/* ============================================
   132 CRM — Styles
   Modern SaaS aesthetic with dark/light themes
   ============================================ */

/* --- Theme Variables --- */
:root, [data-theme="dark"] {
  --bg: #0C0E16;
  --sidebar: #131520;
  --sb-bdr: #1E2132;
  --card: #171A2A;
  --card-bdr: #1E2132;
  --text: #E6E8F0;
  --t2: #9CA0B4;
  --t3: #626680;
  --accent: #8B83FF;
  --accent-l: #635BFF;
  --accent-bg: rgba(139,131,255,.1);
  --green: #34D399;
  --green-bg: rgba(52,211,153,.1);
  --orange: #FBBF24;
  --orange-bg: rgba(251,191,36,.1);
  --red: #F87171;
  --red-bg: rgba(248,113,113,.1);
  --blue: #60A5FA;
  --blue-bg: rgba(96,165,250,.1);
  --pink: #F472B6;
  --pink-bg: rgba(244,114,182,.1);
  --cyan: #22D3EE;
  --cyan-bg: rgba(34,211,238,.1);
  --inp: #1E2132;
  --shd: 0 1px 3px rgba(0,0,0,.3);
  --shd-lg: 0 4px 14px rgba(0,0,0,.35);
  --radius: 14px;
  --radius-sm: 9px;
}

[data-theme="light"] {
  --bg: #F4F5F9;
  --sidebar: #FFF;
  --sb-bdr: #E6E8EF;
  --card: #FFF;
  --card-bdr: #E6E8EF;
  --text: #181B25;
  --t2: #6B7085;
  --t3: #9CA0B2;
  --accent: #635BFF;
  --accent-l: #8B83FF;
  --accent-bg: rgba(99,91,255,.07);
  --green: #0CAF60;
  --green-bg: rgba(12,175,96,.08);
  --orange: #F5A623;
  --orange-bg: rgba(245,166,35,.08);
  --red: #EF4444;
  --red-bg: rgba(239,68,68,.08);
  --blue: #3B82F6;
  --blue-bg: rgba(59,130,246,.08);
  --pink: #EC4899;
  --pink-bg: rgba(236,72,153,.08);
  --cyan: #06B6D4;
  --cyan-bg: rgba(6,182,212,.08);
  --inp: #F0F1F6;
  --shd: 0 1px 3px rgba(0,0,0,.05);
  --shd-lg: 0 4px 14px rgba(0,0,0,.07);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: background .3s, color .3s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .85; }
input, select, textarea, button { font-family: inherit; }

/* --- App Shell --- */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
  width: 224px;
  background: var(--sidebar);
  border-right: 1px solid var(--sb-bdr);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width .25s;
  overflow: hidden;
}
.sidebar.collapsed { width: 62px; }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .theme-label { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 9px 0; }
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 16px 12px; }
.sidebar.collapsed .theme-toggle { justify-content: center; }

.sidebar-logo {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--sb-bdr);
  min-height: 58px;
  cursor: pointer;
  user-select: none;
}
.logo-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  display: flex; align-items: center; justify-content: center;
  color: #FFF; font-size: 12px; font-weight: 800;
  flex-shrink: 0;
}
.logo-icon.lg { width: 48px; height: 48px; font-size: 16px; border-radius: 12px; }
.logo-name { font-size: 15px; font-weight: 700; color: var(--text); display: block; letter-spacing: -.02em; }
.logo-sub { font-size: 9.5px; color: var(--t3); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; display: block; }

.sidebar-nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; margin-bottom: 1px;
  color: var(--t2); font-weight: 500; font-size: 13px;
  transition: all .15s; cursor: pointer;
}
.nav-item:hover { background: var(--accent-bg); color: var(--accent); }
.nav-item.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.nav-item svg { flex-shrink: 0; }

.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--sb-bdr);
}
.theme-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px;
  background: var(--inp); color: var(--t2);
  border: none; cursor: pointer; width: 100%;
  font-size: 12px; font-weight: 500;
}
.theme-toggle:hover { opacity: .85; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* --- Main Area --- */
.main-area {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

/* --- Topbar --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--sb-bdr);
  background: var(--sidebar);
  min-height: 58px;
}
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--inp); border-radius: var(--radius-sm);
  padding: 7px 12px; width: 280px;
  border: 1px solid var(--card-bdr);
  color: var(--t3);
}
.topbar-search input {
  border: none; background: none; outline: none;
  color: var(--text); font-size: 12px; width: 100%;
}
.topbar-search input::placeholder { color: var(--t3); }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.topbar-btn {
  background: none; border: none; cursor: pointer; color: var(--t2);
  position: relative; padding: 4px;
}
.notification-dot {
  position: absolute; top: 0; right: 0;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
}
.topbar-divider { width: 1px; height: 24px; background: var(--card-bdr); }
.topbar-user { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  display: flex; align-items: center; justify-content: center;
  color: #FFF; font-size: 11px; font-weight: 700;
}
.user-avatar.sm { width: 32px; height: 32px; }
.user-name { font-size: 12px; font-weight: 500; color: var(--t2); }
.logout-link { color: var(--t3); display: flex; padding: 4px; }
.logout-link:hover { color: var(--red); }

/* --- Content --- */
.content { flex: 1; overflow-y: auto; padding: 24px; }

/* --- Page Header --- */
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.page-title { font-size: 24px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--t2); margin-top: 3px; }

/* --- Cards --- */
.card {
  background: var(--card);
  border: 1px solid var(--card-bdr);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shd);
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.card-header h3 { font-size: 14px; font-weight: 600; color: var(--text); }

/* --- Stats --- */
.stats-grid {
  display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--card-bdr);
  border-radius: var(--radius);
  padding: 18px 20px;
  flex: 1; min-width: 155;
  box-shadow: var(--shd);
  position: relative;
}
.stat-icon {
  position: absolute; top: 10px; right: 14px;
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon.accent { background: var(--accent-bg); color: var(--accent); }
.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.blue { background: var(--blue-bg); color: var(--blue); }
.stat-icon.cyan { background: var(--cyan-bg); color: var(--cyan); }
.stat-icon.orange { background: var(--orange-bg); color: var(--orange); }
.stat-icon.red { background: var(--red-bg); color: var(--red); }
.stat-label { font-size: 12px; color: var(--t2); margin-bottom: 6px; font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.stat-note { font-size: 11px; color: var(--t3); margin-top: 4px; }

/* --- Grids --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 20px; }

/* --- Tags --- */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .03em;
}
.tag-accent { background: var(--accent-bg); color: var(--accent); }
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-orange { background: var(--orange-bg); color: var(--orange); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-blue { background: var(--blue-bg); color: var(--blue); }
.tag-pink { background: var(--pink-bg); color: var(--pink); }
.tag-cyan { background: var(--cyan-bg); color: var(--cyan); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all .15s;
}
.btn:hover { opacity: .9; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  color: #FFF; box-shadow: 0 4px 12px rgba(99,91,255,.3);
}
.btn-secondary {
  background: var(--inp); color: var(--text);
  border: 1px solid var(--card-bdr);
}
.btn-accent {
  background: var(--accent-bg); color: var(--accent);
}
.btn-sm { padding: 5px 10px; font-size: 11px; border-radius: 7px; }
.btn-full { width: 100%; justify-content: center; }

/* --- Forms --- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 500; color: var(--t2);
  margin-bottom: 6px;
}
.form-link { font-size: 12px; color: var(--accent); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px;
  background: var(--inp); border: 1px solid var(--card-bdr);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 13px; outline: none;
  transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--accent);
}
.form-group input::placeholder { color: var(--t3); }
.checkbox-group { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.checkbox-label input { width: auto; }

/* --- Alerts --- */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; margin-bottom: 16px;
}
.alert-error { background: var(--red-bg); color: var(--red); }
.alert-success { background: var(--green-bg); color: var(--green); }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 10.5px; font-weight: 600;
  color: var(--t3); text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 12px; border-bottom: 1px solid var(--card-bdr);
}
.table td {
  padding: 10px 12px; border-bottom: 1px solid var(--card-bdr);
  font-size: 13px; color: var(--text);
}
.table tr:last-child td { border-bottom: none; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.cell-primary { font-size: 13px; font-weight: 500; color: var(--text); }
.cell-secondary { font-size: 12px; color: var(--t3); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.green { background: var(--green); }
.status-dot.gray { background: var(--t3); }

/* --- Territory List --- */
.territory-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-bdr);
}
.territory-row:last-child { border-bottom: none; }
.territory-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.territory-info { flex: 1; }

/* --- Checklist --- */
.checklist { display: flex; flex-direction: column; gap: 10px; }
.check-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--t2);
}
.check-item.done { color: var(--t3); text-decoration: line-through; }
.check-box {
  width: 18px; height: 18px; border-radius: 5px;
  border: 2px solid var(--t3); display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.check-box.checked {
  background: var(--green); border-color: var(--green); color: #FFF;
}

/* --- Profile --- */
.profile-info { display: flex; flex-direction: column; gap: 12px; }
.profile-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 10px; border-bottom: 1px solid var(--card-bdr);
}
.profile-row:last-child { border-bottom: none; padding-bottom: 0; }
.profile-label { font-size: 12px; color: var(--t3); font-weight: 500; }
.profile-value { font-size: 13px; color: var(--text); font-weight: 500; }

/* --- Modal --- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 100;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--card-bdr);
  border-radius: var(--radius); width: 480px; max-width: 90vw;
  box-shadow: var(--shd-lg);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid var(--card-bdr);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none; border: none; color: var(--t3);
  font-size: 22px; cursor: pointer; line-height: 1;
}
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--card-bdr);
}

/* --- Empty State --- */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 60vh; text-align: center;
}
.empty-icon { color: var(--t3); margin-bottom: 20px; opacity: .5; }
.empty-state h2 { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; color: var(--t2); }
.empty-sub { font-size: 12px; color: var(--t3); margin-top: 4px; }

/* --- Auth Pages --- */
.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg);
}
.auth-container { width: 100%; max-width: 420px; padding: 20px; }
.auth-card {
  background: var(--card); border: 1px solid var(--card-bdr);
  border-radius: 20px; padding: 36px 32px;
  box-shadow: var(--shd-lg);
}
.auth-logo {
  text-align: center; margin-bottom: 28px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.auth-logo h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.auth-subtitle { font-size: 13px; color: var(--t2); }
.auth-form { margin-top: 4px; }
.auth-form .btn { margin-top: 8px; }
.auth-footer {
  text-align: center; font-size: 12px; color: var(--t3);
  margin-top: 20px;
}
.back-link {
  display: block; text-align: center; margin-top: 16px;
  font-size: 13px; color: var(--t2);
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 16px; flex-wrap: wrap;
}
.filter-input, .filter-select {
  padding: 7px 12px; background: var(--inp);
  border: 1px solid var(--card-bdr); border-radius: var(--radius-sm);
  color: var(--text); font-size: 12px; outline: none;
}
.filter-input { width: 200px; }
.filter-input::placeholder { color: var(--t3); }
.filter-select { min-width: 140px; }

/* --- Clickable Rows --- */
.clickable-row { cursor: pointer; transition: background .1s; }
.clickable-row:hover { background: var(--accent-bg); }
.empty-row { text-align: center; color: var(--t3); padding: 40px 12px !important; }
.cell-link { color: var(--accent); }
.cell-link:hover { text-decoration: underline; }

/* --- Pagination --- */
.pagination { display: flex; gap: 4px; justify-content: center; padding: 16px 0; }
.page-link {
  padding: 6px 11px; border-radius: 6px; font-size: 12px; font-weight: 500;
  color: var(--t2); background: var(--inp); border: 1px solid var(--card-bdr);
}
.page-link:hover { background: var(--accent-bg); color: var(--accent); }
.page-link.active { background: var(--accent); color: #FFF; border-color: var(--accent); }

/* --- Bulk Bar --- */
.bulk-bar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--accent);
  border-radius: 12px; padding: 10px 20px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shd-lg); z-index: 50; font-size: 13px; font-weight: 500;
}

/* --- Back Crumb --- */
.back-crumb { font-size: 12px; color: var(--t3); margin-bottom: 4px; display: inline-block; }
.back-crumb:hover { color: var(--accent); }

/* --- Header Actions --- */
.header-actions { display: flex; gap: 8px; align-items: center; }

/* --- Form Row --- */
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-hint { font-size: 12px; color: var(--t3); margin-bottom: 12px; }
.form-group textarea {
  width: 100%; padding: 10px 14px;
  background: var(--inp); border: 1px solid var(--card-bdr);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 13px; outline: none; resize: vertical;
}
.form-group textarea:focus { border-color: var(--accent); }

/* --- Modal Large --- */
.modal-lg { width: 640px; max-width: 95vw; }

/* --- Detail Grid --- */
.detail-grid { display: flex; flex-direction: column; gap: 0; }
.detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--card-bdr);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--t3); font-size: 12px; font-weight: 500; min-width: 120px; }

/* --- Contact Cards --- */
.contact-list { display: flex; flex-direction: column; gap: 6px; }
.contact-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  transition: background .1s; color: var(--text);
}
.contact-card:hover { background: var(--accent-bg); }
.contact-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  display: flex; align-items: center; justify-content: center;
  color: #FFF; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.contact-avatar.sm { width: 30px; height: 30px; font-size: 10px; }
.contact-info { flex: 1; min-width: 0; }

/* --- Progress Bar --- */
.progress-bar {
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--inp); margin-top: 8px; overflow: hidden;
}
.progress-fill { height: 100%; border-radius: 3px; transition: width .3s; }
.progress-fill.green { background: var(--green); }
.progress-fill.orange { background: var(--orange); }
.progress-fill.red { background: var(--red); }

/* --- Timeline --- */
.timeline { display: flex; flex-direction: column; gap: 0; max-height: 500px; overflow-y: auto; }
.timeline-item {
  display: flex; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--card-bdr);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-icon { font-size: 16px; flex-shrink: 0; padding-top: 2px; }
.timeline-content { flex: 1; min-width: 0; }
.timeline-head { display: flex; justify-content: space-between; align-items: center; }
.timeline-body { font-size: 12px; color: var(--t2); margin-top: 4px; line-height: 1.5; }

/* --- Activity Tabs --- */
.activity-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.act-tab {
  padding: 6px 12px; border-radius: 7px; border: 1px solid var(--card-bdr);
  background: none; color: var(--t2); font-size: 12px; cursor: pointer;
  font-weight: 500;
}
.act-tab.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.act-tab:hover { background: var(--accent-bg); }

/* --- AI Panel --- */
.ai-panel {
  border: 1px solid rgba(124, 58, 237, .3);
  background: linear-gradient(135deg, rgba(124,58,237,.05), rgba(124,58,237,.02));
  margin-bottom: 14px;
}
.ai-panel-inline {
  background: linear-gradient(135deg, rgba(124,58,237,.08), rgba(124,58,237,.03));
  border: 1px solid rgba(124,58,237,.2);
  border-radius: var(--radius-sm); padding: 14px; margin-top: 10px;
}
.ai-badge {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  background: rgba(124,58,237,.15); color: #A78BFA;
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  margin-right: 4px; vertical-align: middle;
}
.ai-section { margin-bottom: 14px; }
.ai-section h4 { font-size: 12px; color: var(--t2); font-weight: 600; margin-bottom: 6px; }
.ai-section p { font-size: 13px; color: var(--text); line-height: 1.5; }
.ai-section ul { list-style: disc; padding-left: 18px; font-size: 13px; color: var(--text); }
.ai-section li { margin-bottom: 4px; line-height: 1.4; }
.ai-warn { background: var(--orange-bg); border-radius: 8px; padding: 10px 14px; }
.btn-inline {
  background: none; border: none; color: #A78BFA; font-size: 11px;
  cursor: pointer; font-weight: 600; padding: 0; margin-left: 8px;
}
.btn-inline:hover { text-decoration: underline; }

/* --- Loading Dots --- */
.loading-dots { color: var(--t2); font-size: 13px; padding: 12px 0; }
.loading-dots span { animation: blink 1.4s infinite both; }
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100%{opacity:0}40%{opacity:1} }

/* --- Task List --- */
.task-list { display: flex; flex-direction: column; gap: 6px; }
.task-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--card-bdr);
  font-size: 13px;
}
.task-row:last-child { border-bottom: none; }

/* --- Stat Value Small --- */
.stat-value-sm { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-all; }

/* --- Empty Text --- */
.empty-text { font-size: 13px; color: var(--t3); text-align: center; padding: 20px 0; }

/* --- Import Summary --- */
.import-summary { font-size: 13px; color: var(--t2); margin-bottom: 12px; font-weight: 500; }
.text-red { color: var(--red); }

/* --- Script Cards --- */
.script-list { display: flex; flex-direction: column; gap: 6px; }
.script-card {
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--card-bdr); transition: border-color .1s;
}
.script-card:hover { border-color: var(--accent); }
.script-head { display: flex; align-items: center; gap: 8px; }
.script-preview { font-size: 11px; color: var(--t3); margin-top: 4px; line-height: 1.4; }

/* --- Cadence Steps --- */
.cadence-steps { display: flex; flex-direction: column; gap: 0; }
.step-card {
  display: flex; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--card-bdr);
}
.step-card:last-child { border-bottom: none; }
.step-number {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #FFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.step-content { flex: 1; min-width: 0; }
.step-head { display: flex; align-items: center; gap: 8px; }

/* --- User Cell --- */
.user-cell { display: flex; align-items: center; gap: 8px; }

/* --- Integration Card --- */
.integration-card {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0;
}
.integration-icon { flex-shrink: 0; padding-top: 2px; }
.integration-info { flex: 1; }

/* --- Send Flow --- */
.send-flow { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.send-step { position: relative; padding-left: 48px; }
.step-badge {
  position: absolute; left: 14px; top: 18px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #FFF;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.step-badge-green { background: var(--green); }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.email-body-preview {
  white-space: pre-wrap; font-size: 13px; line-height: 1.6;
  color: var(--text); padding: 14px 0;
  border-top: 1px solid var(--card-bdr);
  margin-top: 8px; max-height: 300px; overflow-y: auto;
}
.confirm-buttons { display: flex; gap: 10px; align-items: center; }

/* --- Kanban Board --- */
.kanban-board {
  display: flex; gap: 10px; overflow-x: auto;
  padding-bottom: 16px; min-height: 400px;
}
.kanban-column {
  flex: 1; min-width: 200px; max-width: 260px;
  background: var(--inp); border-radius: var(--radius);
  padding: 10px; display: flex; flex-direction: column;
}
.kanban-header { padding: 4px 4px 10px; }
.kanban-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--text);
}
.kanban-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.kanban-dot.green { background: var(--green); }
.kanban-dot.red { background: var(--red); }
.kanban-count {
  background: var(--card-bdr); border-radius: 10px;
  padding: 0 6px; font-size: 10px; color: var(--t3);
}
.kanban-value { font-size: 11px; color: var(--t3); margin-top: 2px; }
.kanban-cards {
  flex: 1; display: flex; flex-direction: column; gap: 6px;
  min-height: 60px; transition: background .15s;
}
.kanban-cards.drag-over { background: var(--accent-bg); border-radius: 8px; }
.kanban-card {
  background: var(--card); border: 1px solid var(--card-bdr);
  border-radius: 10px; padding: 10px 12px; cursor: pointer;
  transition: border-color .1s, box-shadow .1s;
}
.kanban-card:hover { border-color: var(--accent); box-shadow: var(--shd); }
.kanban-card.dragging { opacity: 0.4; }
.kanban-card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.kanban-card-company { font-size: 11px; color: var(--t3); margin-top: 2px; }
.kanban-card-value { font-size: 13px; font-weight: 700; color: var(--green); margin-top: 4px; }
.kanban-card-products { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 3px; }
.kanban-card-footer { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10px; }

/* --- Stage Progression Bar --- */
.stage-bar { display: flex; gap: 4px; align-items: center; overflow-x: auto; }
.stage-step { flex: 1; }
.stage-btn {
  width: 100%; padding: 8px 6px; border: none;
  background: var(--inp); color: var(--t3);
  border-radius: 8px; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all .15s; text-align: center;
}
.stage-step.current .stage-btn { background: var(--accent); color: #FFF; }
.stage-step.past .stage-btn { background: var(--accent-bg); color: var(--accent); }
.stage-step.green .stage-btn { background: var(--green); color: #FFF; }
.stage-step.green.past .stage-btn { background: rgba(52,211,153,.15); color: var(--green); }
.stage-step.red .stage-btn { background: var(--red); color: #FFF; }
.stage-step.red.past .stage-btn { background: rgba(248,113,113,.15); color: var(--red); }
.stage-btn:hover { filter: brightness(1.1); }

/* --- How It Works --- */
.how-it-works { display: flex; flex-direction: column; gap: 10px; }
.hiw-step {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; line-height: 1.5; color: var(--t2);
}
.hiw-step .step-badge {
  position: static; width: 22px; height: 22px; font-size: 11px; flex-shrink: 0;
}

/* --- Resource Grid --- */
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.resource-card {
  display: flex; gap: 12px; padding: 12px; border-radius: 10px;
  border: 1px solid var(--card-bdr); color: var(--text);
  transition: border-color .1s, box-shadow .1s;
}
.resource-card:hover { border-color: var(--accent); box-shadow: var(--shd); }
.resource-icon { font-size: 24px; flex-shrink: 0; padding-top: 2px; }
.resource-info { flex: 1; min-width: 0; }
.resource-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; }

/* --- Onboarding Steps --- */
.onboarding-steps { display: flex; flex-direction: column; }
.ob-step {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--card-bdr);
}
.ob-step:last-child { border-bottom: none; }
.ob-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--inp); color: var(--t2); border: 2px solid var(--card-bdr);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.ob-step-num.done { background: var(--green); color: #FFF; border-color: var(--green); }
.ob-step-body { flex: 1; min-width: 0; }
.ob-step-head { display: flex; align-items: center; gap: 8px; }

/* --- Health Buttons --- */
.health-btn {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; opacity: 0.4; transition: all .15s;
}
.health-btn:hover { opacity: 0.8; }
.health-btn.active { opacity: 1; border-color: #FFF; transform: scale(1.15); }

/* --- License Row --- */
.license-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--card-bdr);
}
.license-row:last-child { border-bottom: none; }

/* --- View Tabs --- */
.view-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.view-tab {
  padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
  color: var(--t2); background: var(--inp); border: 1px solid var(--card-bdr);
  display: flex; align-items: center; gap: 6px;
}
.view-tab:hover { background: var(--accent-bg); }
.view-tab.active { background: var(--accent); color: #FFF; border-color: var(--accent); }
.tab-badge {
  background: rgba(255,255,255,.2); border-radius: 10px; padding: 0 6px;
  font-size: 10px; font-weight: 700;
}
.tab-badge-red { background: var(--red); color: #FFF; }

/* --- Task List Full --- */
.task-list-full { display: flex; flex-direction: column; }
.task-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--card-bdr);
}
.task-item:last-child { border-bottom: none; }
.task-item.overdue { background: rgba(248,113,113,.04); margin: 0 -16px; padding-left: 16px; padding-right: 16px; border-radius: 8px; }
.task-item.completed { opacity: 0.5; }
.task-check { flex-shrink: 0; padding-top: 2px; }
.check-btn {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--card-bdr); background: none;
  color: var(--t3); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.check-btn:hover { border-color: var(--green); color: var(--green); }
.check-btn.done { border-color: var(--green); color: var(--green); background: rgba(52,211,153,.1); }
.task-body { flex: 1; min-width: 0; }
.task-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-title { font-size: 13px; font-weight: 600; color: var(--text); }
.task-title.struck { text-decoration: line-through; color: var(--t3); }
.task-meta { display: flex; gap: 10px; align-items: center; margin-top: 3px; font-size: 11px; flex-wrap: wrap; }
.task-desc { font-size: 11px; color: var(--t3); margin-top: 3px; line-height: 1.4; }
.task-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }

/* --- Dropdown --- */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none; position: absolute; right: 0; top: 100%; margin-top: 4px;
  background: var(--card); border: 1px solid var(--card-bdr);
  border-radius: 10px; box-shadow: var(--shd-lg); z-index: 40;
  min-width: 160px; overflow: hidden;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: block; padding: 8px 14px; font-size: 12px; color: var(--text);
  white-space: nowrap;
}
.dropdown-item:hover { background: var(--accent-bg); }

/* --- Chart Wrapper --- */
.chart-wrap { position: relative; height: 250px; }

/* --- Stats 5-col --- */
.stats-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1024px) { .stats-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .stats-5 { grid-template-columns: repeat(2, 1fr); } }

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar { width: 62px; }
  .sidebar .logo-text, .sidebar .nav-item span, .sidebar .theme-label { display: none; }
  .sidebar .nav-item { justify-content: center; padding: 9px 0; }
  .sidebar .sidebar-logo { justify-content: center; padding: 16px 12px; }
  .sidebar .theme-toggle { justify-content: center; }
  .content { padding: 16px; }
  .stats-grid { flex-direction: column; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar-search { width: 160px; }
  .user-name { display: none; }
}
