/* ============================================================
   components.css — KIC Mission Control reusable components
   ------------------------------------------------------------
   Loads after base.css. Every value sourced from tokens.css.
   
   Components in load order (each depends only on the ones
   above it):
     1. Sidebar
     2. Topbar / search bar / user chip
     3. Buttons (primary, outline, ghost, icon)
     4. Cards (basic, action, stat, hero)
     5. Status chips
     6. Tables
     7. Form inputs
     8. Tabs
     9. Modals + backdrop
    10. Toasts
    11. Avatar (initials in coloured circle)
    12. Misc — confidence ring, sparkbar, kbd
   ============================================================ */


/* ============================================================
   1. SIDEBAR
   Fixed left rail. 256px wide. Five items. Active state uses
   primary-container fill; inactive items are muted with hover
   to surface-variant.
   ============================================================ */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  padding: var(--space-lg) var(--space-md);
  background: var(--surface);
  border-right: 1px solid var(--outline-variant);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.sidebar__brand-mark {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #C9A84C;  /* KIC gold — overrides currentColor for the logo SVG */
  flex-shrink: 0;
}

.sidebar__brand-mark .icon {
  font-size: 36px;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.sidebar__brand-name {
  font-size: var(--font-headline-md-size);
  line-height: var(--font-headline-md-line);
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}

.sidebar__brand-sub {
  font-size: var(--font-label-caps-size);
  line-height: var(--font-label-caps-line);
  letter-spacing: var(--font-label-caps-track);
  font-weight: var(--font-label-caps-weight);
  text-transform: uppercase;
  color: var(--on-surface-variant);
  opacity: 0.6;
}

.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-unit);
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  color: var(--on-surface-variant);
  font-size: var(--font-body-base-size);
  line-height: var(--font-body-base-line);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}

.sidebar__item:hover {
  background: var(--surface-variant);
  color: var(--on-surface);
}

.sidebar__item--active {
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-weight: 700;
}

.sidebar__item--active:hover {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.sidebar__footer {
  margin-top: auto;
}


/* ============================================================
   2. TOPBAR
   Fixed top, offset to the right of the sidebar. Holds the
   page-level search, alerts, settings, help, and user chip.
   ============================================================ */

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  width: calc(100% - var(--sidebar-width));
  height: var(--topbar-height);
  padding: 0 var(--space-lg);
  background: var(--surface-container);
  border-bottom: 1px solid var(--outline-variant);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: var(--z-topbar);
}

.topbar__title {
  font-size: var(--font-headline-md-size);
  line-height: var(--font-headline-md-line);
  font-weight: 900;
  color: var(--on-surface);
  text-transform: uppercase;
  margin-right: var(--space-lg);
}

.topbar__cluster {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar__icons {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-right: var(--space-md);
  border-right: 1px solid var(--outline-variant);
}

.topbar__icon-btn {
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}

.topbar__icon-btn:hover {
  color: var(--primary);
}

/* User chip on the right */
.user-chip {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.user-chip__text {
  text-align: right;
}

.user-chip__name {
  font-size: var(--font-label-caps-size);
  line-height: var(--font-label-caps-line);
  font-weight: var(--font-label-caps-weight);
  letter-spacing: var(--font-label-caps-track);
  text-transform: uppercase;
  color: var(--on-surface);
}

.user-chip__role {
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--secondary);
}


/* ============================================================
   3. BUTTONS
   .btn is the base. Modifiers stack: .btn .btn--primary
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px var(--space-md);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--font-body-base-size);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary — vivid orange fill, dark text. The CTA. */
.btn--primary {
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-weight: 700;
}

.btn--primary:hover {
  background: #ff8a3d;  /* slight lightening of primary-container */
}

/* Outline — transparent, orange border + text on dark surfaces */
.btn--outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--outline-variant);
}

.btn--outline:hover {
  border-color: var(--primary);
  background: rgba(255, 182, 144, 0.08);
}

/* Ghost — no border. For lower-priority actions in a cluster */
.btn--ghost {
  background: transparent;
  color: var(--on-surface-variant);
}

.btn--ghost:hover {
  background: var(--surface-variant);
  color: var(--on-surface);
}

/* Destructive — for archive / delete only */
.btn--destructive {
  background: transparent;
  color: var(--error);
  border: 1px solid transparent;
}

.btn--destructive:hover {
  border-color: var(--error);
  background: rgba(255, 180, 171, 0.08);
}

/* Icon-only button */
.btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-lg);
}

/* Sizes */
.btn--sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn--lg {
  padding: 14px 20px;
  font-size: 15px;
}

/* Full-width */
.btn--block {
  width: 100%;
}

/* Sidebar-style pinned button — used for the persistent
   "+ New Deal" at the bottom of the sidebar */
.btn--pinned {
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-weight: 700;
  width: 100%;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
}


/* ============================================================
   4. CARDS
   Surface containers. Five flavours.
   ============================================================ */

/* Base card — the default container */
.card {
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
}

.card--elevated {
  background: var(--surface-container-high);
}

.card--bright {
  background: var(--surface-bright);
}

/* Action card — large clickable tile (Dashboard quick actions) */
.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
  text-align: center;
  min-height: 120px;
}

.action-card:hover {
  background: var(--surface-container-high);
  border-color: var(--outline);
}

.action-card .icon {
  color: var(--secondary);
  font-size: 28px;
}

.action-card__label {
  font-size: var(--font-body-base-size);
  font-weight: 600;
  color: var(--on-surface);
}

/* Primary action card — the orange one */
.action-card--primary {
  background: var(--primary-container);
  border-color: var(--primary-container);
  color: var(--on-primary-container);
}

.action-card--primary:hover {
  background: #ff8a3d;
  border-color: #ff8a3d;
}

.action-card--primary .icon {
  color: var(--on-primary-container);
}

.action-card--primary .action-card__label {
  color: var(--on-primary-container);
  font-weight: 700;
}

/* Stat card — number + label, occasionally with delta + bar */
.stat-card {
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.stat-card__label {
  font-size: var(--font-label-caps-size);
  letter-spacing: var(--font-label-caps-track);
  font-weight: var(--font-label-caps-weight);
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

.stat-card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
}

.stat-card__value {
  font-size: var(--font-display-lg-size);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-surface);
}

.stat-card__value--accent {
  color: var(--primary);
}

.stat-card__delta {
  font-size: var(--font-data-mono-size);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--on-surface-variant);
  white-space: nowrap;
}

.stat-card__delta--up { color: var(--tertiary); }
.stat-card__delta--down { color: var(--error); }

/* Stat-card progress bar (Dashboard) */
.stat-card__bar {
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-container-highest);
  overflow: hidden;
  margin-top: var(--space-xs);
}

.stat-card__bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--tertiary);
}

.stat-card__bar-fill--primary  { background: var(--primary-container); }
.stat-card__bar-fill--secondary { background: var(--secondary); }
.stat-card__bar-fill--good     { background: var(--tertiary); }
.stat-card__bar-fill--bad      { background: var(--error); }

/* Hero card — page-top "Good morning, David" strip */
.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  background: var(--surface-container-high);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.hero-card__title {
  font-size: var(--font-display-lg-size);
  line-height: var(--font-display-lg-line);
  letter-spacing: var(--font-display-lg-track);
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: var(--space-xs);
}

.hero-card__subtitle {
  font-size: var(--font-body-base-size);
  line-height: var(--font-body-base-line);
  color: var(--on-surface-variant);
}

.hero-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.hero-card__meta-item {
  text-align: right;
}

.hero-card__meta-label {
  font-size: var(--font-label-caps-size);
  letter-spacing: var(--font-label-caps-track);
  font-weight: var(--font-label-caps-weight);
  text-transform: uppercase;
  color: var(--on-surface-variant);
  opacity: 0.6;
}

.hero-card__meta-value {
  font-size: var(--font-data-mono-size);
  line-height: var(--font-data-mono-line);
  font-weight: var(--font-data-mono-weight);
  letter-spacing: var(--font-data-mono-track);
  font-variant-numeric: tabular-nums;
  color: var(--tertiary);
}


/* ============================================================
   5. STATUS CHIPS
   Small pill labels for deal status, follow-up state, etc.
   Each modifier defines fg/bg/border at appropriate opacity.
   ============================================================ */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-sm);
  border-radius: var(--radius-default);
  font-size: var(--font-label-caps-size);
  line-height: var(--font-label-caps-line);
  letter-spacing: 0.04em;
  font-weight: var(--font-label-caps-weight);
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}

/* Vivid orange — needs attention, due, critical */
.chip--primary {
  color: var(--primary-container);
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.30);
}

/* Sky blue — informational, in progress */
.chip--info {
  color: var(--secondary);
  background: rgba(137, 206, 255, 0.12);
  border-color: rgba(137, 206, 255, 0.30);
}

/* Emerald — positive, healthy, completed */
.chip--good {
  color: var(--tertiary);
  background: rgba(78, 222, 163, 0.12);
  border-color: rgba(78, 222, 163, 0.30);
}

/* Coral — negative, overdue, failed */
.chip--bad {
  color: var(--error);
  background: rgba(255, 180, 171, 0.12);
  border-color: rgba(255, 180, 171, 0.30);
}

/* Neutral — archived, on hold */
.chip--neutral {
  color: var(--on-surface-variant);
  background: var(--surface-variant);
  border-color: var(--outline-variant);
}

/* Solid variant — for the active stage badge in the hero of a
   deal modal (Stitch uses solid green for "DUE DILIGENCE") */
.chip--solid-good {
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
  border-color: var(--tertiary-container);
}

.chip--solid-info {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  border-color: var(--secondary-container);
}

.chip--solid-primary {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-color: var(--primary-container);
}


/* ============================================================
   6. TABLES
   Used on Inbox, Relationships > Contacts, Settings > Audit.
   Uppercase eyebrow header row; muted alternating bg in body.
   ============================================================ */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-body-base-size);
}

.table__head {
  background: var(--surface-container-low);
}

.table__head th {
  padding: 10px var(--space-md);
  font-size: var(--font-label-caps-size);
  letter-spacing: var(--font-label-caps-track);
  font-weight: var(--font-label-caps-weight);
  text-transform: uppercase;
  color: var(--on-surface-variant);
  text-align: left;
  border-bottom: 1px solid var(--outline-variant);
}

.table__row {
  transition: background var(--t-fast) var(--ease);
}

.table__row:hover {
  background: var(--surface-container-low);
  cursor: pointer;
}

.table__row td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--outline-variant);
  vertical-align: middle;
  color: var(--on-surface);
}

.table__row td:first-child {
  font-weight: 600;
}

.table__row--expanded {
  background: var(--surface-container-high);
}

.table__row--expanded td {
  border-bottom: 0;
}

/* Inline expansion row (Inbox detail) */
.table__expansion {
  background: var(--surface-container);
  border-bottom: 1px solid var(--outline-variant);
}

.table__expansion-cell {
  padding: var(--space-md) var(--space-lg);
}

/* Foot — pagination, count display */
.table__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  font-size: var(--font-label-caps-size);
  letter-spacing: var(--font-label-caps-track);
  text-transform: uppercase;
  color: var(--on-surface-variant);
}


/* ============================================================
   7. FORM INPUTS
   ============================================================ */

.input,
.textarea,
.select {
  width: 100%;
  padding: 10px var(--space-md);
  background: var(--surface);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--font-body-base-size);
  line-height: var(--font-body-base-line);
  transition: border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--on-surface-variant);
  opacity: 0.5;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 1px var(--secondary);
}

.textarea {
  min-height: 100px;
  resize: vertical;
  font-family: var(--font-body);
  line-height: 1.5;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.input-label {
  font-size: var(--font-label-caps-size);
  letter-spacing: var(--font-label-caps-track);
  font-weight: var(--font-label-caps-weight);
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

/* Search input — used in topbar and within page filters */
.input-search {
  position: relative;
}

.input-search .input {
  padding-left: 40px;
}

.input-search .icon {
  position: absolute;
  left: var(--space-sm);
  top: 50%;
  transform: translateY(-50%);
  color: var(--on-surface-variant);
  font-size: 20px;
  pointer-events: none;
}

/* Filter chip — small select-style trigger */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 12px;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  font-size: 12px;
  font-weight: 500;
  color: var(--on-surface);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}

.filter-chip:hover {
  background: var(--surface-container-high);
  border-color: var(--outline);
}

.filter-chip--active {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border-color: var(--primary-container);
}


/* ============================================================
   8. TABS
   Horizontal tab bar with active underline.
   ============================================================ */

.tabs {
  display: flex;
  gap: var(--space-lg);
  border-bottom: 1px solid var(--outline-variant);
  margin-bottom: var(--space-lg);
}

.tabs--compact {
  gap: var(--space-md);
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) 0;
  font-size: var(--font-body-base-size);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}

.tab:hover {
  color: var(--on-surface);
}

.tab--active {
  color: var(--primary-container);
  border-bottom-color: var(--primary-container);
}

/* Toggle group — segmented control style (Pipeline view switcher) */
.toggle-group {
  display: inline-flex;
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  padding: 2px;
}

.toggle-group__item {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  border-radius: var(--radius-default);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}

.toggle-group__item:hover {
  color: var(--on-surface);
}

.toggle-group__item--active {
  background: var(--primary-container);
  color: var(--on-primary-container);
}


/* ============================================================
   9. MODALS
   Backdrop + dialog. Two widths: default 640px, wide 860px.
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 20, 0.80);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal {
  position: relative;
  z-index: var(--z-modal);
  width: 100%;
  max-width: var(--modal-width);
  max-height: calc(100vh - var(--space-xl));
  background: var(--surface-container);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal--wide {
  max-width: var(--modal-width-wide);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-bottom: 1px solid var(--outline-variant);
}

.modal__title {
  font-size: var(--font-headline-md-size);
  line-height: var(--font-headline-md-line);
  font-weight: 700;
  color: var(--on-surface);
}

.modal__subtitle {
  font-size: var(--font-body-base-size);
  color: var(--on-surface-variant);
  margin-top: var(--space-xs);
}

.modal__close {
  color: var(--on-surface-variant);
  font-size: 24px;
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}

.modal__close:hover {
  color: var(--primary);
}

.modal__body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-container-low);
  border-top: 1px solid var(--outline-variant);
}


/* Bridge: index.html modal wrappers use legacy .modal-bg / .modal-bg.open
   pattern from style.css (removed in CP-S-5). Inner chrome classes
   (.modal-hd, .modal-body, .modal-ft, .close-btn) remain unstyled —
   acceptable for Phase 2 intermediate state, full modal restyle deferred. */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-bg);
  background: rgba(5, 10, 20, 0.80);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}
.modal-bg.open { display: flex; }


/* ============================================================
   10. TOASTS
   Calm rectangle in surface-container with status colour bar.
   No illustrations.
   ============================================================ */

.toast-stack {
  position: fixed;
  top: calc(var(--topbar-height) + var(--space-md));
  right: var(--space-md);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  min-width: 280px;
  max-width: 420px;
  padding: var(--space-md);
  background: var(--surface-container-high);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--secondary);
}

.toast--good { border-left-color: var(--tertiary); }
.toast--bad { border-left-color: var(--error); }
.toast--info { border-left-color: var(--secondary); }
.toast--warn { border-left-color: var(--primary-container); }

.toast__title {
  font-size: var(--font-body-base-size);
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: 2px;
}

.toast__body {
  font-size: 12px;
  color: var(--on-surface-variant);
}


/* ============================================================
   11. AVATAR
   Initials in coloured circle. Default — replaced by user
   image only if/when settings supports uploads.
   ============================================================ */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  background: var(--surface-container-highest);
  color: var(--on-surface);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  user-select: none;
}

.avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.avatar--xl { width: 56px; height: 56px; font-size: 18px; }
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }

/* Coloured initials variants — assign by hashing the name in JS */
.avatar--c1 { background: rgba(137, 206, 255, 0.20); color: var(--secondary); }
.avatar--c2 { background: rgba(78, 222, 163, 0.20); color: var(--tertiary); }
.avatar--c3 { background: rgba(255, 182, 144, 0.20); color: var(--primary); }
.avatar--c4 { background: rgba(255, 180, 171, 0.20); color: var(--error); }
.avatar--c5 { background: rgba(218, 226, 253, 0.15); color: var(--on-surface); }


/* ============================================================
   12. MISC — confidence ring, sparkbar, breadcrumbs, kbd
   ============================================================ */

/* Confidence ring (Inbox) — circular progress with % text */
.confidence-ring {
  position: relative;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--tertiary);
}

.confidence-ring__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.confidence-ring__track {
  fill: none;
  stroke: var(--surface-container-highest);
  stroke-width: 3;
}

.confidence-ring__fill {
  fill: none;
  stroke: var(--tertiary);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray var(--t-slow) var(--ease);
}

.confidence-ring--warn .confidence-ring__fill { stroke: var(--primary-container); }
.confidence-ring--bad .confidence-ring__fill { stroke: var(--error); }
.confidence-ring--warn { color: var(--primary-container); }
.confidence-ring--bad { color: var(--error); }

/* Sparkbar — tiny horizontal stack of bars used in deal cards */
.sparkbar {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.sparkbar__bar {
  width: 3px;
  background: var(--secondary);
  border-radius: 1px;
}

.sparkbar__bar--accent {
  background: var(--primary-container);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-label-caps-size);
  letter-spacing: var(--font-label-caps-track);
  font-weight: var(--font-label-caps-weight);
  text-transform: uppercase;
  color: var(--on-surface-variant);
  margin-bottom: var(--space-md);
}

.breadcrumb__item {
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}

.breadcrumb__item:hover {
  color: var(--primary);
}

.breadcrumb__sep {
  opacity: 0.5;
}

.breadcrumb__item--current {
  color: var(--on-surface);
  cursor: default;
}

/* kbd — for the ⌘K hint in the topbar search */
.kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: var(--surface-container-highest);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-default);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--on-surface-variant);
}

/* Dot indicator — connection status, badge, etc. */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--on-surface-variant);
}

.dot--good { background: var(--tertiary); }
.dot--bad  { background: var(--error); }
.dot--warn { background: var(--primary-container); }
.dot--info { background: var(--secondary); }

/* Notification badge — small number on a bell or icon */
.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Mobile menu visibility — toggled by openMobileMenu() / closeMobileMenu() */
.mobile-menu      { display: none; }
.mobile-menu.open { display: flex; }
