:root {
  color-scheme: light;
  --bg: #f4f6fa; --panel: #fff; --nav: #101b2c; --nav-text: #a7b6ce;
  --nav-active: #243754; --text: #18243a; --muted: #566680; --line: #dce3ed;
  --accent: #2258ad; --action: #285fbc; --accent-soft: #eaf2ff; --on-action: #fff;
  --success: #08744f; --warning: #805307; --danger: #a02738;
  --warning-soft: #fff4d7; --danger-soft: #ffecef; --track: #e5ebf3;
  --chart-a: #2e60b6; --chart-b: #0b887e; --chart-c: #7282ad; --chart-d: #b8c8e1; --chart-e: #876a31;
  --shadow: 0 1px 2px rgb(16 27 44 / 5%);
  font: 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101827; --panel: #172236; --nav: #0a1221; --nav-text: #aab9d2;
    --nav-active: #253955; --text: #edf3ff; --muted: #a8b8d0; --line: #303e55;
    --accent: #9bc4ff; --action: #9bc4ff; --accent-soft: #203653; --on-action: #0d1a30;
    --success: #6ed4ab; --warning: #ffce75; --danger: #ffa4af;
    --warning-soft: #382c1b; --danger-soft: #3f2330; --track: #2b3a50;
    --chart-a: #6c9aed; --chart-b: #39b6a4; --chart-c: #9d91df; --chart-d: #475976; --chart-e: #e5a45e;
    --shadow: 0 1px 2px rgb(0 0 0 / 15%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101827; --panel: #172236; --nav: #0a1221; --nav-text: #aab9d2;
  --nav-active: #253955; --text: #edf3ff; --muted: #a8b8d0; --line: #303e55;
  --accent: #9bc4ff; --action: #9bc4ff; --accent-soft: #203653; --on-action: #0d1a30;
  --success: #6ed4ab; --warning: #ffce75; --danger: #ffa4af;
  --warning-soft: #382c1b; --danger-soft: #3f2330; --track: #2b3a50;
  --chart-a: #6c9aed; --chart-b: #39b6a4; --chart-c: #9d91df; --chart-d: #475976; --chart-e: #e5a45e;
  --shadow: 0 1px 2px rgb(0 0 0 / 15%);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, input:not([type="checkbox"]), select {
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel);
  color: var(--text); min-height: 36px; padding: 6px 10px;
}
button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; }
button:disabled { opacity: .55; cursor: wait; }
button:hover:enabled, .file-name:hover { background: var(--accent-soft); }
button.primary { background: var(--action); color: var(--on-action); border-color: transparent; }
button.primary:hover:enabled { opacity: .9; background: var(--action); }
button.quiet { border-color: transparent; background: transparent; }
button.small { min-height: 29px; font-size: .9rem; padding: 3px 7px; }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--action); vertical-align: middle; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 2.4vw, 2.15rem); line-height: 1.2; letter-spacing: -.035em; }
h2 { font-size: 1.08rem; letter-spacing: -.01em; }
p + p { margin-top: 8px; }
.icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only, .skip:not(:focus) { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; position: absolute; white-space: nowrap; }
.skip:focus { position: fixed; z-index: 10; background: var(--panel); padding: 10px; }
.muted { color: var(--muted); }
.shell { min-height: 100dvh; display: grid; grid-template-columns: 225px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 26px; background: var(--nav); color: var(--nav-text); padding: 22px 14px 14px; position: sticky; top: 0; height: 100dvh; overflow: auto; }
.brand { display: flex; gap: 11px; align-items: center; text-decoration: none; color: inherit; font-weight: 750; font-size: 1.08rem; line-height: 1.2; }
.sidebar .brand { color: #f5f8ff; padding: 0 6px; }
.brand small { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); margin-top: 3px; }
.sidebar .brand small { color: var(--nav-text); }
.brand-icon { display: grid; place-items: center; width: 37px; height: 37px; background: #2d5bad; color: #fff; border-radius: 10px; }
.brand-icon .icon { width: 21px; height: 21px; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a, .sidebar-foot button { display: flex; align-items: center; text-decoration: none; color: inherit; gap: 10px; padding: 9px 10px; border-radius: 7px; font-size: .93rem; }
.sidebar nav a:hover, .sidebar-foot button:hover { background: var(--nav-active); }
.sidebar nav a[aria-current] { background: var(--nav-active); color: #f7faff; }
.sidebar :focus-visible { outline-color: #99bfff; }
.sidebar-foot { border-top: 1px solid var(--nav-active); margin-top: auto; padding: 12px 5px 0; font-size: .78rem; }
.sidebar-foot button { margin: 5px 0 0 -5px; font-weight: 500; }
.topbar { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px clamp(12px, 3vw, 36px); background: var(--panel); border-bottom: 1px solid var(--line); }
.top-status, .theme-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.theme-label { margin-left: auto; }
.theme-label select { min-height: 30px; }
.dot { width: 8px; height: 8px; border-radius: 100%; background: var(--muted); }
.dot[data-state="ok"] { background: var(--success); }
.dot[data-state="warning"] { background: var(--warning); }
.menu-toggle { display: none; }
.workspace main { padding: 24px clamp(12px, 3vw, 36px) 35px; max-width: 1600px; margin: auto; }
.notice { display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); }
.notice.mock { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.notice.error { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 18px; flex-wrap: wrap; }
.page-head p { margin-top: 5px; }
.panel, .metric { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric { padding: 13px 14px; display: grid; gap: 3px; }
.metric-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: .86rem; }
.metric-label .icon { color: var(--accent); width: 16px; height: 16px; }
.metric strong { font-size: clamp(1.2rem, 2vw, 1.65rem); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.metric small { color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card { padding: 15px; }
.chart-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 12px; }
.chart-head p { font-size: .86rem; color: var(--muted); }
.storage-chart { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.donut { width: clamp(118px, 12vw, 155px); aspect-ratio: 1; }
.donut .ring { fill: none; stroke-width: 13; }
.donut text { fill: var(--text); font-size: 14px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.donut .ring-track { stroke: var(--track); }
.c0 { --segment: var(--chart-a); } .c1 { --segment: var(--chart-b); } .c2 { --segment: var(--chart-c); } .c3 { --segment: var(--chart-d); } .c4 { --segment: var(--chart-e); }
.ring[class*="c"] { stroke: var(--segment, var(--track)); }
.legend { flex: 1; min-width: 155px; padding: 0; margin: 0; list-style: none; }
.legend li, .detail-grid > div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; }
.legend li span:first-child { display: flex; align-items: center; gap: 7px; }
.swatch { width: 9px; height: 9px; border-radius: 2px; background: var(--segment); }
.age-chart { display: grid; gap: 3px; }
.age-chart button { display: grid; grid-template-columns: 68px minmax(0,1fr) 68px; text-align: left; font-size: .83rem; min-height: 25px; padding: 2px 4px; }
.age-chart button span:last-child { text-align: right; }
.bar { width: 100%; height: 10px; display: block; }
.bar rect:first-child { fill: var(--track); } .bar rect:last-child { fill: var(--chart-a); }
.dashboard-status { margin-top: 14px; }
.detail-grid { margin: 6px 0 0; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.detail-grid > div + div { border-top: 1px solid var(--line); }
.toolbar, .filters, .pager, .breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar { margin-bottom: 11px; }
.toolbar input[type="search"] { width: min(275px, 100%); }
.filters { padding: 10px 0; }
.filters label { display: grid; gap: 2px; font-size: .85rem; color: var(--muted); }
.filters input[type="text"] { width: 100px; }
.breadcrumbs { margin-bottom: 9px; color: var(--muted); }
.breadcrumbs button { color: var(--accent); }
.table-wrap { overflow: auto; max-height: 65vh; min-height: 120px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; background: var(--panel); color: var(--muted); z-index: 1; white-space: nowrap; }
th button { color: inherit; }
td { vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.dense td { padding-top: 3px; padding-bottom: 3px; }
td.file-date, td.file-size { white-space: nowrap; }
td.file-size { font-variant-numeric: tabular-nums; }
tr.selected { background: var(--accent-soft); }
.file-name { text-align: left; font-weight: 650; min-height: 25px; padding: 1px 4px; }
.file-name .icon { color: var(--accent); width: 17px; height: 17px; }
.file-path { display: block; margin-left: 25px; color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.pager { padding: 9px 10px; border-top: 1px solid var(--line); justify-content: space-between; }
.pager button:disabled { cursor: default; }
.empty { padding: 24px 15px; color: var(--muted); }
.selection { margin-bottom: 10px; }
.selection .muted { margin-right: auto; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; width: min(620px, calc(100% - 24px)); max-height: 85vh; padding: 16px; }
dialog::backdrop { background: rgb(8 17 30 / 60%); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dialog-head h2, .preview-files { overflow-wrap: anywhere; }
.preview-files { padding-left: 20px; margin-bottom: 0; }
.toast { position: fixed; z-index: 8; right: 15px; bottom: 15px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); max-width: calc(100% - 30px); }
.login { display: grid; place-items: center; min-height: 100dvh; padding: 16px; }
.login-card { width: min(390px, 100%); padding: 24px; display: grid; gap: 16px; }
.login-card h1 { font-size: 1.45rem; }
.login-card form { display: grid; gap: 9px; }
.login-card .notice { margin: 0; }
@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 840px) {
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .shell { display: block; }
  .sidebar { display: none; height: auto; position: static; gap: 14px; }
  .sidebar.open { display: flex; }
  .menu-toggle { display: inline-flex; }
  .topbar { min-height: 50px; }
  .workspace main { padding-top: 15px; }
  .metric { padding: 9px 10px; }
  .top-status { font-size: .78rem; }
  .theme-label .icon { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  button, .sidebar nav a { transition: background-color .12s ease, opacity .12s ease; }
}
.login-foot { display: flex; align-items: center; gap: 10px; }
.pager .toolbar, .page-head .toolbar { margin-bottom: 0; }
