
:root {
  --bg:#0f1419; --card:#1a2332; --line:#2a3548; --text:#e7ecf3; --muted:#9aa7b8;
  --accent:#3b82f6; --good:#22c55e; --warn:#f59e0b; --accent-soft:rgba(59,130,246,.18);
}
* { box-sizing:border-box; }
body { margin:0; font-family: ui-sans-serif, system-ui, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:var(--bg); color:var(--text); }
.top { display:flex; flex-wrap:wrap; gap:12px; align-items:center; padding:14px 18px;
  border-bottom:1px solid var(--line); background:#0c1016; position:sticky; top:0; z-index:10; }
.brand { font-weight:700; letter-spacing:.02em; }
.tabs button { background:transparent; border:1px solid var(--line); color:var(--muted);
  padding:8px 14px; border-radius:8px; cursor:pointer; margin-right:6px; }
.tabs button.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.meta { margin-left:auto; color:var(--muted); font-size:12px; }
.panel { display:none; padding:16px 18px 40px; }
.panel.active { display:block; }
.filters { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:14px; align-items:flex-end; }
.filters label { color:var(--muted); font-size:13px; display:flex; gap:6px; align-items:center; }
.filters input, .filters select { background:var(--card); color:var(--text); border:1px solid var(--line);
  border-radius:6px; padding:6px 8px; }
.date-range-field {
  position:relative; z-index:6; display:flex; flex-direction:column; gap:4px;
  color:var(--muted); font-size:13px; min-width:220px;
}
.date-range-button {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  width:100%; min-width:220px; min-height:34px; padding:6px 10px;
  border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--text);
  cursor:pointer; text-align:left; font-size:13px;
}
.date-range-button::after {
  content:""; width:8px; height:8px; border-right:2px solid var(--muted); border-bottom:2px solid var(--muted);
  transform:translateY(-2px) rotate(45deg); flex:0 0 auto;
}
.date-range-field.is-open { z-index:40; }
.date-range-field.is-open .date-range-button::after { transform:translateY(2px) rotate(225deg); }
.date-range-panel {
  position:absolute; top:calc(100% + 4px); left:0; z-index:45; width:320px;
  border:1px solid var(--line); border-radius:8px; background:#152033;
  box-shadow:0 14px 32px rgba(0,0,0,.45); padding:8px;
}
.date-range-shortcuts {
  display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:4px; margin-bottom:8px;
}
.date-range-shortcuts button,
.calendar-grid button {
  min-height:30px; border:1px solid var(--line); border-radius:6px;
  background:var(--card); color:var(--text); cursor:pointer; font-size:12px;
}
.date-range-shortcuts button:hover,
.date-range-shortcuts button.is-active,
.calendar-grid button:hover,
.calendar-grid button.is-selected,
.calendar-grid button.is-in-range {
  background:var(--accent-soft); color:#fff; border-color:var(--accent);
}
.calendar-header {
  display:grid; grid-template-columns:34px minmax(0,1fr) 34px; align-items:center; gap:6px; margin-bottom:6px;
}
.calendar-header strong { color:var(--text); font-size:13px; text-align:center; }
.ghost-button, .calendar-nav-button {
  min-height:30px; padding:0; border:1px solid var(--line); border-radius:6px;
  background:var(--card); color:var(--text); cursor:pointer;
}
.calendar-weekdays, .calendar-grid {
  display:grid; grid-template-columns:repeat(7, minmax(0,1fr)); gap:4px;
}
.calendar-weekdays span {
  color:var(--muted); font-size:11px; font-weight:700; text-align:center;
}
.calendar-grid button.is-muted { color:#66788f; }
.calendar-grid button.is-disabled { opacity:.35; cursor:not-allowed; }
.kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; margin-bottom:14px; }
.kpi { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:12px 14px; }
.performance-asof { color:var(--muted); font-size:12px; align-self:center; }
.performance-details { margin-top:18px; color:var(--muted); font-size:12px; line-height:1.8; }
#pf-table td:last-child { font-weight:700; color:#a9ceff; }
.kpi .label { color:var(--muted); font-size:12px; }
.kpi .value { font-size:22px; font-weight:700; margin-top:4px; }
.chart-wrap { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:12px;
  height:320px; margin-bottom:18px; }
h3 { margin:8px 0 10px; font-size:15px; color:var(--muted); font-weight:600; }
.table-wrap { overflow:auto; max-height:480px; border:1px solid var(--line); border-radius:10px; }
table { width:100%; border-collapse:collapse; font-size:13px; }
th, td { padding:8px 10px; border-bottom:1px solid var(--line); text-align:left; white-space:nowrap; }
th { position:sticky; top:0; background:#152033; color:var(--muted); font-weight:600; z-index:5; }
td { background:var(--bg); }
tr:hover td { background:#152033; }
.ord-cell { vertical-align:middle; white-space:nowrap; }
.ord-wrap { display:inline-flex; align-items:center; gap:3px; }
.ord-main { font-weight:700; font-size:15px; line-height:1; }
.ord-frac { display:inline-flex; flex-direction:column; align-items:center; justify-content:center; font-size:10px; line-height:1.05; color:var(--muted); font-weight:400; }
.ord-frac .ord-t, .ord-frac .ord-o { text-align:center; min-width:1.2em; }
.ord-frac .ord-sep { display:block; width:100%; min-width:10px; height:0; border-top:1px solid var(--muted); opacity:.55; margin:1px 0; }
.foot { padding:12px 18px 28px; color:var(--muted); font-size:12px; border-top:1px solid var(--line); }
.foot pre { white-space:pre-wrap; background:var(--card); padding:10px; border-radius:8px; }

.meta {display:flex;align-items:center;gap:12px;font-variant-numeric:tabular-nums}
.meta strong {font-size:13px;color:var(--text)}
.multi-field {display:grid;gap:4px;color:var(--muted);font-size:13px}
.multi {position:relative;min-width:112px}
.multi summary,.multi-clear,.pager button,.pager select,.detail-head input,.switches button {background:var(--card);color:var(--text);border:1px solid var(--line);border-radius:6px;font:inherit}
.multi summary {display:flex;align-items:center;justify-content:space-between;gap:10px;cursor:pointer;padding:7px 10px;min-height:34px;max-width:240px;overflow:hidden;list-style:none}
.multi summary::after {content:"▾";color:var(--muted);margin-left:auto}
.multi summary::-webkit-details-marker {display:none}
.multi[open] {z-index:42}
.multi-menu {position:absolute;top:calc(100% + 4px);left:0;padding:8px;min-width:100%;width:max-content;max-width:min(340px,86vw);background:#152033;border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 24px #0007}
.multi-options {max-height:260px;overflow:auto}
.multi-options label {cursor:pointer;align-items:baseline;overflow-wrap:anywhere;padding:6px;line-height:1.4}
.multi-options label:hover {background:var(--card)}
.multi-options input {accent-color:var(--accent)}
.multi-clear {padding:4px 12px;margin-bottom:4px;cursor:pointer}
.switches {display:flex;gap:2px;width:max-content;padding:3px;background:#0c111a;border:1px solid var(--line);border-radius:8px;margin:0 0 12px}
.switches button {background:transparent;border-color:transparent;color:var(--muted);padding:5px 12px;cursor:pointer;font-size:13px}
.switches button[aria-pressed=true] {background:#24354b;color:#fff;border-color:#3b5069}
.detail-head,.pager {display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px}
.detail-head {justify-content:space-between;margin:14px 0 8px}
.detail-head h3 {margin:0;color:var(--text)}
.detail-head input {padding:7px 10px;font-size:13px;width:clamp(210px,32vw,340px);max-width:100%}
.pager {justify-content:flex-end;margin-top:8px;color:var(--muted);font-size:12px}
.pager button,.pager select {padding:5px 8px}
.pager button {cursor:pointer}
.pager button:disabled {opacity:.45;cursor:default}
th button {border:0;padding:0;cursor:pointer;color:inherit;background:none;font:inherit}
th button span {color:#8192a9;font-size:11px}
th[aria-sort=ascending] button,th[aria-sort=descending] button {color:#b9d9ff}
.empty {text-align:center;color:var(--muted);padding:22px}
.metric-warning {display:inline-grid;place-items:center;vertical-align:middle;margin-left:4px;width:15px;height:15px;border:1px solid #eab644;border-radius:50%;background:#382c12;color:#ffcf61;font:700 11px/1 system-ui;cursor:help;padding:0}
#metric-tip {position:fixed;z-index:80;max-width:min(300px,90vw);padding:8px 11px;border:1px solid #876a31;background:#282318;color:#ffe1a0;border-radius:6px;box-shadow:0 4px 16px #0006;font-size:12px;line-height:1.5;pointer-events:none}
:focus-visible {outline:2px solid #8ebeff;outline-offset:2px}
@media(max-width:640px){.meta{flex-basis:100%;margin:0}.date-range-panel{max-width:calc(100vw - 38px)}.multi-field{position:static}.filters{position:relative}.multi[open]{position:static}.multi-menu{top:auto;left:0;right:0;width:auto;max-width:100%;z-index:45}}
