:root {
  color-scheme: light;
  font: 15px/1.55 "Segoe UI", "Microsoft YaHei UI", sans-serif;
  color: #1b3044;
  background: #f5f7fa;
  --line: #dfe5ea;
  --muted: #576c7d;
  --green: #176548;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.bar { background: #193d37; color: white; }
.bar-inner, main { width: min(1180px, 94%); margin: auto; }
.bar-inner { min-height: 56px; display: flex; gap: 16px; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 7px; font-size: 24px; letter-spacing: -.05em; }
.bar-title { font-weight: 500; padding-left: 17px; border-left: 1px solid #6d8f86; }
#environment { margin-left: auto; color: #e3f2eb; font-size: 13px; }
#admin-actions { gap: 8px; }
#admin-user { font-size: 14px; }
#admin-actions button { padding: 4px 8px; font-size: 14px; color: white; border-color: #78978f; background: transparent; }
#admin-actions button:hover:enabled { background: #2b5148; }
#access-view { width: min(400px, 94%); margin: clamp(32px, 12vh, 120px) auto; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: white; }
#login-form { display: grid; gap: 8px; }
#login-form h1 { margin-bottom: 8px; font-size: 24px; }
#login-form input { width: 100%; min-width: 0; min-height: 40px; margin-bottom: 8px; }
#login-form button { min-height: 40px; }
#login-status { color: var(--green); }
#login-status:empty, #connection-status:empty { display: none; }
#connection-retry { margin-top: 16px; }
main { padding: 20px 0 40px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.04em; }
h2 { font-size: 19px; }
h3 { font-size: 15px; margin: 24px 0 10px; }
.page-head, .list-head, .sheet-head, .pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 16px 0; }
.metrics, .panel { border: 1px solid var(--line); background: #fff; border-radius: 8px; }
.metrics > div { padding: 12px 16px; }
.metrics > div + div { border-inline-start: 1px solid var(--line); }
.metrics span, .meta, small, .pager { color: var(--muted); }
.metrics span { font-size: 13px; }
.metrics strong { display: block; font-size: clamp(18px, 2.7vw, 30px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.panel { overflow: hidden; }
.growth-panel { padding: 16px; margin-bottom: 16px; }
.growth-head, .trend-head, .registration-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.growth-head, .trend-head { justify-content: space-between; }
.growth-periods { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin: 15px 0 18px; }
.growth-period { display: grid; gap: 2px; padding: 8px 14px; text-align: left; background: #f5f8f7; border-color: var(--line); }
.growth-period span { color: var(--muted); font-size: 13px; }
.growth-period strong { font-size: 22px; color: var(--green); font-variant-numeric: tabular-nums; }
.growth-period[aria-pressed=true], .trend-day[aria-pressed=true] { background: #e2f1e9; border-color: var(--green); }
.trend-head { border-top: 1px solid var(--line); padding-top: 12px; }
.trend-head h3 { margin: 0; }
.trend-head select { font-size: 13px; }
.trend-scroll { overflow-x: auto; }
#growth-chart { display: flex; padding: 4px 3px; min-height: 108px; }
.trend-day { display: grid; grid-template-rows: 18px 48px 18px; justify-items: center; flex: 1 0 38px; border: 1px solid transparent; font-size: 12px; min-width: 0; padding: 3px 0; }
.trend-day time { color: var(--muted); font-weight: 400; white-space: nowrap; }
.trend-bar { align-self: end; width: min(48%, 32px); background: #32846a; border-radius: 3px 3px 0 0; }
.trend-day.zero .trend-bar { background: #cbd8d4; }
.registration-filter { border-top: 1px solid var(--line); padding: 8px 18px; background: #f5f8f7; font-size: 13px; }
.registration-filter button { margin-left: auto; }
.registered-date { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.list-head, .pager { padding: 16px 18px; flex-wrap: wrap; }
form[role=search], .actions, .pager div { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
button, input, select { font: inherit; color: inherit; }
button, input, select { border: 1px solid #b9c7ce; border-radius: 8px; padding: 6px 10px; background: #fff; }
button { cursor: pointer; font-weight: 600; white-space: nowrap; }
button:hover:enabled { background: #eef3f2; }
.primary { color: white; background: var(--green); border-color: var(--green); }
.primary:hover:enabled { background: #104e37; }
.danger { color: #972e25; border-color: #d4a59e; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid #438cae; outline-offset: 2px; }
.scroll-table { max-width: 100%; overflow-x: auto; }
.scroll-table table { min-width: 640px; }
#customer-rows td:first-child { min-width: 120px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 8px 12px; border-top: 1px solid var(--line); text-align: left; }
th { font-weight: 600; color: var(--muted); background: #f8fafb; white-space: nowrap; }
td:first-child { overflow-wrap: anywhere; max-width: 290px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-action { color: var(--green); padding: 4px 10px; white-space: nowrap; }
.child-actions { gap: 4px; }
.child-actions button { padding: 3px 7px; white-space: nowrap; }
.badge { display: inline-block; white-space: nowrap; border-radius: 12px; padding: 1px 8px; background: #e5f4eb; color: #146543; font-size: 12px; }
.badge.off { background: #f6e7e4; color: #93372e; }
.empty { text-align: center; color: var(--muted); padding: 25px; }
.pager { border-top: 1px solid var(--line); font-size: 13px; }
dialog { padding: 0; border: 1px solid #b8c6cd; border-radius: 8px; width: min(800px, 94vw); max-height: 90vh; color: inherit; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #10242dae; }
.sheet-head { padding: 15px 22px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { overflow-wrap: anywhere; }
.sheet-body { padding: 18px 22px 24px; overflow: auto; }
.account-sheet { width: min(440px, 94vw); }
.account-sheet form { display: grid; gap: 14px; }
.account-sheet h2, .account-sheet p { overflow-wrap: anywhere; }
.account-sheet label { display: grid; gap: 6px; }
.account-fields { display: grid; gap: 12px; }
.account-sheet input { min-width: 0; width: 100%; }
.account-sheet .actions { justify-content: flex-end; }
#create-review { white-space: pre-line; }
#account-notice { color: var(--green); }
.account-sheet .error:empty, #account-notice:empty { display: none; }
.meta, .audit-item { font-size: 14px; }
.balances { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; margin: 8px 0 16px; }
.balances > div { padding: 4px 0; }
.meta, .operation, #account-notice { overflow-wrap: anywhere; }
dt { font-size: 12px; color: var(--muted); }
dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.operation { padding: 12px; margin-top: 12px; background: #f2f6f5; border-inline-start: 3px solid var(--green); }
.operation h3 { margin: 0 0 10px; }
.operation label { display: grid; gap: 4px; width: min(100%, 310px); }
#effect { margin: 10px 0; white-space: pre-line; }
.audit-item { display: flex; gap: 14px; padding: 8px 0; align-items: baseline; border-top: 1px solid var(--line); }
.audit-item time { color: var(--muted); white-space: nowrap; font-size: 12px; }
#status:empty, #detail-status:empty, #edit-status:empty { display: none; }
#status, #detail-status, #edit-status { padding: 8px 0; color: var(--green); overflow-wrap: anywhere; }
.error { color: #ab2c21 !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 750px) {
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metrics > div:nth-child(odd) { border-inline-start: 0; }
  .metrics > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .growth-periods { gap: 6px; }
  .growth-period { padding: 8px; }
  .list-head { align-items: flex-start; }
  .sheet-head, .sheet-body { padding: 14px; }
  .balances { grid-template-columns: repeat(2,minmax(0,1fr)); }
  input[type=search] { width: min(215px, 100%); }
  .audit-item { flex-wrap: wrap; gap: 3px 10px; }
  .bar-inner { gap: 8px; flex-wrap: wrap; padding: 8px 0; }
  #admin-actions { flex-basis: 100%; justify-content: flex-end; }
  .bar-title { padding-left: 8px; }
  .actions, .sheet-head, form[role=search] { min-width: 0; }
}
