/* Waster brand: red #e12126 · light blue #43b8d0 · blue #0090d0 · navy #283080 · dark #1f2a2c */
:root {
  color-scheme: light;
  --brand-red: #e12126;
  --brand-light: #43b8d0;
  --brand-blue: #0090d0;
  --brand-navy: #283080;
  --brand-dark: #1f2a2c;
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #f7f9fa;
  --chart-surface: #ffffff;
  --ink: #1f2a2c;
  --ink-2: #4b5a5e;
  --muted: #7c8a8f;
  --line: #e2e8eb;
  --line-strong: #cbd4d8;
  --grid: #e6ecee;
  --accent: #0090d0;
  --accent-strong: #007ab3;
  --accent-ink: #ffffff;
  --accent-soft: #e3f4fb;
  --hover: #f0f5f7;
  --sel: #d8eff8;
  --series-1: #0090d0;
  --series-2: #283080;
  --series-3: #1aa876;
  --good: #1aa876;
  --good-text: #0d7a52;
  --warning: #f5a623;
  --serious: #ec835a;
  --critical: #e12126;
  --critical-text: #c01a1f;
  --nav-bg: #1f2a2c;
  --nav-ink: #c9d4d6;
  --nav-muted: #7f9194;
  --nav-hover: #2a383b;
  --shadow-sm: 0 1px 2px rgba(31,42,44,.06);
  --shadow: 0 2px 6px rgba(31,42,44,.06), 0 12px 32px rgba(31,42,44,.10);
  --radius: 10px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --font: "Inter", "Segoe UI Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111718; --surface: #182022; --surface-2: #1d2729; --chart-surface: #182022;
    --ink: #eef3f4; --ink-2: #b9c6c9; --muted: #7f9194; --line: #283436; --line-strong: #394749; --grid: #253133;
    --accent: #43b8d0; --accent-strong: #62c7dc; --accent-ink: #0b1a1d; --accent-soft: #15333a; --hover: #202b2d; --sel: #173b45;
    --series-1: #43b8d0; --series-2: #8f98ff; --series-3: #2cc48d;
    --good-text: #3fd19b; --critical-text: #ff6b6f;
    --nav-bg: #0c1112; --nav-hover: #1b2527;
    --shadow: 0 2px 6px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111718; --surface: #182022; --surface-2: #1d2729; --chart-surface: #182022;
  --ink: #eef3f4; --ink-2: #b9c6c9; --muted: #7f9194; --line: #283436; --line-strong: #394749; --grid: #253133;
  --accent: #43b8d0; --accent-strong: #62c7dc; --accent-ink: #0b1a1d; --accent-soft: #15333a; --hover: #202b2d; --sel: #173b45;
  --series-1: #43b8d0; --series-2: #8f98ff; --series-3: #2cc48d;
  --good-text: #3fd19b; --critical-text: #ff6b6f;
  --nav-bg: #0c1112; --nav-hover: #1b2527;
  --shadow: 0 2px 6px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* layout */
.app { display: grid; grid-template-columns: 208px 1fr; height: 100vh; }
.nav { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; padding: 4px 8px 16px; letter-spacing: -.01em; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 14px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--hover); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a .badge { margin-left: auto; }
.nav .spacer { flex: 1; }
.nav .me { padding: 8px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 8px; }
.nav .me button { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 12px; }
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.main { overflow: auto; display: flex; flex-direction: column; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; padding: 16px 24px 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-body { padding: 0 24px 32px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 24px 12px; }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--critical-text); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
input.in, select.in, textarea.in { height: 32px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); padding: 0 10px; min-width: 0; }
textarea.in { height: auto; padding: 8px 10px; resize: vertical; }
input.in:focus, select.in:focus, textarea.in:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.search { width: 280px; padding-left: 32px !important; background: var(--surface) no-repeat 10px 50% / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); height: 30px; padding: 0 10px; cursor: pointer; color: var(--ink-2); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
label.f .in { font-size: 14px; color: var(--ink); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.chk { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.days { display: flex; gap: 4px; }
.days button { width: 38px; height: 30px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 6px; cursor: pointer; }
.days button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* cards & tiles */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; font-weight: 400; }
.card-b { padding: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile .lbl { color: var(--ink-2); font-size: 12px; font-weight: 500; }
.tile .val { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; }
.tile .delta { font-size: 12px; margin-top: 2px; color: var(--ink-2); }
.up { color: var(--good-text); } .down { color: var(--critical-text); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 1px 8px; font-size: 11px; font-weight: 600; background: var(--hover); color: var(--ink-2); white-space: nowrap; }
.badge.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good-text); }
.badge.warn { background: color-mix(in srgb, var(--warning) 24%, transparent); color: var(--ink); }
.badge.bad { background: color-mix(in srgb, var(--critical) 16%, transparent); color: var(--critical-text); }
.badge.info { background: var(--sel); color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* spreadsheet grid */
.sheet-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-height: calc(100vh - 170px); }
table.sheet { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.sheet th, table.sheet td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0 8px; height: 32px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.sheet th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; cursor: pointer; user-select: none; }
table.sheet th.num { text-align: right; }
table.sheet th .arrow { color: var(--accent); }
table.sheet tbody tr:hover td { background: var(--hover); }
table.sheet td.cell-edit { cursor: cell; }
table.sheet td.focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--sel) !important; }
table.sheet td.editing { padding: 0; }
table.sheet td.editing input, table.sheet td.editing select { width: 100%; height: 31px; border: 0; outline: 2px solid var(--accent); outline-offset: -2px; padding: 0 7px; background: var(--surface); font-size: 13px; }
table.sheet td.saved { animation: flash 900ms ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--good) 30%, transparent); } }
table.sheet tr.ended td { color: var(--muted); }
table.sheet td.first { position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.sheet th.first { left: 0; z-index: 3; }
table.sheet tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 600; }
.row-open { color: var(--ink); text-align: left; font: inherit; cursor: pointer; background: none; border: 0; padding: 0 2px; }
.row-open:hover { color: var(--accent); }

/* plain tables */
table.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
table.tbl th, table.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; }
table.tbl th { color: var(--ink-2); font-size: 12px; font-weight: 600; background: var(--surface-2); }
table.tbl tr.click { cursor: pointer; }
table.tbl tr.click:hover td { background: var(--hover); }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal .dh { background: var(--surface-2); padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.cal .day { background: var(--surface); min-height: 118px; padding: 6px 8px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.cal .day:hover { background: var(--hover); }
.cal .day.out { background: var(--surface-2); color: var(--muted); }
.cal .day.today .dn { background: var(--accent); color: var(--accent-ink); }
.cal .day.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal .dn { font-weight: 600; font-size: 12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.cal .total { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.cal .line { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .flags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; }

/* confirm */
.sup-group { margin-bottom: 16px; }
.lift-row { display: grid; grid-template-columns: 1fr 180px 130px 360px; gap: 10px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.lift-row:last-child { border-bottom: 0; }
.lift-row .who { min-width: 0; }
.lift-row .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lift-row .who span { font-size: 12px; color: var(--muted); }
.lift-row .acts { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.lift-row.done { background: color-mix(in srgb, var(--good) 6%, transparent); }
.lift-row.futile { background: color-mix(in srgb, var(--warning) 10%, transparent); }
.lift-row.missed { background: color-mix(in srgb, var(--critical) 6%, transparent); }
.progress { height: 6px; background: var(--hover); border-radius: 3px; overflow: hidden; width: 160px; }
.progress > div { height: 100%; background: var(--good); border-radius: 3px; }

/* drawer + modal */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--surface); z-index: 51; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.drawer-h h2 { margin: 0; font-size: 16px; }
.drawer-h .x { margin-left: auto; }
.drawer-b { padding: 18px 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 16px; }
.drawer-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.drawer-f .right { margin-left: auto; display: flex; gap: 8px; }
.section-t { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; margin: 4px 0 -4px; }
.preview-dates { display: flex; flex-wrap: wrap; gap: 6px; }
.econ { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.econ div { background: var(--surface-2); border-radius: 6px; padding: 8px 10px; }
.econ b { display: block; font-size: 16px; }
.econ span { font-size: 11px; color: var(--muted); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 9px 16px; border-radius: 8px; z-index: 100; font-weight: 500; box-shadow: var(--shadow); }
.toast.err { background: var(--critical); color: #fff; }

/* charts */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--line-strong); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .dlabel { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.chart .hoverline { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 6px; padding: 8px 10px; font-size: 12px; z-index: 5; min-width: 140px; }
.tip .t { font-weight: 600; margin-bottom: 4px; }
.tip .r { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.tip .r span { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); }
.hbar { display: grid; grid-template-columns: minmax(120px, 34%) 1fr 70px; gap: 10px; align-items: center; font-size: 12px; padding: 3px 0; }
.hbar .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.hbar .track { height: 14px; position: relative; }
.hbar .bar { position: absolute; top: 0; bottom: 0; border-radius: 0 4px 4px 0; }
.hbar .zero { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { margin: 0; font-size: 20px; }
.err-text { color: var(--critical-text); font-size: 13px; }

.empty { padding: 40px; text-align: center; color: var(--muted); }
.issue-list { display: flex; flex-direction: column; }
.issue { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.issue:hover { background: var(--hover); }
.issue:last-child { border-bottom: 0; }
.kbd { font-size: 11px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; color: var(--muted); }
pre.code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; overflow: auto; font-size: 12px; }

@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .nav { flex-direction: row; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand, .nav .spacer, .nav .me { display: none; }
  .page-head, .toolbar { padding-left: 16px; padding-right: 16px; }
  .page-body { padding: 0 16px 24px; }
  .search { width: 100%; }
  .lift-row { grid-template-columns: 1fr; }
  .nav a { white-space: nowrap; }
  .card-h { flex-wrap: wrap; }
  .progress { width: 80px; }
  .form-grid { grid-template-columns: 1fr; }
}

.card > table.tbl td:first-child, .card > table.tbl th:first-child, .card-b table.tbl td:first-child { padding-left: 16px; }
.card > table.tbl td:last-child, .card > table.tbl th:last-child { padding-right: 16px; }

/* ---------- Waster look: dark sidebar, brand accents, motion ---------- */
.app { grid-template-columns: 224px 1fr; }
.nav { background: var(--nav-bg); border-right: 0; padding: 16px 12px; gap: 1px; }
.brand { color: #fff; padding: 2px 8px 18px; gap: 10px; font-size: 17px; letter-spacing: -.02em; }
.brand .ops { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-light); background: rgba(67,184,208,.14); padding: 2px 7px; border-radius: 99px; }
.brand-logo { width: 30px; height: 30px; border-radius: 9px; background: #fff; display: grid; place-items: center; flex: none; }
.brand-logo svg { width: 22px; height: 22px; }
.nav a { color: var(--nav-ink); padding: 8px 10px; border-radius: 8px; position: relative; transition: background .12s var(--ease), color .12s var(--ease); }
.nav a:hover { background: var(--nav-hover); color: #fff; }
.nav a.active { background: rgba(67,184,208,.14); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-light); }
.nav a.active .ico { color: var(--brand-light); }
.nav .badge { background: rgba(255,255,255,.1); color: #fff; }
.nav .badge.bad { background: var(--brand-red); color: #fff; }
.nav .badge.warn { background: #f5a623; color: #1f2a2c; }
.nav .badge.info { background: var(--brand-light); color: #0b1a1d; }
.nav .me { border-top: 1px solid rgba(255,255,255,.08); color: var(--nav-muted); }
.nav .me button { color: var(--brand-light); }
.nav-search { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 7px 10px; border-radius: 8px; background: rgba(255,255,255,.06); color: var(--nav-muted); cursor: pointer; border: 1px solid rgba(255,255,255,.06); font-size: 13px; }
.nav-search:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-search .kbd { margin-left: auto; border-color: rgba(255,255,255,.15); color: var(--nav-muted); }

.main { background: var(--bg); }
.page-head { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); padding: 18px 28px 14px; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.page-body { padding: 0 28px 36px; }
.toolbar { padding: 0 28px 14px; }
#view > * { animation: rise .18s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

.btn { height: 34px; border-radius: 8px; border-color: var(--line-strong); box-shadow: var(--shadow-sm); transition: background .12s var(--ease), border-color .12s, box-shadow .12s, transform .06s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-strong); filter: none; }
.btn.sm { height: 28px; border-radius: 7px; }
.btn.danger { border-color: color-mix(in srgb, var(--critical) 40%, var(--line-strong)); }
input.in, select.in, textarea.in { height: 34px; border-radius: 8px; border-color: var(--line-strong); transition: border-color .12s, box-shadow .12s; }
input.in:focus, select.in:focus, textarea.in:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.seg { border-radius: 9px; background: var(--surface); padding: 2px; gap: 2px; border-color: var(--line); }
.seg button { border: 0; border-radius: 7px; height: 28px; transition: background .12s; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

.card { border-color: var(--line); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-h { padding: 14px 18px; }
.tiles { gap: 14px; }
.tile { border-color: var(--line); box-shadow: var(--shadow-sm); padding: 16px 18px; position: relative; overflow: hidden; transition: transform .12s var(--ease), box-shadow .12s; }
.tile.click, .tile[data-tile] { cursor: pointer; }
.tile.click:hover, .tile[data-tile]:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.tile::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--brand-navy), var(--brand-blue) 55%, var(--brand-light)); opacity: .85; }
.tile .val { font-size: 28px; font-weight: 700; }
.badge { padding: 2px 9px; }
.badge.info { background: var(--accent-soft); color: var(--accent-strong); }

.sheet-wrap { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table.sheet th { background: var(--surface-2); color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
table.sheet tbody tr:hover td { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
table.tbl th { background: var(--surface-2); color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
table.tbl tr.click:hover td { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }

.scrim { background: rgba(15,22,24,.38); backdrop-filter: blur(2px); animation: fade .15s var(--ease); }
.drawer { border-radius: 14px 0 0 14px; animation: slide .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } }
.drawer-h h2 { font-size: 17px; letter-spacing: -.01em; }
.toast { border-radius: 10px; background: var(--brand-dark); color: #fff; animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 6px); } }
.cal .day.today .dn { background: var(--brand-red); color: #fff; }

/* login */
.login { background: radial-gradient(1200px 500px at 80% -10%, rgba(67,184,208,.25), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(40,48,128,.18), transparent 60%), var(--bg); }
.login .card { box-shadow: var(--shadow); border-radius: 16px; }

/* command palette */
.cmdk-scrim { position: fixed; inset: 0; background: rgba(15,22,24,.38); backdrop-filter: blur(2px); z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; animation: fade .12s var(--ease); }
.cmdk { width: min(640px, calc(100vw - 32px)); background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; animation: pop2 .15s var(--ease); border: 1px solid var(--line); }
@keyframes pop2 { from { opacity: 0; transform: translateY(-6px) scale(.99); } }
.cmdk input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; font-size: 16px; background: transparent; outline: 0; }
.cmdk .res { max-height: 56vh; overflow-y: auto; padding: 6px; }
.cmdk .it { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.cmdk .it .k { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); width: 58px; flex: none; }
.cmdk .it .s { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.cmdk .it.on { background: var(--accent-soft); }
.cmdk .it.on .k { color: var(--accent-strong); }
.cmdk .foot { border-top: 1px solid var(--line); padding: 8px 14px; font-size: 11px; color: var(--muted); display: flex; gap: 14px; }

@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .nav { padding: 8px; }
  .nav a.active::before { display: none; }
  .nav-search { display: none; }
  .page-head { padding: 14px 16px 10px; }
  .page-body { padding: 0 16px 24px; }
  .toolbar { padding: 0 16px 12px; }
  .drawer { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* loading shimmer for cards still fetching */
#view .card > div:empty:not([class*="chart"]), #view .card-b:empty { min-height: 140px; background: linear-gradient(90deg, transparent 0, color-mix(in srgb, var(--accent) 7%, transparent) 50%, transparent 100%) 0 0 / 200% 100% no-repeat; animation: shimmer 1.1s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* ---------- matched to waster.com.au: logo wordmark, red pill CTAs, light-blue band, Roboto ---------- */
:root { --font: Roboto, "Inter", "Segoe UI Variable", system-ui, -apple-system, "Segoe UI", sans-serif; --cta: #e12126; --cta-strong: #c8171c; }
.brand { padding: 0 0 16px; }
.wm { position: relative; display: inline-flex; flex-direction: column; align-items: flex-end; background: #fff; border-radius: 12px; padding: 12px 14px 8px; width: 100%; }
.wm .arcs { position: absolute; top: 3px; right: 26px; width: 34px; height: 19px; }
.wm .w { font: 800 30px/1 "Trebuchet MS", "Segoe UI", Roboto, sans-serif; letter-spacing: -.02em; align-self: flex-start; background: linear-gradient(180deg, #283080 10%, #0090d0 95%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-top: 6px; }
.wm .bar { margin-top: 3px; width: 100%; text-align: right; font: 700 12px/1 Roboto, sans-serif; color: #fff; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; background: linear-gradient(90deg, #0090d0, #283080); }
.btn { border-radius: 99px; padding: 0 16px; }
.btn.sm { border-radius: 99px; padding: 0 11px; }
.btn.primary { background: var(--cta); border-color: var(--cta); color: #fff; text-transform: uppercase; letter-spacing: .03em; font-weight: 700; font-size: 13px; }
.btn.primary:hover { background: var(--cta-strong); border-color: var(--cta-strong); }
.btn.danger { color: var(--critical-text); background: var(--surface); }
input.in, select.in { border-radius: 10px; }
.seg { border-radius: 99px; }
.seg button { border-radius: 99px; padding: 0 12px; }
.seg button.on { background: var(--brand-light); color: #fff; font-weight: 700; }
.days button.on { background: var(--brand-light); border-color: var(--brand-light); color: #fff; }
.nav a.active { background: rgba(67,184,208,.18); }
.tile::after { height: 4px; background: linear-gradient(90deg, #0090d0, #283080); }
.page-head h1 { font-weight: 800; }
.card-h { font-weight: 700; }
.login { background: #fff; }
.login .card { border-top: 6px solid var(--brand-light); }
.login .brand { padding: 0; }
.login .wm { width: auto; padding: 0; background: none; }
.login .wm .w { font-size: 40px; }
.login .wm .arcs { right: 30px; width: 44px; height: 24px; top: -6px; }
.login .wm .bar { width: 150px; }

/* ---------- calm: light blue + white, red only for highlights ---------- */
:root:not([data-theme="dark"]) {
  --bg: #f3f9fb; --surface: #ffffff; --surface-2: #f6fbfc; --hover: #eef7fa; --sel: #dcf1f6;
  --line: #dfecf0; --line-strong: #c6dbe1;
  --accent: #1f9bb6; --accent-strong: #16849c; --accent-soft: #e2f4f8;
  --series-1: #43b8d0; --series-2: #283080; --series-3: #1aa876;
  --nav-bg: #ffffff; --nav-ink: #3d4d51; --nav-muted: #7c8a8f; --nav-hover: #eef7fa;
  --cta: #1f9bb6; --cta-strong: #16849c;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cta: #43b8d0; --cta-strong: #62c7dc; } }
:root:not([data-theme="dark"]) .nav { border-right: 1px solid var(--line); }
:root:not([data-theme="dark"]) .nav a:hover { color: var(--ink); }
:root:not([data-theme="dark"]) .nav a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
:root:not([data-theme="dark"]) .nav a.active .ico { color: var(--brand-light); }
:root:not([data-theme="dark"]) .nav .badge { background: var(--accent-soft); color: var(--accent-strong); }
:root:not([data-theme="dark"]) .nav .badge.bad { background: var(--brand-red); color: #fff; }
:root:not([data-theme="dark"]) .nav .badge.warn { background: #fde7c3; color: #7a4a00; }
:root:not([data-theme="dark"]) .nav .me { border-top-color: var(--line); }
:root:not([data-theme="dark"]) .nav .me button { color: var(--accent-strong); }
:root:not([data-theme="dark"]) .nav-search { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
:root:not([data-theme="dark"]) .nav-search:hover { background: var(--hover); color: var(--ink); }
:root:not([data-theme="dark"]) .nav-search .kbd { border-color: var(--line-strong); }
.wm { border: 1px solid var(--line); }
:root:not([data-theme="dark"]) .wm { border: 0; padding-left: 4px; padding-right: 4px; }
.btn.primary { text-transform: none; letter-spacing: 0; font-size: 14px; }
/* red = highlights only */
.nav a.active::before { background: var(--brand-red); }
.tile .val.down, .down { color: var(--brand-red); }
.tile::after { background: linear-gradient(90deg, var(--brand-light), #0090d0 70%, #283080); }
.btn.hl { background: var(--brand-red); border-color: var(--brand-red); color: #fff; font-weight: 700; }

/* logo: arcs sit over the "er" like the real wordmark */
.wm, :root:not([data-theme="dark"]) .wm { display: inline-flex; flex-direction: column; align-items: stretch; width: auto; padding: 10px 6px 4px; background: none; border: 0; }
.wm .w { position: relative; display: inline-block; padding-top: 8px; }
.wm .arcs, .login .wm .arcs { position: absolute; top: -4px; right: 2px; width: 32px; height: 18px; }
.login .wm .arcs { top: -6px; width: 40px; height: 22px; }
.wm .bar { width: auto; }
.login .wm .bar { width: auto; }
.brand { justify-content: flex-start; padding-left: 4px; }
.drawer.wide { width: min(1000px, 100vw); }
.seg button { white-space: nowrap; }
.tm-banner { background: repeating-linear-gradient(-45deg, #fff4d6, #fff4d6 12px, #ffeebf 12px, #ffeebf 24px); color: #6b4a00; padding: 7px 28px; font-size: 13px; border-bottom: 1px solid #f3d98c; }
.tm-banner a { color: #6b4a00; font-weight: 700; margin-left: 6px; }
#testmode-card { scroll-margin-top: 84px; }

/* pipelines board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; padding: 0 28px 28px; overflow-x: auto; align-items: start; min-height: calc(100vh - 120px); }
.board .col { background: color-mix(in srgb, var(--accent) 5%, var(--bg)); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 130px); transition: background .12s, border-color .12s; }
.board .col.over { background: var(--accent-soft); border-color: var(--brand-light); }
.board .col.done header b { color: var(--good-text); }
.board .col.lost { opacity: .75; }
.board .col header { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; font-size: 13px; }
.board .col header .n { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; font-size: 11px; padding: 0 7px; color: var(--muted); }
.board .col header .v { margin-left: auto; font-size: 12px; color: var(--accent-strong); font-weight: 600; }
.board .cards { padding: 0 8px 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 60px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; box-shadow: var(--shadow-sm); transition: box-shadow .12s, transform .12s; border-left: 3px solid var(--brand-light); }
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kcard.hot { border-left-color: var(--brand-red); }
.kcard.dragging { opacity: .45; }
.kcard .t { font-weight: 600; font-size: 13px; line-height: 1.3; }
.kcard .m { font-size: 12px; color: var(--muted); margin-top: 3px; }
.kcard .f { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.kcard .av { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.drop-hint { border: 1.5px dashed var(--line-strong); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); font-size: 12px; }
@media (max-width: 800px) { .board { padding: 0 16px 20px; grid-auto-columns: 80vw; } }

/* per-customer calendar pills */
.pill { display: block; font-size: 11px; line-height: 1.3; padding: 2px 6px; border-radius: 6px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--hover); color: var(--ink-2); border: 1px solid transparent; }
.pill.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good-text); }
.pill.bad { background: color-mix(in srgb, var(--critical) 14%, transparent); color: var(--critical-text); }
.pill.warn { background: color-mix(in srgb, var(--warning) 26%, transparent); color: #6b4a00; }
.pill.info { background: var(--accent-soft); color: var(--accent-strong); }
.pill.todo { background: var(--surface); border-color: var(--warning); color: #6b4a00; }
.pill.skip { background: transparent; color: var(--muted); text-decoration: line-through; border-color: var(--line); }
.pill.extra { background: color-mix(in srgb, var(--brand-navy) 12%, transparent); color: var(--brand-navy); }
.legend .pill { display: inline-block; width: 14px; padding: 0; margin: 0 4px 0 0; vertical-align: -2px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; }
.mcal .day { min-height: 74px; cursor: default; padding: 4px 5px; }
.mcal .dh { padding: 4px 6px; }
