/* =========================================================================
   Panel de administración — Classic Lady Kitchen
   ========================================================================= */

.adm-body {
  margin: 0;
  min-height: 100vh;
  background: #faf5ea;
  color: var(--ink);
  font-family: var(--body);
}

/* ---------- Entrada -------------------------------------------------- */

.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
}
.login-card {
  width: min(420px, 100%); background: #fff; border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: 2.4rem 2.2rem; text-align: center; position: relative;
}
.login-card::before { content: ""; position: absolute; inset: 9px; border: 1px solid var(--line); pointer-events: none; }
.login-card .logo { font-family: var(--script); font-size: 2.6rem; color: var(--rosewood); display: block; }
.login-card .eyebrow { margin-bottom: 1.6rem; }
.login-card form { text-align: left; position: relative; }
.hint {
  margin-top: 1.4rem; font-family: var(--util); font-size: .78rem; color: var(--ink-soft);
  background: var(--linen); padding: .7rem .9rem; border-left: 3px solid var(--butter); text-align: left;
}

/* ---------- Estructura ----------------------------------------------- */

.adm-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

.adm-side {
  background: var(--ink); color: #f4ece0; padding: 1.6rem 1.2rem 2rem;
  display: flex; flex-direction: column; gap: 1.6rem;
}
.adm-side .logo {
  font-family: var(--script); font-size: 2rem; color: var(--butter);
  text-decoration: none; display: block; line-height: 1.1;
}
.adm-side .logo small {
  display: block; font-family: var(--util); font-size: .62rem; letter-spacing: .28em;
  text-transform: uppercase; color: #b8a591; margin-top: .4rem;
}
.adm-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.adm-nav a {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem;
  font-family: var(--util); font-size: .88rem; color: #e6dbcb; text-decoration: none; border-radius: var(--radius);
}
.adm-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.adm-nav a.is-active { background: var(--rosewood); color: #fff; }
.adm-side .side-foot { margin-top: auto; font-family: var(--util); font-size: .78rem; color: #b8a591; }
.adm-side .side-foot a { color: var(--butter); }
.linkbtn {
  background: none; border: 0; color: var(--butter); font: inherit; cursor: pointer; padding: 0; text-decoration: underline;
}

.adm-main { padding: 2rem clamp(1rem, 3vw, 2.4rem) 3rem; min-width: 0; }
.adm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; }
.adm-head h1 { font-size: 1.9rem; margin: 0; }
.adm-head p { margin: .3rem 0 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- Paneles y tablas ----------------------------------------- */

.panel { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: 1.4rem 1.5rem; margin-bottom: 1.6rem; }
.panel > h2 { font-size: 1.2rem; margin-top: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.8rem; }
.stat {
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); padding: 1.1rem 1.2rem;
}
.stat strong { display: block; font-family: var(--display); font-size: 2rem; line-height: 1; }
.stat span { font-family: var(--util); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }

table.adm-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.adm-table th {
  text-align: left; font-family: var(--util); font-size: .7rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-soft); padding: .6rem .7rem; border-bottom: 2px solid var(--line);
}
.adm-table td { padding: .75rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm-table tr:hover td { background: #fdfaf3; }
.adm-table .actions { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }

.pill {
  font-family: var(--util); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .2rem .6rem; border-radius: 999px; background: var(--linen); color: var(--ink-soft);
}
.pill--on { background: #e4efe1; color: #46663d; }
.pill--off { background: #f6e2e5; color: var(--rosewood-dark); }

/* ---------- Formularios ---------------------------------------------- */

.field { margin-bottom: 1.1rem; }
.field label, .field-label {
  display: block; font-family: var(--util); font-size: .74rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: .35rem;
}
.field input[type="text"], .field input[type="password"], .field input[type="number"],
.field input[type="search"], .field select, .field textarea {
  width: 100%; font-family: var(--body); font-size: .97rem; color: var(--ink);
  padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fffdf8;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field .help { font-family: var(--util); font-size: .76rem; color: var(--ink-soft); margin: .35rem 0 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.1rem; }
.check { display: flex; align-items: center; gap: .55rem; font-family: var(--util); font-size: .9rem; margin-bottom: .6rem; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--rosewood); }

.form-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.6rem; align-items: start; }
.sticky-col { position: sticky; top: 1.5rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-top: 1.2rem; }

/* ---------- Editor de recetas ---------------------------------------- */

.editor { border: 1px solid var(--line); border-radius: var(--radius); background: #fffdf8; overflow: hidden; }
.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: .2rem; padding: .4rem; background: var(--linen); border-bottom: 1px solid var(--line);
}
.editor-toolbar button {
  font-family: var(--util); font-size: .8rem; min-width: 2rem; padding: .35rem .55rem;
  background: #fff; border: 1px solid var(--line); border-radius: 3px; cursor: pointer; color: var(--ink);
}
.editor-toolbar button:hover { background: var(--butter); }
.editor-toolbar .sep { width: 1px; background: var(--line); margin: .2rem .35rem; }
.editor-toolbar .is-media { background: var(--sage); border-color: var(--sage); color: #fff; }
.editor-toolbar .is-media:hover { background: #6b8664; }
.editor-area {
  min-height: 380px; padding: 1.2rem 1.3rem; font-family: var(--body); font-size: 1rem; line-height: 1.7;
  outline: none;
}
.editor-area:focus { background: #fff; }
.editor-area img, .editor-area video { max-width: 100%; height: auto; border: 1px solid var(--line); padding: 4px; background: #fff; }
.editor-area blockquote { border-left: 3px solid var(--butter); margin-left: 0; padding-left: 1rem; color: var(--ink-soft); }

/* ---------- Biblioteca multimedia ------------------------------------ */

.dropzone {
  border: 2px dashed var(--line); background: #fffdf8; padding: 2rem 1.5rem; text-align: center; border-radius: var(--radius);
}
.dropzone.is-over { border-color: var(--sage); background: #f2f7f0; }
.dropzone p { font-family: var(--util); color: var(--ink-soft); margin: .4rem 0 1rem; font-size: .9rem; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.1rem; }
.media-item { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.media-thumb {
  aspect-ratio: 4 / 3; background: var(--linen); display: grid; place-items: center; overflow: hidden;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb .ext {
  font-family: var(--util); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft);
}
.media-meta { padding: .7rem .8rem; font-family: var(--util); font-size: .76rem; color: var(--ink-soft); }
.media-meta .name { color: var(--ink); word-break: break-all; display: block; margin-bottom: .3rem; }
.media-actions { display: flex; gap: .35rem; padding: 0 .8rem .8rem; margin-top: auto; flex-wrap: wrap; }
.media-actions input[type="text"] { flex: 1; min-width: 0; font-size: .78rem; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 3px; }

/* Selector modal de multimedia */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; background: rgba(64, 51, 43, .55); z-index: 300;
  display: grid; place-items: center; padding: 1.5rem;
}
.modal-card {
  background: var(--porcelain); width: min(880px, 100%); max-height: 86vh; display: flex; flex-direction: column;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.3rem; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.25rem; }
.modal-filters { display: flex; gap: .4rem; padding: .8rem 1.3rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.modal-filters button {
  font-family: var(--util); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .35rem .9rem; border: 1px solid var(--line); background: #fff; border-radius: 999px; cursor: pointer;
}
.modal-filters button.is-active { background: var(--rosewood); border-color: var(--rosewood); color: #fff; }
.modal-grid { padding: 1.2rem 1.3rem; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
.pick {
  border: 1px solid var(--line); background: #fff; padding: 0; cursor: pointer; text-align: left;
}
.pick:hover { border-color: var(--rosewood); box-shadow: var(--shadow-sm); }
.pick .thumb { aspect-ratio: 4 / 3; background: var(--linen); display: grid; place-items: center; overflow: hidden; }
.pick .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pick .cap { font-family: var(--util); font-size: .72rem; padding: .45rem .55rem; color: var(--ink-soft); word-break: break-all; }
.modal-empty { padding: 2.5rem; text-align: center; font-family: var(--util); color: var(--ink-soft); }

.cover-preview { border: 1px solid var(--line); background: #fffdf8; padding: 8px; margin-bottom: .6rem; }
.cover-preview img { display: block; width: 100%; }

@media (max-width: 980px) {
  .adm-shell { grid-template-columns: 1fr; }
  .adm-side { flex-direction: column; }
  .adm-nav { flex-direction: row; flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .sticky-col { position: static; }
}
