@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================================
   DESIGN SYSTEM  –  Operations System
   Premium Professional UI  |  Mobile-First Responsive
   Version: 3.0  |  2026
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS (CSS Custom Properties)
   -------------------------------------------------------------------------- */

:root {
  /* Brand Palette */
  --clr-primary:        #4f46e5;      /* Indigo 600 */
  --clr-primary-dark:   #3730a3;      /* Indigo 700 */
  --clr-primary-light:  #818cf8;      /* Indigo 400 */
  --clr-primary-bg:     #eef2ff;      /* Indigo 50  */
  --clr-accent:         #06b6d4;      /* Cyan 500   */

  /* Semantic Colours */
  --clr-success:        #10b981;
  --clr-success-bg:     #ecfdf5;
  --clr-success-dark:   #047857;
  --clr-danger:         #ef4444;
  --clr-danger-bg:      #fef2f2;
  --clr-danger-dark:    #b91c1c;
  --clr-warning:        #f59e0b;
  --clr-warning-bg:     #fffbeb;
  --clr-warning-dark:   #b45309;
  --clr-info:           #3b82f6;
  --clr-info-bg:        #eff6ff;
  --clr-info-dark:      #1d4ed8;

  /* Neutral Scale */
  --clr-white:          #ffffff;
  --clr-gray-50:        #f8fafc;
  --clr-gray-100:       #f1f5f9;
  --clr-gray-200:       #e2e8f0;
  --clr-gray-300:       #cbd5e1;
  --clr-gray-400:       #94a3b8;
  --clr-gray-500:       #64748b;
  --clr-gray-600:       #475569;
  --clr-gray-700:       #334155;
  --clr-gray-800:       #1e293b;
  --clr-gray-900:       #0f172a;

  /* Sidebar Gradient */
  --sidebar-bg-from:    #1e293b;
  --sidebar-bg-to:      #0f172a;

  /* Gradients */
  --grad-primary:  linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --grad-success:  linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-danger:   linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --grad-warning:  linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-info:     linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --grad-dark:     linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  --grad-accent:   linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);

  /* Typography */
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --text-xs:     0.75rem;    /* 12px */
  --text-sm:     0.875rem;   /* 14px */
  --text-base:   1rem;       /* 16px */
  --text-lg:     1.125rem;   /* 18px */
  --text-xl:     1.25rem;    /* 20px */
  --text-2xl:    1.5rem;     /* 24px */
  --text-3xl:    1.875rem;   /* 30px */
  --text-4xl:    2.25rem;    /* 36px */

  /* Spacing */
  --sp-1:    0.25rem;
  --sp-2:    0.5rem;
  --sp-3:    0.75rem;
  --sp-4:    1rem;
  --sp-5:    1.25rem;
  --sp-6:    1.5rem;
  --sp-8:    2rem;
  --sp-10:   2.5rem;
  --sp-12:   3rem;
  --sp-16:   4rem;

  /* Border Radius */
  --radius-sm:   0.25rem;      /* 4px  */
  --radius:      0.5rem;       /* 8px  */
  --radius-md:   0.75rem;      /* 12px */
  --radius-lg:   1rem;         /* 16px */
  --radius-xl:   1.5rem;       /* 24px */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:   0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:      0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md:   0 8px 12px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-lg:   0 12px 24px -4px rgba(0,0,0,0.10), 0 6px 12px -6px rgba(0,0,0,0.06);
  --shadow-xl:   0 20px 40px -8px rgba(0,0,0,0.12), 0 8px 16px -8px rgba(0,0,0,0.07);
  --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.06);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);

  /* Transitions */
  --t-fast:   0.12s ease-in-out;
  --t-base:   0.22s ease-in-out;
  --t-slow:   0.35s ease-in-out;
  --t-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --sidebar-w:        260px;
  --sidebar-collapsed: 72px;
  --topbar-h:          64px;
  --content-max:       1400px;

  /* Z-index scale */
  --z-sidebar:  1040;
  --z-topbar:   1030;
  --z-modal:    1060;
  --z-toast:    1080;
  --z-tooltip:  1090;
  --z-overlay:  1020;
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--clr-gray-700);
  background: var(--clr-gray-100);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--clr-primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--clr-primary-dark); }

img, video, svg { max-width: 100%; display: block; }

input, button, select, textarea {
  font: inherit;
}

ul, ol { list-style: none; }

/* Focus-visible ring */
:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   3. LAYOUT – SIDEBAR + CONTENT
   -------------------------------------------------------------------------- */

.layout-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.main-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: var(--z-sidebar);
  background: linear-gradient(180deg, var(--sidebar-bg-from) 0%, var(--sidebar-bg-to) 100%);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--t-base), width var(--t-base);
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

.main-sidebar::-webkit-scrollbar { width: 4px; }
.main-sidebar::-webkit-scrollbar-track { background: transparent; }
.main-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: var(--radius-full); }
.main-sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* Content area */
.content-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--t-base);
}

.page-content {
  padding: var(--sp-6);
  flex: 1;
}

/* Sidebar collapsed state */
.sidebar-collapsed .main-sidebar { width: var(--sidebar-collapsed); }
.sidebar-collapsed .content-wrapper { margin-left: var(--sidebar-collapsed); }

/* Mobile */
@media (max-width: 768px) {
  .main-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w);
  }
  .main-sidebar.open { transform: translateX(0); }
  .content-wrapper { margin-left: 0; }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: calc(var(--z-sidebar) - 1);
    backdrop-filter: blur(2px);
  }
  .sidebar-overlay.active { display: block; }
}

/* --------------------------------------------------------------------------
   4. TOPBAR / HEADER
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  height: var(--topbar-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--clr-gray-200);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--sp-6);
  box-shadow: var(--shadow-xs);
}

.topbar-left  { display: flex; align-items: center; gap: var(--sp-3); flex: 1; }
.topbar-right { display: flex; align-items: center; gap: var(--sp-2); }

/* Hamburger */
.sidebar-toggle {
  width: 40px; height: 40px;
  border: none;
  background: transparent;
  border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  cursor: pointer;
  color: var(--clr-gray-600);
  transition: background var(--t-fast);
  padding: 0;
}
.sidebar-toggle:hover { background: var(--clr-gray-100); color: var(--clr-primary); }
.sidebar-toggle span {
  display: block; width: 20px; height: 2px;
  background: currentColor;
  border-radius: var(--radius-full);
  transition: transform var(--t-base), opacity var(--t-fast);
}

/* Search bar */
.topbar-search {
  position: relative;
  flex: 1;
  max-width: 420px;
}
.topbar-search input {
  width: 100%;
  height: 38px;
  padding: 0 var(--sp-4) 0 2.5rem;
  border: 1.5px solid var(--clr-gray-200);
  border-radius: var(--radius-full);
  background: var(--clr-gray-50);
  font-size: var(--text-sm);
  color: var(--clr-gray-700);
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.topbar-search input:focus {
  outline: none;
  border-color: var(--clr-primary);
  background: var(--clr-white);
  box-shadow: 0 0 0 3px var(--clr-primary-bg);
}
.topbar-search .search-icon {
  position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%);
  color: var(--clr-gray-400); pointer-events: none; font-size: 14px;
}

/* Icon buttons (notification, profile, etc.) */
.topbar-btn {
  position: relative;
  width: 40px; height: 40px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--clr-gray-600);
  cursor: pointer;
  font-size: 16px;
  transition: background var(--t-fast), color var(--t-fast);
  text-decoration: none;
}
.topbar-btn:hover { background: var(--clr-gray-100); color: var(--clr-primary); }

.topbar-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  background: var(--clr-danger);
  color: white;
  border-radius: var(--radius-full);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
}

/* User avatar in topbar */
.topbar-user {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--t-fast);
  border: none; background: transparent;
  color: var(--clr-gray-700);
}
.topbar-user:hover { background: var(--clr-gray-100); }
.topbar-user .avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: var(--text-sm);
  overflow: hidden; flex-shrink: 0;
}
.topbar-user .avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-user .user-info { text-align: left; }
.topbar-user .user-name  { font-weight: 600; font-size: var(--text-sm); line-height: 1.2; }
.topbar-user .user-role  { font-size: var(--text-xs); color: var(--clr-gray-400); }

/* --------------------------------------------------------------------------
   5. SIDEBAR INTERNALS
   -------------------------------------------------------------------------- */

/* Brand */
.brand-link {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-5);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-logo {
  width: 38px; height: 38px; border-radius: var(--radius);
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px; font-weight: 800;
  flex-shrink: 0; overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.brand-text {
  font-size: var(--text-base);
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t-base);
}

/* User panel */
.sidebar-user {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.sidebar-user-avatar {
  width: 40px; height: 40px; border-radius: var(--radius-full);
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px; font-weight: 700;
  flex-shrink: 0; overflow: hidden;
}
.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name {
  display: block; color: white; font-weight: 600;
  font-size: var(--text-sm); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
  transition: color var(--t-fast);
}
.sidebar-user-name:hover { color: var(--clr-primary-light); }
.sidebar-user-role {
  display: block; color: rgba(255,255,255,0.5);
  font-size: var(--text-xs); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.role-badge {
  display: inline-block; padding: 1px 6px;
  border-radius: var(--radius-full); font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.role-badge.badge-approval { background: rgba(245,158,11,0.2); color: #fcd34d; }
.role-badge.badge-admin    { background: rgba(99,102,241,0.2); color: #a5b4fc; }

/* Nav sections */
.sidebar-nav { padding: var(--sp-2) 0; flex: 1; }
.nav-section-label {
  padding: var(--sp-3) var(--sp-5) var(--sp-2);
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(255,255,255,0.3);
}
.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px var(--sp-5);
  color: rgba(255,255,255,0.65);
  font-size: var(--text-sm); font-weight: 500;
  text-decoration: none;
  border-radius: 0;
  transition: background var(--t-fast), color var(--t-fast), padding-left var(--t-fast);
  position: relative;
  border: none; background: transparent; width: 100%; cursor: pointer;
}
.nav-link:hover {
  background: rgba(255,255,255,0.07);
  color: white;
  padding-left: calc(var(--sp-5) + 4px);
}
.nav-link.active {
  background: rgba(99,102,241,0.2);
  color: white;
}
.nav-link.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--clr-primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.nav-link .nav-icon {
  width: 18px; text-align: center;
  font-size: 15px; flex-shrink: 0;
  color: rgba(255,255,255,0.45);
  transition: color var(--t-fast);
}
.nav-link:hover .nav-icon, .nav-link.active .nav-icon { color: white; }
.nav-link .nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link .nav-badge-pill {
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--clr-danger); color: white;
}

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: var(--sp-3) var(--sp-4);
  flex-shrink: 0;
}
.sidebar-footer .nav-link {
  border-radius: var(--radius);
  padding: 8px var(--sp-3);
}

/* --------------------------------------------------------------------------
   6. PAGE HEADER
   -------------------------------------------------------------------------- */

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-4); margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}
.page-header-title h1 {
  font-size: var(--text-2xl); font-weight: 700;
  color: var(--clr-gray-800); letter-spacing: -0.02em;
  line-height: 1.2;
}
.page-header-title p {
  color: var(--clr-gray-500); margin-top: 4px;
  font-size: var(--text-sm);
}
.page-header-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); color: var(--clr-gray-400);
  margin-bottom: var(--sp-2);
}
.breadcrumb a { color: var(--clr-gray-500); transition: color var(--t-fast); }
.breadcrumb a:hover { color: var(--clr-primary); }
.breadcrumb-sep { color: var(--clr-gray-300); font-size: 10px; }

/* --------------------------------------------------------------------------
   7. CARDS
   -------------------------------------------------------------------------- */

.card {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--clr-gray-200);
  overflow: hidden;
  transition: box-shadow var(--t-base);
}
.card:hover { box-shadow: var(--shadow-lg); }

.card-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--clr-gray-100);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.card-header-title { font-size: var(--text-base); font-weight: 700; color: var(--clr-gray-800); }
.card-header-subtitle { font-size: var(--text-xs); color: var(--clr-gray-500); margin-top: 2px; }

.card-body { padding: var(--sp-6); }
.card-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--clr-gray-100);
  background: var(--clr-gray-50);
  display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-3);
}

/* Flat card (no shadow) */
.card-flat  { box-shadow: none; }
.card-flush .card-body { padding: 0; }

/* --------------------------------------------------------------------------
   8. STATS / METRIC CARDS
   -------------------------------------------------------------------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
}

.stat-card {
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--clr-gray-100);
  position: relative;
  overflow: hidden;
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.stat-card-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: var(--sp-4);
}
.stat-card-value {
  font-size: var(--text-3xl); font-weight: 800;
  color: var(--clr-gray-800); letter-spacing: -0.03em; line-height: 1;
  margin-bottom: var(--sp-1);
}
.stat-card-label {
  font-size: var(--text-sm); color: var(--clr-gray-500); font-weight: 500;
}
.stat-card-trend {
  display: flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); font-weight: 600;
  margin-top: var(--sp-3);
}
.stat-card-trend.up   { color: var(--clr-success); }
.stat-card-trend.down { color: var(--clr-danger); }

/* Variant: gradient icon backgrounds */
.stat-icon-primary { background: var(--clr-primary-bg); color: var(--clr-primary); }
.stat-icon-success { background: var(--clr-success-bg); color: var(--clr-success-dark); }
.stat-icon-danger  { background: var(--clr-danger-bg);  color: var(--clr-danger-dark); }
.stat-icon-warning { background: var(--clr-warning-bg); color: var(--clr-warning-dark); }
.stat-icon-info    { background: var(--clr-info-bg);    color: var(--clr-info-dark); }
.stat-icon-accent  { background: rgba(6,182,212,0.1);   color: var(--clr-accent); }

/* Decorative blob */
.stat-card::after {
  content: '';
  position: absolute; right: -20px; bottom: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
}

/* --------------------------------------------------------------------------
   9. BUTTONS
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-weight: 600; font-size: var(--text-sm); line-height: 1;
  padding: 10px var(--sp-5);
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  position: relative;
  overflow: hidden;
  vertical-align: middle;
}
.btn:disabled, .btn.disabled {
  opacity: 0.55; cursor: not-allowed; pointer-events: none;
}

/* Loading state */
.btn.loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin 0.6s linear infinite;
  margin-left: var(--sp-2);
}

/* Sizes */
.btn-sm  { padding: 6px var(--sp-4); font-size: var(--text-xs); }
.btn-lg  { padding: 13px var(--sp-8); font-size: var(--text-base); }
.btn-xl  { padding: 16px var(--sp-10); font-size: var(--text-lg); border-radius: var(--radius-md); }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn-icon.btn-sm { padding: 6px; width: 30px; height: 30px; }

/* Solid variants */
.btn-primary   { background: var(--clr-primary); color: white; border-color: var(--clr-primary); }
.btn-primary:hover   { background: var(--clr-primary-dark); border-color: var(--clr-primary-dark); color: white; box-shadow: 0 4px 12px rgba(79,70,229,0.35); }

.btn-success   { background: var(--clr-success); color: white; border-color: var(--clr-success); }
.btn-success:hover   { background: var(--clr-success-dark); border-color: var(--clr-success-dark); color: white; box-shadow: 0 4px 12px rgba(16,185,129,0.35); }

.btn-danger    { background: var(--clr-danger);  color: white; border-color: var(--clr-danger); }
.btn-danger:hover    { background: var(--clr-danger-dark); border-color: var(--clr-danger-dark); color: white; box-shadow: 0 4px 12px rgba(239,68,68,0.35); }

.btn-warning   { background: var(--clr-warning); color: white; border-color: var(--clr-warning); }
.btn-warning:hover   { background: var(--clr-warning-dark); border-color: var(--clr-warning-dark); color: white; }

.btn-info      { background: var(--clr-info);    color: white; border-color: var(--clr-info); }
.btn-info:hover      { background: var(--clr-info-dark); border-color: var(--clr-info-dark); color: white; }

.btn-dark      { background: var(--clr-gray-800); color: white; border-color: var(--clr-gray-800); }
.btn-dark:hover      { background: var(--clr-gray-900); color: white; }

.btn-secondary { background: var(--clr-gray-200); color: var(--clr-gray-700); border-color: var(--clr-gray-200); }
.btn-secondary:hover { background: var(--clr-gray-300); color: var(--clr-gray-800); }

/* Outline variants */
.btn-outline-primary { color: var(--clr-primary); border-color: var(--clr-primary); background: transparent; }
.btn-outline-primary:hover { background: var(--clr-primary); color: white; }

.btn-outline-success { color: var(--clr-success); border-color: var(--clr-success); background: transparent; }
.btn-outline-success:hover { background: var(--clr-success); color: white; }

.btn-outline-danger  { color: var(--clr-danger);  border-color: var(--clr-danger);  background: transparent; }
.btn-outline-danger:hover  { background: var(--clr-danger);  color: white; }

/* Ghost (no border) */
.btn-ghost { background: transparent; border-color: transparent; color: var(--clr-gray-600); }
.btn-ghost:hover { background: var(--clr-gray-100); color: var(--clr-gray-800); }

/* Gradient */
.btn-gradient { background: var(--grad-primary); color: white; border-color: transparent; }
.btn-gradient:hover { opacity: 0.9; box-shadow: 0 6px 16px rgba(79,70,229,0.4); color: white; }

/* --------------------------------------------------------------------------
   10. FORMS
   -------------------------------------------------------------------------- */

.form-group  { margin-bottom: var(--sp-5); }
.form-label  {
  display: block; margin-bottom: var(--sp-2);
  font-size: var(--text-sm); font-weight: 600;
  color: var(--clr-gray-700);
}
.form-label .required { color: var(--clr-danger); margin-left: 2px; }

.form-control {
  display: block; width: 100%;
  padding: 10px 14px;
  font-size: var(--text-sm);
  color: var(--clr-gray-800);
  background: var(--clr-white);
  border: 1.5px solid var(--clr-gray-300);
  border-radius: var(--radius);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  line-height: 1.5;
}
.form-control::placeholder { color: var(--clr-gray-400); }
.form-control:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-bg);
  background: var(--clr-white);
}
.form-control:disabled, .form-control[readonly] {
  background: var(--clr-gray-50);
  color: var(--clr-gray-500);
  cursor: not-allowed;
}

/* Sizes */
.form-control-sm { padding: 6px 10px; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.form-control-lg { padding: 12px 16px; font-size: var(--text-base); border-radius: var(--radius-md); }

/* States */
.form-control.is-valid   { border-color: var(--clr-success); }
.form-control.is-valid:focus   { box-shadow: 0 0 0 3px var(--clr-success-bg); }
.form-control.is-invalid { border-color: var(--clr-danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--clr-danger-bg); }

.form-text    { margin-top: var(--sp-1); font-size: var(--text-xs); color: var(--clr-gray-400); }
.invalid-feedback { font-size: var(--text-xs); color: var(--clr-danger); margin-top: var(--sp-1); display: none; }
.is-invalid ~ .invalid-feedback { display: block; }
.valid-feedback   { font-size: var(--text-xs); color: var(--clr-success); margin-top: var(--sp-1); display: none; }
.is-valid ~ .valid-feedback { display: block; }

/* Select */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 42px;
}

/* Textarea */
textarea.form-control { resize: vertical; min-height: 100px; }

/* Input group */
.input-group {
  display: flex; align-items: stretch;
  border: 1.5px solid var(--clr-gray-300);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input-group:focus-within {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-bg);
}
.input-group .form-control { border: none; box-shadow: none; border-radius: 0; }
.input-group .form-control:focus { box-shadow: none; border-color: transparent; }
.input-group-text {
  display: flex; align-items: center; padding: 0 14px;
  background: var(--clr-gray-50);
  color: var(--clr-gray-500); font-size: var(--text-sm);
  border-right: 1.5px solid var(--clr-gray-200);
}
.input-group-append .input-group-text { border-right: none; border-left: 1.5px solid var(--clr-gray-200); }

/* Checkbox / Radio */
.form-check { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; }
.form-check-input {
  width: 17px; height: 17px; margin: 0;
  accent-color: var(--clr-primary);
  cursor: pointer;
}

/* Toggle switch */
.form-switch { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; }
.form-switch input[type="checkbox"] { display: none; }
.switch-track {
  width: 44px; height: 24px;
  background: var(--clr-gray-300);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--t-base);
}
.switch-track::before {
  content: '';
  width: 18px; height: 18px;
  background: white; border-radius: 50%;
  position: absolute; top: 3px; left: 3px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base);
}
.form-switch input:checked + .switch-track { background: var(--clr-primary); }
.form-switch input:checked + .switch-track::before { transform: translateX(20px); }

/* --------------------------------------------------------------------------
   11. TABLES
   -------------------------------------------------------------------------- */

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-gray-200);
}

.table {
  width: 100%; border-collapse: collapse;
  font-size: var(--text-sm);
  white-space: nowrap;
}
.table thead th {
  padding: 13px 16px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--clr-gray-500);
  background: var(--clr-gray-50);
  border-bottom: 2px solid var(--clr-gray-200);
  white-space: nowrap;
  text-align: left;
}
.table thead th.sortable { cursor: pointer; user-select: none; }
.table thead th.sortable:hover { color: var(--clr-primary); }

.table tbody tr {
  border-bottom: 1px solid var(--clr-gray-100);
  transition: background var(--t-fast);
}
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--clr-gray-50); }

.table td {
  padding: 14px 16px;
  color: var(--clr-gray-700);
  vertical-align: middle;
}

.table-striped tbody tr:nth-child(odd) { background: var(--clr-gray-50); }

/* Empty state */
.table-empty {
  text-align: center; padding: var(--sp-16);
  color: var(--clr-gray-400);
}
.table-empty i { font-size: 48px; margin-bottom: var(--sp-4); opacity: 0.3; display: block; }

/* --------------------------------------------------------------------------
   12. BADGES
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  vertical-align: middle;
  white-space: nowrap;
}
.badge-dot::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.badge-lg  { padding: 5px 14px; font-size: var(--text-xs); }

/* Colour variants */
.badge-primary { background: var(--clr-primary-bg);  color: var(--clr-primary-dark); }
.badge-success { background: var(--clr-success-bg);  color: var(--clr-success-dark); }
.badge-danger  { background: var(--clr-danger-bg);   color: var(--clr-danger-dark); }
.badge-warning { background: var(--clr-warning-bg);  color: var(--clr-warning-dark); }
.badge-info    { background: var(--clr-info-bg);     color: var(--clr-info-dark); }
.badge-gray    { background: var(--clr-gray-100);    color: var(--clr-gray-600); }
.badge-dark    { background: var(--clr-gray-800);    color: white; }

/* Status dots */
.status-dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 600;
}
.status-dot::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.status-dot.active::before    { background: var(--clr-success); box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.status-dot.inactive::before  { background: var(--clr-gray-400); }
.status-dot.pending::before   { background: var(--clr-warning); box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.status-dot.danger::before    { background: var(--clr-danger);  box-shadow: 0 0 0 3px rgba(239,68,68,0.2); }

/* --------------------------------------------------------------------------
   13. ALERTS
   -------------------------------------------------------------------------- */

.alert {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  margin-bottom: var(--sp-5);
  position: relative;
}
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-content { flex: 1; }
.alert-title { font-weight: 700; margin-bottom: 2px; }
.alert-dismiss {
  position: absolute; top: var(--sp-3); right: var(--sp-3);
  background: none; border: none; cursor: pointer;
  color: inherit; opacity: 0.5; font-size: 16px; padding: 0;
  line-height: 1;
}
.alert-dismiss:hover { opacity: 1; }

.alert-success { background: var(--clr-success-bg); border-color: rgba(16,185,129,0.3); color: var(--clr-success-dark); }
.alert-danger  { background: var(--clr-danger-bg);  border-color: rgba(239,68,68,0.3);  color: var(--clr-danger-dark); }
.alert-warning { background: var(--clr-warning-bg); border-color: rgba(245,158,11,0.3); color: var(--clr-warning-dark); }
.alert-info    { background: var(--clr-info-bg);    border-color: rgba(59,130,246,0.3); color: var(--clr-info-dark); }
.alert-primary { background: var(--clr-primary-bg); border-color: rgba(79,70,229,0.3);  color: var(--clr-primary-dark); }

/* --------------------------------------------------------------------------
   14. TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */

.toast-stack {
  position: fixed; top: var(--sp-5); right: var(--sp-5);
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: var(--sp-2);
  pointer-events: none;
  max-width: 380px; width: 100%;
}

.toast-item {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--clr-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid transparent;
  pointer-events: all;
  animation: toast-in 0.3s var(--t-bounce) both;
  position: relative;
  word-break: break-word;
}
.toast-item.toast-out { animation: toast-out 0.25s ease-in both; }

.toast-item.toast-success { border-left-color: var(--clr-success); }
.toast-item.toast-error   { border-left-color: var(--clr-danger); }
.toast-item.toast-warning { border-left-color: var(--clr-warning); }
.toast-item.toast-info    { border-left-color: var(--clr-info); }

.toast-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.toast-success .toast-icon { color: var(--clr-success); }
.toast-error   .toast-icon { color: var(--clr-danger); }
.toast-warning .toast-icon { color: var(--clr-warning); }
.toast-info    .toast-icon { color: var(--clr-info); }

.toast-body { flex: 1; }
.toast-title   { font-size: var(--text-sm); font-weight: 700; color: var(--clr-gray-800); line-height: 1.3; }
.toast-message { font-size: var(--text-xs); color: var(--clr-gray-500); margin-top: 2px; }

.toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--clr-gray-400); font-size: 16px; padding: 0;
  line-height: 1; flex-shrink: 0; margin-top: 1px;
  transition: color var(--t-fast);
}
.toast-close:hover { color: var(--clr-gray-700); }

.toast-progress {
  position: absolute; bottom: 0; left: 4px; right: 0; height: 3px;
  background: var(--clr-gray-100);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}
.toast-progress-bar {
  height: 100%;
  animation: toast-progress linear forwards;
}
.toast-success .toast-progress-bar { background: var(--clr-success); }
.toast-error   .toast-progress-bar { background: var(--clr-danger); }
.toast-warning .toast-progress-bar { background: var(--clr-warning); }
.toast-info    .toast-progress-bar { background: var(--clr-info); }

@keyframes toast-in  { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; transform: none; }             to { opacity: 0; transform: translateX(40px); } }
@keyframes toast-progress { from { width: 100%; } to { width: 0; } }

/* --------------------------------------------------------------------------
   15. MODALS
   -------------------------------------------------------------------------- */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-4);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-dialog {
  background: var(--clr-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 2rem);
  display: flex; flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--t-bounce);
}
.modal-overlay.active .modal-dialog { transform: none; }

.modal-dialog.modal-sm  { max-width: 380px; }
.modal-dialog.modal-lg  { max-width: 800px; }
.modal-dialog.modal-xl  { max-width: 1100px; }
.modal-dialog.modal-fullscreen { max-width: 100%; border-radius: 0; height: 100%; max-height: 100%; }

.modal-header {
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--clr-gray-100);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  flex-shrink: 0;
}
.modal-title { font-size: var(--text-lg); font-weight: 700; color: var(--clr-gray-800); }
.modal-close-btn {
  width: 32px; height: 32px;
  border: none; background: var(--clr-gray-100); color: var(--clr-gray-500);
  border-radius: var(--radius); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), color var(--t-fast);
}
.modal-close-btn:hover { background: var(--clr-gray-200); color: var(--clr-gray-800); }

.modal-body {
  flex: 1; overflow-y: auto; padding: var(--sp-6);
}
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--clr-gray-200); border-radius: var(--radius-full); }

.modal-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--clr-gray-100);
  display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-3);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   16. SKELETON LOADERS
   -------------------------------------------------------------------------- */

@keyframes shimmer {
  0%   { background-position: -800px 0; }
  100% { background-position:  800px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--clr-gray-200) 25%, var(--clr-gray-100) 50%, var(--clr-gray-200) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--radius);
}
.skeleton-text   { height: 14px; }
.skeleton-text-sm { height: 10px; }
.skeleton-text-lg { height: 20px; }
.skeleton-title  { height: 24px; }
.skeleton-circle { border-radius: 50%; }
.skeleton-block  { border-radius: var(--radius-lg); }
.skeleton-btn    { height: 38px; }

/* --------------------------------------------------------------------------
   17. DROPDOWNS
   -------------------------------------------------------------------------- */

.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 200px;
  background: var(--clr-white);
  border: 1px solid var(--clr-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--sp-1) 0;
  z-index: var(--z-tooltip);
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
}
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: none; }
.dropdown-menu-left { right: auto; left: 0; }

.dropdown-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 9px var(--sp-4);
  font-size: var(--text-sm); color: var(--clr-gray-700);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  border: none; background: transparent; width: 100%;
  text-decoration: none;
}
.dropdown-item:hover { background: var(--clr-gray-50); color: var(--clr-primary); }
.dropdown-item.danger { color: var(--clr-danger); }
.dropdown-item.danger:hover { background: var(--clr-danger-bg); }

.dropdown-divider { height: 1px; background: var(--clr-gray-100); margin: var(--sp-1) 0; }
.dropdown-header {
  padding: 6px var(--sp-4);
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--clr-gray-400);
}

/* --------------------------------------------------------------------------
   18. PAGINATION
   -------------------------------------------------------------------------- */

.pagination {
  display: flex; align-items: center; gap: var(--sp-1);
  flex-wrap: wrap;
}
.pagination-btn {
  min-width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 var(--sp-2);
  border-radius: var(--radius);
  font-size: var(--text-sm); font-weight: 500;
  border: 1.5px solid var(--clr-gray-200);
  background: var(--clr-white); color: var(--clr-gray-600);
  cursor: pointer; text-decoration: none;
  transition: all var(--t-fast);
}
.pagination-btn:hover { border-color: var(--clr-primary); color: var(--clr-primary); }
.pagination-btn.active { background: var(--clr-primary); border-color: var(--clr-primary); color: white; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.pagination-info { font-size: var(--text-xs); color: var(--clr-gray-400); }

/* --------------------------------------------------------------------------
   19. TABS
   -------------------------------------------------------------------------- */

.tabs { display: flex; flex-direction: column; }
.tab-list {
  display: flex; gap: 0; border-bottom: 2px solid var(--clr-gray-200);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-list::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 12px var(--sp-5);
  font-size: var(--text-sm); font-weight: 600;
  color: var(--clr-gray-500); border: none; background: transparent;
  cursor: pointer; white-space: nowrap;
  position: relative; transition: color var(--t-fast);
  text-decoration: none; display: flex; align-items: center; gap: var(--sp-2);
}
.tab-btn::after {
  content: '';
  position: absolute; bottom: -2px; left: 0; right: 0; height: 2px;
  background: var(--clr-primary); border-radius: var(--radius-full);
  transform: scaleX(0); transition: transform var(--t-base);
}
.tab-btn:hover { color: var(--clr-gray-700); }
.tab-btn.active { color: var(--clr-primary); }
.tab-btn.active::after { transform: scaleX(1); }
.tab-pane { display: none; padding-top: var(--sp-5); }
.tab-pane.active { display: block; }

/* --------------------------------------------------------------------------
   20. EMPTY STATES
   -------------------------------------------------------------------------- */

.empty-state {
  text-align: center; padding: var(--sp-16) var(--sp-8);
  color: var(--clr-gray-400);
}
.empty-state-icon {
  width: 80px; height: 80px;
  background: var(--clr-gray-100); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--sp-5);
  font-size: 32px; color: var(--clr-gray-300);
}
.empty-state-title { font-size: var(--text-xl); font-weight: 700; color: var(--clr-gray-700); margin-bottom: var(--sp-2); }
.empty-state-text  { font-size: var(--text-sm); color: var(--clr-gray-400); max-width: 360px; margin: 0 auto var(--sp-6); }

/* --------------------------------------------------------------------------
   21. LOADING STATES
   -------------------------------------------------------------------------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-fade { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.spinner {
  display: inline-block;
  width: 1.2em; height: 1.2em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
}
.spinner-lg { width: 2em; height: 2em; border-width: 3px; }
.spinner-xl { width: 3em; height: 3em; border-width: 3px; }

.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10; border-radius: inherit;
}
.loading-dots {
  display: inline-flex; gap: 4px;
}
.loading-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--clr-primary);
  animation: pulse-fade 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* --------------------------------------------------------------------------
   22. UTILITY CLASSES
   -------------------------------------------------------------------------- */

/* Text */
.text-primary { color: var(--clr-primary) !important; }
.text-success { color: var(--clr-success) !important; }
.text-danger  { color: var(--clr-danger)  !important; }
.text-warning { color: var(--clr-warning) !important; }
.text-info    { color: var(--clr-info)    !important; }
.text-muted   { color: var(--clr-gray-400) !important; }
.text-dark    { color: var(--clr-gray-800) !important; }
.text-white   { color: white !important; }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.text-xs   { font-size: var(--text-xs)  !important; }
.text-sm   { font-size: var(--text-sm)  !important; }
.text-base { font-size: var(--text-base)!important; }
.text-lg   { font-size: var(--text-lg)  !important; }
.text-xl   { font-size: var(--text-xl)  !important; }
.text-2xl  { font-size: var(--text-2xl) !important; }

.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Spacing shorthands */
.mt-auto { margin-top: auto !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-6 { margin-top: 1.5rem !important; }

/* Display */
.d-flex   { display: flex !important; }
.d-grid   { display: grid !important; }
.d-none   { display: none !important; }
.d-block  { display: block !important; }

.items-center  { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-end   { justify-content: flex-end !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-1 { flex: 1 !important; }

/* Background */
.bg-primary { background: var(--clr-primary) !important; color: white; }
.bg-success { background: var(--clr-success) !important; color: white; }
.bg-danger  { background: var(--clr-danger)  !important; color: white; }
.bg-warning { background: var(--clr-warning) !important; color: white; }
.bg-gray-50 { background: var(--clr-gray-50) !important; }
.bg-white   { background: white !important; }

/* Border */
.rounded    { border-radius: var(--radius) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }
.border     { border: 1px solid var(--clr-gray-200) !important; }

/* Width helpers */
.w-full  { width: 100% !important; }
.w-auto  { width: auto !important; }

/* Overflow */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto   { overflow: auto !important; }

/* Position */
.relative { position: relative !important; }

/* --------------------------------------------------------------------------
   23. RESPONSIVE GRID
   -------------------------------------------------------------------------- */

.grid { display: grid; gap: var(--sp-5); }
.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-auto-sm { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

@media (max-width: 1200px) {
  .grid-6 { grid-template-columns: repeat(4, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: var(--sp-4); }
  .topbar { padding: 0 var(--sp-4); }
  .topbar-search { display: none; }
  .page-header { margin-bottom: var(--sp-4); }
  .page-header-title h1 { font-size: var(--text-xl); }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .card-header, .card-body { padding: var(--sp-4); }
  .btn-xs-block { width: 100%; }
}

/* --------------------------------------------------------------------------
   24. PRINT
   -------------------------------------------------------------------------- */

@media print {
  .main-sidebar, .topbar, .sidebar-overlay { display: none !important; }
  .content-wrapper { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  .btn { display: none !important; }
}

/* --------------------------------------------------------------------------
   25. SCROLLBAR GLOBAL
   -------------------------------------------------------------------------- */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--clr-gray-100); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--clr-gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--clr-gray-400); }

/* --------------------------------------------------------------------------
   26. SELECTION
   -------------------------------------------------------------------------- */

::-moz-selection { background: var(--clr-primary-bg); color: var(--clr-primary-dark); }
::selection { background: var(--clr-primary-bg); color: var(--clr-primary-dark); }

/* --------------------------------------------------------------------------
   27. ANIMATIONS
   -------------------------------------------------------------------------- */

@keyframes fadeIn       { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp    { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeInDown  { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes slideInLeft  { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes scaleIn     { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.animate-fade-in    { animation: fadeIn 0.3s ease-out both; }
.animate-fade-in-up { animation: fadeInUp 0.35s ease-out both; }
.animate-scale-in   { animation: scaleIn 0.25s ease-out both; }

.animate-delay-1 { animation-delay: 0.05s; }
.animate-delay-2 { animation-delay: 0.10s; }
.animate-delay-3 { animation-delay: 0.15s; }
.animate-delay-4 { animation-delay: 0.20s; }
.animate-delay-5 { animation-delay: 0.25s; }

/* --------------------------------------------------------------------------
   28. INTER FONT IMPORT  (moved to top of file — see line 1)
   -------------------------------------------------------------------------- */
