:root {
  --azul: #1f3864; --azul2: #2f5597; --fondo: #f4f6fa; --borde: #dde2ec; --texto: #1c2333; --gris: #6b7488;
  --verde: #1a7f4b; --rojo: #b3261e; --ambar: #9a6700; --amarillo: #fff9c4;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 "Segoe UI", system-ui, sans-serif; color: var(--texto); background: var(--fondo); display: flex; min-height: 100vh; }
.nav { width: 220px; flex: none; background: var(--azul); color: #fff; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.marca { font-size: 22px; font-weight: 700; letter-spacing: 1px; padding: 0 8px 14px; }
.marca span { font-weight: 300; opacity: .8; }
.nav select { width: 100%; margin-bottom: 14px; }
.nav a { display: block; color: #d6def0; text-decoration: none; padding: 7px 10px; border-radius: 6px; }
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a.activo { background: #fff; color: var(--azul); font-weight: 600; }
.nav .grupo { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .55; padding: 16px 10px 4px; }
main { flex: 1; padding: 24px 28px 60px; min-width: 0; }
h1 { font-size: 22px; margin: 0 0 4px; color: var(--azul); }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--azul); }
.sub { color: var(--gris); margin-bottom: 18px; }
.cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel { background: #fff; border: 1px solid var(--borde); border-radius: 10px; padding: 16px; margin-bottom: 18px; overflow-x: auto; }
.rejilla { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--borde); border-radius: 10px; padding: 12px 14px; }
.kpi .v { font-size: 21px; font-weight: 600; color: var(--azul); }
.kpi .e { font-size: 12px; color: var(--gris); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th { background: var(--azul); color: #fff; font-weight: 600; font-size: 12px; padding: 7px 8px; text-align: right; white-space: nowrap; }
th.i, td.i { text-align: left; }
th.grupo { background: var(--azul2); text-align: center; }
td { padding: 6px 8px; border-bottom: 1px solid var(--borde); text-align: right; white-space: nowrap; }
tr.total td { font-weight: 700; background: #eef1f7; border-top: 2px solid var(--azul); }
tr.clic { cursor: pointer; } tr.clic:hover td { background: #f1f5fd; }
tr.tenue td { color: var(--gris); }
.pos { color: var(--verde); } .neg { color: var(--rojo); }
input, select, textarea, button { font: inherit; }
input, select, textarea { border: 1px solid #c4cbd9; border-radius: 6px; padding: 6px 8px; background: #fff; color: var(--texto); }
input:focus, select:focus, textarea:focus { outline: 2px solid #9db4e3; border-color: var(--azul2); }
td input { width: 110px; text-align: right; padding: 4px 6px; } td input.ancho { width: 170px; text-align: left; }
td input[type=date] { width: 135px; } td select { padding: 4px 6px; }
input.cierre, select.cierre { background: var(--amarillo); }
textarea { width: 100%; min-height: 110px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--gris); margin-bottom: 3px; }
.campos { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; align-items: flex-end; }
.campos > div { min-width: 130px; }
button, .boton { border: 1px solid var(--azul2); background: #fff; color: var(--azul2); border-radius: 6px; padding: 7px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .boton:hover { background: #eef3fc; }
button.pri { background: var(--azul2); color: #fff; } button.pri:hover { background: var(--azul); }
button.peligro { border-color: var(--rojo); color: var(--rojo); }
button.mini { padding: 2px 8px; font-size: 12px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; background: #e6e9f0; color: #444; }
.chip.BORRADOR, .chip.RECIBIDA, .chip.PENDIENTE { background: #e6e9f0; }
.chip.ENVIADA, .chip.PROPUESTA_ENVIADA, .chip.EN_PROPUESTA { background: #fff1c2; color: var(--ambar); }
.chip.CONFIRMADA, .chip.CERRADA, .chip.PAGADA, .chip.VIVA, .chip.HECHA { background: #d5f0e1; color: var(--verde); }
.chip.DESCARTADA, .chip.ANULADA, .chip.LIQUIDADA { background: #fbdcda; color: var(--rojo); }
.chip.AGOTADA { background: #e6e9f0; color: var(--gris); }
.aviso { padding: 8px 12px; border-radius: 8px; margin-bottom: 6px; display: block; text-decoration: none; color: var(--texto); background: #fff7d6; border-left: 4px solid #e0a800; }
.aviso.error { background: #fde7e5; border-color: var(--rojo); } .aviso.info { background: #e8f0fd; border-color: var(--azul2); }
.pasos { display: flex; gap: 6px; margin: 4px 0 18px; flex-wrap: wrap; }
.paso { padding: 5px 14px; border-radius: 99px; background: #e6e9f0; color: var(--gris); font-size: 12px; font-weight: 600; }
.paso.hecho { background: #d5f0e1; color: var(--verde); } .paso.actual { background: var(--azul2); color: #fff; }
.nota { color: var(--gris); font-size: 12px; margin-top: 8px; }
.barra { height: 8px; border-radius: 4px; background: #e6e9f0; min-width: 80px; overflow: hidden; } .barra i { display: block; height: 100%; background: var(--azul2); }
#toast { position: fixed; bottom: 22px; right: 22px; display: grid; gap: 8px; z-index: 9; }
#toast div { background: var(--azul); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.2); max-width: 420px; }
#toast div.error { background: var(--rojo); }
.acta { max-width: 1120px; } .acta p { text-align: justify; }
@media print {
  .nav, .no-imprimir, #toast { display: none !important; }
  body { background: #fff; } main { padding: 0; } .panel { border: none; padding: 0; }
  th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* acceso */
.quien { margin-top: 18px; padding: 10px; border-top: 1px solid rgba(255,255,255,.15); font-size: 12px; color: #d6def0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.quien button { border-color: #d6def0; color: #fff; background: transparent; }
.acceso main { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.acceso .panel { width: 360px; max-width: 100%; padding: 28px; margin: 0; }
.acceso .marca { color: var(--azul); font-size: 28px; text-align: center; padding-bottom: 4px; }
.acceso label { margin-top: 12px; } .acceso input { width: 100%; } .acceso button { width: 100%; margin-top: 18px; }
.acceso .error { color: var(--rojo); font-size: 13px; margin-top: 10px; min-height: 18px; }
.clave { position: relative; }
.clave input { padding-right: 40px; }
.clave .ojo { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: auto; margin: 0; padding: 2px 8px; border: none; background: transparent; color: var(--gris); font-size: 16px; cursor: pointer; line-height: 1; }
.clave .ojo:hover, .clave .ojo.activo { color: var(--azul2); background: transparent; }
