/* ===================== Griddex · tema.css (v8) =====================
   Piel visual del portal y de la base de datos: fondo gris, tarjetas
   blancas, acento índigo + verde, barra lateral y tema claro/oscuro.
   Se carga DESPUÉS de base.css y de la hoja de cada página. Solo
   presentación: no cambia ningún id, clase funcional ni listener.
   ==================================================================== */
:root{
  --gx-nav-w:248px;
  --gx-accent:#5b5bf6; --gx-accent-hover:#4848e4; --gx-accent-soft:#f3f3ff; --gx-ring:#e4e4ff;
  --gx-green:#22c55e; --gx-green-ink:#15803d; --gx-green-soft:#dcfce7;
  --gx-hover-strong:#d6d9e2; --gx-surface-hover:#f3f4f8;
  --gx-r:14px; --gx-r-sm:10px;
  --gx-shadow:0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --gx-shadow-lg:0 12px 32px rgba(16,24,40,.12), 0 2px 6px rgba(16,24,40,.06);

  /* tokens de base.css reinterpretados */
  --noche:#111827; --verde:#4848e4; --hoja:#5b5bf6; --lima:#5b5bf6;
  --bg:#f1f2f6; --card:#ffffff; --line:#e6e8ee; --line2:#f1f2f6;
  --txt:#111827; --muted:#6b7280;
  --zebra:#f8f9fc; --hover:#f3f3ff; --colline:rgba(17,24,39,.06);
  --shadow:var(--gx-shadow);
  --fuente:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  --titulo:var(--fuente);
  --gx-row:#ffffff; --gx-th:#f7f8fb; --gx-soft:#f7f8fb;
  color-scheme:light;
}
html[data-theme="dark"]{
  --gx-accent:#7272ff; --gx-accent-hover:#8a8aff; --gx-accent-soft:#1e1f3d; --gx-ring:#2c2c5c;
  --gx-green:#34d399; --gx-green-ink:#4ade80; --gx-green-soft:#12301f;
  --gx-hover-strong:#363c4c; --gx-surface-hover:#1f2330;
  --gx-shadow:0 1px 2px rgba(0,0,0,.4); --gx-shadow-lg:0 16px 40px rgba(0,0,0,.55);
  --noche:#e8eaf0; --verde:#9d9dff; --hoja:#7272ff; --lima:#7272ff;
  --bg:#0c0e14; --card:#151821; --line:#272c39; --line2:#1b1f2a;
  --txt:#e8eaf0; --muted:#9aa3b2;
  --zebra:#181b25; --hover:#1e1f3d; --colline:rgba(255,255,255,.05);
  --ambar:#33270b; --ambar2:#46360f; --ambarTxt:#fcd34d;
  --rojo:#f87171; --rojoBg:#3a1517;
  --gx-row:#151821; --gx-th:#1b1f2a; --gx-soft:#1b1f2a;
  color-scheme:dark;
}

/* ---------- base ---------- */
body{font-family:var(--fuente);letter-spacing:-.003em}
:focus-visible{outline:2px solid var(--gx-accent);outline-offset:2px;border-radius:6px}
a{color:var(--gx-accent)}
.btn{border-radius:var(--gx-r-sm);border-color:var(--line);background:var(--card);color:var(--txt);box-shadow:var(--gx-shadow);
  transition:background-color .15s,border-color .15s,color .15s,transform .1s}
.btn:hover{border-color:var(--gx-hover-strong)}
.btn:active:not([disabled]){transform:scale(.98)}
.btn.primary{background:var(--gx-accent);border-color:var(--gx-accent);color:#fff;border-radius:999px;padding-left:16px;padding-right:16px;box-shadow:0 2px 6px rgba(91,91,246,.3)}
.btn.primary:hover{background:var(--gx-accent-hover);border-color:var(--gx-accent-hover)}
.btn.ghost{background:var(--card);color:var(--txt);border-color:var(--line)}
.btn.ghost:hover{background:var(--gx-soft);border-color:var(--gx-hover-strong)}
.btn.danger{background:var(--card)}
.btn.sm{border-radius:8px;box-shadow:none}
input,select,textarea{color:var(--txt)}
.toolbar input[type=search],.toolbar select,.toolbar input[type=date],.field input,.field select,.field textarea{background:var(--card);border-color:var(--line);border-radius:var(--gx-r-sm);color:var(--txt)}
.toolbar input:focus,.toolbar select:focus,.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--gx-accent);box-shadow:0 0 0 4px var(--gx-ring)}
.field label{letter-spacing:.04em}
.chipf{background:var(--card);border-color:var(--line);color:var(--txt)}
.chipf:hover{border-color:var(--gx-hover-strong)}
.chipf[aria-pressed=true]{background:var(--gx-accent);border-color:var(--gx-accent);color:#fff}
.mas-badge{background:var(--gx-accent)}
.entorno{border-radius:999px}
.avisobar{border-radius:var(--gx-r)}
.kpis{background:var(--gx-soft);border-color:var(--line);border-radius:var(--gx-r)}
.kpis div b,.stat b{letter-spacing:-.02em;font-weight:700}
.ruta{background:var(--gx-soft);border-color:var(--line)}
code{background:var(--gx-soft);color:var(--txt)}
.opcion:hover{border-color:var(--gx-accent)}

/* modales, avisos y velo */
.overlay{background:rgba(15,18,30,.45);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}
.modal{border-radius:20px;border:1px solid var(--line);box-shadow:var(--gx-shadow-lg)}
.mhead,.mfoot{border-color:var(--line)}
.modal h3{font-weight:700;letter-spacing:-.01em}
.mfoot .btn{border-radius:999px}
#toast{background:#111827;border-radius:999px;padding:10px 18px}
#toast::before{content:"";display:inline-block;width:8px;height:8px;margin-right:10px;border-radius:50%;background:var(--gx-green);vertical-align:1px}
#toast.malo{background:#111827} #toast.malo::before{background:#ef4444}
html[data-theme="dark"] #toast{background:#e8eaf0;color:#111827}
.veloSpin{border-color:var(--line);border-top-color:var(--gx-accent)}

/* ---------- barra lateral (portal y base de datos) ---------- */
.gx-side{position:fixed;top:0;left:0;bottom:0;z-index:50;width:var(--gx-nav-w);display:flex;flex-direction:column;
  background:var(--card);border-right:1px solid var(--line)}
.gx-side-brand{flex:0 0 auto;display:flex;align-items:center;height:64px;padding:0 16px;border-bottom:1px solid var(--line);text-decoration:none}
.gx-side-brand img{display:block;height:auto;max-height:30px;max-width:150px;width:auto}
.gx-side-brand span,.gx-side-brand img.gx-mark{display:none}
html[data-theme="dark"] .iconbtn.has{background:#33270b}
html[data-theme="dark"] #tab-peticiones .iconbtn.parcial,html[data-theme="dark"] #tab-peticiones td.num .facpct,
html[data-theme="dark"] #tab-facturacion td .parte,html[data-theme="dark"] .repcifras .pend b,html[data-theme="dark"] .tipfac .tf-cifras .pend b{color:#fbbf24}
html[data-theme="dark"] .gx-side-brand img{filter:brightness(0) invert(.92)}
.gx-side-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;padding:0 12px 12px;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.gx-side-label{padding:16px 10px 6px;font-size:10.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.gx-side-link,.gx-side .tabs button{display:flex;align-items:center;gap:10px;width:100%;min-height:38px;padding:7px 10px;margin:0;
  color:var(--muted);background:transparent;border:1px solid transparent;border-radius:var(--gx-r-sm);font-size:13.5px;font-weight:500;text-align:left;text-decoration:none;line-height:1.25}
.gx-side-link:hover,.gx-side .tabs button:hover{color:var(--txt);background:var(--gx-surface-hover)}
.gx-side-link.on,.gx-side .tabs button[aria-selected=true]{color:var(--gx-accent);background:var(--gx-accent-soft);font-weight:600}
.gx-side .tabs{display:flex;flex-direction:column;gap:2px;padding:0;background:transparent;border-radius:0}
.gx-ico{flex:0 0 18px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center}
.gx-ico svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.gx-side-foot{flex:0 0 auto;display:flex;flex-direction:column;gap:10px;padding:12px;border-top:1px solid var(--line)}
.gx-user{display:flex;align-items:center;gap:10px;padding:10px;background:var(--gx-soft);border:1px solid var(--line);border-radius:var(--gx-r)}
.gx-avatar{flex:0 0 32px;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:var(--gx-accent);color:#fff;font-weight:700;font-size:13px;text-transform:uppercase}
.gx-user-info{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px;font-size:12.5px;color:var(--muted)}
.gx-user-info > span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:none}
.gx-user-info b,.gx-user .quienTop{color:var(--txt);font-weight:600}
.gx-user .quienTop{font-size:13px;max-width:none}
.gx-user .btn{flex:0 0 auto;padding:5px 10px;font-size:12px;box-shadow:none;border-radius:8px}
.gx-side-foot .entorno{display:block;text-align:center;font-size:11px;padding:5px 10px;white-space:normal;line-height:1.35}
.gx-side-foot .entorno.hide{display:none !important}
.gx-theme-switch{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;background:var(--gx-soft);border:1px solid var(--line);border-radius:var(--gx-r-sm)}
.gx-theme-switch button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:32px;padding:4px 8px;font-size:12.5px;font-weight:500;color:var(--muted);background:transparent;border:1px solid transparent;border-radius:8px}
.gx-theme-switch button[aria-pressed="true"]{background:var(--card);color:var(--txt);border-color:var(--line);box-shadow:var(--gx-shadow)}
.gx-theme-switch .gx-ico,.gx-theme-switch .gx-ico svg{width:15px;height:15px;flex-basis:15px}
.gx-con-lateral{padding-left:var(--gx-nav-w)}

/* Base de datos: carril de iconos que se despliega al pasar el ratón (las tablas necesitan el ancho) */
@media (min-width:901px){
  body.gx-rail{--gx-nav-w:72px}
  .gx-rail .gx-side{width:72px;overflow:hidden;transition:width .18s cubic-bezier(.2,.7,.2,1),box-shadow .18s}
  .gx-rail .gx-side:hover,.gx-rail .gx-side:focus-within{width:248px;box-shadow:var(--gx-shadow-lg)}
  .gx-rail .gx-side-brand{padding:0 20px}
  .gx-rail .gx-side-brand img{max-width:none;max-height:28px;object-fit:cover;object-position:left center}
  .gx-rail .gx-side:not(:hover):not(:focus-within) .gx-side-brand img:not(.gx-mark){display:none}
  .gx-rail .gx-side:not(:hover):not(:focus-within) .gx-side-brand img.gx-mark{display:block;width:28px;height:28px;max-height:none;filter:none;border-radius:7px}
  .gx-rail .gx-side-link,.gx-rail .gx-side .tabs button{padding-left:15px;white-space:nowrap}
  .gx-rail .gx-side:not(:hover):not(:focus-within) .gx-side-label{visibility:hidden}
  .gx-rail .gx-side:not(:hover):not(:focus-within) .gx-side-link span:not(.gx-ico),
  .gx-rail .gx-side:not(:hover):not(:focus-within) .tabs button span:not(.gx-ico),
  .gx-rail .gx-side:not(:hover):not(:focus-within) .gx-user-info,
  .gx-rail .gx-side:not(:hover):not(:focus-within) .gx-user .btn,
  .gx-rail .gx-side:not(:hover):not(:focus-within) .entorno,
  .gx-rail .gx-side:not(:hover):not(:focus-within) .gx-theme-switch button[aria-pressed="false"],
  .gx-rail .gx-side:not(:hover):not(:focus-within) .gx-theme-switch span:not(.gx-ico){display:none}
  .gx-rail .gx-side:not(:hover):not(:focus-within) .gx-theme-switch{grid-template-columns:1fr}
  .gx-rail .gx-side:not(:hover):not(:focus-within) .gx-user{padding:6px;justify-content:center}
  .gx-rail .gx-side-foot{white-space:nowrap}
}
@media (min-width:901px) and (prefers-reduced-motion:reduce){.gx-rail .gx-side{transition:none}}

/* ---------- pantalla de acceso ---------- */
.acceso{background:var(--bg)}
.acceso .caja{border-radius:20px;border-color:var(--line);box-shadow:var(--gx-shadow-lg);padding:34px 30px}
.acceso h1{font-size:21px;font-weight:700;letter-spacing:-.02em}
.acceso .btn.primary{min-height:42px;font-size:14px}
.acceso .field input{min-height:42px;padding:9px 12px;border:1px solid var(--line);background:var(--card);border-radius:var(--gx-r-sm);color:var(--txt);outline:none;font-size:14px}
.acceso .field input:focus{border-color:var(--gx-accent);box-shadow:0 0 0 4px var(--gx-ring)}
.acceso #a_entorno{display:inline-block;width:100%;padding:6px 10px;border-radius:999px;background:var(--ambar);color:var(--ambarTxt);font-weight:600;font-size:12px}
.acceso #a_entorno.hide{display:none}
html[data-theme="dark"] .acceso .marca img{filter:brightness(0) invert(.92)}

/* ---------- portal ---------- */
body.portal main{max-width:1180px;padding:28px 28px 40px;margin:0}
#pantallaPortal .phead{display:none}
.saludo{font-size:26px;font-weight:700;letter-spacing:-.02em}
.grupo{font-size:10.5px;letter-spacing:.08em;font-weight:600;margin:28px 0 12px}
.rejilla{gap:16px}
.tarjeta{border-radius:var(--gx-r);border-color:var(--line);box-shadow:var(--gx-shadow);padding:20px 20px 22px;position:relative}
.tarjeta:hover{border-color:var(--gx-accent);transform:translateY(-2px);box-shadow:0 0 0 3px var(--gx-ring),var(--gx-shadow-lg)}
.tarjeta .ico{width:42px;height:42px;border-radius:12px;background:var(--gx-accent-soft)}
.tarjeta .ico svg{stroke:var(--gx-accent);stroke-width:1.75}
.tarjeta h2{font-size:15.5px;font-weight:700;letter-spacing:-.01em}
.tarjeta.principal{background:linear-gradient(135deg,var(--gx-accent),#7c5cff);border-color:transparent;color:#fff}
.tarjeta.principal p{color:rgba(255,255,255,.82)}
.tarjeta.principal .ico{background:rgba(255,255,255,.18)}
.tarjeta.principal .ico svg{stroke:#fff}
.tarjeta::after{content:"";position:absolute;top:22px;right:20px;width:16px;height:16px;opacity:0;transform:translateX(-4px);transition:opacity .15s,transform .15s;
  background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E") center/16px no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E") center/16px no-repeat}
.tarjeta:hover::after{opacity:.7;transform:none}

/* ---------- base de datos: cabecera superior ---------- */
header.top{background:var(--bg);border-bottom:none;box-shadow:none;padding:16px 20px 10px;gap:10px}
header.top .gx-page-title{margin:0;font-size:20px;font-weight:700;letter-spacing:-.02em;color:var(--txt)}
#estadoGuardado{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;min-width:0}
#estadoGuardado:empty{display:none}
#estadoGuardado.ok{background:var(--gx-green-soft);color:var(--gx-green-ink)}
#estadoGuardado.ok::before{content:"";width:6px;height:6px;border-radius:50%;background:var(--gx-green)}
#estadoGuardado.err{background:var(--rojoBg)}
.bkp .dot2{border-color:var(--card)}
main{padding:6px 20px 70px}

/* indicadores */
.stat{border-radius:var(--gx-r);border-color:var(--line);box-shadow:var(--gx-shadow);padding:12px 16px}
.stat span{text-transform:none;letter-spacing:0;font-weight:500}
.stat em{color:var(--gx-green-ink)}
.stat.alerta{background:var(--card);border-color:#fcd34d;box-shadow:0 0 0 3px #fef3c7}
html[data-theme="dark"] .stat.alerta{box-shadow:0 0 0 3px #33270b}
.stat.sel:hover{border-color:var(--gx-accent)}
#tab-peticiones .stat,#tab-facturacion .stat{padding:10px 14px}
.filtrosav{background:var(--card);border-color:var(--line);border-radius:var(--gx-r)}

/* grupos y tablas */
.group{border-radius:var(--gx-r);border-color:var(--line);box-shadow:var(--gx-shadow)}
#tab-peticiones .group[data-est],#tab-facturacion .group[data-fgrupo]{box-shadow:var(--gx-shadow);border-left-width:3px}
.ghead{background:var(--gx-soft)}
.ghead .sum{color:var(--txt)}
th{background:var(--gx-th);color:var(--muted);border-bottom-color:var(--line)}
td{background:var(--gx-row);border-bottom-color:var(--line2)}
.masfilas{background:var(--gx-soft)}
.cellinput:hover{background:var(--card)}
.cellinput:focus{border-color:var(--gx-accent);background:var(--card);box-shadow:0 0 0 3px var(--gx-ring)}
.cpmini:focus{border-color:var(--gx-accent);background:var(--card);box-shadow:0 0 0 3px var(--gx-ring)}
select.tsel:focus,select.esel:focus,select.ffsel:focus{box-shadow:0 0 0 3px var(--gx-ring)}
.iconbtn{color:var(--txt)}
.iconbtn:hover{background:var(--gx-surface-hover);border-color:var(--line)}
.rz:hover::after,.rz.on::after{background:var(--gx-accent)}
.menufila{background:var(--card);border-color:var(--line);border-radius:var(--gx-r);box-shadow:var(--gx-shadow-lg)}
.menufila button{color:var(--txt);border-radius:8px}
.menufila button:hover{background:var(--gx-surface-hover)}
.tipfac{border-radius:var(--gx-r);box-shadow:var(--gx-shadow-lg)}
.tipfac .tf-leyenda tr.ahora td{background:var(--gx-accent-soft)}

/* fichas, ajustes, clientes */
.fsec{border-color:var(--line);border-radius:12px}
.fhead{background:var(--gx-soft);color:var(--txt);font-weight:600}
.fhead:hover{background:var(--gx-surface-hover)}
.acc{border-radius:var(--gx-r);border-color:var(--line);box-shadow:var(--gx-shadow)}
.ahead{background:var(--card);color:var(--txt)}
.ahead:hover{background:var(--gx-soft)}
.ahead .atit{font-weight:600}
.ahead .aest.ok{color:var(--gx-green-ink)}
.peligro{border-radius:var(--gx-r)}
.ccard{border-radius:var(--gx-r);border-color:var(--line);box-shadow:var(--gx-shadow);transition:border-color .15s,box-shadow .15s}
.ccard:hover{border-color:var(--gx-hover-strong);box-shadow:var(--gx-shadow-lg)}
.ccard h4{font-weight:700;letter-spacing:-.01em}
.ccard .foot .n{color:var(--gx-accent)}
.seg{background:var(--gx-soft);border-color:var(--line)}
.seg .fec{color:var(--gx-accent)}
.chipserv{background:var(--card);color:var(--txt)}
.chipserv:hover{background:var(--gx-soft)}
.chipsub{background:var(--card)}
.tablaint{border-color:var(--line);border-radius:12px}
table.tint th{background:var(--gx-th)}
.badge.gris{background:var(--gx-soft)}

/* ---------- tema oscuro: superficies con color fijo en las hojas originales ---------- */
html[data-theme="dark"] header.top{background:var(--bg)}
html[data-theme="dark"] .ghead,html[data-theme="dark"] .masfilas,html[data-theme="dark"] .filtrosav{background:var(--gx-soft)}
html[data-theme="dark"] select.tsel option,html[data-theme="dark"] select.esel option,html[data-theme="dark"] select.ffsel option{background:var(--card);color:var(--txt)}
html[data-theme="dark"] .peligro{background:#2a1416;border-color:#5b1f24}
html[data-theme="dark"] .peligro .pelcab{color:#fca5a5} html[data-theme="dark"] .peligro .pelsub{color:#e7b3b3}
html[data-theme="dark"] .avisobar{background:#33270b;border-color:#5c4511;color:#fcd34d}
html[data-theme="dark"] .avisobar.rojo{background:#3a1517;border-color:#5b1f24;color:#fca5a5}
html[data-theme="dark"] .avisobar .btn{background:var(--card)}
html[data-theme="dark"] .cellinput::placeholder{color:#4b5263}
html[data-theme="dark"] .repbar,html[data-theme="dark"] .tipfac .tf-bar,html[data-theme="dark"] #tab-peticiones td.num .facbar{background:#2a2f3c}
html[data-theme="dark"] .ghead .extra{background:rgba(255,255,255,.08)}
html[data-theme="dark"] #tab-peticiones .group[data-est] .ghead .cnt,html[data-theme="dark"] #tab-facturacion .group[data-fgrupo] .ghead .cnt{color:var(--muted)}
html[data-theme="dark"] #tab-peticiones .group[data-est],html[data-theme="dark"] #tab-facturacion .group[data-fgrupo]{
  --g-line:color-mix(in srgb,var(--g-bd) 30%,#272c39);
  --g-head:color-mix(in srgb,var(--g-bd) 22%,#151821);
  --g-th:color-mix(in srgb,var(--g-bd) 12%,#151821);
  --g-fila:#151821;
  --g-zebra:color-mix(in srgb,var(--g-bd) 6%,#151821);
  --g-hover:color-mix(in srgb,var(--g-bd) 16%,#151821)}
html[data-theme="dark"] body.faltas #tab-peticiones .group[data-est="En Progreso"] tbody tr:nth-child(even) td.falta{background:var(--ambar2)}
html[data-theme="dark"] .stat.k-g-sf,html[data-theme="dark"] .stat.k-g-fa,html[data-theme="dark"] .stat.k-g-re,html[data-theme="dark"] .stat.k-g-ve,html[data-theme="dark"] .stat.k-g-co{background:var(--card)}
html[data-theme="dark"] td.cp .cellinput,html[data-theme="dark"] .cpmini,html[data-theme="dark"] td.prev{color:var(--muted)}

/* ---------- pantallas estrechas ---------- */
@media (max-width:900px){
  .gx-con-lateral{padding-left:0}
  .gx-side{position:sticky;top:0;bottom:auto;width:auto;flex-direction:row;align-items:center;border-right:none;border-bottom:1px solid var(--line);z-index:45}
  .gx-side-brand{height:52px;padding:0 10px;border-bottom:none;border-right:1px solid var(--line)}
  .gx-side-brand img{max-height:24px;max-width:100px}
  .gx-side-scroll{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:4px;overflow-x:auto;overflow-y:hidden;padding:6px 8px}
  .gx-side-foot .entorno{display:none}
  .gx-side-label{display:none}
  .gx-side .tabs{flex-direction:row}
  .gx-side-link,.gx-side .tabs button{width:auto;white-space:nowrap;border-radius:999px;padding:6px 12px}
  .gx-side-foot{flex-direction:row;align-items:center;border-top:none;padding:6px 8px}
  .gx-user{padding:4px 6px;gap:6px}
  .gx-user-info,.gx-avatar{display:none}
  .gx-theme-switch button span:not(.gx-ico){display:none}
  body.portal main{padding:20px 14px 32px}
  header.top{position:static}
}
@media print{.gx-side{display:none} .gx-con-lateral{padding-left:0}}
@media (prefers-reduced-motion:reduce){.btn:active:not([disabled]){transform:none}.tarjeta,.tarjeta::after{transition:none}}


/* ---------- franja de «entorno de pruebas» ----------
   Visible siempre, no dependa o no de que la barra lateral esté desplegada.
   Es la comprobación de un vistazo antes de tocar datos: si no hay franja
   ámbar, estás en producción. */
body.gx-pruebas{border-top:4px solid var(--ambarTxt, #d2810f)}
body.gx-pruebas::after{
  content:attr(data-entorno);
  position:fixed;top:4px;left:50%;transform:translateX(-50%);
  z-index:200;pointer-events:none;
  background:var(--ambarTxt, #d2810f);color:#1b1f0a;
  font-size:10.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
  padding:2px 12px 3px;border-radius:0 0 8px 8px;box-shadow:0 2px 6px rgba(0,0,0,.18);
  max-width:60vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media print{ body.gx-pruebas::after{display:none} }

/* ---------- panel de resumen en modo oscuro ----------
   Los mismos colores, re-escalonados para el fondo oscuro: no es un
   volteo automático, son los pasos validados contra #151821. */
html[data-theme="dark"] #tab-resumen{
  --viz-1:#3987e5; --viz-2:#199e70;
  --viz-r1:#9ec5f4; --viz-r2:#6da7ec; --viz-r3:#3987e5; --viz-r4:#184f95;
  --viz-c1:#3987e5; --viz-c2:#d95926; --viz-c3:#199e70; --viz-c4:#c98500; --viz-c5:#d55181;
  --viz-otros:#898781;
  --viz-grid:#272c39;
}
html[data-theme="dark"] .vizkpi.malo b{color:#f87171}
html[data-theme="dark"] .vizkpi.malo{border-color:#5c2b22}
html[data-theme="dark"] .vizavisos li.critico b{color:#f87171}
html[data-theme="dark"] .avgrupo.critico .avtit,
html[data-theme="dark"] .avgrupo.critico .avtit b{color:#f87171;border-bottom-color:#5c2b22}
html[data-theme="dark"] .avgrupo.serio .avtit,
html[data-theme="dark"] .avgrupo.serio .avtit b{color:#fbbf24;border-bottom-color:#46360f}
html[data-theme="dark"] .avcuenta{background:#1f2330;color:var(--muted)}
html[data-theme="dark"] .vizavisos li.mas b{color:var(--gx-accent)}
html[data-theme="dark"] .avok{background:var(--gx-soft);border-color:var(--line)}
html[data-theme="dark"] .avhechas,html[data-theme="dark"] .avtodas{background:var(--gx-soft)}
html[data-theme="dark"] .avhechas[aria-pressed=true]{background:var(--gx-accent);border-color:var(--gx-accent);color:#fff}
html[data-theme="dark"] .avtodas{color:var(--gx-green-ink)}
html[data-theme="dark"] #panelTip{background:#e8eaf0;color:#111827}
html[data-theme="dark"] .vizcard,html[data-theme="dark"] .vizkpi{box-shadow:var(--gx-shadow)}
html[data-theme="dark"] .vizpista{background:#1f2330}
