/* ---------- Colores ---------- */
:root {
  color-scheme: light;
  --bg: #f3f5fb;
  --card: #ffffff;
  --text: #16202e;
  --muted: #5b6577;
  --line: #e3e7f0;
  --lateral: #101c33;
  --lateral-2: #1b2b4b;

  /* Identidad de datos: ingresos en azul y egresos en naranja, en toda la plataforma */
  --serie-ing: #2a78d6;
  --serie-egr: #eb6834;
  --ing: #1c5cab;
  --egr: #b8451a;
  --ing-suave: #e3effc;
  --egr-suave: #fdeadf;

  --ok: #14642f;
  --ok-bg: #dcf7e4;
  --err: #a81f1f;
  --err-bg: #fde4e4;
  --warn: #7a5200;
  --warn-bg: #fdf1cf;

  /* Color de la sección actual (se cambia abajo con data-sec) */
  --accent: #1d4ed8;
  --accent-dark: #1e3a8a;
  --accent-suave: #e4eafd;
}
body[data-sec="rubros"]      { --accent: #0f766e; --accent-dark: #115e59; --accent-suave: #d9f5f0; }
body[data-sec="pac"]         { --accent: #6d28d9; --accent-dark: #4c1d95; --accent-suave: #ece4fd; }
body[data-sec="movimientos"] { --accent: #c2410c; --accent-dark: #9a3412; --accent-suave: #fdeadf; }
body[data-sec="contratos"]   { --accent: #be185d; --accent-dark: #9d174d; --accent-suave: #fce4ee; }
body[data-sec="cargue"]      { --accent: #15803d; --accent-dark: #166534; --accent-suave: #dcf7e4; }
body[data-sec="plantillas"]  { --accent: #0369a1; --accent-dark: #075985; --accent-suave: #dcf0fb; }
body[data-sec="exportar"]    { --accent: #4d7c0f; --accent-dark: #3f6212; --accent-suave: #ecf6d6; }
body[data-sec="compras"]     { --accent: #b45309; --accent-dark: #92400e; --accent-suave: #fef3e2; }
body[data-sec="ajustes"]     { --accent: #475569; --accent-dark: #334155; --accent-suave: #e8ecf2; }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
h1 { font-size: 24px; line-height: 1.2; margin: 0; font-weight: 700; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 18px 0 10px; color: var(--accent-dark); }
.muted { color: var(--muted); }
code { background: var(--accent-suave); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.icono { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Estructura: menú lateral + contenido ---------- */
.lateral { position: fixed; inset: 0 auto 0 0; width: 248px; display: flex; flex-direction: column; z-index: 40; overflow-y: auto;
  background: linear-gradient(180deg, var(--lateral) 0%, var(--lateral-2) 100%); color: #fff; transition: transform .22s ease; }
.contenido { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
.contenido > main { flex: 1; width: 100%; max-width: 1500px; margin: 0 auto; padding: 18px 24px 32px; animation: fundido .3s ease both; }

.marca { display: flex; gap: 11px; align-items: center; padding: 20px 18px 16px; color: #fff; text-decoration: none; }
.marca strong { display: block; font-size: 17px; line-height: 1.2; }
.marca small { display: block; font-size: 12px; color: #aeb9cf; line-height: 1.3; margin-top: 2px; }
.marca-ico { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: linear-gradient(135deg, #2a78d6, #1baf7a); font-size: 18px; }

.menu { display: flex; flex-direction: column; gap: 3px; padding: 6px 10px 20px; }
.menu a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: #d6deec; text-decoration: none; transition: background .15s, color .15s, transform .15s; }
.menu a:hover { background: rgba(255, 255, 255, .08); color: #fff; transform: translateX(2px); }
.menu a.on { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.menu a:focus-visible { outline-color: #fff; }
.tile { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; color: #fff; font-size: 14px; background: var(--tile); }
.menu a[data-sec="index"]       { --tile: #2563eb; }
.menu a[data-sec="rubros"]      { --tile: #0d9488; }
.menu a[data-sec="pac"]         { --tile: #7c3aed; }
.menu a[data-sec="movimientos"] { --tile: #ea580c; }
.menu a[data-sec="contratos"]   { --tile: #db2777; }
.menu a[data-sec="cargue"]      { --tile: #16a34a; }
.menu a[data-sec="plantillas"]  { --tile: #0284c7; }
.menu a[data-sec="exportar"]    { --tile: #65a30d; }
.menu a[data-sec="compras"]     { --tile: #d97706; }
.menu a[data-sec="ajustes"]     { --tile: #64748b; }

.top { display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.btn-menu { display: none; border: 0; background: none; color: var(--text); padding: 6px; font-size: 18px; cursor: pointer; border-radius: 8px; }
.vig { margin: 0 0 0 auto; }
.vig label { display: flex; align-items: center; gap: 8px; margin: 0; }
.vig select { width: auto; margin: 0; padding: 4px 8px; font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 13px; font-weight: 700; color: #fff; background: var(--accent); transition: background .2s; }
.who-txt { line-height: 1.2; font-size: 14px; }
.who-txt small { display: block; color: var(--muted); font-size: 12px; }
.salir { color: var(--muted); padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.salir:hover { background: var(--err-bg); color: var(--err); }
.velo { display: none; }

.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; margin-bottom: 18px; border-radius: 14px; color: #fff;
  background: linear-gradient(115deg, var(--accent-dark) 0%, var(--accent) 100%); }
.hero p { margin: 4px 0 0; color: rgba(255, 255, 255, .88); font-size: 14px; }
.hero-ico { display: grid; place-items: center; width: 54px; height: 54px; flex: none; border-radius: 14px; font-size: 24px; background: rgba(255, 255, 255, .16); }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 14px 20px 22px; }

/* ---------- Tarjetas e indicadores ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(16, 28, 51, .04); }
.card-tit { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.card-tit h2 { margin: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 18px; }
.grid.dos-tablas { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid.dos-tablas .card { margin-bottom: 0; }

.kpi { position: relative; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--kc); border-radius: 14px; padding: 15px 18px; transition: transform .16s ease, box-shadow .16s ease; }
.kpi:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(16, 28, 51, .1); }
.kpi .lbl { color: var(--muted); font-size: 13px; padding-right: 44px; min-height: 2.6em; }
.kpi .val { font-size: 23px; font-weight: 700; margin: 2px 0 8px; overflow-wrap: anywhere; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.kpi-ico { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--kc); background: var(--ks); font-size: 15px; }
.k-ing  { --kc: var(--serie-ing); --ks: var(--ing-suave); }
.k-egr  { --kc: var(--serie-egr); --ks: var(--egr-suave); }
.k-con  { --kc: #be185d; --ks: #fce4ee; }
.k-caja { --kc: #0f766e; --ks: #d9f5f0; }

.bar { background: var(--ks, var(--accent-suave)); border-radius: 99px; height: 8px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--kc, var(--accent)); animation: crecer-ancho .8s cubic-bezier(.2, .7, .2, 1) both; }

.ing { color: var(--ing); }
.egr { color: var(--egr); }
.neg { color: var(--err); }
.adv { color: var(--warn); }

/* ---------- Gráfica de columnas ---------- */
.leyenda { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.leyenda .m-ing { background: var(--serie-ing); }
.leyenda .m-egr { background: var(--serie-egr); }
.leyenda.escala { margin-bottom: 12px; }
.leyenda .h1 { background: #cde2fb; } .leyenda .h2 { background: #9ec5f4; } .leyenda .h3 { background: #6da7ec; }

.grafica { position: relative; padding: 10px 0 0 74px; }
.eje { position: absolute; left: 0; right: 0; top: 10px; height: 220px; }
.marca-eje { position: absolute; left: 74px; right: 0; border-top: 1px solid var(--line); }
.marca-eje:last-child { border-top-color: #c3c9d6; }
.marca-eje span { position: absolute; right: 100%; top: -9px; margin-right: 8px; font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart { position: relative; display: flex; gap: 2px; }
.chart .m { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; border-radius: 8px; cursor: default; transition: background .15s; }
.chart .m:hover, .chart .m:focus-visible { background: rgba(42, 120, 214, .07); }
.chart .pair { display: flex; gap: 2px; align-items: flex-end; justify-content: center; height: 220px; width: 100%; }
.chart .b { width: 38%; max-width: 20px; border-radius: 4px 4px 0 0; transform-origin: bottom; animation: crecer-alto .6s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 30ms); }
.chart .b.i { background: var(--serie-ing); }
.chart .b.e { background: var(--serie-egr); }
.chart small { font-size: 12px; color: var(--muted); padding: 5px 0; }
.chart .m.actual small { color: var(--text); font-weight: 700; }
.grafica-vacia { position: absolute; left: 74px; right: 0; top: 90px; margin: 0; text-align: center; color: var(--muted); }
.tooltip { position: fixed; z-index: 60; pointer-events: none; background: var(--lateral); color: #fff; font-size: 13px; padding: 8px 11px; border-radius: 8px; box-shadow: 0 8px 20px rgba(16, 28, 51, .25); min-width: 170px; }
.tooltip strong { display: block; margin-bottom: 3px; }
.tooltip div { display: flex; align-items: center; gap: 6px; }
.tooltip div b { margin-left: auto; padding-left: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tooltip i { width: 10px; height: 10px; border-radius: 3px; background: var(--serie-ing); }
.tooltip i.e { background: var(--serie-egr); }

/* ---------- Mensajes ---------- */
.alert { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; background: var(--warn-bg); color: var(--warn); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.error { background: var(--err-bg); color: var(--err); }
.alert a { color: inherit; font-weight: 600; }

.toasts { position: fixed; top: 62px; right: 20px; z-index: 50; display: flex; flex-direction: column; gap: 10px; width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 12px 16px; border-radius: 12px; border-left: 5px solid #d39a00; background: var(--warn-bg); color: var(--warn); box-shadow: 0 10px 26px rgba(16, 28, 51, .18); animation: entrar-toast .3s ease both; }
.toast.ok { background: var(--ok-bg); color: var(--ok); border-color: #16a34a; }
.toast.error { background: var(--err-bg); color: var(--err); border-color: #d03b3b; }
.toast.saliendo { opacity: 0; transform: translateX(24px); transition: opacity .25s, transform .25s; }
.toast span { flex: 1; }
.toast-x { border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--accent-suave); color: var(--accent-dark); font-weight: 600; white-space: nowrap; }
thead th:first-child { border-top-left-radius: 8px; }
thead th:last-child { border-top-right-radius: 8px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f6f8fd; }
td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; background: #f4f6fb; }
tr.grupo td { background: #eceff6; font-weight: 700; letter-spacing: .02em; }
tr.grupo.ingreso td { background: var(--ing-suave); color: var(--ing); }
tr.grupo.egreso td { background: var(--egr-suave); color: var(--egr); }
tr.mes-actual td { background: #fff7dc; }
td small { color: var(--muted); }
#tabla-movimientos td:first-child, #tabla-revision td:nth-child(3) { white-space: nowrap; }

/* PAC */
.pac th:first-child, .pac tbody td:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; min-width: 220px; }
.pac thead th:first-child { background: var(--accent-suave); }
.pac tr.total td:first-child { background: #f4f6fb; }
.pac input { width: 100px; padding: 4px 6px; text-align: right; font-size: 13px; margin: 0; }
.pac td.h1 { background: #e6f0fd; } .pac td.h2 { background: #cde2fb; } .pac td.h3 { background: #9ec5f4; }
.pac td.h1 small, .pac td.h2 small, .pac td.h3 small { color: #24344d; }

/* ---------- Formularios y botones ---------- */
form.inline { display: inline; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
input, select, textarea { display: block; width: 100%; margin-top: 3px; padding: 8px 10px; font: inherit; color: var(--text); border: 1px solid #cdd3df; border-radius: 8px; background: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-suave); }
input[type="checkbox"] { display: inline-block; width: auto; margin: 0 6px 0 0; }
textarea { min-height: 90px; resize: vertical; }
.cols { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.span2 { grid-column: 1 / -1; }
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, transform .12s, box-shadow .15s; }
.btn:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(16, 28, 51, .16); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.sec { background: var(--accent-suave); color: var(--accent-dark); }
.btn.sec:hover { background: var(--accent-suave); box-shadow: inset 0 0 0 1px var(--accent); }
.btn.del { background: #fbe0e0; color: var(--err); }
.btn.del:hover { background: var(--err); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: 13px; font-weight: 500; }
.btn.ocupado { opacity: .7; pointer-events: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.actions input, .actions select { margin-top: 0; }
.buscador { width: min(320px, 100%); }
.filtro-cuenta { font-size: 13px; color: var(--muted); }

/* ---------- Etiquetas ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #e8ebf2; color: #39445a; white-space: nowrap; }
.badge.propios { background: #dbeafe; color: #1e3f8a; }
.badge.gratuidad { background: #d9f5e4; color: #14642f; }
.badge.otros { background: #fdf0c8; color: #6d4c00; }
.badge.b-ing { background: var(--ing-suave); color: var(--ing); }
.badge.b-egr { background: var(--egr-suave); color: var(--egr); }
.est-borrador  { background: #e8ebf2; color: #39445a; }
.est-tramite   { background: #fdf0c8; color: #6d4c00; }
.est-firmado   { background: #dbeafe; color: #1e3f8a; }
.est-ejecucion { background: #ece4fd; color: #4c1d95; }
.est-terminado { background: #d9f5f0; color: #115e59; }
.est-liquidado { background: #d9f5e4; color: #14642f; }
.est-anulado   { background: #fbe0e0; color: #a81f1f; text-decoration: line-through; }

/* ---------- Cargue masivo ---------- */
.pasos { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 0; margin: 0 0 16px; font-size: 13.5px; color: var(--muted); }
.pasos li { display: flex; align-items: center; gap: 8px; }
.pasos li span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e3e7f0; font-weight: 700; font-size: 12px; }
.pasos li.actual { color: var(--text); font-weight: 600; }
.pasos li.actual span { background: var(--accent); color: #fff; }
.pasos li.hecho span { background: var(--accent-suave); color: var(--accent-dark); }

.tarjetas-cargue { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 18px; }
.tarjeta-cargue { display: block; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tarjeta-cargue:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(16, 28, 51, .1); }
.tarjeta-cargue.on { border-color: var(--tc); background: var(--ts); }
.tarjeta-cargue .ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; margin-bottom: 8px; color: #fff; background: var(--tc); font-size: 16px; }
.tarjeta-cargue strong { display: block; }
.tarjeta-cargue small { display: block; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.c-teal   { --tc: #0f766e; --ts: #e9faf6; }
.c-violet { --tc: #6d28d9; --ts: #f4effe; }
.c-orange { --tc: #c2410c; --ts: #fef3ec; }
.c-pink   { --tc: #be185d; --ts: #fdeef5; }
.c-amber  { --tc: #b45309; --ts: #fef6e7; }
.aviso-fuente { margin: 0 0 12px; padding: 8px 12px; border-radius: 9px; background: var(--accent-suave); color: var(--accent-dark); font-size: 13.5px; }
.aviso-fuente.neg { background: var(--err-bg); color: var(--err); }
.fuentes-card table { max-width: 900px; }

/* ---------- App instalable y trabajo sin internet ---------- */
.top-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.top-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.top-btn[hidden] { display: none; }
.top-btn b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); font-size: 12px; }
.top-btn.con-error b { background: var(--err-bg); color: var(--err); }
.banda-conexion { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; background: #1f2937; color: #fff; font-size: 14px; }
.banda-conexion[hidden] { display: none; }
.dialogo { width: min(560px, calc(100vw - 32px)); border: 0; border-radius: 14px; padding: 20px 22px; box-shadow: 0 24px 60px rgba(16, 28, 51, .3); color: var(--text); }
.dialogo::backdrop { background: rgba(16, 28, 51, .45); }
.dialogo h2 { margin-top: 0; }
.dialogo ol { padding-left: 20px; line-height: 1.7; }
.dialogo .actions { justify-content: flex-end; margin: 16px 0 0; }
.lista-pend { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow: auto; }
.lista-pend li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lista-pend li span { grid-column: 1; color: var(--muted); font-size: 13px; }
.lista-pend li em { grid-column: 1; color: var(--err); font-style: normal; font-size: 13px; }
.lista-pend li .btn { grid-column: 2; grid-row: 1 / span 3; }
@media (max-width: 700px) {
  .top-btn span { display: none; }
}

.dos-col { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 6px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; }
.reglas { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); }
.reglas li { margin-bottom: 6px; }

.zona { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 30px 16px; margin-bottom: 14px; text-align: center; border: 2px dashed #b7c0d0; border-radius: 14px; color: var(--text); font-size: 14px; background: #fafbfe; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.zona:hover, .zona.sobre { border-color: var(--accent); background: var(--accent-suave); }
.zona.sobre { transform: scale(1.01); }
.zona.lista { border-style: solid; border-color: var(--accent); background: var(--accent-suave); }
.zona .ico { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 4px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 18px; }
.zona small { color: var(--muted); }
.zona input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.zona:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.contadores { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 14px; }
.contador { border: 2px solid transparent; border-radius: 12px; padding: 7px 13px; background: #eef1f7; color: #39445a; font: inherit; font-size: 13px; cursor: pointer; transition: transform .12s, border-color .12s; }
.contador strong { font-size: 17px; margin-right: 3px; }
.contador:hover { transform: translateY(-1px); }
.contador.on { border-color: var(--accent-dark); }
.contador.c-nuevo { background: var(--ok-bg); color: var(--ok); }
.contador.c-actualiza { background: var(--ing-suave); color: var(--ing); }
.contador.c-duplicado { background: var(--warn-bg); color: var(--warn); }
.contador.c-error { background: var(--err-bg); color: var(--err); }
.e-nuevo { background: var(--ok-bg); color: var(--ok); }
.e-actualiza { background: var(--ing-suave); color: var(--ing); }
.e-igual { background: #e8ebf2; color: #39445a; }
.e-duplicado { background: var(--warn-bg); color: var(--warn); }
.e-error { background: var(--err-bg); color: var(--err); }
tr.fila-error { background: #fff6f6; }
td.obs { min-width: 240px; font-size: 13px; }
.check { display: flex; align-items: flex-start; color: var(--text); font-size: 14px; }
.check input { margin-top: 3px; }
.confirmar .actions { margin-bottom: 0; }

/* ---------- Ingreso e instalación ---------- */
body.center { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(135deg, #101c33 0%, #1c5cab 55%, #0f766e 100%); }
.login { width: 100%; max-width: 390px; padding: 26px; margin: 0; box-shadow: 0 24px 50px rgba(8, 15, 30, .35); animation: aparecer .35s ease both; }
.login h1 { margin-bottom: 4px; }
.login .btn { width: 100%; justify-content: center; margin-top: 6px; }

/* ---------- Animaciones ---------- */
@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fundido { from { opacity: 0; } to { opacity: 1; } }   /* sin transform: los mensajes fijos no deben moverse */
@keyframes crecer-ancho { from { width: 0; } }
@keyframes crecer-alto { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes entrar-toast { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Pantallas pequeñas ---------- */
@media (max-width: 900px) {
  .lateral { transform: translateX(-100%); box-shadow: none; }
  body.menu-abierto .lateral { transform: none; box-shadow: 0 0 40px rgba(8, 15, 30, .4); }
  body.menu-abierto .velo { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(8, 15, 30, .45); }
  .contenido { margin-left: 0; }
  .btn-menu { display: grid; place-items: center; }
  .top { padding: 8px 14px; gap: 10px; }
  .contenido > main { padding: 14px 12px 24px; }
  .who-txt { display: none; }
  .hero { padding: 14px 16px; }
  h1 { font-size: 20px; }
  .hero-ico { width: 44px; height: 44px; font-size: 20px; }
  .card { padding: 14px; }
  .grafica { padding-left: 58px; }
  .marca-eje { left: 58px; }
  .marca-eje span { font-size: 10.5px; }
  .grafica-vacia { left: 58px; }
  .chart small { font-size: 10.5px; }
  .pac th:first-child, .pac tbody td:first-child { position: static; min-width: 180px; }
  .toasts { top: 56px; right: 16px; }
}

/* ---------- Impresión ---------- */
@media print {
  .lateral, .top, .actions, footer, form, .toasts, .hero-ico { display: none !important; }
  .contenido { margin: 0; }
  body { background: #fff; }
  .hero { background: none; color: #000; padding: 0; }
  .hero p { color: #000; }
  .card { border: 0; box-shadow: none; }
}
