:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: #142441;
  background: #f4f7fc;
  --muted: #586b87;
  --border: #dce5f2;
  --blue: #205cd8;
  --blue-dark: #164bb8;
  --soft: #eaf2ff;
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: #edf3fc; }
.login-card { width: min(100%, 410px); border: 1px solid #dce5f2; border-radius: 18px; padding: 30px; background: white; box-shadow: 0 14px 60px #1b427f13; display: grid; gap: 17px; }
.login-card h1 { font-size: 24px; }
.login-card .sub { margin-top: -9px; }
.login-card input { min-height: 44px; }
.login-card .btn { min-height: 43px; }
body { margin: 0; min-width: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #3478f6; outline-offset: 2px; }
.shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #11264a; color: #fff; position: sticky; top: 0; height: 100vh; padding: 24px 13px 16px; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; padding: 0 5px; min-height: 38px; }
.brand-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #3478f6; font: 22px "Segoe UI Symbol", sans-serif; flex-shrink: 0; }
nav { display: grid; gap: 5px; margin-top: 25px; }
nav button { display: flex; align-items: center; gap: 12px; background: transparent; border: 1px solid transparent; color: #c6d5ed; padding: 9px 12px; text-align: left; font-size: 14px; border-radius: 8px; min-height: 42px; white-space: nowrap; }
nav button span { display: inline-grid; place-items: center; min-width: 18px; font: 17px "Segoe UI Symbol", sans-serif; }
nav button:hover { background: #1d3961; color: white; }
nav button[aria-current="page"] { background: #275bb1; color: white; border-color: #3e70bf; font-weight: 700; }
.local { margin-top: auto; padding: 20px 10px 4px; color: #b9cbeb; font-size: 12px; white-space: nowrap; }
.local span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #76d6c2; margin-right: 3px; }
main { min-width: 0; }
.top { height: 60px; padding: 0 26px; background: white; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 700; gap: 12px; }
.top time { color: var(--muted); white-space: nowrap; font-size: 13px; font-weight: 500; }
.workspace { max-width: 1680px; margin: auto; padding: 25px 26px 35px; }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 19px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 27px; letter-spacing: -.035em; overflow-wrap: anywhere; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
.sub { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.55; overflow-wrap: anywhere; }
.btn { border: 1px solid #cad8eb; background: white; color: #23395b; padding: 8px 12px; line-height: 1.3; border-radius: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.btn:hover { background: #f0f5fe; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: white; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.danger { color: #a62739; border-color: #efcbd0; background: #fff7f8; }
.btn.danger:hover { background: #fae4e8; }
.link { border: 0; background: none; color: #1d56c3; padding: 0; font-size: inherit; font-weight: 700; line-height: inherit; text-align: left; overflow-wrap: anywhere; }
.link:hover { text-decoration: underline; }
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 143px), 1fr)); margin-bottom: 14px; }
.money-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 166px), 1fr)); }
.metric { min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; }
.metric strong { display: block; margin-top: 10px; font-size: clamp(18px, 2vw, 25px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric .label { color: var(--muted); font-size: 13px; }
.metric.highlight { background: #e8f1ff; border-color: #c7dbfa; color: #1654b2; }
.metric.pay { background: #effaf7; border-color: #caeae3; }
.metric.pay strong { color: #117461; }
.dash { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; margin-top: 18px; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; min-width: 0; overflow: hidden; }
.panel + .panel.stacked { margin-top: 16px; }
.section-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 15px 17px; border-bottom: 1px solid #e8eef7; }
.section-head h2 { display: flex; gap: 8px; align-items: center; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3375ef; }
.dot.warm { background: #ed9a36; }
.dot.red { background: #d54760; }
.dot.green { background: #209a85; }
.row-item { padding: 11px 17px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid #edf2f8; font-size: 13px; }
.row-item:last-child { border-bottom: 0; }
.row-item .sub { margin-top: 3px; }
.empty { text-align: center; padding: 24px 12px; color: var(--muted); font-size: 13px; }
.pill { display: inline-block; border-radius: 25px; padding: 4px 8px; background: #edf3fc; color: #34547d; font-size: 12px; white-space: nowrap; }
.pill.green { background: #def4ed; color: #0e6655; }
.pill.warm { background: #fff1de; color: #86520d; }
.pill.red { background: #fde7ec; color: #9b293d; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filters label { min-width: 112px; }
.filters .search { flex: 1 1 190px; }
label { display: grid; gap: 6px; min-width: 0; font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; min-width: 0; background: white; border: 1px solid #cbd8ea; border-radius: 8px; padding: 8px 9px; color: #142441; font-size: 13px; }
input::placeholder, textarea::placeholder { color: #667897; }
textarea { line-height: 1.65; resize: vertical; min-height: 74px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid #e8eef7; }
th { background: #f3f7fd; color: #334963; font-size: 12px; white-space: nowrap; }
td { overflow-wrap: anywhere; }
tbody tr:hover { background: #f7faff; }
.orders { min-width: 1000px; }
.orders td:nth-child(2), .orders td:nth-child(3), .orders td:nth-child(4) { min-width: 85px; max-width: 165px; }
.orders select { min-width: 85px; padding: 5px 4px; }
.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pagination { padding: 11px 16px; justify-content: space-between; color: var(--muted); font-size: 13px; }
.form { max-width: 1050px; }
.form section { margin-bottom: 13px; }
.form-grid, .details-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px 16px; padding: 15px 17px; }
.span-all { grid-column: 1 / -1; }
.details-grid { margin: 0; }
dt { font-size: 12px; color: var(--muted); }
dd { font-size: 14px; margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice { font-size: 13px; line-height: 1.6; color: var(--muted); background: #edf4ff; padding: 11px 13px; border-radius: 9px; overflow-wrap: anywhere; }
.form-error { min-height: 0; color: #a22739; font-size: 13px; line-height: 1.6; }
.pad { padding: 16px 17px; }
.pad > * + * { margin-top: 12px; }
.backup-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); align-items: start; }
dialog { border: 1px solid var(--border); border-radius: 15px; color: #142441; max-width: min(860px, calc(100vw - 38px)); width: 100%; max-height: calc(100vh - 42px); padding: 0; box-shadow: 0 20px 70px #0c25475c; }
dialog::backdrop { background: #14264280; }
dialog .modal-head { position: sticky; top: 0; background: #fff; z-index: 1; }
dialog section + section { margin-top: 13px; }
dialog .btn.icon { font-size: 15px; padding: 5px 9px; }
#notifications { position: fixed; bottom: 18px; right: 18px; z-index: 5; max-width: min(440px, calc(100vw - 36px)); }
.toast { background: #17355b; color: white; border: 1px solid #5277a8; border-radius: 10px; padding: 10px 13px; margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.toast.error { background: #842638; }
.loading { padding: 22px; color: var(--muted); }
@media (max-width: 1070px) {
  .shell { grid-template-columns: 167px minmax(0, 1fr); }
  .sidebar { padding-inline: 8px; }
  .brand { font-size: 12px; gap: 6px; padding-inline: 4px; }
  .brand-icon { width: 27px; height: 27px; font-size: 18px; }
  .workspace { padding-inline: 17px; }
  .top { padding-inline: 17px; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 125px minmax(0, 1fr); }
  .brand span:last-child { white-space: normal; }
  nav button { padding-inline: 7px; gap: 5px; font-size: 12px; }
  .dash { grid-template-columns: 1fr; }
  .form-grid, .details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: 12px; overflow: visible; }
  .brand { font-size: 15px; }
  nav { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
  nav button { min-height: 34px; padding: 6px 9px; }
  nav button span, .local { display: none; }
  .top { height: auto; min-height: 54px; flex-wrap: wrap; padding: 10px 14px; }
  .top > span { display: none; }
  .workspace { padding: 18px 12px; }
  .form-grid, .details-grid { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 24px; }
  dialog { max-width: calc(100vw - 20px); max-height: calc(100dvh - 28px); }
}
