/* ================================================================
   GREENSTRUM PORTAL — DESIGN SYSTEM
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ================================================================
   CSS VARIABLES
   ================================================================ */
:root {
  --green-950: #052e16;
  --green-900: #14532d;
  --green-800: #166534;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --green-400: #4ade80;
  --green-300: #86efac;
  --green-200: #bbf7d0;
  --green-100: #dcfce7;
  --green-50:  #f0fdf4;

  --primary:        #15803d;
  --primary-dark:   #14532d;
  --primary-darker: #0a2a18;
  --primary-light:  #16a34a;
  --primary-accent: #22c55e;

  --sidebar-width:   260px;
  --topbar-height:   64px;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  --transition: all 0.25s ease;
  --transition-fast: all 0.15s ease;
}

/* ── Light Theme ─────────────────────────────────────────────── */
[data-theme="light"] {
  color-scheme: light;
  --bg-body:           #f0f5f1;
  --bg-sidebar:        #0a2a18;
  --bg-sidebar-hover:  rgba(255,255,255,0.08);
  --bg-sidebar-active: rgba(34,197,94,0.18);
  --bg-topbar:         #ffffff;
  --bg-card:           #ffffff;
  --bg-input:          #ffffff;
  --bg-badge:          #f0f5f1;
  --bg-table-header:   #f7faf8;
  --bg-table-row-alt:  #fbfdfb;
  --bg-modal:          #ffffff;
  --bg-overlay:        rgba(0,0,0,0.45);

  --text-primary:       #0f172a;
  --text-secondary:     #475569;
  --text-muted:         #94a3b8;
  --text-sidebar:       #e2e8f0;
  --text-sidebar-muted: #94a3b8;
  --text-sidebar-active:#ffffff;
  --text-on-primary:    #ffffff;

  --border-color:  #e2e8f0;
  --border-input:  #cbd5e1;
  --border-focus:  #15803d;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.10);
  --shadow-xl:  0 20px 40px rgba(0,0,0,0.12);
}

/* ── Dark Theme ──────────────────────────────────────────────── */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-body:           #080e0a;
  --bg-sidebar:        #030d06;
  --bg-sidebar-hover:  rgba(255,255,255,0.06);
  --bg-sidebar-active: rgba(34,197,94,0.14);
  --bg-topbar:         #0d1310;
  --bg-card:           #0d1310;
  --bg-input:          #131c15;
  --bg-badge:          #131c15;
  --bg-table-header:   #0f160f;
  --bg-table-row-alt:  #0b1009;
  --bg-modal:          #0d1310;
  --bg-overlay:        rgba(0,0,0,0.65);

  --text-primary:       #f1f5f3;
  --text-secondary:     #94a3a0;
  --text-muted:         #4b5e53;
  --text-sidebar:       #cdd5cd;
  --text-sidebar-muted: #4b5e53;
  --text-sidebar-active:#ffffff;
  --text-on-primary:    #ffffff;

  --border-color:  #1a2b1e;
  --border-input:  #243028;
  --border-focus:  #22c55e;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.5);
  --shadow-xl:  0 20px 40px rgba(0,0,0,0.6);
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

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

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: width 0.3s ease, transform 0.3s ease;
  overflow: hidden;
}

/* Sidebar Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
}
.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-accent));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 18px; color: white;
  box-shadow: 0 4px 12px rgba(21,128,61,0.4);
}
.logo-text { display: flex; flex-direction: column; }
.logo-name {
  font-size: 15px; font-weight: 700;
  color: #ffffff; letter-spacing: 0.3px;
}
.logo-tagline {
  font-size: 10px; font-weight: 500;
  color: var(--primary-accent); letter-spacing: 1.5px; text-transform: uppercase;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.nav-section-label {
  padding: 16px 20px 6px;
  font-size: 10px; font-weight: 600;
  color: var(--text-sidebar-muted);
  letter-spacing: 1.2px; text-transform: uppercase;
  white-space: nowrap;
}

.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  margin: 1px 8px;
  color: var(--text-sidebar);
  font-size: 13.5px; font-weight: 500;
  transition: var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.nav-link:hover {
  background: var(--bg-sidebar-hover);
  color: #ffffff;
}
.nav-link.active {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
}
.nav-link.active .nav-icon { color: var(--primary-accent); }
.nav-link.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--primary-accent);
  border-radius: 0 3px 3px 0;
}
.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-sidebar-muted);
  transition: var(--transition-fast);
}
.nav-link:hover .nav-icon { color: #ffffff; }
.nav-arrow {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-sidebar-muted);
  transition: transform 0.25s ease;
}
.nav-item.open > .nav-link .nav-arrow { transform: rotate(180deg); }

/* Submenu */
.submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}
.nav-item.open .submenu { max-height: 500px; }
.submenu-link {
  display: flex; align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 48px;
  margin: 1px 8px;
  border-radius: var(--radius-md);
  color: var(--text-sidebar-muted);
  font-size: 13px; font-weight: 400;
  transition: var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}
.submenu-link:hover { background: var(--bg-sidebar-hover); color: #ffffff; }
.submenu-link.active { background: var(--bg-sidebar-active); color: var(--text-sidebar-active); }
.submenu-link i { font-size: 13px; width: 16px; text-align: center; }

/* Nested sub-submenu */
.submenu-sub-parent { position: relative; }
.submenu-sub-parent .sub-arrow {
  font-size: 10px;
  margin-left: auto;
  transition: transform 0.25s ease;
}
li.sub-open > .submenu-sub-parent .sub-arrow { transform: rotate(90deg); }
.sub-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}
li.sub-open > .sub-submenu { max-height: 200px; }
.sub-submenu-link {
  display: flex; align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 64px;
  margin: 1px 8px;
  border-radius: var(--radius-md);
  color: var(--text-sidebar-muted);
  font-size: 12px; font-weight: 400;
  transition: var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}
.sub-submenu-link:hover { background: var(--bg-sidebar-hover); color: #ffffff; }
.sub-submenu-link.active { background: var(--bg-sidebar-active); color: var(--text-sidebar-active); }
.sub-submenu-link i { font-size: 12px; width: 16px; text-align: center; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #ffffff;
  flex-shrink: 0;
}
.user-details { flex: 1; overflow: hidden; }
.user-name {
  display: block;
  font-size: 13px; font-weight: 600; color: #ffffff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  display: block;
  font-size: 11px; color: var(--text-sidebar-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.logout-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-sidebar-muted);
  font-size: 14px;
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.logout-btn:hover { background: rgba(239,68,68,0.2); color: #ef4444; }


/* ================================================================
   MAIN CONTENT AREA
   ================================================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

/* ================================================================
   TOPBAR
   ================================================================ */
.topbar {
  position: sticky; top: 0;
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 100;
  transition: background 0.3s ease;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.page-title {
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
}
.page-breadcrumb {
  font-size: 13px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.page-breadcrumb span { color: var(--text-primary); font-weight: 500; }
.topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}
.topbar-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-badge);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: var(--transition-fast);
  position: relative;
}
.topbar-btn:hover { background: var(--border-color); color: var(--text-primary); }
.badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--bg-topbar);
}
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-badge);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: var(--transition-fast);
}
.theme-toggle:hover { background: var(--primary-lighter, var(--green-100)); color: var(--primary); }

.topbar-avatar {
  width: 38px; height: 38px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #ffffff;
  cursor: pointer;
  border: 2px solid var(--border-color);
}

/* ================================================================
   PAGE CONTENT
   ================================================================ */
.page-content {
  flex: 1;
  padding: 28px 28px;
  overflow-x: hidden;
}

/* ================================================================
   STAT CARDS
   ================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-start; gap: 16px;
  transition: var(--transition);
  cursor: default;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon-wrap {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon-wrap.green { background: rgba(21,128,61,0.12); color: var(--primary); }
.stat-icon-wrap.blue  { background: rgba(59,130,246,0.12); color: #3b82f6; }
.stat-icon-wrap.amber { background: rgba(245,158,11,0.12); color: #f59e0b; }
.stat-icon-wrap.red   { background: rgba(239,68,68,0.12);  color: #ef4444; }
.stat-icon-wrap.purple{ background: rgba(139,92,246,0.12); color: #8b5cf6; }
.stat-icon-wrap.teal  { background: rgba(20,184,166,0.12); color: #14b8a6; }
.stat-body { flex: 1; }
.stat-value {
  font-size: 28px; font-weight: 800;
  color: var(--text-primary); line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 13px; color: var(--text-secondary);
  font-weight: 500;
}
.stat-change {
  font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 6px;
}
.stat-change.up   { color: #16a34a; }
.stat-change.down { color: #ef4444; }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
}
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 22px; }

/* ================================================================
   GRID LAYOUTS
   ================================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-col-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-col-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px; font-weight: 600;
  transition: var(--transition-fast);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-color);
}
.btn-outline:hover { background: var(--bg-badge); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-badge); color: var(--text-primary); }

.btn-danger {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }

.btn-success {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}
.btn-success:hover { background: var(--primary-dark); }

/* ================================================================
   BADGES / STATUS CHIPS
   ================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-secondary  { background: rgba(107,114,128,0.12); color: #6b7280; }
.badge-unassigned { background: rgba(107,114,128,0.12); color: #6b7280; }
.badge-ocular     { background: rgba(59,130,246,0.12);  color: #3b82f6; }
.badge-installation { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-installed  { background: rgba(16,185,129,0.12);  color: #059669; }
.badge-delayed    { background: rgba(239,68,68,0.12);   color: #ef4444; }
.badge-closed     { background: rgba(139,92,246,0.12);  color: #8b5cf6; }
.badge-not-feasible { background: rgba(236,72,153,0.12); color: #db2777; }

.badge-success { background: rgba(16,185,129,0.12); color: #059669; }
.badge-warning { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-danger  { background: rgba(239,68,68,0.12);  color: #ef4444; }
.badge-info    { background: rgba(59,130,246,0.12);  color: #3b82f6; }
.badge-primary { background: rgba(21,128,61,0.12);   color: var(--primary); }
.badge-gray    { background: rgba(107,114,128,0.12); color: #6b7280; }
.badge-for-review  { background: rgba(168,85,247,0.12); color: #a855f7; }
.badge-for-install { background: rgba(20,184,166,0.12); color: #14b8a6; }
.badge-teal        { background: rgba(6,182,212,0.12);  color: #0891b2; }

/* ================================================================
   FORMS & INPUTS
   ================================================================ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition-fast);
  outline: none;
}
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(21,128,61,0.12);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control-sm { padding: 7px 12px; font-size: 13px; }
.input-group {
  display: flex; align-items: center;
  gap: 8px;
}
.input-icon-wrap {
  position: relative;
}
.input-icon-wrap .form-control { padding-left: 38px; }
.input-icon-wrap .input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}
select.form-control { cursor: pointer; }
/* Force selects to honour theme colours across browsers */
select {
  color-scheme: inherit;
  background-color: var(--bg-input);
  color: var(--text-primary);
}

/* ================================================================
   FORM ROW (2-column responsive grid)
   ================================================================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ================================================================
   TABLES
   ================================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table thead th {
  background: var(--bg-table-header);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) td { background: var(--bg-table-row-alt); }
.data-table tbody tr:hover td { background: var(--bg-badge); }
.table-id { font-weight: 700; color: var(--primary); font-size: 13px; font-family: 'SF Mono', monospace; }
.table-name { font-weight: 600; }
.table-sub  { font-size: 12px; color: var(--text-muted); }

/* ================================================================
   FILTER BAR
   ================================================================ */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-bar .search-wrap {
  flex: 1;
  min-width: 200px;
}
.filter-select {
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  min-width: 160px;
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
}
.filter-select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(21,128,61,0.1); }

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination {
  display: flex; align-items: center; gap: 4px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.pagination-info { font-size: 13px; color: var(--text-muted); }
.pagination-pages { display: flex; align-items: center; gap: 4px; }
.page-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.page-btn:hover { background: var(--bg-badge); color: var(--text-primary); }
.page-btn.active { background: var(--primary); color: #ffffff; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ================================================================
   MODAL
   ================================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  z-index: 999;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop.active { display: flex; }
.modal {
  background: var(--bg-modal);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.25s ease;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-lg { max-width: 800px; }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-badge);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: var(--transition-fast);
}
.modal-close:hover { background: rgba(239,68,68,0.12); color: #ef4444; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px;
}

/* ================================================================
   CHARTS
   ================================================================ */
.chart-wrap {
  position: relative;
  height: 280px;
  display: flex; align-items: center; justify-content: center;
}
.chart-wrap-tall { height: 340px; }
.chart-wrap-sm   { height: 200px; }

/* ================================================================
   KNOWLEDGE BASE
   ================================================================ */
.kb-hero {
  background: linear-gradient(135deg, var(--primary-darker), var(--primary));
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  text-align: center;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.kb-hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 400px; height: 400px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.kb-hero-title { font-size: 30px; font-weight: 800; color: #ffffff; margin-bottom: 8px; }
.kb-hero-sub   { font-size: 15px; color: rgba(255,255,255,0.7); margin-bottom: 24px; }
.kb-search-wrap {
  max-width: 520px; margin: 0 auto;
  position: relative;
}
.kb-search-wrap .form-control {
  padding: 14px 50px 14px 18px;
  font-size: 15px;
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}
.kb-search-wrap .form-control::placeholder { color: rgba(255,255,255,0.5); }
.kb-search-wrap .form-control:focus { border-color: rgba(255,255,255,0.5); }
.kb-search-btn {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  background: var(--primary-accent);
  color: #ffffff;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: var(--transition-fast);
}
.kb-search-btn:hover { background: var(--primary-light); }

.kb-category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: var(--transition);
  cursor: pointer;
}
.kb-category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.kb-cat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}
.kb-cat-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.kb-cat-count { font-size: 12px; color: var(--text-muted); }

.article-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.article-item:last-child { border-bottom: none; }
.article-item:hover .article-title { color: var(--primary); }
.article-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-badge);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.article-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.article-meta  { font-size: 12px; color: var(--text-muted); }

/* ================================================================
   USERS PAGE
   ================================================================ */
.user-row-avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #ffffff;
  flex-shrink: 0;
}
.user-cell { display: flex; align-items: center; gap: 10px; }

/* ================================================================
   PROGRESS BARS
   ================================================================ */
.progress-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}
.progress-fill.green  { background: var(--primary); }
.progress-fill.blue   { background: #3b82f6; }
.progress-fill.amber  { background: #f59e0b; }
.progress-fill.red    { background: #ef4444; }

/* ================================================================
   TIMELINE
   ================================================================ */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--border-color);
}
.timeline-item {
  position: relative;
  margin-bottom: 20px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-card);
}
.timeline-time { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.timeline-text { font-size: 13px; color: var(--text-secondary); }
.timeline-text strong { color: var(--text-primary); }

/* ================================================================
   CALENDAR / PM GRID
   ================================================================ */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.cal-day-head {
  background: var(--bg-table-header);
  padding: 10px;
  text-align: center;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cal-day {
  background: var(--bg-card);
  padding: 8px;
  min-height: 80px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.cal-day:hover { background: var(--bg-badge); }
.cal-day.other-month { opacity: 0.3; }
.cal-day.today { background: rgba(21,128,61,0.07); }
.cal-day-num {
  font-size: 12px; font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.cal-day.today .cal-day-num {
  width: 22px; height: 22px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.cal-event {
  font-size: 10px; font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================================================================
   DROPDOWN MENU
   ================================================================ */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 500;
  display: none;
  animation: dropdownIn 0.15s ease;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px;
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.dropdown-item:hover { background: var(--bg-badge); color: var(--text-primary); }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.08); color: #ef4444; }
.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}
.dropdown-trigger { position: relative; }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-state p { font-size: 14px; }

/* ================================================================
   ROLE LIST (roles modal left panel)
   ================================================================ */
.role-list-item {
  display: flex; align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
  gap: 6px;
}
.role-list-item:hover  { background: var(--bg-badge); }
.role-list-item.active { background: var(--primary-lighter, rgba(21,128,61,.12)); }
.role-list-item.active span:last-child { color: var(--primary); font-weight: 600; }

/* ================================================================
   SEARCHABLE DROPDOWN (dept picker)
   ================================================================ */
.dept-dd { position: relative; }
.dept-dd-list {
  display: none;
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1050;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 180px; overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.dept-dd-list.open { display: block; }
.dept-dd-item {
  padding: 8px 12px; font-size: 13px; cursor: pointer;
  color: var(--text-primary);
}
.dept-dd-item:hover { background: var(--bg-badge); }
.dept-dd-add { color: var(--primary); font-weight: 600; }

/* ================================================================
   ALERT / NOTIFICATION BANNERS
   ================================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: rgba(16,185,129,0.1); color: #059669; border: 1px solid rgba(16,185,129,0.2); }
.alert-warning { background: rgba(245,158,11,0.1); color: #d97706; border: 1px solid rgba(245,158,11,0.2); }
.alert-danger  { background: rgba(239,68,68,0.1);  color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.alert-info    { background: rgba(59,130,246,0.1);  color: #3b82f6; border: 1px solid rgba(59,130,246,0.2); }

/* ================================================================
   CONFIG PAGE
   ================================================================ */
.config-section { margin-bottom: 32px; }
.config-section-title {
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}
.config-row {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}
.config-row:last-child { border-bottom: none; }
.config-info { flex: 1; }
.config-label { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.config-desc  { font-size: 12px; color: var(--text-muted); }
.config-control { flex-shrink: 0; min-width: 200px; }

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 10px;
}
.toggle input { display: none; }
.toggle-slider {
  width: 44px; height: 24px;
  background: var(--border-color);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: #ffffff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-label { font-size: 13px; color: var(--text-secondary); }

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg-body);
}
.login-left {
  flex: 1;
  background: linear-gradient(160deg, var(--primary-darker) 0%, var(--primary) 50%, var(--primary-light) 100%);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}
.login-left::after {
  content: '';
  position: absolute;
  bottom: -150px; left: -50px;
  width: 350px; height: 350px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.login-brand {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 48px;
  position: relative; z-index: 1;
}
.login-brand-icon {
  width: 64px; height: 64px;
  background: rgba(255,255,255,0.15);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: #ffffff;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.2);
}
.login-brand-name { font-size: 28px; font-weight: 800; color: #ffffff; }
.login-brand-tagline { font-size: 13px; color: rgba(255,255,255,0.6); margin-top: 2px; }
.login-left-content { position: relative; z-index: 1; max-width: 380px; }
.login-left h2 { font-size: 32px; font-weight: 800; color: #ffffff; margin-bottom: 12px; line-height: 1.2; }
.login-left p  { font-size: 16px; color: rgba(255,255,255,0.7); line-height: 1.7; }

.login-features { margin-top: 40px; display: flex; flex-direction: column; gap: 16px; }
.login-feature  { display: flex; align-items: center; gap: 14px; }
.login-feature-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.12);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #ffffff;
  flex-shrink: 0;
}
.login-feature-text { color: rgba(255,255,255,0.8); font-size: 14px; }
.login-feature-text strong { color: #ffffff; display: block; margin-bottom: 1px; }

.login-right {
  width: 480px;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 60px 56px;
  background: var(--bg-card);
}
.login-right-header { margin-bottom: 36px; }
.login-right-header h1 { font-size: 26px; font-weight: 800; color: var(--text-primary); margin-bottom: 6px; }
.login-right-header p  { font-size: 14px; color: var(--text-muted); }
.login-form .form-control { padding: 12px 16px; font-size: 14.5px; }
.login-form .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(21,128,61,0.1);
}
.login-extras {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 0 20px;
  font-size: 13px;
}
.login-extras .forgot-link { color: var(--primary); font-weight: 500; }
.login-extras .forgot-link:hover { text-decoration: underline; }
.login-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 15px rgba(21,128,61,0.35);
}
.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(21,128,61,0.4);
}
.login-btn:active { transform: translateY(0); }
.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  color: var(--text-muted); font-size: 12px;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border-color);
}
.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ================================================================
   DETAIL PANEL / DRAWER
   ================================================================ */
.detail-panel {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 440px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  z-index: 300;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex; flex-direction: column;
}
.detail-panel.open { transform: translateX(0); }
.detail-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}
.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}
.detail-row {
  display: flex; align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}
.detail-row:last-child { border-bottom: none; }
.detail-key {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 130px;
  flex-shrink: 0;
  padding-top: 1px;
}
.detail-val { font-size: 14px; color: var(--text-primary); font-weight: 500; }

/* ================================================================
   SEARCH IN KB
   ================================================================ */
.kb-search-results { margin-top: 20px; }
.kb-result-item {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.kb-result-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.kb-result-title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.kb-result-excerpt { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.kb-result-meta { margin-top: 8px; display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); }

/* ================================================================
   MOBILE MENU BUTTON & OVERLAY
   ================================================================ */
.mobile-menu-btn {
  display: none;
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-badge);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.mobile-menu-btn:hover { background: var(--border-color); color: var(--text-primary); }

.sidebar-close-btn {
  display: none;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-sidebar-muted);
  align-items: center; justify-content: center;
  font-size: 15px; cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
  margin-left: auto;
}
.sidebar-close-btn:hover { background: rgba(239,68,68,0.2); color: #ef4444; border-color: rgba(239,68,68,0.3); }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  cursor: pointer;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1100px) {
  .grid-2     { grid-template-columns: 1fr; }
  .grid-3     { grid-template-columns: 1fr 1fr; }
  .grid-col-2-1, .grid-col-1-2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  /* Sidebar: hidden off-screen by default, slides in on mobile */
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 6px 0 24px rgba(0,0,0,0.35);
  }

  /* Main content fills the full width */
  .main-content {
    margin-left: 0 !important;
  }

  /* Show hamburger button and sidebar close button */
  .mobile-menu-btn { display: flex; }
  .sidebar-close-btn { display: flex; }

  .page-content { padding: 20px 16px; }

  /* Detail drawer: full width on tablet/mobile */
  .detail-panel { width: 100%; }

  /* Grid adjustments */
  .grid-3 { grid-template-columns: 1fr 1fr; }

  /* Card header wraps on narrow screens */
  .card-header { flex-wrap: wrap; }

  /* Login: hide decorative panel on tablet/mobile */
  .login-left { display: none; }
  .login-right { width: 100%; max-width: 480px; margin: 0 auto; }
  .login-page { justify-content: center; }
}

@media (max-width: 700px) {
  .login-page { flex-direction: column; }
  .login-left { display: none; }
  .login-right { width: 100%; padding: 40px 28px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-select { min-width: 0; width: 100%; }
  .grid-3 { grid-template-columns: 1fr; }

  /* Form rows stack to single column */
  .form-row { grid-template-columns: 1fr; }

  /* Config rows stack */
  .config-row { flex-direction: column; gap: 12px; }
  .config-control { min-width: auto; width: 100%; }

  /* Knowledge base hero compact */
  .kb-hero { padding: 32px 20px; }
  .kb-hero-title { font-size: 22px; }
  .kb-hero-sub { font-size: 13px; margin-bottom: 18px; }

  /* Modal on mobile */
  .modal-body { padding: 16px; }
  .modal-footer { flex-wrap: wrap; padding: 12px 16px; gap: 8px; }
  .modal-footer .btn { flex: 1; justify-content: center; }

  /* Calendar cells smaller */
  .cal-day { min-height: 60px; padding: 4px; }
  .cal-day-head { padding: 8px 4px; font-size: 10px; }
  .cal-event { font-size: 9px; padding: 1px 3px; }
  .cal-day-num { font-size: 11px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; gap: 10px; }
  .page-content { padding: 16px 12px; }

  /* Hide non-essential topbar buttons on very small screens */
  .topbar-btn { display: none; }
  .theme-toggle { display: flex; }

  /* Smaller topbar text */
  .page-title { font-size: 15px; }
  .page-breadcrumb { display: none; }

  /* Stat cards */
  .stat-value { font-size: 22px; }
  .stat-card { padding: 16px 18px; }

  /* Cards */
  .card-body { padding: 16px; }
  .card-header { padding: 14px 16px; }

  /* Modal almost full screen */
  .modal-backdrop { padding: 12px; }
  .modal { border-radius: var(--radius-lg); }
  .modal-header { padding: 16px; }

  /* Form layout */
  .form-row { grid-template-columns: 1fr; }

  /* Login page */
  .login-right { padding: 32px 20px; }
  .login-right-header h1 { font-size: 22px; }
}

/* ================================================================
   UTILITY CLASSES
   ================================================================ */
.flex       { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.mt-1   { margin-top: 4px; }
.mt-2   { margin-top: 8px; }
.mt-3   { margin-top: 12px; }
.mt-4   { margin-top: 16px; }
.mb-4   { margin-bottom: 16px; }
.mb-6   { margin-bottom: 24px; }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.font-bold   { font-weight: 700; }
.font-semibold { font-weight: 600; }
.w-full      { width: 100%; }
.relative    { position: relative; }
.hidden      { display: none !important; }
