/* =========================================================================
   Veiss Coach — base resets & primitive utility classes
   These ship to consumers alongside the tokens. The `.v-*` classes are the
   shared vocabulary the React components and UI kits compose against.
   ========================================================================= */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface-0);
  color: var(--ink-0);
  font-family: var(--font-sans);
  font-feature-settings: var(--font-features);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { font-size: var(--text-body); line-height: 1.45; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--accent-soft); color: var(--accent-ink); }

/* Numbers + technical metadata are ALWAYS mono + tabular. */
.num, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ── Headings & text ─────────────────────────────────────────────────── */
.v-h1 { font-size: var(--text-h1); font-weight: 600; letter-spacing: var(--track-tight); margin: 0; }
.v-h2 { font-size: var(--text-h2); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.v-h3 { font-size: var(--text-h3); font-weight: 600; margin: 0; }
.v-meta  { font-size: var(--text-meta); color: var(--ink-2); }
.v-muted { color: var(--ink-2); }
.v-mute2 { color: var(--ink-3); }
.v-label {
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ── Card ────────────────────────────────────────────────────────────── */
.v-card {
  background: var(--surface-1);
  border: 1px solid var(--line-0);
  border-radius: var(--d-radius);
  box-shadow: var(--shadow-hairline);
}
.v-card.flush  { padding: 0; }
.v-card.padded { padding: var(--d-card-pad); }
.v-card.interactive {
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.v-card.interactive:hover { border-color: var(--line-2); box-shadow: var(--shadow-card); }

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

/* ── Chip / badge ────────────────────────────────────────────────────── */
.v-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
  font-feature-settings: "tnum";
}
.v-chip .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.v-chip[data-tone="neutral"] { background: var(--surface-sunk); color: var(--ink-1); border-color: var(--line-0); }
.v-chip[data-tone="good"]    { background: var(--good-soft);   color: var(--good); }
.v-chip[data-tone="warn"]    { background: var(--warn-soft);   color: var(--warn); }
.v-chip[data-tone="bad"]     { background: var(--bad-soft);    color: var(--bad); }
.v-chip[data-tone="info"]    { background: var(--info-soft);   color: var(--info); }
.v-chip[data-tone="brand"]   { background: var(--accent-soft); color: var(--accent-ink); }

.v-kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border: 1px solid var(--line-1);
  background: var(--surface-1);
  border-radius: 4px;
  color: var(--ink-2);
}

/* ── Button ──────────────────────────────────────────────────────────── */
.v-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  color: var(--ink-0);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.v-btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.v-btn.primary { background: var(--ink-0); color: #fff; border-color: var(--ink-0); }
.v-btn.primary:hover { background: var(--navy-soft); }
.v-btn.ghost { background: transparent; border-color: transparent; color: var(--ink-1); }
.v-btn.ghost:hover { background: var(--surface-sunk); }
.v-btn.brand { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.v-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Input ───────────────────────────────────────────────────────────── */
.v-input {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-1);
  border-radius: 7px;
  background: var(--surface-1);
  color: var(--ink-0);
  font: inherit;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.v-input:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(7, 16, 31, 0.06); }
.v-input::placeholder { color: var(--ink-3); }

/* ── Avatar ──────────────────────────────────────────────────────────── */
.v-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy-tint);
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
.v-avatar.lg { width: 44px; height: 44px; font-size: 14px; }
.v-avatar.xl { width: 64px; height: 64px; font-size: 18px; }

/* ── Table ───────────────────────────────────────────────────────────── */
.v-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.v-table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-0);
  background: var(--surface-2);
}
.v-table td {
  padding: 0 14px;
  height: var(--d-row-h);
  vertical-align: middle;
  border-bottom: 1px solid var(--line-0);
  color: var(--ink-1);
}
.v-table tr:last-child td { border-bottom: 0; }
.v-table tbody tr { cursor: pointer; transition: background .1s; }
.v-table tbody tr:hover { background: var(--surface-2); }

/* ── App chrome ──────────────────────────────────────────────────────── */
.v-app { min-height: 100%; background: var(--surface-0); display: flex; flex-direction: column; }
.v-topnav {
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line-0);
  background: var(--surface-1);
}
.v-topnav .brand {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-0);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.v-topnav .brand .mark {
  width: 18px; height: 18px;
  background: var(--ink-0);
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 11px;
}
.v-topnav .navlinks { display: flex; gap: 4px; margin-left: 20px; }
.v-topnav .navlinks a { padding: 6px 10px; border-radius: 6px; color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
.v-topnav .navlinks a.active { background: var(--surface-sunk); color: var(--ink-0); }
.v-topnav .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ── Menus / popovers ────────────────────────────────────────────────── */
.v-menuitem { border-radius: 7px; transition: background .1s; cursor: pointer; color: inherit; text-decoration: none; }
.v-menuitem:hover { background: var(--surface-sunk); }
.v-pop { animation: vpop .12s ease-out; }
@keyframes vpop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Scroll ──────────────────────────────────────────────────────────── */
.v-scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.v-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.v-scroll::-webkit-scrollbar-thumb { background: var(--line-1); border-radius: 999px; }

/* ── Focus ───────────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Layout helpers ──────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1 1 auto; min-width: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-spark { display: block; width: 100%; height: 28px; }
