/* ============================================================
   Matrix57 · dashboard-2026.css — design override layer
   2026 dashboard canon (Mixpanel/Cloudflare/ElevenLabs tiles,
   Cosmos/Customer.io pill nav), grounded via Mobbin 07/08.
   REVERT: delete the single <link> to this file in index.html,
   or git reset --hard pre-dashboard-redesign.
   ============================================================ */

/* ---------- sticky glass masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

/* ---------- segmented pill navigation ---------- */
nav.tabs {
  position: sticky;
  top: 58px;
  z-index: 190;
  display: flex;
  gap: 6px;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar { display: none; }

.tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease-out, background 0.15s ease-out, border-color 0.15s ease-out;
}
.tab:hover { color: var(--ink); background: var(--panel-2); }
.tab.is-active {
  color: #2a1f08;
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 600;
}
.tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- status chips ---------- */
.chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 4px 10px;
  font-size: 11px;
  transition: border-color 0.15s ease-out;
}
.chip:hover { border-color: var(--gold); }

/* ---------- interactive tiles (multiview wall) ---------- */
.mv-wall { gap: 18px; padding: 18px 20px; }
.mv-tile {
  border-radius: 16px;
  border: 1px solid var(--line);
  transition: transform 0.18s ease-out, border-color 0.18s ease-out, box-shadow 0.18s ease-out;
  will-change: transform;
}
.mv-tile:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--gold) 55%, var(--line));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}
html[data-theme="light"] .mv-tile:hover { box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14); }

/* quick actions reveal on hover (2026 tile grammar) */
.mv-expand {
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
  border-radius: 10px;
}
.mv-tile:hover .mv-expand,
.mv-tile:focus-within .mv-expand { opacity: 1; transform: none; }
@media (hover: none) { .mv-expand { opacity: 1; transform: none; } }

.mv-chip { border-radius: 999px; }
.mv-bug { border-radius: 10px; }

/* ---------- unified control grammar ---------- */
.controls select,
.controls input,
.controls .btn,
.controls button {
  min-height: 36px;
  border-radius: 8px;
  transition: border-color 0.15s ease-out, background 0.15s ease-out;
}
.controls select:focus-visible,
.controls input:focus-visible,
.controls button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- content sections as cards ---------- */
.view > .controls {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 16px 20px 0;
}

/* ---------- motion discipline ---------- */
@media (prefers-reduced-motion: reduce) {
  .mv-tile, .mv-expand, .tab, .chip { transition: none !important; transform: none !important; }
}

/* ---------- 2026 control-panel grammar (Retool/Supabase/Clay canon) ---------- */
/* filters: stacked micro-label over a quiet 36px select */
.controls { align-items: flex-end; gap: 12px 14px; }
.controls label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.controls select,
.controls input[type="number"],
.controls input[type="text"] {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  transition: border-color 0.15s ease-out;
}
.controls select:hover, .controls input:hover { border-color: var(--ink-dim); }

/* buttons: quiet outline by default; hover fills */
.controls .btn, .controls button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  transition: background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
}
.controls .btn:hover, .controls button:hover { background: var(--panel-2); border-color: var(--ink-dim); }

/* ONE primary per toolbar: every view's Load action */
.controls button[id$="-load"] {
  background: var(--gold);
  border-color: var(--gold);
  color: #2a1f08;
  font-weight: 700;
}
.controls button[id$="-load"]:hover { background: var(--gold-soft); border-color: var(--gold-soft); }

/* ---------- segmented zoom cluster: one fused control, caps on the ends ---------- */
.controls .zoomctl,
.controls span:has(> .zbtn) { display: inline-flex; align-items: stretch; }
.controls .zoomctl-lbl {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  align-self: center;
  margin-right: 8px;
}
.controls .zbtn {
  border-radius: 0;
  margin-left: -1px;              /* fuse shared borders */
  min-width: 36px;
  padding: 8px 12px;
}
.controls .zbtn[data-act="out"] { border-radius: 8px 0 0 8px; margin-left: 0; }
.controls .zbtn.zreset { border-radius: 0 8px 8px 0; font-size: 11px; letter-spacing: 0.04em; }
.controls .zoomctl-pct {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  margin-left: -1px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  font-size: 12px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.controls .zbtn:hover { position: relative; z-index: 1; }   /* hover border wins the fuse */

/* ---------- column totals row (Mobbin summary canon: Fresha/Harvest) ---------- */
.matrix tfoot.mx-total td {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: var(--panel-2);
  border-top: 2px solid var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold-soft);
  padding: 7px 6px;
  text-align: center;
}
.matrix tfoot.mx-total .tlabel {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  text-align: left;
}
.matrix tfoot.mx-total .tzero { color: transparent; }   /* quiet zeros, keep rhythm */

/* meta columns shrink to content; surplus table width flows to the lanes evenly
   (fixes giant DOW/Draw in filtered views where few lanes remain) */
#number-table table.matrix .extra:not(.num-col),
#skip-table table.matrix .extra:not(.num-col) { width: 1%; }
