:root {
  --bg: #101418;
  --surface: #1a2129;
  --surface2: #232d38;
  --text: #e8edf2;
  --muted: #9fb0c0;
  --border: #33404d;
  --accent: #4da3ff;
  --good: #4caf7d;
  --bad: #e05d5d;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
header { padding: 12px 16px 0; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.header-row { display: flex; justify-content: space-between; align-items: center; }
h1 { font-size: 20px; margin: 4px 0; }
h2 { font-size: 17px; margin: 18px 0 8px; }
h3 { font-size: 15px; margin: 12px 0 6px; }
nav#tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; }
nav#tabs button { background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 16px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
nav#tabs button.active { background: var(--accent); color: #06121f; font-weight: 600; border-color: var(--accent); }
main { padding: 8px 16px 48px; max-width: 960px; margin: 0 auto; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--bad); }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin: 10px 0; }
.row-line { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.row-line:last-child { border-bottom: none; }
button { background: var(--accent); color: #06121f; border: none; border-radius: 8px; padding: 7px 12px; cursor: pointer; font-weight: 600; }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); font-weight: 400; }
button.small { padding: 4px 9px; font-size: 13px; }
button.danger { background: var(--bad); color: #fff; }
input, select, textarea { background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px; font-size: 14px; }
input[type="number"] { width: 110px; }
textarea { width: 100%; min-height: 44px; }
label { font-size: 13px; color: var(--muted); display: block; margin: 6px 0 2px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; z-index: 50; }
.login-card { width: min(340px, 90vw); display: flex; flex-direction: column; gap: 10px; }
.chip { display: inline-block; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; margin: 2px 4px 2px 0; font-size: 13px; }
.tag { font-size: 11px; border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.tag-potential { background: #6b5510; color: #ffd94d; }
.tag-sched { background: #274b73; color: #a9cdf5; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 16px; border-bottom: 2px solid var(--border); padding-bottom: 4px; }
.tx-row { cursor: pointer; }
.tx-row:hover { background: var(--surface2); }
.editor { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin: 6px 0 10px; }
.pies { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.pie-card { text-align: center; cursor: pointer; opacity: .75; }
.pie-card.active { opacity: 1; outline: 2px solid var(--accent); }
.pie-card svg { max-width: 230px; width: 100%; height: auto; }
.cat-row { cursor: pointer; }
.cat-row:hover { background: var(--surface2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.big { font-size: 22px; font-weight: 700; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
