/*
 * home.css — Home (home.html, HOME_PLAN.md)
 * @version 1.0.4 — 2026-10-05 — (George) no blue band at the bottom: body gets the
 *   solid page background instead of the inherited animated gradient.
 * @version 1.0.3 — 2026-10-05 — (George) path cards read as clickable: a quiet
 *   labeled button pinned to each card's bottom (.hm-step-go) that fills in
 *   on card hover/focus, arrow nudges right.
 * @version 1.0.2 — 2026-10-05 — (George) page width matches the Performance Lab:
 *   max-width 1440px, 16px side padding (roleplay.html .rp-container).
 * @version 1.0.1 — 2026-10-05 — (George) the two cards under Your path stretch
 *   to the same height (bottoms aligned); content stays top-aligned.
 * @version 1.0.0 — 2026-10-04 — Initial build.
 * Masthead = the Leaderboard / Performance Lab / 1:1 Reviews navy recipe,
 * hm-prefixed. Theme: app tokens (theme.css) with light fallbacks;
 * body.dark-theme swaps them. Semantic colors (good / attention) are never
 * the accent.
 */

/* v1.0.4: solid page background (was the 1:1 Reviews animated blue
   gradient, which showed as a blue band below the app area whenever the
   page ran longer than the viewport). */
body {
    background: var(--bg-body-solid, #f8fafc);
    min-height: 100vh;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}
.app-container.active {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    min-height: 100vh;
}
body.dark-theme .app-container.active { background: var(--bg-body-solid, #0f172a); }

.hm-container {
    --hm-good: #10b981; --hm-warn: #f59e0b; --hm-bad: #ef4444;
    --hm-soft: color-mix(in srgb, var(--brand-primary, #0EA5E9) 9%, var(--bg-card, #fff));
    --hm-ink: var(--text-primary, #1e293b);
    /* Accent as TEXT / thin marks vs. as FILL — both readable in both themes
       whatever the tenant brand color is (a navy brand is unreadable as text
       on the dark surface). */
    --hm-accent-ink: color-mix(in srgb, var(--brand-primary, #0EA5E9) 82%, #000);
    --hm-accent-fill: var(--brand-primary, #0EA5E9);
    --hm-muted: var(--text-tertiary, #64748b);
    --hm-line: var(--border-primary, #e2e8f0);
    max-width: 1440px; margin: 0 auto; padding: 24px 16px 60px; box-sizing: border-box;
    display: grid; gap: 20px;
}
body.dark-theme .hm-container {
    --hm-accent-ink: color-mix(in srgb, var(--brand-primary, #0EA5E9) 30%, #bae6fd);
    --hm-accent-fill: color-mix(in srgb, var(--brand-primary, #0EA5E9) 45%, #38bdf8);
    --hm-soft: color-mix(in srgb, #38bdf8 12%, var(--bg-card, #1e293b));
}
.hm-container *, .hm-container *::before, .hm-container *::after { box-sizing: border-box; }
.hm-container button { font: inherit; cursor: pointer; }
.hm-container button:focus-visible, .hm-container a:focus-visible { outline: 3px solid var(--brand-primary, #0EA5E9); outline-offset: 2px; }
.hm-hidden { display: none !important; }

/* ── Masthead ── */
.hm-mast {
    position: relative; overflow: hidden; color: #fff;
    background: linear-gradient(118deg,
        color-mix(in srgb, var(--brand-primary, #101d4f) 58%, #000),
        var(--brand-primary, #101d4f) 58%,
        color-mix(in srgb, var(--brand-primary, #101d4f) 84%, #fff));
    border-radius: 20px;
    padding: 24px 28px;
    box-shadow: 0 14px 30px color-mix(in srgb, var(--brand-primary, #101d4f) 28%, transparent);
    display: grid; gap: 18px;
}
.hm-mast-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; }
.hm-kicker { font-size: 0.85rem; color: rgba(255,255,255,0.75); }
.hm-title { font-size: 1.75rem; font-weight: 700; margin: 2px 0 0; line-height: 1.2; text-wrap: balance; }
.hm-sub { font-size: 0.95rem; color: rgba(255,255,255,0.8); margin-top: 4px; }
.hm-switch {
    background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.28);
    border-radius: 10px; padding: 8px 14px; font-size: 0.9rem; font-weight: 600;
}
.hm-switch:hover { background: rgba(255,255,255,0.2); }
.hm-nudge-banner {
    display: flex; gap: 10px; align-items: center; font-size: 0.92rem;
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
    border-radius: 12px; padding: 10px 14px;
}

/* ── Today card ── */
.hm-today {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px; padding: 18px 20px;
    display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
}
.hm-today-body { flex: 1 1 280px; min-width: 0; }
.hm-eyebrow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: #7dd3fc; font-weight: 700; }
.hm-what { font-size: 1.3rem; font-weight: 700; margin: 3px 0 2px; overflow-wrap: anywhere; }
.hm-why { font-size: 0.92rem; color: rgba(255,255,255,0.82); }
.hm-start {
    background: #0EA5E9; color: #fff; border: 0; border-radius: 12px;
    padding: 14px 30px; font-size: 1.05rem; font-weight: 700; text-decoration: none;
    box-shadow: 0 6px 16px rgba(14,165,233,0.35); white-space: nowrap;
}
.hm-start:hover { background: #0284c7; }
.hm-chips { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.hm-chip { font-size: 0.75rem; padding: 2px 10px; border-radius: 999px; background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); }
.hm-chip.done { background: rgba(16,185,129,0.28); color: #fff; }
.hm-chip.now { background: #0EA5E9; color: #fff; }

/* ── Section heads ── */
.hm-sh { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hm-sh h2 { font-size: 1.05rem; margin: 0; color: var(--hm-ink); }
.hm-sh small { color: var(--hm-muted); font-size: 0.85rem; }
.hm-link { background: none; border: 0; padding: 0; color: var(--hm-accent-ink); font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.hm-link:hover { text-decoration: underline; }

/* ── Path strip ── */
.hm-path-wrap { display: grid; gap: 10px; }
.hm-path {
    display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
    background: var(--bg-card, #fff); border: 1px solid var(--hm-line); border-radius: 16px; overflow: visible;
}
.hm-step {
    position: relative; text-align: left; border: 0; background: transparent; color: var(--hm-ink);
    padding: 18px 20px; display: flex; flex-direction: column; gap: 4px;
    border-right: 1px solid var(--hm-line); min-width: 0; text-decoration: none;
}
.hm-step:first-child { border-radius: 16px 0 0 16px; }
.hm-step:last-child { border-right: 0; border-radius: 0 16px 16px 0; }
.hm-step:only-child { border-radius: 16px; }
.hm-step:hover { background: var(--hm-soft); }
.hm-step.here { box-shadow: inset 0 -4px 0 var(--hm-accent-fill); }
/* v1.0.3: quiet "go" button at the bottom of every path card */
.hm-step-go {
    margin-top: auto; align-self: flex-start;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px;
    font-size: 0.8rem; font-weight: 700; color: var(--hm-accent-ink);
    border: 1px solid color-mix(in srgb, var(--hm-accent-fill) 30%, transparent);
    background: transparent;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.hm-step-arrow { display: inline-block; transition: transform .15s ease; }
.hm-step > :nth-last-child(2) { margin-bottom: 10px; }   /* room above the go button */
.hm-step:hover .hm-step-go, .hm-step:focus-visible .hm-step-go {
    background: var(--hm-accent-fill); border-color: var(--hm-accent-fill); color: #fff;
}
body.dark-theme .hm-step:hover .hm-step-go, body.dark-theme .hm-step:focus-visible .hm-step-go { color: #0f172a; }
.hm-step:hover .hm-step-arrow, .hm-step:focus-visible .hm-step-arrow { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .hm-step-go, .hm-step-arrow { transition: none; } .hm-step:hover .hm-step-arrow { transform: none; } }
.hm-step-lbl { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--hm-muted); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.hm-step-num { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 0.7rem; background: var(--hm-soft); color: var(--hm-accent-ink); }
.hm-step-name { font-size: 1.05rem; font-weight: 700; }
.hm-step-stat { font-size: 0.85rem; color: var(--hm-muted); overflow-wrap: anywhere; }
.hm-pill { justify-self: start; align-self: flex-start; font-size: 0.75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; margin-top: 4px; }
.hm-pill.due  { background: color-mix(in srgb, var(--hm-accent-fill) 16%, transparent); color: var(--hm-accent-ink); }
.hm-pill.new  { background: color-mix(in srgb, var(--hm-warn) 18%, transparent); color: color-mix(in srgb, var(--hm-warn) 65%, var(--hm-ink)); }
.hm-pill.ok   { background: color-mix(in srgb, var(--hm-good) 16%, transparent); color: color-mix(in srgb, var(--hm-good) 65%, var(--hm-ink)); }
.hm-step:not(:last-child)::after {
    content: '›'; position: absolute; right: -10px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; border-radius: 50%; background: var(--bg-card, #fff);
    border: 1px solid var(--hm-line); color: var(--hm-muted); font-size: 0.85rem; line-height: 17px; text-align: center; z-index: 1;
}

/* ── Cards ── */
.hm-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: stretch; }
.hm-card {
    background: var(--bg-card, #fff); border: 1px solid var(--hm-line); border-radius: 16px;
    padding: 20px; display: grid; gap: 14px; min-width: 0; color: var(--hm-ink);
    align-content: start;
}
.hm-focus { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: var(--hm-soft); }
.hm-focus-tag { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--hm-accent-ink); font-weight: 700; }
.hm-focus b { display: block; font-size: 1rem; margin-top: 2px; }
.hm-focus p { margin: 3px 0 0; color: var(--hm-muted); font-size: 0.88rem; }
.hm-bar { height: 6px; border-radius: 3px; background: var(--hm-line); overflow: hidden; margin-top: 8px; }
.hm-bar > span { display: block; height: 100%; background: var(--hm-accent-fill); border-radius: 3px; }
.hm-note { border-left: 3px solid var(--hm-line); padding: 2px 0 2px 12px; font-size: 0.92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.hm-note-who { color: var(--hm-muted); font-size: 0.78rem; margin-top: 4px; white-space: normal; }
.hm-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.92rem; padding: 10px 0; border-bottom: 1px solid var(--hm-line); }
.hm-row:last-child { border-bottom: 0; }
.hm-row span { min-width: 0; overflow-wrap: anywhere; }
.hm-empty { color: var(--hm-muted); font-size: 0.9rem; margin: 0; }

.hm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.hm-stat { padding: 12px; border-radius: 12px; background: var(--hm-soft); min-width: 0; }
.hm-stat-k { font-size: 0.78rem; color: var(--hm-muted); }
.hm-stat-v { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hm-stat-s { font-size: 0.75rem; color: var(--hm-muted); margin-top: 2px; }
.hm-trend-head { display: flex; justify-content: space-between; gap: 8px; font-size: 0.85rem; color: var(--hm-muted); }
.hm-trend-head b { color: var(--hm-ink); font-variant-numeric: tabular-nums; }
.hm-spark { width: 100%; height: 70px; display: block; }

/* ── Manager view ── */
.hm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hm-kpi { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.hm-kpi-k { font-size: 0.78rem; color: rgba(255,255,255,0.75); }
.hm-kpi-v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hm-rep { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--hm-line); }
.hm-rep:last-child { border-bottom: 0; }
.hm-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--hm-soft); display: grid; place-items: center; font-weight: 700; font-size: 0.8rem; color: var(--hm-accent-ink); }
.hm-rep-name { font-weight: 600; font-size: 0.92rem; overflow-wrap: anywhere; }
.hm-rep-sub { font-size: 0.8rem; color: var(--hm-muted); overflow-wrap: anywhere; }
.hm-sev { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.hm-sev.high { background: var(--hm-bad); }
.hm-sev.medium { background: var(--hm-warn); }
.hm-nudge {
    border: 1px solid var(--hm-accent-ink); background: transparent; color: var(--hm-accent-ink);
    border-radius: 9px; padding: 6px 14px; font-weight: 600; font-size: 0.85rem; white-space: nowrap;
}
.hm-nudge:hover:not([disabled]) { background: var(--hm-soft); }
.hm-nudge[disabled] { border-color: var(--hm-line); color: var(--hm-muted); cursor: default; }
.hm-hbar { display: grid; grid-template-columns: minmax(0, 170px) 1fr 44px; gap: 10px; align-items: center; font-size: 0.85rem; padding: 5px 0; }
.hm-hbar > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-hbar-tr { height: 8px; background: var(--hm-soft); border-radius: 4px; overflow: hidden; }
.hm-hbar-fl { height: 100%; background: var(--hm-accent-fill); border-radius: 4px; }
.hm-hbar-fl.low { background: var(--hm-warn); }
.hm-hbar-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--hm-muted); }

/* ── Settings modal + toast ── */
.hm-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.55); display: grid; place-items: center; padding: 16px; z-index: 1000; }
.hm-modal { background: var(--bg-card, #fff); color: var(--hm-ink); border-radius: 16px; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; display: grid; gap: 14px; }
.hm-modal h3 { margin: 0; font-size: 1.1rem; }
.hm-field { display: grid; gap: 6px; font-size: 0.9rem; }
.hm-field input[type="number"], .hm-field select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border-secondary, #cbd5e1); background: var(--bg-input, #fff); color: var(--hm-ink); }
.hm-check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; }
.hm-check input { margin-top: 3px; }
.hm-check small { display: block; color: var(--hm-muted); }
.hm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.hm-btn { border-radius: 10px; padding: 9px 18px; font-weight: 600; border: 1px solid var(--hm-line); background: transparent; color: var(--hm-ink); }
.hm-btn.primary { background: var(--brand-primary, #0EA5E9); border-color: transparent; color: #fff; }
.hm-toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
    background: #0f172a; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 0.9rem;
    transition: opacity .25s, transform .25s; pointer-events: none; z-index: 1100; max-width: calc(100% - 32px);
}
.hm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 760px) {
    .hm-container { padding: 16px 16px 48px; }
    .hm-cols { grid-template-columns: 1fr; }
    .hm-path { grid-template-columns: 1fr; }
    .hm-step { border-right: 0; border-bottom: 1px solid var(--hm-line); border-radius: 0 !important; }
    .hm-step:first-child { border-radius: 16px 16px 0 0 !important; }
    .hm-step:last-child { border-bottom: 0; border-radius: 0 0 16px 16px !important; }
    .hm-step:only-child { border-radius: 16px !important; }
    .hm-step:not(:last-child)::after { display: none; }
    .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-mast { padding: 20px; }
    .hm-start { width: 100%; text-align: center; }
    .hm-hbar { grid-template-columns: minmax(0, 110px) 1fr 40px; }
}
