:root {
  --bg: #f3f1ea;
  --surface: #fffefa;
  --surface-soft: #f8f5ed;
  --ink: #1d2a26;
  --ink-soft: #3d4a43;
  --muted: #737d75;
  --muted-light: #9ca49c;
  --line: #e4dfd2;
  --line-strong: #d5cebd;
  --teal: #173f3b;
  --teal-deep: #102e2b;
  --teal-soft: #e1ebe5;
  --green: #2f6b55;
  --clay: #a85e55;
  --clay-soft: #f3e5df;
  --gold: #a98143;
  --shadow: 0 1px 2px rgba(25, 42, 34, .04);
  --shadow-lg: 0 24px 60px -32px rgba(18, 41, 33, .38);
  --radius: 18px;
  --sans: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
::selection { background: #c9dbd1; color: var(--teal-deep); }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------------ */
/* 登录                                                                */
/* ------------------------------------------------------------------ */

.login-page { background: #eceae2; }

.login-shell {
  display: grid;
  grid-template-columns: 45% 55%;
  min-height: 100vh;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 42px 52px;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 12%, rgba(155, 190, 166, .18), transparent 30%),
    radial-gradient(circle at 90% 82%, rgba(181, 143, 79, .12), transparent 34%),
    var(--teal);
  color: #f2eee2;
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(242, 238, 226, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 238, 226, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  pointer-events: none;
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -150px;
  bottom: -130px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(242, 238, 226, .1);
  border-radius: 50%;
  box-shadow: 0 0 0 56px rgba(242, 238, 226, .025), 0 0 0 112px rgba(242, 238, 226, .018);
  pointer-events: none;
}

.login-brand-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px 11px 11px 3px;
  background: #f2eee2;
  color: var(--teal-deep);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.login-brand-name { font-size: 17px; font-weight: 650; letter-spacing: .04em; }

.login-brand-body {
  position: relative;
  z-index: 1;
  max-width: 390px;
  margin: auto 0;
  padding: 40px 0;
}

.login-eyebrow {
  margin-bottom: 14px;
  color: rgba(242, 238, 226, .48);
  font-size: 11px;
  letter-spacing: .22em;
}

.login-brand h1 {
  margin-bottom: 34px;
  font-size: 38px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.03em;
}

.role-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(242, 238, 226, .13); }
.role-list li {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid rgba(242, 238, 226, .13);
}
.role-list strong { color: #f5f1e7; font-size: 12.5px; font-weight: 600; }
.role-list span { color: rgba(242, 238, 226, .52); font-size: 11.5px; line-height: 1.6; }

.login-brand-foot {
  position: relative;
  z-index: 1;
  color: rgba(242, 238, 226, .3);
  font-size: 10.5px;
  letter-spacing: .08em;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 38px;
  background: var(--bg);
}

.login-card {
  width: min(392px, 100%);
  padding: 34px 34px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.login-card-head { margin-bottom: 25px; }
.login-card-head h2 { margin-bottom: 6px; font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.login-card-head p { color: var(--muted); font-size: 12px; }

.login-error {
  margin-bottom: 16px;
  padding: 9px 11px;
  border: 1px solid #e7c9bc;
  border-radius: 8px;
  background: #fbeee8;
  color: #964b32;
  font-size: 12px;
}

.login-form { display: flex; flex-direction: column; gap: 15px; }
.login-submit { width: 100%; height: 44px; margin-top: 3px; }

.demo-accounts {
  margin-top: 24px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.demo-accounts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10.5px;
}
.demo-accounts-head em { color: var(--muted-light); font-style: normal; font-size: 9.5px; }
.demo-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
}
.demo-account-row div { display: flex; flex-direction: column; gap: 1px; }
.demo-account-row strong { color: var(--ink-soft); font-size: 11.5px; font-weight: 600; }
.demo-account-row span { color: var(--muted-light); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.text-btn {
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--green);
  font-size: 10.5px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.text-btn:hover { background: var(--teal-soft); border-color: #b9cbbf; }

/* ------------------------------------------------------------------ */
/* 应用框架                                                            */
/* ------------------------------------------------------------------ */

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 18px 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 8%, rgba(155, 190, 166, .14), transparent 32%),
    var(--teal);
  color: #f1eee3;
}

.sidebar::after {
  content: "";
  position: absolute;
  right: -130px;
  bottom: 50px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(242, 238, 226, .07);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(242, 238, 226, .018);
  pointer-events: none;
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 6px;
}

.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-text strong { font-size: 16px; font-weight: 650; letter-spacing: .03em; }
.brand-text small { color: rgba(241, 238, 227, .42); font-size: 9.5px; letter-spacing: .14em; }

.main-nav {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 42px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(241, 238, 227, .58);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.nav-item .icon { width: 16px; height: 16px; opacity: .86; }
.nav-item:hover { color: #f1eee3; background: rgba(241, 238, 227, .06); }
.nav-item.is-active { color: #fffdf5; background: rgba(241, 238, 227, .12); }
.nav-item.is-active .icon { opacity: 1; }

.sidebar-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding: 16px 6px 2px;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 8px;
  border: 1px solid rgba(241, 238, 227, .12);
  border-radius: 999px;
  color: rgba(241, 238, 227, .5);
  font-size: 9.5px;
}
.demo-badge span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9dbca3;
  box-shadow: 0 0 0 3px rgba(157, 188, 163, .1);
}
.sidebar-note { color: rgba(241, 238, 227, .25); font-size: 9.5px; letter-spacing: .06em; }

.main {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1440px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 30px 38px 18px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 23px;
}

.page-subtitle {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .03em;
}
.heading h1 { font-size: 26px; font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }

.topbar-actions { display: flex; align-items: center; gap: 9px; }

.month-picker {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 254, 250, .72);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.month-picker:hover, .month-picker:focus-within { border-color: #b6c5ba; background: var(--surface); }
.month-picker .icon { width: 15px; height: 15px; color: var(--muted); }
.month-picker input {
  width: 108px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.month-picker input::-webkit-calendar-picker-indicator { opacity: .4; cursor: pointer; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, opacity .16s ease, transform .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn .icon { width: 15px; height: 15px; }
.btn-primary { background: var(--teal); color: #faf7ed; }
.btn-primary:hover { background: #20504a; }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink-soft); }
.btn-secondary:hover { border-color: #b8c7bc; background: var(--surface-soft); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-soft); }
.btn-ghost.danger { border-color: #e5c8bd; color: #9e4b36; }
.btn-ghost.danger:hover { background: var(--clay-soft); }

.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin-left: 2px;
  padding-left: 13px;
  border-left: 1px solid var(--line-strong);
}
.role-badge {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--green);
  font-size: 9.5px;
  white-space: nowrap;
}
.role-badge.read-only { background: #f2e8d8; color: #8c6a32; }
.user-name { color: var(--ink-soft); font-size: 11.5px; white-space: nowrap; }
.user-area form { display: flex; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--surface-soft); color: var(--ink); }
.icon-btn .icon { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ */
/* 总览                                                                */
/* ------------------------------------------------------------------ */

.view { animation: viewIn .25s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.stats-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 156px;
  padding: 19px 21px 17px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.balance-card {
  border-color: transparent;
  background:
    radial-gradient(circle at 100% 0%, rgba(187, 216, 195, .16), transparent 38%),
    linear-gradient(145deg, #1d4a43, #143632);
  color: #f5f1e7;
}
.balance-card .stat-head { color: rgba(245, 241, 231, .62); }
.balance-card .money { color: #fffdf5; }
.balance-card .stat-foot { color: rgba(245, 241, 231, .38); }
.balance-card .stat-foot strong { color: #f3eee1; }
.balance-card .delta-chip { background: rgba(245, 241, 231, .1); color: rgba(245, 241, 231, .65); }
.balance-card .delta-chip.good { background: rgba(167, 210, 179, .16); color: #c7e4ce; }
.balance-card .delta-chip.bad { background: rgba(218, 158, 139, .14); color: #ecc4b8; }

.deco-line {
  position: absolute;
  right: -42px;
  bottom: -54px;
  width: 178px;
  height: 178px;
  border: 1px solid rgba(245, 241, 231, .1);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(245, 241, 231, .025);
  pointer-events: none;
}

.stat-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
}

.stat-label { display: flex; align-items: center; gap: 7px; }
.stat-icon {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 7px;
}
.stat-icon .icon { width: 12px; height: 12px; stroke-width: 2; }
.stat-icon.income { color: var(--green); background: #e5eee8; }
.stat-icon.expense { color: var(--clay); background: var(--clay-soft); }

.delta-chip {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f1ede3;
  color: var(--muted);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.delta-chip.good { background: #e1ede5; color: #3a7556; }
.delta-chip.bad { background: #f5e6df; color: #a3553c; }

.money {
  position: relative;
  z-index: 1;
  margin: 12px 0 9px;
  color: var(--ink);
  font-size: 32px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}
.money .currency {
  margin-right: 3px;
  color: var(--muted);
  font-size: .46em;
  font-weight: 500;
  letter-spacing: 0;
  vertical-align: .62em;
}
.money.is-negative { color: var(--clay); }
.money .minus { margin-right: 2px; font-size: .55em; font-weight: 500; vertical-align: .28em; }
.money-lg { font-size: 37px; }
.money-lg .currency { color: rgba(245, 241, 231, .5); }

.stat-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--muted-light);
  font-size: 9.5px;
}
.stat-foot strong { color: var(--ink-soft); font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.trend-panel, .donut-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 19px 21px 16px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.panel-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.panel-note { margin-top: 3px; color: var(--muted-light); font-size: 9.5px; }

.chart-legend { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; }
.legend-dot.income { background: var(--green); }
.legend-dot.expense { background: var(--clay); }

.trend-chart {
  position: relative;
  flex: 1;
  min-height: 250px;
  margin-top: 17px;
  padding: 16px 0 23px 42px;
}

.trend-scale {
  position: absolute;
  top: 16px;
  bottom: 23px;
  left: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--muted-light);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.trend-plot {
  position: relative;
  height: 100%;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 100% 25%;
}

.month-groups {
  display: flex;
  align-items: stretch;
  gap: 7px;
  height: 100%;
}

.month-group {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 1;
  height: 100%;
}

.month-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 100%;
}

.trend-bar {
  display: block;
  width: min(100%, 16px);
  min-height: 2px;
  border-radius: 3px 3px 1px 1px;
  transition: filter .15s ease;
}
.trend-bar.income { background: linear-gradient(180deg, #4d8a6e, #2f6b55); }
.trend-bar.expense { background: linear-gradient(180deg, #c27d70, #a85e55); }
.trend-bar.is-empty { background: #e6e1d5; }
.month-group:hover .trend-bar { filter: brightness(1.06); }

.month-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  color: var(--muted-light);
  font-size: 9px;
  white-space: nowrap;
  transform: translateX(-50%);
}

.month-tip {
  position: absolute;
  top: 4px;
  left: 50%;
  z-index: 4;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--teal-deep);
  color: #f8f5ea;
  font-size: 9px;
  line-height: 1.5;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 3px);
  transition: opacity .14s ease, transform .14s ease;
  pointer-events: none;
}
.month-tip strong { font-weight: 600; }
.month-group:hover .month-tip { opacity: 1; transform: translate(-50%, 0); }

.trend-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted-light);
  font-size: 11px;
}

.donut-layout {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding-top: 12px;
}

.donut { position: relative; width: 156px; height: 156px; flex: 0 0 auto; }
.donut svg { display: block; width: 100%; height: 100%; overflow: visible; }
.donut-track { fill: none; stroke: #eee9dc; stroke-width: 13; }
.donut-seg { fill: none; stroke-width: 13; }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  pointer-events: none;
}
.donut-center span { color: var(--muted-light); font-size: 9px; }
.donut-center strong {
  max-width: 104px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.donut-legend { display: flex; flex-direction: column; width: 100%; gap: 1px; }
.legend-row {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px;
  padding: 3px 2px;
  font-size: 10.5px;
}
.legend-row .legend-dot { width: 6px; height: 6px; border-radius: 50%; }
.legend-name { overflow: hidden; color: var(--ink-soft); text-overflow: ellipsis; white-space: nowrap; }
.legend-amount { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.legend-pct { width: 32px; color: var(--muted-light); font-size: 9px; font-variant-numeric: tabular-nums; text-align: right; }
.legend-empty { padding: 8px 0; color: var(--muted-light); font-size: 10.5px; text-align: center; }

.recent-panel { padding: 19px 21px 8px; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 10.5px;
  cursor: pointer;
}
.link-btn .icon { width: 13px; height: 13px; transition: transform .15s ease; }
.link-btn:hover .icon { transform: translateX(2px); }

.tx-list { margin-top: 5px; }

.tx-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 11px;
  padding: 10px 5px;
  border-bottom: 1px dashed var(--line);
  border-radius: 9px;
  transition: background .15s ease, padding .15s ease;
}
.tx-row:last-child { border-bottom: 0; }
.tx-row.is-editable { cursor: pointer; }
.tx-row.is-editable:hover, .tx-row.is-editable:focus-visible { padding-left: 9px; padding-right: 9px; background: var(--surface-soft); outline: none; }
.tx-row.read-only { grid-template-columns: 38px minmax(0, 1fr) auto; }

.tx-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--cat, #8a9a8e) 13%, #fffefa);
  color: var(--cat, #8a9a8e);
}
.tx-icon .icon { width: 17px; height: 17px; }

.tx-main { min-width: 0; }
.tx-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}
.tx-title > span:first-child { flex: 0 0 auto; }
.tx-note {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tx-sub { margin-top: 2px; color: var(--muted-light); font-size: 9.5px; }
.tx-amount {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.tx-amount.income { color: var(--green); }
.tx-amount.expense { color: var(--ink); }
.tx-chevron { color: #c2c6be; font-size: 14px; text-align: right; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 180px;
  padding: 24px 16px;
  color: var(--muted);
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 2px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted-light);
}
.empty-icon .icon { width: 20px; height: 20px; }
.empty-state strong { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.empty-state p { max-width: 280px; color: var(--muted-light); font-size: 10.5px; line-height: 1.7; }
.empty-state .btn { margin-top: 5px; height: 34px; font-size: 11px; }

/* ------------------------------------------------------------------ */
/* 查询                                                                */
/* ------------------------------------------------------------------ */

.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.section-bar p { max-width: 650px; color: var(--muted); font-size: 11px; line-height: 1.6; }

.filter-panel { padding: 15px 18px 14px; margin-bottom: 14px; }

.quick-ranges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.quick-label { margin-right: 4px; color: var(--muted-light); font-size: 9.5px; }
.quick-ranges button {
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
}
.quick-ranges button:hover { background: var(--teal-soft); color: var(--green); }
.quick-ranges button.is-active { border-color: #c6d6cb; background: var(--teal-soft); color: var(--green); }

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-top: 13px;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { color: var(--muted); font-size: 9.5px; }
.field > span em { color: var(--muted-light); font-style: normal; font-size: 9px; }
.field input, .field select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 11.5px;
  transition: border-color .15s ease, background .15s ease;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8d968d 50%), linear-gradient(135deg, #8d968d 50%, transparent 50%); background-position: calc(100% - 13px) 15px, calc(100% - 8px) 15px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 24px; }
.field input:focus, .field select:focus { border-color: #a9bdb0; background: var(--surface); }
.field input::placeholder { color: var(--muted-light); }
.field-date { grid-column: span 2; }
.field-wide { grid-column: span 2; }

.range-inputs { display: flex; align-items: center; gap: 6px; }
.range-inputs input { min-width: 0; }
.range-inputs em { color: var(--muted-light); font-style: normal; font-size: 9.5px; white-space: nowrap; }
.amount-range input { text-align: left; }

.filter-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 13px; }
.filter-actions .btn { height: 36px; padding: 0 16px; }

.result-panel { padding: 0 18px 12px; }
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 2px 12px;
  border-bottom: 1px solid var(--line);
}
.result-kpis { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.result-kpi { display: flex; align-items: baseline; gap: 5px; font-size: 10px; color: var(--muted); }
.result-kpi strong { color: var(--ink); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.result-kpi strong.income { color: var(--green); }
.result-kpi strong.expense { color: var(--clay); }
.result-period { color: var(--muted-light); font-size: 9.5px; white-space: nowrap; }

.result-panel .tx-list { margin-top: 3px; }
.result-panel .tx-row { padding-top: 11px; padding-bottom: 11px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 0 4px;
  border-top: 1px solid var(--line);
}
.pagination button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  cursor: pointer;
}
.pagination button:hover:not(:disabled) { border-color: #b9c9be; color: var(--ink); }
.pagination button:disabled { opacity: .4; cursor: default; }
.pagination .page-info { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.pagination .icon { width: 13px; height: 13px; }

/* ------------------------------------------------------------------ */
/* 分类                                                                */
/* ------------------------------------------------------------------ */

.category-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 14px;
}
.category-panel { padding: 18px 19px 8px; }
.category-list { margin-top: 7px; }

.category-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line);
}
.category-row:last-child { border-bottom: 0; }
.cat-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--cat) 13%, #fffefa);
  color: var(--cat);
}
.cat-icon .icon { width: 16px; height: 16px; }
.cat-main { min-width: 0; }
.cat-name { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 12px; font-weight: 600; }
.cat-name .default-badge {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1ede3;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 400;
}
.cat-meta { margin-top: 2px; color: var(--muted-light); font-size: 9.5px; }
.cat-actions { display: flex; align-items: center; gap: 2px; }
.cat-actions button {
  padding: 4px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  cursor: pointer;
}
.cat-actions button:hover { background: var(--surface-soft); color: var(--ink); }
.cat-actions button.danger:hover { background: var(--clay-soft); color: #9e4b36; }
.cat-actions button:disabled { opacity: .3; cursor: not-allowed; }
.cat-actions button.is-armed { background: var(--clay-soft); color: #9e4b36; }

/* ------------------------------------------------------------------ */
/* 通用表单 / 弹窗                                                     */
/* ------------------------------------------------------------------ */

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 260px;
  color: var(--muted);
  font-size: 11px;
}
.loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 107, 85, .22); }
  70% { box-shadow: 0 0 0 8px rgba(47, 107, 85, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 107, 85, 0); }
}

.error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid #e6c8bb;
  border-radius: 9px;
  background: #fbeee8;
  color: #8f4a33;
  font-size: 11.5px;
}
.error-banner button { border: 0; background: transparent; color: #8f4a33; font-size: 10.5px; text-decoration: underline; cursor: pointer; }

.view.is-loading { opacity: .5; pointer-events: none; }
.view { transition: opacity .16s ease; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 34, 28, .45);
  backdrop-filter: blur(4px);
}

.modal {
  width: min(570px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 23px 25px 20px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 28px 80px -26px rgba(10, 30, 22, .55);
  animation: modalIn .2s cubic-bezier(.2, .7, .3, 1) both;
}
.modal-sm { width: min(420px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(9px) scale(.99); } to { opacity: 1; transform: none; } }

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.modal-head h2 { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }

.type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  margin-bottom: 16px;
  border-radius: 9px;
  background: #efebe1;
}
.type-btn {
  padding: 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.type-btn.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(25, 42, 34, .08); }
.type-btn[data-kind="expense"].is-active { color: var(--clay); }
.type-btn[data-kind="income"].is-active { color: var(--green); }

.amount-field { display: block; padding: 2px 1px 11px; margin-bottom: 17px; border-bottom: 1px solid var(--line-strong); }
.amount-label { display: block; margin-bottom: 2px; color: var(--muted-light); font-size: 9.5px; }
.amount-input-wrap { display: flex; align-items: baseline; gap: 4px; }
.yen { color: var(--muted); font-size: 20px; }
.amount-input-wrap input {
  width: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 42px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.amount-input-wrap input::placeholder { color: #d9d3c4; }

.form-section { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9.5px; }

.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.category-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #f4f0e7;
  color: var(--muted);
  font-size: 10.5px;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.category-btn .cat-icon { width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto; }
.category-btn .cat-icon .icon { width: 13px; height: 13px; }
.category-btn span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-btn:hover { background: #f0ecdf; }
.category-btn.is-active { border-color: #8eac98; background: #e8f0ea; color: var(--teal); }
.category-btn.is-active::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
}

.form-row { display: grid; grid-template-columns: 1fr 1.5fr; gap: 11px; }
.date-field {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.date-field:focus-within { border-color: #a9bdb0; background: var(--surface); }
.date-field .icon { width: 13px; height: 13px; color: var(--muted); }
.date-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.date-field input::-webkit-calendar-picker-indicator { opacity: .4; }

.form-error {
  margin: 11px 1px 0;
  padding: 8px 10px;
  border-radius: 7px;
  background: #fbeee8;
  color: #984e34;
  font-size: 10.5px;
}

.modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}
.modal-spacer { flex: 1; }
.modal-foot .btn { height: 37px; font-size: 11.5px; }
#deleteBtn { padding: 0 10px; }
#deleteBtn.is-armed { background: var(--clay-soft); border-color: #dcb7a7; color: #8e432d; }

#categoryForm .field { margin-bottom: 4px; }
#categoryKindSwitch.is-hidden { display: none; }

/* ------------------------------------------------------------------ */
/* 用户管理                                                            */
/* ------------------------------------------------------------------ */

.users-panel { padding: 0 20px 10px; }

.users-head {
  display: grid;
  grid-template-columns: minmax(190px, 1.55fr) 90px 76px 60px minmax(220px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 13px 5px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 9px;
  letter-spacing: .04em;
}

.users-list { margin-top: 1px; }

.user-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.55fr) 90px 76px 60px minmax(220px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 5px;
  border-bottom: 1px dashed var(--line);
  border-radius: 8px;
  transition: background .15s ease;
}
.user-row:last-child { border-bottom: 0; }
.user-row:hover { background: var(--surface-soft); }
.user-row.is-inactive { opacity: .62; }

.user-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-avatar {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 650;
}
.user-row.is-inactive .user-avatar { background: #efebe2; color: var(--muted); }
.user-identity-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.user-identity-text strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-identity-text span { color: var(--muted-light); font-size: 9.5px; font-variant-numeric: tabular-nums; }
.self-badge {
  padding: 1px 5px;
  border-radius: 4px;
  background: #e1ebe5;
  color: var(--green);
  font-size: 8px;
  font-weight: 400;
}

.user-role-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--green);
  font-size: 9.5px;
  white-space: nowrap;
}
.user-role-pill.shareholder { background: #f2e8d8; color: #8c6a32; }

.user-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9.5px; white-space: nowrap; }
.user-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #8aaa91; }
.user-status.is-off { color: var(--muted-light); }
.user-status.is-off::before { background: #c0b9aa; }

.user-tx { color: var(--muted); font-size: 9.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.user-tx span { color: var(--muted-light); font-size: 8.5px; }

.user-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 2px; }
.user-actions button {
  padding: 4px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  white-space: nowrap;
  cursor: pointer;
}
.user-actions button:hover { background: var(--surface); color: var(--ink); }
.user-actions button.danger:hover { background: var(--clay-soft); color: #9e4b36; }
.user-actions button:disabled { opacity: .3; cursor: not-allowed; }
.user-actions button.is-armed { background: var(--clay-soft); color: #9e4b36; }

.user-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.user-form-grid .field { margin-bottom: 12px; }
#userForm > .field { margin-bottom: 12px; }
#passwordForm .field { margin-bottom: 12px; }
.form-note { margin: -4px 1px 7px; color: var(--muted-light); font-size: 9.5px; }
.modal-description {
  margin: -2px 1px 15px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.modal-description strong { color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------ */
/* 页脚 / 提示                                                         */
/* ------------------------------------------------------------------ */

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 20px 3px 2px;
  color: var(--muted-light);
  font-size: 9px;
  letter-spacing: .03em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border-radius: 9px;
  background: var(--teal-deep);
  color: #fbf8ef;
  font-size: 11px;
  box-shadow: 0 14px 30px -12px rgba(15, 35, 25, .5);
  opacity: 0;
  transform: translate(-50%, 7px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast .icon { width: 14px; height: 14px; color: #a9c9ac; }

/* ------------------------------------------------------------------ */
/* 响应式                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 218px minmax(0, 1fr); }
  .main { padding: 27px 26px 18px; }
  .insight-grid { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); }
  .money-lg { font-size: 34px; }
}

@media (max-width: 980px) {
  .insight-grid { grid-template-columns: 1fr; }
  .donut-layout { flex-direction: row; justify-content: flex-start; gap: 28px; padding-top: 16px; }
  .donut-legend { max-width: 340px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-date, .field-wide { grid-column: span 2; }
}

@media (max-width: 840px) {
  .app-shell { display: block; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: auto;
    padding: 11px 16px;
    box-shadow: 0 10px 24px -20px rgba(10, 30, 22, .8);
  }
  .sidebar::after, .sidebar-bottom { display: none; }
  .brand { padding: 0; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px 9px 9px 3px; font-size: 17px; }
  .brand-text strong { font-size: 14px; }
  .brand-text small { display: none; }
  .main-nav { flex-direction: row; gap: 2px; margin: 0 0 0 auto; }
  .nav-item { width: auto; padding: 7px 9px; font-size: 10.5px; gap: 6px; border-radius: 8px; }
  .nav-item .icon { width: 13px; height: 13px; }
  .main { min-height: calc(100vh - 54px); padding: 20px 18px 18px; }
  .topbar { margin-bottom: 18px; }
  .heading h1 { font-size: 23px; }
  .page-footer { padding-bottom: 4px; }
  .category-columns { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 280px; padding: 28px 30px; }
  .login-brand-body { margin: 26px 0 0; padding: 0; max-width: none; }
  .login-brand h1 { font-size: 27px; margin-bottom: 18px; }
  .role-list { display: flex; gap: 18px; border-top: 0; }
  .role-list li { display: block; padding: 0; border-bottom: 0; }
  .role-list li span { display: block; margin-top: 2px; }
  .login-brand-foot { display: none; }
  .login-panel { padding: 24px 18px 32px; }
  .login-card { padding: 26px 22px 22px; border: 0; box-shadow: none; background: transparent; }
}

@media (max-width: 640px) {
  .main { padding: 17px 13px 18px; }
  .sidebar { padding: 10px 12px; }
  .brand-text { display: none; }
  .main-nav { margin-left: auto; }
  .nav-item { padding: 7px 8px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .heading h1 { font-size: 22px; }
  .topbar-actions { width: 100%; flex-wrap: wrap; gap: 7px; }
  .month-picker { flex: 1; }
  .month-picker input { width: 100%; }
  .topbar-actions .btn { flex: 0 0 auto; padding: 0 12px; }
  .user-area { margin-left: auto; padding-left: 8px; height: 36px; gap: 6px; }
  .user-name { display: none; }
  .role-badge { font-size: 9px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .balance-card { grid-column: 1 / -1; min-height: 136px; }
  .stat-card { min-height: 128px; padding: 16px 14px 14px; border-radius: 15px; }
  .balance-card { padding: 17px 17px 15px; }
  .money { font-size: 25px; margin: 9px 0 7px; }
  .money-lg { font-size: 32px; }
  .stat-head { font-size: 10.5px; }
  .stat-label { gap: 5px; }
  .stat-icon { width: 20px; height: 20px; border-radius: 6px; }
  .stat-foot { font-size: 8.5px; }
  .stat-foot strong { font-size: 9.5px; }
  .delta-chip { font-size: 8.5px; padding: 2px 5px; }
  .panel { border-radius: 15px; }
  .trend-panel, .donut-panel, .recent-panel { padding: 16px 15px 12px; }
  .panel-head h2 { font-size: 15px; }
  .trend-chart { min-height: 190px; padding-left: 0; margin-top: 14px; }
  .trend-scale { display: none; }
  .chart-legend { gap: 9px; font-size: 9px; }
  .donut-layout { flex-direction: column; gap: 11px; padding-top: 12px; }
  .donut { width: 142px; height: 142px; }
  .donut-legend { max-width: none; }
  .tx-row { grid-template-columns: 35px minmax(0, 1fr) auto; gap: 9px; padding: 9px 2px; }
  .tx-icon { width: 34px; height: 34px; border-radius: 9px; }
  .tx-title { font-size: 11.5px; }
  .tx-note { font-size: 10px; }
  .tx-sub { font-size: 8.5px; }
  .tx-amount { font-size: 12.5px; }
  .tx-chevron { display: none; }
  .result-panel { padding: 0 13px 8px; }
  .result-head { align-items: flex-start; flex-direction: column; gap: 7px; padding: 12px 1px 10px; }
  .result-kpis { gap: 7px 12px; }
  .result-kpi strong { font-size: 12.5px; }
  .result-period { font-size: 8.5px; }
  .filter-panel { padding: 12px 13px; }
  .quick-ranges { gap: 3px; }
  .quick-label { width: 100%; margin-bottom: 2px; }
  .filter-grid { grid-template-columns: 1fr; gap: 10px; }
  .field-date, .field-wide { grid-column: auto; }
  .filter-actions { justify-content: stretch; }
  .filter-actions .btn { flex: 1; }
  .section-bar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-bar .btn { align-self: stretch; }
  .category-panel { padding: 16px 13px 7px; }
  .page-footer { font-size: 8px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal-sm { width: 100%; max-height: 92vh; padding: 20px 16px 16px; border-radius: 18px 18px 0 0; }
  .modal-head h2 { font-size: 18px; }
  .amount-input-wrap input { font-size: 37px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; gap: 10px; }
  .toast { bottom: 16px; max-width: calc(100vw - 26px); white-space: nowrap; }
  .pagination { gap: 8px; }
}

@media (max-width: 980px) {
  .users-head, .user-row {
    grid-template-columns: minmax(160px, 1.5fr) 80px 70px 50px minmax(190px, 1fr);
    gap: 9px;
  }
  .user-actions button { padding: 4px 4px; }
}

@media (max-width: 840px) {
  .users-head { display: none; }
  .users-panel { padding: 7px 14px 8px; }
  .user-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 3px;
  }
  .user-identity { flex: 1 1 170px; }
  .user-role, .user-status, .user-tx { align-self: center; }
  .user-status { margin-left: auto; }
  .user-actions {
    flex: 1 0 100%;
    justify-content: flex-end;
    padding-top: 7px;
    border-top: 1px dashed var(--line);
  }
  .user-actions button { padding: 5px 8px; }
  .user-form-grid { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 390px) {
  .money { font-size: 23px; }
  .money-lg { font-size: 30px; }
  .user-area .icon-btn { border: 1px solid var(--line); }
  .users-panel { padding-left: 11px; padding-right: 11px; }
  .user-identity { flex-basis: 100%; }
  .user-status { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
