/* ═══════════════════════════════════════════════════════════
   Sigma NGO v2 — Design System
   Hybrid theme: dark sidebar + light content area
   Brand: navy / gold / green from Sigma ecosystem
   Icons: Lucide (loaded via CDN in layout.php)
═══════════════════════════════════════════════════════════ */

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  /* Sidebar (dark) */
  --sb-bg:        #0f1724;
  --sb-bg-hover:  #1a2535;
  --sb-bg-active: #1e2d42;
  --sb-border:    #1e2d42;
  --sb-text:      #8ca0b8;
  --sb-text-act:  #ffffff;
  --sb-accent:    #c8a84b;

  /* Content area (light) */
  --bg:           #f0f4f8;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;
  --border:       #e2e8f0;
  --border-focus: #2e8b6e;

  /* Text */
  --text-primary:   #0f1724;
  --text-secondary: #4a5568;
  --text-muted:     #94a3b8;

  /* Brand */
  --navy:   #1a2f5e;
  --green:  #2e8b6e;
  --green-dark: #236b55;
  --gold:   #c8a84b;
  --gold-dark: #a8882e;

  /* Semantic */
  --success-bg:   #ecfdf5;
  --success-text: #065f46;
  --success-border: #a7f3d0;
  --warning-bg:   #fffbeb;
  --warning-text: #92400e;
  --warning-border: #fde68a;
  --danger-bg:    #fef2f2;
  --danger-text:  #991b1b;
  --danger-border:#fecaca;
  --info-bg:      #eff6ff;
  --info-text:    #1e40af;
  --info-border:  #bfdbfe;

  /* Fit bands */
  --fit-strong-bg:   #ecfdf5;
  --fit-strong-text: #065f46;
  --fit-good-bg:     #eff6ff;
  --fit-good-text:   #1e40af;
  --fit-moderate-bg: #fffbeb;
  --fit-moderate-text:#92400e;
  --fit-low-bg:      #f8fafc;
  --fit-low-text:    #64748b;

  /* Layout */
  --sb-width:     240px;
  --sb-width-collapsed: 64px;
  --topbar-h:     56px;
  --radius:       8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:    0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.04);
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ─── LAYOUT SHELL ───────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: var(--sb-width);
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width .2s ease, transform .2s ease;
  overflow: hidden;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--sb-border);
  min-height: var(--topbar-h);
}
.brand-mark {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  flex-shrink: 0;
}
.brand-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--sb-text-act);
  line-height: 1.2;
}
.brand-tagline {
  font-size: 10px;
  color: var(--sb-text);
  line-height: 1;
  margin-top: 2px;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.32); }
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sb-text);
  padding: 16px 20px 4px;
  opacity: .6;
}
.nav-section-sub {
  display: block;
  font-size: 9px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: .02em;
  opacity: .7;
  margin-top: 1px;
  padding-bottom: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sb-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  position: relative;
}
.nav-item:hover {
  background: var(--sb-bg-hover);
  color: var(--sb-text-act);
}
.nav-item.active {
  background: var(--sb-bg-active);
  color: var(--sb-text-act);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .7;
}
.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--green);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.sidebar-footer {
  border-top: 1px solid var(--sb-border);
  padding: 12px 0;
}

/* ─── MAIN CONTENT ───────────────────────────────────────── */
.main-content {
  margin-left: var(--sb-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.page-body {
  padding: 24px;
  flex: 1;
}
/* ─── PAGE HEADER / TITLE ────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.4;
}

/* ─── MOBILE TOPBAR (hamburger) ──────────────────────────── */
.mobile-topbar {
  display: none;
  height: var(--topbar-h);
  background: var(--sb-bg);
  border-bottom: 1px solid var(--sb-border);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.hamburger {
  background: none;
  border: none;
  color: var(--sb-text-act);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

/* ─── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.card + .card { margin-top: 16px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 16px;
  gap: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}
.card-title > i,
.card-title > svg {
  flex-shrink: 0;
}

/* ─── STAT CARDS ─────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .1s, border-color .15s;
}
a.stat-card {
  display: block;
  color: inherit;
}
a.stat-card:hover {
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.1));
  transform: translateY(-1px);
  border-color: var(--border-strong);
}
a.stat-card:active {
  transform: translateY(0);
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.stat-card.accent-green { border-top: 3px solid var(--green); }
.stat-card.accent-gold  { border-top: 3px solid var(--gold); }
.stat-card.accent-navy  { border-top: 3px solid var(--navy); }
.stat-card.accent-red   { border-top: 3px solid #ef4444; }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--green);
  color: white;
  box-shadow: 0 2px 8px rgba(46,139,110,.3);
}
.btn-primary:hover { background: var(--green-dark); }
.btn-navy {
  background: var(--navy);
  color: white;
  box-shadow: 0 2px 8px rgba(26,47,94,.3);
}
.btn-navy:hover { background: #142345; }
.btn-gold {
  background: var(--gold);
  color: #0f1724;
  box-shadow: 0 2px 8px rgba(200,168,75,.3);
}
.btn-gold:hover { background: var(--gold-dark); }
.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); }
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}
.btn-danger:hover { background: #fee2e2; }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--bg); border-color: var(--border); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

/* ─── FORM ELEMENTS ──────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.form-label.required::after {
  content: ' *';
  color: #ef4444;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(46,139,110,.12);
}
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* Multi-select checkboxes */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  font-size: 13px;
  font-weight: 500;
}
.check-item:hover { border-color: var(--green); background: var(--success-bg); }
.check-item input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--green); flex-shrink: 0; }
.check-item.checked { border-color: var(--green); background: var(--success-bg); color: var(--success-text); }

/* ─── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.badge-strong   { background: var(--fit-strong-bg);   color: var(--fit-strong-text); }
.badge-good     { background: var(--fit-good-bg);     color: var(--fit-good-text); }
.badge-moderate { background: var(--fit-moderate-bg); color: var(--fit-moderate-text); }
.badge-low      { background: var(--fit-low-bg);      color: var(--fit-low-text); border: 1px solid var(--border); }
.badge-new      { background: var(--info-bg);         color: var(--info-text); }
.badge-reviewed { background: var(--success-bg);      color: var(--success-text); }
.badge-dismissed{ background: var(--bg);              color: var(--text-muted); border: 1px solid var(--border); }
.badge-draft    { background: var(--warning-bg);      color: var(--warning-text); }
.badge-finalized{ background: var(--success-bg);      color: var(--success-text); }
.badge-overdue  { background: var(--danger-bg);       color: var(--danger-text); }
.badge-upcoming { background: var(--success-bg);      color: var(--success-text); }
.badge-done     { background: var(--bg);              color: var(--text-muted); border: 1px solid var(--border); }

/* ─── TABLES ─────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }

/* On narrow screens, dense multi-column tables (5-8 columns, with rich
   content like buttons/links/forms in the first cell) don't work as
   horizontal scroll — the content-heavy first column fights with the
   narrow trailing columns and content still gets clipped. Instead,
   each row becomes a stacked card: every cell goes full-width and
   stacks vertically, with the column header injected as a small label
   above each value (except the first cell, which is the row's main
   content and reads fine without a label, and empty action cells).
*/
@media (max-width: 768px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td {
    display: block;
    width: 100%;
  }
  .data-table tr {
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 4px 0;
    overflow: hidden;
  }
  .data-table tr:last-child { margin-bottom: 0; }
  .data-table td {
    border-bottom: 1px solid var(--surface-2);
    padding: 10px 14px;
    white-space: normal;
    word-break: break-word;
  }
  .data-table td:last-child { border-bottom: none; }
  .data-table td:empty { display: none; }
  /* Inject the column header as a small label above each cell's value,
     except the first column (the row's main content/title cell) which
     doesn't need one. */
  .data-table td[data-label]:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: 3px;
  }
}

/* ─── WORKFLOW PROGRESS BANNER ───────────────────────────── */
/* Compact horizontal step tracker + one-line contextual tip  */
.workflow-banner {
  background: linear-gradient(135deg, #f8fafc 0%, #f0f9f4 100%);
  border: 1px solid #d1e7dd;
  border-left: 3px solid var(--green);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.workflow-banner.hidden { display: none; }

/* Step row — icons only on mobile, icons+labels on desktop */
.workflow-steps {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.workflow-step {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.workflow-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.workflow-step.done .workflow-step-dot {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.workflow-step.active .workflow-step-dot {
  border-color: var(--gold);
  background: #fffbeb;
  color: var(--gold);
  box-shadow: 0 0 0 2px rgba(200,168,75,.2);
}
.workflow-step-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.workflow-step.done .workflow-step-label { color: var(--green); }
.workflow-step.active .workflow-step-label { color: var(--gold); }
.workflow-step-line {
  width: 14px;
  height: 1.5px;
  background: var(--border);
  flex-shrink: 0;
}
.workflow-step-line.done { background: var(--green); }

/* Tip text — fills remaining space */
.workflow-tip {
  flex: 1;
  min-width: 180px;
  font-size: 11.5px;
  color: #374151;
  line-height: 1.45;
  display: flex;
  align-items: center;
  gap: 8px;
}
.workflow-tip-text { flex: 1; }
.workflow-tip-text strong { color: #111827; }
.workflow-tip-text a { color: var(--green); font-weight: 600; text-decoration: none; }
.workflow-banner-close {
  background: none; border: none; cursor: pointer;
  font-size: 16px; color: #9ca3af; padding: 0;
  line-height: 1; flex-shrink: 0; opacity: .7;
  align-self: flex-start;
}
.workflow-banner-close:hover { opacity: 1; }

/* Mobile: hide step labels, keep dots + lines */
@media (max-width: 600px) {
  .workflow-step-label { display: none; }
  .workflow-step-line { width: 8px; }
  .workflow-tip { min-width: 0; width: 100%; }
}

/* ─── PAGE TIPS ─────────────────────────────────────────────── */
/* Compact dismissible "how this page works" info banners.       */
/* Visually distinct from page content: muted teal background,   */
/* small font, clearly closeable — not part of the UI chrome.    */
.page-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #f0faf7;
  border: 1px solid #a7d7c5;
  border-left: 3px solid #3b9e7e;
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 12px;
  color: #374151;
  margin-bottom: 14px;
  line-height: 1.5;
}
.page-tip.hidden { display: none; }
.page-tip-icon {
  color: #3b9e7e;
  flex-shrink: 0;
  margin-top: 1px;
  opacity: .8;
}
.page-tip-body { flex: 1; min-width: 0; }
.page-tip-body strong { color: #111827; font-weight: 600; }
.page-tip-body em {
  font-style: normal;
  font-weight: 600;
  color: #111827;
  background: rgba(59,158,126,.1);
  padding: 0 3px;
  border-radius: 3px;
}
.page-tip-body a { color: #3b9e7e; font-weight: 600; text-decoration: none; }
.page-tip-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: #9ca3af;
  padding: 0 0 0 4px;
  line-height: 1;
  flex-shrink: 0;
  opacity: .7;
}
.page-tip-close:hover { opacity: 1; color: #374151; }

/* Mobile: ensure tips don't overflow */
@media (max-width: 768px) {
  .page-tip { font-size: 11.5px; padding: 8px 10px; }
  .workflow-banner { padding: 8px 10px; gap: 8px; }
}



/* ─── ALERT / MESSAGE BARS ───────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger-text);  border: 1px solid var(--danger-border); }
.alert-info    { background: var(--info-bg);    color: var(--info-text);    border: 1px solid var(--info-border); }

/* ─── FUNDING CALL CARDS ─────────────────────────────────── */
.call-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow .15s, border-color .15s;
  cursor: pointer;
}
.call-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}
.call-card.fit-strong { border-left: 3px solid var(--green); }
.call-card.fit-good   { border-left: 3px solid var(--navy); }
.call-card.fit-moderate { border-left: 3px solid var(--gold); }
.call-card.fit-low    { border-left: 3px solid var(--border); }
.call-score {
  min-width: 48px;
  text-align: center;
  flex-shrink: 0;
}
.call-score-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}
.call-score-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: .05em;
}
.call-body { flex: 1; min-width: 0; }
.call-title-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.call-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.call-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.call-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.deadline-urgent { color: #dc2626; font-weight: 700; }
.deadline-soon   { color: var(--warning-text); font-weight: 600; }

/* ─── FILTER BAR ─────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}
.filter-select {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
}
.filter-select:focus { border-color: var(--border-focus); }

/* ─── ONBOARDING CARD ────────────────────────────────────── */
.onboarding-card {
  background: linear-gradient(135deg, var(--navy) 0%, #1e3a5f 100%);
  border-radius: var(--radius-xl);
  padding: 32px;
  color: white;
  text-align: center;
  margin-bottom: 24px;
}
.onboarding-card h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.onboarding-card p {
  font-size: 14px;
  opacity: .8;
  max-width: 480px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

/* ─── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon {
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  opacity: .3;
}
.empty-state h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty-state p { font-size: 13px; line-height: 1.6; }

/* ─── LOADING SKELETON ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.w-3\/4 { width: 75%; }
.skeleton-text.w-1\/2 { width: 50%; }
.skeleton-card { height: 80px; margin-bottom: 10px; border-radius: var(--radius-lg); }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sb-width) !important;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.3);
  }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .mobile-topbar { display: flex; }
  .topbar { display: none; }
  .page-body { padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .call-card { flex-direction: column; gap: 10px; }
  .call-card .call-body { width: 100%; }
  .call-card .call-score {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    min-width: 0;
  }
  .filter-bar { gap: 8px; }
  .filter-select { font-size: 12px; padding: 6px 8px; }

  /* Card headers: when the title + action buttons can't fit on one
     line, the actions wrap to their own full-width row underneath
     rather than forcing the whole card wider than the screen. The
     action-button group is always the header's last child. */
  .card-header { width: 100%; }
  .card-header > *:last-child:not(.card-title) {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .card-header > *:last-child:not(.card-title) > .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .check-grid { grid-template-columns: 1fr; }
}

/* ─── UTILITIES ──────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 > *, .grid-3 > * { min-width: 0; overflow-wrap: break-word; }
@media (max-width: 768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Call detail two-column layout — stack to single column on mobile */
@media (max-width: 768px) {
  .call-detail-grid { grid-template-columns: 1fr !important; }
}
