:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #667085;
  --border: #e3e6eb; --accent: #1f5eff; --head: #f0f2f5; --stripe: #fafbfc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --card: #1a1f27; --text: #e6e8ec; --muted: #9aa3b2;
    --border: #2b323d; --accent: #6b93ff; --head: #222833; --stripe: #1e242d;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.topbar { padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--card); }
.brand { font-weight: 600; color: var(--text); text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px 24px; margin-bottom: 20px; }
h1 { font-size: 1.4rem; margin: 0 0 6px; word-break: break-all; }
h2 { font-size: 1.1rem; margin: 0 0 4px; }
.muted { color: var(--muted); margin: 4px 0 12px; }
.flash { background: #fff4e5; color: #7a4b00; border: 1px solid #f5d29a; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.upload { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
button[type=submit] { background: var(--accent); color: #fff; border: 0; padding: 8px 18px; border-radius: 6px; cursor: pointer; font: inherit; }
.filelist { padding-left: 18px; margin: 0; }
.filelist a, .btn-link { color: var(--accent); }
.viewhead { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; cursor: pointer; color: var(--muted); font: inherit; white-space: nowrap; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.hidden { display: none; }
.tablewrap { overflow: auto; max-height: 75vh; border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--border); padding: 6px 10px; text-align: left; white-space: nowrap; }
table.grid thead th { position: sticky; top: 0; background: var(--head); }
table.grid tbody tr:nth-child(even) { background: var(--stripe); }
.actions { display: flex; gap: 16px; align-items: center; }
.btn { background: var(--accent); color: #fff; border: 0; padding: 8px 16px; border-radius: 6px; cursor: pointer; font: inherit; }
