/* ==========================================================================
   AsisNom — capa de refinamiento visual (panel de empresa + pantallas de acceso)
   Se carga DESPUÉS de style.css / components.css / dark.css / responsive.css.
   Solo cambia apariencia (colores, espaciado, tipografía): no toca lógica ni datos.
   Para volver al diseño anterior basta con quitar el <link> a este archivo.
   Rendimiento: CSS puro, sin librerías, sin blur ni animaciones continuas.
   ========================================================================== */

/* ---------- 1. Paleta (azul marino de la marca + dorado como detalle) ---------- */
:root {
  --primary: #1f4a8f;
  --primary-dark: #173a73;
  --primary-ink: #1f4a8f;               /* color de texto/iconos "de marca" sobre fondo claro */
  --primary-soft: rgba(31, 74, 143, .08);
  --primary-ring: rgba(31, 74, 143, .18);
  --accent: #c99a2e;

  --body-bg: #f4f6fa;
  --sidebar-bg: #ffffff;
  --card-bg: #ffffff;
  --border: #e3e8f0;
  --border-strong: #cfd7e4;
  --text: #1b2740;
  --gray: #55637d;
  --muted: #5f6f87;
  --neutral-bg: #eef1f6;
  --neutral-hover: #e3e8f0;

  --ok-ink: #0f7a45;   --ok-bg: rgba(22, 163, 74, .11);   --ok-bd: rgba(22, 163, 74, .28);
  --warn-ink: #92590a; --warn-bg: rgba(217, 119, 6, .12); --warn-bd: rgba(217, 119, 6, .30);
  --bad-ink: #b3261e;  --bad-bg: rgba(220, 38, 38, .09);  --bad-bd: rgba(220, 38, 38, .26);
  --info-ink: #0b6a98; --info-bg: rgba(2, 132, 199, .10); --info-bd: rgba(2, 132, 199, .26);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --sidebar-w: 248px;
  --topbar-h: 64px;

  --bs-primary: #1f4a8f;
  --bs-primary-rgb: 31, 74, 143;
  --bs-link-color: #1f4a8f;
  --bs-link-hover-color: #173a73;
  --bs-body-font-size: .92rem;
}

[data-theme="dark"] {
  color-scheme: dark;
  --primary: #3a6dd0;
  --primary-dark: #2f5bb0;
  --primary-ink: #9fbcf2;
  --primary-soft: rgba(110, 156, 238, .13);
  --primary-ring: rgba(110, 156, 238, .30);
  --accent: #e0b04a;

  --body-bg: #0d1322;
  --sidebar-bg: #111a2d;
  --card-bg: #162037;
  --border: #243049;
  --border-strong: #33425f;
  --text: #e6ebf6;
  --gray: #b3bfd4;
  --muted: #8fa0bb;
  --neutral-bg: #1f2b45;
  --neutral-hover: #29375a;

  --ok-ink: #4ade80;   --ok-bg: rgba(74, 222, 128, .12);  --ok-bd: rgba(74, 222, 128, .30);
  --warn-ink: #fbbf24; --warn-bg: rgba(251, 191, 36, .12); --warn-bd: rgba(251, 191, 36, .30);
  --bad-ink: #fca5a5;  --bad-bg: rgba(248, 113, 113, .13); --bad-bd: rgba(248, 113, 113, .32);
  --info-ink: #7dd3fc; --info-bg: rgba(56, 189, 248, .12); --info-bd: rgba(56, 189, 248, .30);

  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 34px rgba(0, 0, 0, .45);
  --bs-link-color: #9fbcf2;
  --bs-link-hover-color: #c3d6f8;
}

/* ---------- 2. Base ---------- */
html { font-size: 15px; }
body {
  background: var(--body-bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: none;
}
a:not(.btn):not(.side-link):not(.dropdown-item):not(.page-link) { color: var(--primary-ink); }
a:not(.btn):not(.side-link):not(.dropdown-item):not(.page-link):hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { color: var(--text); letter-spacing: -.01em; }
.text-muted { color: var(--muted) !important; }
.text-primary { color: var(--primary-ink) !important; }
::selection { background: var(--primary-ring); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- 3. Menú lateral ---------- */
.sidebar {
  width: var(--sidebar-w);
  padding: 18px 12px 14px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  transition: transform .2s ease;       /* antes animaba también el ancho */
}
/* Logo: el HTML trae un tamaño fijo 150x150 con "brillo" blanco; se reemplaza por proporción real y sin filtros */
.sidebar > a:first-child { padding: 6px 8px 14px !important; }
.sidebar > a:first-child img {
  width: 100% !important; max-width: 176px !important;
  height: auto !important; max-height: 96px !important;
  filter: none !important;
}
[data-theme="dark"] .sidebar > a:first-child img {
  background: #fff; border-radius: 12px; padding: 6px 10px; max-width: 150px !important;
}
.sidebar-nav { margin-top: 6px; padding-right: 0; }
.nav-label {
  padding: 14px 12px 6px;
  font-size: .66rem; font-weight: 700; letter-spacing: .09em;
  color: var(--muted);
}
.side-link {
  position: relative;
  gap: 12px;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: 8px;
  font-size: .9rem; font-weight: 500;
  color: var(--gray);
  transition: background .15s, color .15s;
}
.side-link i { font-size: 1.08rem; width: 1.2rem; text-align: center; opacity: .85; }
.side-link:hover { color: var(--text); background: var(--neutral-bg); }
.side-link.active {
  color: var(--primary-ink);
  background: var(--primary-soft);
  font-weight: 600;
}
.side-link.active i { opacity: 1; }
.side-link.active::before {            /* detalle dorado */
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 3px; background: var(--accent);
}

/* ---------- 4. Barra superior ---------- */
.topbar {
  height: var(--topbar-h);
  padding: 0 28px;
  background: var(--card-bg);
  backdrop-filter: none;               /* el desenfoque cuesta rendimiento y aporta poco */
  border-bottom: 1px solid var(--border);
}
.topbar strong { font-size: .9rem; font-weight: 600; letter-spacing: 0; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px;
  color: var(--gray); border-color: var(--border);
}
.icon-btn:hover { color: var(--primary-ink); border-color: var(--primary); background: var(--primary-soft); }
.notification-dot { background: var(--accent); }
.avatar { background: var(--primary); width: 36px; height: 36px; font-size: .82rem; letter-spacing: .02em; }
.topbar .dropdown > a.d-flex { color: var(--text) !important; text-decoration: none !important; cursor: pointer; }

/* ---------- 5. Contenido y encabezados ---------- */
.content { padding: 28px 32px 40px; max-width: 1680px; margin: 0; }
.page-heading { margin-bottom: 22px; }
.page-heading h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 2px; }
.page-heading p { font-size: .9rem; }
.content .row { --bs-gutter-y: 1rem; }

/* ---------- 6. Tarjetas ---------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
}
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-color: var(--border); font-weight: 600; }
.card h3 { font-size: 1.02rem; font-weight: 650; margin: 0 0 12px; }
.card.card-body > h3:first-child { margin-bottom: 14px; }
/* Tarjetas de cifras (Dashboard): número grande, etiqueta pequeña */
.card-body > strong.h2, .card.card-body > strong.h2 {
  display: block; font-size: 1.85rem; font-weight: 700; line-height: 1.1;
  letter-spacing: -.02em; margin: 0 0 4px; color: var(--text);
}
.card-body > strong.h2 + .text-muted { font-size: .82rem; font-weight: 500; }

/* ---------- 7. Botones ---------- */
.btn {
  border-radius: 8px;
  padding: .5rem .95rem;
  font-size: .86rem; font-weight: 600; line-height: 1.35;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn.sm, .btn-sm { padding: .32rem .7rem; font-size: .8rem; border-radius: 7px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-primary:focus-visible, .btn:focus-visible { box-shadow: 0 0 0 .2rem var(--primary-ring); outline: 0; }

.btn.gris, .btn-secondary {
  background: var(--neutral-bg); color: var(--text); border-color: var(--border-strong);
}
.btn.gris:hover, .btn-secondary:hover { background: var(--neutral-hover); color: var(--text); border-color: var(--border-strong); }
.btn.verde, .btn-success { background: #167a42; border-color: #167a42; color: #fff; }
.btn.verde:hover, .btn-success:hover { background: #11623a; border-color: #11623a; color: #fff; }
.btn.rojo, .btn-danger { background: #b83228; border-color: #b83228; color: #fff; }
.btn.rojo:hover, .btn-danger:hover { background: #962a21; border-color: #962a21; color: #fff; }
.btn-warning { background: #c98a12; border-color: #c98a12; color: #fff; }
.btn-warning:hover { background: #a87310; border-color: #a87310; color: #fff; }
[data-theme="dark"] .btn.verde, [data-theme="dark"] .btn-success { background: #187a42; border-color: #187a42; }
[data-theme="dark"] .btn.rojo, [data-theme="dark"] .btn-danger { background: #c53a30; border-color: #c53a30; }

/* Botones "contorno": mismo trazo, color legible en ambos temas */
.btn-outline-primary   { --bs-btn-color: var(--primary-ink); --bs-btn-border-color: var(--primary-ink); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--primary-dark); --bs-btn-active-border-color: var(--primary-dark); --bs-btn-active-color: #fff; }
.btn-outline-secondary { --bs-btn-color: var(--gray); --bs-btn-border-color: var(--border-strong); --bs-btn-hover-bg: var(--neutral-hover); --bs-btn-hover-border-color: var(--border-strong); --bs-btn-hover-color: var(--text); --bs-btn-active-bg: var(--neutral-hover); --bs-btn-active-color: var(--text); --bs-btn-active-border-color: var(--border-strong); }
.btn-outline-success   { --bs-btn-color: var(--ok-ink); --bs-btn-border-color: var(--ok-bd); --bs-btn-hover-bg: #167a42; --bs-btn-hover-border-color: #167a42; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #11623a; --bs-btn-active-color: #fff; --bs-btn-active-border-color: #11623a; }
.btn-outline-danger    { --bs-btn-color: var(--bad-ink); --bs-btn-border-color: var(--bad-bd); --bs-btn-hover-bg: #b83228; --bs-btn-hover-border-color: #b83228; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #962a21; --bs-btn-active-color: #fff; --bs-btn-active-border-color: #962a21; }
.btn-outline-info      { --bs-btn-color: var(--info-ink); --bs-btn-border-color: var(--info-bd); --bs-btn-hover-bg: #0b6a98; --bs-btn-hover-border-color: #0b6a98; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #095680; --bs-btn-active-color: #fff; --bs-btn-active-border-color: #095680; }
.btn-outline-warning   { --bs-btn-color: var(--warn-ink); --bs-btn-border-color: var(--warn-bd); --bs-btn-hover-bg: #c98a12; --bs-btn-hover-border-color: #c98a12; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #a87310; --bs-btn-active-color: #fff; --bs-btn-active-border-color: #a87310; }
.btn-soft-primary { background: var(--primary-soft); color: var(--primary-ink); }
.btn-soft-primary:hover { background: var(--primary); color: #fff; }
.btn-group > .btn { white-space: nowrap; }
.page-heading .btn.sm, .page-heading .btn-sm { padding: .5rem .95rem; font-size: .86rem; border-radius: 8px; }
.page-heading.d-flex > .btn + .btn, .page-heading.d-flex > a + a { margin-right: 0 !important; }

/* ---------- 8. Formularios ---------- */
.form-label, .label-form { font-size: .8rem; font-weight: 600; color: var(--gray); margin-bottom: .35rem; }
.form-control, .form-select {
  background-color: var(--card-bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 8px;
  padding: .55rem .75rem;
  font-size: .92rem;
  min-height: 40px;
}
.form-control-sm, .form-select-sm { min-height: 34px; padding: .35rem .65rem; font-size: .86rem; border-radius: 7px; }
.form-control::placeholder { color: var(--muted); opacity: .8; }
.form-control:focus, .form-select:focus {
  background-color: var(--card-bg); color: var(--text);
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem var(--primary-ring);
}
.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: var(--neutral-bg); color: var(--muted); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.input-group-text { background: var(--neutral-bg); border-color: var(--border-strong); color: var(--gray); }
form > label.h4, form label.h4 {        /* "Buscar" y similares: etiqueta discreta, no título */
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 6px;
}
.form-box:not(:has(.row)) { max-width: 560px; }
.form-box label { font-size: .8rem; font-weight: 600; color: var(--gray); display: block; margin-bottom: 4px; }
.form-box input:not([type=checkbox]):not([type=radio]), .form-box select, .form-box textarea { width: 100%; }

/* ---------- 9. Tablas ---------- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { --bs-table-hover-bg: var(--primary-soft); --bs-table-hover-color: var(--text); font-size: .88rem; }
.table > :not(caption) > * > * { padding: 12px 14px; border-bottom-color: var(--border); vertical-align: middle; }
.table thead th {
  font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); background: transparent; white-space: nowrap;
  border-bottom: 1px solid var(--border-strong);
}
.table tbody tr:last-child > * { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { background-color: var(--primary-soft); color: var(--text); }
.table td .btn-group .btn { padding: .28rem .6rem; font-size: .78rem; }
.table td:first-child strong, .table td strong { font-weight: 650; }

/* ---------- 10. Estados (píldoras suaves) ---------- */
.badge {
  border-radius: 999px; padding: .3em .7em;
  font-size: .72rem; font-weight: 650; letter-spacing: .01em;
  border: 1px solid transparent;
}
.badge.bg-success, .badge.activo, .badge.entrada { background: var(--ok-bg) !important; color: var(--ok-ink) !important; border-color: var(--ok-bd); }
.badge.bg-danger, .badge.inactivo               { background: var(--bad-bg) !important; color: var(--bad-ink) !important; border-color: var(--bad-bd); }
.badge.bg-warning, .badge.salida                { background: var(--warn-bg) !important; color: var(--warn-ink) !important; border-color: var(--warn-bd); }
.badge.bg-info                                  { background: var(--info-bg) !important; color: var(--info-ink) !important; border-color: var(--info-bd); }
.badge.bg-primary                               { background: var(--primary-soft) !important; color: var(--primary-ink) !important; border-color: var(--primary-ring); }
.badge.bg-secondary, .badge.bg-dark, .badge.bg-light { background: var(--neutral-bg) !important; color: var(--gray) !important; border-color: var(--border); }
.status { border-radius: 999px; padding: .3em .7em; font-size: .72rem; font-weight: 650; }
.status.success { background: var(--ok-bg); color: var(--ok-ink); }
.status.warning { background: var(--warn-bg); color: var(--warn-ink); }

/* ---------- 11. Alertas ---------- */
.alert, .alerta {
  border: 1px solid var(--border); border-radius: 10px;
  padding: .75rem 1rem; font-size: .88rem; margin-bottom: 16px;
}
.alert-success, .alerta.ok       { background: var(--ok-bg);   border-color: var(--ok-bd);   color: var(--ok-ink); }
.alert-danger,  .alerta.error    { background: var(--bad-bg);  border-color: var(--bad-bd);  color: var(--bad-ink); }
.alert-warning                   { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-ink); }
.alert-info                      { background: var(--info-bg); border-color: var(--info-bd); color: var(--info-ink); }

/* ---------- 12. Menús desplegables, modales, paginación, pestañas ---------- */
.dropdown-menu {
  background: var(--card-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 6px; font-size: .88rem;
}
.dropdown-item { color: var(--text); border-radius: 6px; padding: .45rem .75rem; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--primary-soft); color: var(--text); }
.dropdown-item.text-danger { color: var(--bad-ink) !important; }
.dropdown-divider { border-top-color: var(--border); }
.notification-menu { border-radius: 12px; }
.modal-content { border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.page-link { background: var(--card-bg); border-color: var(--border); color: var(--gray); }
.page-link:hover { background: var(--primary-soft); color: var(--primary-ink); }
.page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }
.nav-tabs { border-bottom-color: var(--border); }
.nav-tabs .nav-link { color: var(--gray); border: 0; border-bottom: 2px solid transparent; font-weight: 600; font-size: .88rem; }
.nav-tabs .nav-link:hover { color: var(--text); }
.nav-tabs .nav-link.active { color: var(--primary-ink); background: transparent; border-bottom-color: var(--accent); }
.list-group-item { background: var(--card-bg); color: var(--text); border-color: var(--border); }
hr { border-color: var(--border); opacity: 1; }

/* Utilidades de Bootstrap que en oscuro quedaban claras */
[data-theme="dark"] .bg-white, [data-theme="dark"] .bg-light { background-color: var(--card-bg) !important; }
[data-theme="dark"] .text-dark { color: var(--text) !important; }
[data-theme="dark"] .border, [data-theme="dark"] .border-top, [data-theme="dark"] .border-bottom { border-color: var(--border) !important; }

/* ---------- 13. Asistente de ayuda (botón flotante) ---------- */
#asistenteBoton {
  background: var(--primary) !important; width: 48px !important; height: 48px !important;
  font-size: 20px !important; bottom: 20px !important; right: 20px !important;
  box-shadow: 0 6px 16px rgba(16, 24, 40, .25) !important;
}
#asistentePanel {
  background: var(--card-bg) !important; border: 1px solid var(--border);
  right: 20px !important; bottom: 80px !important; width: min(340px, calc(100vw - 32px)) !important;
}
#asistentePanel > div:first-child { background: var(--primary) !important; }
#asistenteResultados { color: var(--text) !important; }
#asistenteResultados p, #asistenteResultados [style*="98a6bd"] { color: var(--muted) !important; }
#asistenteResultados [style*="a5b4fc"] { color: var(--primary-ink) !important; }
#asistentePanel input { background: var(--body-bg) !important; color: var(--text) !important; border-color: var(--border-strong) !important; }
#asistenteEnviar { background: var(--primary) !important; }


/* ---------- 14. Ajustes sobre estilos en línea que ya existen en las vistas ---------- */
/* Pestañas tipo "píldora" (Planilla, Catálogos, Bitácora, RR.HH.): control segmentado sobrio */
div[style*="background: #e2e8f0"] {
  background: var(--neutral-bg) !important;
  border: 1px solid var(--border);
  border-radius: 10px !important;
  padding: 3px; gap: 2px;
  max-width: 100%;
}
div[style*="background: #e2e8f0"] > a,
div[style*="background: #e2e8f0"] > button {
  border-radius: 8px !important;
  color: var(--gray) !important;
  font-weight: 500;
  white-space: nowrap;
}
div[style*="background: #e2e8f0"] > a:hover,
div[style*="background: #e2e8f0"] > button:hover { color: var(--text) !important; }
div[style*="background: #e2e8f0"] > [style*="#1d4ed8"],
div[style*="background: #e2e8f0"] > [style*="29, 78, 216"] {
  background: var(--card-bg) !important;
  color: var(--primary-ink) !important;
  font-weight: 650 !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .12), inset 0 -2px 0 var(--accent);
}
@media (max-width: 767.98px) {
  div[style*="background: #e2e8f0"] { display: flex !important; overflow-x: auto; flex-wrap: nowrap !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  div[style*="background: #e2e8f0"]::-webkit-scrollbar { display: none; }
}

/* Textos en gris/pizarra fijos (#64748b, #475569…) quedaban apagados en oscuro */
[data-theme="dark"] [style*="color:#64748b"], [data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] [style*="color:#475569"], [data-theme="dark"] [style*="color: #475569"] { color: var(--muted) !important; }
[data-theme="dark"] [style*="color:#1e293b"], [data-theme="dark"] [style*="color: #1e293b"],
[data-theme="dark"] [style*="color:#334155"], [data-theme="dark"] [style*="color: #334155"] { color: var(--text) !important; }

/* Acciones destructivas dentro de tablas: contorno suave (sólido solo al pasar el cursor) */
.table .btn.rojo, .table .btn-danger {
  background: var(--bad-bg); color: var(--bad-ink); border-color: var(--bad-bd);
}
.table .btn.rojo:hover, .table .btn-danger:hover { background: #b83228; border-color: #b83228; color: #fff; }

/* Títulos de página: una sola escala */
.content h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .25rem; }
.content .card h2, .content .modal h2 { font-size: 1.15rem; }
.content h3 { font-size: 1.05rem; font-weight: 650; }
@media (max-width: 575.98px) { .content h2 { font-size: 1.25rem; } }


/* En móvil las tablas se desplazan de lado en vez de partir cada celda en 3-4 líneas */
@media (max-width: 767.98px) {
  .table-responsive .table td, .table-responsive .table th { white-space: nowrap; }
  .table-responsive .table td.text-wrap, .table-responsive .table td[style*="white-space: normal"] { white-space: normal; min-width: 200px; }
}


/* Cuadrículas con columnas de ancho mínimo fijo definidas en línea: nunca más anchas que la pantalla */
@media (max-width: 575.98px) {
  [style*="minmax(260px"] { grid-template-columns: 1fr !important; }
  [style*="minmax(280px"] { grid-template-columns: 1fr !important; }
  [style*="minmax(300px"] { grid-template-columns: 1fr !important; }
  [style*="minmax(320px"] { grid-template-columns: 1fr !important; }
  [style*="minmax(340px"] { grid-template-columns: 1fr !important; }
  [style*="minmax(360px"] { grid-template-columns: 1fr !important; }
  [style*="minmax(380px"] { grid-template-columns: 1fr !important; }
  [style*="minmax(400px"] { grid-template-columns: 1fr !important; }
  [style*="minmax(420px"] { grid-template-columns: 1fr !important; }
  [style*="minmax(440px"] { grid-template-columns: 1fr !important; }
  [style*="minmax(460px"] { grid-template-columns: 1fr !important; }
  [style*="minmax(480px"] { grid-template-columns: 1fr !important; }
}

/* ==========================================================================
   PANTALLAS DE ACCESO (login empresa y login administrador)
   ========================================================================== */
.auth-page { background: var(--body-bg); grid-template-columns: 1.08fr .92fr; }

/* Marca de agua: iconos de línea (reloj, calendario, recibo, QR, credencial, gráfica, moneda). Un solo SVG
   incrustado de ~2 KB que se repite; no hay imágenes externas que descargar. */
.auth-form {
  position: relative;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420' fill='none' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%231f4a8f' stroke-opacity='0.085'%3E%3Cg transform='translate(46 52)'%3E%3Ccircle cx='34' cy='34' r='30'/%3E%3Cpath d='M34 16v19l13 8'/%3E%3C/g%3E%3Cg transform='translate(250 34) rotate(6)'%3E%3Crect x='0' y='6' width='70' height='62' rx='8'/%3E%3Cpath d='M0 24h70M18 0v12M52 0v12M14 38h8M31 38h8M48 38h8M14 52h8M31 52h8'/%3E%3C/g%3E%3Cg transform='translate(168 150) rotate(-5)'%3E%3Crect x='0' y='0' width='56' height='72' rx='6'/%3E%3Cpath d='M12 18h32M12 31h32M12 44h20'/%3E%3Cpath d='M12 58h10M34 58h10'/%3E%3C/g%3E%3Cg transform='translate(46 196)'%3E%3Crect x='0' y='0' width='26' height='26' rx='3'/%3E%3Crect x='46' y='0' width='26' height='26' rx='3'/%3E%3Crect x='0' y='46' width='26' height='26' rx='3'/%3E%3Crect x='8' y='8' width='10' height='10'/%3E%3Crect x='54' y='8' width='10' height='10'/%3E%3Crect x='8' y='54' width='10' height='10'/%3E%3Cpath d='M46 50h8v8h-8zM62 62h10M46 70h8M64 46v6'/%3E%3C/g%3E%3Cg transform='translate(300 190) rotate(5)'%3E%3Crect x='0' y='0' width='84' height='54' rx='7'/%3E%3Ccircle cx='24' cy='22' r='9'/%3E%3Cpath d='M10 44c2-8 8-12 14-12s12 4 14 12M52 18h22M52 30h16'/%3E%3C/g%3E%3Cg transform='translate(58 322)'%3E%3Cpath d='M0 56V0M0 56h84'/%3E%3Cpath d='M16 56V34M36 56V18M56 56V40M76 56V8'/%3E%3C/g%3E%3Cg transform='translate(236 316)'%3E%3Ccircle cx='32' cy='32' r='30'/%3E%3Ccircle cx='32' cy='32' r='21'/%3E%3Cpath d='M32 18v28M40 24c-2-3-6-4-9-4-5 0-8 3-8 6 0 9 18 4 18 13 0 3-4 6-9 6-4 0-8-2-10-5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / 420px 420px repeat, var(--body-bg);
}
[data-theme="dark"] .auth-form {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420' fill='none' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='white' stroke-opacity='0.07'%3E%3Cg transform='translate(46 52)'%3E%3Ccircle cx='34' cy='34' r='30'/%3E%3Cpath d='M34 16v19l13 8'/%3E%3C/g%3E%3Cg transform='translate(250 34) rotate(6)'%3E%3Crect x='0' y='6' width='70' height='62' rx='8'/%3E%3Cpath d='M0 24h70M18 0v12M52 0v12M14 38h8M31 38h8M48 38h8M14 52h8M31 52h8'/%3E%3C/g%3E%3Cg transform='translate(168 150) rotate(-5)'%3E%3Crect x='0' y='0' width='56' height='72' rx='6'/%3E%3Cpath d='M12 18h32M12 31h32M12 44h20'/%3E%3Cpath d='M12 58h10M34 58h10'/%3E%3C/g%3E%3Cg transform='translate(46 196)'%3E%3Crect x='0' y='0' width='26' height='26' rx='3'/%3E%3Crect x='46' y='0' width='26' height='26' rx='3'/%3E%3Crect x='0' y='46' width='26' height='26' rx='3'/%3E%3Crect x='8' y='8' width='10' height='10'/%3E%3Crect x='54' y='8' width='10' height='10'/%3E%3Crect x='8' y='54' width='10' height='10'/%3E%3Cpath d='M46 50h8v8h-8zM62 62h10M46 70h8M64 46v6'/%3E%3C/g%3E%3Cg transform='translate(300 190) rotate(5)'%3E%3Crect x='0' y='0' width='84' height='54' rx='7'/%3E%3Ccircle cx='24' cy='22' r='9'/%3E%3Cpath d='M10 44c2-8 8-12 14-12s12 4 14 12M52 18h22M52 30h16'/%3E%3C/g%3E%3Cg transform='translate(58 322)'%3E%3Cpath d='M0 56V0M0 56h84'/%3E%3Cpath d='M16 56V34M36 56V18M56 56V40M76 56V8'/%3E%3C/g%3E%3Cg transform='translate(236 316)'%3E%3Ccircle cx='32' cy='32' r='30'/%3E%3Ccircle cx='32' cy='32' r='21'/%3E%3Cpath d='M32 18v28M40 24c-2-3-6-4-9-4-5 0-8 3-8 6 0 9 18 4 18 13 0 3-4 6-9 6-4 0-8-2-10-5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / 420px 420px repeat, var(--body-bg);
}

.auth-art {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(32px, 6vw, 88px);
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(255,255,255,.07), transparent 60%),
    linear-gradient(155deg, #0d2347 0%, #163a73 55%, #1f4a8f 100%);
  color: #fff;
}
.auth-art::after { display: none; }
.auth-art::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420' viewBox='0 0 420 420' fill='none' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='white' stroke-opacity='0.075'%3E%3Cg transform='translate(46 52)'%3E%3Ccircle cx='34' cy='34' r='30'/%3E%3Cpath d='M34 16v19l13 8'/%3E%3C/g%3E%3Cg transform='translate(250 34) rotate(6)'%3E%3Crect x='0' y='6' width='70' height='62' rx='8'/%3E%3Cpath d='M0 24h70M18 0v12M52 0v12M14 38h8M31 38h8M48 38h8M14 52h8M31 52h8'/%3E%3C/g%3E%3Cg transform='translate(168 150) rotate(-5)'%3E%3Crect x='0' y='0' width='56' height='72' rx='6'/%3E%3Cpath d='M12 18h32M12 31h32M12 44h20'/%3E%3Cpath d='M12 58h10M34 58h10'/%3E%3C/g%3E%3Cg transform='translate(46 196)'%3E%3Crect x='0' y='0' width='26' height='26' rx='3'/%3E%3Crect x='46' y='0' width='26' height='26' rx='3'/%3E%3Crect x='0' y='46' width='26' height='26' rx='3'/%3E%3Crect x='8' y='8' width='10' height='10'/%3E%3Crect x='54' y='8' width='10' height='10'/%3E%3Crect x='8' y='54' width='10' height='10'/%3E%3Cpath d='M46 50h8v8h-8zM62 62h10M46 70h8M64 46v6'/%3E%3C/g%3E%3Cg transform='translate(300 190) rotate(5)'%3E%3Crect x='0' y='0' width='84' height='54' rx='7'/%3E%3Ccircle cx='24' cy='22' r='9'/%3E%3Cpath d='M10 44c2-8 8-12 14-12s12 4 14 12M52 18h22M52 30h16'/%3E%3C/g%3E%3Cg transform='translate(58 322)'%3E%3Cpath d='M0 56V0M0 56h84'/%3E%3Cpath d='M16 56V34M36 56V18M56 56V40M76 56V8'/%3E%3C/g%3E%3Cg transform='translate(236 316)'%3E%3Ccircle cx='32' cy='32' r='30'/%3E%3Ccircle cx='32' cy='32' r='21'/%3E%3Cpath d='M32 18v28M40 24c-2-3-6-4-9-4-5 0-8 3-8 6 0 9 18 4 18 13 0 3-4 6-9 6-4 0-8-2-10-5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / 420px 420px repeat;
}
.auth-art::before {
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 32% 50%, rgba(0,0,0,.18) 0%, #000 100%);
          mask-image: radial-gradient(ellipse 60% 55% at 32% 50%, rgba(0,0,0,.18) 0%, #000 100%);
}
.auth-copy { position: relative; z-index: 1; max-width: 500px; }
.auth-copy h1 { text-wrap: balance; }
.auth-copy h1 {
  font-size: clamp(1.9rem, 3vw, 2.7rem); line-height: 1.12; letter-spacing: -.03em;
  font-weight: 700; margin: 22px 0 12px; color: #fff;
}
.auth-copy .auth-lead { color: rgba(255,255,255,.82); font-size: 1.02rem; margin-bottom: 22px; }
.auth-rule { width: 44px; height: 3px; border-radius: 2px; background: var(--accent); margin: 0 0 4px; }
.auth-brand-name { font-size: 1.05rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.auth-points { list-style: none; padding: 0; margin: 0 0 26px; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; padding: 7px 0; color: rgba(255,255,255,.9); font-size: .95rem; line-height: 1.45; }
.auth-points i { color: var(--accent); font-size: 1.05rem; margin-top: 1px; flex: 0 0 auto; }
.auth-contact { font-size: .88rem; color: rgba(255,255,255,.75); border-top: 1px solid rgba(255,255,255,.16); padding-top: 18px; }
.auth-contact a { color: #fff !important; font-weight: 600; text-decoration: none; }
.auth-contact a:hover { text-decoration: underline; }

.auth-form { display: flex; align-items: center; justify-content: center; padding: 36px 24px; }
.auth-box {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 34px 32px 26px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { display: flex; justify-content: center; margin: 0 0 18px; }
.auth-logo img { width: 190px; max-width: 70%; height: auto; display: block; }
[data-theme="dark"] .auth-logo img { background: #fff; border-radius: 12px; padding: 8px 14px; }
.auth-box h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 4px; text-align: center; }
.auth-box .auth-sub { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 22px; }
.auth-box .btn-primary { padding: .65rem 1rem; font-size: .92rem; }
.auth-box .alert { margin-bottom: 18px; }
.auth-footer {
  position: static; margin: 22px 0 0; text-align: center;
  color: var(--muted); font-size: .76rem; line-height: 1.7;
}
.auth-footer a { color: var(--muted) !important; text-decoration: none; }
.auth-footer a:hover { color: var(--primary-ink) !important; text-decoration: underline; }
.auth-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  background: rgba(201, 154, 46, .12); border: 1px solid rgba(201, 154, 46, .4);
  padding: 4px 11px; border-radius: 999px;
}

/* ---------- Tablet y móvil ---------- */
@media (max-width: 991.98px) {
  .sidebar { box-shadow: var(--shadow-lg); width: min(284px, 86vw); }
  .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 1035; background: rgba(8, 15, 30, .5);
    opacity: 0; visibility: hidden; transition: opacity .2s;
  }
  .sidebar-backdrop.show { opacity: 1; visibility: visible; }
  body.sidebar-open { overflow: hidden; }
  .topbar { padding: 0 16px; }
  .content { padding: 22px 18px 32px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-form { min-height: 100vh; align-items: center; padding: 28px 16px; }
}
@media (max-width: 575.98px) {
  html { font-size: 14.5px; }
  .content { padding: 16px 14px 28px; }
  .page-heading { margin-bottom: 16px; }
  .page-heading h1 { font-size: 1.25rem; }
  .page-heading.d-flex > .btn, .page-heading.d-flex > a.btn { flex: 1 1 auto; }
  .card-body, .card-header { padding: 16px; }
  .table > :not(caption) > * > * { padding: 10px 12px; }
  .content .btn { min-height: 38px; }                         /* objetivos táctiles cómodos */
  .content .btn.sm, .content .btn-sm { min-height: 34px; }
  .form-control, .form-select { font-size: 16px; }             /* evita el zoom automático de iOS al enfocar */
  .auth-box { padding: 26px 20px 20px; border-radius: 14px; }
  .auth-form { padding: 20px 12px; }
  .topbar .hide-mobile { display: none !important; }
  #asistenteBoton { bottom: 14px !important; right: 14px !important; }
}

/* Los formularios con anchos fijos inline (p. ej. el buscador) no deben desbordar en pantallas chicas */
@media (max-width: 575.98px) {
  form .d-flex > input.form-control[style*="width"] { width: 100% !important; margin-right: 8px !important; flex: 1 1 auto; min-width: 0; }
}

@media print {
  .sidebar-backdrop, #asistenteBoton, #asistentePanel { display: none !important; }
  body { background: #fff; }
}

/* ---- 1.9.1: coordinación de rejillas y alineación ---- */
.content, .main { min-width: 0; }
.content [style*="display:grid"] > *, .content [style*="display: grid"] > *,
.content .row > * { min-width: 0; }
.content [style*="display:grid"], .content [style*="display: grid"] { align-items: stretch !important; }
.content [style*="display:grid"] > .card, .content [style*="display: grid"] > .card { height: 100%; margin-bottom: 0; }
.card { min-width: 0; }
