/* Functional placeholder styling; the real design is made with Leon. */
:root {
  --bg: #ffffff; --fg: #1d1d1f; --muted: #6b6b70; --line: #e2e2e6; --panel: #f6f6f8;
  --accent: #0b6bcb; --accent-fg: #ffffff; --error: #b42318;
  --b: #34c759; --l: #ffe58a; --a: #ff6b5e; --today: #0b6bcb;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151517; --fg: #ececf0; --muted: #a0a0a8; --line: #2c2c31; --panel: #1e1e22;
    --accent: #4da3ff; --accent-fg: #0b0b0c; --error: #ff8a80;
    --b: #2f9e4f; --l: #8a7a2e; --a: #b8443b;
  }
}
:root[data-theme="dark"] {
  --bg: #151517; --fg: #ececf0; --muted: #a0a0a8; --line: #2c2c31; --panel: #1e1e22;
  --accent: #4da3ff; --accent-fg: #0b0b0c; --error: #ff8a80;
  --b: #2f9e4f; --l: #8a7a2e; --a: #b8443b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.muted { color: var(--muted); }
a { color: var(--accent); }
.error { color: var(--error); }
.top { display: flex; gap: 16px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.top nav { display: flex; gap: 4px; }
.top form { margin-left: auto; }
.tab { background: none; border: 0; padding: 6px 10px; border-radius: 6px; color: var(--fg); cursor: pointer; font: inherit; }
.tab.active { background: var(--panel); font-weight: 600; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; }
main { padding: 12px 16px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--fg); padding: 6px 12px; border-radius: 6px; cursor: pointer; font: inherit; text-decoration: none; display: inline-block; }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.danger { color: var(--error); }
input, select, textarea { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.legend { display: flex; gap: 6px; align-items: center; color: var(--muted); margin-left: auto; }
i.d { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.d.B { background: var(--b); } .d.L { background: var(--l); } .d.A { background: var(--a); }
.grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table.grid { border-collapse: collapse; font-size: 12px; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 0; text-align: center; }
.grid th.unit, .grid td.unit { position: sticky; left: 0; background: var(--bg); text-align: left; padding: 4px 8px; white-space: nowrap; min-width: 150px; z-index: 1; }
.grid th.day { width: 26px; min-width: 26px; padding: 4px 0; font-weight: 500; color: var(--muted); }
.grid th.day.we { color: var(--fg); }
.grid th.day.now { color: var(--today); font-weight: 700; }
.grid td.c { width: 26px; height: 26px; cursor: pointer; border-left: 1px solid var(--bg); }
.grid td.c.B { background: var(--b); } .grid td.c.L { background: var(--l); opacity: .55; } .grid td.c.A { background: var(--a); cursor: not-allowed; }
.grid td.c:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.grid tr.region td { background: var(--panel); font-weight: 600; text-align: left; padding: 4px 8px; position: sticky; left: 0; }
table.list { border-collapse: collapse; width: 100%; max-width: 900px; }
.list th, .list td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.list tr.click { cursor: pointer; } .list tr.click:hover { background: var(--panel); }
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); padding: 0; width: min(560px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .35); }
dialog form { padding: 16px; }
dialog h2 { margin: 0 0 12px; font-size: 18px; }
dialog menu { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 0; margin: 16px 0 0; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.fields label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.fields label.wide { grid-column: 1 / -1; }
.fields label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--fg); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
.hist { font-size: 12px; color: var(--muted); margin-top: 12px; max-height: 160px; overflow: auto; }
.login { display: grid; place-items: center; min-height: 100vh; }
.login-box { text-align: center; padding: 32px; border: 1px solid var(--line); border-radius: 12px; }
@media (max-width: 600px) { .fields { grid-template-columns: 1fr; } .legend { margin-left: 0; } }
[hidden] { display: none !important; }
