/* ==========================================================================
   IMPERIO CAPILAR — Áreas con cuenta: probador IA, mi cuenta, administración
   Se carga después de styles.css y reutiliza sus tokens, botones y campos.
   ========================================================================== */

/* Lo oculto siempre queda oculto, aunque el componente defina su propio display */
.app [hidden] { display: none !important; }

.app { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.app main { flex: 1; }
.app--light { background: var(--ivory); color: var(--text-dark); }

/* ---------- Barra superior ---------- */
.app-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  padding: 14px var(--gutter);
  background: rgba(11, 10, 9, 0.82); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ink-line); color: var(--text-light);
}
.app-nav__links { display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); }
.app-nav__links a { font-size: 13px; font-weight: 500; color: var(--muted-light); transition: color 0.3s; }
.app-nav__links a:hover, .app-nav__links a[aria-current="page"] { color: var(--text-light); }
.app-nav__links a[aria-current="page"] { box-shadow: 0 1px 0 0 var(--gold); }
.app-nav__me {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px 0 6px;
  border: 1px solid var(--ink-line); border-radius: 999px; font-size: 13px; color: var(--text-light);
}
.app-nav__me[hidden] { display: none; }
.app-nav__avatar {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold-grad); color: var(--ink); font-size: 12px; font-weight: 700;
}
@media (max-width: 640px) {
  .app-nav .nav__word { display: none; }
  .app-nav__links a.hide-sm { display: none; }
  .app-nav__me span:not(.app-nav__avatar) { display: none; }
  .app-nav__me { padding: 0 6px; }
}

/* ---------- Encabezado de página ---------- */
.app-head { position: relative; overflow: hidden; padding: clamp(48px, 7vw, 96px) 0 clamp(32px, 5vw, 64px); }
.app-head::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("../img/marmol-oscuro.webp") center / cover; opacity: 0.16;
  -webkit-mask-image: radial-gradient(80% 90% at 70% 0%, #000 10%, transparent 75%);
  mask-image: radial-gradient(80% 90% at 70% 0%, #000 10%, transparent 75%);
}
.app-head__title {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 4.6rem); line-height: 1; letter-spacing: -0.025em; text-wrap: balance;
}
.app-head__title em {
  font-style: italic; background-image: var(--gold-grad); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-inline: 0.06em; margin-inline: -0.06em; animation: shimmer 9s linear infinite;
}
.app-head__lead { margin: 18px 0 0; max-width: 58ch; color: var(--muted-light); }
.app-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; }

/* ---------- Tarjetas ---------- */
.card {
  position: relative; padding: clamp(22px, 3vw, 40px); border-radius: 20px;
  background: #f8f4ed; color: var(--text-dark); border: 1px solid var(--ivory-line);
  box-shadow: 0 30px 80px -44px rgba(0, 0, 0, 0.55);
}
.card--dark { background: var(--ink-2); color: var(--text-light); border-color: var(--ink-line); box-shadow: none; }
.card__title { margin: 0 0 6px; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 2.4vw, 2.2rem); line-height: 1.05; letter-spacing: -0.015em; }
.card__lead { margin: 0 0 22px; font-size: 14.5px; color: var(--muted-dark); }
.card--dark .card__lead { color: var(--muted-light); }
.card .eyebrow { color: var(--gold-lo); }
.card--dark .eyebrow { color: var(--gold); }

.notice {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 14px;
  background: rgba(201, 163, 90, 0.12); border: 1px solid rgba(201, 163, 90, 0.35);
  font-size: 14px; line-height: 1.55;
}
.notice[hidden] { display: none; }
.notice .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--gold); }
.notice b { font-weight: 600; }
.notice code { font-size: 12.5px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.18); }

.spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn[aria-busy="true"] { pointer-events: none; opacity: 0.85; }
.btn:disabled { cursor: not-allowed; opacity: 0.55; }
.btn--line { border: 1px solid currentColor; background: transparent; }
.btn--line:hover { background: rgba(201, 163, 90, 0.12); }
.btn--block { width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap;
  background: var(--ivory-2); color: var(--text-dark);
}
.pill--gold { background: var(--gold); color: var(--ink); }
.pill--dark { background: var(--ink); color: var(--ivory); }
.pill--ok { background: #dfe9d8; color: #2f5a22; }
.pill--warn { background: #f4e2c4; color: #7a4a0c; }
.pill--bad { background: #f2d6cf; color: #8a2f1c; }
.pill--muted { background: transparent; border: 1px solid var(--ivory-line); color: var(--muted-dark); }

/* ---------- Acceso (ingresar / crear cuenta) ---------- */
.auth { display: grid; gap: 20px; }
.auth__title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1.02; letter-spacing: -0.02em; }
.auth__lead { margin: -6px 0 0; color: var(--muted-dark); font-size: 15px; }
.auth__tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--ivory-2); }
.auth__tabs button { height: 42px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted-dark); transition: background-color 0.3s, color 0.3s; }
.auth__tabs button[aria-selected="true"] { background: var(--ink); color: var(--ivory); }
.auth__form { display: grid; gap: 22px; }
.auth__row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.auth__link {
  justify-self: start; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--gold-lo);
  text-decoration: underline; text-underline-offset: 3px;
}
.auth__help { margin: 0; font-size: 14.5px; color: var(--muted-dark); }
.auth__submit { width: 100%; }
.auth__status { margin: 0; font-size: 13.5px; color: var(--muted-dark); min-height: 1.2em; }
.auth__status.is-error { color: #a5452f; }
.auth--done { text-align: left; }
.consent--dark .consent__box { background: transparent; border-color: rgba(236, 212, 157, 0.45); }
.consent--dark .consent__box .icon { color: var(--ink); }
.consent--dark input:checked + .consent__box { background: var(--gold); border-color: var(--gold); }
.consent--dark .consent__text { color: var(--muted-light); }
.consent--dark input:focus-visible + .consent__box { outline-color: var(--gold); }
@media (max-width: 560px) { .auth__row { grid-template-columns: 1fr; } }

/* ---------- Probador ---------- */
.tryon { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(20px, 3vw, 40px); align-items: start; padding-bottom: clamp(64px, 8vw, 120px); }
.tryon__steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.tryon > *, .dash > *, .dash__main > *, .tryon__aside > * { min-width: 0; }
.tryon__aside { position: sticky; top: 90px; display: grid; gap: 18px; }
.step-card { padding: clamp(20px, 2.6vw, 32px); }
.step-card__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.step-card__n { font-family: var(--font-display); font-size: 1.8rem; line-height: 1; color: var(--gold-lo); }
.step-card__title { margin: 0; font-size: 17px; font-weight: 600; }
.step-card__hint { margin: 2px 0 0; font-size: 13.5px; color: var(--muted-dark); }

.drop {
  position: relative; display: grid; place-items: center; gap: 12px; min-height: 240px; padding: 24px;
  border: 1.5px dashed rgba(22, 19, 15, 0.25); border-radius: 16px; background: #fff; text-align: center;
  transition: border-color 0.3s, background-color 0.3s;
}
.drop.is-over { border-color: var(--gold-lo); background: #fffaf1; }
.drop__icon { width: 44px; height: 44px; color: var(--gold-lo); }
.drop__text { margin: 0; font-size: 15px; font-weight: 600; }
.drop__sub { margin: 0; font-size: 13px; color: var(--muted-dark); }
.drop__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop__preview { display: flex; gap: 18px; align-items: center; width: 100%; text-align: left; }
.drop__preview img { width: 120px; height: 150px; object-fit: cover; border-radius: 12px; background: var(--ivory-2); }
.drop__preview p { margin: 0 0 10px; font-size: 14px; color: var(--muted-dark); }
.tips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.tips li { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--ivory-2); font-size: 12.5px; line-height: 1.3; }
.tips .icon { width: 16px; height: 16px; color: var(--gold-lo); }
@media (max-width: 760px) { .tips { grid-template-columns: 1fr 1fr; } }

.models { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 170px); gap: 10px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x mandatory; }
.models::-webkit-scrollbar { height: 6px; }
.models::-webkit-scrollbar-thumb { background: var(--ivory-3); border-radius: 6px; }
.opt { position: relative; scroll-snap-align: start; }
.opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.opt__tile {
  display: grid; gap: 8px; height: 100%; padding: 10px 10px 12px; border-radius: 14px;
  border: 1px solid var(--ivory-line); background: #fff; pointer-events: none;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.4s var(--ease-out);
}
.opt__tile img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 10px; background: #fff; }
.opt__name { font-size: 14px; font-weight: 600; line-height: 1.2; }
.opt__meta { font-size: 12px; color: var(--muted-dark); line-height: 1.35; }
.opt:hover .opt__tile { transform: translateY(-2px); border-color: rgba(22, 19, 15, 0.35); }
.opt input:checked + .opt__tile { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.opt input:focus-visible + .opt__tile { outline: 2px solid var(--gold-lo); outline-offset: 3px; }

.tone-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.tone-pick { position: relative; }
.tone-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.tone-pick__tile { display: grid; justify-items: center; gap: 6px; padding: 8px 4px; border-radius: 12px; border: 1px solid transparent; pointer-events: none; font-size: 11.5px; font-weight: 600; transition: border-color 0.3s, background-color 0.3s; }
.tone-pick__tile img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1); }
.tone-pick:hover .tone-pick__tile { background: #fff; }
.tone-pick input:checked + .tone-pick__tile { background: #fff; border-color: var(--ink); }
.tone-pick input:focus-visible + .tone-pick__tile { outline: 2px solid var(--gold-lo); outline-offset: 2px; }
.tone-readout { margin: 12px 0 0; font-size: 13.5px; color: var(--muted-dark); }
.tone-readout b { color: var(--text-dark); }

.styles-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.styles-pick .pick__tile { flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; font-size: 14px; }
.styles-pick .pick__tile small { font-size: 12px; font-weight: 500; color: var(--muted-dark); }
.styles-pick .pick input:checked + .pick__tile small { color: rgba(242, 237, 228, 0.7); }
@media (max-width: 760px) { .styles-pick { grid-template-columns: 1fr 1fr; } }

.credits { display: flex; align-items: center; gap: 16px; }
.credits__ring { --v: 0; position: relative; width: 64px; height: 64px; flex: none; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--v) * 1turn), rgba(236, 212, 157, 0.14) 0); }
.credits__ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--ink-2); }
.credits__ring b { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.6rem; font-weight: 500; color: var(--gold-hi); }
.credits__text { margin: 0; font-size: 14px; color: var(--muted-light); }
.credits__text b { display: block; font-size: 15px; color: var(--text-light); }

.summary { margin: 0; display: grid; gap: 0; }
.summary div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--ink-line); font-size: 14px; }
.summary dt { color: var(--muted-light); }
.summary dd { margin: 0; text-align: right; font-weight: 600; }

.result { display: grid; gap: 16px; }
.result[hidden] { display: none; }
.result .compare { border-radius: 18px; }
.result__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.result__note { margin: 0; font-size: 12.5px; color: var(--muted-light); line-height: 1.5; }

.working { display: grid; place-items: center; gap: 14px; padding: 36px 20px; text-align: center; }
.working[hidden] { display: none; }
.working__orb { width: 72px; height: 72px; border-radius: 50%; background: conic-gradient(from 0deg, transparent, var(--gold-hi), transparent 60%); animation: spin 1.2s linear infinite; -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%); mask: radial-gradient(circle, transparent 54%, #000 56%); }
.working p { margin: 0; color: var(--muted-light); font-size: 14px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery figure { position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: var(--ivory-2); aspect-ratio: 4 / 5; }
.gallery a { display: block; height: 100%; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; font-size: 11.5px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)); }
.gallery__del { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(11, 10, 9, 0.6); color: #fff; }
.gallery__del .icon { width: 14px; height: 14px; }

@media (max-width: 980px) {
  .tryon { grid-template-columns: 1fr; }
  .tryon__aside { position: static; }
}

/* ---------- Mi cuenta ---------- */
.dash { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; padding-bottom: clamp(64px, 8vw, 120px); }
.dash__side { position: sticky; top: 90px; display: grid; gap: 14px; }
.dash__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(20px, 2.6vw, 32px); }
.me { display: grid; gap: 4px; }
.me__name { margin: 8px 0 0; font-family: var(--font-display); font-size: 1.7rem; line-height: 1.05; }
.me__mail { margin: 0; font-size: 13.5px; color: var(--muted-light); word-break: break-all; }
.dash__nav { display: grid; gap: 2px; margin-top: 10px; }
.dash__nav a { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: var(--muted-light); transition: background-color 0.3s, color 0.3s; }
.dash__nav a:hover { background: rgba(236, 212, 157, 0.08); color: var(--text-light); }
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .dash__side { position: static; }
  .dash__nav { display: flex; overflow-x: auto; gap: 6px; }
  .dash__nav a { white-space: nowrap; border: 1px solid var(--ink-line); }
}

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }
.section-title h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 2.8vw, 2.5rem); line-height: 1; letter-spacing: -0.015em; }

.pcard { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: clamp(18px, 2.4vw, 32px); }
.pcard + .pcard { margin-top: 18px; }
.pcard__media { display: grid; gap: 10px; align-content: start; }
.pcard__media img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 14px; background: #fff; }
.pcard__tone { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.pcard__tone img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.pcard__top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.pcard__name { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 2.6vw, 2.4rem); line-height: 1; }
.pcard__sub { margin: 6px 0 0; font-size: 13.5px; color: var(--muted-dark); }
.pcard__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.stat { padding: 16px; border-radius: 14px; background: #fff; border: 1px solid var(--ivory-line); }
.stat__k { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-dark); }
.stat__v { margin: 0; font-family: var(--font-display); font-size: 1.7rem; line-height: 1.05; }
.stat__s { margin: 6px 0 0; font-size: 12.5px; color: var(--muted-dark); }
.stat--alert { background: #fbf0dc; border-color: #ecd49d; }
.stat--bad { background: #f8e3dd; border-color: #e7b9ab; }
.bar { position: relative; height: 8px; margin-top: 12px; border-radius: 99px; background: var(--ivory-2); overflow: hidden; }
.bar > span { position: absolute; inset: 0 auto 0 0; width: calc(var(--v, 0) * 100%); border-radius: inherit; background: var(--gold-grad-dark); }
.bar--warn > span { background: linear-gradient(90deg, #c9a35a, #c0702c); }
.specs-mini { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; font-size: 13.5px; }
.specs-mini dt { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-dark); }
.specs-mini dd { margin: 2px 0 0; }
.pcard__notes { margin: 18px 0 0; padding: 14px 16px; border-left: 2px solid var(--gold); background: #fff; border-radius: 0 12px 12px 0; font-size: 14px; }
.pcard__ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.timeline { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 10px 0 10px; border-top: 1px dashed var(--ivory-line); font-size: 14px; }
.timeline time { font-size: 12.5px; color: var(--muted-dark); }
.timeline b { font-weight: 600; text-transform: capitalize; }
.timeline p { margin: 2px 0 0; color: var(--muted-dark); font-size: 13px; }
details.more { margin-top: 18px; }
details.more summary { cursor: pointer; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-lo); }
@media (max-width: 640px) {
  .pcard { grid-template-columns: 1fr; }
  .pcard__media { grid-template-columns: 110px 1fr; align-items: center; }
  .pcard__stats { grid-template-columns: 1fr; }
}

.empty { display: grid; justify-items: start; gap: 12px; }
.empty p { margin: 0; color: var(--muted-dark); max-width: 52ch; }

.care { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.care li { display: flex; gap: 12px; padding: 16px; border-radius: 14px; background: #fff; border: 1px solid var(--ivory-line); font-size: 14px; line-height: 1.5; }
.care b { display: block; font-size: 14.5px; }
.care .icon { width: 20px; height: 20px; margin-top: 2px; color: var(--gold-lo); }
@media (max-width: 640px) { .care { grid-template-columns: 1fr; } }

.tbl-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--ivory-line); background: #fff; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { padding: 12px 14px; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-dark); background: var(--ivory-2); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-top: 1px solid var(--ivory-line); vertical-align: middle; }
.tbl tr.is-click { cursor: pointer; transition: background-color 0.2s; }
.tbl tr.is-click:hover { background: #fbf7f0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--ivory-line); }
.tbl .muted { color: var(--muted-dark); font-size: 13px; }
.tbl .strong { font-weight: 600; }
.tbl .gold { color: var(--gold-lo); font-weight: 700; }

.app-foot { padding: 28px 0; border-top: 1px solid var(--ink-line); font-size: 13px; color: var(--muted-light); }
.app-foot .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.app-foot a:hover { color: var(--gold-hi); }

/* ==========================================================================
   Administración
   ========================================================================== */
.admin { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; min-height: 100svh; }
.admin__side {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 24px; padding: 22px 16px;
  background: var(--ink); color: var(--text-light); border-right: 1px solid var(--ink-line);
}
.admin__brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.admin__brand svg { width: 30px; height: auto; aspect-ratio: 214 / 225.5; fill: var(--gold); }
.admin__brand span { font-size: 10px; font-weight: 700; letter-spacing: 0.26em; line-height: 1.4; text-transform: uppercase; }
.admin__nav { display: grid; gap: 2px; }
.admin__nav button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 11px 12px; border-radius: 10px; text-align: left; font-size: 14px; color: var(--muted-light);
  transition: background-color 0.25s, color 0.25s;
}
.admin__nav button:hover { background: rgba(236, 212, 157, 0.07); color: var(--text-light); }
.admin__nav button[aria-current="true"] { background: rgba(201, 163, 90, 0.16); color: var(--gold-hi); }
.admin__nav .count { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--gold); color: var(--ink); font-size: 11px; font-weight: 700; text-align: center; }
.admin__nav .count:empty { display: none; }
.admin__foot { margin-top: auto; display: grid; gap: 8px; padding: 0 8px; font-size: 13px; color: var(--muted-light); }
.admin__foot a, .admin__foot button { text-align: left; color: var(--muted-light); }
.admin__foot a:hover, .admin__foot button:hover { color: var(--gold-hi); }

.admin__main { min-width: 0; padding: clamp(20px, 3vw, 44px) clamp(16px, 3vw, 48px) 80px; background: var(--ivory); color: var(--text-dark); }
.admin__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.admin__title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1; letter-spacing: -0.02em; }
.admin__sub { margin: 6px 0 0; font-size: 14px; color: var(--muted-dark); }
.admin__tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search {
  height: 44px; min-width: 240px; padding: 0 16px 0 40px; border-radius: 999px; border: 1px solid var(--ivory-line);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%2316130f' stroke-width='1.6'/%3E%3Cpath d='M20 20l-4-4' stroke='%2316130f' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") 14px center / 16px no-repeat;
  font: inherit; font-size: 14px;
}
.search:focus { outline: none; border-color: var(--gold-lo); }

.admin__mtop { display: none; }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .admin__side { position: fixed; inset: 0 30% 0 0; z-index: 60; transform: translateX(-102%); transition: transform 0.5s var(--ease-out); height: 100%; }
  .admin.is-menu .admin__side { transform: none; box-shadow: 30px 0 80px rgba(0, 0, 0, 0.5); }
  .admin__mtop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
}

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.tile { padding: 18px; border-radius: 16px; background: #fff; border: 1px solid var(--ivory-line); }
.tile__k { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-dark); }
.tile__v { margin: 8px 0 0; font-family: var(--font-display); font-size: 2.4rem; line-height: 1; }
.tile__s { margin: 6px 0 0; font-size: 12.5px; color: var(--muted-dark); }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1000px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.form { display: grid; gap: 20px; }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form__row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .form__row, .form__row--3 { grid-template-columns: 1fr; } }
.form .field__input { font-size: 15px; }
.form textarea.field__input { min-height: 110px; padding: 12px 14px; border: 1px solid rgba(22, 19, 15, 0.2); border-radius: 12px; background: #fff; resize: vertical; line-height: 1.55; }
.form__help { margin: 6px 0 0; font-size: 12.5px; color: var(--muted-dark); }
.form__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 8px; }
.form__actions .spacer { flex: 1; }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }

.kv { display: grid; gap: 8px; }
.kv__row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) 36px; gap: 8px; }
.kv__row input { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--ivory-line); background: #fff; font: inherit; font-size: 14px; min-width: 0; }
.kv__row input:focus { outline: none; border-color: var(--gold-lo); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--muted-dark); transition: background-color 0.2s, color 0.2s; }
.icon-btn:hover { background: var(--ivory-2); color: var(--text-dark); }
.icon-btn .icon { width: 16px; height: 16px; }
.add-btn { justify-self: start; font-size: 13px; font-weight: 600; color: var(--gold-lo); }

.img-field { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; }
.img-field img { width: 120px; height: 120px; object-fit: contain; border-radius: 14px; background: #fff; border: 1px solid var(--ivory-line); }
.img-field--wide { grid-template-columns: 160px 1fr; }
.img-field--wide img { width: 160px; height: 168px; background: var(--ink); }
.img-field input[type="file"] { font-size: 13px; }

/* Panel lateral de edición */
.sheet-panel { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; }
.sheet-panel[hidden] { display: none; }
.sheet-panel__bg { position: absolute; inset: 0; background: rgba(11, 10, 9, 0.5); animation: fade 0.3s both; }
.sheet-panel__box {
  position: relative; width: min(720px, 100%); height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: clamp(20px, 3vw, 36px); background: var(--ivory); color: var(--text-dark);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.35); animation: slide-in 0.5s var(--ease-out) both;
}
.sheet-panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.sheet-panel__title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.02; }
.sheet-panel__close { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; border: 1px solid var(--ivory-line); }
.sheet-panel__close .icon { width: 18px; height: 18px; }
.sheet-panel h3 { margin: 28px 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-lo); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }

.confirm { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }
.btn--danger { background: #8a2f1c; color: #fff; }
.btn--danger:hover { background: #a5452f; }
.link-danger { font-size: 13px; font-weight: 600; color: #8a2f1c; text-decoration: underline; text-underline-offset: 3px; }

.list { display: grid; gap: 10px; }
.list__item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--ivory-line); }
.list__item b { font-weight: 600; }
.list__item p { margin: 2px 0 0; font-size: 13px; color: var(--muted-dark); }

.toast[data-kind="error"] { background: #8a2f1c; color: #fff; }
.toast[data-kind="ok"] { background: var(--gold); color: var(--ink); }

.gate { display: grid; place-items: center; min-height: 100vh; min-height: 100svh; padding: 24px; background: var(--ink); }
.gate .card { width: min(480px, 100%); }
.gate__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.gate__brand svg { width: 34px; height: auto; aspect-ratio: 214 / 225.5; fill: var(--gold-lo); }
.gate__brand span { font-size: 10.5px; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; }
