/* ─────────── Sales CRM — base styles ─────────── */
:root {
  --accent: #2563EB;
  --accent-soft: #2563EB1a;
  --accent-line: #2563EB55;
  --accent-hue: 220;

  /* dark */
  --bg-0: #0B1220;
  --bg-1: #0F1729;
  --bg-2: #141C30;
  --bg-3: #1A2238;
  --line: rgba(255,255,255,0.06);
  --line-strong: rgba(255,255,255,0.10);
  --line-stronger: rgba(255,255,255,0.18);
  --fg-0: #F4F6FB;
  --fg-1: #D7DCE8;
  --fg-2: #98A1B6;
  --fg-3: #6B7388;
  --fg-4: #4A5168;

  --green: #16A34A;
  --green-soft: rgba(22,163,74,.14);
  --amber: #F59E0B;
  --amber-soft: rgba(245,158,11,.14);
  --red: #EF4444;
  --red-soft: rgba(239,68,68,.14);
  --violet: #8B5CF6;
  --violet-soft: rgba(139,92,246,.14);
}

.light-theme {
  --bg-0: #F6F8FC;
  --bg-1: #FFFFFF;
  --bg-2: #F4F6FB;
  --bg-3: #ECEFF6;
  --line: rgba(15,23,41,0.07);
  --line-strong: rgba(15,23,41,0.10);
  --line-stronger: rgba(15,23,41,0.18);
  --fg-0: #0B1220;
  --fg-1: #1A2238;
  --fg-2: #4A5168;
  --fg-3: #6B7388;
  --fg-4: #98A1B6;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--bg-0);
  color: var(--fg-1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  font-feature-settings: 'cv11','ss01','cv01','cv02';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.06); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.12); background-clip: content-box; border: 2px solid transparent; }
.light-theme ::-webkit-scrollbar-thumb { background: rgba(0,0,0,.10); background-clip: content-box; border: 2px solid transparent; }

/* ─────────── primitives ─────────── */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.card-2 {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.divider { height: 1px; background: var(--line); width: 100%; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--fg-1);
  font-size: 12.5px; font-weight: 500;
  cursor: default; transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-3); border-color: var(--line-stronger); color: var(--fg-0); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 88%, white); border-color: color-mix(in oklab, var(--accent) 88%, white); color: white; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--fg-0); border-color: var(--line); }
.btn-sm { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 6px; }
.btn-lg { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 28px; padding: 0; }
.btn-icon.btn-sm { width: 24px; }

.input {
  height: 28px; padding: 0 10px; border-radius: 7px;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  color: var(--fg-0); font: inherit; font-size: 12.5px;
  outline: none; transition: border-color .12s, background .12s;
}
.input:focus { border-color: var(--accent-line); background: var(--bg-1); box-shadow: 0 0 0 3px var(--accent-soft); }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px;
  border-radius: 5px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .015em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-green { background: var(--green-soft); color: #4ADE80; border-color: rgba(74,222,128,.2); }
.badge-amber { background: var(--amber-soft); color: #FBBF24; border-color: rgba(251,191,36,.22); }
.badge-red   { background: var(--red-soft);   color: #FCA5A5; border-color: rgba(252,165,165,.22); }
.badge-blue  { background: var(--accent-soft); color: color-mix(in oklab, var(--accent) 60%, white); border-color: var(--accent-line); }
.badge-violet{ background: var(--violet-soft); color: #C4B5FD; border-color: rgba(196,181,253,.22); }
.badge-mute  { background: var(--bg-2); color: var(--fg-2); border-color: var(--line-strong); }
.light-theme .badge-green { color: #166534; }
.light-theme .badge-amber { color: #92400E; }
.light-theme .badge-red   { color: #991B1B; }
.light-theme .badge-blue  { color: color-mix(in oklab, var(--accent) 50%, black); }
.light-theme .badge-violet{ color: #5B21B6; }

/* dot */
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-green { background: #22C55E; }
.dot-amber { background: #F59E0B; }
.dot-red   { background: #EF4444; }
.dot-blue  { background: var(--accent); }
.dot-mute  { background: var(--fg-3); }

/* avatar (initials) */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--bg-3); color: var(--fg-1);
  font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}
.avatar-lg { width: 36px; height: 36px; font-size: 13px; border-radius: 8px; }
.avatar-xl { width: 52px; height: 52px; font-size: 18px; border-radius: 10px; }
.avatar-round { border-radius: 50%; }

/* sparkline svg */
.spark { display: block; }

/* tag pill (filters) */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px;
  border-radius: 12px;
  background: var(--bg-2); color: var(--fg-1);
  border: 1px solid var(--line-strong);
  font-size: 11.5px; font-weight: 500;
  cursor: default;
}
.pill:hover { border-color: var(--line-stronger); background: var(--bg-3); }
.pill-active { background: var(--accent-soft); color: color-mix(in oklab, var(--accent) 60%, white); border-color: var(--accent-line); }
.light-theme .pill-active { color: color-mix(in oklab, var(--accent) 50%, black); }

/* tabs */
.tabs { display: flex; border-bottom: 1px solid var(--line); gap: 0; }
.tab { padding: 9px 14px; font-size: 12.5px; color: var(--fg-2); border-bottom: 1.5px solid transparent; cursor: default; }
.tab:hover { color: var(--fg-0); }
.tab-active { color: var(--fg-0); border-color: var(--accent); }

/* table */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.tbl th { text-align: left; font-weight: 500; color: var(--fg-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 0 10px; height: 44px; border-bottom: 1px solid var(--line); color: var(--fg-1); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(255,255,255,.02); }
.light-theme .tbl tr:hover td { background: rgba(15,23,41,.02); }

/* skeleton */
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
.skel { background: linear-gradient(90deg, var(--bg-2) 0px, var(--bg-3) 80px, var(--bg-2) 160px); background-size: 400px 100%; animation: shimmer 1.4s linear infinite; border-radius: 6px; }

/* sidebar nav item */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px;
  border-radius: 7px;
  color: var(--fg-2);
  font-size: 12.5px; font-weight: 500;
  cursor: default;
  position: relative;
}
.nav-item:hover { background: var(--bg-2); color: var(--fg-0); }
.nav-item-active { background: var(--bg-2); color: var(--fg-0); }
.nav-item-active::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--accent); }

/* command palette */
.cmdk-backdrop { position: fixed; inset: 0; background: rgba(5,8,16,.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.cmdk { width: min(640px, 92vw); background: var(--bg-1); border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; box-shadow: 0 32px 80px rgba(0,0,0,.4); }

/* deal card on kanban */
.deal-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  cursor: default;
  transition: border-color .12s, background .12s, transform .12s;
}
.deal-card:hover { border-color: var(--line-stronger); background: var(--bg-3); }
.deal-card.dragging { opacity: .4; transform: scale(.98); }
.deal-col {
  display: flex; flex-direction: column;
  min-width: 268px; width: 268px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 100%;
}
.deal-col.drag-over { border-color: var(--accent-line); background: color-mix(in oklab, var(--bg-1) 92%, var(--accent)); }

/* progress bar */
.bar { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; position: relative; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s ease; }

/* mobile bottom nav */
.bottom-nav { display: flex; justify-content: space-around; align-items: center; height: 56px; border-top: 1px solid var(--line); background: var(--bg-1); padding-bottom: env(safe-area-inset-bottom); }
.bottom-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; color: var(--fg-3); font-size: 10px; font-weight: 500; cursor: default; }
.bottom-tab-active { color: var(--accent); }

/* tweaks knob override */
.twk-panel { font-family: 'Inter', system-ui, sans-serif !important; }

/* utility */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-fg-0 { color: var(--fg-0); }
.text-fg-1 { color: var(--fg-1); }
.text-fg-2 { color: var(--fg-2); }
.text-fg-3 { color: var(--fg-3); }
.text-accent { color: var(--accent); }
.bg-bg-0 { background: var(--bg-0); }
.bg-bg-1 { background: var(--bg-1); }
.bg-bg-2 { background: var(--bg-2); }
.bg-bg-3 { background: var(--bg-3); }

/* layout */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.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; } .gap-6 { gap: 24px; }
.flex-1 { flex: 1 1 0%; min-width: 0; }
.flex-wrap { flex-wrap: wrap; }
.relative { position: relative; }
.absolute { position: absolute; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.grid { display: grid; }
.tabular { font-variant-numeric: tabular-nums; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: .06em; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-md { font-size: 13px; }
.text-lg { font-size: 15px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 22px; }
.text-3xl { font-size: 28px; }
.text-4xl { font-size: 34px; }
.text-5xl { font-size: 44px; }
.rounded { border-radius: 7px; }
.rounded-md { border-radius: 9px; }
.rounded-lg { border-radius: 12px; }
.rounded-full { border-radius: 9999px; }
.border-line { border: 1px solid var(--line); }
.border-line-strong { border: 1px solid var(--line-strong); }
.border-b { border-bottom: 1px solid var(--line); }
.border-r { border-right: 1px solid var(--line); }
.border-t { border-top: 1px solid var(--line); }
.p-1 { padding: 4px; } .p-2 { padding: 8px; } .p-3 { padding: 12px; } .p-4 { padding: 16px; } .p-5 { padding: 20px; } .p-6 { padding: 24px; }
.px-2 { padding-left: 8px; padding-right: 8px; } .px-3 { padding-left: 12px; padding-right: 12px; } .px-4 { padding-left: 16px; padding-right: 16px; } .px-5 { padding-left: 20px; padding-right: 20px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; } .py-2 { padding-top: 8px; padding-bottom: 8px; } .py-3 { padding-top: 12px; padding-bottom: 12px; } .py-4 { padding-top: 16px; padding-bottom: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.min-h-0 { min-height: 0; }

/* device frame for mobile preview */
.device-shell { display: flex; align-items: center; justify-content: center; height: 100%; background: #050811; padding: 24px; }
.light-theme .device-shell { background: #cfd6e6; }
.device {
  width: 390px; height: min(844px, calc(100vh - 48px));
  background: var(--bg-0);
  border-radius: 44px;
  border: 8px solid #11161f;
  box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 0 2px #222 inset;
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
}
.light-theme .device { box-shadow: 0 30px 80px rgba(0,0,0,.18), 0 0 0 2px #222 inset; }
.device-notch { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 120px; height: 28px; background: #0a0d14; border-radius: 0 0 18px 18px; z-index: 10; }
.device-status { display: flex; justify-content: space-between; align-items: center; padding: 14px 26px 4px; font-size: 13px; font-weight: 600; color: var(--fg-0); position: relative; z-index: 5; }

/* segmented control */
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px; gap: 2px; }
.seg-item { padding: 4px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 500; color: var(--fg-2); cursor: default; }
.seg-item-active { background: var(--bg-3); color: var(--fg-0); box-shadow: 0 1px 2px rgba(0,0,0,.15); }

/* kbd */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--fg-2);
  font: 600 10px ui-monospace, monospace;
}

/* hover lift */
.hov-lift { transition: transform .15s, border-color .15s, background .15s; }
.hov-lift:hover { transform: translateY(-1px); border-color: var(--line-stronger); }

/* swimlane scroll */
.swim { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }

/* satisfying check */
@keyframes checkpop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.check-pop { animation: checkpop .35s cubic-bezier(.5,1.5,.5,1); }
@keyframes fadeup { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.fadeup { animation: fadeup .25s ease-out both; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* greeting gradient text */
.greet-grad { background: linear-gradient(120deg, var(--fg-0) 0%, var(--fg-1) 40%, color-mix(in oklab, var(--accent) 65%, white) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* focus ring */
.focus-ring:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent); }

/* squircle company logo */
.logo-tile {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px; letter-spacing: .02em;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.2) inset, 0 0 0 1px rgba(255,255,255,.06);
}
.logo-tile-lg { width: 42px; height: 42px; font-size: 15px; border-radius: 10px; }
.logo-tile-xl { width: 56px; height: 56px; font-size: 19px; border-radius: 12px; }
