/* BrandHealth — World-class Light Theme Design System */
/* Color inspiration: Linear, Notion, Stripe, Sprout Social */

:root {
  /* Core palette */
  --white:    #ffffff;
  --bg:       #f8f9fc;
  --bg2:      #ffffff;
  --bg3:      #f1f4f9;
  --bg4:      #e8ecf4;

  /* Borders */
  --border:   #e2e8f0;
  --border2:  #cbd5e1;

  /* Brand colors */
  --accent:   #4f46e5;   /* Indigo — trust, premium */
  --accent2:  #6366f1;
  --accent-lt:#eef2ff;   /* Light indigo bg */

  --green:    #10b981;
  --green-lt: #ecfdf5;
  --red:      #ef4444;
  --red-lt:   #fef2f2;
  --yellow:   #f59e0b;
  --yellow-lt:#fffbeb;
  --purple:   #8b5cf6;
  --purple-lt:#f5f3ff;
  --blue:     #3b82f6;
  --blue-lt:  #eff6ff;
  --orange:   #f97316;
  --orange-lt:#fff7ed;
  --pink:     #ec4899;
  --pink-lt:  #fdf2f8;

  /* Text */
  --text:     #0f172a;
  --text2:    #475569;
  --text3:    #94a3b8;
  --text4:    #cbd5e1;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --shadow:    0 4px 12px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
  --shadow-md: 0 8px 24px rgba(15,23,42,.10), 0 4px 8px rgba(15,23,42,.06);
  --shadow-lg: 0 20px 48px rgba(15,23,42,.12), 0 8px 16px rgba(15,23,42,.08);

  /* Typography */
  --fh: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --fm: 'JetBrains Mono', 'Fira Code', monospace;

  /* Radii */
  --r-sm: 6px;
  --r:    10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
}

/* ── Reset ───────────────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { -webkit-font-smoothing:antialiased; font-size:15px; }
body { background:var(--bg); color:var(--text); font-family:var(--fh); line-height:1.5; }

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--border2); border-radius:10px; }
::-webkit-scrollbar-thumb:hover { background:var(--text3); }

/* ── Typography ──────────────────────────────────── */
h1 { font-size:clamp(28px,4vw,44px); font-weight:800; letter-spacing:-1.5px; line-height:1.1; }
h2 { font-size:clamp(22px,3vw,34px); font-weight:700; letter-spacing:-0.8px; }
h3 { font-size:18px; font-weight:700; letter-spacing:-0.3px; }
h4 { font-size:14px; font-weight:700; }
p  { color:var(--text2); }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--r); border: none;
  font-family: var(--fh); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 3px rgba(79,70,229,.3);
}
.btn-primary:hover { background:#4338ca; box-shadow:0 4px 12px rgba(79,70,229,.35); transform:translateY(-1px); }
.btn-secondary {
  background: var(--white); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { border-color:var(--border2); background:var(--bg3); }
.btn-ghost { background:transparent; color:var(--text2); border:1px solid transparent; }
.btn-ghost:hover { background:var(--bg3); color:var(--text); }
.btn-danger { background:var(--red-lt); color:var(--red); border:1px solid #fecaca; }
.btn-danger:hover { background:var(--red); color:#fff; }
.btn-green { background:var(--green-lt); color:var(--green); border:1px solid #a7f3d0; }
.btn-green:hover { background:var(--green); color:#fff; }
.btn-sm { padding:6px 12px; font-size:13px; border-radius:var(--r-sm); }
.btn-lg { padding:13px 28px; font-size:16px; border-radius:var(--r-md); }
.btn-xl { padding:16px 36px; font-size:17px; border-radius:var(--r-md); font-weight:700; }

/* ── Form controls ───────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text2); margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px; border-radius: var(--r);
  border: 1.5px solid var(--border); background: var(--white);
  color: var(--text); font-size: 14px; font-family: var(--fh);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-input::placeholder { color:var(--text4); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size:12px; color:var(--text3); margin-top:5px; }

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size:14px; font-weight:700; color:var(--text); }
.card-body { padding: 22px; }

/* ── Stat cards ──────────────────────────────────── */
.stat-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 20px 22px;
  box-shadow: var(--shadow-sm); position: relative;
  overflow: hidden; transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 14px;
}
.stat-label { font-size: 12px; font-weight: 600; color: var(--text3); text-transform:uppercase; letter-spacing:.5px; margin-bottom:6px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing:-1px; color:var(--text); }
.stat-delta { font-size: 12px; font-weight: 600; margin-top: 6px; display:flex; align-items:center; gap:4px; }
.delta-up   { color: var(--green); }
.delta-down { color: var(--red); }
.delta-neutral { color: var(--text3); }

/* ── Badges ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: 20px; white-space: nowrap;
}
.badge-indigo  { background:var(--accent-lt); color:var(--accent); }
.badge-green   { background:var(--green-lt);  color:var(--green);  }
.badge-red     { background:var(--red-lt);    color:var(--red);    }
.badge-yellow  { background:var(--yellow-lt); color:var(--yellow); }
.badge-purple  { background:var(--purple-lt); color:var(--purple); }
.badge-blue    { background:var(--blue-lt);   color:var(--blue);   }
.badge-gray    { background:var(--bg3);       color:var(--text2);  }

/* Plan badges */
.plan-badge { font-size:10px; font-weight:700; padding:2px 8px; border-radius:4px; letter-spacing:.3px; }
.plan-starter    { background:#e0e7ff; color:#4f46e5; }
.plan-growth     { background:#d1fae5; color:#059669; }
.plan-agency     { background:#fef3c7; color:#d97706; }
.plan-enterprise { background:#ede9fe; color:#7c3aed; }
.plan-trial      { background:#f1f5f9; color:#64748b; }
.plan-trialing   { background:#f1f5f9; color:#64748b; }

/* Sentiment badges */
.sent-positive { background:var(--green-lt); color:var(--green); }
.sent-negative { background:var(--red-lt);   color:var(--red);   }
.sent-neutral  { background:var(--bg3);      color:var(--text2); }

/* Source type badges */
.src-news      { background:var(--blue-lt);   color:var(--blue);   }
.src-india_news{ background:var(--orange-lt); color:var(--orange); }
.src-social    { background:var(--purple-lt); color:var(--purple); }
.src-tech      { background:var(--green-lt);  color:var(--green);  }
.src-review    { background:var(--yellow-lt); color:var(--yellow); }
.src-podcast   { background:var(--pink-lt);   color:var(--pink);   }

/* ── Tables ──────────────────────────────────────── */
.table { width:100%; border-collapse:collapse; }
.table th {
  padding: 10px 14px; text-align:left; font-size:12px;
  font-weight:600; color:var(--text3); text-transform:uppercase;
  letter-spacing:.5px; border-bottom:1.5px solid var(--border);
  background:var(--bg);
}
.table td {
  padding: 12px 14px; border-bottom:1px solid var(--border);
  font-size:14px; color:var(--text2);
}
.table tr:last-child td { border-bottom:none; }
.table tr:hover td { background:var(--bg); }

/* ── Toggle ──────────────────────────────────────── */
.toggle { display:flex; align-items:center; gap:10px; cursor:pointer; }
.toggle input { display:none; }
.toggle-track {
  width:38px; height:22px; background:var(--border2); border-radius:11px;
  position:relative; transition:.2s; flex-shrink:0;
}
.toggle input:checked ~ .toggle-track { background:var(--accent); }
.toggle-thumb {
  position:absolute; top:3px; left:3px; width:16px; height:16px;
  background:#fff; border-radius:50%; transition:.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked ~ .toggle-track .toggle-thumb { left:19px; }
.toggle-label { font-size:14px; color:var(--text2); font-weight:500; }

/* ── Tags input ──────────────────────────────────── */
.tag-input-wrap {
  display:flex; flex-wrap:wrap; gap:6px; padding:8px 10px;
  border:1.5px solid var(--border); border-radius:var(--r);
  background:var(--white); min-height:44px; cursor:text;
  transition:.15s;
}
.tag-input-wrap:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px rgba(79,70,229,.12); }
.tag {
  display:inline-flex; align-items:center; gap:5px; padding:3px 9px;
  background:var(--accent-lt); color:var(--accent); border-radius:20px;
  font-size:12px; font-weight:600;
}
.tag-rm { cursor:pointer; color:var(--accent); opacity:.6; font-size:14px; line-height:1; }
.tag-rm:hover { opacity:1; }
.tag-real-input {
  background:none; border:none; outline:none; color:var(--text);
  font-size:14px; font-family:var(--fh); min-width:80px; flex:1;
}

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  position:fixed; inset:0; background:rgba(15,23,42,.5); z-index:1000;
  display:flex; align-items:center; justify-content:center;
  opacity:0; pointer-events:none; transition:.2s; backdrop-filter:blur(4px);
}
.modal-overlay.open { opacity:1; pointer-events:all; }
.modal {
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--r-lg); width:580px; max-width:95vw;
  max-height:88vh; overflow-y:auto; box-shadow:var(--shadow-lg);
  transform:translateY(16px) scale(.99); transition:.2s;
}
.modal-overlay.open .modal { transform:translateY(0) scale(1); }
.modal-header {
  padding:20px 24px 16px; border-bottom:1px solid var(--border);
  display:flex; justify-content:space-between; align-items:center;
  position:sticky; top:0; background:var(--white); z-index:1;
}
.modal-title { font-size:17px; font-weight:800; }
.modal-close {
  width:28px; height:28px; background:var(--bg3); border:none;
  border-radius:6px; cursor:pointer; font-size:16px; color:var(--text2);
  display:flex; align-items:center; justify-content:center; transition:.15s;
}
.modal-close:hover { background:var(--red-lt); color:var(--red); }
.modal-body { padding:24px; }
.modal-footer {
  padding:16px 24px; border-top:1px solid var(--border);
  display:flex; gap:10px; justify-content:flex-end;
  background:var(--bg); border-radius:0 0 var(--r-lg) var(--r-lg);
}

/* ── Tabs ────────────────────────────────────────── */
.tab-row {
  display:flex; gap:2px; border-bottom:1.5px solid var(--border);
  margin-bottom:20px;
}
.tab {
  padding:8px 16px; font-size:13px; font-weight:600; color:var(--text3);
  cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1.5px;
  transition:.15s; border-radius:var(--r-sm) var(--r-sm) 0 0;
}
.tab:hover { color:var(--text); background:var(--bg3); }
.tab.active { color:var(--accent); border-bottom-color:var(--accent); }
.tab-pane { display:none; }
.tab-pane.active { display:block; }

/* ── Empty state ─────────────────────────────────── */
.empty {
  text-align:center; padding:48px 24px; color:var(--text3);
}
.empty-icon {
  width:56px; height:56px; background:var(--bg3); border-radius:16px;
  display:flex; align-items:center; justify-content:center;
  font-size:24px; margin:0 auto 16px;
}
.empty h3 { font-size:16px; font-weight:700; color:var(--text2); margin-bottom:6px; }
.empty p { font-size:13px; max-width:300px; margin:0 auto; }

/* ── Progress bars ───────────────────────────────── */
.progress { height:6px; background:var(--bg3); border-radius:3px; overflow:hidden; }
.progress-fill { height:100%; border-radius:3px; transition:.6s; }
.progress-indigo { background:var(--accent); }
.progress-green  { background:var(--green); }
.progress-red    { background:var(--red); }
.progress-yellow { background:var(--yellow); }

/* ── Mention card ────────────────────────────────── */
.mention-card {
  background:var(--white); border:1.5px solid var(--border);
  border-radius:var(--r); padding:14px 16px;
  display:grid; grid-template-columns:1fr auto;
  gap:14px; transition:.15s; margin-bottom:8px;
}
.mention-card:hover { border-color:var(--accent); box-shadow:var(--shadow-sm); }
.mention-title a {
  font-size:14px; font-weight:600; color:var(--text);
  text-decoration:none; line-height:1.4;
}
.mention-title a:hover { color:var(--accent); }
.mention-meta { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:6px; }
.inf-score { text-align:right; min-width:52px; }
.inf-val { font-size:15px; font-weight:800; font-family:var(--fm); }
.inf-bar { height:3px; background:var(--bg3); border-radius:2px; margin-top:4px; }
.inf-fill { height:100%; border-radius:2px; transition:.4s; }

/* ── Alert item ──────────────────────────────────── */
.alert-item {
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--r); padding:14px 16px;
  display:flex; gap:12px; align-items:flex-start;
  margin-bottom:8px; transition:.15s;
}
.alert-item.critical { border-left:4px solid var(--red); border-left-color:var(--red); }
.alert-item.warning  { border-left:4px solid var(--yellow); }
.alert-item.info     { border-left:4px solid var(--blue); }
.alert-item.read     { opacity:.5; }

/* ── SOV bars ────────────────────────────────────── */
.sov-bar { margin-bottom:14px; }
.sov-name {
  display:flex; justify-content:space-between;
  font-size:13px; font-weight:600; margin-bottom:5px;
}
.sov-track { height:8px; background:var(--bg3); border-radius:4px; overflow:hidden; }
.sov-fill  { height:100%; border-radius:4px; transition:.6s; }

/* ── Pagination ──────────────────────────────────── */
.pagination { display:flex; align-items:center; gap:6px; justify-content:center; margin-top:16px; }

/* ── Animations ──────────────────────────────────── */
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
@keyframes spin   { to{transform:rotate(360deg)} }
@keyframes pulse  { 0%,100%{opacity:1} 50%{opacity:.4} }
.animate-in { animation:fadeIn .2s ease; }
.spinner {
  width:20px; height:20px; border:2.5px solid var(--border2);
  border-top-color:var(--accent); border-radius:50%; animation:spin 1s linear infinite;
}

/* ── Color swatches (client picker) ─────────────── */
.color-row { display:flex; gap:8px; flex-wrap:wrap; }
.clr {
  width:28px; height:28px; border-radius:50%; cursor:pointer;
  border:2px solid transparent; transition:.15s;
}
.clr:hover,.clr.sel { border-color:var(--text); transform:scale(1.15); }

/* ── Topbar ──────────────────────────────────────── */
.topbar {
  height:58px; background:var(--white); border-bottom:1.5px solid var(--border);
  display:flex; align-items:center; padding:0 24px; gap:14px;
  position:sticky; top:0; z-index:200; box-shadow:var(--shadow-sm);
}
.logo { font-size:17px; font-weight:800; color:var(--text); text-decoration:none; display:flex; align-items:center; gap:8px; }
.logo-mark {
  width:30px; height:30px; background:var(--accent); border-radius:8px;
  display:flex; align-items:center; justify-content:center; padding:6px; flex-shrink:0;
}
.logo-mark img { width:100%; height:100%; }
.logo span { color:var(--accent); }

/* Live badge */
.live-badge {
  display:flex; align-items:center; gap:5px; font-size:11px;
  font-weight:600; color:var(--green); padding:3px 10px;
  background:var(--green-lt); border:1px solid #a7f3d0; border-radius:20px;
}
.live-dot { width:6px; height:6px; background:var(--green); border-radius:50%; animation:pulse 1.5s infinite; }

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  width:248px; background:var(--white); border-right:1.5px solid var(--border);
  display:flex; flex-direction:column; overflow:hidden;
}
.nav-section { padding:8px; }
.nav-label {
  font-size:11px; font-weight:700; color:var(--text3); letter-spacing:.8px;
  text-transform:uppercase; padding:6px 10px 4px;
}
.nav-item {
  display:flex; align-items:center; gap:9px; padding:8px 10px;
  border-radius:var(--r-sm); cursor:pointer; font-size:13px;
  font-weight:600; color:var(--text2); transition:.12s; margin-bottom:1px;
}
.nav-item:hover { background:var(--bg3); color:var(--text); }
.nav-item.active { background:var(--accent-lt); color:var(--accent); }
.nav-item svg { width:16px; height:16px; flex-shrink:0; }

/* Client list in sidebar */
.client-item {
  display:flex; align-items:center; gap:9px; padding:8px 10px;
  border-radius:var(--r-sm); cursor:pointer; margin-bottom:2px;
  border:1.5px solid transparent; transition:.12s;
}
.client-item:hover { background:var(--bg3); }
.client-item.active { background:var(--accent-lt); border-color:rgba(79,70,229,.2); }
.client-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.client-name { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.client-meta { font-size:11px; color:var(--text3); }

/* ── Layout ──────────────────────────────────────── */
.layout { display:grid; grid-template-columns:248px 1fr; grid-template-rows:58px 1fr; height:100vh; }
.main { overflow-y:auto; background:var(--bg); }
.page-body { padding:24px 28px; }
.page-header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:22px; }
.page-title { font-size:22px; font-weight:800; letter-spacing:-.5px; }
.page-sub { font-size:13px; color:var(--text3); margin-top:3px; }
.view { display:none; }
.view.active { display:block; }

/* ── Chart cards ─────────────────────────────────── */
.chart-card {
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--r-md); padding:20px 22px;
  box-shadow:var(--shadow-sm);
}
.chart-title {
  font-size:14px; font-weight:700; color:var(--text);
  margin-bottom:16px; display:flex; align-items:center; gap:8px;
}
.chart-sub { font-size:12px; color:var(--text3); margin-left:auto; font-weight:500; }

/* ── Chart canvas containment — prevents Chart.js unbounded growth ──
   Chart.js with responsive:true + maintainAspectRatio:false needs its
   PARENT to have an explicit, fixed height. Without this the canvas
   resize-observer loop can grow the chart taller on every redraw. */
.chart-card canvas {
  max-width: 100% !important;
}
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 220px;
}
.chart-canvas-wrap.h-160 { height: 160px; }
.chart-canvas-wrap.h-180 { height: 180px; }
.chart-canvas-wrap.h-200 { height: 200px; }
.chart-canvas-wrap.h-220 { height: 220px; }
.chart-canvas-wrap.h-240 { height: 240px; }
.chart-canvas-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

/* ── Settings cards ──────────────────────────────── */
.settings-card {
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--r-md); padding:22px; margin-bottom:18px;
  box-shadow:var(--shadow-sm);
}
.settings-title {
  font-size:14px; font-weight:700; margin-bottom:16px;
  padding-bottom:12px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; gap:8px;
}

/* ── Crisis score ring ───────────────────────────── */
.crisis-ring {
  width:100px; height:100px; border-radius:50%; position:relative;
  display:flex; align-items:center; justify-content:center;
  background:conic-gradient(var(--accent) 0%, var(--bg3) 0%);
}
.crisis-inner {
  width:74px; height:74px; background:var(--white);
  border-radius:50%; display:flex; flex-direction:column;
  align-items:center; justify-content:center;
}
.crisis-score { font-size:22px; font-weight:800; }
.crisis-label { font-size:10px; color:var(--text3); font-weight:600; text-transform:uppercase; }

/* ── Client card ─────────────────────────────────── */
.client-card {
  background:var(--white); border:1.5px solid var(--border);
  border-radius:var(--r-md); overflow:hidden; transition:.15s;
  box-shadow:var(--shadow-sm);
}
.client-card:hover { box-shadow:var(--shadow); border-color:var(--border2); transform:translateY(-2px); }
.cc-header { padding:16px 18px; display:flex; align-items:flex-start; gap:12px; }
.cc-icon {
  width:40px; height:40px; border-radius:10px; display:flex;
  align-items:center; justify-content:center; font-size:17px; font-weight:800; flex-shrink:0;
}
.cc-stats {
  padding:12px 18px; border-top:1px solid var(--border);
  display:grid; grid-template-columns:repeat(3,1fr); gap:8px;
  background:var(--bg);
}
.cs { text-align:center; }
.cs-val { font-size:17px; font-weight:800; }
.cs-label { font-size:11px; color:var(--text3); font-weight:600; }
.cc-actions {
  padding:10px 18px; border-top:1px solid var(--border);
  display:flex; gap:8px;
}

/* ── Notification bell ───────────────────────────── */
.icon-btn {
  width:36px; height:36px; background:transparent; border:none;
  cursor:pointer; border-radius:var(--r-sm); color:var(--text2);
  display:flex; align-items:center; justify-content:center; transition:.15s; position:relative;
}
.icon-btn:hover { background:var(--bg3); color:var(--accent); }
.icon-btn svg { width:18px; height:18px; }
.notif-dot {
  position:absolute; top:4px; right:4px; width:8px; height:8px;
  background:var(--red); border-radius:50%; border:2px solid var(--white);
}
.notif-badge {
  position:absolute; top:2px; right:2px; min-width:16px; height:16px;
  background:var(--red); border-radius:8px; border:2px solid var(--white);
  font-size:9px; font-weight:700; color:#fff; display:flex;
  align-items:center; justify-content:center; padding:0 3px;
}

/* ── User avatar ─────────────────────────────────── */
.user-avatar {
  width:32px; height:32px; border-radius:50%; background:var(--accent);
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:700; color:#fff; cursor:pointer;
  transition:.15s; flex-shrink:0;
}
.user-avatar:hover { opacity:.85; }

/* ── Portal link ─────────────────────────────────── */
.portal-link {
  padding:8px 18px; border-top:1px solid var(--border);
  font-size:11px; color:var(--text3); background:var(--bg);
}
.portal-link a { color:var(--accent); text-decoration:none; font-weight:600; }
.portal-link a:hover { text-decoration:underline; }

/* ── Webhook row ─────────────────────────────────── */
.webhook-row {
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--r); padding:12px 16px;
  display:flex; align-items:center; gap:12px; margin-bottom:8px;
}
.webhook-name { font-size:13px; font-weight:700; }
.webhook-url  { font-size:11px; color:var(--text3); font-family:var(--fm); margin-top:2px; }

/* ── Responsive ──────────────────────────────────── */
@media(max-width:960px) {
  .layout { grid-template-columns:1fr; }
  .sidebar { display:none; }
  .form-row { grid-template-columns:1fr; }
}

/* ── Utility ─────────────────────────────────────── */
.flex   { display:flex; }
.flex-1 { flex:1; }
.items-center { align-items:center; }
.gap-2  { gap:8px; }
.gap-3  { gap:12px; }
.gap-4  { gap:16px; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }
.grid-4 { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.grid-5 { display:grid; grid-template-columns:repeat(5,1fr); gap:16px; }
.mb-4   { margin-bottom:16px; }
.mb-6   { margin-bottom:24px; }
.mt-4   { margin-top:16px; }
.text-sm { font-size:13px; }
.text-xs { font-size:12px; }
.fw-7    { font-weight:700; }
.text-muted { color:var(--text3); }
.truncate { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.divider { height:1px; background:var(--border); margin:18px 0; }
.section-label {
  font-size:11px; font-weight:700; color:var(--text3); letter-spacing:.8px;
  text-transform:uppercase; margin-bottom:10px;
}
@media(min-width:961px){.side-backdrop{display:none !important}}

/* ── Fancy sidebar menu (colourful icon tiles, 2x size) ─────────────── */
.sidebar { overflow-y:auto; overflow-x:hidden; width:268px; background:linear-gradient(180deg,#ffffff 0%,#f6f7ff 100%); scrollbar-width:thin; scrollbar-color:#c7d2fe transparent; }
.sidebar::-webkit-scrollbar { width:6px; } .sidebar::-webkit-scrollbar-thumb { background:#c7d2fe; border-radius:6px; }
.nav-section { padding:10px 10px 6px; }
.nav-label { font-size:10.5px; letter-spacing:1.4px; color:#818cf8; padding:6px 12px 8px; }
.nav-item {
  --g1:#6366f1; --g2:#8b5cf6;
  position:relative; gap:12px; padding:7px 12px 7px 8px; margin-bottom:5px; border-radius:14px;
  font-size:13.5px; font-weight:700; letter-spacing:.1px; color:#334155;
  background:#fff; border:1px solid #eef0f8; box-shadow:0 1px 2px rgba(79,70,229,.04);
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.nav-item svg {
  width:32px; height:32px; padding:6px; border-radius:10px; color:#fff; stroke:#fff; flex-shrink:0;
  background:linear-gradient(135deg,var(--g1),var(--g2));
  box-shadow:0 4px 10px -3px var(--g1); transition:transform .15s ease;
}
.nav-item:hover { background:#fff; color:#0f172a; transform:translateX(3px); border-color:var(--g1); box-shadow:0 6px 16px -8px var(--g1); }
.nav-item:hover svg { transform:scale(1.08) rotate(-4deg); }
.nav-item.active {
  background:linear-gradient(90deg,color-mix(in srgb,var(--g1) 14%,#fff),#fff 85%);
  color:#0f172a; border-color:color-mix(in srgb,var(--g1) 45%,#fff); box-shadow:0 8px 18px -10px var(--g1);
}
.nav-item.active::before { content:''; position:absolute; left:-10px; top:8px; bottom:8px; width:4px; border-radius:0 4px 4px 0; background:linear-gradient(180deg,var(--g1),var(--g2)); }
#nav-dashboard{--g1:#4f46e5;--g2:#8b5cf6} #nav-agency{--g1:#2563eb;--g2:#06b6d4} #nav-insights{--g1:#9333ea;--g2:#ec4899}
#nav-mentions{--g1:#0ea5e9;--g2:#3b82f6} #nav-crisis{--g1:#ef4444;--g2:#f97316} #nav-influencers{--g1:#f59e0b;--g2:#f97316}
#nav-geo{--g1:#0d9488;--g2:#22c55e} #nav-sov{--g1:#db2777;--g2:#f43f5e} #nav-roi{--g1:#16a34a;--g2:#84cc16}
#nav-medialist{--g1:#0891b2;--g2:#6366f1} #nav-contacts{--g1:#7c3aed;--g2:#d946ef} #nav-releases{--g1:#ea580c;--g2:#fbbf24}
#nav-outreach{--g1:#2563eb;--g2:#6366f1} #nav-clips{--g1:#475569;--g2:#6366f1} #nav-reports{--g1:#059669;--g2:#14b8a6}
#nav-alerts{--g1:#eab308;--g2:#ef4444} #nav-clients{--g1:#4f46e5;--g2:#3b82f6} #nav-users{--g1:#c026d3;--g2:#8b5cf6}
#nav-help{--g1:#0ea5e9;--g2:#14b8a6} #nav-apiaccess{--g1:#334155;--g2:#8b5cf6} #nav-customers{--g1:#e11d48;--g2:#f97316}
#nav-settings{--g1:#64748b;--g2:#0ea5e9} a.nav-item{--g1:#0891b2;--g2:#22c55e}
.sidebar-divider { background:linear-gradient(90deg,transparent,#c7d2fe,transparent); height:1px; margin:10px 14px; }

/* Icon font (Font Awesome Free, self-hosted) */
.nav-item i.fa-solid { width:32px; height:32px; border-radius:10px; color:#fff; font-size:15px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
  background:linear-gradient(135deg,var(--g1),var(--g2)); box-shadow:0 4px 10px -3px var(--g1); transition:transform .15s ease; }
.nav-item:hover i.fa-solid { transform:scale(1.08) rotate(-4deg); }
.icon-btn i.fa-solid { font-size:17px; }
.btn i.fa-solid { font-size:12px; margin-right:6px; }
i.ic { font-style:normal; display:inline-block; line-height:1; vertical-align:-.1em; }
i.ic + * { }
.btn i.ic { margin-right:0; font-size:inherit; }
