/* Nichio · Identidad 1.0 (A · Nicho). Los colores y las formas salen de tokens.css de Identidad. */
:root {
  /* Marca */
  --indigo: #4A3AFF;          /* color de marca: botones, enlaces, logo */
  --indigo-pressed: #3626D9;
  --tinte: #ECEBFF;           /* fondos de realce */
  --tinta: #15132B;           /* texto principal */
  --gris: #5A5A70;            /* texto secundario */
  --fondo: #F6F6FB;
  --superficie: #FFFFFF;
  --linea: #E3E3EE;
  --enlace: #4A3AFF;
  --boton: #4A3AFF;
  --boton-texto: #FFFFFF;

  /* Estados: siempre con punto y palabra */
  --bien: #0B7A3E;      --bien-fondo: #E2F4E9;      --bien-punto: #17A558;
  --atencion: #8A5200;  --atencion-fondo: #FFF0D1;  --atencion-punto: #F0A000;
  --mal: #BF2518;       --mal-fondo: #FCE7E5;       --mal-punto: #E0372A;
  --neutro: #5C6270;    --neutro-fondo: #ECEEF2;    --neutro-punto: #8C93A1;

  /* Tipografía */
  --fuente: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fuente-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --peso-titulo: 700; --peso-subtitulo: 600; --peso-texto: 400;
  --interletra-titulo: -0.04em; --interletra-etiqueta: 0.1em;

  /* Forma */
  --radio-tarjeta: 20px; --radio-boton: 14px; --radio-pastilla: 100px;
  --sombra-tarjeta: 0 24px 50px rgba(10, 10, 30, .12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --tinta: #FFFFFF; --gris: #B9B8CC; --fondo: #0D0C1A; --superficie: #17162A; --linea: #2A2942;
    --tinte: #1F1D3A; --enlace: #9A92FF; --boton: #5B4DFF; --boton-texto: #FFFFFF;
    --bien: #46D98E;     --bien-fondo: rgba(70, 217, 142, .14);     --bien-punto: #46D98E;
    --atencion: #FFC247; --atencion-fondo: rgba(255, 194, 71, .14); --atencion-punto: #FFC247;
    --mal: #FF7468;      --mal-fondo: rgba(255, 116, 104, .15);     --mal-punto: #FF7468;
    --neutro: #A7ADBA;   --neutro-fondo: rgba(167, 173, 186, .14);  --neutro-punto: #A7ADBA;
    --sombra-tarjeta: 0 24px 50px rgba(0, 0, 0, .4);
  }
}
:root[data-tema="oscuro"] {
  --tinta: #FFFFFF; --gris: #B9B8CC; --fondo: #0D0C1A; --superficie: #17162A; --linea: #2A2942;
  --tinte: #1F1D3A; --enlace: #9A92FF; --boton: #5B4DFF; --boton-texto: #FFFFFF;
  --bien: #46D98E;     --bien-fondo: rgba(70, 217, 142, .14);     --bien-punto: #46D98E;
  --atencion: #FFC247; --atencion-fondo: rgba(255, 194, 71, .14); --atencion-punto: #FFC247;
  --mal: #FF7468;      --mal-fondo: rgba(255, 116, 104, .15);     --mal-punto: #FF7468;
  --neutro: #A7ADBA;   --neutro-fondo: rgba(167, 173, 186, .14);  --neutro-punto: #A7ADBA;
  --sombra-tarjeta: 0 24px 50px rgba(0, 0, 0, .4);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--tinta); font: 400 16px/1.5 var(--fuente); -webkit-font-smoothing: antialiased; }
a { color: var(--enlace); text-decoration: none; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--enlace); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
.pagina { max-width: 720px; margin: 0 auto; padding: 0 16px 104px; }

/* ---------- encabezado ---------- */
.cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 10px; }
.marca { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--tinta); }
.marca img { width: 30px; height: 30px; flex: none; }
.marca b { font-weight: 700; letter-spacing: -0.03em; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.etiqueta { font: 600 11px/1 var(--fuente-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gris); }
.titulo { font-weight: 700; font-size: 28px; line-height: 1.12; letter-spacing: -0.04em; margin: 14px 0 6px; }
.bajada { color: var(--gris); font-size: 14.5px; }
.seccion { margin-top: 30px; }
.seccion > h2 { font-weight: 600; font-size: 18px; letter-spacing: -0.02em; margin-bottom: 4px; }
.seccion > .bajada { margin-bottom: 12px; }

/* ---------- estados: siempre punto y palabra ---------- */
.pastilla { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 10px; border-radius: var(--radio-pastilla);
  background: var(--neutro-fondo); color: var(--neutro); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pastilla i { width: 8px; height: 8px; border-radius: 50%; background: var(--neutro-punto); flex: none; }
.pastilla.bien { background: var(--bien-fondo); color: var(--bien); } .pastilla.bien i { background: var(--bien-punto); }
.pastilla.atencion { background: var(--atencion-fondo); color: var(--atencion); } .pastilla.atencion i { background: var(--atencion-punto); }
.pastilla.mal { background: var(--mal-fondo); color: var(--mal); } .pastilla.mal i { background: var(--mal-punto); }
.fila-pastillas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- tarjetas ---------- */
.tarjeta { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio-tarjeta); padding: 18px; margin-top: 12px; }
.tarjeta h3 { font-weight: 600; font-size: 16px; line-height: 1.3; letter-spacing: -0.01em; margin-top: 10px; }
.tarjeta p { color: var(--gris); font-size: 14.5px; margin-top: 6px; }
.tarjeta .sobre { color: var(--tinta); font-weight: 600; font-size: 14.5px; margin-top: 10px; overflow-wrap: anywhere; }
.numeros { font: 500 12.5px/1.5 var(--fuente-mono); color: var(--gris); background: var(--fondo); border-radius: 12px; padding: 10px 12px; margin-top: 10px; overflow-wrap: anywhere; }
.arriba { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cuando { font: 500 12px/1 var(--fuente-mono); color: var(--gris); white-space: nowrap; }
.vacio { color: var(--gris); font-size: 14.5px; padding: 18px; border: 1px dashed var(--linea); border-radius: var(--radio-tarjeta); margin-top: 12px; }
.realce { background: var(--tinte); border-color: transparent; }

/* ---------- botones y formularios ---------- */
.acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.acciones form { flex: 1 1 140px; display: flex; }
.boton { flex: 1; min-height: 48px; padding: 0 18px; border: 0; border-radius: var(--radio-boton); background: var(--boton); color: var(--boton-texto);
  font: 600 15px/1 var(--fuente); cursor: pointer; }
.boton:active { background: var(--indigo-pressed); }
.boton.suave { background: transparent; color: var(--tinta); border: 1.5px solid var(--linea); }
.boton.chico { min-height: 40px; font-size: 14px; flex: none; }
label { display: block; font-weight: 600; font-size: 14px; margin-top: 14px; }
label small { display: block; font-weight: 400; color: var(--gris); margin-top: 2px; }
input[type=text], select { width: 100%; min-height: 48px; margin-top: 6px; padding: 0 14px; border: 1.5px solid var(--linea); border-radius: var(--radio-boton);
  background: var(--superficie); color: var(--tinta); font: 400 16px/1 var(--fuente); }
.aviso { margin-top: 14px; padding: 12px 16px; border-radius: 14px; background: var(--tinte); color: var(--tinta); font-weight: 600; font-size: 14.5px; }
.renglon { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--linea); }
.renglon:first-of-type { border-top: 0; }
.renglon div { min-width: 0; overflow-wrap: anywhere; }
.renglon small { display: block; color: var(--gris); font-size: 13px; }

/* ---------- navegación inferior ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--superficie); border-top: 1px solid var(--linea);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
.nav ul { list-style: none; margin: 0 auto; padding: 0; max-width: 720px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.nav a { display: block; text-align: center; padding: 12px 4px; border-radius: 12px; color: var(--gris); font-weight: 600; font-size: 13.5px; }
.nav a[aria-current=page] { background: var(--tinte); color: var(--enlace); }

/* ---------- entrada ---------- */
.centro { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.centro img { width: 56px; height: 56px; }
.centro .titulo { font-size: 26px; }

/* ---------- panel interno ---------- */
.sin-nav { padding-bottom: 40px; }
.enlace-boton { display: flex; align-items: center; justify-content: center; flex: 1 1 140px; }
a.boton { color: var(--boton-texto); }
a.boton.suave { color: var(--tinta); }
details { margin-top: 14px; border-top: 1px solid var(--linea); padding-top: 12px; }
summary { cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--enlace); }
