:root {
  --paper: #f3f6f5;
  --surface: #ffffff;
  --ink: #1b2421;
  --muted: #5b6864;
  --line: #d8e0dd;
  --brand: #0f5e57;
  --brand-soft: #e2efec;
  --on-brand: #ffffff;
  --star: #c98a12;
  --neg: #b23f2e;
  --neg-soft: #f8e7e3;
  --neu: #8a7630;
  --neu-soft: #f4efdc;
  --pos: #2d7a4c;
  --pos-soft: #e3f1e8;
  --neg-line: #ecc7bf;
  --neu-line: #e6dbb3;
  --pos-line: #bfdfca;
  --radius-s: 6px;
  --radius-m: 10px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111715;
    --surface: #19211f;
    --ink: #e4ebe8;
    --muted: #9aa8a3;
    --line: #2a3531;
    --brand: #4fb3a6;
    --brand-soft: #1d3330;
    --on-brand: #0b1917;
    --star: #e5b04a;
    --neg: #ef8a78;
    --neg-soft: #3a211d;
    --neu: #d6c27a;
    --neu-soft: #34301e;
    --pos: #74c795;
    --pos-soft: #1d3326;
    --neg-line: #5a302a;
    --neu-line: #544b2c;
    --pos-line: #2c5139;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[v-cloak] { display: none; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; }
h1 { font-size: 26px; letter-spacing: -0.01em; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--brand); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

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

/* ---------- controls ---------- */
button, .btn {
  font: inherit;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 7px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
button:hover:not(:disabled), .btn:hover { border-color: var(--muted); }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 500; }
.primary:hover:not(:disabled) { filter: brightness(1.08); border-color: var(--brand); }
.danger { color: var(--neg); }
.link { border: 0; background: none; padding: 0; color: var(--brand); text-decoration: underline; }

input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 8px 10px;
  width: 100%;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
label.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label.field > span { color: var(--ink); font-size: 14px; }
.check { display: flex; gap: 8px; align-items: center; }
.check input { width: auto; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.spacer { flex: 1; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 20px;
}

.notice {
  border-radius: var(--radius-s);
  padding: 10px 14px;
  font-size: 14px;
  background: var(--brand-soft);
}
.notice.error { background: var(--neg-soft); color: var(--neg); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 10px 18px; border-radius: var(--radius-s); font-size: 14px;
  z-index: 50; max-width: calc(100vw - 32px);
}
.toast.error { background: var(--neg); color: #fff; }

/* ---------- auth ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
}
.auth-box { width: min(400px, 100%); }
.auth-box h1 { margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 20px 0; }
.tabs button {
  border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: none; padding: 8px 4px; margin-right: 14px; color: var(--muted);
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side {
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand { font-weight: 700; font-size: 18px; padding: 0 10px 2px; }
.brand-sub { font-size: 13px; color: var(--muted); padding: 0 10px 18px; overflow: hidden; text-overflow: ellipsis; }
.nav button {
  width: 100%; border: 0; background: none; text-align: left;
  padding: 8px 10px; border-radius: var(--radius-s); color: var(--muted);
  justify-content: space-between;
}
.nav button.on { background: var(--brand-soft); color: var(--ink); font-weight: 500; }
.nav .count {
  font-size: 12px; background: var(--neg); color: #fff;
  border-radius: 10px; padding: 0 7px; line-height: 18px;
}
.side-foot { margin-top: auto; display: grid; gap: 6px; padding: 0 10px; font-size: 13px; }
.main { padding: 28px clamp(16px, 4vw, 44px) 60px; max-width: 1040px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap;
    border-right: 0; border-bottom: 1px solid var(--line); padding: 12px;
  }
  .brand-sub, .side-foot { display: none; }
  .brand { width: 100%; padding-bottom: 6px; }
  .nav { display: contents; }
  .nav button { width: auto; }
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); font-size: 13px; }
tr:last-child td { border-bottom: 0; }

.pill {
  display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px;
  background: var(--brand-soft); color: var(--ink); white-space: nowrap;
}
.pill.neg { background: var(--neg-soft); color: var(--neg); }
.pill.neu { background: var(--neu-soft); color: var(--neu); }
.pill.pos { background: var(--pos-soft); color: var(--pos); }

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