:root {
  color-scheme: light dark;
  --bg: light-dark(#f6f5f0, #151a17); --surface: light-dark(#ffffff, #1d2420); --ink: light-dark(#1f2a24, #e8ede9); --muted: light-dark(#66726b, #9aa8a0); --line: light-dark(#dfe3dc, #2f3a34);
  --brand: light-dark(#2f5d46, #7fc29d); --brand-ink: light-dark(#ffffff, #11201a);
  --out: light-dark(#a3262a, #ff9a9d); --critical: light-dark(#b4570a, #ffb870); --reorder: light-dark(#8a6d00, #f0d46a); --ok: light-dark(#2f6b43, #8fd4a8); --info: light-dark(#2c5a8a, #8fbbe8);
  --out-bg: light-dark(#fbe9ea, #3a1f21); --critical-bg: light-dark(#fdeedd, #3a2a18); --reorder-bg: light-dark(#fbf3d3, #38321a); --ok-bg: light-dark(#e5f3ea, #1d3226); --info-bg: light-dark(#e6eef7, #1c2b3d);
  --radius: 10px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
.top { display: flex; align-items: center; gap: 24px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.top nav { display: flex; gap: 18px; }
.top nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }
main { max-width: 1180px; margin: 0 auto; padding: 24px; }
h1 { font-size: 26px; margin: 8px 0 4px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.banner { background: var(--info-bg); color: var(--info); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 16px; }
.banner.warn { background: var(--critical-bg); color: var(--critical); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 18px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; display: block; }
a.card:hover { border-color: var(--brand); }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0 6px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile .n { font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); font-size: 13px; }
.tile.out .n { color: var(--out); } .tile.critical .n { color: var(--critical); } .tile.reorder .n { color: var(--reorder); } .tile.late .n { color: var(--out); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; align-items: center; }
input[type=search], select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
input[type=search] { min-width: 240px; }
button { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
button:hover { border-color: var(--brand); }
.theme-toggle { margin-left: auto; width: 36px; height: 36px; padding: 0; font-size: 18px; line-height: 1; }
.button { display: inline-block; padding: 9px 16px; border-radius: 8px; background: var(--brand); color: var(--brand-ink); font-weight: 600; text-decoration: none; }
button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.tablewrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; user-select: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
.repo td.module { border-bottom: 1px solid var(--line); }
.repo tbody tr:last-child td.module { border-bottom: 0; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.out, .badge.late { background: var(--out-bg); color: var(--out); }
.badge.critical { background: var(--critical-bg); color: var(--critical); }
.badge.reorder, .badge.due-today, .badge.due-soon { background: var(--reorder-bg); color: var(--reorder); }
.badge.ok, .badge.closed, .badge.scheduled { background: var(--ok-bg); color: var(--ok); }
.badge.no-data, .badge.no-date { background: var(--info-bg); color: var(--info); }
.cover { display: inline-block; vertical-align: middle; width: 70px; height: 7px; background: var(--line); border-radius: 4px; margin-right: 8px; overflow: hidden; }
.cover > i { display: block; height: 100%; background: var(--brand); }
.muted { color: var(--muted); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.tabs span { font-size: 12px; color: var(--muted); }
.repo th { cursor: default; }
.repo td { vertical-align: middle; }
.repo td.module { font-weight: 600; vertical-align: top; padding-top: 15px; border-right: 1px solid var(--line); }
.repo td.title { width: 100%; white-space: normal; min-width: 220px; }
.repo .code { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 10px; }
.repo td.action { text-align: right; }
.button.small { padding: 5px 12px; font-size: 13px; }
.button[aria-disabled="true"] { opacity: .5; }
.folder { margin-bottom: 10px; }
.folder summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-weight: 600; cursor: pointer; }
.folder summary:hover { border-color: var(--brand); }
.folder[open] summary { margin-bottom: 8px; }
.drag { float: right; margin: -5px -6px; padding: 5px 10px; border: 0; background: none; color: var(--muted); cursor: grab; touch-action: none; user-select: none; }
.folder.dragging summary { border-color: var(--brand); box-shadow: 0 4px 14px rgb(0 0 0 / .25); }
.folder.dragging .drag { cursor: grabbing; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.empty { padding: 30px; text-align: center; color: var(--muted); }
@media (max-width: 640px) { main { padding: 16px; } .top { flex-wrap: wrap; padding: 12px 16px; gap: 8px 14px; } .top nav { order: 1; width: 100%; } }
