/* Pulse — weekly portfolio review console.

   One idea carries the whole interface: the status rail down the left edge of
   every row. Green means we looked and it holds. Red means we looked and it
   does not. Ochre hatching means we could not establish an answer — hatched,
   not solid, so it can never be misread at a glance as either of the other
   two. Grey means the check did not apply. That distinction is the reason
   this application exists, so it is the thing the eye lands on first. */

:root {
    --ink:        #12212B;
    --ink-soft:   #4A5A64;
    --paper:      #FBFAF7;
    --panel:      #FFFFFF;
    --rule:       #DED9CE;
    --pass:       #2E6F4E;
    --fail:       #A62B1F;
    --unknown:    #8A6D1F;
    --skip:       #8E8A80;
    --action:     #185C73;
    --shade:      #F2EFE8;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

.num, td.num, .metric-value, .tally b {
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-variant-numeric: tabular-nums;
}

a { color: var(--action); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

/* ---------------------------------------------------------------- shell */

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }

.rail {
    background: var(--ink);
    color: #C7D2D8;
    padding: 22px 18px 40px;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
}
.rail h1 { font-size: 17px; letter-spacing: .01em; margin: 0 0 2px; color: #fff; font-weight: 600; }
.rail .strap { font-size: 12.5px; color: #8CA3AD; margin: 0 0 26px; line-height: 1.4; }
.rail nav { display: block; margin-bottom: 26px; }
.rail nav a {
    display: block; padding: 5px 0; color: #C7D2D8; text-decoration: none; font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.rail nav a:hover { color: #fff; }
.rail nav a[aria-current] { color: #fff; font-weight: 600; }
.rail h2 { font-size: 12.5px; color: #7E96A1; font-weight: 600; margin: 0 0 6px; }
.rail .apps a { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.rail .apps a .count { font-size: 12px; color: #E4A79C; }

main { padding: 30px 34px 80px; max-width: 1100px; }

header.page { margin-bottom: 26px; }
header.page h2 { font-size: 25px; margin: 0 0 4px; font-weight: 600; letter-spacing: -.01em; }
header.page p { margin: 0; color: var(--ink-soft); max-width: 68ch; }

/* ---------------------------------------------------------------- tally */

.tally { display: flex; flex-wrap: wrap; gap: 20px; margin: 0 0 8px; padding: 0; list-style: none; }
.tally li { display: flex; align-items: baseline; gap: 7px; }
.tally b { font-size: 22px; font-weight: 600; }
.tally span { font-size: 13.5px; color: var(--ink-soft); }
.tally .t-pass b { color: var(--pass); }
.tally .t-fail b { color: var(--fail); }
.tally .t-unknown b { color: var(--unknown); }
.tally .t-skip b { color: var(--skip); }

.note {
    font-size: 13px; color: var(--ink-soft); border-left: 3px solid var(--rule);
    padding-left: 11px; margin: 14px 0 28px; max-width: 66ch;
}

/* --------------------------------------------------------------- panels */

.panel { background: var(--panel); border: 1px solid var(--rule); margin-bottom: 26px; }
.panel > h3 {
    margin: 0; padding: 12px 16px; font-size: 14px; font-weight: 600;
    border-bottom: 1px solid var(--rule); background: var(--shade);
}
.panel .body { padding: 16px; }

/* The one change. The only place in the interface allowed to shout. */
.headline {
    background: var(--ink); color: #fff; padding: 22px 24px; margin-bottom: 28px;
}
.headline .kicker { font-size: 13px; color: #8CA3AD; margin: 0 0 6px; }
.headline h3 { margin: 0 0 8px; font-size: 20px; font-weight: 600; line-height: 1.3; }
.headline p { margin: 0 0 12px; color: #DCE5E9; max-width: 70ch; }
.headline a { color: #9BD3E8; }
.headline .meta { font-size: 12.5px; color: #7E96A1; }

/* --------------------------------------------------------------- rows */

.row {
    display: grid; grid-template-columns: 5px minmax(0,1fr) auto; gap: 0 14px;
    border-bottom: 1px solid var(--rule); background: var(--panel);
}
.row:last-child { border-bottom: 0; }
.row .status-rail { background: var(--skip); }
.row.s-pass    .status-rail { background: var(--pass); }
.row.s-fail    .status-rail { background: var(--fail); }
.row.s-unknown .status-rail {
    background: repeating-linear-gradient(
        135deg, var(--unknown) 0 3px, #E9DFC4 3px 6px
    );
}
.row .content { padding: 12px 0 13px; }
.row .actions { padding: 12px 14px 12px 0; display: flex; gap: 6px; align-items: flex-start; }
.row h4 { margin: 0 0 3px; font-size: 15px; font-weight: 600; }
.row .why { margin: 4px 0 0; color: var(--ink-soft); max-width: 74ch; }
.row .evidence {
    margin: 6px 0 0; font-family: "IBM Plex Mono", monospace; font-size: 12.5px;
    color: var(--ink-soft); background: var(--shade); padding: 6px 9px; max-width: 74ch;
    overflow-wrap: anywhere;
}
.row .meta { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.row .meta a { overflow-wrap: anywhere; }

.sev { font-size: 12px; font-weight: 600; color: var(--fail); }
.state-tag { font-size: 12px; color: var(--ink-soft); border: 1px solid var(--rule); padding: 1px 6px; }

/* --------------------------------------------------------------- forms */

button, .btn {
    font: inherit; font-size: 13px; padding: 5px 10px; cursor: pointer;
    background: var(--panel); color: var(--ink); border: 1px solid var(--rule);
    text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { border-color: var(--action); color: var(--action); }
button.primary { background: var(--action); border-color: var(--action); color: #fff; }
button.primary:hover { background: #12475A; color: #fff; }

input[type="text"], input[type="password"], input[type="number"] {
    font: inherit; padding: 6px 8px; border: 1px solid var(--rule); background: #fff; color: var(--ink);
    width: 100%;
}
input[type="number"] { font-family: "IBM Plex Mono", monospace; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--rule); font-size: 14px; }
th { font-weight: 600; font-size: 12.5px; color: var(--ink-soft); }
td.num, th.num { text-align: right; }
.delta-up { color: var(--pass); }
.delta-down { color: var(--fail); }

.empty { padding: 26px 16px; color: var(--ink-soft); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* --------------------------------------------------------------- login */

.gate { max-width: 340px; margin: 14vh auto; padding: 0 20px; }
.gate h1 { font-size: 20px; margin: 0 0 4px; }
.gate p { color: var(--ink-soft); margin: 0 0 20px; font-size: 14px; }
.gate label { display: block; font-size: 13px; margin-bottom: 5px; }
.gate button { width: 100%; margin-top: 12px; padding: 8px; }
.gate .error { color: var(--fail); font-size: 13.5px; margin-bottom: 12px; }

@media (max-width: 780px) {
    .shell { grid-template-columns: 1fr; }
    .rail { position: static; height: auto; }
    main { padding: 22px 18px 60px; }
}

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