:root {
  color-scheme: light;
  --bg: #fff; --sidebar: #f6f6f8; --subtle: #f7f8fa; --text: #202125; --muted: #61656e;
  --line: #e6e7eb; --hover: #eeeef2; --accent: #175ad3; --accent-ink: #1754bb; --soft: #eaf1ff;
  --green: #237951; --orange: #9c5917; --red: #b52d3e; --shadow: 0 18px 62px #24253120;
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI",
    "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1c1f; --sidebar: #212226; --subtle: #232427; --text: #eeeef2; --muted: #adb0ba;
  --line: #35363d; --hover: #2b2c32; --accent: #2165de; --accent-ink: #9abfff; --soft: #24344d;
  --green: #80ceab; --orange: #ecbb7a; --red: #ff9caa; --shadow: 0 18px 62px #0006;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .58; cursor: wait; }
a { color: var(--accent-ink); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 29px; line-height: 1.2; letter-spacing: -.025em; font-weight: 725; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 14px; font-weight: 640; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono, .numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: "SF Mono", "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.strong { font-weight: 650; }
.danger, .tone-red { color: var(--red); }
.tone-green { color: var(--green); }
.tone-orange { color: var(--orange); }
.icon { width: 17px; height: 17px; display: inline-block; flex: none; vertical-align: middle; }
.shell { display: grid; grid-template-columns: 218px minmax(0,1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; background: var(--sidebar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 13px 15px; gap: 20px; }
.brand { display: flex; gap: 10px; align-items: center; padding: 1px 9px; }
.brand img { width: 34px; height: 34px; }
.brand strong { font-weight: 725; font-size: 15px; letter-spacing: -.03em; display: block; line-height: 1.33; }
.brand span { font-size: 11px; color: var(--muted); display: block; }
.side nav { display: grid; gap: 4px; }
.nav-label { margin: 2px 9px 5px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.nav-item { width: 100%; display: flex; gap: 9px; align-items: center; text-align: left; padding: 7px 9px;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item[aria-current="page"] { color: var(--accent-ink); background: var(--soft); font-weight: 625; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 4px 0; display: grid; gap: 8px; }
.side-foot-user { padding: 0 5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work { min-width: 0; }
.topbar { height: 58px; border-bottom: 1px solid var(--line); display: flex; align-items: center;
  padding: 0 31px; gap: 14px; position: sticky; top: 0; z-index: 2; background: var(--bg); }
.crumb { color: var(--muted); font-size: 13px; flex: 1; }
.topbar .crumb strong { color: var(--text); font-weight: 600; }
.marker { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.marker::before, .status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.marker-demo { color: var(--orange); }
.content { padding: 28px 31px 50px; max-width: 1550px; margin-inline: auto; }
.heading { margin-bottom: 21px; display: flex; justify-content: space-between; align-items: end; gap: 14px; }
.heading p { margin-top: 7px; color: var(--muted); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 10px; }
.section-head:first-child { margin-top: 0; }
.metrics { display: flex; flex-wrap: wrap; border-block: 1px solid var(--line); padding: 16px 0; gap: 14px 0; }
.metric { flex: 1 1 132px; border-right: 1px solid var(--line); min-width: 0; padding: 0 17px; }
.metric:first-child { padding-left: 0; }
.metric:last-child { border: 0; }
.metric-label { font-size: 12px; color: var(--muted); }
.metric-value { display: block; color: var(--text); font-size: 23px; font-weight: 675; letter-spacing: -.035em;
  font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.metric-value.tone-orange { color: var(--orange); }
.overview-totals .metric { flex-basis: 210px; }
.overview-totals .metric-value { font-size: 30px; }
.overview-totals .metrics { padding-block: 22px; border-top: 0; }
.overview-filter { margin-bottom: 14px; }
.overview-filter-fields { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.overview-filter-fields .form-row { flex: 0 1 190px; }
.overview-filter-fields .actions { min-height: 35px; }
.overview-period .small { margin-top: 8px; }
.actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 33px;
  padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); font-weight: 570; font-size: 13px; white-space: nowrap; }
.button:hover { background: var(--subtle); }
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button.primary:hover { filter: brightness(1.12); }
.button.ghost { border-color: transparent; background: transparent; }
.button.ghost:hover { background: var(--hover); }
.button.link { border-color: transparent; background: transparent; color: var(--accent-ink); padding-inline: 4px; }
.button.link:hover { text-decoration: underline; }
.button.danger { color: var(--red); }
.button.icon-only { padding-inline: 7px; }
.table-box { border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { padding: 9px 12px; vertical-align: middle; }
th { font-size: 12px; background: var(--subtle); font-weight: 625; color: var(--muted); white-space: nowrap; }
tr:not(:last-child) td, thead th { border-bottom: 1px solid var(--line); }
tr:hover td { background: var(--subtle); }
.clip { max-width: min(22vw, 245px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); font-size: 12px; }
.status.tone-green { color: var(--green); }
.status.tone-orange { color: var(--orange); }
.status.tone-red { color: var(--red); }
.empty { color: var(--muted); padding: 24px 14px; font-size: 13px; }
.pagination { display: flex; align-items: center; justify-content: end; gap: 10px; margin-top: 10px; }
.banner { background: var(--subtle); border-left: 2px solid var(--line); padding: 10px 12px; margin: 0 0 15px; color: var(--muted); }
.banner.tone-orange { border-left-color: var(--orange); }
input:not([type="checkbox"]), textarea, select { min-width: 0; width: 100%; min-height: 35px; padding: 6px 9px;
  color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; }
textarea { min-height: 70px; resize: vertical; }
input::placeholder { color: var(--muted); opacity: .8; }
.search { display: flex; width: min(310px, 100%); gap: 7px; }
.form-row { display: grid; gap: 4px; }
.form-row > span { font-weight: 580; font-size: 13px; }
.form-fields { display: grid; gap: 11px; margin-bottom: 14px; }
.date-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 11px; }
.cost-results { margin-top: 12px; }
.field-help { color: var(--muted); font-size: 12px; font-weight: 400 !important; }
.check-list { min-width: 0; padding: 5px 10px 8px; border: 1px solid var(--line); border-radius: 7px; max-height: 160px; overflow: auto; }
.check-row { display: flex; gap: 8px; align-items: center; min-height: 28px; }
.form-footer { display: flex; justify-content: end; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.form-error { color: var(--red); font-size: 13px; margin: 6px 0 10px; }
.loading { padding: 28px; color: var(--muted); }
dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 13px; padding: 0; box-shadow: var(--shadow); }
dialog.wide { width: min(865px, calc(100vw - 24px)); }
dialog::backdrop { background: #15162255; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 11px 16px; }
.dialog-body { padding: 16px; }
.sim-image { display: block; width: 100%; height: auto; margin-bottom: 8px; border-radius: 7px; }
.toast { position: fixed; z-index: 3; bottom: 20px; right: 20px; max-width: calc(100vw - 40px);
  padding: 8px 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--bg); box-shadow: var(--shadow); }
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--sidebar); }
.auth { width: min(100%, 380px); }
.auth > .brand { padding: 0; margin-bottom: 28px; }
.auth .heading { margin-bottom: 16px; }
.auth input { background: var(--bg); }
.auth form .primary { width: 100%; }
.auth-foot { margin-top: 12px; text-align: center; }
@media (max-width: 810px) {
  .shell { grid-template-columns: 157px minmax(0, 1fr); }
  .side { padding-inline: 8px; }
  .content, .topbar { padding-inline: 16px; }
  .heading { align-items: start; flex-direction: column; }
  .metric { padding-inline: 8px; }
  th, td { padding-inline: 8px; }
}
@media (max-width: 580px) {
  .shell { display: block; }
  .side { position: static; height: auto; padding: 11px 10px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side nav { display: flex; overflow-x: auto; }
  .nav-label, .side-foot-user { display: none; }
  .nav-item { white-space: nowrap; }
  .side-foot { position: absolute; top: 8px; right: 7px; margin: 0; border: 0; padding: 0; display: flex; }
  .topbar { height: 42px; }
  .content { padding-top: 18px; }
  h1 { font-size: 24px; }
}
