:root {
  color-scheme: light;
  --ink: #18253a;
  --muted: #596a82;
  --subtle: #718096;
  --line: #dce5ef;
  --canvas: #f5f8fc;
  --surface: #fff;
  --blue: #2559c4;
  --blue-dark: #1b4293;
  --blue-tint: #edf3ff;
  --teal: #087a70;
  --teal-tint: #e9f8f4;
  --orange: #8a4a0c;
  --orange-tint: #fff4e4;
  --red: #9d3341;
  --red-tint: #fff0f1;
  --radius: 12px;
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid #86a9ff; outline-offset: 2px; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.55rem, 2.5vw, 2.03rem); letter-spacing: -.025em; line-height: 1.24; }
h2 { font-size: 1.15rem; line-height: 1.35; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.numeric { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.danger-text { color: var(--red); }
.stack { display: grid; gap: 14px; }
.row, .cluster { display: flex; align-items: center; gap: 10px; }
.cluster { flex-wrap: wrap; }
.between { justify-content: space-between; }
.align-end { align-items: end; }
.skip-link { position: fixed; top: -60px; left: 15px; z-index: 20; padding: 10px; background: white; }
.skip-link:focus { top: 10px; }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 213px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100dvh; padding: 23px 13px 16px; display: flex;
  flex-direction: column; background: #fdfefe; border-right: 1px solid var(--line); z-index: 3;
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 7px 23px; color: var(--ink); }
.brand-mark {
  display: grid; place-items: center; width: 39px; height: 39px; border-radius: 11px;
  background: var(--blue); color: #fff; flex: none;
}
.brand-mark svg { width: 23px; height: 23px; }
.brand strong { font-size: 1.15rem; letter-spacing: .03em; display: block; }
.brand small { color: var(--muted); font-size: .76rem; display: block; }
#navigation { overflow: auto; scrollbar-width: thin; }
.nav-group { margin-bottom: 17px; }
.nav-label { color: var(--subtle); padding: 0 10px 5px; font-size: .76rem; letter-spacing: .08em; }
.nav-item {
  display: flex; align-items: center; min-height: 39px; padding: 8px 10px; gap: 11px;
  border-radius: 8px; color: #43536c; margin-bottom: 2px; font-weight: 520;
}
.nav-item svg { width: 17px; height: 17px; }
.nav-item:hover { background: #f2f6fa; color: var(--ink); }
.nav-item[aria-current="page"] { color: #234eac; background: var(--blue-tint); font-weight: 680; }
.side-footer {
  margin: auto 6px 0; color: var(--muted); font-size: .8rem; padding: 11px 4px 0; display: flex;
  align-items: center; gap: 8px; border-top: 1px solid var(--line);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #189e8e; flex: none; }
.main-shell { min-width: 0; }
.topbar {
  min-height: 63px; padding: 9px 26px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; border-bottom: 1px solid var(--line); background: #fff;
}
.top-left, .top-right { display: flex; align-items: center; gap: 12px; }
.crumb { color: var(--muted); font-size: .9rem; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; border-radius: 8px; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar {
  display: inline-grid; place-items: center; width: 31px; height: 31px; border-radius: 9px;
  background: #eaf0fc; color: #2f59a6; font-weight: 700;
}
.chevron { color: var(--muted); }
.menu { position: absolute; right: 0; z-index: 5; min-width: 138px; top: 40px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 10px 30px #17294412; }
.menu a, .menu button { display: block; text-align: left; width: 100%; color: var(--ink); border: none; background: none;
  padding: 8px; border-radius: 6px; }
.menu a:hover, .menu button:hover { background: var(--blue-tint); }
.content { padding: 25px 26px 40px; max-width: 1580px; margin: 0 auto; display: grid; gap: 16px; }
.content:focus { outline: none; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 2px; }
.eyebrow { color: var(--blue); font-size: .77rem; font-weight: 720; letter-spacing: .12em; margin-bottom: 6px; }
.page-head p:not(.eyebrow) { margin-top: 7px; color: var(--muted); }
.panel { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel.flush { padding: 0; }
.panel-header { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.panel-header p { margin-top: 4px; }
.subline { margin: 5px 0 0; color: var(--muted); font-size: .84rem; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 9px 12px; }
.toolbar > label { min-width: 110px; }
.toolbar > .search-field { flex: 1 1 210px; max-width: 350px; }
label { display: grid; gap: 5px; font-size: .85rem; color: var(--muted); font-weight: 560; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 37px; background: #fff; border: 1px solid #cbd7e7;
  border-radius: 7px; padding: 7px 9px; color: var(--ink); font-weight: 400;
}
input::placeholder, textarea::placeholder { color: #6e7c90; }
input[type="file"] { padding: 6px; }
input[type="checkbox"] { accent-color: var(--blue); width: 16px; height: 16px; min-height: 0; margin: 0; flex: none; }
input[readonly], input:disabled, select:disabled { background: #f4f6f9; }
textarea { resize: vertical; min-height: 74px; }
.check { display: flex; flex-direction: row; align-items: center; gap: 8px; min-height: 28px; color: var(--ink); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 37px;
  padding: 7px 12px; font-weight: 650; border: 1px solid #cdd9e9; border-radius: 8px;
  color: #32465e; background: #fff; white-space: nowrap;
}
.button:hover { background: #f2f6fc; color: var(--blue-dark); }
.button.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button.primary:hover { background: var(--blue-dark); }
.button.link { color: var(--blue); background: transparent; border-color: transparent; padding-inline: 6px; }
.button.danger-button { color: var(--red); }
.button.icon-button { width: 36px; padding: 7px; }
.button.small-button { min-height: 31px; font-size: .83rem; padding: 4px 8px; }
.button svg { width: 16px; height: 16px; }
.tag { display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; padding: 2px 8px; font-size: .79rem;
  line-height: 1.6; font-weight: 650; color: #4d6178; background: #eff3f8; white-space: nowrap; }
.tag.blue { color: #2751a4; background: var(--blue-tint); }
.tag.teal { color: #086a62; background: var(--teal-tint); }
.tag.warn { color: var(--orange); background: var(--orange-tint); }
.tag.red { color: var(--red); background: var(--red-tint); }
.callout { border: 1px solid #cbdaf6; background: #f1f6ff; color: #274678; border-radius: 8px; padding: 10px 13px; }
.callout.warn { background: #fff7eb; border-color: #efdab6; color: var(--orange); }
.callout.danger { background: var(--red-tint); border-color: #f0ccd1; color: var(--red); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.metric { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 640; }
.metric-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; color: var(--blue);
  background: var(--blue-tint); }
.metric-icon.teal { color: var(--teal); background: var(--teal-tint); }
.metric-icon.warn { color: var(--orange); background: var(--orange-tint); }
.metric-icon svg { width: 17px; height: 17px; }
.metric-number { font-size: clamp(1.35rem, 2vw, 1.82rem); font-weight: 750; line-height: 1.2; margin-top: 6px; letter-spacing: -.025em; }
.metric-number small { color: var(--muted); font-size: .78rem; font-weight: 580; }
.unit-totals { display: flex; flex-wrap: wrap; gap: 3px 13px; }
.metric-foot { color: var(--muted); font-size: .8rem; margin-top: 6px; min-height: 20px; }
.chart { position: relative; min-height: 160px; display: grid; align-items: center; }
.chart svg { display: block; width: 100%; height: auto; max-height: 220px; min-height: 135px; overflow: visible; stroke: none; }
.chart .chart-mobile { display: none; }
.chart .gridline { stroke: #e2eaf3; stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-family: inherit; font-size: 12px; }
.chart .series-in, .chart .series-out { fill: none; stroke-width: 2.5; }
.chart .series-in { stroke: #3669d1; }
.chart .series-out { stroke: #129889; }
.chart .point-in { fill: #3669d1; }
.chart .point-out { fill: #129889; }
.legend-key { display: inline-flex; gap: 6px; align-items: center; font-size: .84rem; color: var(--muted); }
.legend-key::before { content: ""; width: 13px; height: 3px; border-radius: 2px; background: #3669d1; }
.legend-key.out::before { background: #129889; }
.table-scroll { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 10px 13px; vertical-align: middle; border-bottom: 1px solid #e7edf5; }
th { font-size: .79rem; color: #52637c; font-weight: 710; background: #f5f8fd; white-space: nowrap; }
td { font-size: .89rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
.code { color: #284f9b; font-weight: 650; white-space: nowrap; }
.table-scroll input { min-width: 95px; }
.pagination { border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 8px 14px; color: var(--muted); font-size: .83rem; }
.empty { color: var(--muted); padding: 23px 15px; text-align: center; }
.loading { color: var(--muted); padding: 25px 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 13px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-all { grid-column: 1 / -1; }
dialog { padding: 0; border: 1px solid var(--line); border-radius: 15px; width: min(660px, calc(100vw - 24px)); max-height: 90dvh;
  background: #fff; color: var(--ink); box-shadow: 0 18px 80px #101d3940; }
dialog.wide { width: min(900px, calc(100vw - 24px)); }
dialog::backdrop { background: #14223d66; }
.dialog-head, .dialog-foot { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 13px 18px; }
.dialog-head { border-bottom: 1px solid var(--line); }
.dialog-foot { border-top: 1px solid var(--line); justify-content: end; }
.dialog-body { padding: 17px 18px; display: grid; gap: 13px; }
.dialog-body .callout { margin: 0; }
.warning-list { padding-left: 20px; margin: 0; max-height: 46vh; overflow: auto; }
.warning-list li + li { margin-top: 6px; }
.line-row, .line-card { padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.line-row .row, .line-card .row { margin-bottom: 5px; }
.line-card { background: #f8fafd; }
.line-card summary { cursor: pointer; color: var(--blue); font-weight: 620; }
.photo-strip { display: flex; align-items: start; gap: 10px; flex-wrap: wrap; }
.photo-tile { display: grid; gap: 6px; align-items: center; text-align: center; }
.thumb { display: inline-grid; place-items: center; width: 60px; height: 60px; padding: 0; overflow: hidden; background: #eff4fa;
  border: 1px solid var(--line); border-radius: 9px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
#photo img { display: block; max-width: 100%; max-height: 72dvh; margin: auto; }
pre { max-width: min(46vw, 680px); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.toast { position: fixed; z-index: 8; right: 20px; bottom: 20px; background: #18395e; color: #fff;
  padding: 11px 14px; border-radius: 9px; box-shadow: 0 8px 35px #14263f2d; max-width: calc(100vw - 40px); }
.toast.error { background: #862b37; }
.nav-scrim { display: none; }
.auth-body { display: grid; min-height: 100dvh; align-items: center; justify-items: center; padding: 20px; }
.auth-card { width: min(410px, 100%); padding: 26px; border: 1px solid var(--line); border-radius: 17px; background: white; display: grid; gap: 13px; }
.auth-card .brand-mark { margin-bottom: 4px; }
.auth-card .tag { justify-self: start; }
.auth-card form { margin-top: 4px; }
@media (min-width: 901px) {
  .workspace.collapsed { grid-template-columns: 63px minmax(0, 1fr); }
  .collapsed .sidebar { padding-inline: 8px; }
  .collapsed .brand { margin-inline: 3px; }
  .collapsed .brand-text, .collapsed .nav-label, .collapsed .nav-item span, .collapsed .side-footer span:last-child { display: none; }
  .collapsed .nav-item { justify-content: center; }
}
@media (max-width: 900px) {
  .workspace { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 212px; transform: translateX(-100%); visibility: hidden; }
  .workspace.nav-open .sidebar { transform: none; visibility: visible; }
  .workspace.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 2; border: 0; background: #17294555; }
  .topbar { padding-inline: 15px; }
  .content { padding: 18px 15px 32px; }
}
@media (max-width: 560px) {
  .crumb, .user-menu #username { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 10px; }
  .metric-number { font-size: 1.25rem; }
  .panel { padding: 12px; }
  .split, .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); }
  .toolbar > label, .toolbar > .search-field { flex: 1 1 40%; max-width: none; }
  .chart .chart-desktop { display: none; }
  .chart .chart-mobile { display: block; }
  .chart-mobile .axis-text { font-size: 11px; }
  .table-scroll table { min-width: 660px; }
  .table-scroll th { min-width: 64px; }
  .table-scroll th:nth-child(2) { min-width: 105px; }
  .dialog-body { padding: 13px; }
  .auth-card { padding: 21px; }
}

.brand-switch { max-width: 11rem; min-width: 5rem; padding: .38rem .5rem; }
