:root {
  --azul: #355d88; --azul-claro: #cfe0f1; --fondo: #f4f6f9; --tarjeta: #fff; --texto: #1f2933;
  --gris: #6b7785; --borde: #dde3ea; --verde: #2e7d4f; --naranja: #b26a00; --rojo: #b3261e;
  --f-verde: #e7f4ec; --f-naranja: #fdf1e0; --f-rojo: #fbe9e7; --radio: 10px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--texto);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); font-size: 15px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 .4em; font-weight: 600; }
h2 { font-size: 1.35rem; }
.gris { color: var(--gris); }
.pequeno { font-size: .85rem; }
.tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px; }

/* Botones y campos */
button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--borde); background: #fff;
  color: var(--texto); cursor: pointer; min-height: 38px; }
button:hover { background: #f0f3f7; }
button.principal { background: var(--azul); border-color: var(--azul); color: #fff; }
button.principal:hover { background: #2c4f74; }
button.peligro { color: var(--rojo); }
button.enlace { border: 0; background: none; color: var(--azul); padding: 4px 0; min-height: 0; }
button:disabled { opacity: .5; cursor: default; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--gris); }
input, select, textarea { font: inherit; color: var(--texto); padding: 8px 10px; border: 1px solid var(--borde);
  border-radius: 8px; background: #fff; min-height: 38px; width: 100%; }
input[type=checkbox] { width: auto; min-height: 0; }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--texto); font-size: .95rem; }
.campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.campos .ancho { grid-column: 1 / -1; }
.botones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.botones .derecha { margin-left: auto; }

/* Entrada */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-caja { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; }
.login-caja h1 { color: var(--azul); }

/* Estructura */
.cabecera { background: var(--azul); color: #fff; display: flex; align-items: center; gap: 14px; padding: 10px 18px;
  position: sticky; top: 0; z-index: 20; }
.marca { display: flex; flex-direction: column; }
.marca strong { font-size: 1.2rem; }
.marca span { color: var(--azul-claro); font-size: .8rem; }
.cab-resumen { margin-left: auto; text-align: right; font-size: .85rem; color: var(--azul-claro); }
.b-menu { display: none; background: none; border: 0; color: #fff; font-size: 1.4rem; padding: 4px 8px; }
.cuerpo { display: flex; min-height: calc(100vh - 60px); }
.menu { width: 220px; flex: none; background: #fff; border-right: 1px solid var(--borde); padding: 12px 0; }
.menu h4 { margin: 14px 18px 4px; font-size: .72rem; letter-spacing: .08em; color: var(--gris); }
.menu a { display: flex; justify-content: space-between; padding: 8px 18px; color: var(--texto); text-decoration: none;
  border-left: 3px solid transparent; }
.menu a.elegida { border-left-color: var(--azul); color: var(--azul); background: #eef3f9; font-weight: 600; }
.menu a .globo { background: var(--naranja); color: #fff; border-radius: 10px; padding: 0 7px; font-size: .75rem; }
.menu .salir { margin: 18px; }
.contenido { flex: 1; min-width: 0; padding: 18px 22px; }
.cab-pagina { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.cab-pagina > div:first-child { flex: 1; min-width: 220px; }

/* Avisos */
.banda { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px;
  white-space: pre-line; background: var(--f-verde); color: var(--verde); }
.banda.naranja { background: var(--f-naranja); color: var(--naranja); }
.banda.rojo { background: var(--f-rojo); color: var(--rojo); }
.banda span { flex: 1; }
.banda button { border: 0; background: none; min-height: 0; padding: 0 4px; color: var(--gris); }
.aviso { margin: 0; color: var(--rojo); white-space: pre-line; }

/* Tablas */
.tabla-caja { overflow: auto; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid #eef1f4; text-align: left; white-space: nowrap; }
th { background: #f8fafc; position: sticky; top: 0; font-weight: 600; color: var(--gris); font-size: .8rem; }
td.num, th.num { text-align: right; }
td.centro, th.centro { text-align: center; }
tr.fila { cursor: pointer; }
tr.fila:hover { background: #f5f8fb; }
tr.elegida { background: #e3edf7 !important; }
tr.baja td { color: #9aa5b1; }
tr.falta td { color: var(--naranja); }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.filtros input[type=search] { max-width: 320px; }
.pie { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.pie .gris { flex: 1; min-width: 200px; }

/* Ventanitas */
.dialogo-fondo { position: fixed; inset: 0; background: rgba(15, 25, 40, .45); display: grid; place-items: center;
  padding: 16px; z-index: 50; }
.dialogo { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 12px; }

/* Móvil */
@media (max-width: 800px) {
  .b-menu { display: block; }
  .cab-resumen { display: none; }
  .menu { position: fixed; top: 56px; bottom: 0; left: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s;
    box-shadow: 2px 0 12px rgba(0,0,0,.15); overflow-y: auto; }
  .menu.abierto { transform: none; }
  .contenido { padding: 14px 16px; }
  .campos { grid-template-columns: 1fr; }
  td, th { padding: 7px 8px; }
}
