:root {
  --bg: #f6f7f9; --surface: #fff; --text: #16191d; --muted: #5d6673; --line: #dde1e7;
  --accent: #0b6bcb; --accent-ink: #fff; --danger: #b42318; --ok: #067647; --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111418; --surface: #1a1f25; --text: #eceff3; --muted: #9aa5b3; --line: #2c333c; --accent: #4da3ff; --accent-ink: #06121f; --danger: #ff8a80; --ok: #4ade80; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 1.4rem; margin: 0 0 .25rem; } h2 { font-size: 1.1rem; margin: 0; }
.muted { color: var(--muted); } .row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; } .grow { flex: 1; }
.auth { max-width: 380px; margin: 8vh auto; padding: 0 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
label { display: block; font-size: .85rem; color: var(--muted); margin: .75rem 0 .25rem; }
input, select, textarea { width: 100%; padding: .55rem .65rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
button.danger { color: var(--danger); } button:disabled { opacity: .55; cursor: not-allowed; }
a { color: var(--accent); } .link { background: none; border: 0; color: var(--accent); padding: 0; text-decoration: underline; cursor: pointer; }
.err { color: var(--danger); font-size: .88rem; min-height: 1.2em; margin-top: .5rem; }
header.top { display: flex; gap: 12px; align-items: center; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
header.top strong { margin-right: 8px; }
nav.tabs { display: flex; gap: 4px; } nav.tabs button { border-color: transparent; background: none; }
nav.tabs button[aria-current="page"] { background: var(--bg); border-color: var(--line); font-weight: 600; }
main { padding: 16px; max-width: 1200px; margin: 0 auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: .55rem .75rem; border-bottom: 1px solid var(--line); } th { color: var(--muted); font-weight: 600; font-size: .82rem; }
tr:last-child td { border-bottom: 0; } .empty { padding: 28px; text-align: center; color: var(--muted); }
.tag { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); margin-right: 4px; }
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { min-width: 250px; width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.col.over { outline: 2px dashed var(--accent); }
.col h3 { margin: 0 0 8px; font-size: .9rem; display: flex; justify-content: space-between; }
.lead { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; cursor: grab; }
.lead.dragging { opacity: .5; } .lead small { color: var(--muted); display: block; }
.lead.won { border-left: 3px solid var(--ok); } .lead.lost { border-left: 3px solid var(--danger); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; }
.modal { width: min(460px, 100%); }
#toast { position: fixed; right: 16px; bottom: 16px; max-width: min(360px, 90vw); }
#toast div { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 8px; margin-top: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
#toast div.bad { border-left-color: var(--danger); }
@media (max-width: 640px) { th:nth-child(n+4), td:nth-child(n+4) { display: none; } }
@media (prefers-reduced-motion: no-preference) { button { transition: background .12s; } }

.mt { margin-top: 14px; } .mb { margin-bottom: 12px; } select.auto { width: auto; }

select.move { margin-top: 6px; padding: .25rem .4rem; font-size: .8rem; }
