/* ──────────────────────────────────────────────────────────────
   OXIDE: Influencers — design tokens & base styles
   ────────────────────────────────────────────────────────────── */

:root {
  /* Neutral scale – light theme */
  --bg-app: #f6f6f7;
  --bg-surface: #ffffff;
  --bg-surface-2: #fafafb;
  --bg-elevated: #ffffff;
  --bg-hover: #f2f2f4;
  --bg-active: #ececef;
  --bg-pressed: #e4e4e8;

  --border-subtle: #ececef;
  --border-default: #e1e1e6;
  --border-strong: #c7c7cf;

  --text-primary: #14141a;
  --text-secondary: #56565f;
  --text-tertiary: #8a8a93;
  --text-disabled: #b9b9c1;
  --text-inverse: #ffffff;

  /* Brand accent */
  --accent-50:  #f3efff;
  --accent-100: #e6dcff;
  --accent-300: #b89cff;
  --accent-500: #6f4cff;
  --accent-600: #5a36e8;
  --accent-700: #4824c4;
  --accent-text: #ffffff;

  /* Status colors – tuned to be distinct at a glance */
  --status-lead-bg: #eef2ff;     --status-lead-fg: #3b40d8;
  --status-talks-bg: #fff4e0;    --status-talks-fg: #b25c00;
  --status-paid-bg: #e9f7ec;     --status-paid-fg: #176b34;
  --status-work-bg: #fff0e1;     --status-work-fg: #c2461c;
  --status-pub-bg: #e7f1ff;      --status-pub-fg: #1c54b6;
  --status-rejected-bg: #f3f3f5; --status-rejected-fg: #6b6b75;

  /* Platform brand colors */
  --p-youtube: #ff0033;
  --p-twitch: #9146ff;
  --p-tiktok: #25f4ee;
  --p-tiktok-2: #fe2c55;
  --p-instagram: #e4405f;
  --p-telegram: #229ed9;
  --p-vk: #0077ff;

  /* Semantic */
  --success: #1f9d55;
  --warning: #d97706;
  --danger:  #d23f3f;
  --info:    #1c54b6;

  /* Sizing */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20, 20, 26, 0.04), 0 0 0 1px rgba(20, 20, 26, 0.04);
  --shadow-md: 0 4px 12px rgba(20, 20, 26, 0.06), 0 0 0 1px rgba(20, 20, 26, 0.04);
  --shadow-lg: 0 16px 48px rgba(20, 20, 26, 0.12), 0 2px 8px rgba(20, 20, 26, 0.06);
  --shadow-drawer: -16px 0 48px rgba(20, 20, 26, 0.10);

  --sidebar-w: 232px;
  --sidebar-w-collapsed: 56px;
  --topbar-h: 56px;

  /* Type */
  --font-ui: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --bg-app: #0c0d10;
  --bg-surface: #131418;
  --bg-surface-2: #16171c;
  --bg-elevated: #1a1b21;
  --bg-hover: #1d1e25;
  --bg-active: #23242c;
  --bg-pressed: #2a2b34;

  --border-subtle: #1f2028;
  --border-default: #272832;
  --border-strong: #3a3b46;

  --text-primary: #f3f3f5;
  --text-secondary: #b3b3bf;
  --text-tertiary: #7a7b87;
  --text-disabled: #4d4e58;

  --accent-50:  rgba(111, 76, 255, 0.10);
  --accent-100: rgba(111, 76, 255, 0.18);
  --accent-300: #9d80ff;
  --accent-500: #8b6cff;
  --accent-600: #7553ff;
  --accent-700: #5b39e6;

  --status-lead-bg: rgba(99, 102, 241, 0.16);     --status-lead-fg: #a5a8ff;
  --status-talks-bg: rgba(217, 119, 6, 0.16);     --status-talks-fg: #ffba6b;
  --status-paid-bg: rgba(34, 197, 94, 0.16);      --status-paid-fg: #74e09a;
  --status-work-bg: rgba(234, 88, 12, 0.18);      --status-work-fg: #ffaa7b;
  --status-pub-bg: rgba(59, 130, 246, 0.18);      --status-pub-fg: #8db8ff;
  --status-rejected-bg: rgba(255,255,255,0.06);   --status-rejected-fg: #a8a9b3;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.50), 0 4px 12px rgba(0,0,0,0.35);
  --shadow-drawer: -24px 0 64px rgba(0,0,0,0.55);
}

/* ── Base reset ─────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
  background: var(--bg-app);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

/* Pretty scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: content-box; border: 2px solid transparent; }

/* ── Layout shell ───────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  height: 100vh;
  overflow: hidden;
}
.app.sidebar-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.sidebar {
  grid-row: 1 / 3;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: width .18s ease;
}
.sidebar-brand {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.sidebar-brand .brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent-500), #ff6b9d);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 14px;
  flex-shrink: 0;
}
.sidebar-brand .brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.sidebar-brand .brand-tag {
  font-size: 10px; color: var(--text-tertiary);
  padding: 2px 6px; border-radius: 4px;
  background: var(--bg-hover);
  margin-left: auto;
  font-weight: 600;
}

.sidebar-nav {
  padding: 12px 8px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
  flex: 1;
}
.sidebar-section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-tertiary);
  padding: 12px 12px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--bg-active); color: var(--text-primary); font-weight: 600; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto; font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #ff8a4d, #d23f7d);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 11px;
  flex-shrink: 0;
}
.user-meta { overflow: hidden; }
.user-meta .name { font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta .role { color: var(--text-tertiary); font-size: 11px; }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  grid-column: 2;
  grid-row: 1;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center;
  padding: 0 20px;
  gap: 12px;
}
.topbar .crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
}
.topbar .crumbs .current { color: var(--text-primary); font-weight: 600; }
.topbar .crumbs .sep { color: var(--text-disabled); }
.topbar-search {
  flex: 1; max-width: 480px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 10px;
  transition: border-color .15s, box-shadow .15s;
}
.topbar-search:focus-within {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px var(--accent-100);
}
.topbar-search input {
  border: 0; outline: 0; background: transparent;
  flex: 1; font-size: 13px;
}
.topbar-search input::placeholder { color: var(--text-tertiary); }
.topbar-search .kbd {
  font-family: var(--font-mono);
  font-size: 10.5px; color: var(--text-tertiary);
  padding: 2px 6px; border-radius: 4px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
}
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

/* ── Main ───────────────────────────────────────────────────── */
.main {
  grid-column: 2;
  grid-row: 2;
  overflow: auto;
  background: var(--bg-app);
}
.page {
  padding: 20px 24px 60px;
  max-width: 100%;
}
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0; display: flex; align-items: center; gap: 12px; }
.page-title .count {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 500;
  color: var(--text-tertiary);
  padding: 4px 8px; border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}
.page-subtitle { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  transition: background .12s, border-color .12s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: translateY(0.5px); }
.btn svg { width: 14px; height: 14px; }
.btn.icon-only { padding: 6px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--bg-hover); }
.btn.primary {
  background: var(--accent-500);
  color: var(--accent-text);
  border-color: var(--accent-500);
}
.btn.primary:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn.sm { padding: 4px 8px; font-size: 12px; border-radius: 6px; }
.btn.sm svg { width: 12px; height: 12px; }
.btn .chev { opacity: .7; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ── Pills / chips / badges ─────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.lead     { color: var(--status-lead-fg);     background: var(--status-lead-bg); }
.pill.talks    { color: var(--status-talks-fg);    background: var(--status-talks-bg); }
.pill.paid     { color: var(--status-paid-fg);     background: var(--status-paid-bg); }
.pill.work     { color: var(--status-work-fg);     background: var(--status-work-bg); }
.pill.pub      { color: var(--status-pub-fg);      background: var(--status-pub-bg); }
.pill.rejected { color: var(--status-rejected-fg); background: var(--status-rejected-bg); }

.platform-icon {
  width: 18px; height: 18px;
  border-radius: 5px;
  display: inline-grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
}
.platform-icon svg { width: 11px; height: 11px; fill: #fff; }
.platform-icon.youtube { background: var(--p-youtube); }
.platform-icon.twitch { background: var(--p-twitch); }
.platform-icon.tiktok { background: #000; }
.platform-icon.tiktok::before { content: ""; position: absolute; }
.platform-icon.instagram { background: linear-gradient(135deg, #f9ce34, #ee2a7b 50%, #6228d7); }
.platform-icon.telegram { background: var(--p-telegram); }
.platform-icon.vk { background: var(--p-vk); }

/* ── KPI / funnel ───────────────────────────────────────────── */
.dashboard-strip {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.funnel-card, .budget-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.card-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.card-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); }
.card-action { font-size: 12px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 4px; }

.funnel { display: flex; align-items: stretch; gap: 0; }
.funnel-step {
  flex: 1;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  padding: 10px 12px;
  margin-right: -1px;
  position: relative;
  cursor: pointer;
  transition: background .15s, transform .15s;
  min-width: 0;
}
.funnel-step:first-child { border-radius: 8px 0 0 8px; }
.funnel-step:last-child { border-radius: 0 8px 8px 0; margin-right: 0; }
.funnel-step:hover { background: var(--bg-hover); }
.funnel-step.active {
  background: var(--accent-50);
  border-color: var(--accent-300);
  z-index: 1;
}
.funnel-step .step-name {
  font-size: 11px; color: var(--text-secondary); font-weight: 600;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.funnel-step .step-name .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.funnel-step .step-count {
  font-family: var(--font-mono);
  font-size: 18px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.funnel-step .step-percent {
  font-size: 11px; color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.budget-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.budget-cell .label { font-size: 11px; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.budget-cell .value { font-family: var(--font-mono); font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.budget-cell .delta { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.budget-cell .delta.up { color: var(--success); }
.budget-cell .delta.down { color: var(--danger); }
.budget-bar {
  margin-top: 10px;
  display: flex; height: 6px; overflow: hidden; border-radius: 999px;
  background: var(--bg-hover);
}
.budget-bar > span { display: block; }
.budget-legend { display: flex; gap: 12px; margin-top: 8px; font-size: 11px; color: var(--text-secondary); flex-wrap: wrap; }
.budget-legend .legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ── Toolbar above table ────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.view-switch {
  display: inline-flex; background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 8px; padding: 2px;
}
.view-switch button {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 6px;
  font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary);
}
.view-switch button svg { width: 13px; height: 13px; }
.view-switch button.active { background: var(--bg-hover); color: var(--text-primary); }
.toolbar .spacer { flex: 1; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px 4px 9px;
  border-radius: 999px;
  background: var(--accent-50);
  color: var(--accent-700);
  font-size: 12px; font-weight: 600;
  border: 1px solid transparent;
}
[data-theme="dark"] .filter-chip { color: var(--accent-300); }
.filter-chip .x { width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.filter-chip .x:hover { background: rgba(0,0,0,0.08); }

/* ── Table ──────────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-scroll {
  overflow-x: auto;
}
table.creators {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.creators thead th {
  position: sticky; top: 0;
  background: var(--bg-surface-2);
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
}
table.creators thead th:hover { color: var(--text-primary); }
table.creators thead th .sort-arrow { opacity: 0; margin-left: 4px; font-size: 9px; }
table.creators thead th.sorted .sort-arrow { opacity: 1; }
table.creators tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  transition: background .08s;
}
table.creators tbody tr:hover { background: var(--bg-hover); cursor: pointer; }
table.creators tbody tr.selected { background: var(--accent-50); }
table.creators tbody tr.active { background: var(--accent-50); }
[data-theme="dark"] table.creators tbody tr.selected { background: rgba(111, 76, 255, 0.12); }
[data-theme="dark"] table.creators tbody tr.active { background: rgba(111, 76, 255, 0.12); }

table.creators td {
  padding: 10px 12px;
  vertical-align: middle;
  white-space: nowrap;
}
.cell-checkbox { width: 30px; padding-right: 0 !important; }
.cell-creator { min-width: 260px; }
.creator-cell {
  display: flex; align-items: center; gap: 10px;
}
.creator-cell .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 11px;
  flex-shrink: 0;
  position: relative;
}
.creator-cell .avatar .pbadge {
  position: absolute; bottom: -2px; right: -3px;
  width: 14px; height: 14px;
  border-radius: 4px;
  display: grid; place-items: center;
  border: 2px solid var(--bg-surface);
  color: #fff;
}
.creator-cell .avatar .pbadge svg { width: 8px; height: 8px; fill: #fff; }
.creator-cell .info { min-width: 0; }
.creator-cell .name {
  font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis;
}
.creator-cell .handle {
  font-size: 11.5px; color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num.bold { font-weight: 600; }
.cell-price .num { font-weight: 600; }
.cell-cpv .num { color: var(--text-secondary); }

.contacts-stack { display: inline-flex; }
.contacts-stack .avatar {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--bg-surface);
  margin-left: -6px;
  display: grid; place-items: center;
  color: #fff; font-size: 9.5px; font-weight: 700;
}
.contacts-stack .avatar:first-child { margin-left: 0; }
.contacts-stack .more {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--bg-surface);
  background: var(--bg-active);
  color: var(--text-secondary);
  display: grid; place-items: center;
  font-size: 9.5px; font-weight: 700;
  margin-left: -6px;
}

.sparkline { display: inline-block; vertical-align: middle; height: 18px; }

.cell-link a {
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 12px;
}
.cell-link a:hover { color: var(--accent-500); text-decoration: underline; }

input[type="checkbox"].cb {
  width: 14px; height: 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 3px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  display: grid; place-items: center;
  margin: 0;
  background: var(--bg-surface);
  transition: all .12s;
}
input[type="checkbox"].cb:checked {
  background: var(--accent-500);
  border-color: var(--accent-500);
}
input[type="checkbox"].cb:checked::after {
  content: ""; width: 7px; height: 4px;
  border-left: 1.5px solid #fff; border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

/* Pagination */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px; color: var(--text-secondary);
}
.pagination .pages { display: inline-flex; gap: 4px; }
.pagination .pages button {
  padding: 4px 8px; border-radius: 5px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}
.pagination .pages button:hover { background: var(--bg-hover); color: var(--text-primary); }
.pagination .pages button.active { background: var(--accent-500); color: #fff; }
.pagination .pages button[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ── Drawer ─────────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 16, 20, 0.32);
  z-index: 50;
  animation: fadein .15s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes slidein { from { transform: translateX(24px); opacity: 0.5; } to { transform: translateX(0); opacity: 1; } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(640px, 92vw);
  background: var(--bg-surface);
  z-index: 51;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-drawer);
  animation: slidein .22s cubic-bezier(.2,.7,.2,1);
}
.drawer-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.drawer-head-row { display: flex; align-items: center; gap: 12px; }
.drawer-head .big-avatar {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 18px;
  flex-shrink: 0;
}
.drawer-head .title-block { flex: 1; min-width: 0; }
.drawer-head .name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.drawer-head .sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; font-family: var(--font-mono); }
.drawer-head .quick-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.drawer-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 20px;
}
.drawer-tab {
  padding: 10px 0;
  margin-right: 18px;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.drawer-tab:hover { color: var(--text-primary); }
.drawer-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-500);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }

.section-block {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.section-block-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-weight: 700; font-size: 13px;
}
.section-block-title .icon { color: var(--text-tertiary); display: grid; place-items: center; }
.section-block-title .icon svg { width: 14px; height: 14px; }
.section-block-title .meta { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--text-tertiary); font-family: var(--font-mono); }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.metric {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
}
.metric .label { font-size: 10.5px; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.metric .value { font-family: var(--font-mono); font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.metric .trend { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.metric .trend.up { color: var(--success); }
.metric .trend.down { color: var(--danger); }

/* Geo + Demography rows */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12.5px; }
.bar-row .bar-label { width: 90px; color: var(--text-secondary); flex-shrink: 0; }
.bar-row .bar-track { flex: 1; height: 6px; background: var(--bg-hover); border-radius: 999px; overflow: hidden; position: relative; }
.bar-row .bar-fill { height: 100%; background: var(--accent-500); border-radius: 999px; transition: width .3s; }
.bar-row .bar-val { width: 38px; text-align: right; font-family: var(--font-mono); color: var(--text-secondary); flex-shrink: 0; }

/* Contacts list */
.contact-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  margin-bottom: 6px;
}
.contact-row .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.contact-row .name { font-weight: 600; }
.contact-row .channel { font-size: 11.5px; color: var(--text-tertiary); font-family: var(--font-mono); }
.contact-row .info { flex: 1; min-width: 0; }
.contact-row .role-select {
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
}

/* Integration */
.integration-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 6px 0; font-size: 13px; }
.integration-row .lbl { color: var(--text-tertiary); }
.integration-row .val { color: var(--text-primary); }
.integration-row .val a { color: var(--accent-500); text-decoration: none; }
.integration-row .val a:hover { text-decoration: underline; }

/* Refresh button on integration */
.integration-views {
  display: flex; align-items: baseline; gap: 8px;
}
.integration-views .live-value { font-family: var(--font-mono); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.integration-views .pulse {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: pulse 1.4s ease-in-out infinite;
  margin-right: 4px;
  vertical-align: 1px;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* Activity timeline */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
  content: ""; position: absolute;
  left: 7px; top: 4px; bottom: 4px;
  width: 1.5px; background: var(--border-default);
}
.timeline-item { position: relative; padding-bottom: 14px; }
.timeline-item .marker {
  position: absolute; left: -22px; top: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--accent-500);
}
.timeline-item .when { font-size: 11px; color: var(--text-tertiary); font-family: var(--font-mono); }
.timeline-item .what { font-size: 13px; margin-top: 2px; }

/* AI */
.ai-panel {
  background: linear-gradient(160deg, var(--accent-50), transparent);
  border: 1px solid var(--accent-300);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
[data-theme="dark"] .ai-panel { background: linear-gradient(160deg, rgba(111, 76, 255, 0.12), transparent); border-color: rgba(111, 76, 255, 0.4); }
.ai-panel .ai-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ai-panel .ai-head .ai-logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-500), #ff6b9d);
  display: grid; place-items: center;
  color: #fff;
}
.ai-panel .ai-title { font-weight: 700; font-size: 14px; }
.ai-panel .ai-sub { font-size: 12px; color: var(--text-secondary); }
.ai-output {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.55;
  margin-top: 10px;
  min-height: 60px;
  white-space: pre-wrap;
}
.ai-output.empty { color: var(--text-tertiary); }
.ai-cursor {
  display: inline-block; width: 2px; height: 14px;
  background: var(--accent-500); vertical-align: -2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ── Kanban ─────────────────────────────────────────────────── */
.kanban {
  display: flex; gap: 12px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 20px;
}
.kanban-col {
  flex-shrink: 0;
  width: 280px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px;
  max-height: calc(100vh - 290px);
  display: flex; flex-direction: column;
}
.kanban-col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 4px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.kanban-col-head .col-name { font-weight: 700; font-size: 12.5px; }
.kanban-col-head .col-count { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); }
.kanban-cards {
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto;
  padding: 2px;
}
.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .12s, transform .08s, box-shadow .12s;
}
.kanban-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.kanban-card .top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kanban-card .top .avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 10.5px; flex-shrink: 0; }
.kanban-card .name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card .meta-row { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--text-secondary); }
.kanban-card .price { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }
.kanban-card .stats { display: flex; gap: 10px; font-size: 11px; color: var(--text-tertiary); margin-top: 6px; font-family: var(--font-mono); }

/* ── Calendar ───────────────────────────────────────────────── */
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.cal-head, .cal-cell {
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 10px;
  min-height: 110px;
  font-size: 12px;
}
.cal-head {
  background: var(--bg-surface-2);
  min-height: auto;
  font-weight: 700; font-size: 11px; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.cal-cell .daynum { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; font-family: var(--font-mono); }
.cal-cell.today .daynum {
  display: inline-block; background: var(--accent-500); color: #fff;
  padding: 1px 6px; border-radius: 999px;
}
.cal-cell.muted { background: var(--bg-surface-2); }
.cal-cell.muted .daynum { color: var(--text-disabled); }
.cal-event {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--accent-50);
  color: var(--accent-700);
  margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer;
}
[data-theme="dark"] .cal-event { color: var(--accent-300); }
.cal-event .platform-icon { width: 12px; height: 12px; border-radius: 3px; }
.cal-event .platform-icon svg { width: 8px; height: 8px; }

/* ── Dropdowns / popovers ───────────────────────────────────── */
.popover {
  position: absolute;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 30;
  min-width: 220px;
  padding: 6px;
  max-height: 340px;
  overflow-y: auto;
  animation: fadein .12s;
}
.popover .pop-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.popover .pop-item:hover { background: var(--bg-hover); }
.popover .pop-item.active { background: var(--bg-active); }
.popover .pop-item .check {
  margin-left: auto;
  color: var(--accent-500);
  display: none;
}
.popover .pop-item.selected .check { display: inline; }
.popover .pop-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); padding: 8px 8px 4px; }
.popover .pop-divider { height: 1px; background: var(--border-subtle); margin: 4px 0; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 16, 20, 0.42);
  display: grid; place-items: center;
  z-index: 100;
  animation: fadein .15s;
}
.modal {
  background: var(--bg-surface);
  border-radius: 14px;
  padding: 24px;
  width: min(560px, 92vw);
  box-shadow: var(--shadow-lg);
  max-height: 90vh; overflow-y: auto;
}
.modal h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.modal .modal-sub { color: var(--text-secondary); font-size: 13px; margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-row.full { grid-template-columns: 1fr; }
.field label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-tertiary); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.05em; }
.field input, .field select, .field textarea {
  width: 100%; padding: 7px 10px;
  background: var(--bg-app);
  border: 1px solid var(--border-default);
  border-radius: 7px;
  font-size: 13px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0;
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px var(--accent-100);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Empty state */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-tertiary);
}
.empty .icon { font-size: 32px; margin-bottom: 8px; }

/* Tooltip helper */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-surface);
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  z-index: 200;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Sign-in screen ─────────────────────────────────────── */
.signin-bg {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(111, 76, 255, 0.16), transparent 60%),
    radial-gradient(800px 500px at 90% 110%, rgba(255, 107, 157, 0.12), transparent 60%),
    var(--bg-app);
}
.signin-card {
  width: min(440px, 100%);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.signin-card.shake { animation: shake .42s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

.passphrase-field { display: flex; flex-direction: column; gap: 6px; }
.passphrase-input {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-app);
  border: 1.5px solid var(--border-default);
  border-radius: 10px;
  padding: 0 10px 0 12px;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.passphrase-input:focus-within {
  border-color: var(--accent-500);
  box-shadow: 0 0 0 4px var(--accent-100);
  background: var(--bg-surface);
}
.passphrase-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(210, 63, 63, 0.12);
}
.passphrase-input input {
  flex: 1; border: 0; outline: 0; background: transparent;
  padding: 12px 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.passphrase-input input::placeholder { color: var(--text-disabled); font-weight: 400; }

.passphrase-format {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 6px;
}
.pf-word {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 6px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.pf-word.pf-num { color: var(--accent-500); border-color: var(--accent-300); background: var(--accent-50); }
.pf-sep { color: var(--text-disabled); font-family: var(--font-mono); font-size: 14px; }
.signin-brand { display: flex; align-items: center; gap: 12px; }
.signin-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  margin-top: 22px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background .12s, border-color .12s;
}
.signin-google:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.signin-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 14px;
  color: var(--text-tertiary);
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  justify-content: center;
}
.signin-divider::before, .signin-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border-subtle);
}
.signin-preset {
  display: flex; flex-direction: column; gap: 6px;
}
.signin-preset-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .05s;
  width: 100%;
}
.signin-preset-row:hover { background: var(--bg-hover); border-color: var(--border-default); }
.signin-preset-row:active { transform: translateY(0.5px); }
.signin-error {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(210, 63, 63, 0.08);
  border: 1px solid rgba(210, 63, 63, 0.24);
  border-radius: 8px;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
}
.signin-foot {
  margin-top: 22px;
  text-align: center;
  line-height: 1.6;
}

/* Misc */
.divider { height: 1px; background: var(--border-subtle); margin: 12px 0; }

/* ── Loading splash screen ───────────────────────────────── */
.loading-screen {
  position: fixed; inset: 0;
  z-index: 9999;
  display: grid; place-items: center;
  background:
    radial-gradient(900px 600px at 30% 20%, rgba(59, 130, 246, 0.16), transparent 60%),
    radial-gradient(700px 500px at 80% 90%, rgba(99, 102, 241, 0.12), transparent 60%),
    linear-gradient(160deg, #06080f 0%, #0d1124 60%, #0a0c18 100%);
  animation: loading-fadeout .5s cubic-bezier(.4,0,.2,1) 2.0s forwards;
}
.loading-stage {
  display: flex; flex-direction: column; align-items: center;
  gap: 22px;
  padding: 24px;
  max-width: 480px;
  text-align: center;
}
.loading-logo-wrap {
  position: relative;
  width: 76px; height: 76px;
  display: grid; place-items: center;
}
.loading-logo-wrap::before {
  content: "";
  position: absolute; inset: -18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35), transparent 70%);
  animation: loading-halo 2.4s ease-in-out infinite;
}
.loading-logo {
  position: relative;
  width: 56px; height: 56px;
  filter: drop-shadow(0 0 14px rgba(59, 130, 246, 0.55));
  animation: loading-pop .9s cubic-bezier(.34,1.56,.64,1) backwards,
             loading-float 3s ease-in-out 0.9s infinite;
}
@keyframes loading-pop {
  from { transform: scale(0.5) rotate(-8deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes loading-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
@keyframes loading-halo {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 0.9;  transform: scale(1.18); }
}
.loading-text {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #f3f4ff;
}
.loading-text span {
  display: block;
  opacity: 0;
  transform: translateY(8px);
  animation: loading-line .55s cubic-bezier(.2,.7,.2,1) forwards;
}
.loading-text span:nth-child(1) { animation-delay: 0.45s; }
.loading-text span:nth-child(2) {
  animation-delay: 0.95s;
  background: linear-gradient(110deg, #7eb6ff, #c4b5fd 60%, #7eb6ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: loading-line .55s cubic-bezier(.2,.7,.2,1) 0.95s forwards,
             loading-shine 3s linear 1.6s infinite;
}
@keyframes loading-line {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes loading-shine {
  to { background-position: 200% center; }
}
.loading-bar {
  width: 180px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.loading-bar-fill {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, transparent, #7eb6ff, transparent);
  animation: loading-bar 1.4s ease-in-out infinite;
}
@keyframes loading-bar {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}
@keyframes loading-fadeout {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* ── Sync badge / banner / toast ────────────────────────── */
.push-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  margin-right: 4px;
  vertical-align: 1px;
}
.push-dot.push-pending  { background: var(--warning); }
.push-dot.push-pushing  { background: var(--accent-500); animation: pulse-accent 1s ease-in-out infinite; }
.push-dot.push-ok       { background: var(--success); }
.push-dot.push-err      { background: var(--danger); }
@keyframes pulse-accent {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.6); opacity: 0.5; }
}

.sync-badge {
  display: inline-flex; align-items: center; gap: 6px;
}
.sync-badge .sync-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
}
.sync-badge .sync-dot.aging { background: var(--warning); box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.18); }
.sync-badge .sync-dot.old   { background: var(--danger);  box-shadow: 0 0 0 2px rgba(210, 63, 63, 0.18); animation: pulse-danger 1.6s ease-in-out infinite; }
.sync-badge .sync-dot.never { background: var(--text-disabled); box-shadow: none; }
@keyframes pulse-danger {
  0%, 100% { box-shadow: 0 0 0 2px rgba(210, 63, 63, 0.18); }
  50%      { box-shadow: 0 0 0 5px rgba(210, 63, 63, 0); }
}
.sync-badge .sync-when {
  font-weight: 500; color: var(--text-tertiary);
  font-family: var(--font-mono); font-size: 11px;
  margin-left: 2px;
}
.sync-badge.stale {
  border-color: rgba(210, 63, 63, 0.4);
  background: rgba(210, 63, 63, 0.06);
}
.sync-badge.stale .sync-when { color: var(--danger); }

/* Stale banner — sticky bottom-right, above bulk bar */
.stale-banner {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  width: min(440px, calc(100vw - 40px));
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--danger);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 14px 14px 14px 14px;
  display: flex; align-items: center; gap: 12px;
  animation: slidein-br .25s cubic-bezier(.2,.7,.2,1);
}
@keyframes slidein-br {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.stale-banner-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(210, 63, 63, 0.10);
  color: var(--danger);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.stale-banner-title { font-weight: 700; font-size: 14px; }
.stale-banner-sub { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }

/* Background auto-sync toast — bottom-center, transient */
.auto-sync-toast {
  position: fixed;
  left: 50%; bottom: 20px;
  transform: translateX(-50%);
  z-index: 55;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--text-primary);
  color: var(--bg-surface);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slidein-bc .2s ease-out;
}
.auto-sync-toast.done  { background: var(--success); color: #fff; }
.auto-sync-toast.error { background: var(--danger);  color: #fff; }
@keyframes slidein-bc {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}

/* ── Cloud sync help modal ──────────────────────────────── */
.cloud-steps {
  margin: 16px 0 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.cloud-steps li { margin-bottom: 10px; }
.cloud-steps code {
  background: var(--bg-surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.cloud-howto {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 16px;
}
.cloud-howto-block {
  padding: 10px 12px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}
.cloud-howto-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.muted { color: var(--text-tertiary); }
.small { font-size: 11.5px; }
.row { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; }

/* Sidebar collapsed visuals */
.app.sidebar-collapsed .sidebar-brand .brand-name,
.app.sidebar-collapsed .sidebar-brand .brand-tag,
.app.sidebar-collapsed .sidebar-section-label,
.app.sidebar-collapsed .nav-item span:not(.nav-badge),
.app.sidebar-collapsed .nav-item .nav-badge,
.app.sidebar-collapsed .user-meta { display: none; }
.app.sidebar-collapsed .nav-item { justify-content: center; }
