:root {
  color-scheme: light;
  --ink: #182238;
  --muted: #71809a;
  --line: #e5eaf2;
  --surface: #ffffff;
  --page: #f5f7fb;
  --blue: #2864e7;
  --blue-dark: #1749bb;
  --blue-soft: #edf3ff;
  --green: #16845a;
  --green-soft: #e8f7f0;
  --amber: #ad6811;
  --amber-soft: #fff4df;
  --red: #c53a49;
  --red-soft: #fff0f2;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.shell { min-height: 100vh; }
.topbar { height: 68px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 760; letter-spacing: 0; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--blue); color: white; font-size: 14px; font-weight: 800; box-shadow: 0 5px 14px rgba(40,100,231,.22); }
.top-actions { display: flex; align-items: center; gap: 16px; }
.account { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 750; font-size: 12px; }
.layout { max-width: 1440px; margin: 0 auto; padding: 30px 32px 52px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 7px 0 5px; font-size: 28px; letter-spacing: 0; }
h2 { margin: 0; font-size: 17px; letter-spacing: 0; }
h3 { margin: 0; font-size: 14px; }
.head-note { margin: 0; color: var(--muted); font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.date-field { height: 38px; min-width: 145px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); outline: none; }
.date-field:focus, .text-field:focus, .select-field:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40,100,231,.12); }
.btn { min-height: 38px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; color: var(--ink); background: #fff; font-weight: 650; font-size: 13px; transition: .16s ease; }
.btn:hover { border-color: #cbd5e5; transform: translateY(-1px); }
.btn-primary { color: white; background: var(--blue); box-shadow: 0 5px 14px rgba(40,100,231,.2); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-danger { color: var(--red); background: var(--red-soft); }
.btn-quiet { color: var(--muted); background: transparent; padding-inline: 9px; }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.notice { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #ccdafc; border-radius: 9px; color: #2959b4; background: var(--blue-soft); font-size: 13px; }
.notice.warn { color: var(--amber); border-color: #f3d59d; background: var(--amber-soft); }
.notice.error { color: var(--red); border-color: #f3c6cc; background: var(--red-soft); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { min-height: 126px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 7px 24px rgba(37,55,88,.045); }
.kpi-label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.kpi-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-weight: 800; }
.kpi:nth-child(2) .kpi-icon { color: var(--green); background: var(--green-soft); }
.kpi:nth-child(3) .kpi-icon { color: var(--amber); background: var(--amber-soft); }
.kpi:nth-child(4) .kpi-icon { color: #7a4fc4; background: #f3ecff; }
.kpi-value { margin-top: 16px; font-size: 27px; font-weight: 780; letter-spacing: 0; }
.kpi-value .currency { margin-right: 3px; color: var(--muted); font-size: 15px; font-weight: 650; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .8fr); gap: 18px; margin-bottom: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 7px 24px rgba(37,55,88,.045); overflow: hidden; }
.panel-head { min-height: 65px; padding: 18px 21px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 20px 21px; }
.panel-subtitle { margin-top: 4px; color: var(--muted); font-size: 12px; }
.chart { min-height: 245px; padding: 15px 10px 7px; border-bottom: 1px solid var(--line); }
.chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart-axis { stroke: #cfd8e7; stroke-width: 1; }
.chart-grid { stroke: #e9edf4; stroke-width: 1; stroke-dasharray: 4 5; }
.chart-line { fill: none; stroke: var(--blue); stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.chart-dots circle { fill: #fff; stroke: var(--blue); stroke-width: 2; }
.chart-labels text { fill: var(--muted); font-size: 11px; }
.bar-item { min-width: 0; flex: 1; height: 210px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.bar-value { max-width: 60px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { width: min(100%, 22px); min-height: 3px; border-radius: 5px 5px 2px 2px; background: var(--blue); }
.bar-label { max-width: 47px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 34px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.summary-list { display: grid; gap: 13px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.summary-row strong { font-size: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 750px; }
th, td { padding: 15px 21px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: 13px; }
th { color: var(--muted); background: #fafbfe; font-size: 12px; font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td strong { font-weight: 700; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status-approved, .status-paid, .status-settled { color: var(--green); background: var(--green-soft); }
.status-pending, .status-reserved { color: var(--amber); background: var(--amber-soft); }
.status-suspended { color: var(--red); background: var(--red-soft); }
.inline-form { display: flex; gap: 9px; }
.text-field, .select-field { width: 100%; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: #fff; color: var(--ink); }
.binding-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.section-space { margin-top: 20px; }
.admin-nav { display: flex; gap: 5px; margin-bottom: 22px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.admin-tab { flex: 0 0 auto; padding: 11px 14px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-weight: 650; font-size: 13px; white-space: nowrap; }
.admin-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.mini-card { padding: 17px 19px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.mini-card label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
.mini-card .number { font-size: 23px; font-weight: 760; }
.field-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
.rate-form { display: grid; grid-template-columns: minmax(0, 180px) auto; align-items: end; gap: 10px; }
.rate-form small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--page); }
.auth-card { width: min(100%, 420px); padding: 31px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(37,55,88,.09); }
.auth-card .brand { margin-bottom: 35px; }
.auth-title { margin: 0 0 7px; font-size: 24px; }
.auth-copy { margin: 0 0 25px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-form { display: grid; gap: 15px; }
.auth-form .btn { width: 100%; }
.auth-switch { margin-top: 18px; text-align: center; color: var(--muted); font-size: 12px; }
.link-btn { padding: 0; border: 0; color: var(--blue); background: none; font-weight: 700; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: 360px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; box-shadow: 0 10px 28px rgba(37,55,88,.15); font-size: 13px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 22px; background: rgba(21,31,49,.42); }
.modal { width: min(100%, 720px); max-height: min(760px, 90vh); overflow: auto; border-radius: 12px; background: #fff; box-shadow: 0 18px 50px rgba(13,22,40,.26); }
.modal .panel-head { position: sticky; top: 0; background: #fff; z-index: 1; }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.detail-stat { padding: 13px; border-radius: 8px; background: var(--page); }
.detail-stat label { display: block; color: var(--muted); font-size: 11px; }
.detail-stat strong { display: block; margin-top: 5px; font-size: 16px; }
.footer-note { margin-top: 19px; color: var(--muted); font-size: 11px; text-align: right; }
@media (max-width: 980px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar { height: auto; min-height: 62px; padding: 13px 17px; gap: 12px; }
  .top-actions .account-name { display: none; }
  .layout { padding: 23px 15px 40px; }
  .page-head { display: block; }
  .toolbar { margin-top: 17px; }
  .date-field { flex: 1; min-width: 0; }
  h1 { font-size: 24px; }
  .kpis { gap: 10px; }
  .kpi { min-height: 112px; padding: 14px; }
  .kpi-value { margin-top: 12px; font-size: 21px; }
  .panel-head, .panel-body { padding-inline: 15px; }
  th, td { padding-inline: 15px; }
  .binding-form, .rate-form { grid-template-columns: 1fr; }
  .auth-card { padding: 24px; }
  .detail-stats { grid-template-columns: 1fr; }
}
