:root {
  --bg: #f5f6f8; --card: #ffffff; --text: #1f2430; --muted: #6b7280; --line: #e3e6eb;
  --brand: #1d4ed8; --brand-dark: #1e3a8a; --warn: #b45309; --warn-bg: #fef3c7; --err: #b91c1c; --err-bg: #fee2e2;
  --ok: #047857; --ok-bg: #d1fae5; --info-bg: #e0e7ff; --info: #3730a3;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.topbar { display: flex; align-items: center; gap: 24px; background: #111827; color: #fff; padding: 0 20px; height: 52px; }
.topbar .brand { font-weight: 600; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: #cbd5e1; text-decoration: none; padding: 6px 12px; border-radius: 6px; }
.topbar nav a.active, .topbar nav a:hover { background: #1f2937; color: #fff; }
.logout { display: flex; align-items: center; gap: 10px; margin: 0; }
.who { color: #cbd5e1; }
.btn-link { background: none; border: 0; color: #93c5fd; cursor: pointer; font: inherit; padding: 0; }
.page { max-width: 1280px; margin: 0 auto; padding: 20px; }
.page.narrow { max-width: 420px; padding-top: 10vh; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid .card { margin-bottom: 0; }
.grid + .card { margin-top: 16px; }
.facts { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.login h1 { margin-bottom: 0; }
.login form { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
label { font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=time], input[type=search] {
  font: inherit; padding: 8px 10px; border: 1px solid #cfd4dc; border-radius: 6px; width: 100%; background: #fff;
}
input:focus { outline: 2px solid #93c5fd; border-color: var(--brand); }
.btn { font: inherit; background: var(--brand); color: #fff; border: 0; border-radius: 6px; padding: 9px 16px; cursor: pointer; margin-top: 10px; }
.btn:hover { background: var(--brand-dark); }
.alert { padding: 10px 12px; border-radius: 6px; margin: 10px 0; }
.alert ul { margin: 6px 0 0 18px; padding: 0; }
.alert.error { background: var(--err-bg); color: var(--err); }
.alert.info { background: var(--info-bg); color: var(--info); }
.alert.success { background: var(--ok-bg); color: var(--ok); }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; margin: 1px 2px 1px 0; white-space: nowrap; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.flags { list-style: none; padding: 0; margin: 12px 0 0; }
.text-warn { color: var(--warn); }
.drive { margin-bottom: 12px; }
.drive-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.bar-used { height: 100%; width: 0; background: var(--brand); }
.bar-used.warn { background: var(--warn); }
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.table-head h2 { margin: 0; }
.table-filter { max-width: 260px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
table.sortable th { cursor: pointer; user-select: none; }
table.sortable th.asc::after { content: " \25B2"; }
table.sortable th.desc::after { content: " \25BC"; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.dim td { color: var(--muted); }
.settings .field { margin-bottom: 14px; max-width: 520px; }
.settings .check { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.has-error input { border-color: var(--err); }
.error-text { color: var(--err); font-size: 12px; }
.actions { margin-bottom: 16px; }

.badge.ok { background: var(--ok-bg); color: var(--ok); }
.btn.small { padding: 6px 12px; font-size: 13px; margin-top: 0; }
.btn.secondary { background: #475569; }
.btn.secondary:hover { background: #334155; }
.inline-actions { display: flex; gap: 8px; margin: 0; }
tr.selected td { background: #eef2ff; }
