/* ================================================================
   VSV ERP · v7.0 — Modern SaaS UI
   Inspired by Zoho / ClickUp / Freshworks
   Clean · Light · Professional · India ERP standard
   ================================================================ */

:root {
  /* Surfaces */
  --bg:       #f0f4f8;
  --surface:  #ffffff;
  --s2:       #f8fafc;
  --s3:       #f1f5f9;
  --s4:       #e8eef7;
  /* Borders */
  --border:   #e2e8f0;
  --border2:  #cbd5e1;
  /* Text */
  --tx:       #0f172a;
  --tx2:      #334155;
  --tx3:      #64748b;
  --tx4:      #94a3b8;
  /* Brand */
  --brand:    #4361ee;
  --brand-h:  #3451d1;
  --brand-bg: #eef1fd;
  --brand-bd: #c5cdfa;
  /* Status */
  --green:    #059669; --green-bg: #ecfdf5; --green-bd: #a7f3d0;
  --amber:    #d97706; --amber-bg: #fffbeb; --amber-bd: #fde68a;
  --red:      #dc2626; --red-bg:   #fef2f2; --red-bd:   #fecaca;
  --blue-bg:  #eff6ff; --blue-bd:  #bfdbfe;
  --purple:   #7c3aed; --purple-bg:#f5f3ff; --purple-bd:#ddd6fe;
  --teal:     #0d9488; --teal-bg:  #f0fdfa; --teal-bd:  #99f6e4;
  --orange:   #ea580c; --orange-bg:#fff7ed; --orange-bd:#fed7aa;
  /* Layout */
  --sidebar-w: 256px;
  --topbar-h:  62px;
  /* Shape */
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-full: 9999px;
  /* Shadows */
  --sh-xs: 0 1px 2px rgba(0,0,0,.05);
  --sh-sm: 0 1px 4px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --sh:    0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --sh-lg: 0 16px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --sh-xl: 0 24px 60px rgba(0,0,0,.15);
}

/* ── Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; min-width: 0; }
html { font-size: 14px; scroll-behavior: smooth; overflow-x: hidden; }
body {
  background: var(--bg); color: var(--tx);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-h); text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: 13px; }
button { cursor: pointer; }
::selection { background: rgba(67,97,238,.2); }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); background: #0f172a;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo {
  height: var(--topbar-h); padding: 0 18px;
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #4361ee, #3451d1);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; color: #fff;
  box-shadow: 0 2px 10px rgba(67,97,238,.45);
}
.logo-title { font-weight: 700; font-size: 14px; color: #f1f5f9; letter-spacing: -.2px; }
.logo-sub   { font-size: 10px; color: #6b7280; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 6px 0 16px;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }
/* Also support .sidebar-scroll as alias */
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 6px 0 16px; }
.sidebar-scroll::-webkit-scrollbar { width: 3px; }
/* Nav groups */
.nav-group, .nav-section {
  padding: 16px 16px 4px;
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #4b5563;
  display: flex; align-items: center; gap: 8px;
}
.nav-group::after, .nav-section::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.06);
}
/* Nav items */
.nav-item, .nav-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; margin: 1px 8px; border-radius: 8px;
  color: #94a3b8; font-size: 12.5px; font-weight: 500;
  transition: all .15s; position: relative; cursor: pointer;
}
.nav-item svg, .nav-link svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .7; transition: opacity .15s; }
.nav-item:hover, .nav-link:hover { background: rgba(255,255,255,.08); color: #f1f5f9; }
.nav-item:hover svg, .nav-link:hover svg { opacity: 1; }
.nav-item.active, .nav-link.active {
  background: rgba(67,97,238,.18); color: #93c5fd; font-weight: 600;
}
.nav-item.active::before, .nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 5px; bottom: 5px;
  width: 3px; border-radius: 0 3px 3px 0; background: #4361ee;
}
.nav-item.active svg, .nav-link.active svg { opacity: 1; color: #93c5fd; }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px;
  background: #dc2626; color: #fff; font-size: 10px; padding: 0 5px;
  border-radius: var(--r-full); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge { 0%,100% { opacity:1; } 50% { opacity:.7; } }
/* Sidebar footer / user */
.sidebar-footer, .sidebar-user { padding: 10px; border-top: 1px solid rgba(255,255,255,.07); flex-shrink: 0; }
.user-card, .sidebar-user-inner {
  display: flex; align-items: center; gap: 9px;
  padding: 8px; border-radius: 8px; cursor: pointer; transition: background .15s;
}
.user-card:hover, .sidebar-user-inner:hover { background: rgba(255,255,255,.07); }
.user-avatar, .u-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #4361ee, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.user-name, .u-name { font-size: 12px; font-weight: 600; color: #f3f4f6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role, .u-role { font-size: 10px; color: #6b7280; text-transform: capitalize; margin-top: 1px; }
.logout-btn, .u-logout {
  margin-left: auto; color: #4b5563; background: none; border: none;
  padding: 5px; border-radius: 6px; cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.logout-btn:hover, .u-logout:hover { color: #f87171; background: rgba(220,38,38,.12); }
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 199; backdrop-filter: blur(3px);
}

/* ── Main layout ──────────────────────────────────────── */
.main-wrap { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; max-width: 100%; }

/* ── Topbar ───────────────────────────────────────────── */
.topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  height: var(--topbar-h); display: flex; align-items: center;
  padding: 0 24px; gap: 12px; position: sticky; top: 0; z-index: 100;
  box-shadow: var(--sh-xs);
}
.menu-toggle, .menu-btn {
  display: none !important; background: none; border: none;
  color: var(--tx3); padding: 7px; border-radius: 8px; cursor: pointer;
}
.menu-toggle:hover, .menu-btn:hover { background: var(--s3); color: var(--tx); }
.topbar-breadcrumb, .breadcrumb {
  flex: 1; display: flex; align-items: center; gap: 5px;
  font-size: 13px; color: var(--tx4); overflow: hidden;
}
.crumb-section, .bc-parent { white-space: nowrap; }
.crumb-sep, .bc-sep { opacity: .4; font-size: 11px; margin: 0 2px; }
.crumb-cur, .bc-cur { color: var(--tx); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right, .topbar-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
/* Notif button */
.icon-btn, .notif-btn {
  width: 36px; height: 36px; border-radius: var(--r);
  background: var(--s2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--tx3); cursor: pointer; transition: all .15s; position: relative;
}
.icon-btn:hover, .notif-btn:hover { background: var(--s3); color: var(--tx); border-color: var(--border2); }
.notif-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; background: #dc2626; border-radius: 50%; border: 2px solid #fff; }
/* Notif panel */
.notif-panel, .np-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: 350px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg); z-index: 9000; display: none; overflow: hidden;
}
.notif-header, .np-header {
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
  background: var(--s2); border-bottom: 1px solid var(--border);
}
.notif-title, .np-title { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.notif-item, .np-item {
  display: flex; gap: 10px; padding: 11px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s;
}
.notif-item:hover, .np-item:hover { background: var(--s2); }
.notif-item.unread, .np-item.unread { background: #f0f5ff; }
.notif-icon, .np-icon {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px; background: var(--s3);
}
.notif-body-text, .np-text { font-size: 12px; line-height: 1.5; color: var(--tx3); }
.notif-body-text strong, .np-text strong { color: var(--tx); }
.notif-time, .np-time { font-size: 10px; color: var(--tx4); margin-top: 2px; }
.notif-empty, .np-empty { padding: 28px; text-align: center; color: var(--tx4); font-size: 13px; }
/* Profile dropdown */
.profile-dropdown { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: var(--r); border: 1px solid var(--border);
  background: #fff; cursor: pointer; transition: all .15s;
}
.profile-btn:hover, .profile-btn.open { background: var(--s2); border-color: var(--border2); }
.p-avatar, .p-av {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #4361ee, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.p-name, .p-nm { font-size: 12px; font-weight: 500; color: var(--tx); white-space: nowrap; }
.p-caret, .p-cr { color: var(--tx4); transition: transform .2s; flex-shrink: 0; }
.profile-btn.open .p-caret, .profile-btn.open .p-cr { transform: rotate(180deg); }
.profile-menu {
  position: absolute; top: calc(100% + 8px); right: 0; width: 240px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg); z-index: 9000; display: none; overflow: hidden;
}
.profile-menu-header, .pm-header {
  padding: 14px 16px; background: linear-gradient(135deg, var(--brand-bg), #f5f3ff);
  border-bottom: 1px solid var(--border);
}
.profile-menu-name, .pm-name { font-weight: 600; font-size: 13px; }
.profile-menu-email, .pm-email { font-size: 11px; color: var(--tx4); margin-top: 2px; }
.profile-menu-item, .pm-item {
  display: flex; align-items: center; gap: 9px; padding: 10px 16px;
  color: var(--tx2); font-size: 13px; cursor: pointer;
  transition: background .12s; border: none; background: none; width: 100%;
}
.profile-menu-item:hover, .pm-item:hover { background: var(--s2); color: var(--tx); }
.profile-menu-item.danger, .pm-item.pm-danger { color: var(--red); }
.profile-menu-item.danger:hover, .pm-item.pm-danger:hover { background: var(--red-bg); }
.profile-menu-divider, .pm-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Page ─────────────────────────────────────────────── */
.page-content { padding: 24px; flex: 1; max-width: 100%; overflow-x: hidden; }

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-sm);
}
.card-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.card-title { font-weight: 600; font-size: 14px; color: var(--tx); display: flex; align-items: center; gap: 8px; }
.card-title svg { color: var(--brand); opacity: .8; }
.card-sub, .card-subtitle { font-size: 12px; color: var(--tx4); margin-top: 2px; }
.card-body { padding: 20px; }
.card-body-sm { padding: 14px 18px; }
.card-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  background: var(--s2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* ── KPI Cards ────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--brand); border-radius: var(--r-lg);
  padding: 20px; cursor: pointer; transition: all .2s; box-shadow: var(--sh-sm);
}
.kpi-card.blue   { border-left-color: #4361ee; }
.kpi-card.c-blue { border-left-color: #4361ee; }
.kpi-card.green  { border-left-color: #059669; }
.kpi-card.c-green{ border-left-color: #059669; }
.kpi-card.amber  { border-left-color: #d97706; }
.kpi-card.c-amber{ border-left-color: #d97706; }
.kpi-card.purple { border-left-color: #7c3aed; }
.kpi-card.c-purple{border-left-color: #7c3aed; }
.kpi-card.teal   { border-left-color: #0d9488; }
.kpi-card.c-teal { border-left-color: #0d9488; }
.kpi-card.red    { border-left-color: #dc2626; }
.kpi-card.c-red  { border-left-color: #dc2626; }
.kpi-card.orange { border-left-color: #ea580c; }
.kpi-card.c-orange{border-left-color: #ea580c; }
.kpi-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--sh); }
.kpi-card:hover { text-decoration: none; color: inherit; }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.kpi-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.kpi-icon.blue, .kpi-icon.i-blue   { background: var(--brand-bg); color: var(--brand); }
.kpi-icon.green, .kpi-icon.i-green { background: var(--green-bg); color: var(--green); }
.kpi-icon.amber, .kpi-icon.i-amber { background: var(--amber-bg); color: var(--amber); }
.kpi-icon.purple,.kpi-icon.i-purple{ background: var(--purple-bg);color: var(--purple);}
.kpi-icon.teal, .kpi-icon.i-teal   { background: var(--teal-bg);  color: var(--teal);  }
.kpi-icon.red,  .kpi-icon.i-red    { background: var(--red-bg);   color: var(--red);   }
.kpi-icon.orange,.kpi-icon.i-orange{ background: var(--orange-bg);color: var(--orange);}
.kpi-trend, .kpi-delta {
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: var(--r-full);
  display: flex; align-items: center; gap: 2px; white-space: nowrap;
}
.kpi-trend.up, .kpi-delta.up     { background: var(--green-bg); color: var(--green); }
.kpi-trend.down, .kpi-delta.down { background: var(--red-bg);   color: var(--red);   }
.kpi-val   { font-size: 26px; font-weight: 700; letter-spacing: -.6px; line-height: 1.15; color: var(--tx); }
.kpi-label { font-size: 12px; color: var(--tx4); font-weight: 500; margin-top: 4px; }
.kpi-foot  { font-size: 11px; color: var(--tx4); margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }

/* ── Stat strip / chips ───────────────────────────────── */
.stat-strip {
  display: flex; border-radius: var(--r-lg); overflow: hidden;
  margin-bottom: 16px; box-shadow: var(--sh-sm); border: 1px solid var(--border);
}
.stat-item {
  flex: 1 1 0; background: var(--surface); padding: 14px 16px;
  text-align: center; cursor: pointer; transition: background .15s;
  border-right: 1px solid var(--border); position: relative;
}
.stat-item:last-child { border-right: none; }
.stat-item:hover { background: var(--s2); }
.stat-item::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-item:nth-child(1)::before { background: #4361ee; }
.stat-item:nth-child(2)::before { background: #059669; }
.stat-item:nth-child(3)::before { background: #0d9488; }
.stat-item:nth-child(4)::before { background: #d97706; }
.stat-item:nth-child(5)::before { background: #7c3aed; }
.stat-item:nth-child(6)::before { background: #dc2626; }
.stat-val   { font-size: 20px; font-weight: 700; color: var(--tx); letter-spacing: -.4px; line-height: 1.2; }
.stat-label { font-size: 10px; color: var(--tx4); margin-top: 2px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
/* Chips (new style) */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-chip {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
  cursor: pointer; transition: all .15s; flex: 1 1 130px; min-width: 0;
}
.stat-chip:hover { border-color: var(--border2); box-shadow: var(--sh); }
.stat-chip-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-chip-val   { font-size: 20px; font-weight: 700; color: var(--tx); letter-spacing: -.4px; line-height: 1; }
.stat-chip-label { font-size: 10px; color: var(--tx4); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* ── Tables ───────────────────────────────────────────── */
.table-wrap, .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table-wrap::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar { height: 5px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  font-size: 11px; font-weight: 600; color: var(--tx3);
  text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 14px; text-align: left; white-space: nowrap;
  background: var(--s2); border-bottom: 1px solid var(--border);
}
.tbl thead th.sortable, .tbl thead th.sort { cursor: pointer; user-select: none; }
.tbl thead th.sortable:hover, .tbl thead th.sort:hover { color: var(--brand); }
.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover td { background: #f7f9ff; }
.tbl-compact td, .tbl-sm td { padding: 8px 12px; }
.tbl .actions, .tbl .act { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; }
.row-danger  td:first-child { border-left: 3px solid var(--red); }
.row-warn    td:first-child { border-left: 3px solid var(--amber); }
.row-warning td:first-child { border-left: 3px solid var(--amber); }
.row-ok      td:first-child { border-left: 3px solid var(--green); }
.row-success td:first-child { border-left: 3px solid var(--green); }
.expiry-overdue td:first-child { border-left: 3px solid var(--red); }
.expiry-warning td:first-child { border-left: 3px solid var(--amber); }

/* ── Bulk bar ─────────────────────────────────────────── */
.bulk-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px;
  background: linear-gradient(to right, #f0f5ff, var(--s2));
  border-bottom: 1px solid var(--brand-bd); flex-wrap: wrap;
}
.bulk-bar input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; }
.bulk-label { font-size: 12px; font-weight: 500; color: var(--tx2); cursor: pointer; }

/* ── Filter bar ───────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--s2);
}
.search-wrap, .filter-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 8px 12px;
  min-width: 200px; flex: 1; max-width: 280px; transition: border-color .15s, box-shadow .15s;
}
.search-wrap:focus-within, .filter-search:focus-within {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(67,97,238,.1);
}
.search-wrap svg, .filter-search svg { color: var(--tx4); flex-shrink: 0; }
.search-wrap input, .filter-search input {
  background: none; border: none; outline: none;
  color: var(--tx); font-size: 13px; flex: 1; min-width: 0; width: 100%;
}
.search-wrap input::placeholder, .filter-search input::placeholder { color: var(--tx4); }
.filter-select {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); color: var(--tx2);
  padding: 8px 28px 8px 10px; font-size: 12px; cursor: pointer;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  transition: border-color .15s;
}
.filter-select:focus { outline: none; border-color: var(--brand); }
.filter-spacer, .fs { flex: 1; }

/* ── Badges ───────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-dot::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-success , .badge-ok       { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-bd); }
.badge-danger  , .badge-error    { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-bd);   }
.badge-warning                   { background: var(--amber-bg);  color: var(--amber);  border: 1px solid var(--amber-bd); }
.badge-primary , .badge-info     { background: var(--brand-bg);  color: var(--brand);  border: 1px solid var(--brand-bd); }
.badge-purple                    { background: var(--purple-bg); color: var(--purple); border: 1px solid var(--purple-bd);}
.badge-teal                      { background: var(--teal-bg);   color: var(--teal);   border: 1px solid var(--teal-bd);  }
.badge-orange                    { background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange-bd);}
.badge-secondary,.badge-neutral  { background: var(--s3);        color: var(--tx4);    border: 1px solid var(--border);   }
/* Pills for verification */
.pill-verified, .pill-ok         { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 2px 8px; border-radius: var(--r-full); font-weight: 600; background: var(--green-bg); color: var(--green); }
.pill-unverified, .pill-warn     { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 2px 8px; border-radius: var(--r-full); font-weight: 600; background: var(--amber-bg); color: var(--amber); }
.pill-missing, .pill-bad         { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 2px 8px; border-radius: var(--r-full); font-weight: 600; background: var(--red-bg); color: var(--red); }
/* Inline verified/unverified spans */
span.verified   { color: var(--green); font-weight: 600; font-size: 12px; }
span.unverified { color: var(--amber); font-weight: 600; font-size: 12px; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 16px; border-radius: var(--r);
  font-size: 13px; font-weight: 500; border: none; cursor: pointer;
  transition: all .15s; white-space: nowrap; text-decoration: none; flex-shrink: 0; line-height: 1;
}
.btn:active { transform: scale(.97); }
.btn:hover  { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn svg { flex-shrink: 0; }
.btn-primary  { background: #4361ee; color: #fff; box-shadow: 0 2px 8px rgba(67,97,238,.3); }
.btn-primary:hover { background: #3451d1; box-shadow: 0 4px 14px rgba(67,97,238,.4); }
.btn-success  { background: #059669; color: #fff; box-shadow: 0 2px 6px rgba(5,150,105,.25); }
.btn-success:hover { background: #047857; }
.btn-danger   { background: #dc2626; color: #fff; box-shadow: 0 2px 6px rgba(220,38,38,.25); }
.btn-danger:hover  { background: #b91c1c; }
.btn-warning  { background: #d97706; color: #fff; box-shadow: 0 2px 6px rgba(217,119,6,.2); }
.btn-warning:hover { background: #b45309; }
.btn-purple   { background: #7c3aed; color: #fff; }
.btn-purple:hover  { background: #6d28d9; }
.btn-teal     { background: #0d9488; color: #fff; }
.btn-teal:hover    { background: #0f766e; }
.btn-ghost    { background: var(--surface); color: var(--tx2); border: 1px solid var(--border); }
.btn-ghost:hover   { background: var(--s2); color: var(--tx); border-color: var(--border2); }
.btn-light    { background: var(--s2); color: var(--tx2); border: 1px solid var(--border); }
.btn-light:hover   { background: var(--s3); color: var(--tx); }
.btn-link     { background: transparent; color: var(--brand); padding: 4px 6px; border: none; }
.btn-link:hover    { color: var(--brand-h); background: var(--brand-bg); }
.btn-sm  { padding: 5px 10px; font-size: 12px; gap: 4px; border-radius: 8px; }
.btn-lg  { padding: 11px 22px; font-size: 14px; font-weight: 600; }
.btn-icon{ width: 32px; height: 32px; padding: 0; border-radius: var(--r); }
.btn-icon.btn-sm { width: 28px; height: 28px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ── Forms ────────────────────────────────────────────── */
.form-grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.form-group  { display: flex; flex-direction: column; gap: 5px; }
.form-group.full   { grid-column: 1 / -1; }
.form-group.span-2 { grid-column: span 2; }
.form-label, .label {
  font-size: 12px; font-weight: 600; color: var(--tx2);
  display: flex; align-items: center; gap: 5px; line-height: 1.4;
}
.form-label svg, .label svg { color: var(--brand); opacity: .75; flex-shrink: 0; }
.form-label .req, .label .req { color: var(--red); font-size: 13px; line-height: 1; }
.input-wrap  { position: relative; display: flex; align-items: center; }
.input-icon, .input-ico { position: absolute; left: 10px; color: var(--tx4); pointer-events: none; display: flex; align-items: center; z-index: 1; }
.input-icon ~ .form-control, .input-ico ~ .form-control { padding-left: 34px; }
.input-suffix { position: absolute; right: 10px; color: var(--tx4); font-size: 12px; pointer-events: none; }
.form-control, .input, .select, .textarea {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); color: var(--tx); padding: 9px 12px; font-size: 13px;
  width: 100%; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none;
}
.form-control:focus, .input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(67,97,238,.1);
}
.form-control::placeholder, .input::placeholder, .textarea::placeholder { color: var(--tx4); }
.form-control:disabled, .input:disabled { opacity: .5; cursor: not-allowed; background: var(--s3); }
.form-control.is-invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.form-control.is-valid   { border-color: var(--green); box-shadow: 0 0 0 3px rgba(5,150,105,.1); }
select.form-control, .select {
  cursor: pointer; padding-right: 30px; background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}
textarea.form-control, .textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.form-hint, .hint { font-size: 11px; color: var(--tx4); margin-top: 3px; }
.form-error, .field-error { font-size: 11px; color: var(--red); margin-top: 3px; display: flex; align-items: center; gap: 4px; }
/* Form sections */
.form-section { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: none; }
.form-section-title, .section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--brand); margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.form-section-title::after, .section-label::after {
  content: ''; flex: 1; height: 1px; background: linear-gradient(to right, var(--brand-bd), transparent);
}
/* Checkbox */
.check-group, .check {
  display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 2px 0;
}
.check-group input[type=checkbox], .check input[type=checkbox] {
  width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0;
}
/* Radio */
.radio-group, .radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-option, .radio-card {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--r);
  transition: all .15s; font-size: 13px; background: var(--surface);
}
.radio-option:hover, .radio-card:hover { border-color: var(--brand); background: var(--brand-bg); }
.radio-option.selected, .radio-option.on, .radio-card.on {
  border-color: var(--brand); background: var(--brand-bg); color: var(--brand); font-weight: 500;
}

/* ── Doc upload ───────────────────────────────────────── */
.doc-upload, .doc-drop {
  border: 2px dashed var(--border); border-radius: var(--r);
  padding: 18px; text-align: center; cursor: pointer; transition: all .2s; background: var(--surface);
}
.doc-upload:hover, .doc-drop:hover { border-color: var(--brand); background: var(--brand-bg); }
.doc-upload input[type=file], .doc-drop input[type=file] { display: none; }
.doc-upload-text, .doc-drop-text { font-size: 12px; color: var(--tx4); line-height: 1.7; }
.doc-upload-text strong, .doc-drop-text strong { color: var(--brand); }
.doc-upload-icon { color: var(--tx4); margin-bottom: 6px; }
.doc-preview { font-size: 11px; color: var(--tx2); margin-top: 6px; display: flex; align-items: center; gap: 5px; }

/* ── Alerts ───────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--r);
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; margin-bottom: 14px; border: 1px solid transparent;
}
.alert-icon { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-bg); color: var(--green); border-color: var(--green-bd); }
.alert-danger  { background: var(--red-bg);   color: var(--red);   border-color: var(--red-bd);   }
.alert-warning { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-bd); }
.alert-info    { background: var(--brand-bg); color: var(--brand); border-color: var(--brand-bd); }
.alert-close {
  margin-left: auto; background: none; border: none;
  color: inherit; opacity: .6; cursor: pointer; font-size: 16px; padding: 0 2px; flex-shrink: 0;
}
.alert-close:hover { opacity: 1; }

/* ── Tabs ─────────────────────────────────────────────── */
.tab-bar, .tabs {
  display: flex; border-bottom: 1px solid var(--border);
  overflow-x: auto; background: var(--surface); flex-shrink: 0;
}
.tab-bar::-webkit-scrollbar, .tabs::-webkit-scrollbar { height: 0; }
.tab-btn {
  padding: 11px 18px; font-size: 13px; font-weight: 500; color: var(--tx4);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; transition: all .15s; margin-bottom: -1px; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.tab-btn:hover { color: var(--tx); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-btn .tab-count, .tab-btn .tc {
  font-size: 10px; padding: 1px 6px; border-radius: var(--r-full); background: var(--s3); font-weight: 600;
}
.tab-btn.active .tab-count, .tab-btn.active .tc { background: var(--brand-bg); color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Modal ────────────────────────────────────────────── */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.65); z-index: 999;
  align-items: center; justify-content: center; padding: 24px;
}
.modal-backdrop.open { display: flex; animation: fade-in .15s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-xl);
  width: 100%; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
  animation: slide-up .2s ease; box-shadow: var(--sh-xl);
}
@keyframes slide-up { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-sm { max-width: 440px; }
.modal-md { max-width: 640px; }
.modal-lg { max-width: 960px; }
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-shrink: 0; background: var(--s2);
}
.modal-title { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 9px; color: var(--tx); }
.modal-close {
  background: none; border: none; color: var(--tx4); font-size: 20px;
  cursor: pointer; padding: 4px 8px; border-radius: 7px; transition: all .15s; flex-shrink: 0;
}
.modal-close:hover { color: var(--red); background: var(--red-bg); }
.modal-body   { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end; flex-shrink: 0; background: var(--s2);
}

/* ── Pagination ───────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--tx2); font-size: 12px;
  background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all .15s; text-decoration: none; font-weight: 500;
}
.page-btn:hover { background: var(--s2); color: var(--tx); border-color: var(--border2); text-decoration: none; }
.page-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; box-shadow: 0 2px 6px rgba(67,97,238,.3); }
.page-btn.disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
.page-info { font-size: 12px; color: var(--tx4); padding: 0 6px; white-space: nowrap; }

/* ── Progress ─────────────────────────────────────────── */
.progress { height: 6px; background: var(--s3); border-radius: var(--r-full); overflow: hidden; }
.progress-sm { height: 4px; }
.progress-lg { height: 10px; }
.progress-fill { height: 100%; border-radius: var(--r-full); transition: width .6s ease; }

/* ── Timeline ─────────────────────────────────────────── */
.timeline { padding: 4px 0; }
.tl-item { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 14px; top: 36px; bottom: -10px; width: 1px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; border: 2px solid transparent; }
.tl-dot.blue  { background: var(--brand-bg); border-color: var(--brand-bd); color: var(--brand); }
.tl-dot.green { background: var(--green-bg); border-color: var(--green-bd); color: var(--green); }
.tl-dot.amber { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber); }
.tl-dot.red   { background: var(--red-bg);   border-color: var(--red-bd);   color: var(--red);   }
.tl-dot.gray  { background: var(--s3);       border-color: var(--border);   color: var(--tx4);   }
.tl-content, .tl-body { flex: 1; min-width: 0; padding-top: 3px; }
.tl-text { font-size: 13px; line-height: 1.5; }
.tl-meta { font-size: 11px; color: var(--tx4); margin-top: 2px; }

/* ── Empty states ─────────────────────────────────────── */
.empty-state, .empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; color: var(--tx4); text-align: center;
}
.empty-state-icon, .empty-icon { font-size: 44px; margin-bottom: 14px; opacity: .55; }
.empty-state-title, .empty-title { font-size: 16px; font-weight: 600; color: var(--tx2); margin-bottom: 7px; }
.empty-state-desc, .empty-desc  { font-size: 13px; line-height: 1.7; max-width: 300px; }

/* ── Audit log ────────────────────────────────────────── */
.audit-entry { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.audit-entry:last-child { border-bottom: none; }
.audit-module, .audit-mod { width: 66px; flex-shrink: 0; font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 3px 6px; border-radius: 5px; background: var(--brand-bg); color: var(--brand); text-align: center; align-self: flex-start; margin-top: 1px; }
.audit-action, .audit-text { font-size: 13px; color: var(--tx); flex: 1; line-height: 1.5; }
.audit-meta { font-size: 11px; color: var(--tx4); margin-top: 2px; }

/* ── Guide ────────────────────────────────────────────── */
.guide-step, .guide-mod      { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 12px; transition: box-shadow .2s; }
.guide-step { display: flex; gap: 14px; padding: 16px; }
.guide-step:hover, .guide-mod:hover { box-shadow: var(--sh); border-color: var(--brand-bd); }
.guide-step-num, .guide-step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.guide-step-title, .guide-step-t { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.guide-step-desc, .guide-step-d  { font-size: 13px; color: var(--tx2); line-height: 1.6; }
.guide-module, .guide-mod-h { padding: 14px 18px; background: var(--s2); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; cursor: pointer; }
.guide-module-header { padding: 14px 18px; background: var(--s2); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; cursor: pointer; }
.guide-module-title, .guide-mod-t { font-weight: 600; font-size: 13px; flex: 1; }
.guide-module-body, .guide-mod-b { padding: 16px 20px; }
.guide-tip { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; background: var(--brand-bg); border: 1px solid var(--brand-bd); border-radius: var(--r); margin-top: 12px; font-size: 13px; color: var(--brand); }

/* ── Chart container ──────────────────────────────────── */
.chart-container { position: relative; padding: 16px; }
.chart-container canvas { max-width: 100% !important; }

/* ── Login page ───────────────────────────────────────── */
.login-wrap, .login-page { min-height: 100vh; display: flex; align-items: stretch; }
.login-left {
  flex: 1; background: linear-gradient(160deg, #0f172a 0%, #1e293b 45%, #1e3a8a 100%);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 52px 44px; color: #fff; position: relative; overflow: hidden;
}
.login-left::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 400px; height: 400px; background: radial-gradient(circle, rgba(67,97,238,.2), transparent 70%); border-radius: 50%;
}
.login-left::after {
  content: ''; position: absolute; bottom: -60px; left: -60px;
  width: 300px; height: 300px; background: radial-gradient(circle, rgba(124,58,237,.15), transparent 70%); border-radius: 50%;
}
.login-brand, .login-logo-wrap { position: relative; z-index: 1; text-align: center; margin-bottom: 44px; }
.login-logo { width: 64px; height: 64px; background: linear-gradient(135deg, #4361ee, #3451d1); border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; color: #fff; margin: 0 auto 16px; box-shadow: 0 8px 28px rgba(67,97,238,.45); }
.login-features, .login-feats { position: relative; z-index: 1; width: 100%; max-width: 380px; }
.login-feature, .login-feat {
  display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px;
}
.login-feature-icon, .login-feat-icon {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: rgba(67,97,238,.2); display: flex; align-items: center; justify-content: center;
  font-size: 18px; border: 1px solid rgba(255,255,255,.1);
}
.login-feature-title, .login-feat-t { font-size: 13px; font-weight: 600; margin-bottom: 3px; color: #f1f5f9; }
.login-feature-desc, .login-feat-d { font-size: 12px; color: #94a3b8; line-height: 1.55; }
.login-right {
  width: 480px; background: #fff;
  display: flex; flex-direction: column; justify-content: center;
  padding: 52px 48px; box-shadow: -4px 0 32px rgba(0,0,0,.1);
}
.login-right-inner, .login-inner { max-width: 360px; width: 100%; margin: 0 auto; }
.login-sub  { font-size: 14px; color: var(--tx4); margin-bottom: 28px; margin-top: 6px; }
.login-footer-text, .login-footer { margin-top: 24px; font-size: 12px; color: var(--tx4); text-align: center; line-height: 1.7; }

/* ── Layout grids ─────────────────────────────────────── */
.grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3   { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.grid-4   { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-3-1 { display: grid; grid-template-columns: 3fr 1fr; gap: 16px; }
.grid-2 > *, .grid-3 > *, .grid-4 > *, .grid-1-2 > *, .grid-2-1 > *, .grid-3-1 > * { min-width: 0; }
.mb-4  { margin-bottom: 4px;  } .mb-8  { margin-bottom: 8px;  } .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.mt-4  { margin-top: 4px;     } .mt-8  { margin-top: 8px;     } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px;    } .mt-20 { margin-top: 20px;    }
.p-16  { padding: 16px; }       .p-20  { padding: 20px; }

/* ── Utilities ────────────────────────────────────────── */
.d-flex { display: flex; }
.align-center, .align-c { align-items: center; }
.justify-between, .justify-b { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.shrink-0 { flex-shrink: 0; }
.gap-4  { gap: 4px;  } .gap-6  { gap: 6px;  } .gap-8  { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.w-100  { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right;  }
.text-muted, .muted   { color: var(--tx4) !important; }
.text-secondary, .muted2 { color: var(--tx3) !important; }
.text-xs  { font-size: 11px; }
.text-sm  { font-size: 12px; }
.fw-500, .fw-5 { font-weight: 500; }
.fw-600, .fw-6 { font-weight: 600; }
.fw-700, .fw-7 { font-weight: 700; }
.text-success, .text-green { color: var(--green) !important; }
.text-danger,  .text-red   { color: var(--red)   !important; }
.text-warning, .text-amber { color: var(--amber) !important; }
.text-brand,   .text-blue  { color: var(--brand) !important; }
.truncate  { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nowrap    { white-space: nowrap; }
.divider   { height: 1px; background: var(--border); margin: 14px 0; }
.skeleton  { background: linear-gradient(90deg, var(--s2) 25%, var(--s3) 50%, var(--s2) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--r); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-row label { color: var(--tx4); font-size: 12px; display: flex; align-items: center; gap: 5px; }
.section-heading { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.d-none-mobile { display: inline; }
.no-print { }
/* Row check */
.row-check { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .kpi-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-1-2, .grid-2-1, .grid-3-1 { grid-template-columns: 1fr; }
  .form-grid-3, .form-grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); width: 256px; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--sh-xl); }
  .sidebar-overlay.open { display: block; }
  .main-wrap { margin-left: 0; }
  .menu-toggle, .menu-btn { display: flex !important; }
  .d-none-mobile { display: none; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; gap: 8px; }
  .topbar .btn-ghost { display: none; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); gap: 12px; }
  .kpi-val { font-size: 22px; }
  .kpi-foot { display: none; }
  .stat-strip { overflow-x: auto; }
  .stat-item { min-width: 100px; }
  .card-body { padding: 16px; }
  .form-section { padding: 14px; }
  .tbl thead th, .tbl tbody td { padding: 9px 10px; font-size: 12px; }
  .tbl thead th { font-size: 10px; }
  .notif-panel { right: -40px; width: 300px; }
}
@media (max-width: 600px) {
  html { font-size: 13px; }
  .page-content { padding: 10px 8px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-val { font-size: 19px; }
  .kpi-icon { width: 36px; height: 36px; }
  .kpi-foot { display: none; }
  .stat-row { display: grid; grid-template-columns: repeat(2,1fr); }
  .stat-chip { flex: none; }
  .topbar { height: 54px; padding: 0 10px; }
  .profile-btn .p-nm, .profile-btn .p-name { display: none; }
  .btn { padding: 7px 10px; font-size: 12px; }
  .btn-lg { padding: 10px 16px; font-size: 13px; }
  .modal { max-width: 100% !important; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 94vh; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-body { padding: 14px; }
  .form-grid, .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; gap: 12px; }
  .grid-2, .grid-3, .grid-4, .grid-1-2, .grid-2-1, .grid-3-1 { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .search-wrap, .filter-search { max-width: 100%; }
  .filter-select { width: 100%; }
  .bulk-bar { flex-wrap: wrap; }
  .notif-panel { position: fixed; top: 58px; left: 6px; right: 6px; width: auto; }
  .profile-menu { position: fixed; top: 58px; right: 6px; width: 240px; }
  .login-left { display: none; }
  .login-right { width: 100%; padding: 28px 20px; }
  .chart-container { height: 200px !important; }
}
@media (max-width: 400px) { .kpi-grid { grid-template-columns: 1fr; } }
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-wrap { margin-left: 0; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ddd; box-shadow: none; }
}

/* ── Missing aliases ──────────────────────────────────── */
.badge-dot::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; display: inline-block; margin-right: 3px; vertical-align: middle; }
.tbl-compact td, .tbl-sm td { padding: 8px 12px; }
.row-danger td:first-child { border-left: 3px solid var(--red) !important; }
.row-warning td:first-child { border-left: 3px solid var(--amber) !important; }

/* search-input alias (legacy) */
.search-input {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 8px 12px;
  flex: 1; max-width: 280px; transition: border-color .15s;
}
.search-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(67,97,238,.1); }
.search-input svg { color: var(--tx4); flex-shrink: 0; }
.search-input input { background: none; border: none; outline: none; color: var(--tx); font-size: 13px; flex: 1; min-width: 0; }
.search-input input::placeholder { color: var(--tx4); }

/* ── Sidebar colorful active state ───────────────────────── */
.nav-item.active {
  background: rgba(67,97,238,.14);
  color: #93c5fd; font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 5px; bottom: 5px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: attr(data-color); /* fallback */
  background: var(--nav-color, #4361ee);
}
/* Use JS to set color dynamically */
.nav-item[data-color]::before { background: attr(data-color); }

/* ── Breadcrumb ────────────────────────────────────────────── */
.topbar-breadcrumb { overflow: hidden; }
.crumb-section { color: var(--tx4); font-size: 13px; }
.crumb-sep     { color: var(--tx4); margin: 0 6px; font-size: 14px; opacity: .5; }
.crumb-cur     { color: var(--tx); font-weight: 600; font-size: 13px; }

/* ── Nav group with icon ───────────────────────────────────── */
.nav-group {
  padding: 14px 16px 4px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #4b5563; display: flex; align-items: center; gap: 6px;
}
.nav-group svg { opacity: .5; flex-shrink: 0; }
.nav-group::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.06); }

/* ── Form validation visual feedback ──────────────────────── */
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(67,97,238,.12); }
.form-control.valid   { border-color: var(--green); }
.form-control.invalid { border-color: var(--red); }
.field-msg { font-size: 11px; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.field-msg.ok  { color: var(--green); }
.field-msg.err { color: var(--red); }

/* ── Card accent colors per module ─────────────────────────── */
.card-accent-blue   { border-top: 3px solid #4361ee; }
.card-accent-green  { border-top: 3px solid #059669; }
.card-accent-amber  { border-top: 3px solid #d97706; }
.card-accent-purple { border-top: 3px solid #7c3aed; }
.card-accent-teal   { border-top: 3px solid #0d9488; }
.card-accent-red    { border-top: 3px solid #dc2626; }

/* ── Colorful section headings ─────────────────────────────── */
.form-section-title { color: var(--brand); }
.form-section:nth-child(2) .form-section-title { color: #7c3aed; }
.form-section:nth-child(3) .form-section-title { color: #0d9488; }
.form-section:nth-child(4) .form-section-title { color: #d97706; }
.form-section:nth-child(5) .form-section-title { color: #dc2626; }
.form-section:nth-child(6) .form-section-title { color: #4361ee; }

/* ── Better table row interaction ──────────────────────────── */
.tbl tbody tr:hover td { background: #f0f5ff; }
.tbl tbody tr:hover td:first-child { border-left: 3px solid var(--brand); }

/* ── Colorful stat strip ───────────────────────────────────── */
.stat-item:nth-child(1) .stat-val { color: #4361ee; }
.stat-item:nth-child(2) .stat-val { color: #059669; }
.stat-item:nth-child(3) .stat-val { color: #0d9488; }
.stat-item:nth-child(4) .stat-val { color: #d97706; }
.stat-item:nth-child(5) .stat-val { color: #7c3aed; }
.stat-item:nth-child(6) .stat-val { color: #dc2626; }

/* ── Indian context: rupee in forms ──────────────────────────  */
.rupee-prefix { 
  position: relative; 
}
.rupee-prefix::before { 
  content: '₹'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--tx4); font-size: 13px; pointer-events: none;
}
.rupee-prefix .form-control { padding-left: 24px; }

/* ── Scrollbar fix for sidebar (no layout jump on scroll) ─── */
html { scrollbar-gutter: stable; }

/* ── Page speed: reduce repaints on scroll ─────────────────── */
.sidebar { will-change: transform; }
.card    { will-change: auto; }
