/* BTMS Admin — la consola central de módulos.
   Misma familia que BTMS Connect y BTMS Frigo (tema Cupertino): azul de marca #22407e,
   grises de Apple, materiales translúcidos, títulos grandes, listas agrupadas.
   Tokens en :root; el modo oscuro los redefine. Nada de colores sueltos en los componentes.
   Escritorio con barra lateral; iPad y teléfono con barra superior y una columna. */

@font-face { font-family: "Geist"; src: url("../fonts/geist-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --brand: #22407e; --brand-2: #3461b8; --brand-ink: #ffffff;
  --brand-soft: rgba(34, 64, 126, .09); --brand-tint: #2d56a6;
  --bg: #f2f2f7; --surface: #ffffff; --surface-2: #f7f7fa; --raised: #ffffff;
  --ink: #1d1d1f; --ink-2: #48484d; --ink-3: #86868b; --ink-4: #aeaeb2;
  --sep: rgba(60, 60, 67, .16);
  --fill: rgba(118, 118, 128, .12); --fill-2: rgba(118, 118, 128, .2);
  --ok: #1e8a4f; --ok-dot: #30b15c; --ok-soft: #e6f5ec;
  --warn: #a15c00; --warn-dot: #f5a524; --warn-soft: #fdf1dd;
  --bad: #d1302b; --bad-dot: #ff3b30; --bad-soft: #fdecea;
  --info: #1f64c8; --info-soft: #e8f0fc;
  --switch-on: #34c759; --knob: #ffffff;
  --violet: #6e4bd8; --graphite: #5b5b63;
  --bar: rgba(249, 249, 251, .78); --bar-line: rgba(0, 0, 0, .12);
  --scrim: rgba(0, 0, 0, .32);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .05);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .05), 0 18px 40px rgba(0, 0, 0, .12);
  --shadow-sheet: 0 24px 80px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .08);
  --r-l: 18px; --r-m: 14px; --r-s: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Geist", "Helvetica Neue", Arial, sans-serif;
  --font-d: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #8aa9ff; --brand-2: #b3c7ff; --brand-ink: #0b1224; --brand-soft: rgba(138, 169, 255, .14); --brand-tint: #8aa9ff;
    --bg: #000000; --surface: #1c1c1e; --surface-2: #232326; --raised: #2c2c2e;
    --ink: #f5f5f7; --ink-2: #d1d1d6; --ink-3: #98989f; --ink-4: #636366;
    --sep: rgba(84, 84, 88, .55); --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .34);
    --ok: #3fd07f; --ok-dot: #30d158; --ok-soft: rgba(48, 209, 88, .14);
    --warn: #ffb340; --warn-dot: #ffb340; --warn-soft: rgba(255, 179, 64, .14);
    --bad: #ff6961; --bad-dot: #ff453a; --bad-soft: rgba(255, 105, 97, .15);
    --info: #64a8ff; --info-soft: rgba(100, 168, 255, .14);
    --switch-on: #30d158; --knob: #ffffff;
    --violet: #a48bff; --graphite: #8e8e93;
    --bar: rgba(22, 22, 24, .74); --bar-line: rgba(255, 255, 255, .1);
    --scrim: rgba(0, 0, 0, .55);
    --shadow-1: 0 0 0 .5px rgba(255, 255, 255, .06);
    --shadow-2: 0 0 0 .5px rgba(255, 255, 255, .08), 0 18px 40px rgba(0, 0, 0, .5);
    --shadow-sheet: 0 0 0 .5px rgba(255, 255, 255, .1), 0 24px 80px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #8aa9ff; --brand-2: #b3c7ff; --brand-ink: #0b1224; --brand-soft: rgba(138, 169, 255, .14); --brand-tint: #8aa9ff;
  --bg: #000000; --surface: #1c1c1e; --surface-2: #232326; --raised: #2c2c2e;
  --ink: #f5f5f7; --ink-2: #d1d1d6; --ink-3: #98989f; --ink-4: #636366;
  --sep: rgba(84, 84, 88, .55); --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .34);
  --ok: #3fd07f; --ok-dot: #30d158; --ok-soft: rgba(48, 209, 88, .14);
  --warn: #ffb340; --warn-dot: #ffb340; --warn-soft: rgba(255, 179, 64, .14);
  --bad: #ff6961; --bad-dot: #ff453a; --bad-soft: rgba(255, 105, 97, .15);
  --info: #64a8ff; --info-soft: rgba(100, 168, 255, .14);
  --switch-on: #30d158; --knob: #ffffff;
  --violet: #a48bff; --graphite: #8e8e93;
  --bar: rgba(22, 22, 24, .74); --bar-line: rgba(255, 255, 255, .1);
  --scrim: rgba(0, 0, 0, .55);
  --shadow-1: 0 0 0 .5px rgba(255, 255, 255, .06);
  --shadow-2: 0 0 0 .5px rgba(255, 255, 255, .08), 0 18px 40px rgba(0, 0, 0, .5);
  --shadow-sheet: 0 0 0 .5px rgba(255, 255, 255, .1), 0 24px 80px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 15px/1.42 var(--font); letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; letter-spacing: inherit; }
input, textarea, select { font: inherit; letter-spacing: inherit; color: var(--ink); }
a { color: var(--brand-tint); text-decoration: none; }
svg { display: block; }
.i { width: 20px; height: 20px; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand-tint) 45%, transparent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- esqueleto */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.lateral {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px 14px; z-index: 30;
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  box-shadow: .5px 0 0 var(--bar-line);
}
.marca { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: var(--ink); }
.sello {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: linear-gradient(160deg, var(--brand-2), var(--brand)); color: var(--brand-ink); box-shadow: var(--shadow-1);
}
.sello svg { width: 22px; height: 22px; }
.marca b { display: block; font: 650 15px/1.15 var(--font-d); letter-spacing: -.02em; }
.marca > span:not(.sello) > span { display: block; font-size: 12px; color: var(--ink-3); letter-spacing: -.005em; }
.lateral nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.lateral nav a {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 9px;
  color: var(--ink); font-size: 14px; font-weight: 500; transition: background .15s;
}
.lateral nav a .i { color: var(--brand-tint); width: 19px; height: 19px; }
.lateral nav a:hover { background: var(--fill); }
.lateral nav a.on { background: var(--brand-soft); color: var(--brand-tint); font-weight: 600; }
.lateral nav a .n { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; font-weight: 500; }
.pie-lat { border-top: .5px solid var(--sep); padding: 12px 6px 0; display: flex; flex-direction: column; gap: 10px; }
.yo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.yo .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); color: var(--ink-2); font-weight: 600; font-size: 13px; flex: none; }
.yo b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yo span { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yo > div { min-width: 0; }
.link { border: 0; background: none; padding: 0; cursor: pointer; color: var(--brand-tint); font-size: 13px; font-weight: 500; text-align: left; }

.principal { min-width: 0; }
.barra-movil { display: none; }
.contenido { max-width: 1180px; padding: 34px 40px 72px; }

/* ---------------------------------------------------------------- encabezados */
.volver { display: inline-flex; align-items: center; gap: 2px; color: var(--brand-tint); font-size: 14px; font-weight: 500; border: 0; background: none; cursor: pointer; padding: 6px 8px 6px 0; margin: -6px 0 6px; border-radius: 8px; }
.volver .i { width: 18px; height: 18px; }
.cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.cabecera h1 { margin: 0; font: 700 32px/1.1 var(--font-d); letter-spacing: -.028em; overflow-wrap: anywhere; }
.cabecera .sub { margin-top: 6px; font-size: 14.5px; color: var(--ink-3); max-width: 72ch; }
.cabecera .acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.cabecera .titulo { min-width: 0; }

/* ---------------------------------------------------------------- controles */
.btn {
  height: 34px; padding: 0 15px; border: 0; border-radius: 17px; background: var(--fill); color: var(--brand-tint);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: transform .2s var(--ease-out), opacity .2s, filter .2s; user-select: none; -webkit-user-select: none;
}
.btn .i { width: 17px; height: 17px; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.97); opacity: .85; transition: none; }
.btn.pri { background: var(--brand); color: var(--brand-ink); }
.btn.peligro { background: var(--bad-soft); color: var(--bad); }
.btn.peligro-lleno { background: var(--bad); color: #fff; }
.btn.ok { background: var(--ok-soft); color: var(--ok); }
.btn.suave { background: var(--surface); box-shadow: var(--shadow-1); }
.btn.grande { height: 46px; border-radius: 23px; font-size: 16px; padding: 0 22px; }
.btn.ancho { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.entrada, .sel select {
  height: 38px; width: 100%; border: 0; border-radius: 10px; background: var(--fill); padding: 0 12px; font-size: 15px; color: var(--ink);
  outline: none; transition: box-shadow .15s, background .15s; -webkit-appearance: none; appearance: none;
}
textarea.entrada { height: auto; min-height: 80px; padding: 9px 12px; resize: vertical; line-height: 1.4; }
.entrada:focus, .sel select:focus { background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft), 0 0 0 1px var(--brand-tint); }
.entrada::placeholder { color: var(--ink-4); }
.sel { position: relative; display: block; }
.sel select { padding-right: 32px; cursor: pointer; }
.sel .i { position: absolute; right: 10px; top: 10px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > label, .campo > .l { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.campo .ayuda { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.form { display: flex; flex-direction: column; gap: 16px; }

.busca { position: relative; flex: 1 1 260px; max-width: 340px; min-width: 0; }
.busca .i { position: absolute; left: 11px; top: 10px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.busca input { padding-left: 36px; }
.herramientas { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

.segmentado { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmentado::-webkit-scrollbar { display: none; }
.segmentado button {
  height: 28px; border: 0; background: none; border-radius: 7px; cursor: pointer; padding: 0 12px;
  font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; transition: background .2s;
}
.segmentado button.on { background: var(--raised); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 .5px 1px rgba(0, 0, 0, .1); }
:root[data-theme="dark"] .segmentado button.on { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmentado button.on { background: #636366; } }
.segmentado button .n { color: var(--ink-3); font-variant-numeric: tabular-nums; margin-left: 4px; font-weight: 500; }

/* el interruptor de iOS */
.switch {
  position: relative; width: 51px; height: 31px; flex: none; border: 0; border-radius: 16px; padding: 0; cursor: pointer;
  background: var(--fill-2); transition: background .25s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: var(--knob);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .3s var(--ease);
}
.switch[aria-checked="true"] { background: var(--switch-on); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch:disabled { cursor: default; opacity: .6; }
.switch:disabled::after { background: var(--knob); }
.switch.ocupado::after { animation: latido .8s ease-in-out infinite alternate; }
@keyframes latido { to { box-shadow: 0 0 0 4px color-mix(in srgb, var(--switch-on) 35%, transparent); } }

/* ---------------------------------------------------------------- tarjetas */
.caja { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-1); padding: 20px 22px; min-width: 0; }
.caja.sin-pad { padding: 0; overflow: hidden; }
.caja > .cab { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.caja.sin-pad > .cab { padding: 18px 22px 0; margin-bottom: 8px; }
.caja > .cab h2 { margin: 0; font: 600 17px/1.25 var(--font-d); letter-spacing: -.02em; }
.caja > .cab .s { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.caja .pie { font-size: 12.5px; color: var(--ink-3); margin-top: 12px; line-height: 1.45; }
.caja.sin-pad .pie { padding: 0 22px 16px; margin-top: 4px; }
.pila > * + * { margin-top: 18px; }
.ficha-grilla { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ficha-grilla > .col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-1); padding: 14px 16px 13px; display: flex; flex-direction: column; gap: 5px; border: 0; text-align: left; cursor: pointer; transition: transform .2s var(--ease-out); }
.kpi:active { transform: scale(.98); }
.kpi .l { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.kpi .v { font: 650 28px/1 var(--font-d); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12.5px; color: var(--ink-3); }
.punto { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-4); }
.punto.ok { background: var(--ok-dot); } .punto.warn { background: var(--warn-dot); } .punto.bad { background: var(--bad-dot); } .punto.gris { background: var(--ink-4); }

/* ---------------------------------------------------------------- listas */
.lista { list-style: none; margin: 0; padding: 0; }
.fila {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 12px 22px; width: 100%;
  border: 0; background: none; text-align: left; color: var(--ink); transition: background .15s;
}
a.fila, button.fila { cursor: pointer; }
a.fila:hover, button.fila:hover { background: color-mix(in srgb, var(--fill) 55%, transparent); }
a.fila:active, button.fila:active { background: var(--fill); transition: none; }
.lista > li + li > .fila::before, .fila + .fila::before { content: ""; position: absolute; top: 0; right: 0; left: var(--sep-l, 22px); border-top: .5px solid var(--sep); }
.fila .cuerpo { flex: 1; min-width: 0; }
.fila .t { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila .t.normal { font-weight: 450; }
.fila .s { display: block; font-size: 13px; color: var(--ink-3); margin-top: 1px; line-height: 1.35; }
.fila .chev { width: 16px; height: 16px; color: var(--ink-4); flex: none; }
.fila .lado { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; text-align: right; }
.fila .lado .s { margin: 0; white-space: nowrap; }
.mono {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--brand-soft); color: var(--brand-tint); font: 650 14px/1 var(--font-d); letter-spacing: -.01em;
}
.mono.warn { background: var(--warn-soft); color: var(--warn); }
.mono.bad { background: var(--bad-soft); color: var(--bad); }
.grupo-mod { padding: 4px 0 6px; }
.grupo-mod + .grupo-mod { border-top: .5px solid var(--sep); }
.grupo-mod > h3 { margin: 0; padding: 14px 22px 4px; font: 600 12px/1.2 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); display: flex; justify-content: space-between; gap: 10px; }
.grupo-mod > h3 span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.fila.modulo { min-height: 50px; padding-top: 9px; padding-bottom: 9px; }
.fila.modulo .t { font-weight: 500; white-space: normal; }
.nucleo-items { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 22px 12px; }

.etiqueta { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; background: var(--fill); color: var(--ink-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.etiqueta.ok { background: var(--ok-soft); color: var(--ok); }
.etiqueta.warn { background: var(--warn-soft); color: var(--warn); }
.etiqueta.bad { background: var(--bad-soft); color: var(--bad); }
.etiqueta.azul { background: var(--brand-soft); color: var(--brand-tint); }
.etiqueta.chica { height: 22px; font-size: 12px; font-weight: 500; padding: 0 9px; }
.aviso-txt { color: var(--warn); }
.tenue { color: var(--ink-3); }

/* pares dato-valor */
.datos { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 16px; font-size: 14px; }
.datos dt { color: var(--ink-3); }
.datos dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pie.notas { white-space: pre-wrap; color: var(--ink-2); font-size: 14px; }
.pila-top { margin-top: 18px; }
.acciones-caja { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* el aviso de la suspensión */
.banda { display: flex; gap: 14px; align-items: flex-start; border-radius: var(--r-l); padding: 16px 18px; margin-bottom: 18px; }
.banda.warn { background: var(--warn-soft); color: var(--warn); }
.banda.bad { background: var(--bad-soft); color: var(--bad); }
.banda .i { width: 24px; height: 24px; margin-top: 1px; }
.banda b { display: block; font-size: 15px; color: inherit; }
.banda p { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.banda .cuerpo { flex: 1; min-width: 0; }
.banda .btn { flex: none; align-self: center; }

/* el historial */
.historial { list-style: none; margin: 0; padding: 4px 0 8px; }
.historial li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 12px 22px; position: relative; }
.historial li + li::before { content: ""; position: absolute; top: 0; right: 0; left: 64px; border-top: .5px solid var(--sep); }
.historial .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--fill); color: var(--ink-2); }
.historial .ic .i { width: 17px; height: 17px; }
.historial .ic.ok { background: var(--ok-soft); color: var(--ok); }
.historial .ic.bad { background: var(--bad-soft); color: var(--bad); }
.historial .ic.azul { background: var(--brand-soft); color: var(--brand-tint); }
.historial .ic.warn { background: var(--warn-soft); color: var(--warn); }
.historial .d { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.historial .m { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.historial .cambio { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.historial .cambio code { font: 12px/1.4 var(--mono); background: var(--fill); border-radius: 6px; padding: 2px 6px; overflow-wrap: anywhere; }
.historial .cambio .flecha { color: var(--ink-4); }

.vacio { text-align: center; padding: 48px 24px; color: var(--ink-3); }
.vacio > .i { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--ink-4); }
.vacio b { display: block; color: var(--ink); font: 600 17px/1.3 var(--font-d); margin-bottom: 4px; }
.vacio p { margin: 0 auto 16px; max-width: 46ch; font-size: 14px; }

.codigo {
  font: 12.5px/1.5 var(--mono); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin: 0;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); max-height: 52vh; overflow: auto; box-shadow: inset 0 0 0 .5px var(--sep);
}
.clave-una-vez { font: 600 14px/1.45 var(--mono); background: var(--surface-2); border-radius: 12px; padding: 14px; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; box-shadow: inset 0 0 0 .5px var(--sep); }

/* ---------------------------------------------------------------- hojas (dialog) */
dialog.hoja {
  border: 0; padding: 0; background: var(--surface); color: var(--ink); border-radius: 20px; box-shadow: var(--shadow-sheet);
  width: min(540px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: hidden;
}
dialog.hoja.ancha { width: min(720px, calc(100vw - 32px)); }
dialog.hoja::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
dialog.hoja[open] { animation: hoja-entra .32s var(--ease); display: flex; flex-direction: column; }
@keyframes hoja-entra { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.hoja .hcab { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 14px 16px 10px; border-bottom: .5px solid var(--sep); }
.hoja .hcab h2 { margin: 0; font: 600 16px/1.2 var(--font-d); letter-spacing: -.015em; text-align: center; grid-column: 2; }
.hoja .hcab .izq { justify-self: start; }
.hoja .hcab .der { justify-self: end; }
.hoja .hcuerpo { padding: 18px 22px 22px; overflow-y: auto; }
.hoja .hcuerpo > p { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.hoja .hpie { display: flex; gap: 10px; justify-content: flex-end; padding: 0 22px 20px; flex-wrap: wrap; }
.boton-texto { border: 0; background: none; color: var(--brand-tint); font-size: 15px; cursor: pointer; padding: 6px 4px; }
.boton-texto.fuerte { font-weight: 600; }

.paquetes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.paquete { border: 0; text-align: left; cursor: pointer; border-radius: 14px; padding: 13px 14px; background: var(--fill); color: var(--ink); box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .15s, background .15s; }
.paquete b { display: block; font-size: 15px; }
.paquete span { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.35; }
.paquete[aria-checked="true"] { background: var(--brand-soft); box-shadow: inset 0 0 0 1.5px var(--brand-tint); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; z-index: 100;
  background: var(--ink); color: var(--bg); border-radius: 14px; padding: 11px 16px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-2);
  transition: opacity .25s, transform .35s var(--ease); pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.in { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--bad); color: #fff; }

/* ---------------------------------------------------------------- ingreso */
.ingreso { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px calc(32px + var(--safe-b));
  background:
    radial-gradient(60% 50% at 10% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
    radial-gradient(50% 40% at 100% 100%, color-mix(in srgb, var(--violet) 9%, transparent), transparent 70%),
    var(--bg); }
.ingreso .tarjeta { width: min(400px, 100%); background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-2); padding: 34px 28px 28px; text-align: center; }
.ingreso .icono { width: 72px; height: 72px; border-radius: 17px; margin: 0 auto 16px; box-shadow: var(--shadow-1); overflow: hidden; }
.ingreso .icono img { width: 100%; height: 100%; display: block; }
.ingreso h1 { margin: 0; font: 700 26px/1.15 var(--font-d); letter-spacing: -.025em; }
.ingreso .sub { margin: 6px 0 24px; color: var(--ink-3); font-size: 14.5px; }
.ingreso .form { text-align: left; margin-bottom: 18px; }
.ingreso .nota { margin: 16px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.ingreso .error { margin: 12px 0 0; font-size: 13.5px; color: var(--bad); }
.cargando { min-height: 100vh; display: grid; place-items: center; color: var(--ink-3); font-size: 14px; }

/* ---------------------------------------------------------------- iPad y teléfono */
@media (max-width: 1023px) {
  .shell { display: block; }
  .lateral { display: none; }
  .barra-movil {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 30;
    padding: calc(10px + var(--safe-t)) 20px 10px; background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 .5px 0 var(--bar-line);
  }
  .barra-movil .marca { padding: 0; }
  .barra-movil .marca .sello { width: 30px; height: 30px; border-radius: 8px; }
  .barra-movil .marca .sello svg { width: 19px; height: 19px; }
  .barra-movil nav { display: flex; gap: 4px; }
  .barra-movil nav a, .barra-movil nav button {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 19px; color: var(--brand-tint); border: 0; background: none; cursor: pointer;
  }
  .barra-movil nav a.on { background: var(--brand-soft); }
  .barra-movil nav .i { width: 21px; height: 21px; }
  .contenido { padding: 26px 24px 64px; margin: 0 auto; }
  .ficha-grilla { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .contenido { padding: 18px 16px calc(56px + var(--safe-b)); }
  .barra-movil { padding-left: 16px; padding-right: 12px; }
  .barra-movil .marca > span:not(.sello) > span { display: none; }
  .cabecera { margin-bottom: 16px; gap: 12px; }
  .cabecera h1 { font-size: 28px; }
  .cabecera .acciones { width: 100%; }
  .cabecera .acciones .btn { flex: 1; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
  .kpi .v { font-size: 24px; }
  .herramientas { flex-direction: column; align-items: stretch; }
  .busca { max-width: none; flex: none; }
  .segmentado { display: flex; }
  .segmentado button { flex: 1; padding: 0 8px; }
  .segmentado button .n { display: none; }
  .caja { padding: 16px; border-radius: 16px; }
  .caja.sin-pad > .cab { padding: 16px 16px 0; }
  .caja.sin-pad .pie { padding: 0 16px 14px; }
  .fila { padding: 11px 16px; gap: 12px; }
  .lista > li + li > .fila::before, .fila + .fila::before { left: var(--sep-l, 16px); }
  .grupo-mod > h3 { padding: 14px 16px 4px; }
  .nucleo-items { padding: 2px 16px 12px; }
  .historial li { padding: 11px 16px; }
  .historial li + li::before { left: 58px; }
  .mono { width: 34px; height: 34px; font-size: 13px; }
  .fila.instalacion { align-items: flex-start; }
  .fila.instalacion .lado { display: none; }
  .fila.instalacion .estado-movil { display: flex; }
  .banda { flex-wrap: wrap; padding: 14px 16px; }
  .banda .btn { width: 100%; }
  .paquetes { grid-template-columns: 1fr; }
  dialog.hoja { width: 100vw; max-width: 100vw; max-height: calc(100vh - 40px - var(--safe-t)); margin: auto 0 0; border-radius: 20px 20px 0 0; padding-bottom: var(--safe-b); }
  dialog.hoja[open] { animation: hoja-sube .38s var(--ease); }
  @keyframes hoja-sube { from { transform: translateY(100%); } }
  .hoja .hcuerpo { padding: 16px 16px 20px; }
  .hoja .hpie { padding: 0 16px 18px; }
  .hoja .hpie .btn { flex: 1; }
}
.estado-movil { display: none; flex-wrap: wrap; gap: 6px; margin-top: 7px; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
