:root {
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;

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

  /* Default "normal" (White) theme variables */
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-navbar: rgba(255, 255, 255, 0.96);
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
}

/* ============================================================================
   THEME MODES: NORMAL (WHITE DEFAULT), GREY (STUDIO PEARL), DARK (OBSIDIAN)
   ============================================================================ */
.app-shell[data-theme="normal"] {
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --surface-bg: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-navbar: rgba(255, 255, 255, 0.96);
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
}

/* Premium Architectural Studio Grey (Inspired by Apple Studio & Linear Light-Grey) */
.app-shell[data-theme="grey"] {
  --bg-canvas: #eceef2;
  --bg-surface: #f8f9fb;
  --surface-bg: #f8f9fb;
  --bg-subtle: #e3e6ed;
  --bg-navbar: rgba(244, 246, 249, 0.92);
  --border-color: #d5dae3;
  --border-strong: #bcc3d0;
  --text-main: #0f172a;
  --text-secondary: #1e293b;
  --text-muted: #526074;
  --slate-50: #eff1f5;
  --slate-100: #e3e6ed;
  --slate-200: #d5dae3;
  --slate-300: #bcc3d0;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.05);
}

.app-shell[data-theme="grey"] .top-navbar {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.app-shell[data-theme="grey"] .nav-tab.active,
.app-shell[data-theme="grey"] .theme-pill-btn.active {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.app-shell[data-theme="grey"] .kanban-column {
  background: #e1e5ec;
  border-color: #cfd5e0;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.app-shell[data-theme="grey"] .kanban-col-header {
  background: #ebeef4;
  border-bottom-color: #d3d9e3;
}

.app-shell[data-theme="grey"] .lead-card {
  background: #fbfcfe;
  border-color: #d6dce6;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.05), inset 0 1px 0 #ffffff;
}

.app-shell[data-theme="grey"] .lead-card:hover {
  background: #ffffff;
  border-color: var(--amber-500);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.09);
}

.app-shell[data-theme="grey"] .custom-field-pill {
  background: #eef1f6;
  border-color: #d8dee8;
  color: #334155;
}

.app-shell[data-theme="grey"] .input-field,
.app-shell[data-theme="grey"] .select-field,
.app-shell[data-theme="grey"] .textarea-field {
  background: #ffffff;
  border-color: #cbd2df;
}

/* Luxury Obsidian Carbon Dark Theme (Inspired by Linear, Raycast & Amber Automate Dark) */
.app-shell[data-theme="dark"] {
  --bg-canvas: #090a0f;
  --bg-surface: #12141c;
  --surface-bg: #12141c;
  --bg-subtle: #181b26;
  --bg-navbar: rgba(12, 14, 20, 0.88);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-main: #f3f4f6;
  --text-secondary: #d1d5db;
  --text-muted: #8b95a5;
  --slate-50: #161923;
  --slate-100: #1c202c;
  --slate-200: rgba(255, 255, 255, 0.085);
  --slate-300: rgba(255, 255, 255, 0.14);
  --slate-400: #64748b;
  --slate-500: #8b95a5;
  --slate-600: #9ca3af;
  --slate-700: #d1d5db;
  --slate-800: #e5e7eb;
  --slate-900: #f9fafb;
  --amber-50: rgba(245, 158, 11, 0.12);
  --amber-100: rgba(245, 158, 11, 0.18);
  --amber-200: rgba(245, 158, 11, 0.3);
  --amber-700: #fbbf24;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  background-image: radial-gradient(ellipse 75% 32% at 50% -8%, rgba(245, 158, 11, 0.09), transparent 70%);
}

.app-shell[data-theme="dark"] .top-navbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.app-shell[data-theme="dark"] .nav-tabs,
.app-shell[data-theme="dark"] .theme-switcher-pills {
  background: #0d0f16;
  border-color: rgba(255, 255, 255, 0.08);
}

.app-shell[data-theme="dark"] .nav-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.app-shell[data-theme="dark"] .nav-tab.active,
.app-shell[data-theme="dark"] .theme-pill-btn.active {
  background: linear-gradient(180deg, #1e2230 0%, #171a26 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.app-shell[data-theme="dark"] .btn-primary {
  background: linear-gradient(180deg, #262b3d 0%, #1b1f2e 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.app-shell[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(180deg, #2f354b 0%, #23283b 100%);
  border-color: rgba(245, 158, 11, 0.4);
}

.app-shell[data-theme="dark"] .btn-secondary {
  background: #151822;
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, 0.1);
}

.app-shell[data-theme="dark"] .btn-secondary:hover {
  background: #1c202e;
  border-color: rgba(255, 255, 255, 0.18);
}

.app-shell[data-theme="dark"] .btn-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.app-shell[data-theme="dark"] .kanban-column {
  background: #0d0f16;
  border-color: rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.app-shell[data-theme="dark"] .kanban-col-header {
  background: #11141d;
  border-bottom-color: rgba(255, 255, 255, 0.065);
}

.app-shell[data-theme="dark"] .lead-card {
  background: linear-gradient(180deg, #171a26 0%, #141722 100%);
  border-color: rgba(255, 255, 255, 0.085);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.app-shell[data-theme="dark"] .lead-card:hover {
  background: linear-gradient(180deg, #1b1f2e 0%, #171b28 100%);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.app-shell[data-theme="dark"] .custom-field-pill {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.09);
  color: #cbd5e1;
}

.app-shell[data-theme="dark"] .deal-badge {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fbbf24;
}

.app-shell[data-theme="dark"] .priority-High {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.32);
}

.app-shell[data-theme="dark"] .priority-Medium {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.32);
}

.app-shell[data-theme="dark"] .priority-Low {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.32);
}

.app-shell[data-theme="dark"] .input-field,
.app-shell[data-theme="dark"] .select-field,
.app-shell[data-theme="dark"] .textarea-field,
.app-shell[data-theme="dark"] .admin-funnel-select {
  background: #0d0f16;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f3f4f6;
}

.app-shell[data-theme="dark"] .data-table th {
  background: #0e1018;
  color: #9ca3af;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.app-shell[data-theme="dark"] .data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.app-shell[data-theme="dark"] select option {
  background: #12141c;
  color: #f3f4f6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

.svg-icon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
}

/* ============================================================================
   1. BLACK SLEEK LOGIN SCREEN (AMBER AUTOMATE DARK AESTHETIC)
   ============================================================================ */
.login-screen {
  min-height: 100vh;
  background-color: #070709;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.05) 35%, transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.login-card {
  width: 100%;
  max-width: 475px;
  background: rgba(17, 17, 21, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(245, 158, 11, 0.12);
  backdrop-filter: blur(16px);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.amber-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #09090b;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.4);
}

.brand-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-subtitle {
  font-size: 11px;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.login-heading {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
}

.login-subtext {
  font-size: 13.5px;
  color: #a1a1aa;
  margin-bottom: 22px;
}

.google-sso-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  color: #09090b;
  border: none;
  border-radius: 11px;
  padding: 13px 18px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.google-sso-btn:hover {
  background: #f4f4f5;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.2);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: #71717a;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.09);
}

.dark-input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.dark-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 10px 13px;
  color: #ffffff;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s;
}

.dark-input:focus {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.amber-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #09090b;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.amber-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.persona-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.persona-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 9px 11px;
  color: #e4e4e7;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: all 0.15s ease;
}

.persona-btn:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.45);
}

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: #ffffff;
  flex-shrink: 0;
}

/* ============================================================================
   2. SLEEK MODERN TOP NAVIGATION BAR & THEME SWITCHER
   ============================================================================ */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-canvas);
  color: var(--text-main);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.top-navbar {
  background: var(--bg-navbar);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 24px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.workspace-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 12px;
  border-right: 1px solid var(--border-color);
}

.workspace-brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #09090b;
  color: var(--amber-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.4);
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.35);
}

.nav-tab.active {
  background: var(--bg-surface);
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.nav-tab.active .svg-icon {
  stroke: var(--amber-500);
}

.nav-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--amber-100);
  color: var(--amber-700);
  line-height: 1.3;
}

.nav-badge-alert {
  background: #fee2e2;
  color: #dc2626;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-switcher-pills {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.theme-pill-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.theme-pill-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.admin-funnel-switcher {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 4px 6px 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.admin-funnel-switcher label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.admin-funnel-select {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 5px;
  border-radius: 99px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-size: 12px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.main-container {
  flex: 1;
  padding: 24px 28px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================================
   3. PAGE HEADERS, KPI CARDS, BUTTONS & CONTROLS
   ============================================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: #09090b;
  color: #ffffff;
  border-color: #27272a;
}

.btn-primary:hover {
  background: #1e293b;
}

.btn-amber {
  background: var(--amber-500);
  color: #09090b;
}

.btn-amber:hover {
  background: var(--amber-400);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}

.btn-success {
  background: #10b981;
  color: #ffffff;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.icon-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.icon-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================================
   4. KANBAN PIPELINE BOARD
   ============================================================================ */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 18px;
  align-items: flex-start;
  min-height: calc(100vh - 280px);
}

.kanban-column {
  min-width: 295px;
  width: 295px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 250px);
  flex-shrink: 0;
}

.kanban-col-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stage-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

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

.stage-count {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
}

.kanban-col-body {
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}

.lead-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.lead-card:hover {
  border-color: var(--amber-500);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.lead-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.lead-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.lead-company {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.lead-custom-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.custom-field-pill {
  font-size: 11px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 11.5px;
  color: var(--text-muted);
}

.deal-badge {
  font-weight: 700;
  color: var(--text-main);
  background: var(--amber-50);
  border: 1px solid var(--amber-200);
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 12px;
}

.priority-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  display: inline-block;
}

.priority-High {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.priority-Medium {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.priority-Low {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* ============================================================================
   5. TABLES, CARDS & INPUTS
   ============================================================================ */
.card-surface {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--bg-subtle);
}

.input-field, .select-field, .textarea-field {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-main);
  background: var(--bg-surface);
  outline: none;
}

.input-field:focus, .select-field:focus, .textarea-field:focus {
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* ============================================================================
   6. FULL-SCREEN LEAD WORKSPACE VIEW + TRACKING HISTORY
   ============================================================================ */
.lead-fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-canvas);
  color: var(--text-main);
  z-index: 95;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.lead-fullscreen-topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.lead-fullscreen-grid {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px 40px;
  display: grid;
  grid-template-columns: 360px 1fr 420px;
  gap: 22px;
  align-items: start;
}

@media (max-width: 1250px) {
  .lead-fullscreen-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.zadarma-box {
  background: linear-gradient(180deg, #09090b 0%, #18181b 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.zadarma-call-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
}

.audio-waveform-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  overflow: hidden;
  flex: 1;
}

.audio-waveform-fill {
  height: 100%;
  background: var(--amber-400);
  width: 0%;
  transition: width 0.2s linear;
}

.history-timeline {
  position: relative;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-color);
}

.history-item {
  position: relative;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 11px 13px;
}

.history-dot {
  position: absolute;
  left: -18px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber-500);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 1px var(--border-strong);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--bg-surface);
  color: var(--text-main);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #09090b;
  color: #ffffff;
  border-left: 4px solid var(--amber-500);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
}
