:root {
  --bg: #f5f6f7;
  --panel: #ffffff;
  --text: #1c2126;
  --muted: #5d6771;
  --line: #dde1e5;
  --accent: #0b6e8f;
  --accent-text: #ffffff;
  --error: #b3261e;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181c;
    --panel: #1d2329;
    --text: #e8ebee;
    --muted: #9aa5af;
    --line: #333c44;
    --accent: #4fb3d4;
    --accent-text: #08242e;
    --error: #f2998f;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
h1 { font-size: 20px; margin: 0; }
[hidden] { display: none !important; }

#login { max-width: 360px; margin: 10vh auto 0; }
#login h1 { margin-bottom: 20px; }
#login-form { display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }

input, select, button { font: inherit; color: inherit; }
input, select { width: 100%; padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
button { padding: 8px 14px; background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent); border-radius: 6px; cursor: pointer; white-space: nowrap; }
button.quiet { background: transparent; color: var(--text); border-color: var(--line); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.error { color: var(--error); margin: 0; min-height: 1.4em; }

#list header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
#filters { display: grid; grid-template-columns: 1fr 160px 150px 150px; gap: 10px; align-items: end; }
#summary { color: var(--muted); margin: 14px 0 8px; min-height: 1.4em; }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 13px; font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }
td.name { white-space: normal; min-width: 160px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

#pager { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

@media (max-width: 720px) {
  #filters { grid-template-columns: 1fr 1fr; }
  #q { grid-column: 1 / -1; }
  #filters > :first-child { grid-column: 1 / -1; }
}
