:root {
  --bg: #F4F1E8; --surface: #FFFFFF; --muted-bg: #ECE7D8; --ink: #23251F; --muted: #5E6158;
  --line: #23251F; --soft: #CFC8B4; --vine: #2E6B3F; --grape: #7A2E62; --sun: #F2B83A;
  --rose: #F0DCE8; --red: #C8233A; --shadow: #23251F;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151C17; --surface: #212B24; --muted-bg: #2A352D; --ink: #F4F1E8; --muted: #B9B4A4;
    --line: #E8E2D0; --soft: #5A6358; --vine: #5FA873; --grape: #E39BC9; --sun: #F2B83A;
    --rose: #4A2A3E; --red: #FF6B7D; --shadow: #F2B83A;
  }
}
@font-face { font-family: system; src: local("system-ui"); }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
h1, h2 { font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: 30px; margin: 8px 0 12px; }
h2 { font-size: 20px; margin: 28px 0 12px; }
a { color: var(--grape); font-weight: 600; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.top { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 10px 16px; background: var(--bg); border-bottom: 3px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 20px; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.top nav a { color: var(--ink); text-decoration: none; padding: 6px 10px; border-radius: 10px; border: 2px solid transparent; }
.top nav a[aria-current="page"] { background: var(--sun); border-color: var(--line); box-shadow: 2px 2px 0 var(--line); color: #23251F; }
.card { background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 16px; }
.card.raised { box-shadow: 4px 4px 0 var(--shadow); }
.card.dashed { border-style: dashed; background: transparent; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin: 16px 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stat b { display: block; font-size: 34px; font-weight: 800; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; }
.sticker { display: inline-block; padding: 1px 8px; border: 2px solid var(--line); border-radius: 10px; font-size: 12px;
  font-weight: 700; background: var(--muted-bg); transform: rotate(-2deg); vertical-align: middle; color: var(--ink); }
.sticker.sun { background: var(--sun); color: #23251F; }
.sticker.grape { background: var(--rose); }
.sticker.red { background: var(--red); color: #fff; }
button { font: inherit; font-weight: 700; cursor: pointer; padding: 10px 16px; min-height: 44px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--grape); color: #fff; box-shadow: 3px 3px 0 var(--shadow); }
button:active { transform: translate(2px, 2px); box-shadow: none; }
button.secondary { background: var(--surface); color: var(--ink); }
button.ghost { background: transparent; color: var(--ink); box-shadow: none; border-color: var(--soft); }
button.danger { background: var(--red); color: #fff; }
input, select { font: inherit; padding: 9px 12px; min-height: 44px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); }
label { display: grid; gap: 4px; font-weight: 600; }
.login { max-width: 420px; margin: 8vh auto; display: grid; gap: 12px; text-align: center; }
.login form { display: grid; gap: 14px; text-align: left; }
.error { color: var(--red); font-weight: 700; }
.filters, .actions, form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions { gap: 16px; }
.table { overflow-x: auto; border: 2px solid var(--line); border-radius: 16px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--soft); }
th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 600; }
.bars { list-style: none; padding: 0; display: grid; gap: 10px; max-width: 520px; }
.bars li { display: grid; grid-template-columns: 90px 1fr 40px; gap: 10px; align-items: center; }
progress { width: 100%; height: 16px; appearance: none; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--muted-bg); }
progress::-webkit-progress-bar { background: var(--muted-bg); }
progress::-webkit-progress-value { background: var(--vine); }
progress::-moz-progress-bar { background: var(--vine); }
code { background: var(--muted-bg); padding: 1px 6px; border-radius: 6px; }
