/* ═══════════════════════════════════════════════════════════════════════════
   ZJ Marketing & Automation — Design System
   Dark mode only. Sharp edges. Space Mono for numbers. Syne for headings.
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --bg: #0A0A0A;
  --surface: #111111;
  --surface-2: #161616;
  --border: #1F1F1F;
  --border-2: #2A2A2A;
  --accent: #4F6AFF;
  --accent-dim: rgba(79, 106, 255, 0.12);
  --accent-glow: rgba(79, 106, 255, 0.25);
  --success: #22C55E;
  --success-dim: rgba(34, 197, 94, 0.12);
  --warning: #F59E0B;
  --warning-dim: rgba(245, 158, 11, 0.12);
  --danger: #EF4444;
  --danger-dim: rgba(239, 68, 68, 0.12);
  --text: #FFFFFF;
  --text-2: #888888;
  --text-3: #555555;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --sidebar-w: 240px;
  --sidebar-collapsed: 0px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-full: 999px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --transition: 150ms ease;
  --transition-slow: 300ms ease;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); font-size: 14px; }
input, textarea, select {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
select option { background: var(--surface); color: var(--text); }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }

/* ── Fonts ─────────────────────────────────────────────────────────────────── */
.font-mono { font-family: var(--font-mono) !important; }
.font-head { font-family: var(--font-head) !important; }

/* ── App Layout ────────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition-slow), width var(--transition-slow);
  overflow: hidden;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo .logo-text {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
}
.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }
.nav-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.nav-section:last-child { border-bottom: none; }
.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 4px 20px 6px;
  white-space: nowrap;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transform: scaleY(0.3);
  transition: opacity var(--transition), transform var(--transition);
}
.nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}
.nav-item:hover::before {
  opacity: 0.5;
  transform: scaleY(0.7);
}
.nav-item.active {
  color: var(--text);
  background: rgba(79, 106, 255, 0.08);
}
.nav-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}
.nav-item svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.nav-item:hover svg, .nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--danger-dim);
  color: var(--danger);
  border-radius: var(--radius-full);
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.nav-badge.accent { background: var(--accent-dim); color: var(--accent); }
.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-footer .user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-footer .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.sidebar-footer .user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.sidebar-footer .user-role {
  font-size: 11px;
  color: var(--text-3);
}

/* Hamburger */
.hamburger {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  margin: 3px 0;
  transition: all var(--transition);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  backdrop-filter: blur(4px);
}

/* ── Main Content ──────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-header {
  padding: 28px 32px 0;
}
.page-title {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-2);
}
.page-body {
  padding: 24px 32px 40px;
  flex: 1;
}

/* ── Page Transition ───────────────────────────────────────────────────────── */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-body { animation: pageIn 200ms ease forwards; }

/* ── Stat Bar ──────────────────────────────────────────────────────────────── */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.stat-card .stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}
.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.stat-card .stat-value.green { color: var(--success); }
.stat-card .stat-value.amber { color: var(--warning); }
.stat-card .stat-value.red { color: var(--danger); }
.stat-card .stat-value.blue { color: var(--accent); }
.stat-card .stat-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}
.stat-card .stat-sparkline {
  position: absolute;
  bottom: 0; right: 0;
  width: 80px;
  height: 32px;
  opacity: 0.4;
}

/* Pulse animations */
@keyframes pulse-blue { 0%, 100% { box-shadow: 0 0 0 0 rgba(79,106,255,0.4); } 50% { box-shadow: 0 0 0 6px rgba(79,106,255,0); } }
@keyframes pulse-red { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); } 50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }
@keyframes pulse-amber { 0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); } 50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); } }
@keyframes pulse-green { 0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.3); } 50% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } }

.stat-card.pulse-blue { animation: pulse-blue 2s infinite; }
.stat-card.pulse-red { animation: pulse-red 1.5s infinite; }
.stat-card.pulse-amber { animation: pulse-amber 2s infinite; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: #3d58e8; border-color: #3d58e8; text-decoration: none; color: #fff; }
.btn-secondary {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--border-2); color: var(--text); background: rgba(255,255,255,0.04); text-decoration: none; }
.btn-success {
  background: var(--success-dim);
  color: var(--success);
  border-color: rgba(34,197,94,0.2);
}
.btn-success:hover { background: rgba(34,197,94,0.2); }
.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-warning {
  background: var(--warning-dim);
  color: var(--warning);
  border-color: rgba(245,158,11,0.2);
}
.btn-warning:hover { background: rgba(245,158,11,0.2); }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
  padding: 6px 8px;
}
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}
.btn-lg {
  padding: 11px 20px;
  font-size: 14.5px;
}
.btn-icon {
  padding: 7px;
  border-radius: var(--radius-sm);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.btn .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-accent  { background: var(--accent-dim);  color: var(--accent); }
.badge-success { background: var(--success-dim); color: var(--success); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-danger  { background: var(--danger-dim);  color: var(--danger); }
.badge-neutral { background: rgba(255,255,255,0.06); color: var(--text-2); }
.badge-purple  { background: rgba(168,85,247,0.12); color: #A855F7; }
.badge-teal    { background: rgba(20,184,166,0.12); color: #14B8A6; }
.badge-orange  { background: rgba(249,115,22,0.12); color: #F97316; }

/* New/Overdue pulse badge */
@keyframes badgePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.badge-pulse { animation: badgePulse 1.5s ease-in-out infinite; }

/* ── Health Dots ───────────────────────────────────────────────────────────── */
.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes breatheGreen { 0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); opacity: 1; } 50% { box-shadow: 0 0 0 5px rgba(34,197,94,0); opacity: 0.7; } }
@keyframes breatheAmber { 0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.6); } 50% { box-shadow: 0 0 0 5px rgba(245,158,11,0); } }
@keyframes breatheRed   { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.7); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }

.health-dot.green { background: var(--success); animation: breatheGreen 3s ease-in-out infinite; }
.health-dot.amber { background: var(--warning); animation: breatheAmber 2s ease-in-out infinite; }
.health-dot.red   { background: var(--danger);  animation: breatheRed 1.2s ease-in-out infinite; }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.table-toolbar {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.table-toolbar .search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.table-toolbar .search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.table-toolbar .search-box input {
  padding-left: 32px;
  height: 34px;
}
.table-toolbar select {
  height: 34px;
  min-width: 120px;
  width: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead tr { background: rgba(255,255,255,0.02); }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
thead th:hover { color: var(--text-2); }
thead th .sort-arrow { opacity: 0.3; margin-left: 4px; }
thead th.sorted-asc .sort-arrow::after { content: '↑'; opacity: 1; }
thead th.sorted-desc .sort-arrow::after { content: '↓'; opacity: 1; }
tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr.overdue { background: rgba(239,68,68,0.04); }
tbody tr.overdue:hover { background: rgba(239,68,68,0.08); }
tbody td {
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}
tbody td .notes-preview {
  color: var(--text-2);
  font-size: 12px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
tbody td .notes-preview:hover { white-space: normal; overflow: visible; }
.table-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
}
.table-empty svg { width: 40px; height: 40px; margin: 0 auto 12px; opacity: 0.3; }
.table-empty h3 { font-size: 15px; color: var(--text-2); margin-bottom: 6px; }
.table-empty p { font-size: 13px; }

/* Row stagger fade */
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}
tbody tr { animation: rowIn 200ms ease both; }
tbody tr:nth-child(1) { animation-delay: 20ms; }
tbody tr:nth-child(2) { animation-delay: 40ms; }
tbody tr:nth-child(3) { animation-delay: 60ms; }
tbody tr:nth-child(4) { animation-delay: 80ms; }
tbody tr:nth-child(5) { animation-delay: 100ms; }
tbody tr:nth-child(n+6) { animation-delay: 120ms; }

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.pagination .page-info { font-size: 12px; color: var(--text-2); font-family: var(--font-mono); }
.pagination .page-buttons { display: flex; gap: 6px; }
.pagination .page-btn {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-2);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-mono);
}
.pagination .page-btn:hover { border-color: var(--accent); color: var(--accent); }
.pagination .page-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.pagination .page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Avatar ────────────────────────────────────────────────────────────────── */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(79,106,255,0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  font-family: var(--font-head);
}
.avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar-row .name { font-weight: 600; font-size: 13px; }
.avatar-row .sub { font-size: 11px; color: var(--text-2); }

/* ── Drawers ───────────────────────────────────────────────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 520px;
  max-width: 95vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 301;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.drawer-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
}
.drawer-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--transition);
}
.drawer-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

/* ── Modals ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
  padding: 20px;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.94);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 1000px; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 4px; }
textarea { resize: vertical; min-height: 80px; }
.input-with-icon {
  position: relative;
}
.input-with-icon input { padding-left: 36px; }
.input-with-icon .input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  width: 16px;
  height: 16px;
  pointer-events: none;
}
.input-with-copy {
  position: relative;
}
.input-with-copy .copy-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 8px;
  font-size: 11px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  color: var(--accent);
  cursor: pointer;
  border: none;
  transition: background var(--transition);
}
.input-with-copy .copy-btn:hover { background: rgba(79,106,255,0.2); }

/* Checkbox */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.checkbox-group label { font-size: 13px; cursor: pointer; }

/* Toggle */
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-2);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  background: var(--text-2);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); background: #fff; }

/* Range / Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border-2);
  border-radius: var(--radius-full);
  outline: none;
  border: none;
  padding: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-item {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition);
}
.tab-item:hover { color: var(--text); }
.tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-item .tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  font-size: 10px;
  margin-left: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
}

/* Pill tabs */
.tabs-pill {
  display: flex;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 4px;
  width: fit-content;
  flex-wrap: wrap;
}
.tab-pill {
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  white-space: nowrap;
}
.tab-pill:hover { color: var(--text); }
.tab-pill.active {
  background: var(--accent);
  color: #fff;
}

/* ── Loading Skeletons ─────────────────────────────────────────────────────── */
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface) 0%, rgba(255,255,255,0.05) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  display: block;
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.sm { height: 10px; width: 60%; }
.skeleton-stat { height: 56px; }
.skeleton-row { height: 44px; }

/* ── Toasts ────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-width: 280px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: all;
  box-shadow: var(--shadow);
  transform: translateX(110%);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.show { transform: translateX(0); }
.toast.hide { transform: translateX(110%); transition: transform 200ms ease-in; }
.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }
.toast-text { flex: 1; font-size: 13px; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--accent); }
.toast.success .toast-icon { color: var(--success); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info    .toast-icon { color: var(--accent); }

/* ── Alert Banner ──────────────────────────────────────────────────────────── */
.alert-banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-banner.danger  { background: var(--danger-dim); border: 1px solid rgba(239,68,68,0.2); color: var(--danger); }
.alert-banner.warning { background: var(--warning-dim); border: 1px solid rgba(245,158,11,0.2); color: var(--warning); }
.alert-banner.success { background: var(--success-dim); border: 1px solid rgba(34,197,94,0.2); color: var(--success); }

/* ── Confirm Dialog ────────────────────────────────────────────────────────── */
.confirm-dialog .modal { max-width: 380px; }
.confirm-dialog .modal-body { text-align: center; padding: 28px 24px; }
.confirm-dialog .confirm-icon { font-size: 36px; margin-bottom: 12px; }
.confirm-dialog h3 { font-size: 16px; margin-bottom: 8px; }
.confirm-dialog p { font-size: 13px; color: var(--text-2); }

/* ── Code Block ────────────────────────────────────────────────────────────── */
.code-block {
  background: #080808;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  overflow-x: auto;
  position: relative;
}
.code-block .code-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: 8px;
}
.code-block .copy-code-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  font-size: 11px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition);
}
.code-block .copy-code-btn:hover { border-color: var(--accent); color: var(--accent); }
.code-block .key { color: #4F6AFF; }
.code-block .string { color: #22C55E; }
.code-block .comment { color: #555; }

/* ── Charts ────────────────────────────────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
}
.chart-container canvas {
  max-width: 100%;
}
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}
.chart-card .chart-title {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.chart-card .chart-subtitle {
  font-size: 11px;
  color: var(--text-2);
  margin-bottom: 16px;
}

/* ── Kanban ────────────────────────────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 400px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.kanban-col {
  min-width: 240px;
  width: 240px;
  flex-shrink: 0;
}
.kanban-col-header {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.kanban-col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}
.kanban-col-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}
.kanban-col-body {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.kanban-col-body.drag-over {
  background: rgba(79,106,255,0.06);
  border: 1px dashed var(--accent);
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: grab;
  transition: all var(--transition);
  user-select: none;
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.kanban-card:hover { border-color: var(--border-2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.kanban-card .card-business { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.kanban-card .card-contact { font-size: 11px; color: var(--text-2); margin-bottom: 8px; }
.kanban-card .card-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kanban-card .card-value { font-family: var(--font-mono); font-size: 12px; color: var(--success); }
.kanban-card .days-in-stage { font-family: var(--font-mono); font-size: 11px; }
.kanban-card .days-in-stage.amber { color: var(--warning); }
.kanban-card .days-in-stage.red { color: var(--danger); }

/* ── AI Panel ──────────────────────────────────────────────────────────────── */
.ai-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}
.ai-panel::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  animation: accentGlow 3s ease-in-out infinite;
}
@keyframes accentGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(79,106,255,0.5); opacity: 1; }
  50% { box-shadow: 0 0 20px rgba(79,106,255,0.8); opacity: 0.7; }
}
.ai-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}
.ai-panel-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}
.ai-live-dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: breatheGreen 2.5s ease-in-out infinite;
}
.ai-live-label {
  font-size: 11px;
  color: var(--success);
  font-weight: 600;
}
.ai-generated-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
}
.ai-panel-body {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
}
.ai-briefing-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  min-height: 80px;
}
.ai-briefing-text p { margin-bottom: 8px; }
.ai-briefing-text strong { color: var(--accent); }
.ai-cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.ai-mini-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-mini-metric {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.ai-mini-metric .mmm-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-3); margin-bottom: 4px; }
.ai-mini-metric .mmm-value { font-family: var(--font-mono); font-size: 20px; font-weight: 700; }
.ai-actions { padding: 0 20px 16px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Chat interface */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 500px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.chat-message {
  display: flex;
  gap: 12px;
  animation: rowIn 200ms ease both;
}
.chat-message.user { flex-direction: row-reverse; }
.chat-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  line-height: 1.6;
}
.chat-message.ai .chat-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px var(--radius-md) var(--radius-md) var(--radius-md);
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.chat-message.user .chat-bubble {
  background: var(--accent-dim);
  border: 1px solid rgba(79,106,255,0.2);
  border-radius: var(--radius-md) 2px var(--radius-md) var(--radius-md);
  color: var(--text);
}
.chat-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 4px;
}
.chat-message.ai .chat-avatar { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(79,106,255,0.3); }
.chat-message.user .chat-avatar { background: rgba(255,255,255,0.06); color: var(--text-2); border: 1px solid var(--border); }
.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}
.chat-input-area textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 160px;
  padding: 10px 14px;
}
.chat-message-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ── Progress Bar ──────────────────────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--border-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
  width: 0%;
}
.progress-bar-fill.green { background: var(--success); }
.progress-bar-fill.amber { background: var(--warning); }
.progress-bar-fill.gradient { background: linear-gradient(90deg, var(--accent), var(--success)); }

/* ── Funnel ────────────────────────────────────────────────────────────────── */
.funnel {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0;
}
.funnel-stage {
  flex: 1;
  min-width: 80px;
  text-align: center;
  position: relative;
}
.funnel-bar {
  height: 40px;
  margin: 0 2px;
  background: var(--accent-dim);
  border: 1px solid rgba(79,106,255,0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  transition: transform var(--transition);
}
.funnel-bar:hover { transform: scaleY(1.05); }
.funnel-label { font-size: 11px; color: var(--text-3); margin-top: 6px; }
.funnel-arrow {
  color: var(--text-3);
  font-size: 18px;
  line-height: 40px;
  margin: 0;
  flex-shrink: 0;
}
.funnel-pct { font-size: 10px; color: var(--success); font-family: var(--font-mono); }

/* ── Drag and Drop Upload ──────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius-sm);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.drop-zone.drag-over { animation: dropPulse 1s ease-in-out infinite; }
@keyframes dropPulse { 0%, 100% { border-color: var(--accent); } 50% { border-color: rgba(79,106,255,0.4); } }
.drop-zone svg { width: 36px; height: 36px; color: var(--text-3); margin: 0 auto 12px; }
.drop-zone p { font-size: 13px; color: var(--text-2); }
.drop-zone span { font-size: 12px; color: var(--text-3); }

/* ── Overdue Glow ──────────────────────────────────────────────────────────── */
@keyframes overdueGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.3); }
  50% { box-shadow: 0 0 10px 4px rgba(245,158,11,0.15); }
}
.overdue-row { animation: overdueGlow 2.5s ease-in-out infinite; }
.overdue-text { color: var(--danger); font-family: var(--font-mono); font-size: 12px; }

/* ── Phone + Email ─────────────────────────────────────────────────────────── */
.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  text-decoration: none;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  background: transparent;
}
.phone-link:hover { color: var(--success); background: var(--success-dim); text-decoration: none; }
.email-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.email-link:hover { color: var(--accent); background: var(--accent-dim); }

/* ── Activity Feed ─────────────────────────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  animation: rowIn 200ms ease both;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.activity-icon.lead { background: rgba(79,106,255,0.12); color: var(--accent); }
.activity-icon.client { background: var(--success-dim); color: var(--success); }
.activity-icon.payment { background: rgba(168,85,247,0.12); color: #A855F7; }
.activity-icon.task { background: var(--warning-dim); color: var(--warning); }
.activity-icon.system { background: rgba(255,255,255,0.06); color: var(--text-3); }
.activity-desc { flex: 1; }
.activity-desc .desc-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.activity-desc .desc-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* ── Pipeline Sidebar ──────────────────────────────────────────────────────── */
.pipeline-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 120px);
}
.pipeline-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-right: 16px;
  height: fit-content;
  position: sticky;
  top: 24px;
}
.pipeline-main { flex: 1; min-width: 0; }
.pipeline-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--success);
  margin: 8px 0;
  animation: countUp 1.5s ease-out;
}
.quick-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 16px; }
.quick-add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  color: var(--text-2);
  transition: all var(--transition);
  text-align: center;
}
.quick-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.quick-add-btn svg { width: 18px; height: 18px; }
.stale-list, .closing-list { margin-top: 8px; }
.stale-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.stale-item:last-child { border-bottom: none; }
.stale-item .stale-name { color: var(--text-2); }
.stale-item .stale-days { font-family: var(--font-mono); font-size: 11px; color: var(--warning); }
.stale-item.pulse { animation: pulse-amber 2s infinite; }

/* ── Count-up Animation ────────────────────────────────────────────────────── */
@keyframes countUp { from { opacity: 0; } to { opacity: 1; } }
.count-up { animation: countUp 0.5s ease-out; }

/* ── Particle Background (Dashboard only) ──────────────────────────────────── */
#particle-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
}
.main-content { position: relative; z-index: 1; }

/* ── Login Page ────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .logo-mark {
  width: 52px; height: 52px;
  background: var(--accent-dim);
  border: 1px solid rgba(79,106,255,0.3);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}
.login-logo h1 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.login-logo p { font-size: 12px; color: var(--text-3); }
.login-error {
  background: var(--danger-dim);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 14px;
  display: none;
}
.login-error.show { display: block; }

/* ── Overdue Banner ────────────────────────────────────────────────────────── */
.overdue-payment-banner {
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.overdue-payment-banner .banner-icon { color: var(--danger); font-size: 18px; }
.overdue-payment-banner .banner-text { flex: 1; }
.overdue-payment-banner .banner-text h4 { font-size: 13px; font-weight: 700; color: var(--danger); margin-bottom: 4px; }
.overdue-payment-banner .banner-text p { font-size: 12px; color: var(--text-2); }

/* ── Gauge Chart ────────────────────────────────────────────────────────────── */
.gauge-container {
  position: relative;
  text-align: center;
}
.gauge-label {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

/* ── Onboarding Checklist ──────────────────────────────────────────────────── */
.onboard-section {
  margin-bottom: 24px;
}
.onboard-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  margin-bottom: 12px;
  font-weight: 700;
}
.onboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: all var(--transition);
}
.onboard-item:hover { border-color: var(--border-2); background: rgba(255,255,255,0.02); }
.onboard-item.done { border-color: rgba(34,197,94,0.2); background: var(--success-dim); }
.onboard-item.done .onboard-label { color: var(--text-2); text-decoration: line-through; }
.onboard-label { flex: 1; font-size: 13px; }
.onboard-notes { font-size: 11px; color: var(--text-3); }

/* ── Sections / Dividers ────────────────────────────────────────────────────── */
.section-title {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ── Inline Editable ────────────────────────────────────────────────────────── */
.editable-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color var(--transition);
  cursor: text;
}
.editable-field:hover { border-color: var(--border-2); background: rgba(255,255,255,0.02); }
.editable-field.editing { border-color: var(--accent); }
.editable-value { flex: 1; font-size: 13px; outline: none; background: transparent; color: var(--text); padding: 0; border: none; width: 100%; }
.editable-edit-btn { color: var(--text-3); opacity: 0; transition: opacity var(--transition); cursor: pointer; flex-shrink: 0; }
.editable-field:hover .editable-edit-btn { opacity: 1; }

/* ── Tags / Multi-input ─────────────────────────────────────────────────────── */
.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  min-height: 40px;
  cursor: text;
  transition: border-color var(--transition);
}
.tag-input:focus-within { border-color: var(--accent); }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--accent-dim);
  border: 1px solid rgba(79,106,255,0.2);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--accent);
}
.tag-chip .remove { cursor: pointer; color: var(--accent); opacity: 0.6; }
.tag-chip .remove:hover { opacity: 1; }
.tag-input input {
  border: none;
  background: transparent;
  padding: 2px 4px;
  font-size: 12px;
  flex: 1;
  min-width: 80px;
  width: auto;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 150;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay { display: block; }
  .main-content { margin-left: 0; }
  .hamburger { display: block; }
  .page-header { padding: 60px 20px 0; }
  .page-body { padding: 20px 20px 40px; }
  .stat-bar { grid-template-columns: 1fr 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .ai-panel-body { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
  .kanban-board { flex-direction: column; }
  .kanban-col { width: 100%; }
  .pipeline-layout { flex-direction: column; }
  .pipeline-sidebar { width: 100%; position: static; margin-right: 0; margin-bottom: 16px; }
}
@media (max-width: 600px) {
  .stat-bar { grid-template-columns: 1fr; }
  .page-title { font-size: 22px; }
}

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* ── Utility ────────────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent { color: var(--accent); }
.text-mono { font-family: var(--font-mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Misc ────────────────────────────────────────────────────────────────────── */
.copy-success { color: var(--success) !important; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
}
.list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.monospace { font-family: var(--font-mono) !important; }
.large-mono { font-family: var(--font-mono); font-size: 24px; font-weight: 700; }
.goal-bar { margin-bottom: 14px; }
.goal-bar .goal-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.goal-bar .goal-value { font-family: var(--font-mono); color: var(--text); }

/* ── Proposal Builder ────────────────────────────────────────────────────────── */
.pricing-line-item {
  display: grid;
  grid-template-columns: 1fr 80px 100px 80px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.pricing-total-row {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--success);
}

/* ── Document list ────────────────────────────────────────────────────────────── */
.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all var(--transition);
}
.doc-item:hover { border-color: var(--border-2); background: rgba(255,255,255,0.02); }
.doc-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 18px; background: rgba(255,255,255,0.04); flex-shrink: 0; }
.doc-meta { flex: 1; }
.doc-name { font-size: 13px; font-weight: 600; }
.doc-sub { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); margin-top: 2px; }
.doc-actions { display: flex; gap: 6px; }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.page-footer {
  padding: 16px 32px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
}
