/* ============================================================
   Graphite design system — tokens + base (Competitor Analytics)
   Sampled from the graphite pitch deck. Re-skin = swap accent only.
   ============================================================ */

:root {
  /* Ink */
  --ink:        #1a1c1e;
  --ink-muted:  #545a60;
  --ink-soft:   #6e7479;
  --ink-faint:  #9aa0a5;

  /* Lines */
  --line:       #d9dada;
  --line-soft:  #e7e8e9;

  /* Surfaces */
  --surface:        #f4f5f6;
  --surface-card:   #ffffff;
  --surface-warm:   #e5e4e1;
  --surface-deep:   #eaebec;

  /* Accent (steel-blue) */
  --accent:      #3e6e8c;
  --accent-ink:  #ffffff;
  --accent-soft: #e3ebf0;
  --accent-line: #3e6e8c;

  /* Semantic (desaturated) */
  --positive:      #3f7d58;
  --positive-soft: #e2ece6;
  --warn:          #b07a2e;
  --warn-soft:     #f1e8d8;
  --danger:        #a4453c;
  --danger-soft:   #f0e0de;

  /* fit scale extras */
  --orange:      #b9682f;
  --orange-soft: #f1e3d7;

  --radius:      10px;
  --radius-sm:   7px;
  --shadow-card: 0 1px 2px rgba(26,28,30,0.04);
  --shadow-pop:  0 8px 28px rgba(26,28,30,0.14);

  --font: "Gilroy", "Poppins", "Montserrat", system-ui, sans-serif;
  --mono: "Menlo", "JetBrains Mono", ui-monospace, monospace;

  --sidebar-w: 218px;
  --topbar-h:  56px;
  --filter-h:  52px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { height: 100%; }

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

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

/* scrollbars — quiet */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cdcfd1; border-radius: 6px; border: 2px solid var(--surface); }
::-webkit-scrollbar-thumb:hover { background: #b9bcbe; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- typographic helpers ---------- */
.tabular { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.micro {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  font-weight: 600;
}

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  font-weight: 600;
}

h1, h2, h3 { font-weight: 700; letter-spacing: -0.015em; margin: 0; }

/* ---------- generic interactive ---------- */
.lk { color: var(--accent); cursor: pointer; }
.lk:hover { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-card);
  color: var(--ink-muted);
  font-size: 12.5px; font-weight: 600;
  transition: all 120ms ease;
  white-space: nowrap;
}
.btn:hover { border-color: #c4c6c8; color: var(--ink); background: #fcfcfc; }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
}
.btn.primary:hover { background: #34607a; border-color: #34607a; color:#fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-deep); border-color: transparent; }
.btn.sm { height: 27px; padding: 0 10px; font-size: 11.5px; }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 8px;
  border-radius: 5px;
  font-size: 11px; font-weight: 600;
  background: var(--surface-deep); color: var(--ink-muted);
  white-space: nowrap;
}
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.positive { background: var(--positive-soft); color: var(--positive); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.orange { background: var(--orange-soft); color: var(--orange); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

/* fit dot/badge */
.fit {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 20px; padding: 0 6px;
  border-radius: 5px; font-size: 11px; font-weight: 700;
  font-family: var(--mono);
}

/* card */
.card {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

/* focus ring */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* table base */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  position: sticky; top: 0;
  background: var(--surface-deep);
  color: var(--ink-soft);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  user-select: none;
}
.tbl thead th.sortable { cursor: pointer; }
.tbl thead th.sortable:hover { color: var(--ink); }
.tbl thead th.num, .tbl td.num { text-align: right; }
.tbl tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.tbl tbody tr { transition: background 100ms; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: var(--surface); }

/* animations */
@keyframes drawerIn { from { transform: translateX(18px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes screenIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.screen-in { animation: screenIn 180ms ease both; }
