:root {
  --ink: #111; --text: #2b2b2b; --muted: #5c5c5c; --faint: #8a8a8a;
  --line: #d1d1d1; --rule: #ececec; --panel: #f4f4f2; --bg: #fff;
  --teal: #4db4b0; --teal-soft: #bfe3e1; --green: #7ca850; --mustard: #e5c45c; --coral: #e0896b;
  --display: "Bebas Neue", "Arial Narrow", sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, sans-serif;
  --maxbar: 150px;        /* tallest bar in a grouped chart */
  --maxcol: 190px;        /* tallest column in a month chart */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--mono); }
a { color: inherit; }
a:hover { color: var(--teal); }

/* top bar */
.top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 10; }
.top .in { max-width: 1160px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 20px; height: 54px; }
.brand { font: 26px/1 var(--display); letter-spacing: .3px; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--teal); }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; padding: 6px 9px; border-radius: 6px; font-size: 12.5px; white-space: nowrap; color: #cfcfcf; }
.nav a:hover { color: #fff; }
.nav a.on { background: #fff; color: var(--ink); }
.nav .count { background: var(--coral); color: var(--ink); border-radius: 9px; padding: 0 6px; margin-left: 4px; font-size: 11px; }
.who { font-size: 12px; color: #9a9a9a; white-space: nowrap; }
.who a { color: #cfcfcf; }

main { max-width: 1160px; margin: 0 auto; padding: 28px 16px 80px; }
h1 { font: 48px/1 var(--display); color: var(--ink); margin: 0 0 8px; letter-spacing: -.4px; }
h2 { font: 30px/1 var(--display); color: var(--ink); margin: 40px 0 12px; letter-spacing: -.3px; }
h3 { font: 20px/1 var(--display); color: var(--muted); margin: 0 0 10px; font-weight: 400; }
.lede { max-width: 640px; color: var(--text); margin: 0 0 22px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

/* buttons, filters */
.btn { display: inline-block; font: 13px var(--mono); color: var(--ink); background: var(--teal); border: 2px solid var(--ink);
       border-radius: 6px; padding: 6px 12px; text-decoration: none; cursor: pointer; box-shadow: 2px 2px 0 var(--ink); }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.btn.plain { background: #fff; }
.btn.small { padding: 3px 8px; font-size: 12px; box-shadow: 1px 1px 0 var(--ink); }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
.seg a { padding: 5px 10px; text-decoration: none; font-size: 12.5px; border-left: 2px solid var(--ink); }
.seg a:first-child { border-left: 0; }
.seg a.on { background: var(--ink); color: #fff; }
form.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
input, select { font: 13px var(--mono); color: var(--ink); border: 1.5px solid var(--line); border-radius: 6px;
                padding: 6px 8px; background: #fff; max-width: 100%; }
input:focus, select:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
label.check { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; }

/* figure panel like a product screenshot, caption underneath */
.figure { border: 2px solid var(--ink); margin: 0 0 28px; background: #fff; }
.figure .stage { background: var(--panel); padding: 34px 20px 22px; overflow-x: auto; }
.figure .caption { padding: 18px 22px 20px; border-top: 2px solid var(--ink); }
.figure .caption h2 { margin: 0 0 6px; font-size: 32px; }
.figure .caption p { margin: 0; max-width: 720px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin-top: 14px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hatch { background: repeating-linear-gradient(135deg, var(--teal) 0 3px, var(--teal-soft) 3px 7px); }

/* grouped bar chart: one dashed box per group, flat bars, values on top */
.groups { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px 18px; min-width: min-content; }
.gbox { position: relative; border: 3px dashed var(--line); border-radius: 16px; padding: 26px 14px 10px; }
.gbox .tag { position: absolute; top: -15px; right: 12px; background: #fff; border: 2px solid var(--line); border-radius: 17px;
             padding: 1px 10px; font: 17px/1.3 var(--display); color: var(--muted); white-space: nowrap; }
.bars { display: flex; gap: 12px; align-items: flex-end; height: 190px; }
.bar { width: 50px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
       text-decoration: none; }
.bar .v { font: 12.5px var(--mono); color: #454545; margin-bottom: 6px; white-space: nowrap; }
.bar .stack { width: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.bar .fill { width: 100%; min-height: 2px; }
.bar .stack .fill:first-child { border-radius: 4px 4px 0 0; }
.bar:hover .fill { filter: brightness(.93); }
.labels { display: flex; gap: 12px; margin-top: 8px; }
.labels span { width: 50px; text-align: center; font: 16px/1 var(--display); color: var(--muted); }

/* single dashed box with many columns (months) */
.cols { display: flex; gap: 16px; align-items: flex-end; height: 230px; }
.cols .bar { width: 64px; }
.cols + .labels span { width: 64px; }
.cols + .labels { gap: 16px; }

/* stat tiles */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 28px; }
.kpi { border: 2px solid var(--ink); padding: 12px 14px 14px; background: #fff; }
.kpi .k { font: 17px/1 var(--display); color: var(--muted); }
.kpi .n { font: 26px/1.2 var(--mono); color: var(--ink); margin-top: 6px; white-space: nowrap; }
.kpi .s { font-size: 12px; color: var(--muted); }
.kpi.warn { background: #fff7e0; }
.kpi.bad { background: #fdece6; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.card { border: 2px solid var(--ink); background: #fff; padding: 16px 18px; }
.card h3 { margin-bottom: 12px; }

/* tables */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { font: 16px/1 var(--display); color: var(--muted); text-align: left; padding: 8px 8px; border-bottom: 2px solid var(--ink);
          white-space: nowrap; font-weight: 400; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl tr:hover td { background: #fafaf8; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.neg { color: var(--ink); } .pos { color: #2f7d4f; }
.tbl select { padding: 3px 4px; font-size: 12px; border-color: transparent; background: transparent; }
.tbl select:hover { border-color: var(--line); background: #fff; }
.desc { max-width: 340px; }
.desc .cp { color: var(--muted); font-size: 12px; }
.locked { color: var(--teal); }
.chip { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 9px; border: 1.5px solid var(--ink); white-space: nowrap; }
.chip.high { background: var(--coral); } .chip.medium { background: var(--mustard); } .chip.low { background: #eee; }
.chip.ok { background: var(--teal-soft); } .chip.late { background: var(--coral); }
.doc { text-decoration: none; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.list li:last-child { border-bottom: 0; }
.alert { border: 2px solid var(--ink); padding: 14px 16px; margin-bottom: 14px; background: #fff; }
.alert.high { border-left: 10px solid var(--coral); } .alert.medium { border-left: 10px solid var(--mustard); }
.alert.low { border-left: 10px solid var(--line); }
.alert h3 { color: var(--ink); font-size: 22px; margin: 4px 0 6px; }
.alert .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
details summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
details ul { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; }
.spark { width: 100%; height: 60px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff;
         padding: 9px 16px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; }

/* sign-in */
.login { max-width: 460px; margin: 10vh auto; padding: 0 16px; }
.login .figure .stage { text-align: center; padding: 40px 20px; }

@media (max-width: 820px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  h1 { font-size: 40px; }
  .who { display: none; }
  :root { --maxbar: 110px; --maxcol: 140px; }
  .bars { height: 150px; gap: 8px; } .bar, .labels span { width: 40px; } .labels { gap: 8px; }
  .cols { height: 180px; gap: 8px; } .cols .bar, .cols + .labels span { width: 44px; } .cols + .labels { gap: 8px; }
  .figure .stage { padding: 30px 12px 16px; }
  .desc { max-width: 200px; }
}
