/* ═══════════════════════════════════════════════════════════════
   ExpenseOS — Professional Theme
   ═══════════════════════════════════════════════════════════════ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  /* Layout */
  --sidebar-w: 248px;
  --navbar-h: 60px;

  /* Palette */
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  --indigo-50:  #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-950: #1e1b4b;

  /* Semantic */
  --bg:       var(--slate-100);
  --surface:  #ffffff;
  --border:   var(--slate-200);
  --text:     var(--slate-900);
  --text-2:   var(--slate-600);
  --text-3:   var(--slate-400);
  --accent:   var(--indigo-500);
  --accent-d: var(--indigo-600);
  --sidebar-bg: var(--indigo-950);

  --green:   #10b981;
  --red:     #ef4444;
  --yellow:  #f59e0b;
  --cyan:    #06b6d4;

  /* Misc */
  --radius:    12px;
  --radius-sm: 7px;
  --radius-xs: 4px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 16px rgba(0,0,0,0.07);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.10);
  --transition: 0.18s ease;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

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

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1000;
  transition: transform var(--transition);
  /* `inset: 0 auto 0 0` pins this to exactly 100vh -- without its own
     scroll, nav items below the fold (more businesses, a taller AI/Tools
     section) are simply clipped with no way to reach them. */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

.sidebar-logo {
  height: 36px; width: auto; object-fit: contain;
  filter: brightness(0) invert(1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--indigo-500), #818cf8);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99,102,241,0.45);
}

.brand-name { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -0.3px; }
.brand-env  { font-size: 9px; font-weight: 700; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); padding: 1px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.6px; }

.sidebar-section-label {
  padding: 16px 18px 5px;
  font-size: 9.5px; font-weight: 700;
  color: rgba(255,255,255,0.28);
  letter-spacing: 1.1px; text-transform: uppercase;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 1px; padding: 4px 10px; }

.sidebar-nav .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.5);
  font-size: 13px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}

.sidebar-nav .nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }

.sidebar-nav .nav-item.active {
  background: rgba(99,102,241,0.2);
  color: #fff; font-weight: 600;
}

.sidebar-nav .nav-item.active .nav-icon { color: var(--indigo-400); }
.nav-icon { font-size: 13.5px; width: 17px; text-align: center; flex-shrink: 0; }
.nav-logo { width: 20px; height: 20px; border-radius: 5px; object-fit: contain; margin: 0 -1.5px; }

.sidebar-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 8px 18px; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: space-between;
}

.currency-pill {
  background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.45);
  font-size: 10.5px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
}

.version-label { font-size: 10px; color: rgba(255,255,255,0.18); }

/* ── Main ──────────────────────────────────────────────────── */
.main-area {
  margin-left: var(--sidebar-w);
  /* min-width: 0 -- a flex child otherwise grows to its widest content (the
     ledger table), which pushed every page past the right edge on a phone. */
  flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh;
  transition: margin-left var(--transition);
}

/* ── Top navbar ────────────────────────────────────────────── */
.top-navbar {
  height: var(--navbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 900;
}

.sidebar-toggle-btn {
  background: none; border: none;
  color: var(--text-3); font-size: 16px;
  cursor: pointer; padding: 6px 8px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.sidebar-toggle-btn:hover { background: var(--slate-100); color: var(--text-2); }

.navbar-breadcrumb {
  flex: 1;
  min-width: 0;
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2);
  overflow: hidden;
}
.navbar-breadcrumb .bc-page {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navbar-breadcrumb .bc-home { color: var(--text-3); }
.navbar-breadcrumb .bc-sep  { color: var(--slate-300); }
.navbar-breadcrumb .bc-page { font-weight: 600; color: var(--text); }

.navbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.date-chip {
  background: var(--slate-50); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 20px;
  font-size: 12px; color: var(--text-3); font-weight: 500;
}

.rate-chip {
  background: var(--slate-50); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 20px;
  font-size: 12px; color: var(--text-3); font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  font-variant-numeric: tabular-nums;
}
.rate-chip:hover { background: var(--slate-100); color: var(--text); border-color: var(--slate-300); }

.btn-primary {
  background: var(--accent); color: #fff; border: none;
  padding: 7px 16px; border-radius: 20px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(99,102,241,0.35);
}
.btn-primary:hover { background: var(--accent-d); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(99,102,241,0.4); }

/* ── Page content ──────────────────────────────────────────── */
.page-content {
  flex: 1; padding: 26px;
  display: flex; flex-direction: column; gap: 22px;
}

/* ═══════════════════════════════════════════════════════════════
   KPI CARDS
   ═══════════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.kpi-card-top { display: flex; align-items: flex-start; justify-content: space-between; }

.kpi-icon-wrap {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}

.kpi-today  .kpi-icon-wrap { background: var(--indigo-50);  color: var(--indigo-500); }
.kpi-week   .kpi-icon-wrap { background: #fef2f2; color: var(--red); }
.kpi-month  .kpi-icon-wrap { background: #ecfdf5; color: var(--green); }
.kpi-total  .kpi-icon-wrap { background: #fffbeb; color: var(--yellow); }

.kpi-trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 20px;
}
.kpi-trend.up   { background: #ecfdf5; color: var(--green); }
.kpi-trend.down { background: #fef2f2; color: var(--red); }
.kpi-trend.neutral { background: var(--slate-100); color: var(--text-3); }

.kpi-label { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--text); letter-spacing: -1px; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-sub   { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* Accent line at top */
.kpi-today::before  { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--indigo-500); border-radius: var(--radius) var(--radius) 0 0; }
.kpi-week::before   { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--red); border-radius: var(--radius) var(--radius) 0 0; }
.kpi-month::before  { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--green); border-radius: var(--radius) var(--radius) 0 0; }
.kpi-total::before  { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--yellow); border-radius: var(--radius) var(--radius) 0 0; }

/* ═══════════════════════════════════════════════════════════════
   CHART CARDS
   ═══════════════════════════════════════════════════════════════ */
.charts-row { display: flex; gap: 16px; }
.chart-wide   { flex: 3; min-width: 0; }
.chart-narrow { flex: 2; min-width: 0; }
.chart-half   { flex: 1; min-width: 0; }

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.chart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.chart-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 7px;
}

.chart-title-icon {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--indigo-50); color: var(--indigo-500);
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}

.chart-badge {
  font-size: 10.5px; font-weight: 600;
  background: var(--slate-100); color: var(--text-3);
  padding: 2px 8px; border-radius: 20px;
}

.chart-body {
  padding: 16px; flex: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; position: relative;
}

.chart-donut-wrap { max-height: 300px; padding: 10px 16px 16px; }

/* ═══════════════════════════════════════════════════════════════
   SECTION / TABLE CARDS
   ═══════════════════════════════════════════════════════════════ */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}

.section-title-icon {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--indigo-50); color: var(--indigo-500);
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}

/* Compact icon-chip stat cards -- e.g. business-page expense summaries,
   where the accent color comes from the business (set via inline style)
   rather than a fixed palette. */
.mini-stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.mini-stat-card {
  flex: 1; min-width: 150px;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
}
.mini-stat-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.mini-stat-label {
  font-size: 10.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 3px;
}
.mini-stat-value { font-size: 18px; font-weight: 800; color: var(--text); letter-spacing: -0.4px; line-height: 1.1; }

/* Trading bot nav (top bar of clickable bot buttons) */
.bot-nav {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.bot-nav-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
  border-top: 3px solid var(--bot-color, var(--slate-300));
}
.bot-nav-btn:hover { color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.bot-nav-btn.active {
  color: #fff; background: var(--bot-color, var(--accent));
  border-color: var(--bot-color, var(--accent));
}
.bot-nav-btn.active .status-pill { filter: brightness(1.1); }

/* Trading bot panel — connection banner, section labels, inline notes */
.bot-conn-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; font-size: 13px; color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.bot-section-label {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 16px 20px 8px;
}
.bot-note {
  margin: 0; padding: 0 20px 12px; font-size: 12.5px; color: var(--text-3);
}

.record-badge {
  background: var(--slate-100); color: var(--text-3);
  font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px;
}

/* Trading fleet overview — one card per distinct VPS/account group (not per
   bot slug or per client row), since /overview's health/market/risk data is
   inherently VPS-wide, not account-specific. */
.fleet-cards { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px; }
.fleet-group-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface);
}
.fleet-group-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
  padding: 12px 16px; background: var(--slate-50);
  border-bottom: 1px solid var(--border);
}
.fleet-group-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--text); }

.section-actions { display: flex; align-items: center; gap: 8px; }

.btn-link {
  font-size: 12px; font-weight: 600; color: var(--accent);
  display: inline-flex; align-items: center; gap: 4px;
  transition: color var(--transition);
}
.btn-link:hover { color: var(--accent-d); }

/* ═══════════════════════════════════════════════════════════════
   EXPENSE TABLE (Sheet)
   ═══════════════════════════════════════════════════════════════ */
.expense-sheet { width: 100% !important; border-collapse: collapse; font-size: 13px; }

.expense-sheet thead th {
  background: var(--slate-50);
  color: var(--text-3); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; user-select: none;
}

.expense-sheet thead th:first-child { padding-left: 18px; }
.expense-sheet thead th:last-child  { padding-right: 18px; }

.expense-sheet tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.expense-sheet tbody td:first-child { padding-left: 18px; }
.expense-sheet tbody td:last-child  { padding-right: 18px; }

.expense-sheet tbody tr:last-child td { border-bottom: none; }
.expense-sheet tbody tr:hover td { background: var(--slate-50); }
.sheet-row { cursor: pointer; }

.sheet-totals td {
  background: var(--slate-50); padding: 10px 16px;
  font-weight: 700; font-size: 13px;
  border-top: 2px solid var(--border);
  color: var(--text);
}

/* ── Cell atoms ────────────────────────────────────────────── */
.date-badge {
  font-size: 12px; color: var(--text-2); font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.desc-cell { font-weight: 500; color: var(--text); max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-cell { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

.cat-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--indigo-50); color: var(--indigo-600);
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px; white-space: nowrap;
}

.pay-chip {
  display: inline-flex; align-items: center;
  background: var(--slate-100); color: var(--slate-600);
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px; white-space: nowrap;
}

.currency-tag {
  display: inline-block; background: var(--slate-100); color: var(--text-3);
  font-size: 9.5px; font-weight: 700; padding: 1px 5px;
  border-radius: var(--radius-xs); margin-left: 4px; letter-spacing: 0.3px;
}

.amount-cell {
  font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text); white-space: nowrap;
}

.status-badge {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 20px; letter-spacing: 0.2px;
}
.status-submitted  { background: #fffbeb; color: #b45309; }
.status-reviewed   { background: #eff6ff; color: #1d4ed8; }
.status-reimbursed { background: #f0fdf4; color: #15803d; }

.actions-cell { white-space: nowrap; }

.btn-icon {
  width: 28px; height: 28px; border: 1.5px solid transparent;
  border-radius: var(--radius-xs); cursor: pointer; font-size: 11.5px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}

.btn-edit { background: var(--indigo-50); border-color: var(--indigo-100); color: var(--indigo-500); }
.btn-edit:hover { background: var(--indigo-100); }
.btn-del  { background: #fef2f2; border-color: #fecaca; color: var(--red); }
.btn-del:hover  { background: #fee2e2; }

.empty-state { text-align: center; padding: 44px 20px !important; color: var(--text-3); }
.empty-state a { color: var(--accent); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   BREAKDOWN TABLE
   ═══════════════════════════════════════════════════════════════ */
.breakdown-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.breakdown-table thead th {
  background: var(--slate-50); color: var(--text-3);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
  padding: 9px 16px; border-bottom: 1px solid var(--border);
}

.breakdown-table tbody td {
  padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.breakdown-table tbody tr:last-child td { border-bottom: none; }
.breakdown-table tbody tr:hover td { background: var(--slate-50); }

.cat-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: middle; flex-shrink: 0; }

.share-bar-wrap { display: flex; align-items: center; gap: 7px; }
.share-bar { height: 5px; border-radius: 3px; min-width: 2px; max-width: 100px; transition: width 0.5s ease; }
.share-bar-wrap span { font-size: 11px; color: var(--text-3); font-weight: 600; min-width: 36px; }

/* ═══════════════════════════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════════════════════════ */
.filter-bar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.filter-group { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 130px; }

.filter-label {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.filter-input, .filter-select {
  height: 34px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 10px;
  font-size: 13px; color: var(--text); background: var(--slate-50);
  outline: none; font-family: inherit; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.filter-input:focus, .filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
  background: #fff;
}

.filter-actions { display: flex; gap: 7px; align-items: flex-end; }

.btn-filter-apply {
  height: 34px; background: var(--accent); color: #fff; border: none;
  padding: 0 16px; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background var(--transition);
}
.btn-filter-apply:hover { background: var(--accent-d); }

.btn-filter-clear {
  height: 34px; background: var(--slate-50); color: var(--text-3);
  border: 1.5px solid var(--border); padding: 0 12px;
  border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-family: inherit;
  transition: background var(--transition), color var(--transition);
}
.btn-filter-clear:hover { background: var(--border); color: var(--text-2); }

.btn-export {
  height: 32px; background: var(--slate-50); color: var(--text-2);
  border: 1.5px solid var(--border); padding: 0 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px;
  transition: background var(--transition), color var(--transition);
}
.btn-export:hover { background: var(--slate-100); }

/* ═══════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════ */
.modal-glass {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-md);
}

.modal-head { padding: 20px 24px 14px; border-bottom: 1px solid var(--border); }

.modal-brand {
  display: flex; align-items: center; gap: 10px;
}

.modal-brand-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--indigo-50); color: var(--indigo-500);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}

.modal-title-text { font-size: 15px; font-weight: 700; color: var(--text); }
.modal-subtitle   { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

.modal-body-inner { padding: 18px 24px 20px; }

.form-row { display: grid; gap: 14px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 2fr 1fr 1fr; }

.form-field { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 10.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.form-label .req { color: var(--red); }

.form-control {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 13.5px; color: var(--text);
  background: var(--slate-50); font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  width: 100%;
}
.form-control:focus {
  border-color: var(--accent); background: #fff; outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
textarea.form-control { resize: vertical; min-height: 70px; }

.modal-footer-actions {
  display: flex; justify-content: flex-end; align-items: center; gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--slate-50);
  border-radius: 0 0 16px 16px;
}

.btn-cancel {
  background: #fff; border: 1.5px solid var(--border); color: var(--text-2);
  padding: 8px 18px; border-radius: 20px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background var(--transition), border-color var(--transition);
}
.btn-cancel:hover { background: var(--slate-100); border-color: var(--slate-300); }

.btn-save {
  background: var(--accent); color: #fff; border: none;
  padding: 8px 22px; border-radius: 20px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.btn-save:hover { background: var(--accent-d); box-shadow: 0 4px 14px rgba(99,102,241,0.4); }

/* Delete modal */
.delete-icon {
  width: 52px; height: 52px; background: #fef2f2; color: var(--red);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin: 0 auto;
}

.btn-danger {
  background: var(--red); color: #fff; border: none;
  padding: 8px 20px; border-radius: 20px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background var(--transition);
}
.btn-danger:hover { background: #dc2626; }

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}

.toast-msg {
  display: flex; align-items: center; gap: 10px;
  background: var(--slate-900); color: #fff;
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 28px rgba(0,0,0,0.2);
  pointer-events: all; min-width: 240px;
  animation: toastIn 0.25s ease forwards;
}

.toast-msg.toast-success .toast-icon { color: var(--green); }
.toast-msg.toast-error   .toast-icon { color: var(--red); }
.toast-msg.toast-out { animation: toastOut 0.25s ease forwards; }

.toast-icon { font-size: 15px; flex-shrink: 0; }
.toast-text { flex: 1; }

@keyframes toastIn  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0);   } to { opacity: 0; transform: translateY(10px); } }

/* ═══════════════════════════════════════════════════════════════
   DATATABLES OVERRIDES
   ═══════════════════════════════════════════════════════════════ */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 5px 10px !important;
  font-size: 12.5px !important;
  background: var(--slate-50) !important;
  font-family: inherit !important;
  color: var(--text) !important;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--accent) !important;
  outline: none !important;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  font-size: 12px; color: var(--text-3);
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--radius-xs) !important; font-size: 12.5px !important; color: var(--text-2) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--slate-100) !important; border-color: var(--border) !important; color: var(--text) !important;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR COLLAPSED STATE (desktop)
   ═══════════════════════════════════════════════════════════════ */
.sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }
.main-area.expanded { margin-left: 0; }

/* ── Mobile sidebar overlay ────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.45);
  z-index: 999;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ═══════════════════════════════════════════════════════════════
   ERROR PAGES
   ═══════════════════════════════════════════════════════════════ */
.error-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.error-box { text-align: center; padding: 32px 24px; max-width: 440px; }
.error-code  { font-size: 72px; font-weight: 800; color: var(--indigo-500); line-height: 1; letter-spacing: -4px; }
.error-title { font-size: 22px; font-weight: 700; color: var(--text); margin: 12px 0 8px; }
.error-desc  { color: var(--text-3); font-size: 14px; margin-bottom: 28px; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — TABLET  (≤ 1024px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .charts-row { flex-direction: column; }
  .chart-wide, .chart-narrow, .chart-half { flex: unset; width: 100%; }

  /* Sidebar becomes off-canvas overlay on tablets too */
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    z-index: 1001;
    box-shadow: none;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-md);
  }
  .main-area { margin-left: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE  (≤ 768px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Navbar ──────────────────────────────────────────────── */
  .top-navbar { padding: 0 14px; gap: 10px; }
  .navbar-breadcrumb { font-size: 13px; }
  .date-chip, .rate-chip { display: none; }         /* hide on mobile — saves space */
  .btn-primary { padding: 8px 14px; font-size: 12px; border-radius: 18px; }

  /* ── Page content ────────────────────────────────────────── */
  .page-content { padding: 14px; gap: 14px; }

  /* ── KPI Cards ───────────────────────────────────────────── */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card { padding: 16px 14px; gap: 10px; }
  .kpi-value { font-size: 20px; letter-spacing: -0.5px; }
  .kpi-label { font-size: 10px; }
  .kpi-sub   { font-size: 10.5px; }
  .kpi-icon-wrap { width: 34px; height: 34px; font-size: 15px; border-radius: 8px; }
  .kpi-trend { font-size: 10px; padding: 2px 6px; }

  /* ── Charts ──────────────────────────────────────────────── */
  .chart-header { padding: 12px 14px 10px; }
  .chart-body   { padding: 12px; min-height: 200px; }
  .chart-donut-wrap { max-height: 260px; padding: 8px 12px 12px; }

  /* ── Section cards ───────────────────────────────────────── */
  .section-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .section-actions { width: 100%; justify-content: flex-end; }

  /* ── Tables ──────────────────────────────────────────────── */
  .expense-sheet thead th,
  .expense-sheet tbody td { padding: 10px 10px; font-size: 12px; }
  .expense-sheet thead th:first-child,
  .expense-sheet tbody td:first-child { padding-left: 14px; }
  .expense-sheet thead th:last-child,
  .expense-sheet tbody td:last-child  { padding-right: 14px; }
  .desc-cell { max-width: 140px; }
  .table-responsive { -webkit-overflow-scrolling: touch; }

  /* ── Breakdown table ─────────────────────────────────────── */
  .breakdown-table thead th,
  .breakdown-table tbody td { padding: 9px 10px; font-size: 12px; }

  /* ── Filter bar ──────────────────────────────────────────── */
  .filter-bar {
    flex-direction: column;
    padding: 12px 14px;
    gap: 10px;
  }
  .filter-group { min-width: unset; width: 100%; }
  .filter-actions { width: 100%; flex-direction: row; }
  .btn-filter-apply,
  .btn-filter-clear { flex: 1; justify-content: center; height: 40px; }

  /* ── Buttons in section header ───────────────────────────── */
  .btn-export { height: 34px; font-size: 11.5px; padding: 0 10px; }

  /* ── Modal — bottom sheet on mobile ─────────────────────── */
  .modal-dialog {
    margin: 0;
    min-height: 100%;
    align-items: flex-end;
  }
  .modal-dialog-centered { align-items: flex-end !important; }

  .modal-glass {
    border-radius: 20px 20px 0 0 !important;
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
  }

  /* Drag handle pill at top of sheet */
  .modal-head::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: var(--slate-300);
    border-radius: 2px;
    margin: 0 auto 14px;
  }

  .modal-head       { padding: 10px 18px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
  .modal-body-inner { padding: 16px 18px; overflow-y: auto; flex: 1; }
  .modal-footer-actions {
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    flex-shrink: 0;
  }

  /* ── Prevent iOS auto-zoom (font-size must be ≥ 16px) ───── */
  .form-control,
  .filter-input,
  .filter-select { font-size: 16px !important; }
  textarea.form-control { font-size: 16px !important; }

  /* ── Larger touch targets ────────────────────────────────── */
  .form-control  { height: 48px; padding: 0 14px; }
  textarea.form-control { height: auto; padding: 12px 14px; min-height: 80px; }
  .btn-save, .btn-cancel, .btn-danger { height: 48px; font-size: 15px; border-radius: 24px; }

  /* ── cols-3 rows: keep Amount + Currency side by side ────── */
  .form-row.cols-3 { grid-template-columns: 1fr; }
  .form-row.cols-2 { grid-template-columns: 1fr 1fr; }

  /* ── DataTables ──────────────────────────────────────────── */
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter { width: 100%; }
  .dataTables_wrapper .dataTables_filter input { width: 100% !important; }
  .dataTables_wrapper .dataTables_info { font-size: 11.5px; }

  /* ── Toast ───────────────────────────────────────────────── */
  #toast-container { bottom: 16px; right: 12px; left: 12px; }
  .toast-msg { min-width: unset; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE  (≤ 480px)
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* Keep KPI cards horizontal (2-up) even on the smallest phones —
     previously these collapsed to a single full-width column */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi-card { padding: 12px; gap: 8px; }
  .kpi-icon-wrap { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
  .kpi-value { font-size: 18px; letter-spacing: -0.5px; }
  .kpi-label { font-size: 9.5px; }
  .kpi-sub   { font-size: 9.5px; }

  /* Navbar — icon-only buttons on very small screens */
  .btn-primary .btn-label,
  .btn-income-nav .btn-label { display: none; }
  .navbar-breadcrumb .bc-page { font-size: 13px; }

  /* Tighter page padding */
  .page-content { padding: 10px; gap: 10px; }

  /* Full-width section actions */
  .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .section-actions { width: 100%; flex-wrap: wrap; gap: 6px; }
  .section-actions .btn-export,
  .section-actions .btn-primary { flex: 1; justify-content: center; }

  /* ── Business pages ─────────────────────────────────────── */
  .form-row-2 { grid-template-columns: 1fr !important; }
  .agency-section-switcher { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .publish-grid  { grid-template-columns: 1fr; }
  .stat-grid     { grid-template-columns: repeat(2, 1fr); }
  .mkt-client-header  { flex-direction: column; align-items: flex-start; gap: 12px; }
  .mkt-client-stats   { gap: 12px; }
  .mkt-content-grid   { grid-template-columns: repeat(2, 1fr); }
  .agency-sub-header  { flex-direction: column; align-items: flex-start; gap: 10px; }
  .table-wrap         { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .biz-header         { flex-wrap: wrap; gap: 10px; }
  .biz-header .ms-auto { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   FINANCIAL OVERVIEW
   ═══════════════════════════════════════════════════════════════ */

/* ── Setup prompt (when not configured) ─────────────────────── */
.fin-setup-prompt {
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm);
}
.fin-setup-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: #ecfdf5; color: #10b981;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.fin-setup-title { font-size: 14px; font-weight: 700; color: var(--text); }
.fin-setup-sub   { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.fin-setup-text  { flex: 1; }
.btn-fin-setup {
  background: #10b981; color: #fff; border: none;
  padding: 9px 18px; border-radius: 20px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; font-family: inherit;
  display: inline-flex; align-items: center;
  transition: background var(--transition);
}
.btn-fin-setup:hover { background: #059669; }

/* ── Main overview card ──────────────────────────────────────── */
.fin-overview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.fin-overview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}
.fin-overview-title {
  font-size: 13px; font-weight: 700; color: #065f46;
  display: flex; align-items: center; gap: 8px;
}
.fin-overview-title i { color: #10b981; }
.btn-fin-edit {
  background: #fff; border: 1.5px solid #a7f3d0; color: #065f46;
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background var(--transition);
}
.btn-fin-edit:hover { background: #ecfdf5; }

/* ── 4-stat grid ─────────────────────────────────────────────── */
.fin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.fin-stat {
  padding: 18px 20px;
  border-right: 1px solid var(--border);
}
.fin-stat:last-child { border-right: none; }

.fin-stat-label {
  font-size: 10.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.fin-stat-value {
  font-size: 22px; font-weight: 800; color: var(--text);
  letter-spacing: -0.5px; font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 5px;
}
.fin-stat-value.fin-over { color: var(--red); }
.fin-stat-value.fin-good { color: var(--green); }
.fin-stat-sub {
  font-size: 11.5px; color: var(--text-3); margin-top: 4px;
}
.fin-spent-label {
  font-size: 12px; font-weight: 500; color: var(--text-3);
}
.fin-over-tag {
  display: inline-block;
  background: #fef2f2; color: var(--red);
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 20px;
}

/* Accent left borders per stat */
.fin-stat-balance  { border-top: 3px solid #6366f1; }
.fin-stat-income   { border-top: 3px solid #10b981; }
.fin-stat-month    { border-top: 3px solid #f59e0b; }
.fin-stat-net      { border-top: 3px solid #06b6d4; }

/* ── Progress bar ────────────────────────────────────────────── */
.fin-progress-wrap {
  padding: 16px 20px 18px;
  border-top: 1px solid var(--border);
  background: var(--slate-50);
}
.fin-progress-labels {
  display: flex; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  margin-bottom: 8px;
}
.fin-progress-labels .fin-over { color: var(--red); }
.fin-progress-track {
  height: 10px; background: var(--slate-200);
  border-radius: 10px; overflow: hidden;
}
.fin-progress-fill {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
}
.fin-progress-fill.fin-warn-fill { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fin-progress-fill.fin-over-fill { background: linear-gradient(90deg, #ef4444, #f87171); }
.fin-progress-legend {
  display: flex; justify-content: space-between;
  font-size: 10.5px; color: var(--text-3); margin-top: 5px;
}

/* ── Income nav button ───────────────────────────────────────── */
.btn-income-nav {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #fff; border: none;
  padding: 7px 14px; border-radius: 20px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: inherit;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}
.btn-income-nav:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-sm-nav { padding: 5px 12px; font-size: 11.5px; }

.btn-save-income { background: linear-gradient(135deg, #10b981, #34d399) !important; }

/* ── Budget modal specifics ──────────────────────────────────── */
.budget-info-banner {
  background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 12px; color: #1d4ed8; margin-bottom: 18px;
  display: flex; gap: 8px;
}
.budget-info-banner i { flex-shrink: 0; margin-top: 1px; }

.currency-toggle-group {
  display: flex; gap: 8px;
}
.currency-toggle-option {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.currency-toggle-option:has(input:checked) {
  border-color: var(--accent); background: var(--indigo-50); color: var(--accent);
}
.currency-toggle-option input { display: none; }

.form-hint {
  display: block; font-size: 10.5px; font-weight: 400;
  color: var(--text-3); text-transform: none; letter-spacing: 0;
  margin-top: 1px;
}
.amount-input-wrap {
  display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--slate-50); overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.amount-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
  background: #fff;
}
.amount-prefix {
  padding: 0 12px; font-size: 16px; font-weight: 700;
  color: var(--text-3); border-right: 1.5px solid var(--border);
  background: var(--slate-100); height: 46px;
  display: flex; align-items: center; flex-shrink: 0;
}
.amount-input {
  border: none !important; background: transparent !important;
  box-shadow: none !important; border-radius: 0 !important;
  flex: 1; padding-left: 12px !important; font-size: 16px !important;
}

/* ═══════════════════════════════════════════════════════════════
   DEBT TRACKING
   ═══════════════════════════════════════════════════════════════ */

.debt-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Single debt card ────────────────────────────────────────── */
.debt-card {
  padding: 20px 20px 0;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.debt-card:last-child { border-bottom: none; }
.debt-card:hover { background: var(--slate-50); }
.debt-card.debt-paid { opacity: 0.6; }
.debt-card.debt-paid:hover { opacity: 1; }

/* ── Card header ─────────────────────────────────────────────── */
.debt-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.debt-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  flex-shrink: 0; letter-spacing: 0;
}

.debt-info { flex: 1; min-width: 0; }
.debt-person { font-size: 15px; font-weight: 700; color: var(--text); }
.debt-desc   { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.debt-meta   { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }

.debt-status-pill {
  flex-shrink: 0;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
  display: inline-flex; align-items: center;
  white-space: nowrap;
}
.pill-active { background: #fef3c7; color: #92400e; }
.pill-paid   { background: #dcfce7; color: #166534; }

.debt-actions {
  display: flex; gap: 5px; flex-shrink: 0;
}

/* ── Metrics strip ───────────────────────────────────────────── */
.debt-metrics {
  display: flex;
  align-items: center;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.debt-metric {
  flex: 1;
  padding: 10px 14px;
  text-align: center;
}

.debt-metric-divider {
  width: 1px; height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

.debt-metric-label {
  font-size: 10px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 3px;
}

.debt-metric-value {
  font-size: 15px; font-weight: 700;
  color: var(--text); font-variant-numeric: tabular-nums;
}

.debt-metric-paid   { color: var(--green); }
.debt-metric-owed   { color: #ef4444; }
.debt-metric-zero   { color: var(--green); }

.debt-metric-highlight { background: rgba(239,68,68,0.04); }

/* ── Progress bar + actions row ──────────────────────────────── */
.debt-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.debt-progress-track {
  flex: 1; height: 7px;
  background: var(--slate-200);
  border-radius: 10px; overflow: hidden;
}

.debt-progress-fill {
  height: 100%; border-radius: 10px;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}
.fill-done { background: linear-gradient(90deg, #10b981, #34d399); }
.fill-good { background: linear-gradient(90deg, #10b981, #34d399); }
.fill-mid  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fill-low  { background: linear-gradient(90deg, #ef4444, #f87171); }

.debt-pct {
  font-size: 11px; font-weight: 600;
  color: var(--text-3); white-space: nowrap;
}

.btn-pay {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: #fff; border: none;
  padding: 5px 12px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; font-family: inherit;
  display: inline-flex; align-items: center;
  transition: opacity var(--transition);
}
.btn-pay:hover { opacity: 0.85; }
.btn-pay--ghost {
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border);
}

/* ── Client jobs ─────────────────────────────────────────────── */
.pill-open { background: var(--indigo-50); color: var(--indigo-600); }
.job-sub-label {
  font-size: 10.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .5px; margin: 8px 0 4px;
}
.client-chip {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 4px;
  background: #fffbeb; color: #92400e; text-decoration: none;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; white-space: nowrap;
}
.client-chip:hover { color: #78350f; }
.client-chip.is-recovered { background: #dcfce7; color: #166534; }
.billable-switch {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-2);
}
.billable-switch input { margin-top: 3px; accent-color: var(--indigo-500); }

/* ── Payment history ─────────────────────────────────────────── */
.debt-history-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 0 14px;
  font-size: 12px; font-weight: 600; color: var(--text-3);
  cursor: pointer; user-select: none;
  transition: color var(--transition);
}
.debt-history-toggle:hover { color: var(--accent); }

.toggle-arrow {
  margin-left: auto;
  transition: transform 0.2s ease;
  font-size: 11px;
}

.proj-more-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0 14px;
  font-size: 12px; font-weight: 600; color: var(--text-3);
  cursor: pointer; user-select: none;
  transition: color var(--transition);
}
.proj-more-toggle:hover { color: var(--accent); }
.proj-more-arrow { transition: transform 0.2s ease; font-size: 11px; }

.debt-history {
  border-top: 1px solid var(--border);
  margin: 0 -20px;
  padding: 0 20px 16px;
}

.payment-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-top: 10px;
}
.payment-table thead th {
  color: var(--text-3); font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 6px 10px; border-bottom: 1px solid var(--border);
  background: var(--slate-50);
}
.payment-table tbody td {
  padding: 9px 10px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.payment-table tbody tr:last-child td { border-bottom: none; }
.payment-table tbody tr:hover td { background: var(--slate-50); }

/* ── Empty state ─────────────────────────────────────────────── */
.debt-empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}
.debt-empty i {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
  color: var(--slate-300);
}

/* ── Payment modal banner ────────────────────────────────────── */
.pay-remaining-banner {
  background: #ecfdf5; border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 12.5px;
  font-weight: 600; color: #065f46;
  margin-bottom: 16px;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .debt-card { padding: 16px 14px 0; }
  .debt-card-head { gap: 10px; }
  .debt-avatar { width: 36px; height: 36px; font-size: 15px; }
  .debt-person { font-size: 14px; }
  .debt-status-pill { display: none; }
  .debt-metrics { flex-wrap: wrap; }
  .debt-metric { padding: 8px 10px; }
  .debt-metric-value { font-size: 13.5px; }
  .debt-history { margin: 0 -14px; padding: 0 14px 12px; }
}

/* ── Responsive: financial overview ─────────────────────────── */
@media (max-width: 768px) {
  .fin-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .fin-stat { border-right: none; border-bottom: 1px solid var(--border); }
  .fin-stat:nth-child(1),
  .fin-stat:nth-child(2) { border-right: 1px solid var(--border); }
  .fin-stat:nth-child(odd) { border-right: 1px solid var(--border); }
  .fin-stat:nth-last-child(-n+2) { border-bottom: none; }
  .fin-stat-value { font-size: 18px; }
  .fin-setup-prompt { flex-wrap: wrap; }
  .btn-fin-setup { width: 100%; justify-content: center; }
}
@media (max-width: 480px) {
  .fin-stats-grid { grid-template-columns: 1fr 1fr; }
  .fin-stat { padding: 14px; }
}

/* ── Safe area insets (iPhone notch / home indicator) ───────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .page-content  { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  #toast-container { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .sidebar { padding-bottom: env(safe-area-inset-bottom); }
}

/* ── Prevent body scroll when mobile sidebar is open ────────── */
body.sidebar-open { overflow: hidden; }

/* ══════════════════════════════════════════════════════════════
   AGENT REVIEW UI
   ══════════════════════════════════════════════════════════════ */

/* Filter tabs */
.agent-filter-tabs {
  display: flex; gap: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px;
}
.agent-tab {
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  transition: background var(--transition), color var(--transition);
  display: inline-flex; align-items: center; gap: 6px;
}
.agent-tab:hover { background: var(--slate-100); color: var(--text); }
.agent-tab.active { background: var(--indigo-50); color: var(--indigo-600); font-weight: 700; }
.tab-badge {
  background: var(--yellow); color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 1px 5px; border-radius: 10px;
}

/* Business origin badge */
.biz-origin-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  background: var(--slate-100); color: var(--text-2);
}

/* gap-10 utility */
.gap-10 { gap: 10px; }

.agent-task-list { display: flex; flex-direction: column; }

.agent-task {
  border-bottom: 1px solid var(--border); padding: 16px 20px;
  transition: background var(--transition);
}
.agent-task:last-child { border-bottom: none; }
.agent-task:hover { background: var(--slate-50); }
.agent-task--pending  { border-left: 3px solid var(--yellow); }
.agent-task--approved { border-left: 3px solid var(--green); }
.agent-task--rejected { border-left: 3px solid var(--red); opacity: 0.6; }
.agent-task--executing { border-left: 3px solid var(--cyan); }
.agent-task--done     { border-left: 3px solid var(--slate-300); }
.agent-task--failed   { border-left: 3px solid var(--red); }

.agent-task-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}

.agent-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px;
}
.agent-badge--manager          { background: #ede9fe; color: #5b21b6; }
.agent-badge--software_engineer { background: #dbeafe; color: #1e40af; }
.agent-badge--designer         { background: #fce7f3; color: #9d174d; }
.agent-badge--social_media     { background: #d1fae5; color: #065f46; }
.agent-badge--marketing        { background: #fff7ed; color: #c2410c; }

.priority-badge { font-size: 11px; }

.task-date { font-size: 11px; color: var(--text-3); }

.agent-task-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  margin-bottom: 8px; line-height: 1.4;
}

.agent-task-draft {
  background: var(--slate-50); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px;
}
.draft-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-3); margin-bottom: 4px;
}
.draft-body { font-size: 12.5px; color: var(--text-2); line-height: 1.5; white-space: pre-wrap; }
.draft-link { font-size: 12px; color: var(--accent); word-break: break-all; }

.draft-image {
  width: 100%; max-width: 340px; border-radius: var(--radius-sm);
  margin-bottom: 10px; display: block;
}
.draft-hashtags {
  font-size: 12px; color: var(--indigo-500); margin-top: 6px; line-height: 1.6;
}
.calendar-table-wrap { overflow-x: auto; margin-top: 8px; }
.calendar-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.calendar-table th {
  background: var(--slate-100); padding: 5px 10px; text-align: left;
  font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border);
}
.calendar-table td {
  padding: 6px 10px; border-bottom: 1px solid var(--slate-100); color: var(--text);
  vertical-align: top;
}
.calendar-table tr:last-child td { border-bottom: none; }
.ad-headline {
  font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.ad-cta {
  display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700;
  background: var(--indigo-50); color: var(--indigo-600);
  padding: 3px 10px; border-radius: 20px;
}

.agent-task-result {
  font-size: 12px; color: var(--text-2); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.agent-task-result a { color: var(--accent); }

.agent-task-actions { display: flex; gap: 8px; margin-top: 6px; }

.btn-agent-approve {
  background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7;
  border-radius: var(--radius-xs); padding: 5px 12px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background var(--transition);
}
.btn-agent-approve:hover { background: #a7f3d0; }

.btn-agent-reject {
  background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5;
  border-radius: var(--radius-xs); padding: 5px 12px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background var(--transition);
}
.btn-agent-reject:hover { background: #fecaca; }

.btn-agent-execute {
  background: var(--indigo-500); color: #fff; border: none;
  border-radius: var(--radius-xs); padding: 5px 14px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background var(--transition);
}
.btn-agent-execute:hover { background: var(--indigo-600); }

/* ══════════════════════════════════════════════════════════════
   AI AGENTS PAGE
   ══════════════════════════════════════════════════════════════ */

/* ── Page header ─────────────────────────────────────────────── */
.agents-page-header {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.agents-title-area {
  display: flex; align-items: center; gap: 14px; flex: 1; min-width: 200px;
}
.agents-title-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--indigo-500), var(--indigo-700));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px; flex-shrink: 0;
}
.agents-title {
  font-size: 18px; font-weight: 700; color: var(--text); margin: 0;
}
.agents-sub { font-size: 12px; color: var(--text-3); margin: 2px 0 0; }

/* ── Business selector pills ─────────────────────────────────── */
.biz-pills-row {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.biz-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 24px; border: none;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all var(--transition);
  background: var(--slate-100); color: var(--text-2);
}
.biz-pill:hover { background: var(--slate-200); color: var(--text); }

.biz-pill--all.active,
.biz-pill--all:hover.active {
  background: linear-gradient(135deg, var(--indigo-500), var(--indigo-700));
  color: #fff; box-shadow: 0 2px 10px rgba(99,102,241,0.35);
}
.biz-pill--agency.active {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; box-shadow: 0 2px 10px rgba(59,130,246,0.35);
}
.biz-pill--gadgets.active {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  color: #fff; box-shadow: 0 2px 10px rgba(168,85,247,0.35);
}
.biz-pill--trading.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff; box-shadow: 0 2px 10px rgba(16,185,129,0.35);
}

/* ── Agency sub-section ──────────────────────────────────────── */
.agency-sub-header {
  background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: var(--radius); padding: 14px 20px;
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.agent-type-pills {
  display: flex; gap: 6px; flex: 1; flex-wrap: wrap;
}
.agent-type-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid #bfdbfe; background: #fff;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; color: #1d4ed8;
  transition: all var(--transition);
}
.agent-type-pill:hover { background: #dbeafe; }
.agent-type-pill.active {
  background: #3b82f6; border-color: #3b82f6; color: #fff;
}
.agency-actions {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.btn-agent-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all var(--transition);
}
.btn-agent-action--run  { background: var(--indigo-500); color: #fff; }
.btn-agent-action--run:hover  { background: var(--indigo-600); }
.btn-agent-action--se   { background: #dbeafe; color: #1e40af; }
.btn-agent-action--se:hover   { background: #bfdbfe; }
.btn-agent-action--mkt  { background: #ffedd5; color: #c2410c; }
.btn-agent-action--mkt:hover  { background: #fed7aa; }

/* ── Status bar ──────────────────────────────────────────────── */
.agents-status-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 0;
}
.btn-sm-action {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-2);
  font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all var(--transition);
}
.btn-sm-action:hover { background: var(--slate-100); color: var(--text); }

/* ── Business badge colours ──────────────────────────────────── */
.biz-badge--agency   { background: #dbeafe; color: #1e40af; }
.biz-badge--gadgets  { background: #f3e8ff; color: #6b21a8; }
.biz-badge--trading  { background: #d1fae5; color: #065f46; }
.biz-badge--shipping { background: #e0f2fe; color: #075985; }
.biz-badge--luvre    { background: #fce7f3; color: #9d174d; }

/* ══════════════════════════════════════════════════════════════
   CONTENT PUBLISHER
   ══════════════════════════════════════════════════════════════ */

.publish-filter-tabs { display:flex; gap:3px; }
.pub-tab {
  padding:4px 12px; border-radius:6px; border:none; background:none;
  font-size:12px; font-weight:600; cursor:pointer; color:var(--text-2);
  font-family:inherit; transition:all var(--transition);
}
.pub-tab:hover { color:var(--text); background:var(--slate-100); }
.pub-tab.active { background:#fff7ed; color:#ea580c; }

.publish-grid {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(260px,1fr));
  gap:16px; padding:4px 0;
}
.pub-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); overflow:hidden;
  transition:box-shadow var(--transition), transform var(--transition);
  border-top:3px solid var(--slate-200);
}
.pub-card:hover { box-shadow:0 4px 16px rgba(0,0,0,0.07); transform:translateY(-1px); }
.pub-card--scheduled { border-top-color:#f59e0b; }
.pub-card--published { border-top-color:#10b981; }
.pub-card--failed    { border-top-color:#ef4444; }
.pub-card--cancelled { border-top-color:#94a3b8; opacity:0.65; }

.pub-media {
  width:100%; height:180px; overflow:hidden; position:relative;
  background:var(--slate-100); display:flex; align-items:center; justify-content:center;
}
.pub-media-img { width:100%; height:100%; object-fit:cover; }
.pub-media--empty { flex-direction:column; gap:8px; color:var(--text-3); font-size:13px; }
.pub-media--empty i { font-size:32px; }
.pub-video-badge {
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:40px; height:40px; border-radius:50%; background:rgba(0,0,0,0.5);
  display:flex; align-items:center; justify-content:center; color:#fff; font-size:14px;
}

.pub-card-body { padding:14px; }
.pub-card-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }

.pub-client-badge {
  font-size:11px; font-weight:700; background:var(--indigo-50);
  color:var(--indigo-600); padding:2px 8px; border-radius:20px;
}
.pub-status-badge {
  display:inline-flex; align-items:center; gap:4px;
  font-size:11px; font-weight:700; padding:2px 8px; border-radius:20px;
}
.pub-status--scheduled { background:#fef3c7; color:#b45309; }
.pub-status--published { background:#d1fae5; color:#065f46; }
.pub-status--failed    { background:#fee2e2; color:#991b1b; }
.pub-status--cancelled { background:#f1f5f9; color:#64748b; }

.pub-platforms { display:flex; align-items:center; gap:6px; margin-bottom:8px; flex-wrap:wrap; }
.pub-platform {
  width:26px; height:26px; border-radius:6px;
  display:flex; align-items:center; justify-content:center; font-size:13px;
}
.pub-platform--facebook  { background:#e7f0fd; color:#1877f2; }
.pub-platform--instagram { background:#fce4ec; color:#e1306c; }
.pub-platform--tiktok    { background:#f0f0f0; color:#000; }
.pub-type-tag {
  font-size:10.5px; font-weight:700; background:var(--slate-100);
  color:var(--text-2); padding:2px 8px; border-radius:20px; text-transform:uppercase;
}

.pub-caption { font-size:12.5px; color:var(--text); line-height:1.5; margin-bottom:6px; }
.pub-hashtags { font-size:11.5px; color:var(--indigo-500); margin-bottom:6px; }
.pub-schedule-time {
  font-size:11.5px; color:var(--text-2); display:flex; align-items:center; gap:5px; margin-bottom:4px;
}
.pub-prompt {
  font-size:11px; color:var(--text-3); display:flex; align-items:flex-start;
  gap:5px; margin-bottom:6px; line-height:1.4;
}

.pub-actions { display:flex; gap:6px; margin-top:10px; padding-top:10px; border-top:1px solid var(--border); }
.btn-pub-cancel {
  font-size:11.5px; font-weight:600; padding:4px 12px; border-radius:6px;
  border:1.5px solid #fca5a5; background:#fee2e2; color:#991b1b; cursor:pointer;
  font-family:inherit; transition:background var(--transition);
}
.btn-pub-cancel:hover { background:#fecaca; }
.btn-pub-delete {
  font-size:11.5px; font-weight:600; padding:4px 10px; border-radius:6px;
  border:1.5px solid var(--border); background:var(--surface); color:var(--text-3);
  cursor:pointer; font-family:inherit; transition:background var(--transition);
}
.btn-pub-delete:hover { background:#fee2e2; color:#991b1b; border-color:#fca5a5; }

/* Upload area */
.pub-upload-area {
  border:2px dashed #fed7aa; background:#fff7ed; border-radius:var(--radius);
  padding:32px; text-align:center; cursor:pointer; margin-bottom:4px;
  transition:border-color var(--transition), background var(--transition);
}
.pub-upload-area:hover { border-color:#f97316; background:#ffedd5; }

/* Platform checkboxes */
.platform-checks { display:flex; gap:12px; flex-wrap:wrap; }
.platform-check-label {
  display:inline-flex; align-items:center; gap:6px;
  font-size:13px; font-weight:600; cursor:pointer; padding:6px 14px;
  border-radius:8px; border:1.5px solid var(--border);
  background:var(--surface); transition:all var(--transition);
}
.platform-check-label:has(input:checked) {
  border-color:#f97316; background:#fff7ed; color:#ea580c;
}
.platform-check-label input { width:14px; height:14px; accent-color:#f97316; }

/* ══════════════════════════════════════════════════════════════
   AI ADVISOR
   ══════════════════════════════════════════════════════════════ */

/* Sidebar AI badge */
.nav-item--ai { position: relative; }
.ai-badge {
  margin-left: auto;
  font-size: 9px; font-weight: 800; letter-spacing: 0.5px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; padding: 2px 6px; border-radius: 10px;
}

/* Page layout */
.ai-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  height: calc(100vh - var(--navbar-h) - 28px);
  min-height: 500px;
}

/* Prompts panel */
.ai-prompts-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto;
}

.ai-prompts-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-3);
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

.ai-prompts-list { display: flex; flex-direction: column; gap: 6px; }

.ai-prompt-chip {
  background: var(--slate-50); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
  font-size: 12px; color: var(--text-2); text-align: left;
  cursor: pointer; line-height: 1.4;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.ai-prompt-chip:hover {
  background: var(--indigo-50); border-color: var(--indigo-400);
  color: var(--indigo-600);
}

.ai-context-note {
  margin-top: auto;
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 11px; color: var(--text-3); line-height: 1.5;
  padding: 10px; background: var(--slate-50); border-radius: var(--radius-sm);
}
.ai-context-note i { color: var(--indigo-400); margin-top: 2px; flex-shrink: 0; }

/* Chat area */
.ai-chat-wrap {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}

.ai-chat-messages {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}

/* Messages */
.ai-msg {
  display: flex; align-items: flex-start; gap: 10px;
  max-width: 86%;
}
.ai-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.ai-msg--assistant .ai-msg-avatar {
  background: linear-gradient(135deg, var(--indigo-500), #8b5cf6);
  color: #fff;
}
.ai-msg--user .ai-msg-avatar {
  background: var(--slate-200); color: var(--text-2);
}

.ai-msg-bubble {
  border-radius: 14px; padding: 12px 16px;
  font-size: 13.5px; line-height: 1.65;
}
.ai-msg--assistant .ai-msg-bubble {
  background: var(--slate-50); border: 1px solid var(--border);
  border-top-left-radius: 4px;
}
.ai-msg--user .ai-msg-bubble {
  background: var(--indigo-500); color: #fff;
  border-top-right-radius: 4px;
}

/* Markdown inside AI bubble */
.ai-msg-content p { margin: 0 0 8px; }
.ai-msg-content p:last-child { margin-bottom: 0; }
.ai-msg-content h1,.ai-msg-content h2,.ai-msg-content h3 {
  font-size: 14px; font-weight: 700; margin: 12px 0 6px;
  color: var(--text);
}
.ai-msg-content ul,.ai-msg-content ol { padding-left: 18px; margin: 6px 0; }
.ai-msg-content li { margin-bottom: 4px; }
.ai-msg-content strong { font-weight: 700; color: var(--text); }
.ai-msg-content code {
  background: var(--slate-200); border-radius: 3px;
  padding: 1px 5px; font-size: 12px; font-family: monospace;
}
.ai-msg-content pre {
  background: var(--slate-800); color: #e2e8f0;
  border-radius: 6px; padding: 12px; overflow-x: auto;
  font-size: 12px; margin: 8px 0;
}

/* Typing indicator */
.ai-typing-dots {
  display: flex; align-items: center; gap: 4px; padding: 2px 0;
}
.ai-typing-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--slate-400);
  animation: aiTypingPulse 1.2s infinite ease-in-out;
}
.ai-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiTypingPulse {
  0%,80%,100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input area */
.ai-input-area {
  border-top: 1px solid var(--border); padding: 14px 16px 10px;
  background: var(--surface);
}

.ai-input-wrap {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--slate-50); border: 1px solid var(--border);
  border-radius: 14px; padding: 8px 8px 8px 14px;
  transition: border-color var(--transition);
}
.ai-input-wrap:focus-within { border-color: var(--indigo-400); }

.ai-input {
  flex: 1; border: none; background: transparent; resize: none;
  font-family: inherit; font-size: 13.5px; color: var(--text);
  line-height: 1.5; outline: none; max-height: 180px;
  padding: 2px 0;
}
.ai-input::placeholder { color: var(--text-3); }

.ai-send-btn {
  width: 34px; height: 34px; border-radius: 10px; border: none; flex-shrink: 0;
  background: var(--indigo-500); color: #fff; font-size: 13px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), opacity var(--transition);
}
.ai-send-btn:hover { background: var(--indigo-600); }
.ai-send-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.ai-input-hint {
  font-size: 10.5px; color: var(--text-3); margin-top: 6px; text-align: right;
}

/* Mobile: stack layout */
@media (max-width: 768px) {
  .ai-layout { grid-template-columns: 1fr; height: auto; }
  .ai-prompts-panel { max-height: 220px; }
  .ai-chat-wrap { height: 65vh; }
}

/* ══════════════════════════════════════════════════════════════
   BUSINESSES
   ══════════════════════════════════════════════════════════════ */

/* Sidebar business group */
.biz-group { display: flex; flex-direction: column; }

.biz-toggle {
  background: none; border: none; width: 100%; text-align: left;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.5);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.biz-toggle:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.biz-toggle.active { background: rgba(99,102,241,0.2); color: #fff; font-weight: 600; }

.biz-chevron {
  font-size: 10px; margin-left: auto;
  transition: transform var(--transition);
  color: rgba(255,255,255,0.3);
}

.biz-sub {
  display: flex; flex-direction: column; gap: 1px;
  padding-left: 14px; margin-top: 2px;
}

.nav-sub {
  font-size: 12px !important;
  padding: 7px 10px !important;
  color: rgba(255,255,255,0.38) !important;
}
.nav-sub:hover { color: rgba(255,255,255,0.7) !important; }
.nav-sub.active { color: #fff !important; }

/* Business page header */
.biz-header {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.biz-header-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  background: var(--biz-color, var(--accent));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--biz-color, var(--accent)) 40%, transparent);
}

.biz-title { font-size: 20px; font-weight: 700; color: var(--text); margin: 0; }
.biz-sub   { font-size: 12.5px; color: var(--text-2); margin: 2px 0 0; }

.btn-biz {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--biz-color, var(--accent));
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 600; padding: 8px 14px;
  cursor: pointer; transition: opacity var(--transition);
}
.btn-biz:hover { opacity: 0.88; }
.btn-biz:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-biz-sm {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--slate-100); color: var(--text-2);
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  font-size: 11.5px; font-weight: 600; padding: 5px 10px;
  cursor: pointer; transition: background var(--transition);
}
.btn-biz-sm:hover { background: var(--slate-200); }
.btn-biz-sm:disabled { opacity: 0.45; cursor: not-allowed; }

/* Section card */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 14px; font-weight: 700; color: var(--text); margin: 0;
}

/* Data table */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: var(--slate-50); color: var(--text-2);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
  padding: 10px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 11px 16px; border-bottom: 1px solid var(--border);
  color: var(--text); vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--slate-50); }

/* Status pills */
.status-pill {
  display: inline-block;
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  text-transform: capitalize;
}
.status-pill-select {
  font-size: 10.5px; font-weight: 700; padding: 2px 20px 2px 8px; border-radius: 20px;
  text-transform: capitalize; border: none; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
}
.status-active, .status-referred, .status-submitted { background: #d1fae5; color: #065f46; }
.status-inactive, .status-cancelled, .status-failed { background: #fee2e2; color: #991b1b; }
.status-on_hold, .status-pending, .status-provisioning { background: #fef3c7; color: #92400e; }
.status-completed, .status-paid { background: #dbeafe; color: #1e40af; }
.status-registered { background: #ede9fe; color: #5b21b6; }
/* INGCO request-for-quote and shop-account states (domains/ingco/models/enums.py) */
.status-quoted { background: #ede9fe; color: #5b21b6; }
.status-confirmed, .status-approved { background: #d1fae5; color: #065f46; }
.status-ready { background: #cffafe; color: #155e75; }
.status-rejected, .status-suspended { background: #fee2e2; color: #991b1b; }

/* ── INGCO: tab bar + sheets ─────────────────────────────────── */
.ingco-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.ingco-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 2px solid transparent; background: none;
  color: var(--text-2); font-size: 13px; font-weight: 700;
  font-family: inherit; cursor: pointer; transition: all var(--transition);
}
.ingco-tab:hover { background: var(--slate-100); color: var(--text); }
.ingco-tab.active { background: var(--biz-color, var(--accent)); color: #fff; }
.ingco-tab .count-badge { margin-left: 0; }
.ingco-tab.active .count-badge { background: rgba(255,255,255,0.22); color: #fff; }
.ingco-search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  flex: 1 1 260px; max-width: 420px;
}
.ingco-search .form-input { flex: 1; }
.ingco-search-count { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.sheet-wrap { max-height: 72vh; overflow: auto; }
.sheet thead th { position: sticky; top: 0; z-index: 1; }
.sheet td { padding: 7px 12px; font-size: 12.5px; }
.sheet th { padding: 8px 12px; }
.sheet .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.sheet .num { text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sheet tr.ingco-lines td { background: var(--slate-50); padding: 0 12px 10px 40px; }
.sheet tr.ingco-lines table { font-size: 12px; width: auto; min-width: 60%; }
.sheet tr.ingco-lines td td { padding: 4px 10px; border-bottom: 1px solid var(--border); background: none; }
.sheet tr.inactive td { color: var(--text-3); }
@media (max-width: 768px) {
  .ingco-search { margin-left: 0; max-width: none; flex-basis: 100%; }
}
.status-picked_up, .status-in_transit { background: #dbeafe; color: #1e40af; }
.status-arrived_in_ghana { background: #cffafe; color: #155e75; }
.status-out_for_delivery { background: #ede9fe; color: #5b21b6; }
.status-delivered, .status-fulfilled { background: #d1fae5; color: #065f46; }

/* Live MT5 connection badge -- distinct from .status-pill(-select) above,
   which is a staff-set lifecycle field, not a live connectivity read */
.live-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.live-badge i { font-size: 7px; }
.live-badge-up { background: #d1fae5; color: #065f46; }
.live-badge-down { background: #fee2e2; color: #991b1b; }
.live-badge-unknown { background: var(--slate-100, #f1f5f9); color: var(--text-muted, #64748b); }

/* Status select inline */
.status-select {
  font-size: 11.5px; padding: 3px 6px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); cursor: pointer;
}

/* ── Invoice list ────────────────────────────────────────────── */
.invoice-list { display: flex; flex-direction: column; }
.invoice-row {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.invoice-row:hover { background: var(--slate-50); }
.invoice-row--overdue { border-left: 3px solid var(--red); }
.invoice-row-main {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.invoice-number {
  font-size: 13px; font-weight: 700; color: var(--indigo-500); min-width: 120px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.biz-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.biz-badge--none { background: var(--slate-100); color: var(--text-3); }
.biz-select {
  border: none; font-size: 10.5px; font-weight: 700; padding: 3px 22px 3px 8px;
  border-radius: 20px; cursor: pointer; font-family: inherit; appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 6px center;
}
.biz-select:hover { filter: brightness(0.97); }
.biz-select:focus { outline: 2px solid var(--indigo-300); outline-offset: 1px; }
.invoice-client { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 5px; flex: 1; }
.invoice-meta   { display: flex; gap: 12px; flex-wrap: wrap; }
.inv-meta-item  { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.invoice-row-right {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.invoice-amount { font-size: 16px; font-weight: 700; color: var(--text); }
.invoice-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px;
}
.invoice-status--draft { background: var(--slate-100); color: var(--slate-600); }
.invoice-status--sent  { background: #dbeafe; color: #1e40af; }
.invoice-status--paid  { background: #d1fae5; color: #065f46; }
.invoice-actions { display: flex; gap: 6px; }
.btn-inv-action {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: var(--radius-xs); border: none;
  font-size: 11.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background var(--transition);
}
.btn-inv-sent   { background: #dbeafe; color: #1e40af; }
.btn-inv-sent:hover { background: #bfdbfe; }
.btn-inv-paid   { background: #d1fae5; color: #065f46; }
.btn-inv-paid:hover { background: #a7f3d0; }
.btn-inv-delete { background: #fee2e2; color: #991b1b; }
.btn-inv-delete:hover { background: #fecaca; }
.btn-inv-print  { background: #f1f5f9; color: #475569; }
.btn-inv-print:hover  { background: #e2e8f0; }

.invoice-items { padding: 0 20px 14px; }
.invoice-items-table {
  width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 6px;
}
.invoice-items-table th {
  background: var(--slate-50); padding: 5px 10px; text-align: left;
  font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border);
}
.invoice-items-table td { padding: 5px 10px; border-bottom: 1px solid var(--slate-100); }
.invoice-items-table tfoot td { padding: 4px 10px; border: none; }
.inv-total-row td { font-weight: 700; font-size: 13px; border-top: 1px solid var(--border); }
.text-right { text-align: right; }
.inv-notes {
  font-size: 12px; color: var(--text-3); padding: 6px 10px;
  background: var(--slate-50); border-radius: var(--radius-sm);
  display: flex; gap: 6px; align-items: flex-start;
}

/* Line item builder */
.line-item-row {
  display: grid; grid-template-columns: 1fr 80px 100px 80px 32px;
  gap: 6px; margin-bottom: 6px; align-items: center;
}
.li-desc  { }
.li-qty   { text-align: right; }
.li-price { text-align: right; }
.li-amount { font-size: 13px; font-weight: 600; text-align: right; color: var(--text); }
.li-remove {
  background: #fee2e2; color: #991b1b; border: none; border-radius: 6px;
  width: 28px; height: 28px; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.btn-add-item {
  background: none; border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 12px; font-weight: 600; padding: 6px 14px;
  cursor: pointer; width: 100%; margin-top: 4px; font-family: inherit;
  transition: all var(--transition);
}
.btn-add-item:hover { border-color: var(--indigo-400); color: var(--indigo-500); }
.inv-totals-preview { margin: 12px 0; }
.inv-total-display {
  background: var(--slate-50); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
}
.inv-total-line {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-2); padding: 2px 0;
}
.inv-total-bold { font-size: 14px; font-weight: 700; color: var(--text); border-top: 1px solid var(--border); margin-top: 4px; padding-top: 6px; }

/* ── Agency horizontal stats row ────────────────────────────── */
.agency-stats-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0 8px;
  display: flex; align-items: center;
  margin-bottom: 0;
}
.agency-stat {
  flex: 1; padding: 16px 20px; text-align: center;
}
.agency-stat-value {
  font-size: 22px; font-weight: 800; color: var(--text);
  letter-spacing: -0.5px; line-height: 1.2;
}
.agency-stat-label {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.4px; margin-top: 3px;
}
.agency-stat-divider {
  width: 1px; height: 40px; background: var(--border); flex-shrink: 0;
}
@media (max-width: 640px) {
  .agency-stats-row { flex-wrap: wrap; padding: 0; }
  .agency-stat { flex: 1 1 45%; padding: 14px; border-bottom: 1px solid var(--border); }
  .agency-stat-divider { display: none; }
}

/* ── Agency section switcher ─────────────────────────────────── */
.agency-section-switcher {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.agency-section-btn {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px;
  cursor: pointer; font-family: inherit; text-align: left;
  transition: all var(--transition);
}
.agency-section-btn i {
  font-size: 22px; color: var(--text-3); flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--slate-100);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.agency-section-btn:hover { border-color: var(--indigo-400); }
.agency-section-btn.active {
  border-color: var(--indigo-500);
  background: linear-gradient(135deg, #eef2ff, #fff);
  box-shadow: 0 4px 16px rgba(99,102,241,0.12);
}
.agency-section-btn.active i {
  background: var(--indigo-500); color: #fff;
}
.asb-title { font-size: 15px; font-weight: 700; color: var(--text); }
.asb-sub   { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ── Marketing content grid ──────────────────────────────────── */
.mkt-content-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr));
  gap: 10px;
}
.mkt-content-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--slate-50);
}
.mkt-thumb {
  width: 100%; height: 100px; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  background: var(--slate-100); color: var(--text-3); font-size: 24px;
}
.mkt-thumb--video { background: #1e293b; color: #fff; }
.mkt-thumb--empty { flex-direction: column; gap: 4px; font-size: 20px; }
.mkt-content-info { padding: 8px; }
.mkt-content-type {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 3px;
}
.mkt-content-caption {
  font-size: 11px; color: var(--text); line-height: 1.4; margin-bottom: 4px;
}
.mkt-content-platforms { display: flex; gap: 4px; margin-bottom: 4px; color: var(--text-3); }
.mkt-content-item--more {
  display: flex; align-items: center; justify-content: center;
  min-height: 160px; border: 2px dashed var(--border);
  background: none; cursor: pointer;
}
.mkt-view-all {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-3); font-size: 12px; font-weight: 600;
  text-decoration: none; transition: color var(--transition);
}
.mkt-view-all:hover { color: var(--accent); }
.mkt-view-all i { font-size: 20px; }

/* Media library */
.mkt-media-item { position: relative; }
.mkt-media-delete-form { position: absolute; top: 6px; right: 6px; margin: 0; }
.mkt-media-delete-btn {
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: rgba(15,23,42,0.65); color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background var(--transition);
}
.mkt-media-delete-btn:hover { background: #ef4444; }

/* Per-item folders within one client's Media Library (e.g. Gadgets4All's
   product folders: timelapse + real photos grouped under the item name) */
.mkt-media-folder-section { margin-bottom: 18px; }
.mkt-media-folder-section:last-of-type { margin-bottom: 0; }
.mkt-media-folder-label {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.4px;
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}

/* ── Project cards ───────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; padding: 4px 0;
}
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow var(--transition), transform var(--transition);
  border-top: 3px solid var(--slate-200);
}
.project-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); transform: translateY(-1px); }
.project-card--active    { border-top-color: #f59e0b; }
.project-card--completed { border-top-color: #10b981; }
.project-card--on_hold   { border-top-color: #94a3b8; }
.project-card--cancelled { border-top-color: #ef4444; opacity: 0.7; }

.project-card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.project-edit-btn {
  background: none; border: none; cursor: pointer; padding: 4px 6px;
  color: var(--text-3); font-size: 12px; border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.project-edit-btn:hover { background: var(--slate-100); color: var(--text-2); }
.project-header-actions { display: flex; align-items: center; gap: 2px; }
.project-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--indigo-50); color: var(--indigo-500);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.project-status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
}
.project-status--active    { background: #fef3c7; color: #b45309; }
.project-status--completed { background: #d1fae5; color: #065f46; }
.project-status--on_hold   { background: #f1f5f9; color: #64748b; }
.project-status--cancelled { background: #fee2e2; color: #991b1b; }

.project-title {
  font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3;
}
.project-client {
  font-size: 12px; color: var(--text-2);
  display: flex; align-items: center; gap: 5px;
}
.project-service-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  background: var(--indigo-50); color: var(--indigo-600);
  padding: 2px 10px; border-radius: 20px;
}
.project-links {
  display: flex; flex-direction: column; gap: 5px; margin-top: 2px;
}
.project-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 500; padding: 5px 10px;
  border-radius: var(--radius-sm); text-decoration: none;
  transition: background var(--transition);
}
.project-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-link--github {
  background: #f6f8fa; color: #24292f; border: 1px solid #d0d7de;
}
.project-link--github:hover { background: #eaeef2; }
.project-link--vercel {
  background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0;
}
.project-link--vercel:hover { background: #dcfce7; }
.project-link--facebook {
  background: #eff6ff; color: #1877f2; border: 1px solid #bfdbfe;
}
.project-link--facebook:hover { background: #dbeafe; }
.project-link--instagram {
  background: #fdf2f8; color: #c2185b; border: 1px solid #fbcfe8;
}
.project-link--instagram:hover { background: #fce7f3; }
.project-link--no-url {
  background: var(--slate-50); color: var(--text-3);
  border: 1px dashed var(--border); cursor: default;
}
.project-commit {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-3); padding: 0 2px;
}
.project-commit i { color: var(--slate-300); flex-shrink: 0; }
.project-commit span:first-of-type {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.project-commit-time { flex-shrink: 0; white-space: nowrap; }
.project-commit--fresh i  { color: #10b981; }
.project-commit--aging i { color: #f59e0b; }
.project-commit--stale i { color: var(--slate-300); }
.project-commit--error   { color: #ef4444; }
.project-commit--error i { color: #ef4444; }
.project-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border);
}
.project-budget {
  font-size: 13px; font-weight: 700; color: var(--text);
}
.project-monthly-rate {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: #166534;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  padding: 3px 10px; border-radius: 20px; width: fit-content;
}
.project-monthly-rate i { font-size: 10px; }

/* Recurring expense templates list (recurring_expense_modal.html) */
.recurring-list-wrap { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.recurring-list-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-3); margin-bottom: 10px;
}
.recurring-list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-xs);
  margin-bottom: 8px;
}
.recurring-list-item.is-paused { opacity: 0.55; }
.recurring-list-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.recurring-list-desc { font-size: 13px; font-weight: 600; color: var(--text); }
.recurring-list-amount { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.recurring-list-paused-tag {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  background: var(--slate-100); padding: 2px 7px; border-radius: 20px;
}
.recurring-list-actions { display: flex; gap: 6px; flex-shrink: 0; }
.recurring-list-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 16px 0 4px; }

/* Filament batches (business_expenses.html's Filament Expenses tab) */
.filament-batch-list { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.filament-batch-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.filament-batch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.filament-batch-label { font-size: 14px; font-weight: 700; color: var(--text); }
.filament-batch-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.filament-batch-notes { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.filament-batch-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.filament-cost-list { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.filament-cost-row {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0; font-size: 13px;
}
.filament-cost-label { flex: 1; color: var(--text-2); }
.filament-cost-amount { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.filament-batch-total {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text);
}
.filament-cost-per-gram { color: var(--accent); font-variant-numeric: tabular-nums; }

/* Live cost/gram preview in the New Filament Batch modal */
.filament-preview-banner {
  background: #ecfdf5; border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 13px; font-weight: 700; color: #047857;
  display: flex; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums;
}
.project-status-select {
  font-size: 11px; padding: 4px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); cursor: pointer;
}

/* Project filter tabs */
.proj-filter-tabs {
  display: flex; gap: 2px; background: var(--slate-100);
  border-radius: 8px; padding: 3px;
}
.proj-tab {
  padding: 4px 10px; border-radius: 6px; border: none;
  font-size: 11.5px; font-weight: 600; cursor: pointer;
  background: none; color: var(--text-2); font-family: inherit;
  transition: all var(--transition);
}
.proj-tab:hover { color: var(--text); }
.proj-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Count badge in section title */
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--indigo-50); color: var(--indigo-600);
  font-size: 11px; font-weight: 700; min-width: 20px; height: 20px;
  border-radius: 10px; padding: 0 6px; margin-left: 6px;
}

/* Icon buttons */
.btn-icon {
  background: none; border: 1px solid var(--border);
  color: var(--text-2); width: 28px; height: 28px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; cursor: pointer; transition: all var(--transition);
}
.btn-icon:hover { background: var(--slate-100); color: var(--text); }
.btn-icon-danger:hover { background: #fee2e2; color: var(--red); border-color: #fecaca; }

/* ── Trading platform cards ───────────────────────────────────── */
.platform-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; padding: 16px;
}
.platform-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  border-top: 3px solid var(--slate-200);
  transition: box-shadow var(--transition), transform var(--transition);
}
.platform-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); transform: translateY(-1px); }
.platform-card--forex  { border-top-color: #3b82f6; }
.platform-card--crypto { border-top-color: #f59e0b; }

.platform-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.platform-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
}
.platform-icon--forex  { background: #3b82f6; }
.platform-icon--crypto { background: #f59e0b; }
.platform-icon--other  { background: var(--slate-400); }

.platform-name { font-size: 14px; font-weight: 700; color: var(--text); }

.platform-badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px; text-transform: capitalize;
}
.platform-badge--forex  { background: #dbeafe; color: #1e40af; }
.platform-badge--crypto { background: #fef3c7; color: #92400e; }
.platform-badge--other  { background: var(--slate-100); color: var(--text-2); }

.platform-commission { font-size: 13px; font-weight: 600; color: var(--text-2); margin-top: 4px; }
.platform-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.platform-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 20px; color: var(--text-3);
  gap: 10px;
}
.empty-state i { font-size: 28px; }
.empty-state p { margin: 0; font-size: 13px; }

/* Misc */
.fw-600 { font-weight: 600; }
.mono { font-family: ui-monospace, monospace; font-size: 12px; }
.text-warning { color: var(--yellow) !important; }
.text-danger  { color: var(--red) !important; }

/* Alert flash */
.alert-flash {
  padding: 12px 18px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: 13px; font-weight: 500;
}
.alert-flash--success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-flash--error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* 2-col form row */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ══════════════════════════════════════════════════════════════
   AI AGENTS — n8n-style hub + vertical flow
   ══════════════════════════════════════════════════════════════ */

/* ── Hub wrapper (centers the hub card) ─────────────────────── */
.agents-hub-wrap {
  display: flex; justify-content: center;
  margin-bottom: 20px;
}

.agents-hub {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 16px 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  width: 100%; max-width: 720px;
}

/* ── Stats row inside hub ───────────────────────────────────── */
.hub-stats-row {
  display: flex; align-items: center; gap: 0;
}
.hub-stat-item {
  display: flex; align-items: center; gap: 8px;
  padding: 0 18px;
}
.hub-stat-item:first-child { padding-left: 0; }
.hub-stat-item:last-child  { padding-right: 0; }
.hub-sv {
  font-size: 20px; font-weight: 800; color: var(--text); line-height: 1;
}
.hub-sv--dim { color: var(--text-3); }
.hub-sl {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.hub-stat--pending  .hub-sv { color: #f59e0b; }
.hub-stat--approved .hub-sv { color: #10b981; }
.hub-stat-sep {
  width: 1px; height: 32px; background: var(--border); flex-shrink: 0;
}

/* ── Business pill bar ──────────────────────────────────────── */
.hub-pills {
  display: flex; gap: 4px; align-items: center;
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: 40px; padding: 5px;
}
.hub-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px; border-radius: 30px; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--text-2);
  transition: all var(--transition); font-family: inherit;
}
.hub-pill i { font-size: 12px; }
.hub-pill:hover { background: var(--slate-200); color: var(--text); }
.hub-pill--all.active     { background: linear-gradient(135deg, var(--indigo-500), var(--indigo-700)); color: #fff; box-shadow: 0 2px 12px rgba(99,102,241,0.4); }
.hub-pill--agency.active   { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; box-shadow: 0 2px 12px rgba(59,130,246,0.4); }
.hub-pill--gadgets.active  { background: linear-gradient(135deg, #a855f7, #7e22ce); color: #fff; box-shadow: 0 2px 12px rgba(168,85,247,0.4); }
.hub-pill--trading.active  { background: linear-gradient(135deg, #10b981, #059669); color: #fff; box-shadow: 0 2px 12px rgba(16,185,129,0.4); }
.hub-pill--shipping.active { background: linear-gradient(135deg, #0ea5e9, #0369a1); color: #fff; box-shadow: 0 2px 12px rgba(14,165,233,0.4); }
.hub-pill--luvre.active    { background: linear-gradient(135deg, #ec4899, #be185d); color: #fff; box-shadow: 0 2px 12px rgba(236,72,153,0.4); }

/* ── Live status indicator ──────────────────────────────────── */
.hub-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: #059669;
}
.hub-live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,0.6);
  animation: hub-live-pulse 2s infinite;
}
.hub-live-dot.hub-live-dot--stale { background: #cbd5e1; animation: none; box-shadow: none; }
@keyframes hub-live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* ── Hub caption ────────────────────────────────────────────── */
.hub-label {
  font-size: 11.5px; color: var(--text-3);
  display: flex; align-items: center; gap: 6px;
}

/* ── Flow filter bar (status tabs + global action) ──────────── */
.flow-filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 16px;
}

/* ── n8n Canvas ─────────────────────────────────────────────── */
.n8n-canvas {
  background-color: #f8fafc;
  background-image: radial-gradient(circle, #cbd5e1 1px, transparent 1px);
  background-size: 22px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px 40px;
  position: relative;
}

/* ── Shared connector dot ───────────────────────────────────── */
.n8n-conn {
  width: 13px; height: 13px; border-radius: 50%;
  background: #94a3b8;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 1.5px #cbd5e1;
  position: absolute;
  z-index: 2;
  pointer-events: none;
}
/* Left/right connectors (horizontal flow) -- .n8n-conn--in/--out only ever
   appear alongside .pipe-conn-top/-bottom in this file, so those own the
   actual position; these two are semantic tags only (no position of their
   own, to avoid a confusing two-rule override chain doing the real work). */
.n8n-conn--in, .n8n-conn--out {}
/* Top/bottom connectors (vertical flow). Centering on the node's full width
   lands the top dot right over the subtitle text (the widest line in the
   card) -- pulling it up well clear of the card, into the gap the fork legs
   already extend through below, keeps a real gap regardless of how long
   that subtitle line runs. */
.pipe-conn-top    { top: -18px;   left: 50%; transform: translateX(-50%); }
.pipe-conn-bottom { bottom: -8px; left: 50%; transform: translateX(-50%); }

/* ── Agent icon box ─────────────────────────────────────────── */
.n8n-icon {
  width: 42px; height: 42px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.n8n-icon--manager           { background: #ede9fe; color: #5b21b6; }
.n8n-icon--software_engineer { background: #dbeafe; color: #1e40af; }
.n8n-icon--marketing         { background: #fff7ed; color: #c2410c; }

/* ── Task detail modal sections ─────────────────────────────── */
.td-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; margin-bottom: 4px;
}
.td-actions {
  display: flex; gap: 8px; margin-top: 16px;
  padding-top: 14px; border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════════
   PIPELINE LAYOUT
   ══════════════════════════════════════════════════════════════ */

/* ── Manager (trigger) node ─────────────────────────────────── */
.pipe-manager-wrap {
  display: flex; justify-content: center;
  position: relative; margin-bottom: 0;
}
.pipe-manager-node {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border: 1.5px solid #e2e8f0;
  border-top: 3px solid var(--indigo-500);
  border-radius: 10px; padding: 16px 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  width: 100%; max-width: 640px; position: relative;
}
.pipe-node-body { flex: 1; min-width: 0; }
.pipe-node-name { font-size: 14px; font-weight: 700; color: #0f172a; }
.pipe-node-sub  { font-size: 12px; color: #94a3b8; margin-top: 2px; line-height: 1.4; }
.pipe-manager-actions { flex-shrink: 0; }
.pipe-run-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 8px; border: none;
  background: var(--indigo-500); color: #fff;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background var(--transition);
}
.pipe-run-btn:hover { background: var(--indigo-600); }

/* ── Fork connector (manager → agents) ──────────────────────── */
.pipe-fork-stem {
  width: 2px; height: 24px; background: #cbd5e1;
  margin: 0 auto;
}
.pipe-fork {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  height: 44px; position: relative;
}
/* Crossbar across the top of the fork */
.pipe-fork::before {
  content: ''; position: absolute;
  top: 0;
  left: calc(100%/6 - 1px); right: calc(100%/6 - 1px);
  height: 2px; background: #cbd5e1;
}
/* Each leg centers within its own 1/3-width grid column */
.pipe-fork-left, .pipe-fork-mid, .pipe-fork-right { border-left: 2px solid #cbd5e1; margin-left: calc(50% - 1px); }

/* ── Three-column agent grid ─────────────────────────────────── */
.pipe-agents-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 24px; align-items: start;
}

/* ── Agent column ───────────────────────────────────────────── */
.pipe-agent-col {
  display: flex; flex-direction: column; align-items: stretch;
}

/* ── Agent node ─────────────────────────────────────────────── */
.pipe-agent-node {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1.5px solid #e2e8f0;
  border-radius: 10px; padding: 13px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  position: relative; cursor: default;
}
.pipe-agent-node--se  { border-top: 3px solid #3b82f6; }
.pipe-agent-node--mkt { border-top: 3px solid #f97316; }
.pipe-agent-node--mgr { border-top: 3px solid #a855f7; }

.pipe-count-badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 10px; background: #dbeafe; color: #1e40af;
  flex-shrink: 0;
}
.pipe-count-badge--orange { background: #fff7ed; color: #c2410c; }
.pipe-count-badge--purple { background: #ede9fe; color: #5b21b6; }

/* Real business activity -- second stacked badge line under .pipe-count-badge */
.pipe-headline-badge {
  display: block; margin-top: 6px; font-size: 11px; font-weight: 600;
  color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pipe-headline-badge:empty { display: none; }

.pipe-add-icon-btn {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  border: 1.5px solid #e2e8f0; background: #f8fafc; color: #94a3b8;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; transition: all var(--transition);
}
.pipe-add-icon-btn:hover      { border-color: var(--indigo-400); color: var(--indigo-500); background: var(--indigo-50); }
.pipe-add-icon-btn--mkt:hover { border-color: #f97316; color: #f97316; background: #fff7ed; }

/* ── Vertical line from agent to tasks ──────────────────────── */
.pipe-col-line {
  width: 2px; height: 20px; background: #cbd5e1; margin: 0 auto;
}

/* ── Task nodes column ──────────────────────────────────────── */
.pipe-col-tasks {
  display: flex; flex-direction: column; gap: 8px;
}

/* ── Individual task node ───────────────────────────────────── */
.pipe-task-node {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #e2e8f0;
  border-left: 3px solid #cbd5e1;
  border-radius: 8px; padding: 10px 12px;
  cursor: pointer; position: relative;
  transition: box-shadow 0.15s, transform 0.15s;
  user-select: none;
}
.pipe-task-node:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateX(3px);
}
.pipe-task-node--pending   { border-left-color: #f59e0b; }
.pipe-task-node--approved  { border-left-color: #10b981; }
.pipe-task-node--done      { border-left-color: #94a3b8; }
.pipe-task-node--rejected  { border-left-color: #ef4444; opacity: 0.65; }
.pipe-task-node--executing { border-left-color: #06b6d4; }
.pipe-task-node--failed    { border-left-color: #ef4444; }
.pipe-task-node--resolved  { border-left-color: #cbd5e1; opacity: 0.65; }

.pipe-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.pipe-status--pending   { background: #f59e0b; }
.pipe-status--approved  { background: #10b981; }
.pipe-status--done      { background: #94a3b8; }
.pipe-status--rejected  { background: #ef4444; }
.pipe-status--executing { background: #06b6d4; }
.pipe-status--failed    { background: #ef4444; }
.pipe-status--resolved  { background: #cbd5e1; }

.pipe-task-title {
  flex: 1; font-size: 12.5px; font-weight: 600; color: #0f172a;
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.pipe-task-date { font-size: 10.5px; color: #94a3b8; flex-shrink: 0; }

/* ── Empty state inside column ──────────────────────────────── */
.pipe-col-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px;
  padding: 20px 10px; border-radius: 8px;
  border: 1.5px dashed #e2e8f0;
  background: #f8fafc; color: #94a3b8; font-size: 12px;
  text-align: center;
}

/* ── "Add task" dashed button at column bottom ──────────────── */
.pipe-new-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px; border: 1.5px dashed #cbd5e1; border-radius: 8px;
  background: transparent; color: #94a3b8;
  font-size: 12px; font-weight: 600; cursor: pointer; width: 100%;
  font-family: inherit; transition: all var(--transition);
}
.pipe-new-btn:hover          { border-color: var(--indigo-400); color: var(--indigo-500); background: var(--indigo-50); }
.pipe-new-btn--mkt:hover     { border-color: #f97316; color: #f97316; background: #fff7ed; }

/* ══════════════════════════════════════════════════════════════
   AUTOMATIONS SECTION (WhatsApp / Email -- status, not review)
   ══════════════════════════════════════════════════════════════ */
.automations-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin-top: 20px;
}
.automations-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.automations-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.automations-title i { color: var(--indigo-500); }
.automations-group { margin-bottom: 18px; }
.automations-group:last-child { margin-bottom: 0; }
.automations-group-label {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.4px;
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.automation-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.automation-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; background: var(--slate-50);
}
.automation-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.automation-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.automation-dot--ok  { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.15); }
.automation-dot--off { background: #cbd5e1; }
.automation-name { font-size: 13px; font-weight: 700; color: var(--text); }
.automation-trigger { font-size: 11.5px; color: var(--text-3); margin-bottom: 8px; line-height: 1.4; }
.automation-biz-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.automation-biz-tag {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 8px;
  background: var(--slate-100); color: var(--text-2);
}
.automation-config-label { font-size: 10.5px; font-weight: 600; }
.automation-config-label--ok  { color: #059669; }
.automation-config-label--off { color: var(--text-3); }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .agents-hub       { padding: 14px 16px; }
  .hub-stats-row    { flex-wrap: wrap; justify-content: center; }
  .hub-stat-item    { padding: 4px 10px; }
  .hub-pills        { flex-wrap: wrap; justify-content: center; }
  .hub-pill span    { display: none; }
  .hub-pill i       { font-size: 15px; }
  .hub-pill.active span { display: inline; }
  .flow-filter-bar  { flex-direction: column; align-items: flex-start; gap: 8px; }
  .n8n-canvas       { padding: 20px 14px 28px; }
  .pipe-manager-node { flex-wrap: wrap; }
  .pipe-agents-grid { grid-template-columns: 1fr; gap: 32px; }
  .pipe-fork        { display: none; }
  .pipe-fork-stem   { display: none; }
  .automations-wrap { padding: 16px 14px; }
  .automation-cards { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   Reused by the side panel (AI Agents page) -- sub-lane grouping
   ══════════════════════════════════════════════════════════════ */
.biz-sublane { margin-bottom: 16px; }
.biz-sublane:last-child { margin-bottom: 0; }
.biz-sublane-label {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.4px;
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}

/* Recent Activity sublane -- plain read-only rows (not clickable task nodes) */
.pipe-activity-list { display: flex; flex-direction: column; gap: 6px; }
.pipe-activity-row {
  font-size: 12.5px; color: var(--text-2); padding: 7px 10px;
  background: var(--slate-50); border-radius: 8px; line-height: 1.4;
}
.pipe-activity-empty { font-size: 12px; color: var(--text-3); padding: 4px 0; }

/* Agent side panel: what the agent does, live numbers, task meta line */
.agent-about {
  background: var(--slate-50); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
}
.agent-about-what { font-size: 13px; color: var(--text); line-height: 1.5; }
.agent-about details { margin-top: 8px; }
.agent-about summary {
  font-size: 11.5px; font-weight: 600; color: var(--indigo-500);
  cursor: pointer; list-style: none;
}
.agent-about summary::-webkit-details-marker { display: none; }
.agent-about ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--text-2); line-height: 1.55; }
.agent-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.agent-stat {
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; text-align: center;
}
.agent-stat-num { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.2; }
.agent-stat-num--attn { color: #b45309; }
.agent-stat-label { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.3px; }
.agent-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pipe-task-main { flex: 1; min-width: 0; }
#bizPanelBody .pipe-conn-top { display: none; } /* canvas wiring dot -- meaningless in a list */
.pipe-task-meta {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-top: 3px; font-size: 10.5px; color: #94a3b8;
}
.pipe-task-biz { font-weight: 600; color: var(--text-2); }
.pipe-task-high { color: #dc2626; font-weight: 700; }
.agent-history summary {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.4px; cursor: pointer; margin-bottom: 8px;
}
.td-approve-note {
  font-size: 12px; color: var(--text-2); background: var(--slate-50);
  border-radius: 8px; padding: 8px 12px; margin: 12px 0 0;
}
.status-pill.status-approved, .status-pill.status-executing { background: #d1fae5; color: #065f46; }
.status-pill.status-done { background: #dbeafe; color: #1e40af; }
.status-pill.status-rejected, .status-pill.status-resolved { background: var(--slate-100); color: var(--text-2); }

/* Section dividers inside the Add/Edit Project modals */
.form-section-label {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.4px;
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.form-section-label--spaced { margin-top: 18px; }

/* Utility row (Reset canvas view) */
.hub-actions { display: flex; gap: 8px; align-items: center; }
.hub-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 30px;
  border: 1px solid var(--border); background: var(--slate-50);
  color: var(--text-2); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all var(--transition);
}
.hub-action-btn:hover { background: var(--slate-200); color: var(--text); }

/* ══════════════════════════════════════════════════════════════
   n8n-STYLE INTERACTIVE CANVAS (AI Agents page)
   ══════════════════════════════════════════════════════════════ */
.n8n-canvas {
  overflow: hidden; position: relative; flex: 1; min-height: 0;
  padding: 0; cursor: grab; user-select: none; background-color: #f8fafc;
  visibility: hidden;
}
.page-content--full { padding: 0; gap: 0; }
.n8n-canvas.n8n-panning { cursor: grabbing; }
.n8n-reset-btn {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 13px; box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.n8n-reset-btn:hover { background: var(--slate-50); color: var(--text); }
.n8n-world {
  position: absolute; top: 0; left: 0; width: 3000px; height: 1400px;
  transform-origin: 0 0;
  background-image: radial-gradient(circle, #cbd5e1 1px, transparent 1px);
  background-size: 22px 22px; will-change: transform;
}
.n8n-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
/* --conn-color is set per-path in JS (createConnectorPaths) -- each wire
   takes its destination business's own brand color. The dash+animation
   pair is the standard SVG "flow" technique: a repeating dash pattern
   whose offset animates continuously, read as motion travelling along the
   path from source to target (matches the fan-out from Manager outward). */
.n8n-conn-path {
  fill: none; stroke: var(--conn-color, #cbd5e1); stroke-width: 2.5px;
  stroke-linecap: round; stroke-dasharray: 5 7; stroke-dashoffset: 0;
  animation: n8n-flow 1s linear infinite;
  transition: stroke 0.15s, opacity 0.15s;
}
/* Manager -> business/company-wide/etc lines are the primary hierarchy and
   stay fully visible. Business -> WhatsApp/Email lines are real (WhatsApp
   and Email are genuinely one shared integration each, used by several
   businesses for different triggers) but drawing a dozen of them at full
   weight reads as visual clutter -- fade + slow them by default instead. */
.n8n-conn-path--assets { opacity: 0.6; stroke-width: 2px; animation-duration: 2.4s; }
@keyframes n8n-flow {
  to { stroke-dashoffset: -24; }
}

.n8n-node {
  position: absolute; z-index: 1; background: #fff; border: 1.5px solid #e2e8f0;
  border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.n8n-node--trigger {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  border-top: 3px solid var(--accent); width: 520px; cursor: grab;
}
.n8n-node--biz { width: 220px; padding: 14px 16px; cursor: grab; }
.n8n-node--side { width: 200px; padding: 12px 14px; cursor: grab; border-top: 3px solid #f97316; }
.n8n-node--dragging { cursor: grabbing; box-shadow: 0 8px 28px rgba(0,0,0,0.18); z-index: 5; }
.n8n-node-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.n8n-node-header .biz-origin-badge {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.n8n-node-btn { flex-shrink: 0; }

/* ── Assets rectangle: a business's own agents/website/messages grouped
   into one box wired once to the business, instead of a separate floating
   node (and wire) per asset. ── */
.n8n-node--assets { width: 220px; padding: 10px 0; cursor: grab; }
.assets-head {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-3); padding: 0 14px 8px;
}
.asset-row {
  display: flex; align-items: center; gap: 9px; padding: 7px 14px; border: none;
  background: none; width: 100%; text-align: left; text-decoration: none; color: inherit;
  font-family: inherit; font-size: inherit;
}
.asset-row.is-link:hover, .asset-row[onclick]:hover { background: var(--slate-50); }
.asset-icon {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.asset-body { min-width: 0; flex: 1; }
.asset-name { font-size: 11px; font-weight: 700; color: #0f172a; }
.asset-sub {
  font-size: 9.5px; color: #94a3b8; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 700px) {
  .hub-actions { flex-wrap: wrap; justify-content: center; }
}

/* ── Ledger filters fold away on phones (expenses.html) ────────── */
.filter-toggle-mobile { display: none; }
@media (max-width: 768px) {
  .filter-toggle-mobile {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; height: 46px; padding: 0 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 12px;
  }
  .filter-toggle-chevron { transition: transform var(--transition); color: var(--text-3); }
  .filter-toggle-mobile.is-open .filter-toggle-chevron { transform: rotate(180deg); }
  .filter-toggle-dot {
    display: inline-block; width: 7px; height: 7px; margin-left: 4px; vertical-align: middle;
    border-radius: 50%; background: var(--accent);
  }
  .filter-bar-collapsible { display: none; }
  .filter-bar-collapsible.is-open { display: flex; }
}

/* ── Gadgets4All page (compact layout) ───────────────────────── */
.g4-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.g4-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.g4-mark {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: color-mix(in srgb, var(--biz-color) 12%, transparent); color: var(--biz-color); font-size: 17px;
}
.g4-mark img { width: 100%; height: 100%; object-fit: contain; }
.g4-title h1 { font-size: 18px; font-weight: 800; margin: 0; color: var(--text); letter-spacing: -.3px; }
.g4-title p { font-size: 12px; margin: 0; color: var(--text-3); }
.g4-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.g4-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 12.5px; font-weight: 600; text-decoration: none; cursor: pointer;
  white-space: nowrap; transition: border-color var(--transition), color var(--transition);
}
.g4-btn:hover { border-color: var(--slate-300); color: var(--text); }
.g4-btn--primary { background: var(--biz-color, var(--indigo-500)); border-color: transparent; color: #fff; }
.g4-btn--primary:hover { color: #fff; opacity: .9; }
.g4-btn--sm { height: 30px; padding: 0 10px; font-size: 12px; }
.g4-btn--ok { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.g4-caret { font-size: 9px; opacity: .8; }
.g4-menu { font-size: 13px; border-radius: var(--radius-sm); border-color: var(--border); box-shadow: 0 10px 30px -10px rgba(15,23,42,.25); }
.g4-menu .dropdown-item { display: flex; align-items: center; gap: 9px; padding: 7px 14px; }
.g4-menu .dropdown-item i { width: 14px; color: var(--text-3); }

.g4-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 12px; overflow: hidden;
}
.g4-stat {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 16px;
  border: 0; border-right: 1px solid var(--border); background: none; text-align: left; font: inherit;
}
.g4-stat:last-child { border-right: 0; }
button.g4-stat { cursor: pointer; }
button.g4-stat:hover { background: var(--slate-50); }
.g4-stat-label { font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; }
.g4-stat-value { font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: -.4px; }
.g4-stat-value.is-alert { color: #d97706; }
.g4-stat-value.is-money { color: var(--green); }

.g4-tabs {
  display: flex; gap: 2px; margin-bottom: 12px; border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.g4-tabs::-webkit-scrollbar { display: none; }
.g4-tabs button {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 9px 12px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--text-3); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.g4-tabs button:hover { color: var(--text); }
.g4-tabs button.is-active { color: var(--text); border-bottom-color: var(--biz-color); }
.g4-tabs button i { font-size: 12px; }
.g4-count {
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 20px;
  background: var(--slate-100); color: var(--text-2);
}
.g4-count.is-alert { background: #fef3c7; color: #b45309; }

.g4-panel { padding: 0; overflow: hidden; }
.g4-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.g4-toolbar-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.g4-toolbar-end { margin-left: auto; display: flex; gap: 6px; }
.g4-alert-text { color: #b45309; font-weight: 700; }
.g4-search {
  position: relative; flex: 1 1 200px; max-width: 320px;
}
.g4-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-3); }
.g4-search input, .g4-select {
  height: 30px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px;
}
.g4-search input { width: 100%; padding: 0 10px 0 30px; }
.g4-select { padding: 0 8px; }
.g4-search input:focus, .g4-select:focus { outline: none; border-color: var(--biz-color, var(--indigo-500)); }
.g4-subhead {
  padding: 8px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-3); background: var(--slate-50); border-bottom: 1px solid var(--border);
}

.g4-table th { padding-top: 8px; padding-bottom: 8px; }
.g4-table td { padding-top: 8px; padding-bottom: 8px; vertical-align: middle; }
.g4-row-click { cursor: pointer; }
.g4-row-actions { white-space: nowrap; text-align: right; }
.g4-row-actions > * { display: inline-flex; vertical-align: middle; margin-left: 4px; }
.g4-nowrap { white-space: nowrap; }
.g4-muted { color: var(--text-3); font-size: 12px; }
.g4-product { display: flex; align-items: center; gap: 10px; min-width: 0; }
.g4-product-text { display: flex; flex-direction: column; min-width: 0; }
.g4-product-name { font-weight: 600; color: var(--text); }
.g4-thumb {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; overflow: hidden;
  background: var(--slate-50); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.g4-thumb img { width: 100%; height: 100%; object-fit: cover; }
.g4-flag {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; background: var(--slate-100); color: var(--text-3); vertical-align: 1px;
}
.g4-flag.is-hot { background: #fff1f2; color: #e11d48; }
.g4-flag.is-sale { background: #fef3c7; color: #b45309; }
.g4-card-img { height: 36px; border-radius: 6px; object-fit: cover; }
.g4-details { border-top: 1px solid var(--border); }
.g4-details summary { padding: 9px 14px; font-size: 12px; font-weight: 600; color: var(--text-3); cursor: pointer; }
.g4-panel-plain > .section-card { margin-bottom: 0; }

@media (max-width: 768px) {
  .g4-stats { grid-template-columns: repeat(2, 1fr); }
  .g4-stat:nth-child(2) { border-right: 0; }
  .g4-stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .g4-stat-value { font-size: 17px; }
  .g4-actions .g4-btn:not(.g4-btn--primary) span { display: none; }
  .g4-search { max-width: none; }
  .g4-toolbar-end .g4-btn span { display: none; }
  .g4-hide-sm { display: none; }
}

/* ── Shipments ───────────────────────────────────────────────── */
.shp-stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.shp-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-right: 1px solid var(--border); }
.shp-stat:last-child { border-right: 0; }
.shp-stat-label { font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; }
.shp-stat-value { font-size: 19px; font-weight: 800; color: var(--text); letter-spacing: -.4px; }
.shp-stat-value i { font-size: 13px; color: var(--text-3); }
.shp-stat-value.is-alert { color: #d97706; }
.shp-stat-value.is-late { color: var(--red); }
.shp-sep { color: var(--text-3); font-weight: 400; }

.shp-filters { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.shp-filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shp-chips { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.shp-chip {
  --c: var(--slate-500);
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 12.5px; font-weight: 600;
}
.shp-chip:hover { border-color: var(--c); }
.shp-chip.is-on { background: var(--c); border-color: var(--c); color: #fff; }
.shp-chip.is-on .shp-dot { background: #fff; }
.shp-chip-n { font-size: 10.5px; opacity: .75; }
.shp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex-shrink: 0; display: inline-block; }

.shp-seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.shp-seg button, .shp-seg label span {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 0; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.shp-seg > * + * { border-left: 1px solid var(--border) !important; }
.shp-seg button.is-on, .shp-seg input:checked + span { background: var(--slate-800); color: #fff; }
.shp-seg label { margin: 0; flex: 1; }
.shp-seg label span { width: 100%; justify-content: center; height: 38px; }
.shp-seg input { position: absolute; opacity: 0; pointer-events: none; }
.shp-seg--form { display: flex; width: 100%; }

.shp-search { position: relative; flex: 1 1 220px; max-width: 360px; }
.shp-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-3); }
.shp-search input {
  width: 100%; height: 30px; padding: 0 10px 0 30px; font: inherit; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
.shp-search input:focus { outline: none; border-color: var(--indigo-500); }
.shp-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); margin: 0; cursor: pointer; }
.shp-add { margin-left: auto; }

.shp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.shp-card {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.shp-card[hidden] { display: none; }
.shp-card.status-collected { opacity: .65; }
.shp-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shp-biz {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
}
.shp-mode { font-size: 11.5px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.shp-status { margin-left: auto; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.shp-status--ordered    { background: var(--slate-100); color: var(--slate-600); }
.shp-status--in_transit { background: #e0f2fe; color: #0369a1; }
.shp-status--arrived    { background: #fef3c7; color: #b45309; }
.shp-status--collected  { background: #dcfce7; color: #166534; }
.shp-items { font-size: 14.5px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.35; white-space: pre-line; }
.shp-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.shp-meta i { color: var(--text-3); margin-right: 3px; }
.shp-track {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px;
  background: var(--slate-50); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.shp-track .btn-icon { width: 26px; height: 26px; font-size: 11px; }
.shp-track-code { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.shp-carrier { font-family: Inter, system-ui, sans-serif; font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; margin-right: 6px; }
.shp-track-none { flex: 1; font-size: 12px; color: var(--text-3); font-style: italic; }
.shp-link { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--indigo-500); cursor: pointer; }
.shp-dates { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.shp-dates strong { color: var(--text-2); font-weight: 600; }
.shp-dates .is-late, .shp-dates .is-late strong { color: var(--red); }
.shp-notes { margin: 0; font-size: 12px; color: var(--text-2); }
.shp-card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.shp-card-foot form { margin: 0; }
.shp-next {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border: 1px solid var(--c); border-radius: 20px; background: none; color: var(--c);
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.shp-next:hover { background: var(--c); color: #fff; }
.shp-done { font-size: 12px; font-weight: 600; color: #166534; }
.shp-foot-actions { margin-left: auto; display: flex; gap: 4px; }
.shp-empty { text-align: center; padding: 36px 20px; color: var(--text-3); }
.shp-empty i { font-size: 28px; margin-bottom: 8px; display: block; }

.shp-biz-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.shp-biz-pick label { margin: 0; cursor: pointer; }
.shp-biz-pick input { position: absolute; opacity: 0; pointer-events: none; }
.shp-biz-pick span {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 20px;
  border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.shp-biz-pick input:checked + span { background: var(--c); border-color: var(--c); color: #fff; }
.shp-biz-pick input:checked + span .shp-dot { background: #fff; }
.shp-biz-pick input:focus-visible + span, .shp-seg input:focus-visible + span { outline: 2px solid var(--indigo-500); outline-offset: 1px; }

@media (max-width: 768px) {
  .shp-stats { grid-template-columns: repeat(2, 1fr); }
  .shp-stat { border-bottom: 1px solid var(--border); }
  .shp-stat:nth-child(2n) { border-right: 0; }
  .shp-stat:last-child { grid-column: span 2; border-bottom: 0; }
  .shp-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .shp-chip { flex-shrink: 0; }
  .shp-search { max-width: none; order: -1; flex-basis: 100%; }
  .shp-grid { grid-template-columns: 1fr; }
}
