:root {
  --bg: #f4f7f4;
  --panel: #ffffff;
  --ink: #17251a;
  --muted: #5c6b5f;
  --line: #dde6de;
  --brand: #2e7d32;
  --brand-ink: #ffffff;
  --brand-soft: #e3f1e4;
  --side: #163f1c;
  --side-ink: #d7eadb;
  --side-active: #2e7d32;
  --warn: #9a5b00;
  --warn-soft: #fff3dc;
  --bad: #b3261e;
  --bad-soft: #fde7e5;
  --ok: #1e7b34;
  --ok-soft: #e1f3e5;
  --info-soft: #e8eef9;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 40, 20, 0.06), 0 4px 16px rgba(16, 40, 20, 0.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1711;
    --panel: #162019;
    --ink: #e4efe6;
    --muted: #9db0a1;
    --line: #26352a;
    --brand: #6fbf75;
    --brand-ink: #0c1a0e;
    --brand-soft: #1c3320;
    --side: #0b130d;
    --side-ink: #b9d3be;
    --side-active: #23502a;
    --warn: #f0b75c;
    --warn-soft: #33270f;
    --bad: #ff8a80;
    --bad-soft: #3a1714;
    --ok: #7fd18b;
    --ok-soft: #173020;
    --info-soft: #1b2433;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; }
small, .muted { color: var(--muted); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--brand-soft); padding: 1px 6px; border-radius: 6px; }

/* layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; font-weight: 650; }
.brand img { width: 30px; height: 30px; }
.brand span small { display: block; color: var(--side-ink); font-weight: 400; font-size: 12px; }
.side a.nav { color: var(--side-ink); text-decoration: none; padding: 9px 12px; border-radius: 9px; display: flex; justify-content: space-between; align-items: center; }
.side a.nav:hover { background: rgba(255, 255, 255, 0.06); }
.side a.nav.active { background: var(--side-active); color: #fff; }
.side .group { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; padding: 14px 12px 4px; }
.side .spacer { flex: 1; }
.side .who { font-size: 13px; padding: 10px 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.side .who button { margin-top: 6px; }
.count { background: #f0b75c; color: #2b1d00; border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 700; }
main { padding: 26px 30px 60px; max-width: 1180px; width: 100%; }
.topbar { display: none; }

/* blocks */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.stat { font-size: 26px; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 13px; }
.banner { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid transparent; }
.banner.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(154, 91, 0, 0.2); }
.banner.info { background: var(--info-soft); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--ink); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.grey { background: var(--line); color: var(--muted); }

button, .btn {
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 8px 14px; border-radius: 9px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
button:hover, .btn:hover { border-color: var(--brand); }
button.primary, .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.danger { color: var(--bad); }
button.small { padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.side button { background: transparent; color: var(--side-ink); border-color: rgba(255, 255, 255, 0.15); }

label { display: block; font-weight: 600; font-size: 13px; margin: 10px 0 4px; }
input, select, textarea {
  font: inherit; width: 100%; padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
}
textarea { min-height: 70px; resize: vertical; }
input[type="checkbox"] { width: auto; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.empty { color: var(--muted); padding: 18px 4px; text-align: center; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 4px 0 10px 38px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; display: grid; place-items: center; font-size: 13px; }

.pack { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--panel); }
.pack.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; cursor: pointer; user-select: none; background: var(--panel); }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.switch { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--line); border: 0; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.switch.on { background: var(--brand); }
.switch.on::after { left: 21px; }

.toast { position: fixed; bottom: 20px; right: 20px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 10; max-width: 420px; }
.toast.bad { background: var(--bad); color: #fff; }

.signin { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.signin .card { max-width: 440px; width: 100%; text-align: center; padding: 34px 30px; }
.signin img { width: 56px; height: 56px; margin-bottom: 8px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; position: fixed; inset: 0 30% 0 0; z-index: 5; overflow-y: auto; }
  .side.open { display: flex; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--side); color: #fff; }
  .topbar button { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.2); }
  main { padding: 18px 16px 50px; }
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
}

/* utilities (no inline styles: the page CSP forbids them) */
.mt { margin-top: 12px; }
.mt-s { margin-top: 8px; }
.mt-l { margin-top: 30px; }
label.inline { margin: 0; }
.sub { opacity: 0.7; }
button.wide { width: 100%; justify-content: center; margin-top: 8px; }
.fine { margin-top: 14px; font-size: 13px; }
