/* ───────────────────────── Convoso Onboarding · Design tokens ───────────────────────── */
:root {
  /* base typography */
  --font-sans: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;

  /* light surface tokens — clean corporate */
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-sunken: #f1f3f5;
  --border: #e6e8eb;
  --border-strong: #d3d7dc;
  --text: #0b1220;
  --text-muted: #5a6473;
  --text-subtle: #8a93a0;

  /* accent — lime/electric (mood 3) */
  --accent: #84cc16;
  --accent-ink: #0a1a01;
  --accent-soft: #ecfccb;

  /* status */
  --success: #16a34a;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #2563eb;

  /* radius / shadow */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 1px rgba(15, 23, 42, .03);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, .06), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 18px 48px -12px rgba(15, 23, 42, .18), 0 8px 16px -8px rgba(15, 23, 42, .08);
  --ring: 0 0 0 3px color-mix(in oklab, var(--accent) 35%, transparent);
}

[data-theme="dark"] {
  --bg: #0a0e14;
  --surface: #11161e;
  --surface-2: #161c26;
  --surface-sunken: #0d1219;
  --border: #1f2733;
  --border-strong: #2a3340;
  --text: #e8ecf2;
  --text-muted: #98a2b0;
  --text-subtle: #6b7585;
  --accent-ink: #0a1a01;
  --accent-soft: #1f3104;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 48px -12px rgba(0, 0, 0, .55);
}

/* color theme variants */
[data-accent="lime"]   { --accent: #84cc16; --accent-soft: color-mix(in oklab, #84cc16 15%, var(--surface)); }
[data-accent="indigo"] { --accent: #6366f1; --accent-ink: #ffffff; --accent-soft: color-mix(in oklab, #6366f1 14%, var(--surface)); }
[data-accent="coral"]  { --accent: #ef6a4d; --accent-ink: #ffffff; --accent-soft: color-mix(in oklab, #ef6a4d 14%, var(--surface)); }
[data-accent="ocean"]  { --accent: #0891b2; --accent-ink: #ffffff; --accent-soft: color-mix(in oklab, #0891b2 14%, var(--surface)); }

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; }
a { color: inherit; }

/* ───────────────── App shell ───────────────── */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background: var(--bg);
}

/* sidebar */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0;
  height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--text);
  display: grid; place-items: center;
  color: var(--accent);
  font-weight: 800; font-size: 14px;
  letter-spacing: -0.04em;
}
.brand-name {
  font-weight: 700; font-size: 15px; letter-spacing: -0.02em;
}
.brand-sub {
  font-size: 11px; color: var(--text-subtle);
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-left: auto;
  font-weight: 600;
}
.nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav-group { margin-bottom: 16px; }
.nav-group-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-subtle);
  padding: 6px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin: 1px 0;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  border: none; background: transparent;
  width: 100%; text-align: left;
  position: relative;
}
.nav-item:hover { background: var(--surface-sunken); color: var(--text); }
.nav-item.active {
  background: var(--surface-sunken);
  color: var(--text); font-weight: 600;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-item .ni-icon {
  width: 18px; height: 18px; opacity: .9;
  flex-shrink: 0;
}
.nav-item .ni-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  padding: 1px 7px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
}
.nav-item .ni-dot {
  margin-left: auto; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

.sidebar-foot {
  padding: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: white;
  flex-shrink: 0;
}
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.user-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-role { font-size: 11px; color: var(--text-subtle); margin-top: 2px; }

/* topbar */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 30;
}
.topbar-search {
  flex: 1; max-width: 380px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-sunken);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 8px 12px;
  color: var(--text-subtle);
  font-size: 13px;
}
.topbar-search input {
  flex: 1; border: 0; outline: none; background: transparent;
  color: var(--text); font-size: 13px; font-family: inherit;
}
.topbar-search kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.topbar-actions {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}
.icon-btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  width: 36px; height: 36px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  color: var(--text-muted); cursor: pointer;
  position: relative;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn .pill {
  position: absolute; top: -3px; right: -3px;
  font-size: 9.5px; font-weight: 700;
  padding: 1px 5px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
  border: 2px solid var(--surface);
}

/* content */
.content {
  padding: 28px 32px 48px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* ───────────────── Common UI ───────────────── */
.btn {
  appearance: none; border: 0;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: transform .04s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(.95); }
.btn-dark { background: var(--text); color: var(--surface); }
.btn-dark:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-sunken); border-color: var(--border-strong); }
.btn-soft { background: var(--surface-sunken); color: var(--text); }
.btn-soft:hover { background: var(--border); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 20px; font-size: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-pad { padding: 20px; }
.card-pad-lg { padding: 28px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  background: var(--surface-sunken); color: var(--text-muted);
  border: 1px solid var(--border);
  letter-spacing: .005em;
  white-space: nowrap;
}
.chip-accent { background: var(--accent-soft); color: var(--text); border-color: transparent; }
.chip-success { background: color-mix(in oklab, var(--success) 14%, var(--surface)); color: var(--success); border-color: transparent; }
.chip-warn { background: color-mix(in oklab, var(--warn) 16%, var(--surface)); color: color-mix(in oklab, var(--warn) 80%, var(--text)); border-color: transparent; }
.chip-info { background: color-mix(in oklab, var(--info) 14%, var(--surface)); color: var(--info); border-color: transparent; }
.chip-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; display: inline-block;
}

.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* page header */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 24px;
}
.page-title {
  font-size: 28px; font-weight: 700; letter-spacing: -0.025em;
  margin: 0 0 4px;
  font-family: var(--font-display);
}
.page-sub {
  font-size: 14px; color: var(--text-muted); margin: 0;
}

.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-subtle);
}

/* progress ring */
.ring-wrap { position: relative; width: 56px; height: 56px; flex-shrink: 0; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 5; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.ring-label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
}

/* progress bar */
.bar { height: 6px; background: var(--surface-sunken); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .4s ease; }

/* checkbox circle */
.tick {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: grid; place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--surface);
  transition: all .15s ease;
}
.tick:hover { border-color: var(--accent); }
.tick.done {
  background: var(--accent); border-color: var(--accent);
  color: var(--accent-ink);
}
.tick.done svg { display: block; }
.tick svg { display: none; }

/* dashed slot */
.slot {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 24px;
  color: var(--text-subtle);
  background: var(--surface-sunken);
  text-align: center;
  font-size: 13px;
}

/* skeleton placeholder image */
.placeholder {
  background:
    linear-gradient(135deg, var(--surface-sunken) 25%, var(--border) 50%, var(--surface-sunken) 75%);
  background-size: 200% 200%;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: grid; place-items: center;
  color: var(--text-subtle);
  font-size: 12px;
  font-weight: 500;
}

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--text-muted);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.tbl td {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--surface-sunken); }

/* density */
[data-density="compact"] .content { padding: 18px 24px 32px; }
[data-density="compact"] .card-pad { padding: 14px; }
[data-density="compact"] .card-pad-lg { padding: 20px; }
[data-density="compact"] .page-head { margin-bottom: 16px; }
[data-density="compact"] .tbl td { padding: 9px 14px; }

/* keyframes */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.fade-up { animation: fadeUp .35s ease both; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  animation: pulse 1.6s ease-in-out infinite;
  display: inline-block;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* scrollbars */
.content { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* utility */
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.mono { font-family: var(--font-mono); }
.tnum { font-variant-numeric: tabular-nums; }
.t-display { font-family: var(--font-display); letter-spacing: -0.025em; }
