:root {
  --navy-900: #0F1729;
  --navy-800: #16233D;
  --navy-700: #223655;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --border: #E4E8EF;
  --text: #1E2532;
  --text-muted: #6B7686;
  --teal: #0EA5A0;
  --teal-dark: #0B8580;
  --teal-bg: #E3F6F5;
  --amber: #E8A33D;
  --amber-bg: #FDF3E1;
  --coral: #E0645A;
  --coral-bg: #FBEAE9;
  --indigo: #5B6FE8;
  --indigo-bg: #ECEEFC;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 41, 0.04), 0 4px 16px rgba(15, 23, 41, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.tabular { font-variant-numeric: tabular-nums; letter-spacing: 0.2px; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #DCE3F0;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 22px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--teal);
  color: #0B2E2C;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.brand-text { line-height: 1.3; }
.brand-title { font-weight: 700; font-size: 14.5px; color: #fff; }
.brand-sub { font-size: 11.5px; color: #93A0BD; }

.nav-section-label {
  font-size: 11px;
  color: #6B7BA0;
  padding: 0 10px;
  margin: 14px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #B9C3DB;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(14, 165, 160, 0.18); color: #6FE0D9; font-weight: 600; }

.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.08); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; margin-bottom: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--indigo);
  color: #fff; font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; background: var(--indigo); }
.user-name { font-size: 13px; color: #fff; font-weight: 600; }
.user-role { font-size: 11px; color: #8493B4; }
.btn-logout {
  width: 100%;
  background: rgba(224, 100, 90, 0.12);
  color: #F0958D;
  border: 1px solid rgba(224, 100, 90, 0.25);
  border-radius: 8px;
  padding: 8px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-logout:hover { background: rgba(224, 100, 90, 0.22); }

.main { flex: 1; min-width: 0; }
.topbar { background: var(--card); border-bottom: 1px solid var(--border); padding: 16px 28px; }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; }
.content { padding: 24px 28px; }

.alert { padding: 11px 16px; border-radius: var(--radius); font-size: 13.5px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--teal-bg); color: var(--teal-dark); border-color: rgba(14,165,160,0.25); }
.alert-error, .alert-danger { background: var(--coral-bg); color: #A8362D; border-color: rgba(224,100,90,0.25); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card + .card { margin-top: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  padding: 9px 18px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; transition: filter 0.15s, background 0.15s;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { filter: brightness(0.94); }
.btn:disabled { background: #D7DBE3; color: #8A93A6; cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: #F0F2F6; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
input[type=text], input[type=date], input[type=password], input[type=search],
select, textarea {
  width: 100%; font-family: inherit; font-size: 13.5px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: #FCFDFE; color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,165,160,0.13); }
.field { margin-bottom: 14px; }

.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th { background: #FAFBFD; text-align: right; font-size: 12px; color: var(--text-muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border); }
tbody td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.row-link { cursor: pointer; transition: background 0.12s; }
tbody tr.row-link:hover { background: #F8FBFC; }
tfoot td { padding: 13px 16px; font-weight: 700; background: #FAFBFD; border-top: 2px solid var(--border); }
.empty-row td { text-align: center; color: var(--text-muted); padding: 40px 16px; }

.th-group { text-align: center !important; border-bottom: 2px solid var(--border) !important; }
.th-group-indigo { background: var(--indigo-bg) !important; color: var(--indigo) !important; }
.th-group-teal { background: var(--teal-bg) !important; color: var(--teal-dark) !important; }
.th-hint {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,0.6); color: var(--teal-dark);
  font-size: 10px; font-weight: 800; cursor: help; margin-right: 3px;
}

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-warning { background: var(--amber-bg); color: #A66A16; }
.pill-success { background: var(--teal-bg); color: var(--teal-dark); }
.pill-danger  { background: var(--coral-bg); color: #A8362D; }
.pill-neutral { background: #EEF0F4; color: var(--text-muted); }
.chip-type { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 6px; }
.chip-promoter { background: var(--indigo-bg); color: var(--indigo); }
.chip-driver { background: var(--teal-bg); color: var(--teal-dark); }

.filter-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .field { margin-bottom: 0; min-width: 160px; }

.lead-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.lead-title { font-size: 19px; font-weight: 800; margin: 0 0 4px; }
.lead-phone { color: var(--text-muted); font-size: 13.5px; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.info-item .info-label { font-size: 11.5px; color: var(--text-muted); margin-bottom: 3px; }
.info-item .info-value { font-size: 14px; font-weight: 600; }

.timeline { position: relative; padding-right: 26px; margin-top: 6px; }
.timeline::before { content: ''; position: absolute; right: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute; right: -26px; top: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  border: 3px solid var(--card); box-shadow: 0 0 0 1.5px var(--border);
}
.timeline-dot.dot-call { background: var(--indigo); }
.timeline-dot.dot-followup { background: var(--teal); }
.timeline-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.timeline-kind { font-weight: 700; }
.timeline-date { color: var(--text-muted); font-size: 12px; }
.timeline-desc { font-size: 13px; color: var(--text); margin-top: 3px; line-height: 1.7; }
.timeline-caller { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.timeline-empty { color: var(--text-muted); font-size: 13px; padding: 10px 0; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, #1B2C4C, var(--navy-900) 60%);
  padding: 20px;
}
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 16px; padding: 34px 30px; box-shadow: 0 20px 50px rgba(0,0,0,0.35); }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand .brand-mark { margin: 0 auto 12px; }
.login-title { font-size: 17px; font-weight: 800; margin: 0 0 2px; }
.login-sub { font-size: 12.5px; color: var(--text-muted); }

.agent-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; background: var(--card); box-shadow: var(--shadow); }
.agent-card-header {
  display: flex; width: 100%; justify-content: space-between; align-items: center;
  background: #FAFBFD; border: none; padding: 12px 16px; cursor: pointer;
  font-family: inherit; text-align: right;
}
.agent-card.open .agent-card-header { border-bottom: 1px solid var(--border); }
.agent-card-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.agent-card-meta { display: flex; align-items: center; gap: 8px; }
.chevron { color: var(--text-muted); transition: transform 0.2s ease; flex-shrink: 0; }
.agent-card.open .chevron { transform: rotate(180deg); color: var(--teal); }
.agent-card-body { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.agent-card.open .agent-card-body { max-height: 3000px; }
.agent-card-body table { border: none; }

.province-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; background: var(--card); box-shadow: var(--shadow); }
.province-header {
  display: flex; width: 100%; justify-content: space-between; align-items: center;
  background: var(--navy-800); border: none; padding: 14px 18px; cursor: pointer;
  font-family: inherit; text-align: right;
}
.province-name { font-size: 14.5px; font-weight: 800; color: #fff; }
.province-meta { display: flex; align-items: center; gap: 10px; }
.chevron-lg { color: #93A0BD; }
.province-card.open .chevron-lg { transform: rotate(180deg); color: #6FE0D9; }
.province-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; padding: 0 14px; }
.province-card.open .province-body { max-height: 6000px; padding: 14px; }
.province-body .agent-card:last-child { margin-bottom: 0; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--navy-800); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stat-card-success .stat-value { color: var(--teal-dark); }
.stat-card-accent { background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); border: none; }
.stat-card-accent .stat-value { color: #fff; }
.stat-card-accent .stat-label { color: #B9C3DB; }
.rate-bar { display: inline-block; width: 46px; height: 5px; background: #EEF0F4; border-radius: 999px; overflow: hidden; vertical-align: middle; margin-left: 6px; }
.rate-fill { display: block; height: 100%; background: var(--teal); border-radius: 999px; }

.overview-grid {
  display: grid;
  grid-template-columns: 170px 160px repeat(5, minmax(130px, 160px));
  grid-template-rows: 1fr 1fr;
  gap: 8px 14px;
  margin-bottom: 18px;
  width: fit-content;
}
.type-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; display: flex; align-items: center; justify-content: center;
  text-align: center; font-size: 13px; font-weight: 700; color: var(--text-muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.type-card-indigo:hover { border-color: var(--indigo); color: var(--indigo); }
.type-card-teal:hover { border-color: var(--teal); color: var(--teal-dark); }
.type-card-indigo.type-card-active { background: var(--indigo-bg); border-color: var(--indigo); color: var(--indigo); }
.type-card-teal.type-card-active { background: var(--teal-bg); border-color: var(--teal); color: var(--teal-dark); }
.overview-grid .stat-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.stat-chip {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; text-align: center; transition: border-color 0.15s, transform 0.1s;
}
.stat-chip:hover { transform: translateY(-1px); border-color: var(--teal); }
.stat-chip-active { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(14,165,160,0.15); }
.stat-chip-value { display: block; font-size: 20px; font-weight: 800; color: var(--navy-800); }
.stat-chip-label { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.stat-chip-indigo .stat-chip-value { color: var(--indigo); }
.stat-chip-teal .stat-chip-value { color: var(--teal-dark); }
.stat-chip-amber .stat-chip-value { color: #A66A16; }
.stat-chip-coral .stat-chip-value { color: #A8362D; }
.stat-chip-neutral .stat-chip-value { color: var(--text-muted); }
.stat-chip-total { background: var(--navy-800); border-color: var(--navy-800); }
.stat-chip-total .stat-chip-value, .stat-chip-total .stat-chip-label { color: #fff; }
.stat-chip-total.stat-chip-active { box-shadow: 0 0 0 2px rgba(14,165,160,0.4); }

.hamburger {
  display: none; background: none; border: none; padding: 6px;
  margin-left: 10px; cursor: pointer; color: var(--navy-800);
}
.hamburger svg { width: 22px; height: 22px; display: block; pointer-events: none; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 41, 0.5); z-index: 40; }
.sidebar-overlay.visible { display: block; }

@media (max-width: 780px) {
  .hamburger { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar {
    display: flex !important;
    position: fixed !important;
    right: 0; top: 0; height: 100vh; z-index: 50;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: -10px 0 30px rgba(0,0,0,0.3);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .topbar { display: flex; align-items: center; padding: 12px 16px; }
  .topbar h1 { font-size: 15.5px; }
  .content { padding: 14px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 640px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .field { min-width: 0; width: 100%; }
  .filter-bar .btn { width: 100%; }
  div[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  .info-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .lead-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .overview-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: none; gap: 8px;
  }
  .overview-grid > * { grid-column: auto !important; grid-row: auto !important; }
  .overview-grid .stat-chip-total { grid-column: 1 / 3 !important; }
  .agent-card-header, .province-header { flex-wrap: wrap; gap: 6px; }
  .agent-card-meta, .province-meta { flex-wrap: wrap; }
  .login-card { padding: 26px 20px; }
  .timeline { padding-right: 20px; }
}

@media (max-width: 420px) {
  .stat-cards { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
  .overview-grid .stat-chip-total { grid-column: 1 !important; }
}

.report-overview { display: flex; gap: 14px; margin-bottom: 20px; align-items: stretch; }
.report-overview .stat-cards { margin-bottom: 0; }
@media (max-width: 900px) {
  .report-overview { flex-direction: column; }
  .report-overview .type-stack { width: 100%; }
}

.report-overview { display: flex; gap: 14px; margin-bottom: 20px; align-items: stretch; }
.report-overview .stat-cards { margin-bottom: 0; }
@media (max-width: 900px) {
  .report-overview { flex-direction: column; }
  .report-overview .type-stack { width: 100%; }
}

.pct-inline { font-size: 11.5px; color: var(--text-muted); font-weight: 400; }

.type-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 170px;
  flex-shrink: 0;
}

.tab-bar { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab-btn {
  background: none; border: none; padding: 14px 18px;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--teal-dark); border-bottom-color: var(--teal); }

.chart-wrap { position: relative; height: 380px; padding: 10px 4px 0; }
@media (max-width: 780px) {
  .chart-wrap { height: 280px; }
}

.form-alert {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--amber-bg); border: 1px solid rgba(232,163,61,0.35);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px;
}
.form-alert-text { font-size: 13.5px; color: #8A5A10; }
.form-alert-text strong { display: block; margin-bottom: 2px; }
@media (max-width: 780px) {
  .form-alert { flex-direction: column; align-items: flex-start; }
}

/* هم‌ارتفاع کردن کارت‌های تماس/پیگیری در صفحه جزئیات لید */
div[style*="grid-template-columns: 1fr 1fr"] {
  align-items: stretch;
}
div[style*="grid-template-columns: 1fr 1fr"] > .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
div[style*="grid-template-columns: 1fr 1fr"] > .card > .card-body {
  flex: 1;
}

/* اطمینان از هم‌تراز بودن دقیق کارت‌های تماس/پیگیری از بالا */
div[style*="grid-template-columns: 1fr 1fr"] {
  align-items: start;
}
div[style*="grid-template-columns: 1fr 1fr"] > .card {
  margin: 0;
}
div[style*="grid-template-columns: 1fr 1fr"] > .card > .card-header {
  min-height: 48px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

/* ---------- Sidebar nav group (submenu) ---------- */
.nav-group { margin-bottom: 2px; }
.nav-item-toggle {
  width: 100%;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  text-align: right;
}
.nav-chevron { transition: transform 0.2s ease; opacity: 0.7; flex-shrink: 0; }
.nav-item-toggle.open .nav-chevron { transform: rotate(180deg); }

.nav-subitems {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  padding-right: 27px;
}
.nav-subitems.open { max-height: 200px; }
.nav-subitem {
  display: block;
  padding: 7px 10px;
  font-size: 12.5px;
  color: #9FACC9;
  border-radius: 6px;
  margin-bottom: 1px;
  transition: background 0.15s, color 0.15s;
}
.nav-subitem:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-subitem.active { color: #6FE0D9; font-weight: 600; }

.pill-amber-soft { background: #FFF4E0; color: #B8760A; }

.sortable-th { color: inherit; display: inline-flex; gap: 4px; cursor: pointer; }
.sortable-th:hover { color: var(--teal-dark); }

/* ---------- Cities: colored card per agent, grouped by province ---------- */
.province-block { margin-bottom: 30px; }
.province-block-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--navy-800);
  padding: 4px 4px 10px;
  border-bottom: 2px solid var(--navy-800);
  margin-bottom: 14px;
}
.mini-table-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
}
.mini-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 170px;
  flex: 0 0 auto;
}
.mini-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 700;
}
.mini-table-agent { white-space: nowrap; }
.mini-table-count {
  background: rgba(255,255,255,0.35);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  padding: 0 6px;
}
.mini-table-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}
.mini-table-list li {
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.mini-table-list li:last-child { border-bottom: none; }

.mini-table-header-1 { background: var(--indigo-bg); color: var(--indigo); }
.mini-table-header-2 { background: var(--teal-bg); color: var(--teal-dark); }
.mini-table-header-3 { background: var(--amber-bg); color: #A66A16; }
.mini-table-header-4 { background: var(--coral-bg); color: #A8362D; }
.mini-table-header-5 { background: #EEF0F4; color: var(--text-muted); }

@media (max-width: 780px) {
  .mini-table-row { gap: 10px; }
  .mini-table { min-width: 140px; flex: 1 1 140px; }
}

.stat-cards-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) {
  .stat-cards-5 { grid-template-columns: repeat(2, 1fr); }
}

.th-subtext {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: normal;
}

.col-divider { border-left: 2px solid var(--navy-800) !important; }

.stat-pct {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy-800);
  margin-top: 6px;
}
.stat-card-accent .stat-pct { color: #fff; }
.stat-card-success .stat-pct { color: var(--teal-dark); }

/* ---------- Multi-select dropdown ---------- */
.ms-dropdown { position: relative; }
.ms-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-width: 160px;
  font-family: inherit; font-size: 13.5px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: #FCFDFE; color: var(--text);
  cursor: pointer;
}
.ms-toggle:hover { border-color: var(--teal); }
.ms-toggle-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-panel {
  display: none;
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); padding: 6px; min-width: 200px; max-height: 260px; overflow-y: auto;
}
.ms-panel.open { display: block; }
.ms-option {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 6px; font-size: 13px; cursor: pointer;
}
.ms-option:hover { background: #F0F2F6; }
.ms-option input { margin: 0; }
