/* ── The Dashboard (home P3, 2026-10-15; views/home-module.js, docs/HOME.md §3) ──
   One page per person, one column of sections in the reply's order: the shift line, the target card (the target
   bar's own card, re-scoped light here), ≤ 4 numbers, Do now. Its own --home-* tokens on #view-dashboard: it never
   reads --cc-*, so the CRM's dark sheet (crm-dark.css, which "only themes CRM surfaces") leaves it as it is — the
   Dashboard stays light by decision (the plan's "Look, phone, theme"); a hub-wide dark mode is separate work.
   No inline grids (the old page's could not be overridden by a media query).
   PHONE GUTTER: .main is padded 28 px at every width (hub-app.css: its ≤ 900 px 12 px rule is overridden by the later
   `.main { padding: 28px }`), so the Dashboard pulls itself 12 px back out on a phone → 16 px from the screen edge;
   tools/home_ui_check.php measures it on the real index.php at 360 px. .main itself is not changed here. */
#view-dashboard {
  --home-surface: #fff; --home-ink: #1f2420; --home-ink-2: #5d645f; --home-ink-3: #7a807b; --home-line: #e3dfd5;
  --home-accent: #1b3a2d; --home-red: #b42318; --home-amber: #8a5300; --home-green: #157a43; --home-grey: #59615c;
  --home-track: #ebe7de; --home-red-soft: #fdecea; --home-amber-soft: #fdf3e1; --home-green-soft: #e8f5ec;
  color-scheme: light;
  color: var(--home-ink);
  min-width: 0;
}
/* #dashboard-body is the tiles' container: 4 across when the BODY is wide enough, never by the viewport (review #17 —
   at 905 px the sidebar, .main's padding and the chat rail left four 131 px tiles and "₹18,451" broke in two). */
#view-dashboard #dashboard-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; container-type: inline-size; }
#view-dashboard #dashboard-body > * { min-width: 0; }
#view-dashboard #home-shift:empty, #view-dashboard #home-tiles:empty { display: none; }

/* the status beside Refresh (#home-status, in the shell's header: on a phone at the top of the screen, where the button is) */
#view-dashboard .home-status { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 12.5px; color: var(--home-ink-3); }
#view-dashboard .home-status:empty { display: none; }
#view-dashboard .home-status .home-failed { color: var(--home-red); }
#view-dashboard .home-btn-inline { padding: 1px 8px; font-size: 12px; }

/* the shift line */
#view-dashboard .home-shift { margin: 0; font-size: 13.5px; color: var(--home-ink-2); overflow-wrap: anywhere; }
#view-dashboard .home-head { display: none; }   /* the gate's view of the header; the shell's #dash-title / #dash-sub carry it */

/* the target card: TBAR's card (P.cardHtml), on light tokens */
#view-dashboard .home-card {
  --tb-bg: var(--home-surface); --tb-ink: var(--home-ink); --tb-ink-2: var(--home-ink-2); --tb-line: var(--home-line);
  --tb-grey: var(--home-grey); --tb-red: var(--home-red); --tb-amber: var(--home-amber); --tb-green: var(--home-green); --tb-track: var(--home-track);
  background: var(--home-surface); color: var(--home-ink); border: 1px solid var(--home-line); border-radius: 14px;
  padding: 14px 16px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere;
}
#view-dashboard .home-card[hidden] { display: none; }
#view-dashboard .home-card .tb-seg { white-space: normal; flex-wrap: wrap; }
#view-dashboard .home-card .tb-seg[data-go]:focus-visible { outline: 2px solid var(--home-accent); outline-offset: 2px; border-radius: 4px; }
/* the card's segments are real links here (review #20) — they read as the card, not as blue underlined text */
#view-dashboard .home-card a.tb-seg { color: inherit; text-decoration: none; }
#view-dashboard .home-card a.tb-seg:hover .tb-t { text-decoration: underline; }
#view-dashboard .home-card .tb-card-foot { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--home-line); }
#view-dashboard .home-card .tb-desk { color: var(--home-accent); font-weight: 700; text-decoration: none; }
#view-dashboard .home-card .tb-desk:hover { text-decoration: underline; }

/* the numbers: 2 × 2, and 4 across once the body has room for four ≥ 160 px tiles (4 × 160 + 3 × 12 ≈ 680 px) */
#view-dashboard .home-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@container (min-width: 680px) { #view-dashboard .home-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
#view-dashboard .home-tile {
  display: flex; flex-direction: column; gap: 4px; min-width: 0; box-sizing: border-box;
  background: var(--home-surface); color: var(--home-ink); border: 1px solid var(--home-line); border-radius: 12px;
  padding: 14px 16px; text-decoration: none; overflow-wrap: anywhere;
}
#view-dashboard a.home-tile:hover { border-color: var(--home-accent); }
#view-dashboard a.home-tile:focus-visible, #view-dashboard .home-row-a:focus-visible, #view-dashboard .home-btn:focus-visible { outline: 2px solid var(--home-accent); outline-offset: 2px; }
#view-dashboard .home-tile-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--home-ink-2); font-weight: 600; }
/* a figure never breaks inside itself ("₹18,4" / "51"); a text value ("11 present") may wrap at its space */
#view-dashboard .home-tile-value { font-family: 'DM Mono', monospace; font-size: 24px; font-weight: 600; line-height: 1.15; color: var(--home-ink); overflow-wrap: normal; }
#view-dashboard .home-tone-danger .home-tile-value { color: var(--home-red); }
#view-dashboard .home-tile-sub { font-size: 12.5px; color: var(--home-ink-2); }
#view-dashboard .home-tile-pace { font-size: 12px; font-weight: 700; }
#view-dashboard .home-pace-behind { color: var(--home-amber); }
#view-dashboard .home-pace-ahead { color: var(--home-green); }
#view-dashboard .home-pace-on { color: var(--home-ink-2); }
#view-dashboard .home-tile-name { font-size: 12px; color: var(--home-ink-3); }
#view-dashboard .home-tile-asof { font-size: 11px; color: var(--home-ink-3); margin-top: auto; padding-top: 4px; }
#view-dashboard .home-tile-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
#view-dashboard .home-tile-link { color: var(--home-accent); font-size: 12.5px; font-weight: 700; text-decoration: none; }
#view-dashboard .home-tile-link:hover { text-decoration: underline; }

/* buttons inside the page */
#view-dashboard .home-btn {
  border: 1px solid var(--home-line); background: var(--home-surface); color: var(--home-ink); border-radius: 8px;
  padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
#view-dashboard .home-btn:hover { border-color: var(--home-accent); }

/* Do now: one ranked list, every row a real link */
#view-dashboard .home-donow { background: var(--home-surface); border: 1px solid var(--home-line); border-radius: 12px; padding: 12px 16px 14px; }
#view-dashboard .home-h { margin: 0 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--home-ink-2); font-weight: 700; }
#view-dashboard .home-rows { list-style: none; margin: 0; padding: 0; }
#view-dashboard .home-row { border-bottom: 1px solid var(--home-line); }
#view-dashboard .home-rows .home-row:last-child { border-bottom: none; }
#view-dashboard .home-row-a {
  display: flex; flex-direction: column; gap: 2px; width: 100%; box-sizing: border-box; padding: 9px 0 9px 12px;
  border-left: 3px solid var(--home-line); color: var(--home-ink); text-decoration: none; background: none;
  border-top: 0; border-right: 0; border-bottom: 0; text-align: left; font: inherit; font-size: 13.5px; overflow-wrap: anywhere;
}
#view-dashboard button.home-row-a { cursor: pointer; }
#view-dashboard a.home-row-a:hover .home-row-label, #view-dashboard button.home-row-a:hover .home-row-label { text-decoration: underline; }
#view-dashboard .home-sev-danger .home-row-a { border-left-color: var(--home-red); }
#view-dashboard .home-sev-approve .home-row-a { border-left-color: var(--home-amber); }
#view-dashboard .home-sev-today .home-row-a { border-left-color: var(--home-green); }
#view-dashboard .home-row-label { font-weight: 600; }
#view-dashboard .home-row-name { font-size: 12.5px; color: var(--home-ink-3); }
#view-dashboard .home-more { margin-top: 10px; }
#view-dashboard .home-rows-more { margin-top: 6px; border-top: 1px dashed var(--home-line); }
#view-dashboard .home-more-note { margin: 8px 0 0; font-size: 12.5px; color: var(--home-ink-3); }
#view-dashboard .home-empty { margin: 6px 0 2px; font-size: 13.5px; color: var(--home-ink-2); }
#view-dashboard .home-clear { color: var(--home-green); font-weight: 600; }

/* the notes and the one error line */
#view-dashboard .home-note { margin: 0; font-size: 12.5px; color: var(--home-ink-3); }
#view-dashboard .home-error { margin: 0; padding: 14px 16px; background: var(--home-surface); border: 1px solid var(--home-line); border-radius: 12px; font-size: 13.5px; color: var(--home-ink); overflow-wrap: anywhere; }
#view-dashboard .home-link { color: var(--home-accent); font-weight: 700; text-decoration: none; }

/* a phone: one column, 16 px from the screen edge, nothing sideways */
@media (max-width: 900px) {
  #view-dashboard { margin-inline: -12px; }
  #view-dashboard .page-hdr { flex-wrap: wrap; }
  #view-dashboard .home-tile-value { font-size: 20px; }
}
