/* ============================================================
   sincow-admin.css — Sistema de diseño SINCOW ERP
   Tema: Navy Blue · Colombia · Sector Público
   Basado en la arquitectura de Maintain Admin CSS
   ============================================================ */

/* ── Variables globales ──────────────────────────────────── */
:root {
  /* Paleta navy blue SINCOW */
  --s-950: #030a1a;
  --s-900: #071832;
  --s-800: #0d2855;
  --s-700: #1a3d7c;
  --s-600: #2354a8;
  --s-500: #3572d4;
  --s-400: #6096e8;
  --s-200: #afc8f5;
  --s-100: #d6e5fb;
  --s-50:  #eef4ff;

  /* Semánticos */
  --color-primary:       var(--s-700);
  --color-primary-hover: var(--s-500);
  --color-success:       #15803d;
  --color-warning:       #d97706;
  --color-danger:        #c0392b;
  --color-info:          #0891b2;

  /* Superficies */
  --surface:   #f0f4f8;
  --card:      #ffffff;
  --border:    #d0dae8;
  --border-lt: #e4ecf5;

  /* Textos */
  --text-1: #111827;
  --text-2: #374151;
  --text-3: #6b7280;

  /* Layout */
  --sidebar-w:           240px;
  --sidebar-w-collapsed: 56px;
  --topbar-h:            56px;
  --content-pad:         15px 24px;

  /* Tipografía */
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', 'Fira Code', 'Consolas', monospace;

  /* Espacios */
  --radius:    10px;
  --radius-sm: 7px;
  --radius-lg: 14px;

  /* Sombras */
  --shadow:    0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.05);
}

/* ── DARK MODE ──────────────────────────────────────────── */
html.dark {
  /* Paleta invertida */
  --s-950: #f8fafc;
  --s-50:  #0f172a;

  /* Semánticos (ajustados para contraste en fondo oscuro) */
  --color-primary:       #6096e8;
  --color-primary-hover: #afc8f5;
  --color-success:       #4ade80;
  --color-warning:       #fbbf24;
  --color-danger:        #f87171;
  --color-info:          #22d3ee;

  /* Superficies */
  --surface:   #0f172a;
  --card:      #1e293b;
  --border:    #334155;
  --border-lt: #1e293b;

  /* Textos */
  --text-1: #f1f5f9;
  --text-2: #cbd5e1;
  --text-3: #94a3b8;

  /* Sombras (más sutiles en dark) */
  --shadow:    0 1px 3px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35), 0 1px 4px rgba(0,0,0,.2);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.25);
}

/* Componentes que necesitan override explícito en dark */
html.dark .s-topbar { background: var(--card); border-bottom-color: var(--border); }
html.dark .s-input, html.dark .s-select, html.dark .s-textarea {
  background-color: #0f172a; border-color: var(--border); color: var(--text-1);
}
html.dark .s-input:focus, html.dark .s-select:focus, html.dark .s-textarea:focus {
  border-color: #6096e8; box-shadow: 0 0 0 3px rgba(96,150,232,.2);
}
html.dark .s-table thead th { background: #0f172a; color: var(--text-3); }
html.dark .s-table tbody tr:hover td { background: rgba(96,150,232,.08); }
html.dark .s-modal { background: var(--card); }
html.dark .s-modal-overlay { background: rgba(0,0,0,.7); }
html.dark .s-modal-footer { background: #0f172a; }
html.dark .s-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

/* Alerts dark */
html.dark .s-alert-success { background: #052e16; border-color: #166534; color: #4ade80; }
html.dark .s-alert-danger  { background: #450a0a; border-color: #991b1b; color: #fca5a5; }
html.dark .s-alert-warning { background: #451a03; border-color: #92400e; color: #fde68a; }
html.dark .s-alert-info    { background: #0c1e3a; border-color: #1e40af; color: #93c5fd; }

/* Badges dark */
html.dark .s-badge-active   { background: #1e3a5f; color: #93c5fd; }
html.dark .s-badge-inactive { background: #1e293b; color: #94a3b8; }
html.dark .s-badge-pending  { background: #451a03; color: #fde68a; }
html.dark .s-badge-approved,
html.dark .s-badge-paid     { background: #052e16; color: #4ade80; }
html.dark .s-badge-rejected,
html.dark .s-badge-overdue,
html.dark .s-badge-danger   { background: #450a0a; color: #fca5a5; }
html.dark .s-badge-draft,
html.dark .s-badge-secondary { background: #1e293b; color: #94a3b8; }
html.dark .s-badge-info,
html.dark .s-badge-primary  { background: #1e3a5f; color: #93c5fd; }
html.dark .s-badge-success  { background: #052e16; color: #4ade80; }
html.dark .s-badge-warning  { background: #451a03; color: #fde68a; }

/* Buttons dark */
html.dark .s-btn-primary { background: #2354a8; border-color: #2354a8; }
html.dark .s-btn-primary:hover { background: #3572d4; border-color: #3572d4; }
html.dark .s-btn-secondary { background: #1e293b; border-color: var(--border); color: var(--text-2); }
html.dark .s-btn-secondary:hover { background: #334155; border-color: #6096e8; color: var(--text-1); }
html.dark .s-btn-danger { background: #1e293b; border-color: #991b1b; color: #f87171; }
html.dark .s-btn-danger:hover { background: #450a0a; border-color: #f87171; }
html.dark .s-btn-ghost { color: #6096e8; }
html.dark .s-btn-ghost:hover { background: #1e293b; color: #afc8f5; }
html.dark .s-btn-success { background: #166534; border-color: #166534; }
html.dark .s-btn-warning { background: #92400e; border-color: #92400e; }

/* Pagination dark */
html.dark .s-page-link { background: #1e293b; border-color: var(--border); color: var(--text-2); }
html.dark .s-page-link:hover { border-color: #6096e8; color: #afc8f5; }

/* Card dark */
html.dark .s-card { background: var(--card); border-color: var(--border); }
html.dark .s-card-header { border-bottom-color: var(--border); }

/* Filter bar dark */
html.dark .s-filter-bar { background: var(--card); border-color: var(--border); }

/* Form section dark */
html.dark .s-form-section { background: var(--card); border-color: var(--border); }
html.dark .s-form-section-title { color: #6096e8; border-bottom-color: var(--border); }

/* KPI dark */
html.dark .s-kpi-card { background: var(--card); border-color: var(--border); }

/* Notif panel dark */
html.dark .s-notif-panel { background: var(--card); border-color: var(--border); }

/* Skip link dark */
html.dark .s-skip-link { background: #6096e8; }

/* Breadcrumb dark */
html.dark .s-breadcrumb-sep { color: var(--border); }

/* Company name topbar dark */
html.dark .s-topbar-company { color: var(--text-1); }

/* Inline overrides: fallback para estilos inline no migrados */
html.dark [style*="background:#fff"],
html.dark [style*="background: #fff"] { background-color: var(--card) !important; }
html.dark [style*="background:#f8fafc"],
html.dark [style*="background: #f8fafc"] { background-color: var(--surface) !important; }

/* ── Reset y base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-1);
  background: var(--surface);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--s-600); text-decoration: none; }
a:hover { color: var(--s-500); text-decoration: underline; }

/* Focus visible — accesibilidad por teclado */
:focus-visible {
  outline: 2px solid var(--s-500);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }
.s-btn:focus-visible { box-shadow: 0 0 0 3px rgba(53,114,212,.35); }
.s-nav-sublink:focus-visible,
.s-nav-link:focus-visible,
.s-nav-module-link:focus-visible { outline-color: var(--s-400); }

/* Skip to content link — accesibilidad */
.s-skip-link {
  position: absolute; top: -40px; left: 0; z-index: 10000;
  background: var(--s-700); color: #fff; padding: 8px 16px;
  font-size: 13px; font-weight: 600; border-radius: 0 0 8px 0;
  transition: top .2s;
}
.s-skip-link:focus { top: 0; outline: none; text-decoration: none; color: #fff; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.s-layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.s-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--s-900);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: transform .25s cubic-bezier(.4,0,.2,1), width .25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

/* Brand */
.s-sidebar-brand {
  padding: 16px 18px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
}
.s-brand-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--s-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
  font-family: var(--font-mono);
  flex-shrink: 0;
  letter-spacing: -1px;
}
.s-brand-name {
  font-size: 17px; font-weight: 700;
  color: #fff; letter-spacing: -.4px;
}
.s-brand-version {
  font-size: 10px; color: rgba(255,255,255,.30);
  font-family: var(--font-mono);
  margin-top: 1px; display: block;
}

/* Company pill */
.s-company-pill {
  margin: 10px 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.s-company-pill-label {
  font-size: 9.5px; color: rgba(255,255,255,.40);
  text-transform: uppercase; letter-spacing: .8px;
  margin-bottom: 2px; font-weight: 600;
}
.s-company-pill-name {
  font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,.88);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Nav */
.s-nav { flex: 1; padding: 4px 0; overflow-y: auto; overflow-x: hidden; }
.s-nav::-webkit-scrollbar { width: 3px; }
.s-nav::-webkit-scrollbar-track { background: transparent; }
.s-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

/* ── Module accordion (level 1) ─────────────────── */
.s-nav-module { margin: 2px 0; }
.s-nav-module-link {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px;
  color: rgba(255,255,255,.45);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  cursor: pointer;
  transition: all .15s;
}
.s-nav-module-link:hover {
  color: rgba(255,255,255,.70);
  background: rgba(255,255,255,.04);
}
.s-nav-module-link.active { color: rgba(255,255,255,.70); }
.s-nav-module-link.open {
  color: rgba(255,255,255,.65);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.s-nav-module-icon {
  width: 16px; height: 16px; flex-shrink: 0;
  text-align: center; font-size: 13px !important;
  opacity: .65;
}
.s-nav-module-link.active .s-nav-module-icon { opacity: 1; }
.s-nav-module-text {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: max-width .25s cubic-bezier(.4,0,.2,1), opacity .2s;
}
.s-nav-module-arrow {
  margin-left: auto; flex-shrink: 0;
  font-size: 9px; opacity: .35;
  transition: transform .2s cubic-bezier(.4,0,.2,1);
}
.s-nav-module-link.open .s-nav-module-arrow { transform: rotate(90deg); }
.s-nav-module-body {
  max-height: 0; overflow: hidden;
  transition: max-height .3s cubic-bezier(.4,0,.2,1);
}
.s-nav-module-body.open { max-height: 800px; }

.s-nav-item { margin: 1px 7px 1px 10px; }
.s-nav-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px;
  color: rgba(255,255,255,.62);
  font-size: 13px; font-weight: 400;
  border-radius: 7px;
  transition: all .15s;
  cursor: pointer; overflow: hidden;
}
.s-nav-text {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 200px;
  transition: max-width .25s cubic-bezier(.4,0,.2,1), opacity .2s;
  display: inline-block;
}
.s-nav-link:hover {
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.92);
  text-decoration: none;
}
.s-nav-link.active {
  background: var(--s-600);
  color: #fff; font-weight: 500;
}
.s-nav-icon {
  width: 16px; height: 16px; flex-shrink: 0;
  opacity: .70; text-align: center;
  font-size: 14px !important;
}
.s-nav-link.active .s-nav-icon { opacity: 1; }

/* Submenú accordion */
.s-nav-submenu {
  margin: 2px 7px 2px 32px;
  border-left: 1px solid rgba(255,255,255,.10);
  padding-left: 8px;
  display: none;
}
.s-nav-submenu.open { display: block; }
.s-nav-sublink {
  display: block;
  padding: 5px 10px;
  color: rgba(255,255,255,.50);
  font-size: 12.5px;
  border-radius: 5px;
  transition: all .12s;
  text-decoration: none;
}
.s-nav-sublink:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.06); text-decoration: none; }
.s-nav-sublink.active { color: var(--s-400); font-weight: 500; }

/* Flecha del acordeón */
.s-nav-arrow {
  margin-left: auto; flex-shrink: 0;
  font-size: 10px; opacity: .45;
  transition: transform .2s;
}
.s-nav-link.open .s-nav-arrow { transform: rotate(90deg); }

/* Sidebar footer */
.s-sidebar-footer {
  padding: 11px 12px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.s-user-row { display: flex; align-items: center; gap: 9px; }
.s-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--s-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0; overflow: hidden;
  text-decoration: none;
  transition: opacity .15s;
}
.s-user-avatar:hover { opacity: .85; }
.s-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.s-user-info { flex: 1; min-width: 0; text-decoration: none; }
.s-user-info:hover .s-user-name { color: #fff; }
.s-user-name { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.88); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.s-user-role { font-size: 10.5px; color: rgba(255,255,255,.38); }
.s-logout-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  cursor: pointer; color: rgba(255,255,255,.60);
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; margin-left: auto; flex-shrink: 0;
  font-size: 13px; text-decoration: none;
}
.s-logout-btn:hover {
  background: rgba(220,38,38,.25);
  border-color: rgba(220,38,38,.4);
  color: #fca5a5;
}

/* ── MAIN WRAPPER ────────────────────────────────────────── */
.s-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .25s cubic-bezier(.4,0,.2,1);
}

/* ── SIDEBAR COLAPSADO ───────────────────────────────────── */
.s-sidebar.collapsed { width: var(--sidebar-w-collapsed); overflow: visible; }

.s-sidebar.collapsed .s-brand-name,
.s-sidebar.collapsed .s-brand-version,
.s-sidebar.collapsed .s-nav-module-text,
.s-sidebar.collapsed .s-nav-module-arrow,
.s-sidebar.collapsed .s-user-name,
.s-sidebar.collapsed .s-user-role {
  max-width: 0; opacity: 0; overflow: hidden;
  white-space: nowrap; pointer-events: none;
  transition: max-width .25s, opacity .2s;
  display: inline-block; vertical-align: middle;
}
/* En colapsado: ocultar el body del módulo (menús + opciones) */
.s-sidebar.collapsed .s-nav-module-body { display: none; }
/* Módulo: solo icono centrado */
.s-sidebar.collapsed .s-nav-module { position: relative; }
.s-sidebar.collapsed .s-nav-module-link {
  justify-content: center; padding: 10px 0;
  width: var(--sidebar-w-collapsed);
  position: relative; overflow: visible;
}
.s-sidebar.collapsed .s-nav-module-link.open { border-bottom: none; }
.s-sidebar.collapsed .s-nav-module-link.active {
  background: var(--s-600);
  border-radius: 8px;
  margin: 0 8px;
  width: calc(var(--sidebar-w-collapsed) - 16px);
}
.s-sidebar.collapsed .s-nav-module-icon { width: 20px; height: 20px; font-size: 16px !important; opacity: .7; }
.s-sidebar.collapsed .s-nav-module-link.active .s-nav-module-icon { opacity: 1; color: #fff; }
.s-sidebar.collapsed .s-sidebar-brand { justify-content: center; padding: 18px 0 14px; gap: 0; }
.s-sidebar.collapsed .s-sidebar-footer { padding: 10px 0; }
.s-sidebar.collapsed .s-user-row {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
/* Company pill colapsado: solo logo/icono centrado */
.s-sidebar.collapsed .s-company-pill {
  justify-content: center;
  margin: 8px 4px;
  padding: 6px;
  background: none;
  border: none;
}
.s-sidebar.collapsed .s-company-pill-info { display: none; }
/* Icono fallback: oculto por defecto, visible en colapsado si no hay logo */
.s-company-pill-icon { display: none; }
.s-sidebar.collapsed .s-company-pill-icon {
  display: flex;
  width: 32px; height: 32px;
  align-items: center; justify-content: center;
  border-radius: 6px;
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.70);
  font-size: 15px;
  flex-shrink: 0;
}
/* Si hay logo, el icono no se muestra ni en colapsado */
.s-sidebar.collapsed .s-company-pill-logo ~ .s-company-pill-icon { display: none; }
.s-sidebar.collapsed .s-company-pill-logo {
  width: 32px !important; height: 32px !important;
  border-radius: 6px;
}

/* Oculta el contenedor nombre/rol que sigue ocupando espacio */
.s-sidebar.collapsed .s-user-info { display: none; }
.s-sidebar.collapsed .s-user-avatar { width: 34px; height: 34px; font-size: 12px; }
.s-sidebar.collapsed .s-logout-btn {
  margin-left: 0;
  width: 28px; height: 28px;
  background: rgba(255,255,255,.07);
  border-radius: 7px;
  color: rgba(255,255,255,.55);
  font-size: 12px;
}
.s-layout.sidebar-collapsed .s-main { margin-left: var(--sidebar-w-collapsed); }

/* Botón colapso */
.s-collapse-btn {
  position: absolute; right: -1px; top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  background: var(--s-600);
  border: 2px solid var(--s-900);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 9px;
  z-index: 1001; transition: background .15s, transform .25s;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.s-collapse-btn:hover { background: var(--s-500); }
.s-layout.sidebar-collapsed .s-collapse-btn { transform: translateY(-50%) rotate(180deg); }

/* ── Module mega-flyout (sidebar colapsado) ─────────── */

.s-sidebar.collapsed .s-nav { overflow: visible; }

/* Mega-flyout: oculto por defecto, se muestra en collapsed on hover */
.s-nav-module-flyout { display: none; }
.s-sidebar.collapsed .s-nav-module-flyout {
  display:        block;
  position:       absolute;
  left:           var(--sidebar-w-collapsed);
  top:            0;
  width:          240px;
  max-height:     calc(100vh - 40px);
  overflow-y:     auto;
  background:     var(--s-800);
  border-radius:  0 10px 10px 0;
  padding:        0;
  box-shadow:     6px 4px 24px rgba(0,0,0,.45);
  z-index:        99998;
  opacity:        0;
  visibility:     hidden;
  pointer-events: none;
  transition:     opacity .15s ease, visibility .15s ease;
}
.s-sidebar.collapsed .s-nav-module:hover .s-nav-module-flyout {
  opacity:        1;
  visibility:     visible;
  pointer-events: auto;
}
/* Scrollbar del flyout */
.s-sidebar.collapsed .s-nav-module-flyout::-webkit-scrollbar { width: 3px; }
.s-sidebar.collapsed .s-nav-module-flyout::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.15); border-radius: 2px;
}

/* Header del flyout (nombre del módulo) */
.s-nav-flyout-header {
  padding: 10px 16px 8px;
  font-size: 12px; font-weight: 600;
  color: #fff; white-space: nowrap;
  background: rgba(255,255,255,.07);
  border-bottom: 1px solid rgba(255,255,255,.12);
  border-radius: 0 10px 0 0;
  margin-bottom: 4px;
}
/* Flyout menu accordion */
.s-nav-flyout-menu { border-bottom: 1px solid rgba(255,255,255,.06); }
.s-nav-flyout-menu:last-child { border-bottom: none; }
.s-nav-flyout-group {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,.50);
  cursor: pointer;
  transition: all .12s;
}
.s-nav-flyout-group:hover {
  color: rgba(255,255,255,.80);
  background: rgba(255,255,255,.04);
}
.s-nav-flyout-group.open { color: rgba(255,255,255,.80); }
.s-nav-flyout-group-arrow {
  font-size: 9px; opacity: .4;
  transition: transform .2s cubic-bezier(.4,0,.2,1);
}
.s-nav-flyout-group.open .s-nav-flyout-group-arrow { transform: rotate(90deg); }
/* Flyout menu body: colapsado por defecto */
.s-nav-flyout-menu-body {
  max-height: 0; overflow: hidden;
  transition: max-height .25s cubic-bezier(.4,0,.2,1);
}
.s-nav-flyout-menu-body.open { max-height: 400px; }
/* Links dentro del flyout */
.s-nav-flyout-link {
  display: block;
  padding: 6px 16px 6px 24px;
  color: rgba(255,255,255,.55);
  font-size: 12.5px;
  text-decoration: none;
  transition: all .12s;
}
.s-nav-flyout-link:hover {
  color: rgba(255,255,255,.90);
  background: rgba(255,255,255,.06);
  text-decoration: none;
}
.s-nav-flyout-link.active { color: var(--s-400); font-weight: 500; }
.s-nav-flyout-link:last-child { border-radius: 0 0 10px 0; }

/* Tooltip sidebar colapsado */
#s-sidebar-tooltip {
  position: fixed; display: block;
  background: var(--s-800); color: #fff;
  font-size: 12.5px; font-family: var(--font-sans); font-weight: 500;
  white-space: nowrap; padding: 6px 12px;
  border-radius: 7px; pointer-events: none;
  z-index: 99999; opacity: 0; visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
#s-sidebar-tooltip.visible { opacity: 1; visibility: visible; }
#s-sidebar-tooltip::before {
  content: ''; position: absolute; right: 100%; top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent; border-right-color: var(--s-800);
}

/* ── TOPBAR ──────────────────────────────────────────────── */
.s-topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 500; flex-shrink: 0;
}
.s-hamburger {
  display: none; width: 34px; height: 34px; border-radius: 8px;
  border: none; background: none; cursor: pointer;
  color: var(--text-2); align-items: center; justify-content: center;
  font-size: 18px;
}
.s-hamburger:hover { background: var(--surface); }
.s-breadcrumb {
  flex: 1; display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-3);
  white-space: nowrap; overflow: hidden;
}
.s-breadcrumb-current { color: var(--text-1); font-weight: 500; }
.s-breadcrumb-sep { color: var(--border); }
.s-topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.s-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px;
  transition: all .15s; cursor: text;
  color: var(--text-3); font-size: 12.5px;
}
.s-search input {
  border: none; background: none; outline: none;
  font-size: 12.5px; color: var(--text-1);
  font-family: var(--font-sans); width: 160px;
}
.s-search input::placeholder { color: var(--text-3); }
.s-search:focus-within { border-color: var(--s-400); box-shadow: 0 0 0 3px rgba(53,114,212,.12); }

.s-icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); position: relative; transition: all .15s;
  font-size: 16px;
}
.s-icon-btn:hover { background: var(--surface); color: var(--text-1); }
.s-notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-danger); border: 2px solid var(--card);
}

/* Company name centered in topbar */
.s-topbar-company {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  font-size: 13px; font-weight: 600;
  color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 40%; text-align: center;
  pointer-events: none;
}
.s-topbar-company-short { display: none; }

/* ── CONTENT AREA ────────────────────────────────────────── */
.s-content { flex: 1; padding: var(--content-pad); }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.s-page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
  /* Sticky global: permanece visible bajo el topbar al hacer scroll */
  position: sticky;
  top: var(--topbar-h);
  z-index: 9;
  background: var(--surface);
  margin: 0 calc(var(--content-pad) * -1) 12px;
  padding: 10px var(--content-pad);
  border-bottom: 1px solid var(--border);
}
.s-page-title {
  font-size: 18px; font-weight: 700;
  color: var(--text-1); letter-spacing: -.4px; margin-bottom: 0;
}
.s-page-subtitle { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* ── FLASH ALERTS ────────────────────────────────────────── */
.s-alerts { margin-bottom: 16px; }
.s-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 8px; border: 1px solid;
  animation: s-fade-in .2s ease;
}
@keyframes s-fade-in { from { opacity:0; transform: translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.s-alert-success { background: #edf7f2; border-color: #a3d9bc; color: #0f5132; }
.s-alert-danger  { background: #fdecea; border-color: #f5b7b1; color: #7b241c; }
.s-alert-warning { background: #fffbeb; border-color: #f9e4b7; color: #78520a; }
.s-alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e3a5f; }
.s-alert-close {
  margin-left: auto; background: none; border: none;
  cursor: pointer; opacity: .5; font-size: 16px; line-height: 1;
  padding: 0 2px; color: inherit;
}
.s-alert-close:hover { opacity: 1; }

/* ── CARDS ───────────────────────────────────────────────── */
.s-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.s-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 16px; border-bottom: 1px solid var(--border-lt);
  font-size: 13px; font-weight: 600; color: var(--text-1);
}
.s-card-body { padding: 16px; }
.s-card-footer {
  padding: 11px 16px; border-top: 1px solid var(--border-lt);
  background: var(--surface); border-radius: 0 0 var(--radius) var(--radius);
  display: flex; align-items: center;
}

/* ── KPI CARDS ───────────────────────────────────────────── */
.s-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.s-kpi-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s;
  position: relative; overflow: hidden;
}
.s-kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 3px; height: 100%; background: var(--s-500);
  border-radius: var(--radius) 0 0 var(--radius);
}
.s-kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.s-kpi-label {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .6px; color: var(--text-3); margin-bottom: 7px;
}
.s-kpi-value {
  font-size: 24px; font-weight: 700; color: var(--text-1);
  line-height: 1; margin-bottom: 5px;
}
.s-kpi-trend { font-size: 11.5px; color: var(--text-3); }
.s-kpi-trend.up   { color: var(--color-success); }
.s-kpi-trend.down { color: var(--color-danger); }
.s-kpi-card.s-kpi-primary::before  { background: var(--s-500); }
.s-kpi-card.s-kpi-success::before  { background: var(--color-success); }
.s-kpi-card.s-kpi-warning::before  { background: var(--color-warning); }
.s-kpi-card.s-kpi-danger::before   { background: var(--color-danger); }

/* ── TABLES ──────────────────────────────────────────────── */
.s-table-wrap { overflow-x: auto; }
.s-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.s-table thead th {
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-3); background: #f8fafc;
  padding: 12px 8px; border-bottom: 1px solid var(--border);
  white-space: nowrap; text-align: left;
}
.s-table tbody td {
  padding: 6px 8px; border-bottom: 1px solid var(--border-lt);
  vertical-align: middle; color: var(--text-2);
}
.s-table tbody tr:last-child td { border-bottom: none; }
.s-table tbody tr:hover td { background: var(--s-50); }
.s-table tfoot td {
  padding: 6px 8px; border-top: 2px solid var(--border);
  vertical-align: middle;
}
.s-table-link { color: var(--s-600); font-weight: 500; text-decoration: none; }
.s-table-link:hover { color: var(--s-500); text-decoration: underline; }
.s-table-empty {
  text-align: center; padding: 32px; color: var(--text-3);
  font-style: italic;
}

/* ── FORMS ───────────────────────────────────────────────── */
.s-form-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.s-form-section-title {
  font-size: 12.5px; font-weight: 600; color: var(--s-700);
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--s-100);
  display: flex; align-items: center; gap: 7px;
}
.s-label {
  display: block; font-size: 12.5px; font-weight: 500;
  color: var(--text-2); margin-bottom: 5px;
}
.s-label-required::after { content: ' *'; color: var(--color-danger); }

.s-input, .s-select, .s-textarea {
  display: block; width: 100%;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 13px;
  font-size: 13.5px; font-family: var(--font-sans); color: var(--text-1);
  transition: border-color .15s, box-shadow .15s; outline: none;
  -webkit-appearance: none;
}
.s-input:hover, .s-select:hover, .s-textarea:hover { border-color: var(--s-400); }
.s-input:focus, .s-select:focus, .s-textarea:focus {
  border-color: var(--s-500); box-shadow: 0 0 0 3px rgba(53,114,212,.15);
}
.s-input.is-invalid, .s-select.is-invalid { border-color: var(--color-danger); }
.s-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(192,57,43,.12); }
.s-invalid-feedback { font-size: 11.5px; color: var(--color-danger); margin-top: 4px; display: none; }
.s-input.is-invalid ~ .s-invalid-feedback,
.s-select.is-invalid ~ .s-invalid-feedback,
.s-textarea.is-invalid ~ .s-invalid-feedback,
input.is-invalid ~ .s-invalid-feedback,
select.is-invalid ~ .s-invalid-feedback,
textarea.is-invalid ~ .s-invalid-feedback { display: block; }
input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--color-danger); }
input.is-invalid:focus, select.is-invalid:focus, textarea.is-invalid:focus { box-shadow: 0 0 0 3px rgba(192,57,43,.12); }
.s-select.is-invalid { box-shadow: 0 0 0 3px rgba(192,57,43,.12); }
.s-field { position: relative; }

/* Loading state on buttons */
.s-btn[disabled] { cursor: not-allowed; }
.s-btn .fa-spinner { animation: fa-spin 1s linear infinite; }
@keyframes fa-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.s-form-text { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.s-textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
.s-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; padding-right: 32px; }

/* Input group */
.s-input-group { position: relative; }
.s-input-group .s-input { padding-left: 36px; }
.s-input-group-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none; font-size: 14px;
}
.s-input-group-append .s-input { padding-right: 36px; }
.s-input-group-icon-right {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); cursor: pointer;
  background: none; border: none; padding: 0; font-size: 14px;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.s-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; font-family: var(--font-sans);
  cursor: pointer; border: 1px solid transparent;
  transition: all .15s; text-decoration: none;
  white-space: nowrap; line-height: 1;
}
.s-btn:active { transform: scale(.98); }
.s-btn-sm { padding: 6px 11px; font-size: 12px; }
.s-btn-lg { padding: 11px 20px; font-size: 14px; }

.s-btn-primary { background: var(--s-700); border-color: var(--s-700); color: #fff; }
.s-btn-primary:hover { background: var(--s-600); border-color: var(--s-600); color: #fff; text-decoration: none; }

.s-btn-secondary { background: var(--card); border-color: var(--border); color: var(--text-2); }
.s-btn-secondary:hover { background: var(--surface); border-color: var(--s-400); color: var(--text-1); text-decoration: none; }

.s-btn-danger { background: var(--card); border-color: #f5b7b1; color: var(--color-danger); }
.s-btn-danger:hover { background: #fdecea; border-color: var(--color-danger); color: var(--color-danger); text-decoration: none; }

.s-btn-ghost { background: none; border-color: transparent; color: var(--s-600); }
.s-btn-ghost:hover { background: var(--s-50); color: var(--s-700); text-decoration: none; }

.s-btn-success { background: #166534; border-color: #166534; color: #fff; }
.s-btn-success:hover { background: #15803d; border-color: #15803d; text-decoration: none; }

.s-btn-warning { background: #92400e; border-color: #92400e; color: #fff; }
.s-btn-warning:hover { background: #b45309; border-color: #b45309; text-decoration: none; }

/* ── BADGES ──────────────────────────────────────────────── */
.s-badge {
  display: inline-block; border-radius: 20px;
  padding: 2px 9px; font-size: 11px; font-weight: 600;
  letter-spacing: .1px;
}
.s-badge-active    { background: #eff6ff; color: var(--s-700); }
.s-badge-inactive  { background: #f3f4f6; color: #6b7280; }
.s-badge-pending   { background: #fff8e6; color: #92620a; }
.s-badge-approved  { background: #f0fdf4; color: #15803d; }
.s-badge-rejected  { background: #fdecea; color: var(--color-danger); }
.s-badge-draft     { background: #f3f4f6; color: #6b7280; }
.s-badge-paid      { background: #f0fdf4; color: #15803d; }
.s-badge-overdue   { background: #fdecea; color: var(--color-danger); }
.s-badge-info      { background: #eff6ff; color: #1d4ed8; }
.s-badge-success   { background: #edf7f2; color: #0f5132; }
.s-badge-warning   { background: #fff8e6; color: #92620a; }
.s-badge-danger    { background: #fdecea; color: var(--color-danger); }
.s-badge-primary   { background: #eff6ff; color: var(--s-700); }
.s-badge-secondary { background: #f3f4f6; color: #6b7280; }

/* ── PAGINATION ──────────────────────────────────────────── */
.s-pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.s-page-link {
  min-width: 32px; height: 32px; border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--card); color: var(--text-2);
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; transition: all .15s; padding: 0 8px;
}
.s-page-link:hover { border-color: var(--s-400); color: var(--s-700); text-decoration: none; }
.s-page-item.active .s-page-link { background: var(--s-700); border-color: var(--s-700); color: #fff; }
.s-page-item.disabled .s-page-link { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* ── TIMELINE / AUDIT ────────────────────────────────────── */
.s-timeline { display: flex; flex-direction: column; gap: 0; }
.s-timeline-item { display: flex; gap: 12px; padding-bottom: 18px; position: relative; }
.s-timeline-item::before {
  content: ''; position: absolute; left: 6px; top: 18px;
  bottom: 0; width: 1px; background: var(--border);
}
.s-timeline-item:last-child::before { display: none; }
.s-timeline-dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--s-500); border: 2px solid var(--card);
  flex-shrink: 0; margin-top: 3px;
  box-shadow: 0 0 0 2px var(--s-200);
}
.s-timeline-date { font-size: 10.5px; color: var(--text-3); font-family: var(--font-mono); }
.s-timeline-text { font-size: 13px; color: var(--text-1); }
.s-timeline-sub  { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* ── UTILITIES ───────────────────────────────────────────── */
.s-mono { font-family: var(--font-mono); }
.s-text-muted    { color: var(--text-3); }
.s-text-primary  { color: var(--s-700); }
.s-text-success  { color: var(--color-success); }
.s-text-danger   { color: var(--color-danger); }
.s-fw-400 { font-weight: 400; }
.s-fw-500 { font-weight: 500; }
.s-fw-600 { font-weight: 600; }
.s-fw-700 { font-weight: 700; }
.s-gap-actions { 
  /* display: flex;  */
  align-items: center; 
  gap: 4px; 
  flex-wrap: nowrap; 
  white-space: nowrap; 
}
.s-divider { height: 1px; background: var(--border); margin: 16px 0; }
.s-skeleton {
  background: linear-gradient(90deg, #f0f4f8 25%, #e4ecf5 50%, #f0f4f8 75%);
  background-size: 200% 100%;
  animation: s-shimmer 1.4s infinite;
  border-radius: 4px;
}
@keyframes s-shimmer { to { background-position: -200% 0; } }

/* Colombia: formato COP */
.s-cop::before { content: '$ '; }

/* ── LAYOUT UTILITIES (responsive) ──────────────────────── */

/* Semantic layout classes — replaces inline styles across views */
.s-filter-bar {
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.s-flex-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.s-flex-row-compact {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-bottom: 1px;
}
.s-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.s-form-grid-nb {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.s-form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.s-form-grid-label {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.s-form-grid-label-lg {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.s-form-actions {
  display: flex;
  justify-content: center;
  padding: 14px 16px;
  border-top: 1px solid var(--border-lt);
}
.s-card-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.s-flex-col {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.s-flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Display utilities */
.s-d-none   { display: none !important; }
.s-d-block  { display: block !important; }
.s-d-flex   { display: flex !important; }
.s-d-grid   { display: grid !important; }
.s-d-inline { display: inline !important; }

/* Spacing utilities */
.s-p-0  { padding: 0; }
.s-p-sm { padding: 10px; }
.s-p-md { padding: 16px; }
.s-p-lg { padding: 20px; }
.s-mb-0  { margin-bottom: 0; }
.s-mb-sm { margin-bottom: 8px; }
.s-mb-md { margin-bottom: 14px; }
.s-mb-lg { margin-bottom: 20px; }

/* Gap utilities */
.s-gap-1 { gap: 4px; }
.s-gap-2 { gap: 8px; }
.s-gap-3 { gap: 12px; }
.s-gap-4 { gap: 16px; }

/* Text utilities */
.s-text-center { text-align: center; }
.s-text-right  { text-align: right; }
.s-text-left   { text-align: left; }

/* Flex utilities */
.s-flex-wrap       { flex-wrap: wrap; }
.s-align-center    { align-items: center; }
.s-justify-between { justify-content: space-between; }
.s-justify-end     { justify-content: flex-end; }
.s-justify-center  { justify-content: center; }

/* Width */
.s-w-100 { width: 100%; }

/* ── MODAL ───────────────────────────────────────────────── */
.s-modal-overlay {
  position: fixed; inset: 0; background: rgba(7,24,50,.55);
  z-index: 2000; display: none;
  align-items: center; justify-content: center; padding: 20px;
}
.s-modal-overlay.open { display: flex; animation: s-fade-in .2s ease; }
.s-modal {
  background: var(--card); border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.s-modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.s-modal-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.s-modal-close {
  width: 28px; height: 28px; border-radius: 7px;
  border: none; background: none; cursor: pointer;
  color: var(--text-3); font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.s-modal-close:hover { background: var(--surface); color: var(--text-1); }
/* Form dentro de modal: debe participar en el flex layout */
.s-modal > form {
  display: flex; flex-direction: column;
  overflow: hidden; flex: 1; min-height: 0;
}
.s-modal-body { padding: 20px; overflow-y: auto; flex: 1; min-height: 0; }
.s-modal-error { flex-shrink: 0; animation: s-fade-in .2s ease; margin: 12px 16px 0; }
.s-modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-shrink: 0; background: var(--surface);
}

/* ── NOTIFICATION PANEL ──────────────────────────────────── */
.s-notif-panel {
  position: fixed; top: calc(var(--topbar-h) + 8px); right: 16px;
  width: 320px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); z-index: 600; overflow: hidden; display: none;
}
.s-notif-panel.open { display: block; animation: s-slide-down .18s cubic-bezier(.4,0,.2,1); }
@keyframes s-slide-down { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
.s-notif-header {
  padding: 12px 15px; border-bottom: 1px solid var(--border-lt);
  display: flex; justify-content: space-between; align-items: center;
}
.s-notif-header-title { font-size: 13px; font-weight: 600; }
.s-notif-list { max-height: 340px; overflow-y: auto; }
.s-notif-item { padding: 11px 15px; border-bottom: 1px solid var(--border-lt); cursor: pointer; transition: background .12s; }
.s-notif-item:hover { background: var(--s-50); }
.s-notif-empty { padding: 28px; text-align: center; font-size: 13px; color: var(--text-3); }

/* ── LOGIN PAGE ──────────────────────────────────────────── */
.s-login-page {
  min-height: 100vh; display: flex;
  background: linear-gradient(135deg, var(--s-900) 0%, var(--s-700) 60%, var(--s-600) 100%);
}
.s-login-panel {
  width: 440px; min-width: 360px; background: var(--card);
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 40px; box-shadow: 4px 0 40px rgba(0,0,0,.25);
}
.s-login-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 36px;
}
.s-login-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--s-700); display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 18px;
  font-weight: 800; font-family: var(--font-mono);
}
.s-login-title { font-size: 22px; font-weight: 700; color: var(--text-1); }
.s-login-subtitle { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.s-login-hero {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px; flex-direction: column; gap: 20px;
}
.s-login-hero-title {
  font-size: 32px; font-weight: 700; color: #fff;
  line-height: 1.2; max-width: 380px;
}
.s-login-hero-sub {
  font-size: 15px; color: rgba(255,255,255,.65); max-width: 380px;
}
.s-login-hero-flags { display: flex; gap: 8px; }
.s-login-flag {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px; padding: 5px 12px;
  font-size: 12px; color: rgba(255,255,255,.75); font-weight: 500;
}

/* ── RESPONSIVE ──────────────────────────────────────────── */

/* ── Paso 4: iPad landscape (≤1024px) ───────────────────── */
@media (max-width: 1024px) {
  .s-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
  }
  .s-sidebar.open { transform: translateX(0); }
  .s-main { margin-left: 0 !important; }
  .s-hamburger { display: flex; width: 44px; height: 44px; } /* paso 1 */
  .s-collapse-btn { display: none; }
  .s-login-hero { display: none; }
  .s-login-panel { width: 100%; min-height: 100vh; }
  /* Tablet: mostrar siglas */
  .s-topbar-company-full  { display: none; }
  .s-topbar-company-short { display: inline; }
}


/* ── Tablet/móvil (≤768px) ───────────────────────────────── */
@media (max-width: 768px) {
  .s-sidebar { position: fixed; width: 80vw; transform: translateX(-100%); }
  .s-sidebar.open { transform: translateX(0); }
  input, .s-select, button { min-height: 44px; }

  .s-content { padding: 16px; }
  .s-kpi-grid { grid-template-columns: 1fr 1fr; }
  .s-page-header { flex-direction: column; position: static; margin: 0 0 12px; padding: 0; border-bottom: 0; background: transparent; }
  /* Ocultar nombre de empresa */
  .s-topbar-company { display: none; }

  /* Touch targets */
  .s-btn          { padding: 12px 18px; font-size: 14px; }
  .s-btn-sm       { padding: 9px 14px;  font-size: 13px; }
  .s-btn-xs       { padding: 6px 10px;  font-size: 12px; }
  .s-input, .s-select, .s-textarea { padding: 12px 13px; font-size: 14px; }
  .s-label        { font-size: 13px; }
  /* Tabla: scroll horizontal + encabezados legibles */
  .s-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .s-table thead th { font-size: 11px; }
  /* Grid 3-col → 2-col en tablet */
  .s-form-grid-3 { grid-template-columns: 1fr 1fr; }
  /* Select2 full-width */
  .select2-container { width: 100% !important; }
  /* Display responsive: tablet */
  .s-d-md-none  { display: none !important; }
  .s-d-md-block { display: block !important; }
  .s-d-md-flex  { display: flex !important; }
}

/* ── Móvil (≤640px) ─────────────────────────────────────── */
@media (max-width: 640px) {
  /* Font base más legible en móvil */
  body { font-size: 14px; }

  /* Grids semánticos → 1 columna */
  .s-form-grid,
  .s-form-grid-nb,
  .s-form-grid-3,
  .s-form-grid-label,
  .s-form-grid-label-lg {
    grid-template-columns: 1fr;
  }
  /* Fallback: inline grids que no se migraron → 1 col */
  form  [style*="grid-template-columns"],
  .s-card [style*="grid-template-columns"],
  .s-modal-body [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Filter bar: hijos full-width */
  .s-filter-bar > * {
    min-width: 0 !important;
    flex: 1 1 100%;
  }
  .s-filter-bar > a.s-btn,
  .s-filter-bar > button.s-btn,
  .s-filter-bar > button[type="submit"] {
    flex: 0 1 auto;
    width: 100%;
    justify-content: center;
  }
  /* Fallback: inline flex-wrap bars no migradas */
  form [style*="flex-wrap:wrap"] > *,
  .s-card form [style*="flex-wrap:wrap"] > * {
    min-width: 0 !important;
    flex: 1 1 100% !important;
  }
  form [style*="flex-wrap:wrap"] > a.s-btn,
  form [style*="flex-wrap:wrap"] > button.s-btn {
    flex: 0 1 auto !important;
    width: 100%;
    justify-content: center;
  }

  /* Flex compact → wrap */
  .s-flex-row-compact {
    flex-wrap: wrap;
  }
  .s-flex-row-compact > * {
    flex: 1 1 100%;
    min-width: 0;
  }

  /* Flex between → wrap */
  .s-flex-between {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Modales full-screen */
  .s-modal {
    max-width: 100%;
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
  }
  .s-modal-overlay { padding: 0; }

  /* Topbar compacto */
  .s-topbar { padding: 0 12px; gap: 8px; }
  .s-breadcrumb { font-size: 11.5px; }

  /* Display responsive: móvil */
  .s-d-sm-none  { display: none !important; }
  .s-d-sm-block { display: block !important; }
  .s-d-sm-flex  { display: flex !important; }
}

/* ── Teléfono pequeño (≤480px) ───────────────────────────── */
@media (max-width: 480px) {
  .s-kpi-grid { grid-template-columns: 1fr; }
  .s-content  { padding: 12px; }
}

/* Mobile overlay */
.s-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(7,24,50,.5); z-index: 999;
}
.s-overlay.open { display: block; }

/* ── TOAST ───────────────────────────────────────────────── */
@keyframes s-toast-in {
  from { opacity:0; transform:translateX(20px); }
  to   { opacity:1; transform:translateX(0); }
}

/* Variante centrada para paginación */
.s-card-footer-center { justify-content: center; }

/* ── SELECTOR DE IDIOMA ──────────────────────────────────── */
.s-locale-wrap {
  position: relative;
}
.s-locale-btn {
  font-size: 11px; font-weight: 700;
  letter-spacing: .5px; min-width: 36px;
}
.s-locale-menu {
  display: none;
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.13);
  min-width: 120px;
  z-index: 700;
  overflow: hidden;
  animation: s-slide-down .15s cubic-bezier(.4,0,.2,1);
}
.s-locale-menu.open { display: block; }
.s-locale-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 9px 14px;
  border: 0; background: transparent;
  font-size: 12.5px; font-weight: 400;
  color: var(--text-2); cursor: pointer;
  text-align: left; gap: 8px;
  transition: background .1s, color .1s;
}
.s-locale-item:hover      { background: var(--s-50); color: var(--text-1); }
.s-locale-item.active     { background: var(--s-50); color: var(--s-700); font-weight: 600; }
.s-locale-item .s-lc-check { font-size: 10px; color: var(--s-500); }

/* ── Marca de agua ANULADO ─────────────────────────────── */
.s-watermark-anulado {
  position: relative;
}
.s-watermark-anulado::before {
  content: "ANULADO    ANULADO    ANULADO    ANULADO    ANULADO";
  position: fixed;
  top: 50%; left: 0; right: 0;
  transform: translateY(-50%) rotate(-25deg);
  font-size: 7rem;
  font-weight: 900;
  color: rgba(220, 38, 38, 0.09);
  letter-spacing: 0.3em;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  user-select: none;
  text-align: center;
  width: 200%;
  margin-left: -50%;
}

/* ── PRINT ──────────────────────────────────────────────── */
@media print {
  .s-sidebar, .s-topbar, .s-hamburger, .s-overlay,
  .s-filter-bar, .s-form-actions, .s-breadcrumb,
  .s-pagination, .s-collapse-btn { display: none !important; }
  .s-main { margin-left: 0 !important; }
  .s-content { padding: 0 !important; }
  .s-card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .s-table { font-size: 11px; }
  body { font-size: 12px; background: #fff; }
}
