/* ============================================================================
   ADSYAFF CRM — SWISS / EDITORIAL REDESIGN
   White (#fbfbf9) · Black type · single cobalt accent (#1d4ed8)
   Space Grotesk display + Inter body · hairlines · tabular nums · minimal radius
   NOTE: all variable names & selectors preserved (app.js uses var(--accent) inline)
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── CSS Variables ──────────────────────────────────────────────────────────── */
:root {
  /* Light (default) — Swiss editorial */
  --bg: #fbfbf9;
  --surface: #ffffff;
  --card: #ffffff;
  --border: #000000;
  --border-light: rgba(0,0,0,0.12);
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-light: rgba(29,78,216,0.08);
  --accent-rgb: 29,78,216;
  --accent2: #1d4ed8;
  --text: #0a0a0a;
  --text-secondary: #1a1a1a;
  --muted: #6b6b66;
  --danger: #b91c1c;
  --danger-bg: rgba(185,28,28,0.07);
  --warning: #92600a;
  --warning-bg: rgba(146,96,10,0.07);
  --success: #1d4ed8;
  --success-bg: rgba(29,78,216,0.07);
  --sidebar-bg: #fbfbf9;
  --sidebar-border: #000000;
  --sidebar-hover: rgba(0,0,0,0.04);
  --sidebar-active-bg: transparent;
  --sidebar-active-text: #0a0a0a;
  --table-header-bg: transparent;
  --table-hover: rgba(0,0,0,0.025);
  --modal-bg: #ffffff;
  --fg: #0a0a0a;
  --card-bg: #ffffff;
  --input-bg: #ffffff;
  --shadow-sm: none;
  --shadow-md: 0 2px 0 rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --radius-pill: 2px;
  --hair: rgba(0,0,0,0.14);
}

/* ── Dark Mode ──────────────────────────────────────────────────────────────── */
:root.dark {
  --bg: #0a0a0a;
  --surface: #111111;
  --card: #111111;
  --border: #ffffff;
  --border-light: rgba(255,255,255,0.16);
  --accent: #6691ff;
  --accent-hover: #85a8ff;
  --accent-light: rgba(102,145,255,0.12);
  --accent-rgb: 102,145,255;
  --accent2: #6691ff;
  --text: #f5f5f0;
  --text-secondary: #d4d4cf;
  --muted: #8a8a84;
  --danger: #f87171;
  --danger-bg: rgba(248,113,113,0.12);
  --warning: #fbbf24;
  --warning-bg: rgba(251,191,36,0.12);
  --success: #6691ff;
  --success-bg: rgba(102,145,255,0.12);
  --sidebar-bg: #0a0a0a;
  --sidebar-border: #ffffff;
  --sidebar-hover: rgba(255,255,255,0.06);
  --sidebar-active-bg: transparent;
  --sidebar-active-text: #f5f5f0;
  --table-header-bg: transparent;
  --table-hover: rgba(255,255,255,0.04);
  --modal-bg: #111111;
  --fg: #f5f5f0;
  --card-bg: #111111;
  --input-bg: #0a0a0a;
  --shadow-sm: none;
  --shadow-md: 0 2px 0 rgba(255,255,255,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --hair: rgba(255,255,255,0.16);
}

/* ── Base ───────────────────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.hidden { display: none !important; }

/* numbers / headings use Space Grotesk + tabular */
.card-value, .hero-metric-value, .heat-card-leads, .donut::after,
.page-header h2, .logo, .login-brand-logo, .login-box h1, .modal h3,
.bar-chart-title, .heatmap-title { font-family: 'Space Grotesk', sans-serif; }

.card-value, .hero-metric-value, .heat-card-leads, .heat-card-cr,
.bar-stats span, .chart-bar-count, .pagination, .donut::after, table td, table th {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ── Top accent line ────────────────────────────────────────────────────────── */
.top-accent-line {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  z-index: 9999;
}

/* ============================================================================
   LOGIN SCREEN — split, editorial
   ============================================================================ */
.login-screen { display: flex; height: 100vh; background: var(--bg); }

.login-brand {
  width: 42%;
  background: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-right: 2px solid var(--border);
}
.login-brand-content { position: relative; z-index: 2; text-align: left; padding: 56px; width: 100%; }
.login-brand-text { position: relative; z-index: 3; }
.login-brand-logo {
  font-size: 52px;
  font-weight: 700;
  color: var(--bg);
  letter-spacing: -0.04em;
  display: flex;
  align-items: center;
  gap: 16px;
}
.login-brand-logo .brand-icon {
  width: 18px; height: 44px;
  background: var(--accent);
  border-radius: 0;
  display: inline-block;
}
.login-brand-subtitle {
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  margin-top: 22px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}
:root.dark .login-brand-subtitle { color: rgba(245,245,240,0.5); }

/* Geometric shapes → editorial hairlines */
.login-brand-shapes { position: absolute; inset: 0; overflow: hidden; }
.shape { position: absolute; border-radius: 0; border: 1px solid rgba(255,255,255,0.08); }
.shape-1 { width: 70%; height: 1px; top: 33%; left: 0; background: rgba(255,255,255,0.1); border: 0; }
.shape-2 { width: 1px; height: 60%; top: 0; right: 30%; background: rgba(255,255,255,0.08); border: 0; }
.shape-3 { width: 160px; height: 160px; bottom: 12%; right: 10%; border: 1px solid rgba(255,255,255,0.07); background: transparent; }
.shape-4 { width: 70px; height: 70px; bottom: 18%; right: 18%; background: var(--accent); opacity: 0.5; border: 0; }

.login-form-panel {
  width: 58%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}
.login-box { width: 380px; max-width: 90%; }
.login-box h1 {
  font-size: 34px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}
.login-subtitle {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 36px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
}
.login-box .form-row { margin-bottom: 20px; }
.login-box .form-row label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 8px;
  display: block;
}
.login-box .form-row input {
  width: 100%;
  padding: 12px 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--hair);
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
}
.login-box .form-row input:focus {
  border-bottom-color: var(--accent);
  box-shadow: none;
  outline: none;
}
.login-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 16px;
}
.login-btn:hover { background: var(--accent-hover); }
.login-btn:active { transform: none; }

/* ============================================================================
   LAYOUT — top horizontal menu
   ============================================================================ */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Sidebar → top bar ──────────────────────────────────────────────────────── */
.sidebar {
  width: 100%;
  background: var(--sidebar-bg);
  border-right: none;
  border-bottom: 2px solid var(--sidebar-border);
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  transition: none;
  overflow: visible;
  z-index: 100;
  padding: 0 32px;
  gap: 0;
  flex-wrap: wrap;
}

.sidebar-header {
  padding: 0 28px 0 0;
  margin-right: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: none;
  border-right: 1px solid var(--hair);
  height: 60px;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.04em;
}
.logo-icon {
  width: 12px;
  height: 26px;
  background: var(--accent);
  border-radius: 0;
  display: inline-block;
  flex-shrink: 0;
}

/* collapse / expand buttons — hidden per spec */
.sidebar-collapse,
.sidebar-expand { display: none !important; }

/* ── Nav (horizontal) ───────────────────────────────────────────────────────── */
nav {
  overflow-x: auto;
  overflow-y: visible;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0;
  flex: 1;
  gap: 0;
  scrollbar-width: none;
}
nav::-webkit-scrollbar { display: none; }

.nav-group {
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
}

/* group labels hidden in top bar — keep accessible but out of flow */
.nav-label {
  display: none;
}

nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  margin: 0;
  height: 60px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 0;
  transition: color 0.15s;
  white-space: nowrap;
  overflow: visible;
  position: relative;
}
nav a svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.55; }
nav a:hover { color: var(--accent); background: transparent; }
nav a:hover svg { opacity: 1; }

nav a.active {
  color: var(--text);
  background: transparent;
  font-weight: 700;
}
nav a.active svg { opacity: 1; stroke: var(--accent); }
nav a.active::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
}

/* ── Sidebar footer → right side of bar ─────────────────────────────────────── */
.sidebar-footer {
  padding: 0 0 0 24px;
  border-top: none;
  border-left: 1px solid var(--hair);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  height: 60px;
  flex-shrink: 0;
  margin-left: auto;
}
.sidebar-user-row { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 0;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  flex-shrink: 0;
}
.user-name-text {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}
.theme-toggle {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--hair);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); background: transparent; }

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--hair);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.logout-btn:hover { color: var(--danger); border-color: var(--danger); background: transparent; }

/* collapsed state neutralised (button hidden) */
.sidebar.collapsed {
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 32px !important;
  border-right: none !important;
  border-bottom: 2px solid var(--sidebar-border) !important;
  overflow: visible !important;
}

.sidebar-overlay { display: none !important; }

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */
#main-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 40px 32px 56px;
  background: var(--bg);
  max-width: 1340px;
  margin: 0 auto;
  width: 100%;
}

/* ── Page header ────────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
}
.page-header h2 {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.035em;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────────── */
.breadcrumb {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .bc-sep { opacity: 0.4; }

/* ── Greeting ───────────────────────────────────────────────────────────────── */
.greeting {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ── Period toggle pills ────────────────────────────────────────────────────── */
.period-pills {
  display: inline-flex;
  gap: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  overflow: hidden;
}
.period-pill {
  padding: 7px 16px;
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--hair);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.period-pill:last-child { border-right: none; }
.period-pill:hover { color: var(--text); }
.period-pill.active { background: var(--accent); color: #fff; font-weight: 700; }

/* ============================================================================
   CARDS / METRICS — Swiss: big numbers divided by hairlines, no boxes
   ============================================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  margin-bottom: 28px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cards-bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 28px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.card-hero { grid-column: span 2; }

.card {
  background: transparent;
  border: none;
  border-right: 1px solid var(--hair);
  border-radius: 0;
  padding: 26px 26px 26px 0;
  transition: none;
  position: relative;
}
.cards .card:last-child,
.cards-bento .card:last-child { border-right: none; }
.card:hover { transform: none; box-shadow: none; }

.card-icon {
  width: 28px; height: 28px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 14px;
  border: 1px solid var(--hair);
}
.card-icon.blue   { background: transparent; color: var(--accent); border-color: var(--accent); }
.card-icon.green  { background: transparent; color: var(--success); border-color: var(--hair); }
.card-icon.red    { background: transparent; color: var(--danger); border-color: var(--hair); }
.card-icon.yellow { background: transparent; color: var(--warning); border-color: var(--hair); }

.card-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  margin-bottom: 16px;
}
.card-value {
  font-size: 42px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.035em;
  line-height: 0.95;
}
.card-value.green { color: var(--accent); }
.card-value.red   { color: var(--text); }
.card-value.blue  { color: var(--accent); }

/* sparkbar */
.spark-bar { display: flex; align-items: flex-end; gap: 2px; height: 24px; margin-top: 12px; }
.spark-bar div { width: 4px; background: var(--accent); border-radius: 0; opacity: 0.4; }

/* ============================================================================
   TABLES — editorial rules
   ============================================================================ */
.table-wrap {
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--table-header-bg);
  padding: 14px 16px 11px 0;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
tbody tr { border-bottom: 1px solid var(--hair); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--table-hover); }
tbody td {
  padding: 15px 16px 15px 0;
  color: var(--text-secondary);
  vertical-align: middle;
}

/* ── Dashboard table tabs ───────────────────────────────────────────────────── */
.table-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.table-tab {
  padding: 12px 0;
  margin-right: 24px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.table-tab:hover { color: var(--text); }
.table-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 700; }

/* ============================================================================
   STATUS CHIPS — flat, dot-prefixed
   ============================================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  border-radius: 0;
  background: transparent !important;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}
.badge-approved   { color: var(--accent); }
.badge-rejected   { color: var(--muted); }
.badge-pending    { color: var(--warning); }
.badge-sent       { color: var(--accent); }
.badge-hold       { color: var(--muted); }
.badge-chargeback { color: var(--danger); }
.badge-declined   { color: var(--danger); }
.badge-queued     { color: var(--accent); }
.badge-new        { color: var(--accent); }

/* ============================================================================
   BUTTONS
   ============================================================================ */
button {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:active { transform: none; }
button:disabled { opacity: 0.35; cursor: not-allowed; }

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
button.secondary:hover { background: transparent; border-color: var(--accent); color: var(--accent); }

button.danger { background: var(--danger); border-color: var(--danger); }
button.danger:hover { background: #991b1b; border-color: #991b1b; }

button.sm { padding: 6px 12px; font-size: 9.5px; }

button.text-btn {
  background: none;
  color: var(--accent);
  border: none;
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
button.text-btn:hover { background: transparent; text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================================
   FORMS
   ============================================================================ */
input, select, textarea {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--input-bg);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: none;
}
input::placeholder { color: var(--muted); }

/* Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; align-items: center; }
.filter-bar select, .filter-bar input { border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px; }

/* Search bar */
.search-bar { position: relative; margin-bottom: 18px; }
.search-bar input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  border: 1px solid var(--hair);
  background: var(--surface);
}
.search-bar input:focus { border-color: var(--accent); box-shadow: none; }
.search-bar .search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

/* ============================================================================
   MODALS
   ============================================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,10,10,0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--modal-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  width: 500px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}
.modal h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 22px;
  color: var(--text);
  letter-spacing: -0.025em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-row { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.form-row label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.form-row input, .form-row select, .form-row textarea { width: 100%; }

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ============================================================================
   PAGINATION
   ============================================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--muted);
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: calc(200px + 100%) 0; } }

#main-content > * { animation: slideUp 0.2s ease; }

.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--hair) 50%, var(--border-light) 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ============================================================================
   NOTIFICATION PANEL (kept for completeness; hidden via override)
   ============================================================================ */
.notif-bell {
  position: fixed; top: 14px; right: 24px; z-index: 1000; cursor: pointer;
  width: 36px; height: 36px; border-radius: 0;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: color 0.15s;
}
.notif-bell:hover { background: transparent; color: var(--text); }
.notif-badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 50%; width: 18px; height: 18px; line-height: 18px; text-align: center;
}
.notif-panel {
  position: fixed; top: 56px; right: 20px; width: 380px; max-height: 440px;
  overflow-y: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); z-index: 1001; box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

/* ============================================================================
   FAB (kept; hidden via override)
   ============================================================================ */
.fab-container { position: fixed; bottom: 28px; right: 28px; z-index: 998; }
.fab-btn {
  width: 52px; height: 52px; border-radius: 0;
  background: var(--accent); color: #fff; border: none;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  padding: 0; cursor: pointer; transition: background 0.2s;
}
.fab-btn:hover { background: var(--accent-hover); }
.fab-menu {
  display: none; position: absolute; bottom: 62px; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  min-width: 160px; padding: 6px; animation: slideUp 0.2s ease;
}
.fab-menu.open { display: block; }
.fab-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: none; border: none; color: var(--text);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.1s;
}
.fab-menu-item:hover { background: var(--sidebar-hover); }

/* ============================================================================
   CHART BARS
   ============================================================================ */
.chart-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 0; padding: 12px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.chart-bar-label {
  width: 120px; color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chart-bar-track { flex: 1; background: var(--border-light); border-radius: 0; height: 4px; }
.chart-bar-fill { height: 100%; border-radius: 0; background: var(--accent); transition: width 0.3s ease; }
.chart-bar-count {
  width: 50px; text-align: right; font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

/* ============================================================================
   AI CHAT WIDGET (kept; hidden via override)
   ============================================================================ */
.chat-btn {
  position: fixed; bottom: 28px; right: 92px; width: 48px; height: 48px;
  border-radius: 0; background: var(--accent); box-shadow: var(--shadow-md);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 20px; z-index: 997; transition: background 0.2s; padding: 0;
}
.chat-btn:hover { background: var(--accent-hover); }
.chat-window {
  position: fixed; bottom: 88px; right: 28px; width: 380px; height: 500px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  display: flex; flex-direction: column; z-index: 998; box-shadow: var(--shadow-lg);
  overflow: hidden; animation: slideUp 0.25s ease;
}
.chat-header {
  padding: 14px 18px; background: var(--accent); display: flex;
  align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; color: #fff;
}
.chat-header span { font-size: 11px; opacity: 0.8; display: block; font-weight: 400; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 85%; padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.chat-msg.user { align-self: flex-end; background: var(--accent); color: #fff; }
.chat-msg.bot { align-self: flex-start; background: var(--sidebar-hover); color: var(--text); }
.chat-msg.typing { color: var(--muted); font-style: italic; }
.chat-input-row { padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.chat-input-row input { flex: 1; border-radius: var(--radius-sm); padding: 8px 14px; }
.chat-input-row button { border-radius: var(--radius-sm); width: 36px; height: 36px; padding: 0; font-size: 16px; flex-shrink: 0; }

/* ============================================================================
   LEAD DETAIL
   ============================================================================ */
.lead-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.detail-field label {
  font-size: 10px; color: var(--muted); display: block; margin-bottom: 5px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em;
}
.detail-field span { font-size: 14px; color: var(--text); }

/* ============================================================================
   TOOLTIPS & SCORE
   ============================================================================ */
.tooltip-wrap { position: relative; display: inline-block; cursor: default; }
.tooltip-box {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--surface); color: var(--text); font-size: 12px; padding: 8px 12px;
  border-radius: var(--radius-md); white-space: normal; max-width: 320px; word-break: break-word;
  z-index: 999; border: 1px solid var(--border); box-shadow: var(--shadow-lg); pointer-events: none;
}
.tooltip-wrap:hover .tooltip-box { display: block; }

.score-hover { position: relative; display: inline-block; }
.score-hover .score-tip {
  display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 8px 12px; font-size: 11px; font-weight: 400; white-space: nowrap; z-index: 1000;
  box-shadow: var(--shadow-lg); pointer-events: none; min-width: 180px; text-align: left; margin-bottom: 6px;
}
.score-hover .score-tip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--border);
}
.score-hover:hover .score-tip { display: block; }

.status-tooltip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px; min-width: 220px; box-shadow: var(--shadow-lg); }
.status-history-row { display: flex; align-items: center; gap: 6px; padding: 4px 8px; font-size: 12px; border-bottom: 1px solid var(--border-light); }
.status-history-row:last-child { border-bottom: none; }
.sh-date { color: var(--muted); min-width: 90px; font-size: 11px; }

/* ============================================================================
   BRANDING
   ============================================================================ */
.color-preview { width: 36px; height: 36px; border-radius: 0; border: 1px solid var(--border); flex-shrink: 0; }
.logo-preview { max-height: 60px; max-width: 200px; object-fit: contain; border-radius: 0; }
.palette-swatch { width: 32px; height: 32px; border-radius: 0; display: inline-block; border: 1px solid var(--border); }

/* ── Copy / error ──────────────────────────────────────────────────────────── */
.copy-btn { font-size: 9.5px; padding: 4px 10px; }
.error { color: var(--danger); font-size: 12px; margin-top: 8px; }

/* ── Filters legacy ────────────────────────────────────────────────────────── */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; align-items: center; }

/* ============================================================================
   MOBILE RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
  .login-screen { flex-direction: column; }
  .login-brand { width: 100%; height: 160px; flex-shrink: 0; border-right: none; border-bottom: 2px solid var(--border); }
  .login-brand-content { padding: 28px; }
  .login-brand-logo { font-size: 34px; }
  .login-form-panel { width: 100%; flex: 1; padding: 24px; }
  .login-box { width: 100%; max-width: 380px; }

  /* top bar stays horizontal & scrolls */
  .sidebar { padding: 0 14px; height: auto; min-height: 52px; }
  .sidebar-header { height: 52px; padding-right: 16px; }
  .logo { font-size: 18px; }
  nav a { height: 52px; padding: 0 12px; font-size: 10px; }
  nav a span { display: inline; }
  .sidebar-footer { padding-left: 14px; gap: 10px; height: 52px; }
  .user-name-text { display: none; }
  .logout-btn span { display: none; }

  #main-content { padding: 24px 14px 32px; }

  #app { flex-direction: column; }
  body { overflow: auto; }
  #app { height: auto; min-height: 100vh; overflow: visible; }

  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header h2 { font-size: 24px; }

  .cards { grid-template-columns: repeat(2, 1fr); gap: 0; }
  .card { padding: 18px 16px; border-bottom: 1px solid var(--hair); }
  .cards-bento { grid-template-columns: 1fr; }
  .card-hero { grid-column: span 1; }
  .card-value { font-size: 32px; }

  .filters, .filter-bar { flex-direction: column; align-items: stretch; }
  .filters select, .filters input, .filters button,
  .filter-bar select, .filter-bar input { width: 100%; }

  div[style*="grid-template-columns:repeat(auto-fill"] { grid-template-columns: 1fr 1fr !important; gap: 6px !important; }

  .table-wrap { border-radius: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 11px; min-width: 700px; }
  thead th { padding: 8px 8px; font-size: 9px; }
  tbody td { padding: 10px 8px; }

  .pagination { font-size: 10px; gap: 8px; }

  .modal { width: 95vw; max-height: 85vh; padding: 20px; border-radius: var(--radius-md); }
  .modal h3 { font-size: 18px; margin-bottom: 14px; }
  .lead-detail-grid { grid-template-columns: 1fr; gap: 10px; }

  .chat-btn { bottom: 16px; right: 72px; width: 44px; height: 44px; font-size: 18px; }
  .chat-window { bottom: 0; right: 0; left: 0; width: 100%; height: 100%; border-radius: 0; position: fixed; }
  .fab-container { bottom: 16px; right: 16px; }
  .fab-btn { width: 46px; height: 46px; }

  div[style*="grid-template-columns: 1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }
  div[style*="display:flex"][style*="gap:16px"] { flex-wrap: wrap; }

  .chart-bar-label { width: 80px; font-size: 10px; }
  .copy-btn { font-size: 11px; padding: 6px 12px; }

  .notif-bell { top: 10px; right: 12px; }
  .notif-panel { width: calc(100vw - 24px); right: 12px; }
}

@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
  .card-value { font-size: 30px; }
  div[style*="grid-template-columns:repeat(auto-fill"] { grid-template-columns: 1fr !important; }
  .page-header > div { width: 100%; flex-wrap: wrap; }
  table { min-width: 600px; font-size: 10px; }
  thead th { padding: 6px 6px; font-size: 9px; }
  tbody td { padding: 8px 6px; }
  .period-pills { flex-wrap: wrap; }
}

/* ============================================================================
   VISUAL ANALYTICS DASHBOARD & CARD GRID LEADS
   ============================================================================ */

/* ── Hero Metric ──────────────────────────────────────────────────────────── */
.hero-metric {
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-md);
  padding: 36px 40px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.hero-metric::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 6px; height: 100%;
  background: var(--accent);
}
.hero-metric-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 12px;
}
:root.dark .hero-metric-label { color: rgba(245,245,240,0.5); }
.hero-metric-value {
  font-size: 60px;
  font-weight: 600;
  color: var(--bg);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 16px;
}
.hero-metric-compare {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 0;
  border-radius: 0;
  background: transparent !important;
}
.hero-metric-compare.up { color: #93b4ff; }
.hero-metric-compare.down { color: rgba(255,255,255,0.5); }
.hero-metric-compare.neutral { color: rgba(255,255,255,0.5); }
.hero-progress-track {
  margin-top: 22px;
  height: 4px;
  background: rgba(255,255,255,0.14);
  border-radius: 0;
  overflow: hidden;
}
.hero-progress-fill {
  height: 100%;
  border-radius: 0;
  background: var(--accent);
  transition: width 1s cubic-bezier(.22,1,.36,1);
}

/* ── Donut Charts Row ─────────────────────────────────────────────────────── */
.donut-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-bottom: 28px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.donut-card {
  background: transparent;
  border: none;
  border-right: 1px solid var(--hair);
  border-radius: 0;
  padding: 28px 24px;
  display: flex; flex-direction: column; align-items: center;
  transition: none;
}
.donut-row .donut-card:last-child { border-right: none; }
.donut-card:hover { transform: none; box-shadow: none; }
.donut-card-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); margin-bottom: 18px; }
.donut { width: 130px; height: 130px; border-radius: 50%; position: relative; margin-bottom: 16px; transition: none; }
.donut:hover { transform: none; }
.donut::after {
  content: attr(data-label); position: absolute; inset: 22px; background: var(--bg);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600; color: var(--text);
}
.donut-legend { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.donut-legend-item { display: flex; align-items: center; gap: 5px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; color: var(--muted); }
.donut-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Bar Chart (Horizontal) ──────────────────────────────────────────────── */
.bar-chart-card { background: transparent; border: none; border-top: 1px solid var(--border); border-radius: 0; padding: 24px 0; margin-bottom: 28px; }
.bar-chart-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text); margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.bar-chart-title .bar-chart-icon { width: 26px; height: 26px; border-radius: 0; background: transparent; border: 1px solid var(--hair); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.bar-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--hair); }
.bar-row:last-child { border-bottom: none; }
.bar-rank { width: 22px; height: 22px; border-radius: 0; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bar-label { width: 140px; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.bar-track { flex: 1; height: 4px; background: var(--border-light); border-radius: 0; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 0; background: var(--accent); transition: width 0.8s cubic-bezier(.22,1,.36,1); min-width: 0; }
.bar-stats { display: flex; gap: 14px; flex-shrink: 0; font-size: 12px; }
.bar-stats span { white-space: nowrap; }
.bar-stats .bar-leads { color: var(--text); font-weight: 700; font-family: 'Space Grotesk', sans-serif; }
.bar-stats .bar-cr { color: var(--accent); font-weight: 600; font-family: 'Space Grotesk', sans-serif; }

/* ── Country Heatmap Grid ─────────────────────────────────────────────────── */
.heatmap-card { background: transparent; border: none; border-top: 1px solid var(--border); border-radius: 0; padding: 24px 0; margin-bottom: 28px; }
.heatmap-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.country-heatmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0; border-left: 1px solid var(--hair); border-top: 1px solid var(--hair); }
.heat-card {
  border-radius: 0; padding: 16px 12px; text-align: left; transition: none;
  border: none; border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  position: relative; overflow: hidden;
}
.heat-card:hover { transform: none; box-shadow: none; background: var(--table-hover); }
.heat-card-flag { font-size: 20px; margin-bottom: 6px; }
.heat-card-code { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px; }
.heat-card-leads { font-size: 24px; font-weight: 600; color: var(--text); margin-bottom: 2px; letter-spacing: -0.03em; }
.heat-card-cr { font-size: 11px; font-weight: 700; }

/* ── Dashboard Grid Layout ────────────────────────────────────────────────── */
.dash-grid-2col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; margin-bottom: 28px; }

/* ============================================================================
   LEADS — Card Grid View
   ============================================================================ */
.leads-view-toggle {
  display: inline-flex; gap: 0; background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0; margin-right: 8px; overflow: hidden;
}
.view-btn {
  padding: 7px 14px; border-radius: 0; border: none; border-right: 1px solid var(--hair);
  background: transparent; color: var(--muted); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; font-family: inherit; cursor: pointer;
  transition: all 0.15s; display: inline-flex; align-items: center; gap: 5px;
}
.view-btn:last-child { border-right: none; }
.view-btn:hover { color: var(--text); background: transparent; }
.view-btn.active { background: var(--accent); color: #fff; font-weight: 700; }

/* Status chip filters */
.status-chips { display: flex; gap: 0; flex-wrap: wrap; margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; width: fit-content; }
.chip {
  padding: 7px 16px; border-radius: 0; border: none; border-right: 1px solid var(--hair);
  background: transparent; color: var(--muted); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; font-family: inherit; cursor: pointer;
  transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px;
}
.chip:last-child { border-right: none; }
.chip:hover { color: var(--accent); background: transparent; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.chip .chip-count {
  background: var(--hair); color: var(--text); padding: 0 6px; border-radius: 0;
  font-size: 10px; font-weight: 700; line-height: 18px; font-family: 'Space Grotesk', sans-serif;
}
.chip.active .chip-count { background: rgba(255,255,255,0.25); color: #fff; }

/* Leads Grid */
.leads-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0; margin-bottom: 20px; border-left: 1px solid var(--hair); border-top: 1px solid var(--hair); }
.lead-card {
  background: transparent; border: none; border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
  border-radius: 0; padding: 0; overflow: hidden; cursor: pointer; transition: background 0.15s; position: relative;
}
.lead-card:hover { transform: none; box-shadow: none; border-color: var(--hair); background: var(--table-hover); }
.lead-card-stripe { height: 3px; width: 100%; }
.lead-card-stripe.approved  { background: var(--accent); }
.lead-card-stripe.rejected  { background: var(--muted); }
.lead-card-stripe.pending   { background: var(--warning); }
.lead-card-stripe.sent      { background: var(--accent); }
.lead-card-stripe.hold      { background: var(--muted); }
.lead-card-stripe.chargeback { background: var(--danger); }
.lead-card-stripe.declined  { background: var(--danger); }
.lead-card-stripe.queued    { background: var(--accent); }
.lead-card-stripe.new       { background: var(--accent); }

.lead-card-body { padding: 18px 16px; }
.lead-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.lead-card-name { font-size: 15px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.015em; color: var(--text); line-height: 1.25; }
.lead-card-id { font-size: 10px; color: var(--muted); margin-top: 1px; }
.lead-card-email { font-size: 12px; color: var(--muted); margin-bottom: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lead-card-meta-item { font-size: 11.5px; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-card-meta-item .meta-icon { color: var(--muted); flex-shrink: 0; opacity: 0.6; }
.lead-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair); }
.lead-card-time { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.lead-card-sale-status { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 0; border-radius: 0; }

/* Lead drawer */
.lead-drawer-overlay { position: fixed; inset: 0; background: rgba(10,10,10,0.45); backdrop-filter: blur(2px); z-index: 1000; animation: fadeIn 0.2s ease; }
.lead-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; max-height: 85vh; background: var(--modal-bg);
  border-top-left-radius: var(--radius-md); border-top-right-radius: var(--radius-md);
  border-top: 2px solid var(--border); box-shadow: var(--shadow-lg); z-index: 1001;
  overflow-y: auto; padding: 28px 32px; animation: slideUpDrawer 0.3s ease;
}
@keyframes slideUpDrawer { from { transform: translateY(100%); } to { transform: translateY(0); } }
.lead-drawer-handle { width: 40px; height: 3px; background: var(--border); border-radius: 0; margin: 0 auto 20px; }

/* ── Responsive adjustments ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-metric { padding: 24px; }
  .hero-metric-value { font-size: 40px; }
  .donut-row { grid-template-columns: 1fr; }
  .donut-card { border-right: none; border-bottom: 1px solid var(--hair); }
  .donut { width: 100px; height: 100px; }
  .donut::after { inset: 18px; font-size: 16px; }
  .dash-grid-2col { grid-template-columns: 1fr; gap: 24px; }
  .leads-grid { grid-template-columns: 1fr; }
  .bar-label { width: 90px; font-size: 11px; }
  .country-heatmap { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .lead-drawer { padding: 20px; max-height: 90vh; }
  .bar-stats { gap: 8px; font-size: 11px; }
}
@media (max-width: 480px) {
  .donut-row { grid-template-columns: 1fr; }
  .leads-grid { grid-template-columns: 1fr; }
  .status-chips { width: 100%; }
  .chip { padding: 6px 10px; font-size: 9.5px; flex: 1; justify-content: center; }
}

/* ============================================================================
   OVERRIDES — hide chat / FAB / notif (kept from original)
   ============================================================================ */
.chat-btn, .chat-widget, #quick-actions-fab, #chat-toggle-btn, .chat-window,
.fab-container, .fab-btn, .fab-menu,
#notif-bell, #notif-panel {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ── Top bar light mode ─────────────────────────────────────────────────────── */
.sidebar {
  background: var(--bg) !important;
  border-right: none !important;
  border-bottom: 2px solid #000000 !important;
}
.sidebar .logo, .sidebar .logo span, .sidebar .logo-text { color: #0a0a0a !important; }
.sidebar .nav-label { color: var(--muted) !important; }
.sidebar nav a { color: #6b6b66 !important; }
.sidebar nav a svg { stroke: #6b6b66 !important; }
.sidebar nav a:hover:not(.active) { color: #1d4ed8 !important; background: transparent !important; }
.sidebar nav a:hover:not(.active) svg { stroke: #1d4ed8 !important; }
.sidebar nav a.active { color: #0a0a0a !important; background: transparent !important; }
.sidebar nav a.active svg { stroke: #1d4ed8 !important; }
.sidebar-header { border-bottom: none !important; border-right: 1px solid rgba(0,0,0,0.14) !important; }
.sidebar-footer { border-top: none !important; border-left: 1px solid rgba(0,0,0,0.14) !important; color: #6b6b66 !important; }
.sidebar .user-avatar { background: #0a0a0a !important; color: #fbfbf9 !important; }
.sidebar .user-name-text { color: #0a0a0a !important; }
.sidebar .theme-toggle { color: #6b6b66 !important; border-color: rgba(0,0,0,0.14) !important; background: transparent !important; }
.sidebar .theme-toggle:hover { color: #1d4ed8 !important; border-color: #1d4ed8 !important; background: transparent !important; }
.sidebar .logout-btn { color: #6b6b66 !important; border-color: rgba(0,0,0,0.14) !important; }
.sidebar .logout-btn:hover { color: #b91c1c !important; border-color: #b91c1c !important; background: transparent !important; }

/* ── Top bar dark mode ──────────────────────────────────────────────────────── */
:root.dark .sidebar {
  background: #0a0a0a !important;
  border-right: none !important;
  border-bottom: 2px solid #ffffff !important;
}
:root.dark .sidebar .logo, :root.dark .sidebar .logo-text { color: #f5f5f0 !important; }
:root.dark .sidebar .nav-label { color: rgba(245,245,240,0.45) !important; }
:root.dark .sidebar nav a { color: rgba(245,245,240,0.6) !important; }
:root.dark .sidebar nav a svg { stroke: rgba(245,245,240,0.6) !important; }
:root.dark .sidebar nav a:hover:not(.active) { color: #6691ff !important; background: transparent !important; }
:root.dark .sidebar nav a:hover:not(.active) svg { stroke: #6691ff !important; }
:root.dark .sidebar nav a.active { color: #f5f5f0 !important; background: transparent !important; }
:root.dark .sidebar nav a.active svg { stroke: #6691ff !important; }
:root.dark .sidebar-header { border-bottom: none !important; border-right: 1px solid rgba(255,255,255,0.16) !important; }
:root.dark .sidebar-footer { border-top: none !important; border-left: 1px solid rgba(255,255,255,0.16) !important; color: rgba(245,245,240,0.7) !important; }
:root.dark .sidebar .user-avatar { background: #f5f5f0 !important; color: #0a0a0a !important; }
:root.dark .sidebar .user-name-text { color: #f5f5f0 !important; }
:root.dark .sidebar .theme-toggle { color: rgba(245,245,240,0.6) !important; border-color: rgba(255,255,255,0.16) !important; background: transparent !important; }
:root.dark .sidebar .theme-toggle:hover { color: #6691ff !important; border-color: #6691ff !important; background: transparent !important; }
:root.dark .sidebar .logout-btn { color: rgba(245,245,240,0.6) !important; border-color: rgba(255,255,255,0.16) !important; }
:root.dark .sidebar .logout-btn:hover { color: #f87171 !important; border-color: #f87171 !important; background: transparent !important; }

/* ============================================================================
   EDITORIAL DASHBOARD — Swiss mockup layout
   numbered sections · metric grid · black finance strip · leads table + geo bars
   ============================================================================ */
.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  border-bottom: 1px solid var(--border);
  padding: 32px 0 10px;
}
.sec-head:first-child { padding-top: 4px; }
.sec-head h2 {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text);
}
.sec-head .idx {
  font-size: 10px; letter-spacing: 0.16em; color: var(--muted);
  text-transform: uppercase; font-weight: 600; white-space: nowrap;
}
.sec-right { display: flex; align-items: center; gap: 18px; }
.sec-right .period-pills { transform: scale(0.9); transform-origin: right center; }

/* metric grid */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border);
}
.metrics .metric { padding: 28px 26px 28px 0; border-right: 1px solid var(--hair); }
.metrics .metric:last-child { border-right: none; padding-right: 0; }
.metrics .metric .label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em;
  font-weight: 600; color: var(--muted); margin-bottom: 16px;
}
.metrics .metric .big {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 46px;
  line-height: 0.95; letter-spacing: -0.035em; color: var(--text);
}
.metrics .metric .big .pct { font-size: 26px; }
.metrics .metric .sub { margin-top: 14px; display: flex; align-items: center; gap: 10px; }
.metrics .delta { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 12.5px; }
.metrics .delta.up { color: var(--accent); }
.metrics .delta.down { color: var(--muted); }
.metrics .note { font-size: 11px; color: var(--muted); }

/* finance strip (black) */
.finance {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #0a0a0a; color: #fff;
}
.finance .fin { padding: 24px 26px; border-right: 1px solid rgba(255,255,255,0.12); }
.finance .fin:last-child { border-right: none; }
.finance .fin .label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.16em;
  font-weight: 600; color: rgba(255,255,255,0.55);
}
.finance .fin .v {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 30px;
  margin-top: 12px; letter-spacing: -0.03em; color: #fff;
}
.finance .fin.accent .v { color: var(--accent); }
.finance .fin .bar { height: 3px; background: rgba(255,255,255,0.14); margin-top: 16px; position: relative; }
.finance .fin .bar i { position: absolute; left: 0; top: 0; height: 100%; background: #fff; display: block; transition: width 0.8s cubic-bezier(.22,1,.36,1); }
.finance .fin.accent .bar i { background: var(--accent); }

/* two columns: recent leads + top geos */
.cols { display: grid; grid-template-columns: 1.85fr 1fr; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.cols .col-left { border-right: 1px solid var(--hair); }
.cols .col-pad { padding: 0 30px 24px 0; }
.cols .col-right .col-pad { padding: 0 0 24px 30px; }
.subhead { padding: 24px 0 4px; }
.subhead .label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em; font-weight: 600; color: var(--muted); }
.cols table td.right, .cols table th.right { text-align: right; padding-right: 0; }
.cols .lead-name { font-family: 'Space Grotesk', sans-serif; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.cols .geo { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.cols .offer { font-size: 12.5px; color: var(--text-secondary); }
.cols .val { font-family: 'Space Grotesk', sans-serif; font-weight: 600; color: var(--text); }

/* status dots (table) */
.status { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status.appr::before { background: var(--accent); }
.status.appr { color: var(--text); }
.status.pend::before { background: transparent; border: 1px solid var(--text); }
.status.pend { color: var(--muted); }
.status.rej::before { background: var(--hair); }
.status.rej { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--hair); }

/* top geos rank rows */
.geos { padding-top: 2px; }
.georow { display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--hair); }
.georow:last-child { border-bottom: none; }
.georow .rank { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 13px; color: var(--muted); }
.georow .gname { font-weight: 600; font-size: 13px; color: var(--text); }
.georow .gpct { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 14px; text-align: right; color: var(--text); }
.georow .gbar { grid-column: 2 / 3; height: 4px; background: var(--hair); margin-top: 9px; position: relative; }
.georow .gbar i { position: absolute; left: 0; top: 0; height: 100%; background: var(--text); display: block; transition: width 0.8s cubic-bezier(.22,1,.36,1); }
.georow:first-child .gbar i { background: var(--accent); }
.georow .gleads { grid-column: 3 / 4; font-size: 10px; color: var(--muted); text-align: right; letter-spacing: 0.04em; margin-top: 4px; }

/* logo: ADSYAFF. with cobalt dot */
.sidebar .logo { font-family: 'Space Grotesk', sans-serif; text-transform: uppercase; letter-spacing: -0.03em; font-weight: 700; }
.sidebar .logo::after { content: "."; color: var(--accent); }

/* dual-theme — toggle visible (editorial light + dark) */

@media (max-width: 1000px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .finance { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
  .cols .col-left { border-right: none; border-bottom: 1px solid var(--hair); }
  .cols .col-pad, .cols .col-right .col-pad { padding: 0 0 20px; }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: 1fr; }
  .finance { grid-template-columns: 1fr; }
  .metrics .metric { border-right: none; border-bottom: 1px solid var(--hair); padding: 22px 0; }
  .metrics .metric:last-child { border-bottom: none; }
  .finance .fin { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.12); }
  .metrics .metric .big { font-size: 38px; }
  .sec-right .period-pills { transform: scale(0.82); }
}

/* ── Reconciliation (сверка) — theme-inherited via vars ───────────────────── */
.recon-controls { display: flex; gap: 8px; align-items: center; }
.recon-period-label { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.recon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .recon-grid { grid-template-columns: 1fr; } }
.recon-col-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.recon-col-count { background: rgba(var(--accent-rgb, 99,102,241), .14); color: var(--accent); border-radius: 20px; padding: 1px 9px; font-size: 12px; }
.recon-empty, .recon-loading { color: var(--muted); font-size: 13px; padding: 18px 0; }
.recon-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 12px); padding: 16px 18px; margin-bottom: 14px; }
.recon-card.is-paid { opacity: .72; }
.recon-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.recon-party-name { font-weight: 700; font-size: 15px; color: var(--text); }
.recon-party-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.recon-amount { text-align: right; flex-shrink: 0; }
.recon-amount-val { font-weight: 700; font-size: 18px; color: var(--accent); }
.recon-status { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; margin-top: 2px; }
.recon-status.paid { color: #15a06b; }
.recon-status.unpaid { color: var(--warning, #d9881f); }
.recon-section { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.recon-section-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.recon-li { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; color: var(--text); }
.recon-geos { font-size: 13px; color: var(--text); }
.recon-inv-email { font-size: 12px; color: var(--muted); font-family: var(--mono, ui-monospace, monospace); }
.recon-pay { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.recon-hash-input { flex: 1; min-width: 160px; padding: 7px 11px; font-size: 12px; }
.recon-hash { font-size: 12px; color: var(--muted); flex: 1; }
.recon-hash code { color: var(--text); }

/* fix(country-picker): checkbox/radio inside .form-row must not inherit width:100% */
.form-row input[type="checkbox"], .form-row input[type="radio"] { width: auto; flex: 0 0 auto; padding: 0; margin: 0; }
