/* ===== CSS Variables — Stripe/Cash App inspired ===== */
:root {
  --sidebar-bg: #0A0A0A;
  --sidebar-width: 232px;
  --sidebar-hover: #171717;
  --sidebar-active: #262626;
  --bg: #FAFAFA;
  --bg-secondary: #F4F4F5;
  --card-bg: #FFFFFF;
  --text: #0A0A0A;
  --text-secondary: #71717A;
  --text-muted: #A1A1AA;
  --border: #E4E4E7;
  --border-strong: #D4D4D8;
  --primary: #635BFF;          /* Stripe indigo */
  --primary-hover: #5046E5;
  --primary-soft: #EEEDFF;
  --success: #16A34A;
  --success-soft: #DCFCE7;
  --warning: #D97706;
  --warning-soft: #FEF3C7;
  --danger: #DC2626;
  --danger-hover: #B91C1C;
  --danger-soft: #FEE2E2;
  --purple: #635BFF;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow: 0 0 0 1px rgba(0,0,0,0.02);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 180ms var(--ease);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  letter-spacing: -0.005em;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
table { border-collapse: collapse; width: 100%; }
input, select, textarea { font-family: inherit; font-size: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ===== Mobile top bar (only shown on phone) ===== */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  z-index: 90;
}
.mobile-menu-btn {
  background: none;
  border: none;
  padding: 8px;
  margin: -8px;
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mobile-menu-btn:hover { background: var(--bg-secondary); }
.mobile-topbar-logo { width: 110px; height: auto; display: block; }

/* Sidebar backdrop (only active on mobile when drawer open) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.5);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease);
}
@media (max-width: 768px) {
  .sidebar-backdrop { display: block; }
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-header { padding: 28px 20px 20px; }
.sidebar-logo { font-size: 18px; font-weight: 600; letter-spacing: -0.4px; color: #fff; }
.sidebar-logo-img { width: 132px; height: auto; display: block; }
.sidebar-subtitle { font-size: 12px; color: rgba(255,255,255,0.5); display: block; margin-top: 6px; letter-spacing: 0.01em; }
.sidebar-nav { flex: 1; padding: 8px 12px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  transition: background var(--transition), color var(--transition);
  margin-bottom: 1px;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item svg { flex-shrink: 0; opacity: 0.85; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer { padding: 12px; }
.sidebar-divider { height: 1px; background: rgba(255,255,255,0.08); margin-bottom: 12px; }
.sidebar-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.4); font-weight: 500; margin-bottom: 8px; padding: 0 12px; }
.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  margin-bottom: 1px;
}
.sidebar-btn:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-btn-danger:hover { background: rgba(220,38,38,0.18); color: #FCA5A5; }

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px 40px 64px;
  min-height: 100vh;
  max-width: 1280px;
}

/* ===== Tab Content ===== */
.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}
.tab-header h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text);
}
.tab-header-actions { display: flex; gap: 10px; align-items: center; }

/* ===== Cards ===== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.card-title {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

/* ===== KPI Sections ===== */
.kpi-sections {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}
.kpi-section {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.kpi-section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.kpi-section-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* ===== KPI Cards ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  border-left: 3px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-label { font-size: 11px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-value { font-size: 22px; font-weight: 600; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi-revenue { border-left-color: var(--success); }
.kpi-expense { border-left-color: var(--danger); }
.kpi-profit { border-left-color: var(--primary); }
.kpi-projects { border-left-color: #8B5CF6; }
.kpi-aov { border-left-color: var(--warning); }
.kpi-monthly-rev { border-left-color: var(--primary); }

/* ===== Charts ===== */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  margin-bottom: 20px;
}
.chart-card { min-height: 320px; }
.chart-container { position: relative; width: 100%; height: 260px; }
.chart-container-doughnut { height: 240px; max-width: 280px; margin: 0 auto; }

/* ===== Tables ===== */
.table-card { padding: 0; overflow: hidden; }
.table-card > .card-title { padding: 20px 24px; margin-bottom: 0; border-bottom: 1px solid var(--border); }
.table-card > .empty-state { padding: 32px 24px; }
.table-wrapper { overflow-x: auto; margin: 0; }
.data-table { font-size: 13px; font-variant-numeric: tabular-nums; }
.data-table thead { background: transparent; }
.data-table th {
  padding: 12px;
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.data-table th:first-child, .data-table td:first-child, .data-table tfoot td:first-child { padding-left: 24px; }
.data-table th:last-child, .data-table td:last-child, .data-table tfoot td:last-child { padding-right: 24px; }
.data-table th.sortable { cursor: pointer; transition: color var(--transition); }
.data-table th.sortable:hover { color: var(--text); }
.sort-icon { font-size: 0.7rem; margin-left: 2px; color: var(--text-muted); }
.data-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--bg-secondary); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot td {
  padding: 14px 12px;
  font-weight: 600;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: none;
}

/* Row color-coding for leads */
.row-won { background: rgba(16, 185, 129, 0.06); }
.row-won:hover { background: rgba(16, 185, 129, 0.12) !important; }
.row-lost { background: rgba(239, 68, 68, 0.06); }
.row-lost:hover { background: rgba(239, 68, 68, 0.12) !important; }
.row-in-progress { background: rgba(245, 158, 11, 0.04); }
.row-in-progress:hover { background: rgba(245, 158, 11, 0.08) !important; }

/* ===== Tags / Pills ===== */
.tag-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: 0;
  margin-right: 4px;
  margin-bottom: 2px;
  border: 1px solid transparent;
}
.tag-story { background: #EEF2FF; color: #3730A3; border-color: #E0E7FF; }
.tag-brand { background: #FDF2F8; color: #9D174D; border-color: #FCE7F3; }
.tag-website { background: #ECFDF5; color: #065F46; border-color: #D1FAE5; }
.tag-fractional { background: #F5F3FF; color: #5B21B6; border-color: #EDE9FE; }
.tag-freelance { background: #ECFEFF; color: #155E75; border-color: #CFFAFE; }
.tag-campaign { background: #FFFBEB; color: #92400E; border-color: #FEF3C7; }
.tag-other { background: var(--bg-secondary); color: var(--text-secondary); border-color: var(--border); }

/* ===== Status Badge ===== */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
  border: 1px solid transparent;
}
.status-badge.clickable {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s, transform 0.1s;
}
.status-badge.clickable:hover { opacity: 0.85; }
.status-badge.clickable:active { transform: scale(0.95); }
.status-active { background: #ECFDF5; color: #065F46; border-color: #D1FAE5; }
.status-completed { background: #EEF2FF; color: #3730A3; border-color: #E0E7FF; }
.status-on-hold { background: #FFFBEB; color: #92400E; border-color: #FEF3C7; }
.status-cancelled { background: #FEF2F2; color: #991B1B; border-color: #FEE2E2; }

/* Stage badge */
.stage-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
  border: 1px solid transparent;
}
.stage-intro { background: #EEF2FF; color: #3730A3; border-color: #E0E7FF; }
.stage-first_meeting { background: #EFF6FF; color: #1E40AF; border-color: #DBEAFE; }
.stage-proposal { background: #FFFBEB; color: #92400E; border-color: #FEF3C7; }
.stage-cold { background: var(--bg-secondary); color: var(--text-secondary); border-color: var(--border); }
.stage-signed { background: #ECFDF5; color: #065F46; border-color: #D1FAE5; }
.stage-out { background: #FEF2F2; color: #991B1B; border-color: #FEE2E2; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.25); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #15803D; border-color: #15803D; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-secondary); border-color: var(--border-strong); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon {
  background: none;
  border: 1px solid transparent;
  padding: 6px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.btn-icon:hover { color: var(--primary); background: var(--primary-soft); }
.btn-icon-danger:hover { color: var(--danger); background: var(--danger-soft); }
.btn-icon:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.2); }

/* ===== Forms ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; color: var(--text-secondary); }
.input-field, .select-input, .textarea-field {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff;
}
.input-field:focus, .select-input:focus, .textarea-field:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.18); }
.input-field::placeholder, .textarea-field::placeholder { color: var(--text-muted); }
.textarea-field { resize: vertical; min-height: 60px; }
.input-date { width: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-computed {
  padding: 9px 12px;
  background: var(--success-soft);
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  color: #065F46;
  font-variant-numeric: tabular-nums;
}
.checkbox-group { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.checkbox-label { display: flex; align-items: center; gap: 4px; font-size: 0.85rem; cursor: pointer; }
.checkbox-label input { cursor: pointer; }

/* ===== Filters Bar ===== */
.filters-bar {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.filter-group { display: flex; flex-direction: column; gap: 6px; }
.filter-label { font-size: 11px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.filters-bar .select-input, .filters-bar .input-field { width: auto; min-width: 140px; padding: 7px 10px; font-size: 13px; }

/* ===== Pipeline / Funnel ===== */
.funnel-container { padding: 8px 0; }
.funnel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.funnel-label {
  width: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
  color: var(--text-secondary);
  text-transform: capitalize;
}
.funnel-bar-track {
  flex: 1;
  height: 28px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.funnel-bar {
  height: 100%;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  min-width: fit-content;
  transition: width 300ms ease;
}
.funnel-bar-intro { background: #818cf8; }
.funnel-bar-first_meeting { background: #3b82f6; }
.funnel-bar-proposal { background: #f59e0b; }
.funnel-bar-cold { background: #94a3b8; }
.funnel-bar-signed { background: #10b981; }
.funnel-bar-out { background: #ef4444; }
.funnel-count { min-width: 30px; font-size: 0.85rem; font-weight: 700; color: var(--text); }

/* Pipeline summary on dashboard */
.pipeline-summary .funnel-row { margin-bottom: 6px; }

/* Lead monthly cards */
.lead-monthly-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.monthly-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  text-align: center;
}
.monthly-card-label { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; }
.monthly-card-value { font-size: 1.3rem; font-weight: 700; margin-top: 4px; }

/* ===== YoY Growth ===== */
.yoy-positive { color: var(--success); font-weight: 600; }
.yoy-negative { color: var(--danger); font-weight: 600; }

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
  width: 90%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; color: var(--text); }
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.modal-close:hover { color: var(--text); background: var(--bg-secondary); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg-secondary);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: toast-in 200ms ease;
  max-width: 360px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }
.toast-exit { animation: toast-out 200ms ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-10px); } }

/* ===== Empty State ===== */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
}
.empty-state p { font-size: 0.95rem; }

/* ===== View Toggle ===== */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}
.view-toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  border-radius: calc(var(--radius) - 3px);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.view-toggle-btn:hover { color: var(--text); }
.view-toggle-btn.active {
  background: var(--card-bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
}

/* ===== Kanban Board ===== */
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  min-height: 400px;
  padding-bottom: 12px;
  margin-bottom: 20px;
}
.kanban-column {
  min-width: 220px;
  max-width: 260px;
  flex: 1;
  flex-shrink: 0;
  background: #f1f5f9;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  transition: background var(--transition);
}
.kanban-column.drag-over {
  background: #e0e7ff;
}
.kanban-column-header {
  padding: 12px 14px 8px;
  border-top: 3px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-column-header .col-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: capitalize;
}
.kanban-column-header .col-count {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 1px 8px;
  color: var(--text-secondary);
}
.kanban-column-body {
  flex: 1;
  padding: 4px 8px 8px;
  overflow-y: auto;
  min-height: 60px;
}
/* Stage border colors */
.kanban-col-intro .kanban-column-header { border-top-color: #818cf8; }
.kanban-col-first_meeting .kanban-column-header { border-top-color: #3b82f6; }
.kanban-col-proposal .kanban-column-header { border-top-color: #f59e0b; }
.kanban-col-cold .kanban-column-header { border-top-color: #94a3b8; }
.kanban-col-signed .kanban-column-header { border-top-color: #10b981; }
.kanban-col-out .kanban-column-header { border-top-color: #ef4444; }

.kanban-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: box-shadow var(--transition), opacity var(--transition);
}
.kanban-card:hover {
  box-shadow: var(--shadow-lg);
}
.kanban-card:active {
  cursor: grabbing;
}
.kanban-card.dragging {
  opacity: 0.4;
}
.kanban-card-company {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.kanban-card-type {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.kanban-card-budget {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 2px;
}
.kanban-card-notes {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.3;
  margin-top: 4px;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .lead-monthly-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .kpi-sections { flex-direction: column; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .lead-monthly-cards { grid-template-columns: repeat(2, 1fr); }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

/* ===== Mobile (≤768px): drawer sidebar + full-width content ===== */
@media (max-width: 768px) {
  /* Show mobile top bar */
  .mobile-topbar { display: flex; }

  /* Sidebar becomes off-canvas drawer */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 220ms var(--ease);
    box-shadow: 0 0 0 0 rgba(0,0,0,0);
    width: 280px;
    min-width: 280px;
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  }

  /* Backdrop appears when drawer open */
  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  /* Lock background scroll when drawer open */
  body.sidebar-open { overflow: hidden; }

  /* Main content full width, accounting for top bar */
  .main-content {
    margin-left: 0;
    padding: 72px 16px 32px;
    max-width: 100%;
  }

  /* Tab header stacks */
  .tab-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }
  .tab-header h2 { font-size: 22px; }
  .tab-header-actions { width: 100%; flex-wrap: wrap; }
  .tab-header-actions .btn { flex: 1; min-width: 0; }
  .tab-header-actions .select-input { flex: 1; min-width: 140px; }

  /* Cards: tighter padding on phone */
  .card { padding: 18px; margin-bottom: 16px; }
  .card-title { font-size: 12px; }

  /* Hero scaling */
  #tab-dashboard { padding: 0; }
  .hero-section { padding: 4px 0 28px; margin-bottom: 24px; }
  .hero-number { font-size: 38px; letter-spacing: -1px; }
  .hero-eyebrow { margin-bottom: 8px; }
  .hero-sub { margin-bottom: 16px; flex-wrap: wrap; }
  .hero-trend-bars { height: 52px; }

  /* Glance row stacks */
  .glance-row { grid-template-columns: 1fr; gap: 20px; margin-bottom: 32px; }
  .glance-value { font-size: 22px; }

  /* KPI grid: single column */
  .kpi-grid { grid-template-columns: 1fr; gap: 12px; }
  .kpi-section-cards { grid-template-columns: 1fr; }

  /* Filters bar wraps */
  .filters-bar { flex-direction: column; align-items: stretch; gap: 12px; padding: 12px; }
  .filter-group { width: 100%; }
  .filters-bar .select-input,
  .filters-bar .input-field { width: 100%; min-width: 0; }

  /* Quick-add bar stacks */
  .quick-add { flex-wrap: wrap; padding: 12px; gap: 8px; border-radius: 12px; }
  .qa-input { width: 100%; height: 44px; flex: 1 1 100%; }
  .qa-revenue, .qa-expense, .qa-select { flex: 1 1 calc(50% - 4px); }
  .qa-add { flex: 1 1 100%; height: 44px; }

  /* Tables: tighter padding, smaller first/last */
  .data-table { font-size: 12px; }
  .data-table th { padding: 10px 8px; font-size: 10px; }
  .data-table td { padding: 12px 8px; }
  .data-table th:first-child,
  .data-table td:first-child,
  .data-table tfoot td:first-child { padding-left: 16px; }
  .data-table th:last-child,
  .data-table td:last-child,
  .data-table tfoot td:last-child { padding-right: 16px; }
  .table-card > .card-title { padding: 16px 18px; }
  .table-card > .empty-state { padding: 24px 18px; }

  /* Buttons: ensure tappable height */
  .btn { padding: 11px 16px; min-height: 40px; }
  .btn-sm { padding: 8px 12px; min-height: 36px; }

  /* Form inputs: prevent iOS zoom on focus by setting font ≥16px */
  .input-field, .select-input, .textarea-field, .qa-input { font-size: 16px; }

  /* Modal: near full-screen on phone */
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .modal-overlay { align-items: flex-start; }
  .modal-header { padding: 16px 18px; }
  .modal-body { padding: 18px; }
  .modal-footer { padding: 14px 18px; border-radius: 0; }
  .modal-footer .btn { flex: 1; }

  /* Past check-ins compact */
  .past-checkin-row {
    grid-template-columns: 90px 1fr auto;
    gap: 10px;
    padding: 12px 6px;
  }
  .past-checkin-delete { opacity: 1; } /* always visible on touch */
  .past-checkin-stats { font-size: 12px; }

  /* Check-in banner stacks */
  .checkin-banner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .checkin-banner .btn { width: 100%; }

  /* Hide redundant subtitle, scale hero edit */
  .sidebar-subtitle { font-size: 13px; }
}

/* Smaller phones */
@media (max-width: 380px) {
  .main-content { padding: 68px 12px 24px; }
  .hero-number { font-size: 32px; }
  .glance-value { font-size: 20px; }
  .qa-revenue, .qa-expense, .qa-select { flex: 1 1 100%; }
}

/* ===== Payment Rows ===== */
.payment-row {
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.payment-row .pm-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-top: 0;
}

/* ===== Insight Detail ===== */
.insight-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== Tag Select (multi-toggle) ===== */
.tag-select {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-option {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.tag-option:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tag-option.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ===== Project Type Tags (display) ===== */
.kanban-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.project-type-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  background: #e0e7ff;
  color: #3b52a0;
}

.project-type-tag.tag-story { background: #fef3c7; color: #92400e; }
.project-type-tag.tag-brand { background: #ede9fe; color: #6d28d9; }
.project-type-tag.tag-website { background: #d1fae5; color: #065f46; }
.project-type-tag.tag-freelance { background: #dbeafe; color: #1e40af; }
.project-type-tag.tag-campaign { background: #fce7f3; color: #9d174d; }
.project-type-tag.tag-fractional { background: #e0f2fe; color: #0369a1; }
.project-type-tag.tag-other { background: #f3f4f6; color: #4b5563; }

/* ===== Referral Source Tags ===== */
.source-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-right: 4px;
  margin-bottom: 2px;
  text-transform: capitalize;
}
.source-tag-direct { background: #dbeafe; color: #1e40af; }
.source-tag-referral { background: #ede9fe; color: #6d28d9; }
.source-tag-past-client { background: #d1fae5; color: #065f46; }
.source-tag-x { background: #1e293b; color: #f1f5f9; }
.source-tag-linkedin { background: #dbeafe; color: #1e40af; }
.source-tag-outbound { background: #fef3c7; color: #92400e; }
.source-tag-vc { background: #e0e7ff; color: #3730a3; }
.source-tag-warpcast { background: #ede9fe; color: #5b21b6; }
.source-tag-other { background: #f3f4f6; color: #4b5563; }
.source-referrer {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

/* ===== Tag Add Button / Input ===== */
.tag-add-btn {
  border-style: dashed !important;
  color: var(--text-secondary) !important;
  min-width: 36px;
  justify-content: center;
}
.tag-add-input {
  width: 120px;
  padding: 5px 10px;
  border: 1px dashed var(--primary);
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: var(--font);
  outline: none;
  background: var(--card-bg);
}
.tag-add-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

/* ===== Simplified v18: Current month card, KPIs, funnel, check-in ===== */

.current-month-wrapper { padding: 0; overflow: hidden; }

.current-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
}
.current-card-cta {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-left: 4px solid var(--primary);
}
.current-card-done {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-left: 4px solid var(--success);
}
.current-card-eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.current-card-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.current-card-meta {
  font-size: 14px;
  color: var(--text-secondary);
}
.btn-large {
  padding: 12px 22px;
  font-size: 15px;
}

.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
.kpi-positive { color: var(--success); }
.kpi-negative { color: var(--danger); }

/* Funnel */
.funnel-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.funnel-stage {
  flex: 1;
  min-width: 110px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.funnel-stage-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.funnel-stage-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.funnel-arrow {
  align-self: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: #eff6ff;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.funnel-context {
  margin-top: 12px;
  font-size: 13px;
}
.funnel-empty {
  color: var(--text-secondary);
  font-style: italic;
  padding: 16px;
}
.muted { color: var(--text-secondary); }
.empty-cell { text-align: center; color: var(--text-secondary); padding: 24px; }
.recent-notes { color: var(--text-secondary); font-style: italic; }

/* Check-in flow */
.checkin-container {
  max-width: 640px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.checkin-progress {
  margin-bottom: 24px;
}
.checkin-progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.checkin-progress-bar {
  height: 100%;
  background: var(--primary);
  width: 14%;
  transition: width 250ms ease;
}
.checkin-progress-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.checkin-notice {
  background: #fef3c7;
  border-left: 3px solid var(--warning);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #78350f;
  margin-bottom: 16px;
}
.checkin-step { display: none; }
.checkin-step.active { display: block; }
.checkin-question {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.checkin-hint {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.input-large {
  font-size: 18px;
  padding: 12px 14px;
  width: 100%;
}
.input-with-prefix {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
}
.input-with-prefix:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.input-with-prefix .input-prefix {
  padding: 12px 14px;
  background: #f8fafc;
  border-right: 1px solid var(--border);
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 500;
}
.input-with-prefix input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 14px;
  font-size: 18px;
  background: transparent;
}
.funnel-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.funnel-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.funnel-input span {
  font-weight: 500;
  color: var(--text);
}
.funnel-input input {
  width: 100px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  text-align: right;
  background: var(--card-bg);
}
.funnel-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.checkin-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.checkin-controls .btn-primary { margin-left: auto; }

/* Review screen */
.review-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  margin-bottom: 16px;
}
.review-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.review-row:last-child { border-bottom: none; }
.review-row span { color: var(--text-secondary); }
.review-row strong { color: var(--text); }
.review-row em { color: var(--text-secondary); font-style: normal; font-weight: 400; font-size: 12px; }
.review-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin: 16px 0 8px;
}
.review-section { margin-bottom: 12px; }
.review-text {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  white-space: pre-wrap;
  font-size: 14px;
  color: var(--text);
}

.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: 4px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Scope bar */
.scope-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.scope-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* 5-column KPI grid */
.kpi-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) {
  .kpi-grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .kpi-grid-5 { grid-template-columns: repeat(2, 1fr); }
}

/* Deal list (check-in step 2) */
.deals-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.deal-row {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.deal-row-top {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.deal-client {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--card-bg);
}
.deal-client:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}
.deal-amount-wrap {
  width: 140px;
  flex-shrink: 0;
}
.deal-amount-wrap .input-prefix {
  padding: 8px 10px;
  font-size: 14px;
}
.deal-amount-wrap input {
  padding: 8px 10px;
  font-size: 14px;
  text-align: right;
  width: 100%;
}
.deal-remove {
  width: 32px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.deal-remove:hover {
  background: #fef2f2;
  border-color: var(--danger);
  color: var(--danger);
}
.deal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.deal-tag {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
  transition: all var(--transition);
}
.deal-tag:hover { border-color: var(--primary); color: var(--primary); }
.deal-tag.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.deals-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 12px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  font-size: 14px;
}
.deals-total strong {
  font-size: 18px;
  color: var(--primary);
}

.checkin-simple {
  max-width: 720px;
}
.checkin-intro {
  margin: 0 0 18px;
  font-size: 14px;
}

/* ===== Stripe-style Dashboard ===== */
#tab-dashboard .tab-header { display: none; }
#tab-dashboard {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 0 32px;
}

/* Check-in banner */
.checkin-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--warning-soft);
  border: 1px solid #FDE68A;
  color: #78350F;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 32px;
}
.checkin-banner-text { font-size: 14px; }
.checkin-banner strong { font-weight: 600; }

/* Hero */
.hero-section {
  padding: 8px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}
.hero-eyebrow {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.hero-number {
  font-size: 52px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -1.5px;
  line-height: 1.05;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.hero-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-edit {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  transition: background var(--transition);
}
.hero-edit:hover { background: var(--primary-soft); }

.hero-bar-wrap { margin-bottom: 28px; }
.hero-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.hero-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.5s var(--ease);
}
.hero-bar-meta {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Trend strip */
.hero-trend { margin-top: 8px; }
.hero-trend-bars {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 64px;
  padding: 4px 0;
}
.hero-trend-bars::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: var(--target-pct, 0%);
  height: 1px;
  background: var(--border-strong);
  border-top: 1px dashed var(--border-strong);
  pointer-events: none;
  z-index: 0;
}
.trend-bar {
  flex: 1;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: opacity 0.2s;
  position: relative;
  z-index: 1;
  opacity: 0.85;
}
.trend-bar:hover { opacity: 1; }
.trend-bar-future { background: var(--border); opacity: 1; }
.hero-trend-labels {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.hero-trend-labels span {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Glance row */
.glance-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 44px;
}
.glance {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.glance-value {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.glance-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.glance-label {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}
.glance-target {
  font-size: 12px;
  color: var(--text-secondary);
}
.glance-bar {
  margin-top: 8px;
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 999px;
  overflow: hidden;
}
.glance-bar-fill {
  height: 100%;
  background: var(--success);
  border-radius: 999px;
  transition: width 0.5s var(--ease);
}

/* Mix section */
.mix-section {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.mix-block { display: flex; flex-direction: column; gap: 10px; }
.mix-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.mix-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.1px;
}
.mix-context { font-size: 12px; color: var(--text-secondary); }
.mix-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-secondary);
}
.mix-bar-seg { transition: opacity 0.2s; }
.mix-bar-seg:hover { opacity: 0.85; }
.mix-bar-empty { width: 100%; background: #f1f5f9; }
.mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
}
.mix-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.mix-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

@media (max-width: 700px) {
  .glance-row { grid-template-columns: 1fr; gap: 20px; }
  .hero-number { font-size: 36px; }
}

/* ===== Historical "live" row tag ===== */
.live-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--success-soft);
  color: #065F46;
  border: 1px solid #BBF7D0;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}
tr.row-live {
  background: rgba(16, 185, 129, 0.04);
}
.proj-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 6px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cell-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ===== Past check-ins list ===== */
.past-checkins {
  margin-top: 24px;
}
.past-checkins-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}
.past-checkins-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.past-checkins-hint {
  font-size: 13px;
}
.past-checkin-row {
  display: grid;
  grid-template-columns: 110px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  border-radius: 6px;
}
.past-checkin-delete {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.past-checkin-row:hover .past-checkin-delete { opacity: 1; }
.past-checkin-delete:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.past-checkin-row:hover {
  background: var(--bg-secondary);
}
.past-checkin-row:last-child { border-bottom: none; }
.past-checkin-month {
  font-weight: 600;
  font-size: 14px;
}
.past-checkin-stats {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.past-checkin-rate {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.past-checkin-empty {
  padding: 24px 8px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ===== Hero carry-over note ===== */
.hero-carryover-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.hero-carryover-note:empty { display: none; }
.carryover-link {
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  cursor: pointer;
}
.carryover-link:hover { color: var(--text); }

/* Quick-add last-added pill */
.qa-last-added {
  margin: -20px 0 24px;
  padding: 10px 14px;
  background: var(--success-soft);
  border: 1px solid #BBF7D0;
  border-radius: var(--radius);
  font-size: 13px;
  color: #065F46;
  display: flex;
  align-items: center;
  gap: 10px;
}
.qa-last-added strong { color: #064E3B; font-weight: 600; }
.qa-last-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.qa-last-dismiss {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #065F46;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.55;
  transition: opacity var(--transition);
}
.qa-last-dismiss:hover { opacity: 1; }

/* Clickable tag/source pills (in projects table) */
.clickable-filter {
  cursor: pointer;
  transition: filter 0.12s, transform 0.12s;
}
.clickable-filter:hover {
  filter: brightness(0.92);
  transform: translateY(-1px);
}
.clickable-filter:active { transform: translateY(0); }

/* Active filter chips above projects table */
.filter-active-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-active-chips:empty { display: none; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-secondary);
}
.filter-chip strong { color: var(--text); font-weight: 600; }
.filter-chip button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 4px;
}
.filter-chip button:hover { color: var(--danger, #dc2626); }


/* ===== Quick Add bar ===== */
.quick-add {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 32px;
  padding: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.qa-input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.qa-input::placeholder { color: var(--text-muted); }
.qa-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.18);
}
.qa-client { flex: 2; min-width: 0; }
.qa-revenue, .qa-expense { flex: 1; min-width: 0; }
.qa-select { flex: 1; min-width: 0; cursor: pointer; }
.qa-add { white-space: nowrap; }

@media (max-width: 700px) {
  .quick-add { flex-wrap: wrap; }
  .qa-client { flex: 1 1 100%; }
  .qa-revenue, .qa-expense, .qa-select { flex: 1 1 calc(50% - 4px); }
  .qa-add { flex: 1 1 100%; }
}

/* ===== Collapsible "More options" in modals ===== */
.more-options {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.more-options > summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 0;
  list-style: none;
  user-select: none;
}
.more-options > summary::-webkit-details-marker { display: none; }
.more-options > summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s;
}
.more-options[open] > summary::before {
  transform: rotate(90deg);
}
.more-options[open] > summary {
  margin-bottom: 8px;
}
