/* ============================================================
   Equity Research Portal — Wireframe primitives
   Clean low-fi: boxes, hatch placeholders, mono annotations,
   grayscale + a single blue accent. No real shadows/gradients.
   ============================================================ */

:root {
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --bg:      oklch(0.975 0.003 255);
  --panel:   oklch(1 0 0);
  --panel-2: oklch(0.985 0.003 255);
  --ink:     oklch(0.31 0.018 260);
  --ink-2:   oklch(0.46 0.015 260);
  --muted:   oklch(0.62 0.012 260);
  --faint:   oklch(0.75 0.008 260);
  --line:    oklch(0.88 0.006 260);
  --line-2:  oklch(0.93 0.005 260);

  --accent:      oklch(0.55 0.13 252);
  --accent-ink:  oklch(0.42 0.13 252);
  --accent-soft: oklch(0.95 0.035 252);
  --accent-line: oklch(0.80 0.07 252);

  --pos: oklch(0.58 0.10 150);
  --neg: oklch(0.58 0.13 25);
  --warn: oklch(0.70 0.11 75);

  --r: 5px;
  --hatch: repeating-linear-gradient(45deg,
            oklch(0.92 0.005 260) 0 6px,
            oklch(0.965 0.004 260) 6px 12px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ---------- direction tab bar (per-screen options) ---------- */
.dir-head {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px;
  background: oklch(0.97 0.004 260 / 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.dir-title {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.dir-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.dir-tab {
  font-family: var(--mono); font-size: 12px;
  padding: 5px 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-2);
  border-radius: 100px; cursor: pointer; white-space: nowrap;
}
.dir-tab[aria-selected="true"] {
  background: var(--accent); color: white; border-color: var(--accent);
}
.dir-note {
  margin-left: auto; font-size: 12px; color: var(--muted);
  max-width: 46ch; text-align: right;
}

.dir-panel { display: none; padding: 26px 28px 80px; }
.dir-panel.on { display: block; }

/* canvas centering for fixed-width mocks */
.canvas { max-width: 1320px; margin: 0 auto; }
.canvas.narrow { max-width: 560px; }
.canvas.mid { max-width: 920px; }

/* ---------- generic boxes ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.soft { background: var(--panel-2); }
.pad { padding: 16px; }
.pad-sm { padding: 10px 12px; }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.rule.v { width: 1px; height: auto; align-self: stretch; }

.row { display: flex; gap: 14px; }
.col { display: flex; flex-direction: column; gap: 14px; }
.between { justify-content: space-between; }
.center { align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.gap-sm { gap: 8px; }
.gap-lg { gap: 22px; }

/* ---------- type helpers ---------- */
.kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.h1 { font-size: 26px; font-weight: 650; letter-spacing: -0.01em; }
.h2 { font-size: 18px; font-weight: 620; letter-spacing: -0.005em; }
.h3 { font-size: 14px; font-weight: 620; }
.dim { color: var(--muted); }
.mono { font-family: var(--mono); }
.tnum { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.tiny { font-size: 11px; }

/* ---------- fake form fields ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12px; color: var(--ink-2); font-weight: 550; }
.input {
  height: 38px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); display: flex; align-items: center;
  padding: 0 12px; color: var(--faint); font-size: 13px;
}
.input.tall { height: 44px; }
.input.focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--ink); }

/* ---------- fake buttons / chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: var(--r);
  font-size: 13px; font-weight: 560; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); white-space: nowrap;
}
.btn.pri { background: var(--accent); border-color: var(--accent); color: white; }
.btn.block { width: 100%; }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 100px;
  border: 1px solid var(--line); background: var(--panel);
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
}
.chip.accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.chip.pos { color: var(--pos); border-color: color-mix(in oklch, var(--pos), white 55%); background: color-mix(in oklch, var(--pos), white 88%); }
.chip.neg { color: var(--neg); border-color: color-mix(in oklch, var(--neg), white 55%); background: color-mix(in oklch, var(--neg), white 88%); }

.tag { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }

/* ---------- placeholder hatch (image / logo) ---------- */
.ph {
  background-image: var(--hatch);
  border: 1px dashed var(--line);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding: 8px;
}
.ph .lbl { background: oklch(1 0 0 / 0.78); padding: 2px 7px; border-radius: 3px; }

/* ---------- chart placeholder ---------- */
.chart {
  position: relative; border: 1px solid var(--line); border-radius: var(--r);
  background:
    linear-gradient(var(--line-2) 1px, transparent 1px) 0 0 / 100% 25%,
    var(--panel);
  overflow: hidden;
}
.chart .chart-lbl {
  position: absolute; top: 8px; left: 10px;
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  background: oklch(1 0 0 / 0.7); padding: 1px 5px; border-radius: 3px;
}
.chart svg { display: block; width: 100%; height: 100%; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .ln2 { fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .band { fill: var(--accent-soft); opacity: .8; }
.chart .bar { fill: var(--accent-line); }

/* ---------- dense data table ---------- */
.wf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.wf-table th, .wf-table td {
  border-bottom: 1px solid var(--line-2);
  padding: 6px 10px; text-align: right;
  font-variant-numeric: tabular-nums; font-family: var(--mono);
}
.wf-table th { color: var(--muted); font-weight: 600; font-size: 10.5px;
  letter-spacing: .04em; text-transform: uppercase; background: var(--panel-2);
  position: sticky; top: 0; z-index: 1; }
.wf-table th:first-child, .wf-table td:first-child {
  text-align: left; font-family: var(--sans); color: var(--ink); font-weight: 500;
}
.wf-table tr:hover td { background: var(--accent-soft); }
.wf-table .grp td {
  background: var(--panel-2); font-family: var(--sans); font-weight: 650;
  font-size: 11px; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-2);
}
.wf-table.zebra tbody tr:nth-child(even) td { background: oklch(0.985 0.003 255); }
.wf-table.zebra tbody tr:hover td { background: var(--accent-soft); }

/* ---------- skeleton (loading) ---------- */
.sk { background: linear-gradient(90deg, var(--line-2), oklch(0.96 0.004 260), var(--line-2));
  background-size: 200% 100%; border-radius: 4px; height: 12px; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ---------- metric stat block ---------- */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .k { font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); }
.stat .v { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .d { font-size: 11.5px; font-family: var(--mono); }

/* ---------- annotation callouts ---------- */
.annot {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12px; color: var(--accent-ink); line-height: 1.4;
}
.annot .pin {
  flex: none; width: 18px; height: 18px; border-radius: 100px;
  background: var(--accent); color: white; font-family: var(--mono);
  font-size: 11px; display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.annot-rail { display: flex; flex-direction: column; gap: 12px; }
.note-card {
  border: 1px dashed var(--accent-line); background: var(--accent-soft);
  border-radius: var(--r); padding: 10px 12px;
}

/* numbered pin marker placed over a mock */
.mark {
  display: inline-flex; width: 17px; height: 17px; border-radius: 100px;
  background: var(--accent); color: #fff; font-family: var(--mono); font-size: 10px;
  align-items: center; justify-content: center; vertical-align: middle;
}

/* sidebar nav bits (used in shell mocks) */
.nav-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px;
  border-radius: var(--r); color: var(--ink-2); font-size: 13px; }
.nav-item .ic { width: 15px; height: 15px; border: 1.5px solid currentColor; border-radius: 3px; opacity: .55; flex: none; }
.nav-item.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-item.on .ic { opacity: 1; border-color: var(--accent); }
.nav-grp { font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint); padding: 12px 10px 4px; display:flex; justify-content:space-between; }

/* watchlist row */
.wl { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-radius: var(--r); }
.wl.on { background: var(--accent-soft); }
.wl .tk { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink); }
.wl .nm { font-size: 11px; color: var(--muted); }

/* utility */
.scaleframe { transform-origin: top left; }
.b-line { border: 1px solid var(--line); }
.dashed { border: 1px dashed var(--line) !important; }
.center-text { text-align: center; }
.fill { width: 100%; }
