/* mcp.wrongtrain -- the dashboard's shell and components mapped onto the Wrong Train
   workspace system. Loaded after app.css; nothing here introduces a colour, a face or a
   shadow that the system does not define. House style: no em or en dashes in this tree. */

/* --- shell: the rail is the identity panel, the toolbar carries the tools ---------- */
.shell.shell-app { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
.sidenav { position: static; height: auto; padding: 0; border: 0; display: block; }
.nav-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-links a {
  display: flex; align-items: center; min-height: 40px; padding: 8px 12px; border: 0;
  border-radius: var(--radius-control); color: var(--ink-2); font-weight: 600; font-size: 14.5px; text-decoration: none;
  transition: color 120ms ease, background 120ms ease;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-raised); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); border: 0; }
.nav-links .nav-sep { height: 1px; margin: 8px 12px; background: var(--line-soft); }
.wordmark { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.wordmark svg { width: 18px; height: 18px; color: var(--accent); }
.nav-foot { margin-top: auto; padding: 16px 6px 0; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--ink-3); }
.nav-foot .build { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; }
.signout, .theme-toggle, .cmdk-trigger, .account-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-control); background: transparent; color: var(--ink-2);
  font-family: var(--font-ui); font-size: 13px; font-weight: 600; cursor: pointer; transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}
.signout:hover, .theme-toggle:hover, .cmdk-trigger:hover, .account-link:hover { color: var(--ink); border-color: var(--ink-3); background: var(--surface-raised); }
.signout { color: var(--ink-3); border-color: transparent; }
.account-link { text-decoration: none; }
.account-link[aria-current="page"] { color: var(--ink); border-color: var(--ink-3); }
.cmdk-trigger span { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }
main#main { max-width: var(--content-w); padding: clamp(26px, 3.4vw, 44px) var(--gutter) 88px; }
main#main > section + section { margin-top: 36px; }
.skip { position: fixed; top: 10px; left: 50%; z-index: 100; transform: translate(-50%, -160%); padding: 10px 16px; border: 0; border-radius: var(--radius-control); background: var(--btn-bg); color: var(--btn-fg); font-weight: 700; }
.skip:focus-visible { left: 50%; top: 10px; transform: translate(-50%, 0); }

/* --- filters: one quiet strip under the toolbar ------------------------------------ */
.filter-bar { gap: 12px; padding: 0 0 18px; margin-bottom: 24px; border-bottom: 1px solid var(--line-soft); }
.fb-group { border: 1px solid var(--line); border-radius: var(--radius-control); padding: 6px 10px; gap: 6px 12px; background: var(--surface); }
.fb-legend { font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-transform: none; letter-spacing: 0; }
.fb-opt { font-family: var(--font-ui); font-size: 13px; color: var(--ink-2); }
.fb-opt:has(input:checked) { color: var(--ink); font-weight: 600; }
.fb-date { font-size: 13px; }
.fb-date input[type="date"] { font-family: var(--font-mono); border-radius: 6px; }
.filter-clear { color: var(--ink-3); font-size: 13px; }

/* --- page heads and cards ----------------------------------------------------------- */
h1 { font-size: clamp(26px, 2.8vw, 32px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 14px; font-weight: 600; }
.view-head { margin-bottom: 24px; }
.card { padding: var(--pad-card); border-radius: var(--radius-card); }
.card + .card { margin-top: var(--gap-card); }
.card-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.card.keyed { border-left: 3px solid var(--accent); }

/* --- status and provenance chips: sentence case, tinted, a word always present ------- */
.chip-prov, .chip-status, .chip-status-plain {
  display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 1px 9px; border-radius: 999px;
  border: 0; background: var(--surface-raised); color: var(--ink-2); font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  letter-spacing: 0; text-transform: none; white-space: nowrap;
}
.chip-prov { font-family: var(--font-mono); font-weight: 500; font-size: 11.5px; }
.chip-status.good { color: var(--ok); background: var(--ok-soft); }
.chip-status.attention { color: var(--warn); background: var(--warn-soft); }
.chip-status.critical { color: var(--bad); background: var(--bad-soft); }
.chip-status::before { font-size: 8px; }

/* --- stat tiles and hero figures ---------------------------------------------------- */
.stat-tile .stat-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.stat-tile .stat-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-tile .stat-delta, .hero-delta { font-size: 13px; color: var(--ink-2); }
.hero-value { font-family: var(--font-ui); font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero-basis { font-size: 13px; color: var(--ink-3); }

/* --- tables ------------------------------------------------------------------------- */
table.data { font-size: 14px; }
table.data th { background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.data td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
table.data tr:hover td { background: var(--surface-raised); }
table.data th.num, table.data td.num { font-family: var(--font-mono); }

/* --- forms and buttons --------------------------------------------------------------- */
input[type="text"], input[type="password"], input[type="number"], input:not([type]), textarea, select {
  min-height: 42px; padding: 9px 12px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-control); font-family: var(--font-ui);
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid transparent; border-radius: var(--radius-control); background: var(--btn-bg); color: var(--btn-fg); font-family: var(--font-ui); font-size: 14.5px; font-weight: 600; }
.btn:hover { filter: none; background: var(--btn-bg-hover); color: var(--btn-fg); }
.btn-small { min-height: 32px; padding: 5px 11px; font-size: 13px; }

/* --- diagnostics sub-navigation: tabs ----------------------------------------------- */
.diag-subnav { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.diag-subnav a { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 2px; margin-bottom: -1px; color: var(--ink-2); font-size: 14.5px; font-weight: 500; text-decoration: none; border-bottom: 2px solid transparent; }
.diag-subnav a:hover { color: var(--ink); text-decoration: none; }
.diag-subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* --- command palette ---------------------------------------------------------------- */
.cmdk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); color: var(--ink); box-shadow: var(--shadow-lg); }
.cmdk::backdrop { background: var(--scrim); backdrop-filter: blur(6px); }
.cmdk-input { border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; background: transparent; font-size: 16px; padding: 14px 16px; min-height: 0; }
.cmdk-input:focus { box-shadow: none; }
.cmdk-foot { font-size: 11.5px; color: var(--ink-3); }

/* --- responsive ---------------------------------------------------------------------- */
@media (max-width: 900px) {
  .sidenav { display: contents; }
  .nav-links { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
  .nav-links .nav-sep, .nav-links li:nth-child(n + 6) { display: none; }
  .nav-links a { min-height: 55px; justify-content: center; padding: 8px 4px; text-align: center; border-radius: 10px; font-size: 12px; }
  .nav-links a[aria-current="page"] { color: var(--accent); }
  .nav-foot { display: none; }
  main#main { padding: 22px 14px 40px; }
  .filter-bar { margin-bottom: 18px; }
}

/* --- sign-in: the login-card is a plain form inside the system's gate panel ---------- */
body.login-page { display: block; padding: 0; }
.login-page .gate-card { max-width: 1040px; }
.login-page .gate-kicker { margin: 34px 0 14px; }
.login-card .field-input { font-size: 16px; line-height: 1.55; padding: 10px 13px; }
@media (max-width: 760px) {
  .login-page .gate-kicker { margin: 22px 0 10px; }
}
.login-card { display: block; width: auto; max-width: none; padding: 0; margin: 0; background: transparent; border: 0; box-shadow: none; }
.login-card .btn { width: 100%; margin-top: 10px; }
.login-foot { line-height: 1.5; }

/* --- sentence case everywhere: the dashboard's tracked capitals are retired ---------- */
.chip-prov, .nav-group, .fb-legend, .cmdk-list li .cmdk-cat, .eyebrow, .health-badge, .status-text,
details.why summary, .trend-table th, .sev, .chip-confidence, .finding-type { text-transform: none; letter-spacing: 0; }
.eyebrow { font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.health-badge, .sev, .chip-confidence { font-family: var(--font-ui); font-weight: 600; border-radius: 999px; }
.status-text { font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; }

/* --- the phone layout: app.css loads after the system, so its two-column grid must yield here */
@media (max-width: 900px) {
  .shell.shell-app { display: block; grid-template-columns: none; }
}

/* Archive sign-in (OIDC) on the gate: offered above the password form when
   ARCHIVE_SSO_ENABLED is on. */
.sso-block .sso-start { display: flex; justify-content: center; width: 100%; text-decoration: none; }
.sso-note { color: var(--ink-2); font-size: 13px; margin: 10px 0 0; line-height: 1.45; }
.sso-divider {
  display: flex; align-items: center; gap: 12px; margin: 22px 0 20px;
  color: var(--ink-3); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
}
.sso-divider::before, .sso-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line-soft); }
