/* ── Geef.Atelier Dashboard CSS ──────────────────────────────────────────────
   All layout and widget styles for the /  (Index) dashboard page.
   Uses CSS variables from atelier.css — no theme overrides here.
   Global scope only (no Blazor scoped CSS).
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Layout ──────────────────────────────────────────────────────────────── */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 32px 48px;
  max-width: 1440px;
  margin: 0 auto;
}

.dash-section {
  display: grid;
  gap: 16px;
}

.dash-3col        { grid-template-columns: repeat(3, 1fr); }
.dash-3col-bottom { grid-template-columns: repeat(3, 1fr); }
.dash-2col-gallery { grid-template-columns: repeat(2, 1fr); }

/* ── Loading / scope toggle ──────────────────────────────────────────────── */
.dash-loading {
  padding: 48px 32px;
  color: var(--ink-3);
  font-size: 14px;
}

.dash-scope-bar {
  display: flex;
  gap: 8px;
}

.scope-btn {
  padding: 6px 14px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.scope-btn:hover   { background: var(--surface-2); color: var(--ink-1); }
.scope-btn.active  {
  background: var(--hero);
  color: var(--on-hero);
  border-color: var(--hero);
  font-weight: 600;
}

/* ── Base card ───────────────────────────────────────────────────────────── */
.dash-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline-soft);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dash-card-head .card-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.card-sub {
  font-size: 11px;
  color: var(--ink-3);
}

/* ── Welcome strip ───────────────────────────────────────────────────────── */
.dash-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, color-mix(in oklch, var(--hero) 8%, var(--surface-1)), var(--surface-1));
  border: 1px solid var(--hairline-soft);
  border-radius: 12px;
  padding: 20px 28px;
  gap: 24px;
}

.dash-welcome .greet {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink-1);
}

.dash-welcome .meta {
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  gap: 20px;
}

.dash-welcome .streak { color: var(--hero); font-weight: 600; }

.admin-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-2);
}

.scope-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 3px;
}

.scope-toggle button {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.scope-toggle button.active {
  background: var(--surface-1);
  color: var(--ink-1);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* ── Ledger tiles ────────────────────────────────────────────────────────── */
.ledger {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.ledger-tile {
  background: var(--surface-1);
  border: 1px solid var(--hairline-soft);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ledger-tile .label  { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.ledger-tile .value  { font-size: 22px; font-weight: 700; color: var(--ink-1); font-variant-numeric: tabular-nums; }
.ledger-tile .suffix { font-size: 12px; color: var(--ink-2); }
.ledger-tile .count  { font-size: 12px; color: var(--ink-3); }

/* ── Press card ──────────────────────────────────────────────────────────── */
.press-card {
  min-height: 160px;
}

.press-runs { display: flex; flex-direction: column; gap: 8px; }

.press-run {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 8px;
}

.phase-rail {
  display: flex;
  gap: 4px;
}

.phase-rail .pip {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  transition: background .3s;
}

.phase-rail .pip.active { background: var(--hero); }
.phase-rail .pip.done   { background: color-mix(in oklch, var(--hero) 40%, var(--surface-3)); }

.press-meta-line {
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  gap: 10px;
}

.compact-rail { font-size: 12px; color: var(--ink-2); }

.iter-readout { font-size: 11px; color: var(--ink-3); }

.idle { color: var(--ink-3); font-size: 13px; }

.since { font-size: 11px; color: var(--ink-3); }

.pulse-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--hero);
  font-weight: 600;
}

.pulse-tag::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hero);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(1.3); }
}

/* ── Activity heatmap ────────────────────────────────────────────────────── */
.calendar-wrap {
  overflow-x: auto;
}

.heatmap {
  display: flex;
  gap: 2px;
}

.heatmap-col { display: flex; flex-direction: column; gap: 2px; }

.heatmap-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--surface-3);
  transition: background .15s;
}

.heatmap-cell.lvl-0 { background: var(--surface-3); }
.heatmap-cell.lvl-1 { background: color-mix(in oklch, var(--hero) 20%, var(--surface-3)); }
.heatmap-cell.lvl-2 { background: color-mix(in oklch, var(--hero) 40%, var(--surface-3)); }
.heatmap-cell.lvl-3 { background: color-mix(in oklch, var(--hero) 65%, var(--surface-3)); }
.heatmap-cell.lvl-4 { background: var(--hero); }

.weekdays { display: flex; flex-direction: column; gap: 2px; }
.weekdays .d { font-size: 9px; color: var(--ink-3); height: 11px; display: flex; align-items: center; }

.months { display: flex; gap: 2px; padding-left: 24px; }
.months .l { font-size: 9px; color: var(--ink-3); }

.calendar-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.calendar-legend .cell { width: 11px; height: 11px; border-radius: 2px; }

.peak { font-size: 11px; color: var(--ink-2); }

/* ── Crew DNA ────────────────────────────────────────────────────────────── */
.crew-cols  { display: flex; flex-direction: column; gap: 6px; }

.crew-entry { display: flex; align-items: center; gap: 8px; }

.crew-entry .name { flex: 1; font-size: 13px; color: var(--ink-1); }
.crew-entry .v    { font-size: 11px; color: var(--ink-2); min-width: 32px; text-align: right; }

.bar-row { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--hero); border-radius: 3px; transition: width .4s ease; }

.crew-empty { font-size: 13px; color: var(--ink-3); }

/* ── Cost Forge Sankey ───────────────────────────────────────────────────── */
.sankey {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.node {
  display: flex;
  align-items: center;
  gap: 10px;
}

.node .area {
  height: 32px;
  border-radius: 4px;
  background: color-mix(in oklch, var(--hero) 25%, var(--surface-2));
  min-width: 4px;
  transition: width .4s ease;
}

.node-label {
  display: flex;
  flex-direction: column;
}

.node-label .primary { font-size: 13px; color: var(--ink-1); font-weight: 600; }
.node-label .small   { font-size: 11px; color: var(--ink-3); }

/* ── Sweet Spot Histogram ────────────────────────────────────────────────── */
.hist { display: flex; align-items: flex-end; gap: 4px; height: 60px; }

.hist-sweet-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.hist-sweet-strip .bar {
  width: 100%;
  background: color-mix(in oklch, var(--hero) 50%, var(--surface-2));
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height .3s ease;
}

.hist-sweet-strip .x-label { font-size: 10px; color: var(--ink-3); }

.hist-verdict { font-size: 12px; color: var(--ink-2); text-align: center; margin-top: 6px; }

/* ── Manuscripts Gallery ─────────────────────────────────────────────────── */
.gallery { display: flex; flex-direction: column; gap: 8px; }

.ms-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  color: inherit;
}

.ms-card:hover { background: var(--surface-3); }

.ms-card .body  { font-size: 13px; color: var(--ink-1); }
.ms-card .meta  { font-size: 11px; color: var(--ink-3); display: flex; gap: 10px; }

/* ── Token Stream ────────────────────────────────────────────────────────── */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 40px;
}

.spark-stat { display: flex; gap: 16px; flex-wrap: wrap; }

.spark-stat .item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spark-stat .key   { font-size: 11px; color: var(--ink-3); }
.spark-stat .av    { font-size: 14px; color: var(--ink-1); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Critics Bench ───────────────────────────────────────────────────────── */
.crit-matrix { display: flex; flex-direction: column; gap: 6px; }

.reviewer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reviewer .name    { flex: 1; font-size: 13px; color: var(--ink-1); }
.reviewer .pass    { font-size: 11px; color: color-mix(in oklch, var(--hero) 80%, var(--ink-2)); }
.reviewer .fail    { font-size: 11px; color: var(--sv-critical, oklch(0.65 0.18 20)); }
.reviewer .fill    { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.reviewer .fill span { display: block; height: 100%; background: var(--hero); border-radius: 3px; }

.strictest { font-size: 11px; color: var(--ink-3); }

/* ── Provider Bench ──────────────────────────────────────────────────────── */
.providers { display: flex; flex-direction: column; gap: 6px; }

.provider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-2);
}

.provider-name { flex: 1; font-size: 13px; color: var(--ink-1); font-weight: 600; }
.provider-type { font-size: 11px; color: var(--ink-3); }
.provider-when { font-size: 11px; color: var(--ink-3); }

.global-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hero);
}

/* ── Knowledge Base ──────────────────────────────────────────────────────── */
.kb-block {
  display: flex;
  gap: 16px;
}

.kb-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kb-stat {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.kb-stat .key   { color: var(--ink-3); }
.kb-stat .value { color: var(--ink-1); font-weight: 600; }

.file {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
  padding: 3px 0;
}

/* ── Day Book ─────────────────────────────────────────────────────────────── */
.daybook { display: flex; flex-direction: column; gap: 2px; }

.dl {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px 10px;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid var(--hairline-soft);
}

.dl:last-child { border-bottom: none; }

.dl .verb  { font-size: 12px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.dl .what  { font-size: 12px; color: var(--ink-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl .when  { font-size: 11px; color: var(--ink-3); white-space: nowrap; text-align: right; }

/* ── Live update strip ───────────────────────────────────────────────────── */
.live-updates {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
  padding: 6px 0 0;
}

/* ── Misc helpers ─────────────────────────────────────────────────────────── */
.empty  { font-size: 13px; color: var(--ink-3); }
.ghost  { opacity: .4; }
.quiet  { font-size: 11px; color: var(--ink-3); }
.flush  { margin: 0; padding: 0; }
.t-mono { font-family: var(--font-mono); }

.icon-cell svg { width: 16px; height: 16px; }
.fmt-icon  { display: flex; align-items: center; gap: 4px; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .dash-3col,
  .dash-3col-bottom { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .dashboard { padding: 16px; gap: 16px; }
  .dash-3col,
  .dash-3col-bottom,
  .dash-2col-gallery { grid-template-columns: 1fr; }
  .ledger { grid-template-columns: repeat(2, 1fr); }
  .sankey { flex-direction: column; }
  .kb-block { flex-direction: column; }
}
