/* Panel OjoProp — colores provisorios (verde petróleo + ámbar). Contrastes AA verificados. */
:root {
  --fondo: #f4f6f5;
  --superficie: #ffffff;
  --texto: #1b2422;
  --texto-suave: #4a5652;
  --borde: #cfd8d5;
  --primario: #0f5c55;
  --primario-hover: #0b4843;
  --sobre-primario: #ffffff;
  --acento: #fbbf24;
  --barra: #0f2e2b;
  --sobre-barra: #f1f5f4;
  --foco: #b45309;
  --error-fondo: #fdecec; --error-texto: #8a1c1c;
  --ok-fondo: #e6f4ec; --ok-texto: #1d5a35;
  --radio: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fondo: #111917; --superficie: #1a2421; --texto: #e7eeec; --texto-suave: #a9b7b2; --borde: #33433e;
    --primario: #4fb3a6; --primario-hover: #6cc6ba; --sobre-primario: #0b1a18;
    --barra: #0a1311; --sobre-barra: #e7eeec; --foco: #fbbf24;
    --error-fondo: #3a1717; --error-texto: #ffb4b4; --ok-fondo: #15301f; --ok-texto: #a6e3bd;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fondo: #111917; --superficie: #1a2421; --texto: #e7eeec; --texto-suave: #a9b7b2; --borde: #33433e;
  --primario: #4fb3a6; --primario-hover: #6cc6ba; --sobre-primario: #0b1a18;
  --barra: #0a1311; --sobre-barra: #e7eeec; --foco: #fbbf24;
  --error-fondo: #3a1717; --error-texto: #ffb4b4; --ok-fondo: #15301f; --ok-texto: #a6e3bd;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; background: var(--fondo); color: var(--texto); font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--primario); }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 .6rem; color: var(--texto-suave); }
.saltar { position: absolute; left: -9999px; top: 0; background: var(--acento); color: #1b1300; padding: .6rem 1rem; z-index: 100; font-weight: 600; }
.saltar:focus { left: 1rem; top: 1rem; }
.solo-lector { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* marca */
.marca { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.15rem; color: inherit; text-decoration: none; letter-spacing: .01em; }
.marca-ojo { width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 3px solid var(--acento); position: relative; flex: none; }
.marca-ojo::after { content: ""; position: absolute; inset: 30%; border-radius: 50%; background: currentColor; }
.marca-grande { font-size: 1.5rem; margin: 0 0 1.25rem; color: var(--primario); }

/* armazón */
.marco { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
.barra { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; background: var(--barra); color: var(--sobre-barra); padding: .6rem 1rem; }
.barra-usuario { margin-left: auto; font-size: .95rem; }
.barra-salir { margin: 0; }
.barra .boton-suave { color: var(--sobre-barra); border-color: rgba(255,255,255,.35); background: transparent; }
.barra .boton-suave:hover { background: rgba(255,255,255,.1); }
.menu-boton { display: none; background: none; border: 0; color: inherit; padding: .35rem; cursor: pointer; min-width: 44px; min-height: 44px; }
.menu-boton svg, .menu svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu { background: var(--superficie); border-right: 1px solid var(--borde); padding: 1rem .6rem; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu a { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: 8px; color: var(--texto); text-decoration: none; font-weight: 500; min-height: 44px; }
.menu a:hover { background: var(--fondo); }
.menu a[aria-current="page"] { background: var(--primario); color: var(--sobre-primario); }
.contenido { padding: 1.75rem 2rem 3rem; max-width: 1100px; width: 100%; }
.contenido:focus { outline: none; }
.bajada { color: var(--texto-suave); margin: 0 0 1.25rem; max-width: 65ch; }
.nota { color: var(--texto-suave); font-size: .9rem; }

/* tarjetas */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; }
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem 1.1rem; }
.tarjeta-titulo { margin: 0; color: var(--texto-suave); font-size: .9rem; }
.tarjeta-valor { margin: .2rem 0 0; font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tarjeta-nota { margin: .1rem 0 0; color: var(--texto-suave); font-size: .82rem; }

/* datos y tablas */
.datos { display: grid; gap: 0; margin: 0 0 1.5rem; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); max-width: 700px; }
.datos > div { display: grid; grid-template-columns: 12rem 1fr; gap: 1rem; padding: .7rem 1rem; border-top: 1px solid var(--borde); }
.datos > div:first-child { border-top: 0; }
.datos dt { color: var(--texto-suave); }
.datos dd { margin: 0; font-weight: 500; }
.tabla-envoltura { overflow-x: auto; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th, .tabla td { text-align: left; padding: .65rem .9rem; border-top: 1px solid var(--borde); vertical-align: middle; }
.tabla thead th { border-top: 0; color: var(--texto-suave); font-weight: 600; font-size: .9rem; }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* formularios y botones */
.campo { margin-bottom: 1rem; }
.campo label { display: block; font-weight: 600; margin-bottom: .35rem; }
.campo input { width: 100%; font: inherit; padding: .7rem .8rem; border: 1px solid var(--texto-suave); border-radius: 8px; background: var(--superficie); color: var(--texto); min-height: 44px; }
.campo input[aria-invalid="true"] { border-color: var(--error-texto); }
.ayuda { margin: .3rem 0 0; color: var(--texto-suave); font-size: .88rem; }
.formulario { max-width: 420px; }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; padding: .6rem 1.1rem; border-radius: 8px; border: 1px solid transparent; cursor: pointer; text-decoration: none; min-height: 44px; }
.boton-principal { background: var(--primario); color: var(--sobre-primario); }
.boton-principal:hover { background: var(--primario-hover); }
.boton-suave { background: var(--superficie); color: var(--primario); border-color: var(--borde); }
.boton-suave:hover { border-color: var(--primario); }
.boton-ancho { width: 100%; }
.aviso { padding: .75rem 1rem; border-radius: 8px; margin: 0 0 1rem; font-weight: 500; }
.aviso-error { background: var(--error-fondo); color: var(--error-texto); }
.aviso-ok { background: var(--ok-fondo); color: var(--ok-texto); }

/* entrar */
.entrar { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 16px; background: linear-gradient(160deg, var(--barra) 0 38%, var(--fondo) 38%); }
.entrar-caja { width: 100%; max-width: 400px; background: var(--superficie); border: 1px solid var(--borde); border-radius: 14px; padding: 2rem 1.75rem; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.entrar-caja h1 { font-size: 1.3rem; margin-bottom: 1.25rem; }

/* celular */
@media (max-width: 760px) {
  .marco { grid-template-columns: minmax(0, 1fr); }
  .tabla thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
  .tabla tr { padding: .8rem .9rem; border-top: 1px solid var(--borde); display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; }
  .tabla tbody tr:first-child { border-top: 0; }
  .tabla td { border: 0; padding: 0; width: auto; }
  .tabla td:first-child { grid-column: 1 / -1; font-weight: 600; }
  .tabla td.num { text-align: left; color: var(--texto-suave); font-size: .9rem; }
  .tabla td:nth-child(3) { color: var(--texto-suave); font-size: .9rem; }
  .tabla td:last-child { grid-column: 1 / -1; margin-top: .4rem; }
  .tabla td:last-child .boton { width: 100%; }
  .menu-boton { display: inline-flex; align-items: center; justify-content: center; }
  .barra { gap: .5rem; padding: .4rem 16px; }
  .barra-usuario { display: none; }
  .barra-salir { margin-left: auto; }
  .menu { display: none; border-right: 0; border-bottom: 1px solid var(--borde); }
  .menu.abierto { display: block; }
  .contenido { padding: 1.25rem 16px 2.5rem; }
  .datos > div { grid-template-columns: 1fr; gap: .1rem; }
  .tarjetas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tarjeta-valor { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
