@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ══════════════════════════════════════════════════════
   CENTRALCORE — Design System v2
   Arquitectura: tokens → base → layout → componentes
   → módulos → responsive → utilities
══════════════════════════════════════════════════════ */

/* ══════════════════════════════
   1. DESIGN TOKENS
══════════════════════════════ */
:root {
  --primary:       #1A3C6E;
  --primary-light: #2557A7;
  --primary-dark:  #0F2544;
  --primary-rgb:   26, 60, 110;
  --accent:        #E8821A;
  --accent-light:  #F5A04A;
  --accent-rgb:    232, 130, 26;
  --success:       #0F7B55;
  --success-light: #D1FAE5;
  --success-rgb:   15, 123, 85;
  --warning:       #B45309;
  --warning-light: #FEF3C7;
  --danger:        #C0392B;
  --danger-light:  #FEE2E2;
  --danger-rgb:    192, 57, 43;
  --info:          #1D6FA4;
  --info-light:    #DBEAFE;
  --bg-base:       #F2F5FB;
  --bg-surface:    #FFFFFF;
  --bg-surface-2:  #F0F4FF;
  --bg-surface-3:  #E6EDF8;
  --border:        #D4DCF0;
  --border-strong: #A3B0D0;
  --text-primary:   #0F1F3D;
  --text-secondary: #4A5A7A;
  --text-muted:     #8A98B8;
  --shadow-xs: 0 1px 2px rgba(26,60,110,0.05);
  --shadow-sm: 0 1px 4px rgba(26,60,110,0.08), 0 1px 2px rgba(26,60,110,0.04);
  --shadow-md: 0 4px 14px rgba(26,60,110,0.10), 0 2px 6px rgba(26,60,110,0.06);
  --shadow-lg: 0 10px 32px rgba(26,60,110,0.13), 0 4px 12px rgba(26,60,110,0.07);
  --shadow-xl: 0 20px 56px rgba(26,60,110,0.16), 0 8px 24px rgba(26,60,110,0.09);
  --sidebar-w:           260px;
  --sidebar-collapsed-w: 64px;
  --topbar-h:            60px;
  --page-pad:            28px;
  --page-pad-mobile:     16px;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition:      0.20s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-base:       #090E1B;
  --bg-surface:    #111827;
  --bg-surface-2:  #192133;
  --bg-surface-3:  #1F2B42;
  --border:        #1C2D47;
  --border-strong: #263D60;
  --text-primary:   #E8EEFF;
  --text-secondary: #8FA3C0;
  --text-muted:     #445570;
  --primary-light: #3B72D4;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.30);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.36);
  --shadow-lg: 0 10px 32px rgba(0,0,0,0.42);
  --shadow-xl: 0 20px 56px rgba(0,0,0,0.52);
}

/* ══════════════════════════════
   2. RESET & BASE
══════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
  line-height: 1.5;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea, button { font-family: inherit; }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ══════════════════════════════
   3. LAYOUT SHELL
══════════════════════════════ */
#app-shell.hidden { display: none; }
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #0d1b34 0%, #0a1626 100%);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 200;
  transition: width 0.26s var(--ease), transform 0.26s var(--ease), box-shadow 0.26s;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed-w); }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-user-info { display: none; }
.sidebar.collapsed .nav-badge         { display: none !important; }
.sidebar.collapsed .nav-item          { justify-content: center; padding: 9px 0; }
.sidebar.collapsed .sidebar-user      { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-logo      { justify-content: center; padding: 14px 0; }
.sidebar.collapsed .sidebar-logo .sidebar-pin { margin-left: 0; }
.sidebar.collapsed .sidebar-logo-icon,
.sidebar.collapsed .sidebar-logo img  { display: none; }
.sidebar:not(.collapsed) .nav-label,
.sidebar:not(.collapsed) .nav-section-label,
.sidebar:not(.collapsed) .sidebar-logo-text,
.sidebar:not(.collapsed) .sidebar-user-info {
  animation: sidebarFadeIn 0.18s var(--ease) forwards;
}
@keyframes sidebarFadeIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: none; }
}

/* Sidebar backdrop (mobile) */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.48); z-index: 199;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s var(--ease);
}
.sidebar-backdrop.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh; min-width: 0;
  display: flex; flex-direction: column;
  transition: margin-left 0.26s var(--ease);
}
.main-content.sidebar-collapsed { margin-left: var(--sidebar-collapsed-w); }

.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--page-pad);
  position: sticky; top: 0; z-index: 100;
  transition: background var(--transition);
  box-shadow: var(--shadow-xs);
  gap: 12px;
}

.page-content {
  flex: 1;
  padding: var(--page-pad);
  animation: pageIn 0.28s var(--ease-out);
  min-width: 0;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ══════════════════════════════
   4. SIDEBAR COMPONENTS
══════════════════════════════ */
.sidebar-logo {
  padding: 14px 10px 14px 14px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: var(--topbar-h); flex-shrink: 0;
}
.sidebar-logo .sidebar-pin { margin-left: auto; flex-shrink: 0; }
.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.1rem; flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(232,130,26,0.28);
}
.sidebar-logo-text { overflow: hidden; min-width: 0; flex: 1; }
.sidebar-logo-text .app-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; font-size: 0.88rem;
  color: rgba(255,255,255,0.94); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-logo-text .app-sub { font-size: 0.70rem; color: rgba(255,255,255,0.42); white-space: nowrap; }

.sidebar-pin {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}
.sidebar-pin:hover  { background: rgba(255,255,255,0.08); color: white; }
.sidebar-pin.pinned { color: rgba(255,255,255,0.85); }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; overflow-x: hidden; }

.nav-section-label {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: rgba(255,255,255,0.32);
  padding: 14px 10px 5px;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius);
  color: rgba(255,255,255,0.68); font-size: 0.86rem; font-weight: 500;
  margin-bottom: 1px;
  transition: background var(--transition-fast), color var(--transition-fast);
  cursor: pointer; position: relative;
  white-space: nowrap; user-select: none;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-item.active { background: linear-gradient(135deg, var(--primary-light), #1d4ed8); color: white; font-weight: 600; box-shadow: 0 2px 8px rgba(37,87,167,0.35); }
.nav-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.65; }
.nav-item.active .nav-icon, .nav-item:hover .nav-icon { opacity: 1; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  margin-left: auto; background: var(--accent); color: white;
  font-size: 0.62rem; font-weight: 700; padding: 1px 7px;
  border-radius: 99px; min-width: 18px; text-align: center; flex-shrink: 0;
}

.nav-tooltip {
  position: fixed; left: calc(var(--sidebar-collapsed-w) + 10px);
  background: #1e293b; color: #f1f5f9;
  font-size: 0.76rem; font-weight: 500;
  padding: 5px 10px; border-radius: var(--radius-sm);
  white-space: nowrap; pointer-events: none; z-index: 9999;
  opacity: 0; transition: opacity 0.10s; box-shadow: var(--shadow-md);
}
.nav-tooltip.visible { opacity: 1; }
.nav-tooltip::before {
  content: ''; position: absolute; left: -5px; top: 50%; transform: translateY(-50%);
  border: 5px solid transparent; border-right-color: #1e293b; border-left-width: 0;
}

.sidebar-footer { padding: 10px; border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.sidebar-user {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius);
  cursor: pointer; transition: background var(--transition-fast);
}
.sidebar-user:hover { background: rgba(255,255,255,0.06); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.76rem; flex-shrink: 0;
}
.user-info { overflow: hidden; flex: 1; min-width: 0; }
.user-name { font-size: 0.80rem; font-weight: 600; color: rgba(255,255,255,0.92); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.68rem; color: rgba(255,255,255,0.4); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* ══════════════════════════════
   5. TOPBAR COMPONENTS
══════════════════════════════ */
.topbar-left  { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.topbar-hamburger {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius);
  color: var(--text-secondary); transition: background var(--transition-fast); flex-shrink: 0;
}
.topbar-hamburger:hover { background: var(--bg-surface-2); color: var(--text-primary); }

.topbar-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.breadcrumb { font-size: 0.76rem; color: var(--text-muted); }
.breadcrumb span { color: var(--text-secondary); }

.icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative; flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-surface-2); color: var(--text-primary); }

.theme-toggle {
  width: 50px; height: 26px; background: var(--bg-surface-3);
  border-radius: 99px; position: relative; cursor: pointer;
  transition: background var(--transition); border: 1px solid var(--border);
  display: flex; align-items: center; padding: 2px; flex-shrink: 0;
}
.theme-toggle-thumb {
  width: 20px; height: 20px; background: var(--bg-surface);
  border-radius: 50%; box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
  display: flex; align-items: center; justify-content: center; font-size: 0.65rem;
}
[data-theme="dark"] .theme-toggle { background: var(--primary-light); }
[data-theme="dark"] .theme-toggle-thumb { transform: translateX(24px); }

.topbar-user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: var(--radius-lg);
  background: var(--bg-surface-2); border: 1px solid var(--border);
  font-size: 0.80rem; flex-shrink: 0;
}

/* ══════════════════════════════
   6. PAGE HEADER
══════════════════════════════ */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.page-header-info .page-title { font-size: 1.35rem; font-weight: 800; line-height: 1.2; }
.page-header-info .page-desc  { font-size: 0.80rem; color: var(--text-muted); margin-top: 3px; }
.page-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ══════════════════════════════
   7. CARDS
══════════════════════════════ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), background var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border); gap: 10px; flex-wrap: wrap;
}
.card-title    { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.92rem; font-weight: 700; }
.card-subtitle { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }

.stat-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.stat-card::after {
  content: ''; position: absolute; right: -18px; top: -18px;
  width: 72px; height: 72px; border-radius: 50%; opacity: 0.055; pointer-events: none;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card.blue::after   { background: var(--primary); }
.stat-card.orange::after { background: var(--accent); }
.stat-card.green::after  { background: var(--success); }
.stat-card.red::after    { background: var(--danger); }
.stat-card.purple::after { background: #7C3AED; }

.stat-icon {
  width: 40px; height: 40px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.stat-icon.blue   { background: rgba(26,60,110,0.10);  color: var(--primary-light); }
.stat-icon.orange { background: rgba(232,130,26,0.10); color: var(--accent); }
.stat-icon.green  { background: rgba(15,123,85,0.10);  color: var(--success); }
.stat-icon.red    { background: rgba(192,57,43,0.10);  color: var(--danger); }
.stat-icon.purple { background: rgba(124,58,237,0.10); color: #7C3AED; }

.stat-value { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.7rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.76rem; color: var(--text-muted); margin-top: 4px; }
.stat-trend { font-size: 0.73rem; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ══════════════════════════════
   8. GRID LAYOUTS
══════════════════════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }

/* Variante compacta — para páginas con 5+ tarjetas de stats (ej. Bordados) */
.stats-grid-compact { grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stats-grid-compact .stat-card  { padding: 12px 14px; }
.stats-grid-compact .stat-icon  { width: 30px; height: 30px; margin-bottom: 8px; }
.stats-grid-compact .stat-icon svg { width: 16px; height: 16px; }
.stats-grid-compact .stat-value { font-size: 1.3rem; }
.stats-grid-compact .stat-label { font-size: 0.7rem; margin-top: 2px; }
@media (max-width: 900px) {
  .stats-grid-compact { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 500px) {
  .stats-grid-compact { grid-template-columns: repeat(2, 1fr); }
}
.grid-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3     { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4     { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ══════════════════════════════
   9. TABLES
══════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 500px; }
thead tr { background: var(--bg-surface-2); }
th {
  padding: 9px 14px; text-align: left;
  font-size: 0.70rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted); white-space: nowrap; user-select: none;
}
td {
  padding: 11px 14px; font-size: 0.83rem;
  color: var(--text-secondary); border-bottom: 1px solid var(--border); vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition-fast); }
tbody tr:hover { background: var(--bg-surface-2); }

/* ══════════════════════════════
   10. BADGES / STATUS
══════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 99px;
  font-size: 0.70rem; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge.pending  { background: var(--warning-light); color: var(--warning); }
.badge.approved { background: var(--success-light); color: var(--success); }
.badge.rejected { background: var(--danger-light);  color: var(--danger); }
.badge.draft    { background: var(--bg-surface-3);  color: var(--text-muted); }
.badge.issued   { background: var(--info-light);    color: var(--info); }
.badge.received { background: var(--success-light); color: var(--success); }
.badge.partial  { background: var(--warning-light); color: var(--warning); }
.badge.voided   { background: #F3E8FF; color: #7C3AED; }

/* ══════════════════════════════
   11. BUTTONS
══════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--radius);
  font-size: 0.83rem; font-weight: 600;
  transition: all var(--transition);
  position: relative; overflow: hidden;
  white-space: nowrap; user-select: none; flex-shrink: 0;
}
.btn:active { transform: scale(0.97); }
.btn::after { content: ''; position: absolute; inset: 0; background: white; opacity: 0; transition: opacity 0.12s; }
.btn:hover::after { opacity: 0.07; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white; box-shadow: 0 3px 10px rgba(26,60,110,0.25);
}
.btn-primary:hover { box-shadow: 0 5px 16px rgba(26,60,110,0.35); transform: translateY(-1px); }
.btn-accent  { background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: white; }
.btn-success { background: linear-gradient(135deg, var(--success), #15a86e); color: white; }
.btn-danger  { background: linear-gradient(135deg, var(--danger), #e74c3c); color: white; }
.btn-outline {
  background: transparent; border: 1.5px solid var(--border-strong); color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); background: rgba(26,60,110,0.05); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.btn-sm   { padding: 5px 11px; font-size: 0.76rem; }
.btn-lg   { padding: 10px 22px; font-size: 0.92rem; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--radius); }

/* ══════════════════════════════
   12. FORMS
══════════════════════════════ */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 5px;
}
.form-label.required::after { content: ' *'; color: var(--danger); }

.form-control {
  width: 100%; padding: 8px 12px;
  background: var(--bg-surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary); font-size: 0.84rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none; appearance: none;
}
.form-control:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,87,167,0.12);
}
.form-control::placeholder { color: var(--text-muted); }
[data-theme="dark"] .form-control { background: var(--bg-surface-2); }
select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238A98B8'%3E%3Cpath d='M1 1l5 5 5-5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px;
}
textarea.form-control { resize: vertical; min-height: 86px; }
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.form-section {
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 18px;
}
.form-section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.83rem; font-weight: 700; color: var(--primary-light);
  margin-bottom: 14px; display: flex; align-items: center; gap: 6px;
}
[data-theme="dark"] .form-section-title { color: #7EB3FF; }

.input-group { display: flex; align-items: stretch; }
.input-group-prefix {
  padding: 0 11px; background: var(--bg-surface-3);
  border: 1.5px solid var(--border); border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  display: flex; align-items: center; font-size: 0.82rem; color: var(--text-muted); flex-shrink: 0;
}
.input-group .form-control { border-radius: 0 var(--radius) var(--radius) 0; }

.items-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.items-table th { background: var(--bg-surface-3); }
.item-row-input {
  padding: 5px 7px; background: transparent;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 0.80rem; width: 100%;
  transition: border-color var(--transition-fast), background var(--transition-fast); font-family: inherit;
}
.item-row-input:focus { outline: none; border-color: var(--primary-light); background: var(--bg-surface); }

/* ══════════════════════════════
   13. MODALS
══════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 999; display: flex; align-items: center; justify-content: center;
  padding: 16px; animation: fadeIn 0.18s var(--ease);
}
.modal {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); width: 100%; max-width: 620px;
  max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl); animation: slideUp 0.24s var(--ease-spring);
}
.modal-lg { max-width: 860px; }
.modal-xl { max-width: 1100px; }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-header {
  padding: 20px 22px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1rem; font-weight: 700; }
.modal-body  { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; flex-wrap: wrap;
}
.confirm-modal { max-width: 400px; }
.confirm-icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin: 0 auto 14px;
}
.confirm-icon.danger  { background: var(--danger-light); }
.confirm-icon.warning { background: var(--warning-light); }

/* ══════════════════════════════
   14. TOASTS
══════════════════════════════ */
#toast-container {
  position: fixed; right: 16px; bottom: 16px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px);
}
.toast {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 16px;
  min-width: 240px; max-width: 340px;
  box-shadow: var(--shadow-xl); display: flex; align-items: flex-start; gap: 10px;
  animation: toastIn 0.28s var(--ease-spring); border-left: 3px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.toast-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.toast-content .toast-title { font-weight: 700; font-size: 0.82rem; }
.toast-content .toast-msg   { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }

/* ══════════════════════════════
   15. SEARCH & FILTERS
══════════════════════════════ */
.search-bar { position: relative; display: flex; align-items: center; }
.search-bar svg { position: absolute; left: 10px; color: var(--text-muted); width: 15px; height: 15px; pointer-events: none; }
.search-bar input { padding-left: 34px; width: 240px; }
.filters-row { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }

/* ══════════════════════════════
   16. EMPTY STATE
══════════════════════════════ */
.empty-state { text-align: center; padding: 52px 20px; color: var(--text-muted); }
.empty-state .empty-icon  { font-size: 2.8rem; margin-bottom: 14px; opacity: 0.35; }
.empty-state .empty-title { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 0.95rem; font-weight: 700; color: var(--text-secondary); }
.empty-state .empty-desc  { font-size: 0.80rem; margin-top: 5px; }
.empty-state .btn         { margin-top: 18px; }

/* ══════════════════════════════
   17. PROGRESS / STEPS
══════════════════════════════ */
.steps-bar { display: flex; align-items: center; margin-bottom: 24px; }
.step { display: flex; align-items: center; gap: 7px; flex: 1; position: relative; }
.step:last-child { flex: none; }
.step-circle {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; border: 2px solid var(--border);
  background: var(--bg-surface); color: var(--text-muted);
  transition: all var(--transition); flex-shrink: 0; z-index: 1;
}
.step.active .step-circle { border-color: var(--primary-light); background: var(--primary-light); color: white; }
.step.done   .step-circle { border-color: var(--success); background: var(--success); color: white; }
.step-line { flex: 1; height: 2px; background: var(--border); transition: background var(--transition); }
.step.done .step-line { background: var(--success); }
.step-label { font-size: 0.70rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.step.active .step-label { color: var(--primary-light); }
.step.done   .step-label { color: var(--success); }

/* ══════════════════════════════
   18. SKELETON
══════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-surface-2) 50%, var(--border) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card  { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 22px; margin-bottom: 14px; }
.skeleton-line  { height: 13px; margin-bottom: 9px; border-radius: 5px; }
.skeleton-title { height: 19px; width: 40%; margin-bottom: 15px; border-radius: 5px; }
.skeleton-stat  { height: 60px; border-radius: var(--radius-xl); }
.skeleton-row   { height: 46px; margin-bottom: 7px; border-radius: var(--radius); }

/* ══════════════════════════════
   19. DROPDOWN
══════════════════════════════ */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 5px); right: 0;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  min-width: 172px; z-index: 500; overflow: hidden; animation: fadeIn 0.14s var(--ease);
}
.dropdown-item {
  padding: 8px 14px; font-size: 0.82rem; color: var(--text-secondary);
  cursor: pointer; transition: background var(--transition-fast);
  display: flex; align-items: center; gap: 8px; user-select: none;
}
.dropdown-item:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ══════════════════════════════
   20. ROLE BADGES
══════════════════════════════ */
.role-badge {
  display: inline-block; padding: 1px 8px; border-radius: 99px;
  font-size: 0.63rem; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap;
}
.role-badge.role-superuser        { background: rgba(139,47,201,0.12); color: #8B2FC9; }
.role-badge.role-admin            { background: rgba(26,60,110,0.12);  color: var(--primary-light); }
.role-badge.role-approver         { background: rgba(15,123,85,0.12);  color: var(--success); }
.role-badge.role-requester        { background: rgba(180,83,9,0.12);   color: var(--warning); }
.role-badge.role-asesor           { background: rgba(8,145,178,0.12);  color: #0891b2; }
.role-badge.role-operario_bordado { background: rgba(217,119,6,0.12);  color: #d97706; }

/* Dentro del sidebar oscuro: pill sólido claro para que se lea bien */
.sidebar-user .role-badge { background: rgba(255,255,255,0.14); color: #cfe0ff; }
.role-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.role-dot.superuser        { background: #8B2FC9; }
.role-dot.admin            { background: var(--primary-light); }
.role-dot.approver         { background: var(--success); }
.role-dot.requester        { background: var(--warning); }
.role-dot.asesor           { background: #0891b2; }
.role-dot.operario_bordado { background: #d97706; }

/* ══════════════════════════════
   21. AUTH / LOGIN
══════════════════════════════ */
.auth-spinner {
  width: 42px; height: 42px; border: 3px solid rgba(255,255,255,0.2);
  border-top-color: rgba(255,255,255,0.85); border-radius: 50%; animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-bg {
  min-height: 100vh;
  display: flex;
  background: #050d1e; /* fallback visible mientras carga, cubierto por los paneles */
}

/* ── Panel izquierdo: marca + valor ─────────────────────── */
.login-branding {
  flex: 1 1 58%;
  min-width: 0;
  background: linear-gradient(145deg, #050d1e 0%, #0c1c3a 45%, #162d5c 75%, #0a1425 100%);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 48px clamp(32px, 5vw, 72px);
}
.login-orb { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.login-orb-1 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(37,87,167,0.32) 0%, transparent 70%);
  top: -180px; left: -120px; animation: orbFloat 9s ease-in-out infinite;
}
.login-orb-2 {
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(232,130,26,0.16) 0%, transparent 70%);
  bottom: -160px; right: -100px; animation: orbFloat 11s ease-in-out infinite reverse;
}
@keyframes orbFloat {
  0%,100% { transform: translateY(0) scale(1); }
  50%     { transform: translateY(-26px) scale(1.04); }
}
.login-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 30px 30px; pointer-events: none;
}
.login-branding-inner { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; max-width: 560px; }

.login-brand-top { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.login-brand-logo {
  width: 44px; height: 44px; background: linear-gradient(135deg, #e8821a, #f5a04a);
  border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(232,130,26,0.32);
}
.login-brand-logo-img { height: 44px; width: auto; max-width: 180px; object-fit: contain; flex-shrink: 0; }
.login-brand-wordmark { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 0.95rem; color: rgba(255,255,255,0.92); letter-spacing: -0.01em; }

.login-eyebrow { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; color: var(--accent-light); margin-bottom: 18px; }
.login-hero-title {
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; letter-spacing: -0.02em;
  font-size: clamp(1.9rem, 3vw, 2.7rem); line-height: 1.14; color: white; margin-bottom: 18px;
}
.login-hero-accent {
  background: linear-gradient(100deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-hero-sub { font-size: 0.94rem; line-height: 1.6; color: rgba(255,255,255,0.55); max-width: 440px; margin-bottom: 34px; }

/* ── Mockup flotante (signature element) ─────────────────── */
.login-mockup-card {
  background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px; overflow: hidden; margin-bottom: 34px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35); backdrop-filter: blur(6px);
  animation: mockupIn 0.6s var(--ease-spring) 0.15s both;
}
@keyframes mockupIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.login-mockup-titlebar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: rgba(255,255,255,0.04); border-bottom: 1px solid rgba(255,255,255,0.08); }
.login-mockup-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.login-mockup-title { margin-left: 8px; font-size: 0.68rem; color: rgba(255,255,255,0.4); font-weight: 600; }
.login-mockup-body { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 13px; }
.login-mockup-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.login-mockup-op { font-size: 0.76rem; font-weight: 600; color: rgba(255,255,255,0.85); }
.login-mockup-badge { font-size: 0.63rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.login-mockup-badge.badge-progress { background: rgba(37,87,167,0.28); color: #8fb4e8; }
.login-mockup-badge.badge-done     { background: rgba(15,123,85,0.28); color: #6fd7ab; }
.login-mockup-badge.badge-cut      { background: rgba(232,130,26,0.24); color: #f5b063; }
.login-mockup-bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; }
.login-mockup-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary-light), var(--accent-light)); }

/* ── Features + trust ─────────────────────────────────────── */
.login-features-row { display: flex; gap: 22px; margin-bottom: 26px; flex-wrap: wrap; }
.login-feature-mini { display: flex; align-items: flex-start; gap: 10px; flex: 1 1 150px; min-width: 150px; }
.login-feature-mini-icon { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.09); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; flex-shrink: 0; }
.login-feature-mini-title { font-size: 0.76rem; font-weight: 600; color: rgba(255,255,255,0.82); margin-bottom: 1px; }
.login-feature-mini-desc  { font-size: 0.68rem; color: rgba(255,255,255,0.36); }

.login-trust-row { display: flex; gap: 20px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.08); margin-top: auto; }
.login-trust-item { display: flex; align-items: center; gap: 7px; font-size: 0.72rem; font-weight: 600; color: rgba(255,255,255,0.5); }
.login-trust-item svg { color: #6fd7ab; flex-shrink: 0; }

.login-status-footer {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 8px;
  font-size: 0.72rem; color: rgba(255,255,255,0.4); margin-top: 28px;
}
.login-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #28c840; box-shadow: 0 0 0 0 rgba(40,200,64,0.5); animation: statusPulse 2s infinite; flex-shrink: 0; }
@keyframes statusPulse {
  0%   { box-shadow: 0 0 0 0 rgba(40,200,64,0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(40,200,64,0); }
  100% { box-shadow: 0 0 0 0 rgba(40,200,64,0); }
}

/* ── Panel derecho: formulario ────────────────────────────── */
.login-form-panel {
  flex: 1 1 42%; min-width: 0;
  background: var(--bg-surface); display: flex; flex-direction: column;
  padding: 48px clamp(28px, 4vw, 64px); overflow-y: auto;
}
[data-theme="dark"] .login-form-panel { background: #111827; }
.login-form-panel-inner { margin: auto; width: 100%; max-width: 400px; display: flex; flex-direction: column; }

.login-form-top-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 44px; }
.login-form-top-logo { width: 30px; height: 30px; background: linear-gradient(135deg, #1a3c6e, #2557a7); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.login-form-top-logo-img { height: 30px; width: auto; max-width: 140px; object-fit: contain; flex-shrink: 0; }
.login-form-top-name { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 0.86rem; color: var(--text-primary); }

.login-form-header { margin-bottom: 30px; }
.login-form-eyebrow { font-size: 0.82rem; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.login-form-title  { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 1.7rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; line-height: 1.25; }
.login-form-title-accent { color: var(--primary-light); }
.login-form-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 7px; }
.login-form-body { display: flex; flex-direction: column; }
.login-input-group { margin-bottom: 18px; }
.login-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 7px; }
.login-input-wrap { position: relative; }
.login-input-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-muted); pointer-events: none; }
.login-input {
  width: 100%; padding: 12px 42px 12px 42px;
  background: var(--bg-surface-2); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); color: var(--text-primary);
  font-size: 0.90rem; font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.login-input:focus { outline: none; border-color: var(--primary-light); background: var(--bg-surface); box-shadow: 0 0 0 4px rgba(37,87,167,0.10); }
.login-input::placeholder { color: var(--text-muted); }
[data-theme="dark"] .login-input { background: var(--bg-surface-2); }
.login-eye-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); cursor: pointer; border: none; background: none; color: var(--text-muted); padding: 4px; transition: color var(--transition-fast); }
.login-eye-btn:hover { color: var(--text-primary); }
.login-error { background: var(--danger-light); color: var(--danger); padding: 10px 14px; border-radius: var(--radius); font-size: 0.80rem; font-weight: 500; margin-bottom: 14px; border-left: 3px solid var(--danger); }
.login-error.hidden { display: none; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-5px); } 40%,80% { transform: translateX(5px); } }
.login-error.shake { animation: shake 0.38s ease; }
.login-btn {
  width: 100%; padding: 13px 22px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white; border: none; border-radius: var(--radius-lg);
  font-size: 0.92rem; font-weight: 700; font-family: 'Plus Jakarta Sans', sans-serif;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 5px 18px rgba(26,60,110,0.38); transition: all 0.22s ease;
  margin-top: 8px; margin-bottom: 20px; position: relative; overflow: hidden;
}
.login-btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,0.13) 0%, transparent 60%); pointer-events: none; }
.login-btn:hover:not(:disabled)  { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(26,60,110,0.48); }
.login-btn:active:not(:disabled) { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.78; cursor: not-allowed; }
.login-btn-spinner { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.65s linear infinite; }
.login-btn-spinner.hidden { display: none; }

.login-security-note { display: flex; align-items: center; gap: 9px; color: var(--success); }
.login-security-note svg { flex-shrink: 0; }
.login-security-title { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.login-security-desc  { font-size: 0.7rem; color: var(--text-muted); }

.login-form-footer { text-align: center; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border); }
.login-footer-line1 { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }
.login-footer-line1 strong { color: var(--primary); font-weight: 700; letter-spacing: 0.05em; }
.login-footer-line2 { font-size: 0.68rem; color: var(--text-muted); opacity: 0.6; letter-spacing: 0.03em; }

/* ══════════════════════════════
   22. CHARTS / MISC
══════════════════════════════ */
.mini-chart { display: flex; align-items: flex-end; gap: 3px; height: 38px; }
.mini-bar { flex: 1; border-radius: 3px 3px 0 0; background: var(--primary-light); opacity: 0.28; transition: opacity var(--transition); min-width: 5px; }
.mini-bar.active { opacity: 1; }
.mini-bar:hover  { opacity: 0.75; }

.avatar { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: white; flex-shrink: 0; width: 34px; height: 34px; font-size: 0.76rem; }
.avatar-sm { width: 28px; height: 28px; font-size: 0.68rem; }
.avatar-lg { width: 44px; height: 44px; font-size: 0.90rem; }

/* ══════════════════════════════
   23. PRINT
══════════════════════════════ */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin: 0 !important; }
  .page-content { padding: 0 !important; }
  body { background: white; color: black; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ══════════════════════════════
   24. RESPONSIVE
══════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 260px !important; box-shadow: none; }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .main-content { margin-left: 0 !important; }
  .topbar { padding: 0 var(--page-pad-mobile); }
  .topbar-hamburger { display: flex; }
  .page-content { padding: var(--page-pad-mobile); }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .login-branding  { display: none; }
  .login-form-panel { padding: 32px 24px; min-height: 100vh; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; justify-content: center; }
  .modal-header { flex-wrap: wrap; row-gap: 8px; }
  .search-bar input { width: 100%; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .topbar-user-chip .user-chip-name { display: none; }
}

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-4     { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1080px) and (min-width: 769px) {
  .login-mockup-card, .login-trust-row { display: none; }
  .login-features-row { margin-top: 8px; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
}

/* Sidebar backdrop */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.48); z-index: 199;
  backdrop-filter: blur(2px); animation: fadeIn 0.2s var(--ease);
}
.sidebar-backdrop.active { display: block; }

/* ══════════════════════════════
   25. UTILITIES
══════════════════════════════ */
.text-primary-c { color: var(--primary-light); }
.text-accent    { color: var(--accent); }
.text-success   { color: var(--success); }
.text-danger    { color: var(--danger); }
.text-muted     { color: var(--text-muted); }
.text-sm        { font-size: 0.80rem; }
.text-xs        { font-size: 0.70rem; }
.font-bold      { font-weight: 700; }
.font-semibold  { font-weight: 600; }
.d-flex         { display: flex; }
.align-center   { align-items: center; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.w-full   { width: 100%; }
.hidden   { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-select { user-select: none; }
.divider  { height: 1px; background: var(--border); margin: 16px 0; }
body.modal-open { overflow: hidden; }
