/* ================================================================
   MenuLand — Design System  ·  app.css
   Fonts: Plus Jakarta Sans (display) + Inter (body)
   No Bootstrap · No Tailwind · Pure CSS from scratch
   ================================================================ */

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

/* ════════════════════════════════════════════════════════════════
   DESIGN TOKENS  v3.0
   ════════════════════════════════════════════════════════════════ */
:root {
  /* Brand */
  --gold:           #C9A84C;
  --gold-light:     #E3C97A;
  --gold-dim:       rgba(201,168,76,.15);

  /* Primary — Vivid Indigo */
  --primary:        #6366F1;
  --primary-dark:   #4F46E5;
  --primary-dim:    rgba(99,102,241,.10);
  --primary-ring:   rgba(99,102,241,.28);

  /* Semantic */
  --success:        #10B981;
  --success-dark:   #059669;
  --success-dim:    rgba(16,185,129,.10);

  --warning:        #F59E0B;
  --warning-dark:   #D97706;
  --warning-dim:    rgba(245,158,11,.12);

  --danger:         #EF4444;
  --danger-dark:    #DC2626;
  --danger-dim:     rgba(239,68,68,.10);

  --info:           #3B82F6;
  --info-dark:      #2563EB;
  --info-dim:       rgba(59,130,246,.10);

  /* Surfaces — Light */
  --bg:             #EEF2F7;
  --surface:        #FFFFFF;
  --surface-2:      #F8FAFB;
  --surface-raised: #FFFFFF;

  /* Sidebar — ALWAYS dark navy, both light and dark themes */
  --sidebar-bg:        #0F172A;
  --sidebar-border:    rgba(255,255,255,.07);
  --sidebar-hover:     rgba(255,255,255,.06);
  --sidebar-active:    rgba(99,102,241,.20);
  --sidebar-brand-c:   #FFFFFF;
  --sidebar-bar:       rgba(255,255,255,.12);
  --sidebar-icon-act:  #A5B4FC;
  --t-sidebar:         rgba(203,213,225,.72);
  --t-sidebar-sec:     rgba(148,163,184,.45);
  --t-sidebar-act:     #FFFFFF;

  /* Topbar */
  --topbar-bg:      #FFFFFF;
  --topbar-border:  #E8ECF4;

  /* Text */
  --t1:             #0F172A;
  --t2:             #3D4B5C;
  --t3:             #6B7A8F;
  --t4:             #A4B0BF;
  --t-inv:          #FFFFFF;

  /* Borders */
  --border:         #E2E8F0;
  --border-strong:  #BEC8D6;
  --border-focus:   var(--primary);

  /* Dimensions */
  --sidebar-w:      256px;
  --sidebar-cw:     66px;
  --topbar-h:       64px;

  /* Typography */
  --ff-display:     'Plus Jakarta Sans', sans-serif;
  --ff-body:        'Inter', sans-serif;

  /* Radius */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(15,23,42,.05);
  --shadow-sm:  0 1px 4px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md:  0 4px 16px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.04);
  --shadow-lg:  0 10px 32px rgba(15,23,42,.11), 0 4px 12px rgba(15,23,42,.06);
  --shadow-xl:  0 20px 56px rgba(15,23,42,.16), 0 8px 20px rgba(15,23,42,.07);
  --shadow-focus: 0 0 0 3px var(--primary-ring);

  /* Stat icon gradients */
  --grad-primary: linear-gradient(135deg, #6366F1 0%, #818CF8 100%);
  --grad-success: linear-gradient(135deg, #10B981 0%, #34D399 100%);
  --grad-warning: linear-gradient(135deg, #F59E0B 0%, #FCD34D 100%);
  --grad-danger:  linear-gradient(135deg, #EF4444 0%, #F87171 100%);
  --grad-info:    linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
  --grad-gold:    linear-gradient(135deg, #C9A84C 0%, #E3C97A 100%);

  /* Transition */
  --ease:    cubic-bezier(.4,0,.2,1);
  --t-fast:  120ms;
  --t-std:   220ms;
  --t-slow:  360ms;

  /* Z-index scale */
  --z-sidebar:  90;
  --z-topbar:   100;
  --z-dropdown: 200;
  --z-modal:    300;
  --z-toast:    400;
}

/* ── Dark mode variable block (reused below) ──────────────────── */
/* Applied when: (a) system preference + no explicit override, OR (b) user explicitly chose dark */

/* (a) System preference fallback */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg:             #080C14;
    --surface:        #0F1520;
    --surface-2:      #141B28;
    --surface-raised: #1A2235;

    --topbar-bg:      #0F1520;
    --topbar-border:  #1C2436;

    --t1:             #E8EDF8;
    --t2:             #8899B0;
    --t3:             #556070;
    --t4:             #303C4A;

    --border:         #1C2436;
    --border-strong:  #263044;

    --primary-dim:    rgba(99,102,241,.18);
    --success-dim:    rgba(16,185,129,.15);
    --warning-dim:    rgba(245,158,11,.15);
    --danger-dim:     rgba(239,68,68,.15);
    --info-dim:       rgba(59,130,246,.15);

    --shadow-sm:  0 1px 4px rgba(0,0,0,.50);
    --shadow-md:  0 4px 16px rgba(0,0,0,.60);
    --shadow-lg:  0 10px 32px rgba(0,0,0,.70);
    --shadow-xl:  0 20px 56px rgba(0,0,0,.80);

    /* Sidebar — slightly deeper in dark mode */
    --sidebar-bg:        #060911;
    --sidebar-border:    rgba(255,255,255,.06);
    --sidebar-hover:     rgba(255,255,255,.05);
    --sidebar-active:    rgba(99,102,241,.22);
    --sidebar-bar:       rgba(255,255,255,.10);
  }
}

/* (b) Explicit dark mode */
html[data-theme="dark"] {
  --bg:             #080C14;
  --surface:        #0F1520;
  --surface-2:      #141B28;
  --surface-raised: #1A2235;

  --topbar-bg:      #0F1520;
  --topbar-border:  #1C2436;

  --t1:             #E8EDF8;
  --t2:             #8899B0;
  --t3:             #556070;
  --t4:             #303C4A;

  --border:         #1C2436;
  --border-strong:  #263044;

  --primary-dim:    rgba(99,102,241,.18);
  --success-dim:    rgba(16,185,129,.15);
  --warning-dim:    rgba(245,158,11,.15);
  --danger-dim:     rgba(239,68,68,.15);
  --info-dim:       rgba(59,130,246,.15);

  --shadow-sm:  0 1px 4px rgba(0,0,0,.50);
  --shadow-md:  0 4px 16px rgba(0,0,0,.60);
  --shadow-lg:  0 10px 32px rgba(0,0,0,.70);
  --shadow-xl:  0 20px 56px rgba(0,0,0,.80);

  /* Sidebar — slightly deeper in dark mode */
  --sidebar-bg:        #060911;
  --sidebar-border:    rgba(255,255,255,.06);
  --sidebar-hover:     rgba(255,255,255,.05);
  --sidebar-active:    rgba(99,102,241,.22);
  --sidebar-bar:       rgba(255,255,255,.10);
}

/* (c) Explicit light mode */
html[data-theme="light"] {
  --bg:             #EEF2F7;
  --surface:        #FFFFFF;
  --surface-2:      #F8FAFB;
  --surface-raised: #FFFFFF;

  --topbar-bg:      #FFFFFF;
  --topbar-border:  #E8ECF4;

  --t1:             #0F172A;
  --t2:             #3D4B5C;
  --t3:             #6B7A8F;
  --t4:             #A4B0BF;

  --border:         #E2E8F0;
  --border-strong:  #BEC8D6;

  --primary-dim:    rgba(99,102,241,.10);
  --success-dim:    rgba(16,185,129,.10);
  --warning-dim:    rgba(245,158,11,.12);
  --danger-dim:     rgba(239,68,68,.10);
  --info-dim:       rgba(59,130,246,.10);

  --shadow-sm:  0 1px 4px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md:  0 4px 16px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.04);
  --shadow-lg:  0 10px 32px rgba(15,23,42,.11), 0 4px 12px rgba(15,23,42,.06);
  --shadow-xl:  0 20px 56px rgba(15,23,42,.16), 0 8px 20px rgba(15,23,42,.07);

  /* Sidebar — stays dark navy in light mode too */
  --sidebar-bg:        #0F172A;
  --sidebar-border:    rgba(255,255,255,.07);
  --sidebar-hover:     rgba(255,255,255,.06);
  --sidebar-active:    rgba(99,102,241,.20);
  --sidebar-bar:       rgba(255,255,255,.12);
  --sidebar-icon-act:  #A5B4FC;
  --t-sidebar:         rgba(203,213,225,.72);
  --t-sidebar-sec:     rgba(148,163,184,.45);
  --t-sidebar-act:     #FFFFFF;
  --sidebar-brand-c:   #FFFFFF;
}

/* ════════════════════════════════════════════════════════════════
   RESET & BASE
   ════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--ff-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--t1);
  background: var(--bg);
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--t1);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: .9rem; }

p { line-height: 1.7; }

small { font-size: .8rem; }

/* ════════════════════════════════════════════════════════════════
   APP LAYOUT  (sidebar + topbar + content)
   ════════════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
  overflow-x: scroll;
}

/* ── Overlay for mobile ───────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.50);
  z-index: calc(var(--z-sidebar) - 1);
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ════════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════════ */
.app-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  transition: width var(--t-std) var(--ease),
              transform var(--t-std) var(--ease);
  overflow: hidden;
  border-right: 1px solid var(--sidebar-border);
}

/* ── Sidebar brand ────────────────────────────────────────────── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1.25rem;
  height: var(--topbar-h);
  flex-shrink: 0;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
  overflow: hidden;
}
.sidebar-brand img {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(255,255,255,.15);
}
.sidebar-brand-name {
  font-family: var(--ff-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--sidebar-brand-c);
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: -.01em;
}
.sidebar-brand-name span {
  color: var(--gold);
}

/* ── Sidebar scroll area ──────────────────────────────────────── */
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .75rem 0 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--sidebar-bar) transparent;
}
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: var(--sidebar-bar);
  border-radius: 4px;
}

/* ── Section header ───────────────────────────────────────────── */
.sidebar-section {
  display: block;
  padding: 1.1rem 1.25rem .35rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--t-sidebar-sec);
  white-space: nowrap;
  overflow: hidden;
}

/* ── Nav item ─────────────────────────────────────────────────── */
.sidebar-item { position: relative; }

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  padding: .56rem 1.1rem;
  margin: .08rem .5rem;
  border-radius: var(--r-md);
  color: var(--t-sidebar);
  text-decoration: none;
  font-size: .855rem;
  font-weight: 450;
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  border: none;
  background: transparent;
  width: calc(100% - 1rem);
  position: relative;
}
.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: rgba(255,255,255,.90);
}
.sidebar-link.active {
  background: var(--sidebar-active);
  color: var(--t-sidebar-act);
  font-weight: 600;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 20%; bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sidebar-icon-act);
}
.sidebar-link i, .sidebar-link .si {
  font-size: 1.05rem;
  flex-shrink: 0;
  width: 1.2rem;
  text-align: center;
  opacity: .65;
  transition: opacity var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.sidebar-link:hover i,
.sidebar-link:hover .si { opacity: .85; }
.sidebar-link.active i,
.sidebar-link.active .si { opacity: 1; color: var(--sidebar-icon-act); }

.sidebar-link-text { flex: 1; }

/* Arrow for sub-menus */
.sidebar-arrow {
  font-size: .65rem;
  transition: transform var(--t-fast) var(--ease);
  opacity: .40;
  flex-shrink: 0;
}
.sidebar-link.open .sidebar-arrow { transform: rotate(90deg); opacity: .65; }

/* ── Sub-menu ─────────────────────────────────────────────────── */
.sidebar-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-std) var(--ease);
}
.sidebar-sub.open { max-height: 500px; }

.sidebar-sub .sidebar-link {
  font-size: .835rem;
  padding-left: 3.2rem;
  font-weight: 400;
}
.sidebar-sub .sidebar-link::before {
  content: '';
  position: absolute;
  left: 2.4rem;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: .35;
  flex-shrink: 0;
  top: 50%;
  transform: translateY(-50%);
}
.sidebar-sub .sidebar-link.active::before {
  left: 2.4rem;
  background: var(--sidebar-icon-act);
  opacity: 1;
  width: 5px; height: 5px;
}

/* ── Collapsed sidebar ────────────────────────────────────────── */
.app-layout.sidebar-collapsed .app-sidebar {
  width: var(--sidebar-cw);
}
.app-layout.sidebar-collapsed .sidebar-brand-name,
.app-layout.sidebar-collapsed .sidebar-link-text,
.app-layout.sidebar-collapsed .sidebar-section,
.app-layout.sidebar-collapsed .sidebar-arrow,
.app-layout.sidebar-collapsed .sidebar-sub {
  display: none !important;
}
.app-layout.sidebar-collapsed .sidebar-link {
  padding: .6rem;
  margin: .1rem auto;
  justify-content: center;
  width: calc(var(--sidebar-cw) - 16px);
}
.app-layout.sidebar-collapsed .sidebar-link i {
  width: auto;
}
.app-layout.sidebar-collapsed .app-content {
  margin-left: var(--sidebar-cw);
}

/* ════════════════════════════════════════════════════════════════
   TOPBAR
   ════════════════════════════════════════════════════════════════ */
.app-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  box-shadow: 0 1px 0 var(--topbar-border), 0 2px 8px rgba(15,23,42,.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: var(--z-topbar);
  transition: left var(--t-std) var(--ease);
  gap: 1rem;
}
.app-layout.sidebar-collapsed .app-topbar {
  left: var(--sidebar-cw);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.topbar-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--t2);
  font-size: 1rem;
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}
.topbar-hamburger:hover {
  background: var(--bg);
  color: var(--t1);
}

.topbar-page-title {
  font-family: var(--ff-display);
  font-size: .95rem;
  font-weight: 600;
  color: var(--t1);
}

/* ── Topbar icon buttons ──────────────────────────────────────── */
.topbar-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--t2);
  font-size: 1rem;
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}
.topbar-icon-btn:hover {
  background: var(--bg);
  color: var(--t1);
}
.topbar-icon-btn .badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--topbar-bg);
  display: none;
}
.topbar-icon-btn .badge-dot.show { display: block; }

/* ── Topbar count badge ───────────────────────────────────────── */
.topbar-notif-badge {
  position: absolute;
  top: -4px; right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--danger);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--topbar-bg);
  line-height: 1;
}
.topbar-notif-badge.show { display: flex; }

/* ── User button ──────────────────────────────────────────────── */
.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .3rem .7rem .3rem .3rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.topbar-user-btn:hover { background: var(--bg); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  font-family: var(--ff-display);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99,102,241,.30);
}
.user-avatar.avatar-gold {
  background: var(--grad-gold);
  color: #fff;
  box-shadow: 0 2px 8px rgba(201,168,76,.30);
}
.user-avatar.avatar-success {
  background: var(--grad-success);
  box-shadow: 0 2px 8px rgba(16,185,129,.30);
}
.user-avatar.avatar-warning {
  background: var(--grad-warning);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245,158,11,.30);
}

.user-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--t1);
  white-space: nowrap;
}

.user-caret {
  font-size: .7rem;
  color: var(--t3);
  transition: transform var(--t-fast) var(--ease);
}

/* ════════════════════════════════════════════════════════════════
   DROPDOWN
   ════════════════════════════════════════════════════════════════ */
.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  padding: .4rem;
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.98);
  transform-origin: top right;
  transition: opacity var(--t-fast) var(--ease),
              visibility var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.dropdown-menu.dropdown-left {
  right: auto;
  left: 0;
  transform-origin: top left;
}

.dropdown-header {
  padding: .6rem .75rem .5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .3rem;
}
.dropdown-header h6 {
  font-size: .875rem;
  font-weight: 600;
  margin: 0 0 .1rem;
}
.dropdown-header small {
  color: var(--t3);
  font-size: .78rem;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .52rem .75rem;
  border-radius: var(--r-sm);
  color: var(--t1);
  font-size: .875rem;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease);
  cursor: pointer;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-dim); }
.dropdown-item i { width: 1rem; text-align: center; font-size: .95rem; color: var(--t3); }
.dropdown-item.danger i { color: var(--danger); }
.dropdown-item.theme-toggle { cursor: pointer; }
.dropdown-item.theme-toggle i { color: var(--primary); }
.dropdown-divider { border-top: 1px solid var(--border); margin: .3rem 0; }

/* ── Notification dropdown ────────────────────────────────────── */
.notif-dropdown { min-width: 300px; padding: 0; overflow: hidden; }
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.notif-header h6 { margin: 0; font-size: .9rem; }
.notif-scroll { max-height: 280px; overflow-y: auto; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--t1);
  transition: background var(--t-fast) var(--ease);
}
.notif-item:hover { background: var(--bg); }
.notif-item:last-child { border-bottom: none; }
.notif-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.notif-icon.warning { background: var(--warning-dim); color: var(--warning-dark); }
.notif-icon.danger  { background: var(--danger-dim);  color: var(--danger-dark); }
.notif-icon.info    { background: var(--info-dim);    color: var(--info-dark); }
.notif-body h6 { font-size: .84rem; margin-bottom: .15rem; }
.notif-body p  { font-size: .78rem; color: var(--t3); margin: 0; }
.notif-footer {
  padding: .6rem;
  border-top: 1px solid var(--border);
}
.notif-footer a {
  display: block;
  text-align: center;
  font-size: .8rem;
  color: var(--primary);
  padding: .3rem;
  border-radius: var(--r-sm);
}
.notif-footer a:hover { background: var(--primary-dim); }
.notif-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--t3);
  font-size: .84rem;
}

/* ════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════════════════════════════════ */
.app-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  transition: margin-left var(--t-std) var(--ease);
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding: 1.75rem;
}

/* Page title box (replaces Minible .page-title-box) */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.page-header-info h4 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 .2rem;
}
.page-header-info p {
  font-size: .83rem;
  color: var(--t3);
  margin: 0;
}
.page-header-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

/* Breadcrumb (keep Bootstrap-compatible) */
.page-title-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.page-title-right { display: flex; align-items: center; gap: .5rem; }
.page-title-box h4 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -.02em;
  color: var(--t1);
}

/* ── App Footer ────────────────────────────────────────────────── */
.app-footer {
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--t3);
  font-size: .8rem;
  background: var(--surface);
}

/* ════════════════════════════════════════════════════════════════
   GRID  (12-column Bootstrap-compatible)
   ════════════════════════════════════════════════════════════════ */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -.75rem;
}
[class^="col"] { padding: 0 .75rem; }
.col    { flex: 1 0 0%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-11 { flex: 0 0 91.66%; max-width: 91.66%; }
.col-10 { flex: 0 0 83.33%; max-width: 83.33%; }
.col-9  { flex: 0 0 75%;    max-width: 75%; }
.col-8  { flex: 0 0 66.66%; max-width: 66.66%; }
.col-7  { flex: 0 0 58.33%; max-width: 58.33%; }
.col-6  { flex: 0 0 50%;    max-width: 50%; }
.col-5  { flex: 0 0 41.66%; max-width: 41.66%; }
.col-4  { flex: 0 0 33.33%; max-width: 33.33%; }
.col-3  { flex: 0 0 25%;    max-width: 25%; }
.col-2  { flex: 0 0 16.66%; max-width: 16.66%; }
.col-1  { flex: 0 0 8.33%;  max-width: 8.33%; }

/* Responsive col breakpoints */
@media (min-width: 576px) {
  .col-sm-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
  .col-sm-1  { flex: 0 0 8.33%;  max-width: 8.33%; }
  .col-sm-2  { flex: 0 0 16.66%; max-width: 16.66%; }
  .col-sm-3  { flex: 0 0 25%;    max-width: 25%; }
  .col-sm-4  { flex: 0 0 33.33%; max-width: 33.33%; }
  .col-sm-5  { flex: 0 0 41.66%; max-width: 41.66%; }
  .col-sm-6  { flex: 0 0 50%;    max-width: 50%; }
  .col-sm-7  { flex: 0 0 58.33%; max-width: 58.33%; }
  .col-sm-8  { flex: 0 0 66.66%; max-width: 66.66%; }
  .col-sm-9  { flex: 0 0 75%;    max-width: 75%; }
  .col-sm-10 { flex: 0 0 83.33%; max-width: 83.33%; }
  .col-sm-11 { flex: 0 0 91.66%; max-width: 91.66%; }
  .col-sm-12 { flex: 0 0 100%;   max-width: 100%; }
}
@media (min-width: 768px) {
  .col-md-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
  .col-md-1  { flex: 0 0 8.33%;  max-width: 8.33%; }
  .col-md-2  { flex: 0 0 16.66%; max-width: 16.66%; }
  .col-md-3  { flex: 0 0 25%;    max-width: 25%; }
  .col-md-4  { flex: 0 0 33.33%; max-width: 33.33%; }
  .col-md-5  { flex: 0 0 41.66%; max-width: 41.66%; }
  .col-md-6  { flex: 0 0 50%;    max-width: 50%; }
  .col-md-7  { flex: 0 0 58.33%; max-width: 58.33%; }
  .col-md-8  { flex: 0 0 66.66%; max-width: 66.66%; }
  .col-md-9  { flex: 0 0 75%;    max-width: 75%; }
  .col-md-10 { flex: 0 0 83.33%; max-width: 83.33%; }
  .col-md-11 { flex: 0 0 91.66%; max-width: 91.66%; }
  .col-md-12 { flex: 0 0 100%;   max-width: 100%; }
}
@media (min-width: 992px) {
  .col-lg-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
  .col-lg-1  { flex: 0 0 8.33%;  max-width: 8.33%; }
  .col-lg-2  { flex: 0 0 16.66%; max-width: 16.66%; }
  .col-lg-3  { flex: 0 0 25%;    max-width: 25%; }
  .col-lg-4  { flex: 0 0 33.33%; max-width: 33.33%; }
  .col-lg-5  { flex: 0 0 41.66%; max-width: 41.66%; }
  .col-lg-6  { flex: 0 0 50%;    max-width: 50%; }
  .col-lg-7  { flex: 0 0 58.33%; max-width: 58.33%; }
  .col-lg-8  { flex: 0 0 66.66%; max-width: 66.66%; }
  .col-lg-9  { flex: 0 0 75%;    max-width: 75%; }
  .col-lg-10 { flex: 0 0 83.33%; max-width: 83.33%; }
  .col-lg-11 { flex: 0 0 91.66%; max-width: 91.66%; }
  .col-lg-12 { flex: 0 0 100%;   max-width: 100%; }
}
@media (min-width: 1200px) {
  .col-xl-auto { flex: 0 0 auto; width: auto; max-width: 100%; }
  .col-xl-1  { flex: 0 0 8.33%;  max-width: 8.33%; }
  .col-xl-2  { flex: 0 0 16.66%; max-width: 16.66%; }
  .col-xl-3  { flex: 0 0 25%;    max-width: 25%; }
  .col-xl-4  { flex: 0 0 33.33%; max-width: 33.33%; }
  .col-xl-5  { flex: 0 0 41.66%; max-width: 41.66%; }
  .col-xl-6  { flex: 0 0 50%;    max-width: 50%; }
  .col-xl-7  { flex: 0 0 58.33%; max-width: 58.33%; }
  .col-xl-8  { flex: 0 0 66.66%; max-width: 66.66%; }
  .col-xl-9  { flex: 0 0 75%;    max-width: 75%; }
  .col-xl-10 { flex: 0 0 83.33%; max-width: 83.33%; }
  .col-xl-11 { flex: 0 0 91.66%; max-width: 91.66%; }
  .col-xl-12 { flex: 0 0 100%;   max-width: 100%; }
}

/* col-auto: size to content */
.col-auto { flex: 0 0 auto; width: auto; max-width: 100%; }

/* Grid gap helpers */
.g-0 { --gap: 0; }
.g-1 { margin: -.25rem; } .g-1 > * { padding: .25rem; }
.g-2 { margin: -.375rem; } .g-2 > * { padding: .375rem; }
.g-3 { margin: -.5rem; } .g-3 > * { padding: .5rem; }
.g-4 { margin: -.75rem; } .g-4 > * { padding: .75rem; }

/* ════════════════════════════════════════════════════════════════
   CARD
   ════════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
  transition: box-shadow var(--t-std) var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  background: var(--surface-2);
}
.card-header h5, .card-header h6 {
  margin: 0;
  font-family: var(--ff-display);
  letter-spacing: -.01em;
}
.card-body { padding: 1.35rem; }
.card-footer {
  padding: .875rem 1.35rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: .25rem; letter-spacing: -.01em; }

/* Colored card borders */
.card.border-primary { border-color: var(--primary) !important; }
.card.border-success  { border-color: var(--success) !important; }
.card.border-warning  { border-color: var(--warning) !important; }
.card.border-danger   { border-color: var(--danger) !important; }
.card.border-info     { border-color: var(--info) !important; }

/* Subtle colored card headers */
.card-header.bg-primary-subtle {
  background: var(--primary-dim);
  border-color: rgba(91,80,232,.2);
}
.card-header.bg-success-subtle {
  background: var(--success-dim);
  border-color: rgba(16,185,129,.2);
}
.card-header.bg-warning-subtle {
  background: var(--warning-dim);
  border-color: rgba(245,158,11,.2);
}
.card-header.bg-danger-subtle {
  background: var(--danger-dim);
  border-color: rgba(239,68,68,.2);
}
.card-header.bg-info-subtle {
  background: var(--info-dim);
  border-color: rgba(59,130,246,.2);
}

/* ── Stat card ────────────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.35rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  transition: box-shadow var(--t-std) var(--ease),
              transform var(--t-std) var(--ease);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%);
  transform: translate(20px, -20px);
  pointer-events: none;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-icon {
  width: 50px; height: 50px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.stat-icon.primary { background: var(--grad-primary); }
.stat-icon.success { background: var(--grad-success); }
.stat-icon.warning { background: var(--grad-warning); }
.stat-icon.danger  { background: var(--grad-danger); }
.stat-icon.info    { background: var(--grad-info); }
.stat-icon.gold    { background: var(--grad-gold); }

.stat-body { flex: 1; min-width: 0; }
.stat-label {
  font-size: .72rem;
  color: var(--t3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .35rem;
}
.stat-value {
  font-family: var(--ff-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--t1);
  line-height: 1.1;
  margin-bottom: .35rem;
  letter-spacing: -.02em;
}
.stat-trend {
  font-size: .76rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
}
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger); }
.stat-trend.flat { color: var(--t3); }

/* ════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .5rem 1rem;
  border-radius: var(--r-md);
  font-family: var(--ff-body);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.4;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
  -webkit-user-select: none;
  user-select: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}
.btn i { font-size: 1rem; }

/* Sizes */
.btn-lg { padding: .7rem 1.4rem; font-size: 1rem; border-radius: var(--r-md); }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-xs { padding: .2rem .55rem; font-size: .75rem; border-radius: var(--r-sm); }

/* Filled */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

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

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

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

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

.btn-dark {
  background: var(--t1);
  color: #fff;
  border-color: var(--t1);
}
.btn-dark:hover {
  background: #000;
  border-color: #000;
  color: #fff;
}

.btn-light {
  background: var(--bg);
  color: var(--t1);
  border-color: var(--border);
}
.btn-light:hover {
  background: var(--border);
  color: var(--t1);
}

/* Outline */
.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

.btn-outline-success {
  background: transparent;
  color: var(--success-dark);
  border-color: var(--success);
}
.btn-outline-success:hover { background: var(--success); color: #fff; }

.btn-outline-warning {
  background: transparent;
  color: var(--warning-dark);
  border-color: var(--warning);
}
.btn-outline-warning:hover { background: var(--warning); color: #fff; }

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-outline-danger:hover { background: var(--danger); color: #fff; }

.btn-outline-info {
  background: transparent;
  color: var(--info-dark);
  border-color: var(--info);
}
.btn-outline-info:hover { background: var(--info); color: #fff; }

.btn-outline-secondary {
  background: transparent;
  color: var(--t2);
  border-color: var(--border-strong);
}
.btn-outline-secondary:hover { background: var(--bg); color: var(--t1); }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--t2);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg); color: var(--t1); }

/* Full width */
.btn-block, .d-grid .btn { width: 100%; }
.d-grid { display: grid; }
.d-grid.gap-2 { gap: .5rem; }

/* waves-effect stub */
.waves-effect { position: relative; overflow: hidden; }

/* ════════════════════════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════════════════════════ */
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  color: var(--t2);
  margin-bottom: .4rem;
}
.form-label .required,
.form-label span.text-danger { color: var(--danger); }

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: .56rem .85rem;
  font-size: .9rem;
  font-family: var(--ff-body);
  font-weight: 400;
  color: var(--t1);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  line-height: 1.5;
  transition: border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
  appearance: none;
  -webkit-appearance: none;
}
.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}
.form-control::placeholder { color: var(--t4); }
.form-control.bg-light, .form-control[readonly] {
  background: var(--surface-2);
  color: var(--t3);
}
.form-control-sm, .form-select-sm {
  padding: .32rem .7rem;
  font-size: .82rem;
  border-radius: var(--r-sm);
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%237B8899' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 14px;
  padding-right: 2.25rem;
}

textarea.form-control { resize: vertical; min-height: 90px; }

.form-text {
  font-size: .78rem;
  color: var(--t3);
  margin-top: .3rem;
}
.form-text.text-danger { color: var(--danger); }

/* Input group */
.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .form-control,
.input-group .form-select {
  flex: 1;
  border-radius: 0;
}
.input-group > :first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
.input-group > :last-child  { border-radius: 0 var(--r-md) var(--r-md) 0; }

.input-group-text {
  display: flex;
  align-items: center;
  padding: .56rem .85rem;
  font-size: .9rem;
  color: var(--t3);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 0;
  white-space: nowrap;
}
.input-group > .input-group-text:first-child {
  border-radius: var(--r-md) 0 0 var(--r-md);
  border-right: none;
}
.input-group > .input-group-text:last-child {
  border-radius: 0 var(--r-md) var(--r-md) 0;
  border-left: none;
}
.input-group .btn { border-radius: 0; }
.input-group .btn:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
}
.form-check-input {
  width: 16px; height: 16px;
  border: 2px solid var(--border-strong);
  border-radius: var(--r-xs);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background: var(--surface);
  flex-shrink: 0;
  transition: all var(--t-fast) var(--ease);
}
.form-check-input[type="radio"] { border-radius: 50%; }
.form-check-input:checked {
  background: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M6 10l3 3 6-6'/%3e%3c/svg%3e");
  background-size: 10px;
  background-repeat: no-repeat;
  background-position: center;
}
.form-check-input[type="radio"]:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3ccircle cx='10' cy='10' r='5' fill='white'/%3e%3c/svg%3e");
  background-size: 8px;
}
.form-check-input:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.form-check-label {
  font-size: .875rem;
  color: var(--t1);
  cursor: pointer;
}
.form-check-inline {
  display: inline-flex;
  margin-right: 1rem;
}

/* Form switch (toggle) */
.form-switch .form-check-input {
  width: 36px; height: 20px;
  border-radius: var(--r-full);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(80,80,100,.5)'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: left .15rem center;
  background-size: auto;
  transition: background-position var(--t-fast) var(--ease);
}
.form-switch .form-check-input:checked {
  background-position: right .15rem center;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='white'/%3e%3c/svg%3e");
}

/* Validation states */
.form-control.is-invalid,
.form-select.is-invalid { border-color: var(--danger); }
.form-control.is-valid,
.form-select.is-valid   { border-color: var(--success); }
.invalid-feedback { display: none; font-size: .8rem; color: var(--danger); margin-top: .25rem; }
.valid-feedback   { display: none; font-size: .8rem; color: var(--success); margin-top: .25rem; }
.is-invalid ~ .invalid-feedback,
.is-invalid + .invalid-feedback { display: block; }
.is-valid   ~ .valid-feedback,
.is-valid   + .valid-feedback   { display: block; }

/* mb helpers for forms */
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }

/* ════════════════════════════════════════════════════════════════
   TABLE
   ════════════════════════════════════════════════════════════════ */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md);
  /* Ensure the card's overflow:hidden doesn't clip the scrollbar */
  width: 100%;
}

/* Allow cards containing a scrollable table to show the horizontal scrollbar.
   .card has overflow:hidden which clips .table-responsive — override it. */
.card:has(.table-responsive) {
  overflow: visible;
}
.card:has(.table-responsive) .card-body {
  overflow: visible;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table th {
  font-family: var(--ff-display);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--t3);
  padding: .7rem 1rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
  background: var(--surface-2);
}
.table td {
  padding: .82rem 1rem;
  color: var(--t1);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: .87rem;
}
.table tbody tr {
  transition: background var(--t-fast) var(--ease);
}
.table tbody tr:nth-child(even) { background: rgba(0,0,0,.016); }
html[data-theme="dark"] .table tbody tr:nth-child(even) { background: rgba(255,255,255,.025); }
.table.table-hover tbody tr:hover { background: var(--primary-dim) !important; }
.table.table-hover tbody tr:hover td { color: var(--t1); }

.table-light { background: var(--surface-2) !important; }

.table-sm th, .table-sm td {
  padding: .5rem .75rem;
  font-size: .82rem;
}

.table-bordered {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.table-bordered th,
.table-bordered td {
  border: 1px solid var(--border);
}
.table-bordered thead th { border-bottom-width: 2px; }

.table-borderless th,
.table-borderless td { border: none; }

/* Centered cell */
.table .text-center { text-align: center; }
.table .text-end    { text-align: right; }

/* Empty state */
.table-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--t3);
}
.table-empty i {
  font-size: 3rem;
  display: block;
  margin-bottom: .75rem;
  opacity: .4;
}
.table-empty p { font-size: .9rem; margin: 0; }

/* ════════════════════════════════════════════════════════════════
   BADGE
   ════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .28rem .62rem;
  font-size: .72rem;
  font-weight: 600;
  font-family: var(--ff-display);
  border-radius: var(--r-sm);
  white-space: nowrap;
  line-height: 1.3;
}
.badge i { font-size: .75rem; }

/* Filled */
.badge.bg-primary  { background: var(--primary-dim); color: var(--primary); }
.badge.bg-success  { background: var(--success-dim); color: var(--success-dark); }
.badge.bg-warning  { background: var(--warning-dim); color: var(--warning-dark); }
.badge.bg-danger   { background: var(--danger-dim);  color: var(--danger-dark); }
.badge.bg-info     { background: var(--info-dim);    color: var(--info-dark); }
.badge.bg-dark     { background: rgba(17,19,24,.1);  color: var(--t1); }
.badge.bg-light    { background: var(--bg);          color: var(--t2); border: 1px solid var(--border); }
.badge.bg-secondary { background: var(--bg); color: var(--t2); }

/* Subtle variants (Minible-compatible) */
.badge.bg-primary-subtle { background: var(--primary-dim); color: var(--primary); }
.badge.bg-success-subtle { background: var(--success-dim); color: var(--success-dark); }
.badge.bg-warning-subtle { background: var(--warning-dim); color: var(--warning-dark); }
.badge.bg-danger-subtle  { background: var(--danger-dim);  color: var(--danger-dark); }
.badge.bg-info-subtle    { background: var(--info-dim);    color: var(--info-dark); }

/* Rounded pill */
.badge.rounded-pill { border-radius: var(--r-full); }
.rounded-pill { border-radius: var(--r-full) !important; }

/* Text color helpers */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success-dark) !important; }
.text-warning { color: var(--warning-dark) !important; }
.text-danger  { color: var(--danger) !important; }
.text-info    { color: var(--info-dark) !important; }
.text-muted   { color: var(--t3) !important; }
.text-dark    { color: var(--t1) !important; }
.text-white   { color: #fff !important; }
.text-gold    { color: var(--gold) !important; }

/* ════════════════════════════════════════════════════════════════
   ALERT
   ════════════════════════════════════════════════════════════════ */
.alert {
  padding: .9rem 1.1rem;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: 1rem;
  position: relative;
}
.alert ul { padding-left: 1.25rem; margin: 0; }
.alert ul li + li { margin-top: .25rem; }

.alert-primary  {
  background: var(--primary-dim);
  border-color: rgba(91,80,232,.2);
  color: var(--primary-dark);
}
.alert-success  {
  background: var(--success-dim);
  border-color: rgba(16,185,129,.25);
  color: var(--success-dark);
}
.alert-warning  {
  background: var(--warning-dim);
  border-color: rgba(245,158,11,.3);
  color: var(--warning-dark);
}
.alert-danger   {
  background: var(--danger-dim);
  border-color: rgba(239,68,68,.25);
  color: var(--danger-dark);
}
.alert-info     {
  background: var(--info-dim);
  border-color: rgba(59,130,246,.2);
  color: var(--info-dark);
}
.alert-dismissible { padding-right: 3rem; }
.alert .btn-close {
  position: absolute;
  top: .7rem; right: .75rem;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
  font-size: .75rem;
  opacity: .7;
  transition: all var(--t-fast) var(--ease);
}
.alert .btn-close::before { content: '✕'; }
.alert .btn-close:hover { opacity: 1; background: rgba(0,0,0,.12); }
.alert-link { font-weight: 600; color: inherit; text-decoration: underline; }

/* Subtle alert variants */
.bg-primary-subtle { background: var(--primary-dim) !important; }
.bg-success-subtle { background: var(--success-dim) !important; }
.bg-warning-subtle { background: var(--warning-dim) !important; }
.bg-danger-subtle  { background: var(--danger-dim) !important; }
.bg-info-subtle    { background: var(--info-dim) !important; }

/* ════════════════════════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: calc(var(--z-modal) - 1);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.show { display: flex; }

.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn var(--t-std) var(--ease) both;
}
.modal-dialog.modal-lg { max-width: 800px; }
.modal-dialog.modal-sm { max-width: 380px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-20px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.05rem; font-weight: 700; font-family: var(--ff-display); margin: 0; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--t3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: .85rem;
  transition: all var(--t-fast) var(--ease);
}
.modal-close:hover { background: var(--border); color: var(--t1); }
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 340px;
  width: 100%;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: .9rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  animation: toastIn var(--t-std) var(--ease) both;
  position: relative;
  overflow: hidden;
}
.toast::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.toast.success::before { background: var(--success); }
.toast.danger::before  { background: var(--danger); }
.toast.warning::before { background: var(--warning); }
.toast.info::before    { background: var(--info); }

.toast-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}
.toast.success .toast-icon { background: var(--success-dim); color: var(--success-dark); }
.toast.danger  .toast-icon { background: var(--danger-dim);  color: var(--danger-dark); }
.toast.warning .toast-icon { background: var(--warning-dim); color: var(--warning-dark); }
.toast.info    .toast-icon { background: var(--info-dim);    color: var(--info-dark); }

.toast-body { flex: 1; }
.toast-title { font-weight: 600; font-size: .875rem; margin-bottom: .15rem; }
.toast-msg   { font-size: .82rem; color: var(--t3); }

.toast-dismiss {
  background: none; border: none;
  color: var(--t3); cursor: pointer;
  font-size: .75rem;
  padding: .1rem;
  flex-shrink: 0;
  opacity: .6;
}
.toast-dismiss:hover { opacity: 1; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); height: 0; padding: 0; margin: 0; }
}
.toast.removing {
  animation: toastOut var(--t-std) var(--ease) forwards;
}

/* ════════════════════════════════════════════════════════════════
   TABS
   ════════════════════════════════════════════════════════════════ */
.nav-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: .1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.nav-tabs .nav-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--t3);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none;
  cursor: pointer;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  transition: color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.nav-tabs .nav-link:hover { color: var(--t1); background: var(--bg); }
.nav-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* Custom nav-tabs-custom alias */
.nav-tabs-custom { display: flex; border-bottom: 2px solid var(--border); }
.nav-tabs-custom .nav-item .nav-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--t3);
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  text-decoration: none;
}
.nav-tabs-custom .nav-item .nav-link:hover { color: var(--t1); }
.nav-tabs-custom .nav-item .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════
   BREADCRUMB
   ════════════════════════════════════════════════════════════════ */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .15rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: .8rem;
  color: var(--t3);
}
.breadcrumb-item { display: flex; align-items: center; }
.breadcrumb-item a { color: var(--t3); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--t2); }
.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  margin-right: .15rem;
  color: var(--t3);
  opacity: .5;
}

/* ════════════════════════════════════════════════════════════════
   PAGINATION
   ════════════════════════════════════════════════════════════════ */
.pagination {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
  flex-wrap: wrap;
}
.pagination .page-item .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px; height: 34px;
  padding: 0 .5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--t2);
  font-size: .83rem;
  font-weight: 500;
  text-decoration: none;
  background: var(--surface);
  transition: all var(--t-fast) var(--ease);
}
.pagination .page-item .page-link:hover {
  background: var(--bg);
  color: var(--t1);
}
.pagination .page-item.active .page-link {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pagination .page-item.disabled .page-link {
  opacity: .4;
  pointer-events: none;
}

/* ════════════════════════════════════════════════════════════════
   FILTER BAR  (search + selects)
   ════════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.filter-bar .form-control,
.filter-bar .form-select {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
}
.filter-bar .form-select {
  max-width: 160px;
}
.filter-bar .btn { flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════════
   SIMPLEBAR CUSTOM SCROLLBAR
   ════════════════════════════════════════════════════════════════ */
[data-simplebar] .simplebar-scrollbar::before {
  background: var(--t4) !important;
  border-radius: 4px;
}

/* ════════════════════════════════════════════════════════════════
   ACTIVITY FEED  (timeline)
   ════════════════════════════════════════════════════════════════ */
.activity-feed {
  position: relative;
  padding-left: 1.5rem;
}
.activity-feed::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--border);
}
.feed-item {
  position: relative;
  padding-bottom: 1.25rem;
}
.feed-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 5px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--primary-ring);
}

/* ════════════════════════════════════════════════════════════════
   STATUS BADGES  (Minible aliases kept)
   ════════════════════════════════════════════════════════════════ */
.badge.font-size-11 { font-size: .68rem; }
.badge.font-size-12 { font-size: .72rem; }
.badge.font-size-13 { font-size: .78rem; }

/* ════════════════════════════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════════════════════════════ */

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

@media (min-width: 576px) {
  .d-sm-none         { display: none !important; }
  .d-sm-block        { display: block !important; }
  .d-sm-flex         { display: flex !important; }
  .d-sm-inline-block { display: inline-block !important; }
  .d-sm-grid         { display: grid !important; }
}
@media (min-width: 768px) {
  .d-md-none         { display: none !important; }
  .d-md-block        { display: block !important; }
  .d-md-flex         { display: flex !important; }
  .d-md-inline-block { display: inline-block !important; }
  .d-md-grid         { display: grid !important; }
  .d-md-inline       { display: inline !important; }
}
@media (min-width: 992px) {
  .d-lg-none         { display: none !important; }
  .d-lg-block        { display: block !important; }
  .d-lg-flex         { display: flex !important; }
  .d-lg-inline-block { display: inline-block !important; }
  .d-lg-grid         { display: grid !important; }
  .d-lg-inline       { display: inline !important; }
}
@media (min-width: 1200px) {
  .d-xl-none         { display: none !important; }
  .d-xl-block        { display: block !important; }
  .d-xl-flex         { display: flex !important; }
  .d-xl-inline-block { display: inline-block !important; }
  .d-xl-grid         { display: grid !important; }
  .d-xl-inline       { display: inline !important; }
}

/* Flexbox */
.flex-1    { flex: 1 !important; }
.flex-row  { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.flex-grow-1   { flex-grow: 1 !important; }

.align-items-center  { align-items: center !important; }
.align-items-start   { align-items: flex-start !important; }
.align-items-end     { align-items: flex-end !important; }
.align-items-baseline { align-items: baseline !important; }

.justify-content-between { justify-content: space-between !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-end     { justify-content: flex-end !important; }
.justify-content-start   { justify-content: flex-start !important; }

/* Gap */
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: .75rem !important; }
.gap-4 { gap: 1rem !important; }

/* Spacing */
.m-0  { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: .75rem !important; }
.mb-4 { margin-bottom: 1.25rem !important; }
.mb-5 { margin-bottom: 2rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .25rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: .75rem !important; }
.mt-4 { margin-top: 1.25rem !important; }
.mt-5 { margin-top: 2rem !important; }

.ms-0 { margin-left: 0 !important; }
.ms-1 { margin-left: .25rem !important; }
.ms-2 { margin-left: .5rem !important; }
.ms-3 { margin-left: .75rem !important; }
.ms-auto { margin-left: auto !important; }

.me-0 { margin-right: 0 !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.me-3 { margin-right: .75rem !important; }
.me-auto { margin-right: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.p-0  { padding: 0 !important; }
.p-1  { padding: .25rem !important; }
.p-2  { padding: .5rem !important; }
.p-3  { padding: .75rem !important; }
.p-4  { padding: 1.25rem !important; }

.py-1 { padding-top: .25rem !important; padding-bottom: .25rem !important; }
.py-2 { padding-top: .5rem !important;  padding-bottom: .5rem !important; }
.py-3 { padding-top: .75rem !important; padding-bottom: .75rem !important; }
.py-4 { padding-top: 1.25rem !important; padding-bottom: 1.25rem !important; }
.py-5 { padding-top: 2rem !important;   padding-bottom: 2rem !important; }

.px-1 { padding-left: .25rem !important; padding-right: .25rem !important; }
.px-2 { padding-left: .5rem !important;  padding-right: .5rem !important; }
.px-3 { padding-left: .75rem !important; padding-right: .75rem !important; }
.px-4 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }

.ps-0 { padding-left: 0 !important; }
.ps-2 { padding-left: .5rem !important; }
.ps-3 { padding-left: .75rem !important; }

.pe-0 { padding-right: 0 !important; }

/* Typography */
.text-center   { text-align: center !important; }
.text-end      { text-align: right !important; }
.text-start    { text-align: left !important; }

.fw-light    { font-weight: 300 !important; }
.fw-normal   { font-weight: 400 !important; }
.fw-medium   { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold     { font-weight: 700 !important; }
.fw-extrabold { font-weight: 800 !important; }

.font-size-11 { font-size: .68rem !important; }
.font-size-12 { font-size: .75rem !important; }
.font-size-13 { font-size: .81rem !important; }
.font-size-14 { font-size: .875rem !important; }
.font-size-15 { font-size: .94rem !important; }
.font-size-16 { font-size: 1rem !important; }
.font-size-18 { font-size: 1.125rem !important; }
.font-size-20 { font-size: 1.25rem !important; }
.font-size-22 { font-size: 1.375rem !important; }
.font-size-24 { font-size: 1.5rem !important; }
.font-size-36 { font-size: 2.25rem !important; }
.font-size-48 { font-size: 3rem !important; }

.text-capitalize { text-transform: capitalize !important; }
.text-uppercase  { text-transform: uppercase !important; }
.text-lowercase  { text-transform: lowercase !important; }

.font-mono, .text-monospace { font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important; }

.text-decoration-none { text-decoration: none !important; }
.text-reset { color: inherit !important; }

/* Inline code */
code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: .875em;
  color: var(--primary);
  background: var(--surface-2);
  padding: .15em .4em;
  border-radius: var(--r-sm);
}
pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1rem;
  overflow-x: auto;
  font-size: .85rem;
}
pre code { background: none; padding: 0; }
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sizing */
.w-100  { width: 100% !important; }
.w-75   { width: 75% !important; }
.w-50   { width: 50% !important; }
.w-auto { width: auto !important; }
.w-sm   { min-width: 80px; }
.h-100  { height: 100% !important; }

/* Border */
.border         { border: 1px solid var(--border) !important; }
.border-top     { border-top: 1px solid var(--border) !important; }
.border-bottom  { border-bottom: 1px solid var(--border) !important; }
.border-0       { border: none !important; }
.border-primary { border-color: var(--primary) !important; }
.border-success { border-color: var(--success) !important; }
.border-warning { border-color: var(--warning) !important; }
.border-danger  { border-color: var(--danger) !important; }
.border-info    { border-color: var(--info) !important; }

/* Border radius */
.rounded       { border-radius: var(--r-md) !important; }
.rounded-sm    { border-radius: var(--r-sm) !important; }
.rounded-lg    { border-radius: var(--r-lg) !important; }
.rounded-xl    { border-radius: var(--r-xl) !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-0     { border-radius: 0 !important; }

/* Background */
.bg-white   { background: #fff !important; }
.bg-light   { background: var(--bg) !important; }
.bg-surface { background: var(--surface) !important; }
.bg-dark    { background: var(--t1) !important; }
.bg-transparent { background: transparent !important; }

/* Shadow */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow     { box-shadow: var(--shadow-md) !important; }
.shadow-lg  { box-shadow: var(--shadow-lg) !important; }
.shadow-none { box-shadow: none !important; }

/* Overflow */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto   { overflow: auto !important; }

/* Position */
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }

/* Cursor */
.cursor-pointer { cursor: pointer !important; }

/* Float */
.float-end   { float: right !important; }
.float-start { float: left !important; }

/* No-print utility */
@media print { .no-print { display: none !important; } }

/* ════════════════════════════════════════════════════════════════
   SIMPLEBAR OVERRIDE  (keep inner layout scrolling natural)
   ════════════════════════════════════════════════════════════════ */
[data-simplebar] { height: auto; }
.sidebar-scroll[data-simplebar] { height: 100%; }

/* ════════════════════════════════════════════════════════════════
   LOGIN / AUTH PAGE
   ════════════════════════════════════════════════════════════════ */
.auth-body {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

.auth-panel {
  display: flex;
  flex: 1;
}

/* Left hero panel */
.auth-hero {
  flex: 1;
  background: linear-gradient(145deg, #0C0D10 0%, #1A1428 50%, #0F1B2D 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
}
.auth-hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.15) 0%, transparent 70%);
  pointer-events: none;
}
.auth-hero::after {
  content: '';
  position: absolute;
  bottom: -15%;
  left: -10%;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,80,232,.12) 0%, transparent 70%);
  pointer-events: none;
}

.auth-hero-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  z-index: 1;
  position: relative;
}
.auth-hero-logo img {
  width: 42px; height: 42px;
  border-radius: var(--r-sm);
  object-fit: cover;
}
.auth-hero-logo-name {
  font-family: var(--ff-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}
.auth-hero-logo-name span { color: var(--gold); }

.auth-hero-center {
  z-index: 1;
  position: relative;
}
.auth-hero-title {
  font-family: var(--ff-display);
  font-size: 2.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.auth-hero-title span { color: var(--gold); }
.auth-hero-sub {
  font-size: 1rem;
  color: rgba(255,255,255,.55);
  max-width: 360px;
  line-height: 1.7;
}

.auth-hero-features {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  z-index: 1;
  position: relative;
}
.auth-feature {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: rgba(255,255,255,.05);
  border-radius: var(--r-md);
  border: 1px solid rgba(255,255,255,.07);
}
.auth-feature-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 1rem;
  flex-shrink: 0;
}
.auth-feature-text {
  font-size: .84rem;
  color: rgba(255,255,255,.65);
  font-weight: 500;
}

/* Right form panel */
.auth-form-panel {
  width: 440px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2.5rem;
  background: var(--surface);
  min-height: 100vh;
  box-shadow: -20px 0 60px rgba(0,0,0,.08);
}

.auth-form-inner {
  width: 100%;
  max-width: 360px;
}

.auth-form-header {
  margin-bottom: 2rem;
}
.auth-form-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: .4rem;
}
.auth-form-header p {
  color: var(--t3);
  font-size: .9rem;
}

.auth-form .form-label { font-size: .875rem; font-weight: 500; }
.auth-form .form-control {
  padding: .7rem 1rem;
  border-radius: var(--r-md);
}
.auth-form .form-group { margin-bottom: 1.1rem; }
.auth-form-submit {
  width: 100%;
  padding: .75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--r-md);
  margin-top: 1.5rem;
}

.auth-footer-note {
  text-align: center;
  color: var(--t4);
  font-size: .78rem;
  margin-top: 2rem;
}

/* Password toggle button */
.pw-toggle {
  position: absolute;
  right: .85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--t3);
  cursor: pointer;
  font-size: .95rem;
  padding: .2rem;
  transition: color var(--t-fast) var(--ease);
}
.pw-toggle:hover { color: var(--t1); }
.input-with-btn { position: relative; }
.input-with-btn .form-control { padding-right: 2.75rem; }

/* ════════════════════════════════════════════════════════════════
   CONTAINER
   ════════════════════════════════════════════════════════════════ */
.container-fluid {
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* ════════════════════════════════════════════════════════════════
   MISC UI ELEMENTS
   ════════════════════════════════════════════════════════════════ */

/* Avatar title (icon in circle) */
.avatar-title {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: .95rem;
}
.avatar-xs { width: 28px; height: 28px; font-size: .75rem; }
.avatar-sm { width: 36px; height: 36px; }
.avatar-md { width: 44px; height: 44px; font-size: 1.1rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.3rem; }

/* ── List Group ─────────────────────────────────────────────── */
.list-group { display: flex; flex-direction: column; border-radius: var(--r-md); }
.list-group-item {
  display: block;
  padding: .6rem .75rem;
  color: var(--t1);
  border: 1px solid var(--border);
  border-bottom: none;
  font-size: .875rem;
  background: var(--surface);
  text-decoration: none;
  transition: background var(--t-fast) var(--ease);
}
.list-group-item:first-child { border-radius: var(--r-md) var(--r-md) 0 0; }
.list-group-item:last-child  { border-bottom: 1px solid var(--border); border-radius: 0 0 var(--r-md) var(--r-md); }
.list-group-item:only-child  { border-radius: var(--r-md); }
.list-group-item-action:hover { background: var(--surface-2); color: var(--t1); }
.list-group-flush .list-group-item { border-left: none; border-right: none; border-radius: 0; }
.list-group-flush .list-group-item:first-child { border-top: none; }
.list-group-flush .list-group-item:last-child  { border-bottom: none; }

/* Divider */
.divider {
  position: relative;
  text-align: center;
  margin: 1rem 0;
}
.divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.divider span {
  position: relative;
  background: var(--surface);
  padding: 0 .75rem;
  font-size: .78rem;
  color: var(--t3);
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 1.2rem; height: 1.2rem;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Border helpers used by pages */
.border-0  { border: none !important; }

/* Align middle */
.align-middle { vertical-align: middle !important; }

/* ════════════════════════════════════════════════════════════════
   APEXCHARTS OVERRIDES
   ════════════════════════════════════════════════════════════════ */
.apexcharts-canvas { margin: 0 auto; }
.apexcharts-tooltip {
  border-radius: var(--r-md) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--t1) !important;
}
.apexcharts-gridline { stroke: var(--border) !important; }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet & Mobile
   ════════════════════════════════════════════════════════════════ */

/* ── Auth page: hide hero pane below 992px ─────────────────── */
@media (max-width: 991px) {
  .auth-hero { display: none; }
  .auth-form-panel {
    width: 100%;
    min-height: 100vh;
    box-shadow: none;
  }
}

/* ════════════════════════════════════════════════════════════════
   TABLET  (768px – 1199px)
   Sidebar collapses to icon-only (64 px) by default.
   Hamburger click brings out the full 252 px sidebar as an overlay.
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 1199px) and (min-width: 768px) {

  /* ── Icon-only sidebar ── */
  .app-sidebar {
    width: var(--sidebar-cw);
  }
  .app-sidebar .sidebar-brand-name,
  .app-sidebar .sidebar-link-text,
  .app-sidebar .sidebar-section,
  .app-sidebar .sidebar-arrow,
  .app-sidebar .sidebar-sub {
    display: none !important;
  }
  .app-sidebar .sidebar-link {
    padding: .6rem !important;
    margin: .1rem auto !important;
    justify-content: center !important;
    width: calc(var(--sidebar-cw) - 16px) !important;
  }
  .app-sidebar .sidebar-link i { width: auto !important; }

  /* ── Topbar & content align to icon-only width ── */
  .app-topbar  { left: var(--sidebar-cw) !important; }
  .app-content { margin-left: var(--sidebar-cw) !important; }

  /* ── Also override any stale sidebar-collapsed class from desktop ── */
  .app-layout.sidebar-collapsed .app-topbar  { left: var(--sidebar-cw) !important; }
  .app-layout.sidebar-collapsed .app-content { margin-left: var(--sidebar-cw) !important; }

  /* ── Full overlay when hamburger opens it ── */
  .app-sidebar.mobile-open {
    width: var(--sidebar-w) !important;
    box-shadow: var(--shadow-xl);
    z-index: calc(var(--z-sidebar) + 10);
  }
  .app-sidebar.mobile-open .sidebar-brand-name,
  .app-sidebar.mobile-open .sidebar-link-text,
  .app-sidebar.mobile-open .sidebar-section,
  .app-sidebar.mobile-open .sidebar-arrow {
    display: block !important;
    opacity: 1 !important;
    width: auto !important;
  }
  .app-sidebar.mobile-open .sidebar-sub.open { display: block !important; }
  .app-sidebar.mobile-open .sidebar-link {
    padding: .58rem 1.25rem !important;
    width: calc(100% - 1rem) !important;
    justify-content: space-between !important;
  }

  /* ── Page & card spacing on tablet ── */
  .page-content { padding: 1.25rem; }
  .card-body    { padding: 1rem; }

  /* ── Page header: allow action buttons to wrap ── */
  .page-header         { flex-wrap: wrap; }
  .page-header-actions { flex-wrap: wrap; }
  .page-title-box      { flex-wrap: wrap; }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE  (≤ 767px)
   Sidebar fully off-screen; hamburger shows it as full overlay.
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  :root {
    --topbar-h: 56px;
  }

  /* ── Sidebar: translate off-screen ── */
  .app-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
    z-index: calc(var(--z-sidebar) + 10);
  }
  .app-sidebar.mobile-open { transform: translateX(0); }

  /* Force full sidebar styles when open */
  .app-sidebar.mobile-open .sidebar-brand-name,
  .app-sidebar.mobile-open .sidebar-link-text,
  .app-sidebar.mobile-open .sidebar-section,
  .app-sidebar.mobile-open .sidebar-arrow {
    display: block !important;
    opacity: 1 !important;
    width: auto !important;
  }
  .app-sidebar.mobile-open .sidebar-link {
    padding: .58rem 1.25rem !important;
    width: calc(100% - 1rem) !important;
    justify-content: space-between !important;
  }

  /* ── Topbar & content: no sidebar offset ── */
  .app-topbar  { left: 0 !important; }
  .app-content { margin-left: 0 !important; width: 70% }

  /* ── Page spacing ── */
  .page-content { padding: 1rem; }

  /* ── Topbar: show avatar only (hide name + caret) ── */
  .topbar-user-btn .user-name,
  .topbar-user-btn .user-caret { display: none; }

  /* ── Dropdowns: clamp to viewport ── */
  .dropdown-menu { max-width: calc(100vw - 1.5rem); }
  .notif-dropdown {
    min-width: 0;
    width: min(340px, calc(100vw - 1.5rem));
    right: 0;
  }

  /* ── Page title ── */
  .page-title-box {
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
  }
  .page-title-box .d-flex.gap-2 { flex-wrap: wrap; }
  .page-header         { flex-direction: column; align-items: flex-start; }
  .page-header-actions { flex-wrap: wrap; }

  /* ── Breadcrumb: hide on small screens ── */
  .breadcrumb, ol.breadcrumb { display: none !important; }

  /* ── Cards ── */
  .card-body   { padding: 1rem; }
  .card-header { padding: .75rem 1rem; flex-wrap: wrap; gap: .5rem; }
  .card-footer { padding: .75rem 1rem; }

  /* ── Stat cards: 2-column grid ── */
  .row > .col-md-6.col-xl-3,
  .row > .col-md-6 { width: 50%; }

  /* ── Tables: tighter cells ── */
  .table th, .table td { padding: .5rem .65rem; font-size: .82rem; }
  .table-responsive { border-radius: 0; }

  /* Allow flex rows to wrap naturally on mobile instead of forcing column layout */
  .d-flex.justify-content-between { flex-wrap: wrap; gap: .5rem; }

  /* ── Pagination: touch-friendly ── */
  .pagination { flex-wrap: wrap; gap: .25rem; }
  .page-link  {
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ── Buttons: 38 px minimum touch target ── */
  .btn    { min-height: 38px; }
  .btn-sm { min-height: 34px; }

  /* ── btn-group: allow wrap ── */
  .btn-group     { flex-wrap: wrap; }
  .btn-group .btn {
    border-radius: var(--r-sm) !important;
    border: 1px solid var(--border-strong) !important;
  }

  /* ── Forms ── */
  .form-control, .form-select { width: 100%; }
  .filter-bar .form-control,
  .filter-bar .form-select { max-width: 100%; flex: 1 0 140px; }

  /* ── Alert ── */
  .alert { flex-wrap: wrap; word-break: break-word; }

  /* ── Modals: sheet from bottom ── */
  .modal-backdrop { padding: .5rem; align-items: flex-end; }
  .modal-dialog {
    max-width: 100%;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 92vh;
  }
  .modal-body { padding: 1.1rem; }
  .modal-header, .modal-footer { padding: 1rem 1.1rem; }

  /* ── Toast: full width, below topbar ── */
  #toast-container {
    left: .75rem;
    right: .75rem;
    top: calc(var(--topbar-h) + .5rem);
    max-width: 100%;
  }

  /* ── App footer ── */
  .app-footer {
    text-align: center;
    font-size: .8rem;
    padding: .75rem 1rem;
    flex-direction: column;
    gap: .25rem;
  }

  /* Inline summary text above tables */
  .card-title.mb-0 + span.text-muted { display: block; margin-top: .25rem; }

  /* ── Stat value: scale down so long naira amounts don't overflow 50%-width cards ── */
  .stat-value { font-size: 1.35rem; }

  /* ── Float-end inside card body: drop the float so it stacks above the title ── */
  .card-body > .float-end {
    float: none !important;
    display: block;
    margin-bottom: .65rem;
  }

  /* ── Chart summary list: allow items to wrap gracefully ── */
  .main-chart.list-inline { flex-wrap: wrap; row-gap: .25rem; }
  .main-chart h3 { font-size: 1rem; }
  .main-chart .list-inline-item { border-left: none !important; padding-left: 0 !important; }

  /* ── iOS Safari: prevent page zoom when tapping form inputs (requires font-size ≥ 16px) ── */
  .form-control,
  .form-select,
  .form-control-sm,
  .form-select-sm { font-size: 16px; }

  /* ── Touch targets: Apple HIG recommends ≥ 44px height for interactive elements ── */
  .form-control, .form-select { min-height: 44px; }
  .form-control-sm, .form-select-sm { min-height: 40px; }

  /* ── Better tap responsiveness on buttons and links ── */
  .btn, a, button, .sidebar-link { touch-action: manipulation; }
}

/* ════════════════════════════════════════════════════════════════
   SMALL PHONES  (≤ 575px)
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 575px) {
  .page-content { padding: .75rem; }

  /* ── Stat cards: tighter ── */
  .stat-card  { padding: .9rem; gap: .7rem; }
  .stat-icon  { width: 40px; height: 40px; font-size: 1.1rem; }
  .stat-value { font-size: 1.15rem; }

  /* ── Tables ── */
  .table th, .table td { padding: .4rem .5rem; font-size: .78rem; }

  /* ── Cards ── */
  .card-body   { padding: .75rem; }
  .card-header { padding: .65rem .75rem; }

  /* ── Page title ── */
  .page-title-box { flex-direction: column; align-items: flex-start; }
  .page-title-box h4 { font-size: 1rem; }

  /* ── Badges ── */
  .badge { font-size: .7rem; padding: .25em .5em; }

  /* ── btn-group preset buttons: flex fill ── */
  .btn-group.btn-group-sm { width: 100%; }
  .btn-group.btn-group-sm .btn { flex: 1 1 auto; }

  /* ── Notification dropdown: near-fullscreen ── */
  .notif-dropdown {
    position: fixed;
    left: .75rem !important;
    right: .75rem !important;
    width: auto !important;
    top: calc(var(--topbar-h) + .5rem);
  }

  /* ── Modals ── */
  .modal-dialog { max-height: 96vh; }

  /* ── Input groups: stack on tiny screens ── */
  .input-group { flex-wrap: wrap; }
  .input-group > * { border-radius: var(--r-md) !important; width: 100%; }
  .input-group > *:not(:last-child) { margin-bottom: .25rem; }

  /* ── Stat cards: single column so long naira values have full width ── */
  .row > .col-md-6.col-xl-3,
  .row > .col-md-6 { width: 100%; }
}

/* ════════════════════════════════════════════════════════════════
   EXTRA SMALL  (≤ 400px)  — iPhone SE, Galaxy A03, very narrow
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 400px) {
  .page-content { padding: .5rem; }
  .card-body    { padding: .625rem; }
  .card-header  { padding: .5rem .625rem; }

  /* Topbar: tighter spacing */
  .app-topbar { padding: 0 .75rem; }
  .topbar-hamburger { width: 34px; height: 34px; }

  /* Stat value: absolute minimum */
  .stat-value { font-size: 1.05rem; }
  .stat-icon  { width: 36px; height: 36px; font-size: 1rem; }

  /* Buttons: allow text to wrap */
  .btn { white-space: normal; }

  /* Hide user name on topbar even if not already hidden */
  .user-name, .user-caret { display: none !important; }

  /* Table cells: ultra-compact */
  .table th, .table td { padding: .3rem .4rem; font-size: .75rem; }

  /* Badge: smaller */
  .badge { font-size: .65rem; padding: .2em .45em; }
}

/* ════════════════════════════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.animate-in { animation: fadeIn var(--t-std) var(--ease) both; }

/* Stagger for list items */
.stagger > * { animation: fadeIn var(--t-std) var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .04s; }
.stagger > *:nth-child(2) { animation-delay: .08s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .16s; }

/* ════════════════════════════════════════════════════════════════
   PROGRESS BAR
   ════════════════════════════════════════════════════════════════ */
.progress {
  height: 8px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--primary);
  transition: width .6s var(--ease);
}
.progress-bar.bg-primary  { background: var(--primary); }
.progress-bar.bg-success  { background: var(--success); }
.progress-bar.bg-warning  { background: var(--warning); }
.progress-bar.bg-danger   { background: var(--danger); }
.progress-bar.bg-info     { background: var(--info); }

/* ════════════════════════════════════════════════════════════════
   SPINNER
   ════════════════════════════════════════════════════════════════ */
.spinner-border {
  display: inline-block;
  width: 2rem; height: 2rem;
  border: .22em solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
.spinner-border-sm { width: 1.1rem; height: 1.1rem; border-width: .18em; }
.spinner-border.text-primary { border-top-color: var(--primary); }
.spinner-border.text-success { border-top-color: var(--success); }
.spinner-border.text-warning { border-top-color: var(--warning); }
.spinner-border.text-danger  { border-top-color: var(--danger); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ════════════════════════════════════════════════════════════════
   BUTTON GROUP
   ════════════════════════════════════════════════════════════════ */
.btn-group {
  display: inline-flex;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border-strong);
}
.btn-group .btn {
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--border-strong);
}
.btn-group .btn:last-child { border-right: none; }
.btn-group-sm .btn { padding: .28rem .65rem; font-size: .8rem; }

/* ════════════════════════════════════════════════════════════════
   LIST HELPERS
   ════════════════════════════════════════════════════════════════ */
.list-inline      { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; padding: 0; margin: 0; }
.list-inline-item { display: inline-flex; align-items: center; }
.list-unstyled    { list-style: none; padding: 0; margin: 0; }
.main-chart .list-inline-item { border-left: 2px solid var(--border); padding-left: 1rem; }
.main-chart .list-inline-item:first-child { border-left: none; padding-left: 0; }
.main-chart h3 { font-size: 1.25rem; margin: 0; display: flex; align-items: center; gap: .5rem; }

/* ════════════════════════════════════════════════════════════════
   TYPOGRAPHY HELPERS (missing)
   ════════════════════════════════════════════════════════════════ */
.fst-italic  { font-style: italic !important; }
.fs-6        { font-size: .9rem !important; }
.fs-5        { font-size: 1.1rem !important; }
.lh-1        { line-height: 1 !important; }
.text-sm-end { text-align: right !important; }
.text-nowrap { white-space: nowrap !important; }

/* ── Responsive text alignment ─────────────────────────────── */
@media (min-width: 768px) {
  .text-md-start { text-align: left !important; }
  .text-md-center { text-align: center !important; }
  .text-md-end { text-align: right !important; }
}
@media (min-width: 992px) {
  .text-lg-start { text-align: left !important; }
  .text-lg-center { text-align: center !important; }
  .text-lg-end { text-align: right !important; }
}

/* ── Responsive flex direction ──────────────────────────────── */
@media (min-width: 576px) {
  .flex-sm-row    { flex-direction: row !important; }
  .flex-sm-column { flex-direction: column !important; }
  .flex-sm-wrap   { flex-wrap: wrap !important; }
  .flex-sm-nowrap { flex-wrap: nowrap !important; }
}
@media (min-width: 768px) {
  .flex-md-row    { flex-direction: row !important; }
  .flex-md-column { flex-direction: column !important; }
  .flex-md-wrap   { flex-wrap: wrap !important; }
  .flex-md-nowrap { flex-wrap: nowrap !important; }
}
@media (min-width: 992px) {
  .flex-lg-row    { flex-direction: row !important; }
  .flex-lg-column { flex-direction: column !important; }
  .flex-lg-wrap   { flex-wrap: wrap !important; }
  .flex-lg-nowrap { flex-wrap: nowrap !important; }
}

/* ── Responsive gap ─────────────────────────────────────────── */
@media (min-width: 768px) {
  .gap-md-0 { gap: 0 !important; }
  .gap-md-2 { gap: .5rem !important; }
  .gap-md-3 { gap: .75rem !important; }
  .gap-md-4 { gap: 1rem !important; }
}

/* ── Responsive justify/align ───────────────────────────────── */
@media (min-width: 768px) {
  .justify-content-md-start   { justify-content: flex-start !important; }
  .justify-content-md-end     { justify-content: flex-end !important; }
  .justify-content-md-center  { justify-content: center !important; }
  .justify-content-md-between { justify-content: space-between !important; }
  .align-items-md-center      { align-items: center !important; }
  .align-items-md-start       { align-items: flex-start !important; }
  .align-items-md-end         { align-items: flex-end !important; }
}
@media (min-width: 992px) {
  .justify-content-lg-start   { justify-content: flex-start !important; }
  .justify-content-lg-end     { justify-content: flex-end !important; }
  .justify-content-lg-between { justify-content: space-between !important; }
  .align-items-lg-center      { align-items: center !important; }
}

/* ── Responsive margin/padding ──────────────────────────────── */
@media (max-width: 767px) {
  .mb-mobile-2 { margin-bottom: .5rem !important; }
  .mb-mobile-3 { margin-bottom: .75rem !important; }
  .p-mobile-0  { padding: 0 !important; }
  .ms-mobile-0 { margin-left: 0 !important; }
  .me-mobile-0 { margin-right: 0 !important; }
}

/* ── Width utilities ────────────────────────────────────────── */
@media (min-width: 768px) {
  .w-md-auto { width: auto !important; }
  .w-md-50   { width: 50% !important; }
  .w-md-75   { width: 75% !important; }
  .w-md-100  { width: 100% !important; }
}

/* ── Ensure col-xl-* columns span full width below xl ────────
   (When no md/lg class is provided, columns fill the row.) */
@media (max-width: 1199px) {
  .col-xl-1:not([class*="col-md"]):not([class*="col-lg"]):not([class*="col-sm"]),
  .col-xl-2:not([class*="col-md"]):not([class*="col-lg"]):not([class*="col-sm"]),
  .col-xl-3:not([class*="col-md"]):not([class*="col-lg"]):not([class*="col-sm"]),
  .col-xl-4:not([class*="col-md"]):not([class*="col-lg"]):not([class*="col-sm"]),
  .col-xl-5:not([class*="col-md"]):not([class*="col-lg"]):not([class*="col-sm"]),
  .col-xl-6:not([class*="col-md"]):not([class*="col-lg"]):not([class*="col-sm"]),
  .col-xl-7:not([class*="col-md"]):not([class*="col-lg"]):not([class*="col-sm"]),
  .col-xl-8:not([class*="col-md"]):not([class*="col-lg"]):not([class*="col-sm"]),
  .col-xl-9:not([class*="col-md"]):not([class*="col-lg"]):not([class*="col-sm"]),
  .col-xl-10:not([class*="col-md"]):not([class*="col-lg"]):not([class*="col-sm"]),
  .col-xl-11:not([class*="col-md"]):not([class*="col-lg"]):not([class*="col-sm"]) {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ════════════════════════════════════════════════════════════════
   TABLE — additional helpers
   ════════════════════════════════════════════════════════════════ */
.table-centered td,
.table-centered th { vertical-align: middle; text-align: center; }
.table-nowrap td,
.table-nowrap th  { white-space: nowrap; }

/* ════════════════════════════════════════════════════════════════
   NAV (tab aliases)
   ════════════════════════════════════════════════════════════════ */
.nav          { display: flex; flex-wrap: wrap; gap: .1rem; padding: 0; margin: 0; list-style: none; }
.nav-link     { display: flex; align-items: center; gap: .4rem; padding: .55rem .9rem;
                color: var(--t3); font-size: .875rem; font-weight: 500; text-decoration: none;
                border-radius: var(--r-sm); transition: all var(--t-fast) var(--ease); cursor: pointer; border: none; background: none; }
.nav-link:hover { background: var(--bg); color: var(--t1); }
.nav-link.active { color: var(--primary); font-weight: 600; }
.nav-item     { display: flex; }

/* ════════════════════════════════════════════════════════════════
   PRINT — GENERAL  (hides portal chrome)
   ════════════════════════════════════════════════════════════════ */
@media print {
  .app-sidebar,
  .app-topbar,
  .app-footer,
  .sidebar-overlay,
  .no-print { display: none !important; }

  .app-layout { display: block !important; }
  .app-content { margin: 0 !important; padding: 0 !important; width: 100% !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; }
}

/* ════════════════════════════════════════════════════════════════
   PRINT — POS RECEIPT (80mm thermal paper)
   Used by: invoice detail, payment detail pages
   Activate by adding class="pos-receipt" to body or wrapper
   ════════════════════════════════════════════════════════════════ */
/* POS receipt @page rule is set per-page in inline styles so we
   can choose A4 for reports or 80mm for receipts. */

/* ════════════════════════════════════════════════════════════════
   RECEIPT COMPONENT STYLES  (used inside .receipt-print wrapper)
   ════════════════════════════════════════════════════════════════ */
.receipt-print {
  max-width: 72mm;
  margin: 0 auto;
  background: #fff;
  color: #000;
  font-family: 'Courier New', Courier, monospace;
  font-size: 8.5pt;
  line-height: 1.4;
}
.receipt-print .receipt-brand {
  text-align: center;
  font-size: 12pt;
  font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 2pt;
}
.receipt-print .receipt-sub {
  text-align: center;
  font-size: 7.5pt;
  color: #444;
  margin-bottom: 4pt;
}
.receipt-print .receipt-divider {
  border: none;
  border-top: 1px dashed #666;
  margin: 4pt 0;
}
.receipt-print .receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 8pt;
  margin-bottom: 1pt;
}
.receipt-print .receipt-row-bold {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 9pt;
  margin-top: 2pt;
}
.receipt-print .receipt-items th {
  font-size: 7pt;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid #ccc;
  padding: 2pt 3pt;
}
.receipt-print .receipt-items td {
  font-size: 7.5pt;
  padding: 1.5pt 3pt;
  border: none;
  vertical-align: top;
}
.receipt-print .receipt-total {
  font-weight: 700;
  font-size: 11pt;
  text-align: right;
  margin-top: 4pt;
  border-top: 2px solid #000;
  padding-top: 3pt;
}
.receipt-print .receipt-footer {
  text-align: center;
  font-size: 7.5pt;
  color: #555;
  margin-top: 6pt;
  border-top: 1px dashed #999;
  padding-top: 4pt;
}

@media print {
  .receipt-print { max-width: 100%; }
  .receipt-print .receipt-items td,
  .receipt-print .receipt-items th {
    border: none !important;
    background: transparent !important;
  }
}
