/* LoadTest1 owner dashboard.
   Cool flour-dusted base, deep ink, one accent (blackcurrant). One type family, tabular figures. */
:root {
    --paper: #edf0ec;
    --surface: #ffffff;
    --ink: #1f2b2a;
    --ink-2: #3a4846;
    --muted: #5f6d6a;
    --line: #d5dbd6;
    --line-soft: #e6eae6;
    --accent: #6e2a55;
    --accent-soft: #f2e6ee;
    --accent-on-dark: #e3b5d1;
    --bar-2: #9aa6a2;
    --ok: #2f6b4f;
    --warn: #9a5c0b;
    --bad: #a33a2e;

    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
    --r-sm: 4px; --r-md: 8px;

    --font: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
    --t-xs: 12px; --t-sm: 13px; --t-md: 15px; --t-lg: 18px; --t-xl: 24px; --t-xxl: 34px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    font-size: var(--t-md);
    line-height: 1.45;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: var(--t-xl); }
h2 { font-size: var(--t-lg); }
h3 { font-size: var(--t-md); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.side {
    background: var(--ink);
    color: #dfe6e3;
    padding: var(--s5) var(--s3);
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: var(--s4);
}
.brand { padding: 0 var(--s3) var(--s2); }
.brand-name { font-size: var(--t-lg); font-weight: 600; color: #fff; }
.brand-sub { font-size: var(--t-sm); color: #a9b6b2; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-title { font-size: var(--t-xs); color: #8c9a96; padding: var(--s2) var(--s3) var(--s1); }
.nav-link {
    display: flex; align-items: center; gap: var(--s3);
    padding: 7px var(--s3);
    border-radius: var(--r-sm);
    color: #dfe6e3; text-decoration: none; font-size: var(--t-sm);
    border-left: 3px solid transparent;
}
.nav-link svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:hover { background: rgba(255,255,255,.06); }
.nav-link.active { background: rgba(227,181,209,.12); color: #fff; border-left-color: var(--accent-on-dark); }
.side-foot { margin-top: auto; padding: 0 var(--s3); font-size: var(--t-xs); color: #a9b6b2; }

.main { padding: var(--s5) var(--s6) var(--s7); min-width: 0; }
.topline { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.topline p { margin: var(--s1) 0 0; color: var(--muted); font-size: var(--t-sm); max-width: 70ch; }

/* live indicator */
.live { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--t-sm); color: var(--muted); white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.live-dot.off { background: var(--warn); }
.live.flash .live-dot { animation: ping 1.2s ease-out 1; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(47,107,79,.5); } 100% { box-shadow: 0 0 0 10px rgba(47,107,79,0); } }

/* ---------- KPI band: the one bold element ---------- */
.band {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--accent);
    border-radius: var(--r-md);
    margin-bottom: var(--s5);
}
.kpi { padding: var(--s4) var(--s5); border-left: 1px solid var(--line-soft); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi-value { font-size: var(--t-xxl); font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi-label { font-size: var(--t-sm); color: var(--ink-2); margin-top: var(--s1); }
.kpi-note { font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }
.kpi.alert .kpi-value { color: var(--bad); }

/* ---------- panels and charts ---------- */
.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-bottom: var(--s5); }
.grid.two { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s4) var(--s5); min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); margin-bottom: var(--s3); }
.panel-head .sub { font-size: var(--t-xs); color: var(--muted); }
.state { color: var(--muted); font-size: var(--t-sm); padding: var(--s4) 0; }
.state.error { color: var(--bad); }

.bars { display: flex; flex-direction: column; gap: var(--s2); }
.bar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: var(--s3); font-size: var(--t-sm); }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.bar-track { height: 14px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .4s ease; }
.bar-fill.alt { background: var(--bar-2); }
.bar-value { font-variant-numeric: tabular-nums; min-width: 4ch; text-align: right; }
.axis-note { font-size: var(--t-xs); color: var(--muted); margin-top: var(--s2); }

.cols svg { width: 100%; height: 180px; display: block; }
.cols .col { fill: var(--accent); }
.cols .col.today { fill: var(--ink); }
.cols text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.cols .val { fill: var(--ink-2); }
.cols .base { stroke: var(--line); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
table.list th { text-align: left; font-weight: 600; color: var(--muted); padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.list tr:hover td { background: #f7f8f6; }
table.list .r { text-align: right; font-variant-numeric: tabular-nums; }
table.list .strong { font-weight: 600; }
.list-foot { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s3); font-size: var(--t-sm); color: var(--muted); }

.btn {
    font: inherit; font-size: var(--t-sm);
    padding: 6px var(--s4);
    border: 1px solid var(--accent); color: var(--accent); background: var(--surface);
    border-radius: var(--r-sm); cursor: pointer;
}
.btn:hover { background: var(--accent-soft); }
.btn:disabled { opacity: .5; cursor: default; }

.search { font: inherit; font-size: var(--t-sm); padding: 6px var(--s3); border: 1px solid var(--line); border-radius: var(--r-sm); min-width: 220px; background: var(--surface); color: var(--ink); }

/* status chips: shape + text, colour as a hint only */
.chip { display: inline-block; padding: 1px var(--s2); border-radius: 999px; font-size: var(--t-xs); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.chip.ok { border-color: #b7d1c3; color: var(--ok); background: #eef5f1; }
.chip.warn { border-color: #e2c79c; color: var(--warn); background: #fbf4e8; }
.chip.bad { border-color: #e2b4ae; color: var(--bad); background: #fbefed; }
.chip.go { border-color: #d9b9cd; color: var(--accent); background: var(--accent-soft); }

.sub-list { margin: 0; padding-left: var(--s4); color: var(--ink-2); }

/* ---------- activity feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li { padding: var(--s2) 0; border-bottom: 1px solid var(--line-soft); font-size: var(--t-sm); }
.feed li:last-child { border-bottom: 0; }
.feed-time { color: var(--muted); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.feed-changes { margin: 2px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--t-xs); }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: var(--s5); bottom: var(--s5); display: flex; flex-direction: column; gap: var(--s2); z-index: 10; width: 340px; max-width: calc(100vw - 2 * var(--s5)); }
.toast {
    background: var(--ink); color: #eef2f0;
    border-left: 4px solid var(--accent-on-dark);
    border-radius: var(--r-sm);
    padding: var(--s3) var(--s4);
    font-size: var(--t-sm);
    box-shadow: 0 6px 18px rgba(31,43,42,.25);
    animation: toast-in .25s ease-out;
}
.toast.del { border-left-color: #f0a79d; }
.toast-head { display: flex; justify-content: space-between; gap: var(--s2); color: #a9b6b2; font-size: var(--t-xs); }
.toast ul { margin: var(--s1) 0 0; padding-left: var(--s4); color: #c9d3cf; font-size: var(--t-xs); }
.toast button { background: none; border: 0; color: #a9b6b2; cursor: pointer; font: inherit; padding: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
    .nav-group { flex-direction: row; flex-wrap: wrap; }
    .nav-group-title, .side-foot { display: none; }
    .main { padding: var(--s4); }
    .grid.two { grid-template-columns: 1fr; }
}

#blazor-error-ui {
    background: #fbf4e8; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
