/* ADpersonam · layout y componentes */

/* ── Barra superior con la "cinta métrica" ───────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 20px 0;
  background: rgba(25, 25, 27, .92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.top::after { /* la cinta: marcas cada 8px, una más larga cada 40px */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 9px; pointer-events: none; opacity: .4;
  background:
    repeating-linear-gradient(90deg, var(--gold) 0 1px, transparent 1px 40px) bottom / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, var(--gold) 0 1px, transparent 1px 8px) bottom / 100% 4px no-repeat;
}
.marca { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.marca .logo { width: 38px; height: auto; display: block; }
.marca-nombre { font: 800 17px/1 var(--f-titulo); letter-spacing: .1em; }
.marca-nombre span { font-weight: 500; color: var(--gold); letter-spacing: .06em; }

/* Logo: cuerpo crema + pieza champán */
.m-cuerpo { fill: var(--text); }
.m-pieza  { fill: var(--gold); }

/* ── Navegación: abajo en el cel, arriba en laptop ───────────────────── */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(25, 25, 27, .94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.nav a {
  display: grid; place-items: center; align-content: center; gap: 3px;
  text-decoration: none; color: var(--soft); font-size: 12px; font-weight: 500;
  position: relative; transition: color .2s;
}
.nav a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a[aria-current="page"] { color: var(--gold); }
.nav a[aria-current="page"]::before {
  content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; background: var(--gold); border-radius: 0 0 2px 2px;
}

main { padding: 28px 20px calc(var(--nav-h) + var(--safe-b) + 36px); max-width: 1040px; margin: 0 auto; }
.vista { animation: entra .35s ease both; }
/* Solo opacidad: un transform en .vista atraparía a los hijos position:fixed (pie del wizard) */
@keyframes entra { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 820px) {
  .top { padding-left: 32px; padding-right: 32px; }
  .nav {
    position: fixed; top: var(--safe-t); right: 32px; bottom: auto; left: auto; z-index: 21;
    display: flex; align-items: center; gap: 6px; height: var(--top-h); padding: 0;
    background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .nav a { display: flex; flex-direction: row; gap: 8px; padding: 9px 16px; border-radius: 999px; font-size: 14px; }
  .nav a:hover { background: var(--surf); color: var(--text); }
  .nav a[aria-current="page"] { background: var(--surf); }
  .nav a[aria-current="page"]::before { display: none; }
  .nav a svg { width: 18px; height: 18px; }
  main { padding: 52px 32px 64px; }
}

/* ── Botones ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; padding: 0 24px; border: 1px solid transparent; border-radius: 999px;
  font: 700 15px/1 var(--f-titulo); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: transform .15s, background .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-oro { background: var(--gold); color: var(--gold-ink); }
.btn-oro:hover { background: #ECD1A4; }
.btn-linea { background: transparent; border-color: var(--line); color: var(--text); }
.btn-linea:hover { border-color: var(--gold); color: var(--gold); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Inicio ──────────────────────────────────────────────────────────── */
.hero { position: relative; padding: 18px 0 40px; }
.hero h1 { font-size: clamp(38px, 9.5vw, 76px); font-weight: 800; letter-spacing: -.02em; max-width: 12ch; }
.hero p { margin: 20px 0 30px; max-width: 46ch; color: var(--soft); font-size: clamp(16px, 2.2vw, 19px); }
.hero-marca {
  position: absolute; right: -40px; top: -6px; width: min(62vw, 400px); opacity: .1; pointer-events: none; z-index: -1;
}
.hero-marca .m-cuerpo { fill: none; stroke: var(--text); stroke-width: 1.2; }
.hero-marca .m-pieza { fill: var(--gold); }
@media (min-width: 820px) { .hero-marca { right: 0; top: -20px; opacity: .16; } }

.seccion-t { font-size: 20px; font-weight: 700; margin: 34px 0 14px; }
.vacio {
  display: grid; justify-items: start; gap: 6px; padding: 26px 24px;
  background: var(--surf); border: 1px dashed var(--line); border-radius: var(--r-lg);
}
.vacio strong { font: 700 17px/1.2 var(--f-titulo); }
.vacio p { color: var(--soft); font-size: 15px; }

.titulo-vista { font-size: clamp(30px, 6vw, 44px); font-weight: 800; letter-spacing: -.01em; margin-bottom: 8px; }
.sub-vista { color: var(--soft); max-width: 52ch; margin-bottom: 26px; }

/* ── Ajustes ─────────────────────────────────────────────────────────── */
.lista { display: grid; background: var(--surf); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.fila { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; min-height: 64px; }
.fila + .fila { border-top: 1px solid var(--line); }
.fila b { font-weight: 600; display: block; }
.fila small { color: var(--soft); font-size: 13px; }
.segmentos { display: inline-flex; padding: 3px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; }
.segmentos button {
  min-width: 48px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--soft);
  font: 700 13px/1 var(--f-titulo); cursor: pointer; transition: background .2s, color .2s;
}
.segmentos button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); }
.fila .valor { color: var(--soft); font-variant-numeric: tabular-nums; }

.sello { margin-top: 40px; text-align: center; color: var(--soft); font-size: 12px; display: grid; gap: 6px; }
.verso { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--gold); text-shadow: 0 0 9px rgba(227, 195, 141, .55), 0 0 18px rgba(224, 122, 95, .35); }

/* ── Modal y toast propios (nunca alert/confirm nativos) ─────────────── */
.modal-bg {
  position: fixed; inset: 0; z-index: 200; display: grid; align-items: end; justify-items: center;
  background: rgba(8, 8, 9, .66); opacity: 0; transition: opacity .25s;
  padding: 0; overscroll-behavior: contain;
}
.modal-bg.on { opacity: 1; }
.modal {
  width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  background: var(--surf); border: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 28px 24px calc(24px + var(--safe-b)); transform: translateY(24px); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.modal-bg.on .modal { transform: none; }
.modal h2 { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.modal p { color: var(--soft); }
.modal-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; }
.puntos { display: flex; gap: 7px; }
.puntos i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background .2s, width .2s; }
.puntos i.on { background: var(--gold); width: 20px; border-radius: 4px; }
.modal-logo { width: 54px; margin-bottom: 18px; display: block; }
.btn-texto { background: none; border: 0; color: var(--soft); min-height: 44px; padding: 0 10px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; }
.btn-texto:hover { color: var(--text); }
@media (min-width: 820px) {
  .modal-bg { align-items: center; }
  .modal { border-radius: var(--r-lg); transform: translateY(12px); }
}

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 300;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--gold); color: var(--gold-ink); font-weight: 700; font-size: 14px;
  padding: 11px 20px; border-radius: 999px; transition: opacity .25s, transform .25s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 820px) { .toast { bottom: 28px; } }

@media (prefers-reduced-motion: reduce) {
  .vista { animation: none; }
  .modal, .modal-bg, .toast { transition: none; }
}

/* ── Pantalla de entrada (sin sesión) ────────────────────────────────── */
body.sin-sesion .nav { display: none; }
body.sin-sesion main { padding-bottom: 40px; }
.entrada { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 8vh 0 40px; max-width: 420px; margin: 0 auto; }
.entrada-logo { width: 110px; height: auto; margin-bottom: 8px; }
.entrada h1 { font-size: clamp(30px, 7vw, 40px); font-weight: 800; }
.entrada p { color: var(--soft); }
.entrada-btn { margin-top: 10px; min-width: 240px; }
.entrada-btn svg { width: 20px; height: 20px; }
.entrada-aviso { min-height: 1.5em; color: var(--copper) !important; font-weight: 600; font-size: 14px; }
.entrada-ver { font-size: 12px; opacity: .6; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ── Administrador ───────────────────────────────────────────────────── */
.cat-admin { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 18px; }
.cat-admin .btn svg, .adm-ir svg, .adm-sec-t .btn svg, .adm-cat-t .btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.adm-cat-t, .adm-sec-t { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.adm-cat-t .ops-grupo, .adm-sec-t .ops-grupo { margin: 0; }
.adm-cat-t .btn, .adm-sec-t .btn { min-height: 40px; padding: 0 16px; font-size: 13.5px; }
.adm-op { display: grid; gap: 6px; align-content: start; }
.adm-acc { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.adm-acc .btn-texto { min-width: 40px; font-size: 18px; color: var(--gold); justify-content: center; }
.adm-acc .btn { min-height: 38px; padding: 0 16px; font-size: 13px; }
.adm-sec { margin-bottom: 30px; }
.adm-fila .btn { min-height: 40px; padding: 0 16px; font-size: 13.5px; flex: none; }
.adm-fila small { word-break: break-all; }
.adm-ir { margin-bottom: 8px; }
.adm-form { gap: 12px; }
.adm-json { font: 12.5px/1.5 ui-monospace, Consolas, monospace !important; min-height: 180px; white-space: pre; overflow: auto; }
.adm-ayuda { color: var(--soft); font-size: 12.5px; }
.adm-errores ul { margin: 0; padding: 12px 16px 12px 30px; border-radius: 12px; background: rgba(224, 122, 95, .12); border: 1px solid rgba(224, 122, 95, .5); color: var(--copper); font-size: 13.5px; display: grid; gap: 4px; }
.adm-id code { font-size: 12.5px; color: var(--gold); }
.adm-borrar { color: var(--copper) !important; }
.modal .modal-pie > div { display: flex; gap: 6px; align-items: center; }
@media (min-width: 820px) { .modal:has(.adm-form) { max-width: 640px; } }
