:root {
  --ink: #201824;
  --ink-soft: #6f6472;
  --plum-950: #321033;
  --plum-900: #3d123e;
  --plum-800: #4b164b;
  --plum-700: #67175d;
  --plum-600: #7a1f70;
  --plum-100: #f3e8f1;
  --cream: #f8f5f2;
  --cream-deep: #f2ece6;
  --white: #fffdfc;
  --gold: #f1ca54;
  --gold-deep: #b57d0c;
  --gold-pale: #fff4d3;
  --rose: #c96e78;
  --rose-pale: #fae9eb;
  --sage: #2c7b68;
  --sage-pale: #e5f3ee;
  --line: #e8dfe7;
  --shadow: 0 18px 42px rgba(58, 24, 55, .09);
  --shadow-soft: 0 8px 24px rgba(58, 24, 55, .07);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; min-height: 100%; max-width: 100%; overflow-x: hidden; background: var(--cream); }
html { overscroll-behavior-x: none; }
body { width: 100%; min-width: 320px; touch-action: pan-y; overflow-wrap: anywhere; }
body.overlay-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
img, svg { max-width: 100%; }
.hidden { display: none !important; }

.app-shell {
  width: 100%; min-height: 100vh; overflow-x: clip; transform-origin: 50% 48%;
  transition: transform .38s cubic-bezier(.2,.82,.2,1); backface-visibility: hidden;
}
body.overlay-open .app-shell { transform: scale(.994); }
.mobile-fab-stack { display: none; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: 250px;
  display: flex; flex-direction: column; padding: 24px 16px 18px;
  color: white; background:
    radial-gradient(circle at 20% -5%, rgba(255,255,255,.09), transparent 24%),
    linear-gradient(170deg, #431840 0%, #351033 65%, #2f0e31 100%);
}
.brand-lockup { display: flex; align-items: center; gap: 13px; padding: 0 10px; }
.brand-lockup strong { display: block; font-family: Georgia, "Songti SC", serif; font-size: 23px; letter-spacing: 2px; }
.brand-lockup span { display: block; margin-top: 2px; font-size: 11px; letter-spacing: 1.7px; opacity: .76; }
.brand-mark {
  display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.14); border-radius: 14px; color: #efd294; background: rgba(255,255,255,.1);
}
.brand-mark svg { width: 26px; height: 26px; }

.nav-list { display: flex; flex-direction: column; gap: 5px; margin-top: 27px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 13px; width: 100%; height: 45px;
  padding: 0 15px; border: 0; border-radius: 13px; color: rgba(255,255,255,.79); background: transparent;
  text-align: left; transition: background-color .2s ease, color .2s ease, box-shadow .22s ease, transform .28s cubic-bezier(.2,.82,.2,1);
}
.nav-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.nav-item span { font-size: 15px; letter-spacing: .15px; }
.nav-item:hover { color: white; background: rgba(255,255,255,.07); transform: translateX(2px); }
.nav-item.active { color: white; background: rgba(255,255,255,.11); box-shadow: inset 3px 0 var(--gold); }
.nav-item i { margin-left: auto; padding: 2px 6px; border-radius: 99px; color: #40213d; background: var(--gold); font-size: 10px; font-style: normal; font-weight: 800; }
.nav-divider { height: 1px; margin: 8px 10px; background: rgba(255,255,255,.09); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 10px; }
.quick-ledger-button {
  display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid rgba(245,207,90,.34);
  border-radius: 15px; color: #2f1730; background: linear-gradient(135deg, #f7d86f, #eebf43);
  box-shadow: 0 12px 24px rgba(5,0,5,.19); text-align: left;
}
.quick-ledger-button > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; background: rgba(255,255,255,.45); font-size: 22px; }
.quick-ledger-button strong, .quick-ledger-button small { display: block; }
.quick-ledger-button strong { font-size: 14px; }
.quick-ledger-button small { margin-top: 2px; font-size: 10px; opacity: .72; }
.sidebar-safe { display: flex; align-items: center; gap: 9px; padding: 7px 11px; color: rgba(255,255,255,.75); }
.sidebar-safe strong, .sidebar-safe small { display: block; font-size: 10px; }
.sidebar-safe small { margin-top: 2px; opacity: .6; }
.safe-dot { width: 8px; height: 8px; border-radius: 50%; background: #58d59e; box-shadow: 0 0 0 4px rgba(88,213,158,.12); }
.user-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%;
  padding: 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 15px; color: white; background: rgba(255,255,255,.07); text-align: left;
}
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #3b1b38; background: var(--gold); font-weight: 800; }
.user-card strong, .user-card small { display: block; }
.user-card strong { font-size: 14px; }
.user-card small { margin-top: 1px; font-size: 10px; opacity: .72; }
.user-card b { letter-spacing: 2px; }

.main-area { min-height: 100vh; margin-left: 250px; overflow-x: clip; }
.topbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; min-height: 104px;
  padding: 22px 6.3%; border-bottom: 1px solid rgba(73,45,70,.08); background: rgba(248,245,242,.88); backdrop-filter: blur(18px);
}
.eyebrow { color: var(--plum-600); font-size: 12px; font-weight: 800; letter-spacing: .7px; }
.page-heading h1 { margin: 5px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 27px; line-height: 1.15; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.search-box {
  display: flex; align-items: center; gap: 9px; width: 350px; height: 46px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.8); color: var(--ink-soft);
}
.search-box:focus-within { border-color: rgba(122,31,112,.42); box-shadow: 0 0 0 4px rgba(122,31,112,.07); }
.search-box svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box kbd { padding: 2px 6px; border: 1px solid #e0d8df; border-radius: 6px; color: #9b8f9b; background: #fff; font-size: 10px; white-space: nowrap; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 43px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 13px; font-weight: 800;
  transition: transform .28s cubic-bezier(.2,.82,.2,1), box-shadow .22s ease, background-color .22s ease, opacity .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: linear-gradient(135deg, #7b1d70, #68155e); box-shadow: 0 10px 22px rgba(100,22,91,.2); }
.button.primary:hover { box-shadow: 0 12px 26px rgba(100,22,91,.27); }
.button.gold { color: #3c2338; background: var(--gold); }
.button.ghost { color: var(--plum-700); border-color: var(--line); background: white; }
.button.soft { color: var(--plum-700); background: var(--plum-100); }
.button.danger { color: #a8424d; background: var(--rose-pale); }
.button.small { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 12px; }
.button.wide { width: 100%; }
.grow { flex: 1; }
.icon-button {
  display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; color: var(--ink-soft); background: #f4eff3; font-size: 23px;
  transition: transform .28s cubic-bezier(.2,.82,.2,1), background-color .2s ease, opacity .18s ease;
}
button:disabled { cursor: wait; opacity: .56; transform: none !important; }
.button.is-saving { opacity: .82; }
.button.is-saving::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -2px;
  animation: buttonSpin .7s linear infinite;
}
@keyframes buttonSpin { to { transform: rotate(360deg); } }

.demo-banner {
  display: flex; align-items: center; gap: 12px; margin: 20px 6.3% 0; padding: 11px 16px;
  border: 1px solid #ecd69e; border-radius: 13px; color: #705018; background: #fff8e7; font-size: 12px;
}
.demo-banner strong { color: #55370a; }
.page-content { padding: 24px 6.3% 72px; }
body.route-loading::after {
  content: "";
  position: fixed;
  z-index: 90;
  top: 0;
  left: 250px;
  width: min(38vw, 520px);
  height: 3px;
  border-radius: 0 99px 99px 0;
  background: linear-gradient(90deg, transparent, var(--gold), var(--plum-600), transparent);
  box-shadow: 0 2px 10px rgba(122,31,112,.22);
  animation: routeProgress .9s cubic-bezier(.2,.78,.2,1) infinite;
  pointer-events: none;
}
@keyframes routeProgress {
  from { transform: translate3d(-100%,0,0); }
  to { transform: translate3d(calc(100vw + 520px),0,0); }
}
.page-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-toolbar h2 { margin: 0; font-size: 18px; }
.toolbar-group { display: flex; align-items: center; gap: 9px; }
.select, .field-input {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; outline: none;
}
.select:focus, .field-input:focus { border-color: rgba(122,31,112,.5); box-shadow: 0 0 0 3px rgba(122,31,112,.07); }
.page-search {
  display: flex; align-items: center; gap: 9px; width: min(420px, 100%); height: 43px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 13px; color: var(--ink-soft); background: white;
}
.page-search:focus-within { border-color: rgba(122,31,112,.45); box-shadow: 0 0 0 3px rgba(122,31,112,.07); }
.page-search svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.page-search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.page-search button { display: grid; place-items: center; width: 27px; height: 27px; border: 0; border-radius: 8px; color: var(--ink-soft); background: #f2edf1; }
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-pill { min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-soft); background: white; font-size: 11px; font-weight: 800; }
.filter-pill.active { color: var(--plum-700); border-color: rgba(122,31,112,.35); background: var(--plum-100); }
.period-control-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 13px 16px; }
.period-control-copy strong, .period-control-copy small { display: block; }
.period-control-copy strong { font-size: 13px; }
.period-control-copy small { margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.period-control-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.period-picker { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.period-picker > .select { min-width: 136px; }
.period-year-select { text-align: center; text-align-last: center; }
.period-range-picker, .ledger-range-picker {
  display: grid; grid-template-columns: minmax(150px,1fr) auto minmax(150px,1fr); align-items: end; gap: 8px;
  color: var(--ink-soft); font-size: 10px; font-weight: 700;
}
.period-range-picker { min-width: 390px; }
.ledger-range-picker { min-width: 390px; margin-left: auto; }
.period-range-picker label, .ledger-range-picker label { display: grid; gap: 5px; min-width: 0; }
.period-range-picker i, .ledger-range-picker i { align-self: center; padding-top: 15px; font-style: normal; text-align: center; }
.period-range-picker .select, .ledger-range-picker .select { width: 100%; min-width: 0; }
.period-range-picker .native-picker-control, .ledger-range-picker .native-picker-control { width: 100%; min-width: 0; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(250px, .65fr); gap: 16px; }
.hero-grid.dashboard-hero-single { grid-template-columns: 1fr; }
.hero-card {
  position: relative; min-height: 194px; overflow: hidden; padding: 27px;
  border-radius: var(--radius-xl); color: white;
  background: radial-gradient(circle at 86% 22%, rgba(255,255,255,.17), transparent 30%), linear-gradient(135deg, #451347, #7b2569);
  box-shadow: 0 21px 44px rgba(65,18,62,.16);
}
.hero-card::after { content: ""; position: absolute; right: -40px; bottom: -95px; width: 260px; height: 260px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.hero-card .label { font-size: 13px; opacity: .86; }
.hero-card .hero-number { margin-top: 18px; font-family: Georgia, serif; font-size: 42px; font-weight: 700; letter-spacing: -.8px; }
.hero-card .hero-note { margin-top: 10px; color: var(--gold); font-size: 13px; font-weight: 700; }
.hero-card .hero-actions { position: absolute; right: 25px; bottom: 24px; z-index: 1; display: flex; gap: 8px; }
.hero-card .hero-actions .button { color: #3b2037; background: rgba(255,255,255,.92); box-shadow: none; }
.panel {
  border: 1px solid var(--line); border-radius: var(--radius-xl); background: rgba(255,255,255,.87); box-shadow: var(--shadow-soft);
}
.mini-panel { min-height: 194px; padding: 22px; }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-title h3 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 18px; }
.panel-title p { margin: 5px 0 0; color: var(--ink-soft); font-size: 11px; }
.status-badge { padding: 4px 9px; border-radius: 99px; font-size: 10px; font-weight: 800; }
.status-badge.safe { color: var(--sage); background: var(--sage-pale); }
.status-badge.pending { color: #9b6411; background: var(--gold-pale); }
.status-badge.auto { color: var(--plum-700); background: var(--plum-100); }
.status-badge.voided { color: #a44852; background: var(--rose-pale); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.visit-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
.metric-card {
  position: relative; min-height: 130px; overflow: hidden; padding: 21px;
  border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.88); box-shadow: var(--shadow-soft);
}
.metric-card::after { content: ""; position: absolute; right: -23px; top: -35px; width: 88px; height: 88px; border-radius: 50%; background: var(--tint, #f3e7f1); }
.metric-card .metric-label { position: relative; z-index: 1; color: var(--ink-soft); font-size: 12px; }
.metric-card strong { position: relative; z-index: 1; display: block; margin-top: 15px; font-family: Georgia, serif; font-size: 29px; line-height: 1; }
.metric-card small { position: relative; z-index: 1; display: block; margin-top: 12px; color: var(--sage); font-size: 10px; }
.metric-card.expense strong { color: #b55662; }
.metric-card.income strong { color: #9b6900; }
.metric-card.balance strong { color: var(--plum-700); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 16px; margin-top: 18px; }
.content-panel { padding: 22px; }
.empty-state { display: grid; place-items: center; min-height: 180px; color: var(--ink-soft); text-align: center; }
.empty-state .empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 10px; border-radius: 17px; color: var(--plum-700); background: var(--plum-100); font-size: 20px; }
.empty-state h3 { margin: 0; color: var(--ink); font-size: 16px; }
.empty-state p { margin: 6px 0 0; font-size: 11px; }

.table-panel { margin-top: 18px; overflow: hidden; }
.table-panel .panel-title { padding: 21px 21px 13px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 11px 18px; color: #857985; background: #faf7f9; font-size: 10px; text-align: left; letter-spacing: .4px; }
.data-table td { padding: 14px 18px; border-top: 1px solid #eee7ed; vertical-align: middle; }
.data-table tr:hover td { background: #fdfafb; }
.table-actions { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
.table-note { max-width: 260px; line-height: 1.5; }
.money { font-family: Georgia, serif; font-size: 14px; font-weight: 800; white-space: nowrap; }
.money.income { color: #a36b00; }
.money.expense { color: #b3545f; }
.ledger-mobile-list { display: none; }
.ledger-control-panel { margin-bottom: 18px; padding: 7px 20px; }
.ledger-control-row, .ledger-action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 15px; padding: 13px 0; }
.ledger-control-row + .ledger-control-row, .ledger-action-row { border-top: 1px solid #eee7ed; }
.ledger-control-label { width: 118px; flex: 0 0 auto; }
.ledger-control-label strong, .ledger-control-label small, .ledger-action-row > div:first-child strong, .ledger-action-row > div:first-child small { display: block; }
.ledger-control-label strong, .ledger-action-row > div:first-child strong { font-size: 13px; }
.ledger-control-label small, .ledger-action-row > div:first-child small { margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.ledger-picker { display: flex; align-items: center; gap: 7px; margin-left: auto; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.ledger-action-row { justify-content: space-between; }
.ledger-summary-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.75fr); gap: 16px; }
.ledger-summary-card { position: relative; min-height: 210px; overflow: hidden; padding: 26px; border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.ledger-summary-card::after { content: ""; position: absolute; right: -62px; bottom: -128px; width: 260px; height: 260px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; pointer-events: none; }
.ledger-summary-card .summary-kicker { display: block; font-size: 13px; font-weight: 700; opacity: .85; }
.ledger-summary-card > strong { display: block; margin-top: 14px; font: 700 40px Georgia, serif; }
.ledger-summary-card > .button { position: absolute; right: 24px; bottom: 23px; z-index: 1; }
.income-summary { color: white; background: radial-gradient(circle at 82% 20%,rgba(255,255,255,.16),transparent 26%),linear-gradient(135deg,#451347,#7b2569); }
.income-summary > .button { color: #3b2037; background: rgba(255,255,255,.94); }
.expense-summary { color: #72333b; border: 1px solid #efd8dc; background: radial-gradient(circle at 88% 12%,rgba(255,255,255,.8),transparent 28%),linear-gradient(145deg,#fff7f7,#f8e6e9); }
.expense-summary::after { border-color: rgba(179,84,95,.12); }
.expense-summary p { max-width: 260px; color: #876b70; font-size: 11px; line-height: 1.7; }
.expense-summary > .button { color: #98424c; background: white; }
.summary-breakdown { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; padding-right: 130px; }
.summary-breakdown span { min-width: 105px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.14); border-radius: 11px; background: rgba(255,255,255,.08); font: 700 12px Georgia, serif; }
.summary-breakdown b { display: block; margin-bottom: 4px; font: 500 9px "Microsoft YaHei UI",sans-serif; opacity: .72; }
.ledger-insights { margin-top: 18px; }
.ledger-expense-breakdown { max-width: 760px; }
.ledger-entry-card { border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 8px 20px rgba(58,24,55,.055); }
.ledger-entry-card.is-voided { opacity: .68; }
.ledger-entry-head, .ledger-entry-main, .ledger-entry-meta, .ledger-entry-actions { display: flex; align-items: center; }
.ledger-entry-head { justify-content: space-between; padding: 12px 14px 8px; }
.ledger-entry-head time { color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.ledger-entry-main { justify-content: space-between; gap: 12px; padding: 0 14px 11px; }
.ledger-entry-main strong, .ledger-entry-main small { display: block; }
.ledger-entry-main strong { font-size: 14px; }
.ledger-entry-main small { max-width: 210px; margin-top: 4px; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
.ledger-entry-main .money { font-size: 18px; }
.ledger-entry-meta { flex-wrap: wrap; gap: 5px 12px; padding: 9px 14px; border-top: 1px solid #f2ebf0; color: var(--ink-soft); font-size: 9px; }
.ledger-entry-meta a { color: var(--plum-700); }
.ledger-entry-actions { justify-content: flex-end; padding: 9px 12px 12px; }
.money.voided { color: #aaa0a8; text-decoration: line-through; }
.muted { color: var(--ink-soft); }
.source-cell { display: flex; align-items: center; gap: 6px; }
.member-cell { display: flex; align-items: center; gap: 9px; }
.member-avatar { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; color: var(--plum-700); background: var(--plum-100); font-weight: 800; }
.member-cell strong, .member-cell small { display: block; }
.member-cell small { margin-top: 2px; color: var(--ink-soft); font-size: 10px; }

.report-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding: 18px 20px;
  border: 1px solid #ecd39c; border-radius: 19px; background: linear-gradient(100deg, #fffdf7, #fff8e8); box-shadow: var(--shadow-soft);
}
.report-banner .report-copy { display: flex; align-items: center; gap: 14px; }
.report-banner .report-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: #9b6900; background: #fce8ae; font-size: 24px; }
.report-banner strong, .report-banner small { display: block; }
.report-banner strong { font-size: 14px; }
.report-banner small { margin-top: 4px; color: var(--ink-soft); font-size: 10px; }

.donut-layout { display: grid; grid-template-columns: 145px 1fr; align-items: center; gap: 12px; min-height: 220px; }
.donut { position: relative; width: 132px; height: 132px; border-radius: 50%; background: conic-gradient(var(--plum-600) 0 38%, var(--gold) 38% 65%, var(--rose) 65% 82%, #87b6a8 82% 100%); }
.donut::after { content: ""; position: absolute; inset: 25px; border-radius: 50%; background: white; }
.donut-center { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-family: Georgia, serif; font-size: 19px; }
.donut-center span { color: var(--ink-soft); font-size: 9px; }
.category-list { display: grid; gap: 10px; }
.category-row { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 8px; font-size: 11px; }
.category-row i { width: 8px; height: 8px; border-radius: 50%; }
.category-row strong { font-family: Georgia, serif; }

.quick-actions-list { display: grid; gap: 9px; margin-top: 18px; }
.quick-action-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid #eee6ec; border-radius: 13px; background: #fdfafb; }
.quick-action-row .q-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--plum-100); }
.quick-action-row strong, .quick-action-row small { display: block; }
.quick-action-row strong { font-size: 12px; }
.quick-action-row small { margin-top: 2px; color: var(--ink-soft); font-size: 9px; }
.quick-action-row button { border: 0; color: var(--plum-700); background: transparent; font-size: 18px; }

.section-card { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: #fdfafb; }
.section-card + .section-card { margin-top: 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.section-heading strong { color: var(--ink); font-size: 13px; }
.section-heading span { color: var(--ink-soft); font-size: 10px; }
.plan-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.plan-choice {
  display: grid; gap: 4px; padding: 13px; border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); background: white; text-align: left;
}
.plan-choice strong { font-size: 12px; }
.plan-choice small { color: var(--ink-soft); font-size: 9px; line-height: 1.5; }
.plan-choice.active { border-color: rgba(122,31,112,.5); background: var(--plum-100); box-shadow: 0 0 0 2px rgba(122,31,112,.06); }
.plan-choice.no-card { border-style: dashed; }
.member-picker { position: relative; }
.member-search-results { display: grid; gap: 7px; max-height: 230px; margin-top: 8px; overflow-y: auto; }
.member-result {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 11px;
  border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: white; text-align: left;
}
.member-result:hover, .member-result.active { border-color: rgba(122,31,112,.42); background: var(--plum-100); }
.member-result:disabled { cursor: not-allowed; opacity: .58; }
.member-result strong, .member-result small { display: block; }
.member-result small { margin-top: 2px; color: var(--ink-soft); font-size: 9px; }
.member-result > em { color: var(--plum-700); font-size: 10px; font-style: normal; font-weight: 800; }
.selected-member-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 13px; border: 1px solid #d9c7d6; border-radius: 15px; background: var(--plum-100); }
.selected-member-card strong, .selected-member-card small { display: block; }
.selected-member-card small { margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.selected-member-card button { border: 0; color: var(--plum-700); background: transparent; font-weight: 800; }
.visit-rule { display: flex; align-items: center; gap: 11px; padding: 13px; border-radius: 14px; color: #64470c; background: var(--gold-pale); }
.visit-rule strong, .visit-rule span { display: block; }
.visit-rule span { margin-top: 3px; font-size: 10px; line-height: 1.5; }
.platform-income-tip { display: grid; gap: 3px; margin-top: 14px; padding: 12px 13px; border: 1px solid #ecd39c; border-radius: 13px; color: #62460f; background: var(--gold-pale); }
.platform-income-tip strong { font-size: 11px; }
.platform-income-tip span { font-size: 10px; line-height: 1.55; }
.detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.detail-stat { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fdfafb; }
.detail-stat span, .detail-stat strong { display: block; }
.detail-stat span { color: var(--ink-soft); font-size: 9px; }
.detail-stat strong { margin-top: 6px; font-size: 15px; }
.history-list { display: grid; gap: 8px; max-height: 270px; overflow-y: auto; }
.history-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.history-row strong, .history-row small { display: block; }
.history-row small { margin-top: 3px; color: var(--ink-soft); font-size: 9px; }
.danger-note { padding: 12px; border: 1px solid #f0cbd0; border-radius: 13px; color: #8d3f49; background: var(--rose-pale); font-size: 10px; line-height: 1.6; }

.enrollment-toggle-card { padding: 13px 17px; }
.enrollment-toggle { display: flex !important; align-items: center; justify-content: space-between; gap: 16px !important; cursor: pointer; }
.enrollment-toggle > span { display: grid; gap: 3px; }
.enrollment-toggle strong { color: var(--ink); font-size: 13px; }
.enrollment-toggle small { color: var(--ink-soft); font-size: 10px; font-weight: 400; }
.enrollment-toggle input { width: 42px !important; min-height: 24px !important; appearance: none; padding: 2px !important; border: 0 !important; border-radius: 20px !important; background: #d9d0d7 !important; box-shadow: none !important; transition: background .18s; }
.enrollment-toggle input::after { content: ""; display: block; width: 20px; height: 20px; border-radius: 50%; background: white; box-shadow: 0 2px 7px rgba(39,15,37,.2); transition: transform .18s; }
.enrollment-toggle input:checked { background: var(--plum-600) !important; }
.enrollment-toggle input:checked::after { transform: translateX(18px); }
.plan-gift-summary { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin-bottom: 13px; padding: 11px 13px; border: 1px solid #ecdcae; border-radius: 13px; background: #fff9e9; }
.plan-gift-summary strong { color: #72520b; font-size: 11px; }
.plan-gift-summary span { color: var(--ink); font-size: 11px; line-height: 1.55; }
.plan-gift-summary small { grid-column: 2; color: var(--ink-soft); font-size: 9px; }
.family-card-hint { padding: 10px 12px; border-radius: 12px; color: var(--plum-700); background: var(--plum-100); font-size: 10px; line-height: 1.6; }
.member-note-card { padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink-soft); background: #fff; font-size: 11px; line-height: 1.6; }
.owned-card-list { display: grid; gap: 12px; }
.owned-card-block { padding: 15px; border: 1px solid #d9c7d6; border-radius: 16px; background: white; box-shadow: 0 7px 18px rgba(55,24,52,.04); }
.owned-card-block.inactive { opacity: .76; background: #faf7f9; }
.owned-card-head { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.owned-card-head strong, .owned-card-head small { display: block; }
.owned-card-head strong { color: var(--ink); font-size: 13px; }
.owned-card-head small { margin-top: 5px; color: var(--ink-soft); font-size: 9px; line-height: 1.55; }
.owned-card-balance { color: var(--plum-700); font-family: Georgia, "Songti SC", serif; font-size: 17px; font-weight: 800; white-space: nowrap; }
.owned-card-status { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.owned-card-status small { color: var(--ink-soft); font-size: 9px; }
.owned-card-gifts { margin: 12px 0; padding: 11px; border-radius: 12px; background: #fcf7fa; }
.owned-card-gifts > span { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.owned-card-gifts > div { display: flex; flex-wrap: wrap; gap: 7px; }
.refund-record { display: grid; gap: 5px; margin-top: 12px; padding: 11px 12px; border: 1px solid #ecc7cd; border-radius: 13px; background: #fff4f5; color: #79343e; }
.refund-record.is-voided { border-color: #ddd4dc; background: #f7f4f6; color: var(--ink-soft); }
.refund-record > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.refund-record span { font-size: 9px; font-weight: 800; }
.refund-record strong { font-size: 12px; }
.refund-record small { color: inherit; font-size: 9px; line-height: 1.55; }
.refund-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.refund-summary > div { padding: 13px; border: 1px solid #e3d7e1; border-radius: 14px; background: #fff; }
.refund-summary span, .refund-summary strong { display: block; }
.refund-summary span { color: var(--ink-soft); font-size: 9px; }
.refund-summary strong { margin-top: 6px; color: var(--plum-800); font-size: 15px; }
.refund-guidance { display: grid; gap: 5px; padding: 13px; border: 1px solid #efd98f; border-radius: 14px; background: #fff8dc; }
.refund-guidance strong { color: #7b5812; font-size: 13px; }
.refund-guidance span, .refund-guidance small { color: #766749; font-size: 9px; line-height: 1.55; }
.refund-confirm { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 9px !important; padding: 12px; border-radius: 13px; background: #faf6f9; }
.refund-confirm input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }
.refund-confirm span { color: var(--ink-soft); font-size: 9px; line-height: 1.6; }
.gift-state-button { min-height: 31px; padding: 0 10px; border: 1px solid #e5c57a; border-radius: 10px; color: #795b11; background: #fff8df; font-size: 9px; font-weight: 800; }
.gift-state-button.completed { color: #3b7d67; border-color: #b9dfd1; background: #edf8f4; text-decoration: line-through; }
.visit-card-choice { display: grid !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; padding: 12px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink) !important; background: white; cursor: pointer; }
.visit-card-choice:has(input:checked) { border-color: rgba(122,31,112,.52); background: var(--plum-100); box-shadow: 0 0 0 2px rgba(122,31,112,.05); }
.visit-card-choice input { width: 17px !important; min-height: 17px !important; padding: 0 !important; accent-color: var(--plum-600); }
.visit-card-choice strong, .visit-card-choice small { display: block; }
.visit-card-choice small { margin-top: 3px; color: var(--ink-soft); font-size: 9px; font-weight: 400; }
.plan-settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.plan-setting-card { padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: var(--shadow-soft); }
.plan-setting-card.inactive { opacity: .68; background: #f7f3f6; }
.plan-setting-head { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.plan-setting-head strong, .plan-setting-head small { display: block; }
.plan-setting-head strong { color: var(--ink); font-size: 14px; }
.plan-setting-head small { margin-top: 4px; color: var(--ink-soft); font-size: 9px; }
.plan-setting-head b { color: var(--plum-700); font-family: Georgia, serif; font-size: 21px; white-space: nowrap; }
.plan-setting-rule { margin-top: 13px; padding: 10px 11px; border-radius: 11px; color: var(--ink); background: #faf5f8; font-size: 10px; line-height: 1.6; }
.plan-setting-card p { margin: 9px 0 0; color: var(--ink-soft); font-size: 9px; line-height: 1.55; }
.plan-setting-card .table-actions { margin-top: 13px; }

.permission-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.permission-cards article { display: flex; align-items: flex-start; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.88); box-shadow: var(--shadow-soft); }
.permission-cards strong, .permission-cards small { display: block; }
.permission-cards strong { font-size: 14px; }
.permission-cards small { margin-top: 5px; color: var(--ink-soft); font-size: 10px; line-height: 1.65; }
.permission-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; color: var(--plum-700); background: var(--plum-100); font-weight: 900; }
.permission-icon.manager { color: #805b0a; background: var(--gold-pale); }
.role-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: var(--plum-700); background: var(--plum-100); font-size: 10px; font-weight: 800; }
.role-badge.owner { color: #805b0a; background: var(--gold-pale); }
.role-badge.staff { color: var(--sage); background: var(--sage-pale); }
.permission-copy { color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.modal-intro { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.invite-result { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px 16px; padding: 18px; border: 1px solid #e7d6e3; border-radius: 17px; background: linear-gradient(145deg,#fff,#faf3f8); }
.invite-result span { color: var(--ink-soft); font-size: 10px; }
.invite-result strong { color: var(--ink); font-size: 17px; text-align: right; }
.invite-result b { padding: 8px 11px; border: 1px dashed #b98aae; border-radius: 10px; color: var(--plum-700); background: white; font-family: ui-monospace,"Cascadia Mono",monospace; font-size: 23px; letter-spacing: 2px; user-select: all; }
.invite-result small { grid-column: 1 / -1; padding-top: 9px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 9px; }
.invite-steps { display: grid; gap: 7px; padding: 14px 16px; border-radius: 14px; background: #f8f4f6; }
.invite-steps b { font-size: 11px; }
.invite-steps span { color: var(--ink-soft); font-size: 10px; }
.danger-note strong, .danger-note span { display: block; }
.danger-note span { margin-top: 4px; }

.tabs { display: inline-flex; gap: 3px; padding: 4px; border-radius: 12px; background: #eee8ed; }
.tabs button { min-height: 33px; padding: 0 13px; border: 0; border-radius: 9px; color: var(--ink-soft); background: transparent; font-size: 11px; font-weight: 700; transition: color .2s ease, background-color .2s ease, box-shadow .22s ease, transform .28s cubic-bezier(.2,.82,.2,1); }
.tabs button.active { color: var(--plum-700); background: white; box-shadow: 0 3px 10px rgba(64,30,60,.08); }

.backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(24,9,24,.38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .24s ease, visibility 0s linear .28s;
}
.backdrop.visible { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.drawer {
  position: fixed; left: 50%; top: 50%; z-index: 60; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-x: hidden; overflow-y: auto;
  padding: 25px 28px; border: 1px solid rgba(255,255,255,.72); border-radius: 27px; background: #fffcfb;
  box-shadow: 0 30px 90px rgba(38,13,37,.24); opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate3d(-50%, calc(-50% + 14px), 0) scale(.965); transform-origin: 50% 50%; backface-visibility: hidden;
  transition: transform .28s cubic-bezier(.4,0,.7,1), opacity .2s ease, visibility 0s linear .28s;
}
.drawer.open {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translate3d(-50%, -50%, 0) scale(1);
  transition: transform .36s cubic-bezier(.16,1,.3,1), opacity .2s ease, visibility 0s; transition-delay: 0s;
}
.drawer-head, .modal-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2, .modal-head h2 { margin: 4px 0 0; font-family: Georgia, "Songti SC", serif; font-size: 25px; }
.drawer-body { width: 100%; max-width: 100%; padding: 19px 0; overflow-x: clip; }
.drawer-body > *, .drawer .form-grid, .drawer .form-grid > label { width: 100%; max-width: 100%; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 5px; border-radius: 14px; background: #eee8ed; }
.segmented button { height: 39px; border: 0; border-radius: 10px; color: var(--ink-soft); background: transparent; font-weight: 800; transition: color .2s ease, background-color .2s ease, box-shadow .22s ease, transform .28s cubic-bezier(.2,.82,.2,1); }
.segmented button.active[data-direction="expense"] { color: #a33e4b; background: white; box-shadow: var(--shadow-soft); }
.segmented button.active[data-direction="income"] { color: #8a6000; background: white; box-shadow: var(--shadow-soft); }
.amount-field { display: block; margin-top: 20px; }
.amount-field > span { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.amount-field > div { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; padding-bottom: 9px; border-bottom: 2px solid #d9ced7; }
.amount-field b { color: var(--plum-700); font-family: Georgia, serif; font-size: 26px; }
.amount-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-family: Georgia, serif; font-size: 40px; font-weight: 700; }
.drawer fieldset { margin: 22px 0 0; padding: 0; border: 0; }
.drawer legend { margin-bottom: 10px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.drawer legend em { color: var(--rose); font-style: normal; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chip { min-height: 37px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-soft); background: white; font-size: 11px; transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .22s ease, transform .28s cubic-bezier(.2,.82,.2,1); }
.choice-chip:hover { border-color: #cdbdca; }
.choice-chip.active { color: var(--plum-700); border-color: rgba(122,31,112,.45); background: var(--plum-100); font-weight: 800; }
.drawer label:not(.amount-field):not(.receipt-upload), .stack-form label, .modal-body label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.drawer label input, .drawer label select, .drawer label textarea, .stack-form input, .modal-body input, .modal-body select, .modal-body textarea {
  width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; outline: 0;
}
input[type="date"], input[type="month"] { display: block; width: 100%; min-width: 0; max-width: 100%; inline-size: 100%; min-inline-size: 0; max-inline-size: 100%; }
.native-picker-control {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 100%; max-width: 100%; min-height: 48px; padding: 0 44px; overflow: hidden; contain: inline-size;
  border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white;
  font-size: 16px; font-weight: 700; line-height: 1; white-space: nowrap; vertical-align: middle;
}
.native-picker-control.compact { width: 178px; min-height: 40px; font-size: 14px; }
.native-picker-value { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: inherit; line-height: 1; text-align: center; }
.native-picker-control.empty .native-picker-value { color: #aaa1aa; font-weight: 600; }
.native-picker-control svg {
  position: absolute; top: 50%; right: 14px; width: 18px; height: 18px; transform: translateY(-50%);
  fill: none; stroke: var(--plum-600); stroke-width: 1.7; stroke-linecap: round; pointer-events: none;
}
.native-picker-control > input {
  position: absolute; inset: 0; z-index: 1; display: block; width: 100% !important; min-width: 0 !important; max-width: 100% !important;
  height: 100%; min-height: 0 !important; margin: 0 !important; padding: 0 !important; overflow: hidden;
  border: 0 !important; border-radius: inherit; opacity: 0; cursor: pointer; box-shadow: none !important; -webkit-appearance: none; appearance: none;
}
.native-picker-control:focus-within { border-color: rgba(122,31,112,.5); box-shadow: 0 0 0 3px rgba(122,31,112,.07); }
.panel-title > .native-picker-control { flex: 0 1 178px; }
.ledger-picker .native-picker-control { flex: 0 1 178px; }
.filter-bar > label { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.filter-bar > label .native-picker-control { flex: 1 1 178px; }
.drawer label input:focus, .drawer label select:focus, .stack-form input:focus, .modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus { border-color: rgba(122,31,112,.5); box-shadow: 0 0 0 3px rgba(122,31,112,.07); }
.form-grid { display: grid; gap: 12px; margin-top: 18px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.drawer-body > label:not(.amount-field):not(.receipt-upload) { margin-top: 18px; }
.receipt-upload { display: grid; place-items: center; gap: 4px; min-height: 74px; margin-top: 18px; border: 1px dashed #cfbecb; border-radius: 13px; color: var(--plum-700); background: #fdf9fc; font-size: 12px; font-weight: 800; cursor: pointer; }
.receipt-upload input { display: none; }
.receipt-upload small { color: var(--ink-soft); font-size: 9px; font-weight: 400; }
.drawer-actions { display: flex; gap: 9px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }

.modal-backdrop { z-index: 110; }
.modal {
  position: fixed; left: 50%; top: 50%; z-index: 111; width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-x: hidden; overflow-y: auto;
  padding: 23px; border: 1px solid rgba(255,255,255,.7); border-radius: 23px; background: #fffcfb; box-shadow: 0 30px 90px rgba(38,13,37,.25);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translate3d(-50%, calc(-50% + 12px), 0) scale(.965); transform-origin: 50% 50%; backface-visibility: hidden;
  transition: transform .28s cubic-bezier(.4,0,.7,1), opacity .2s ease, visibility 0s linear .28s;
}
.modal.open {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translate3d(-50%, -50%, 0) scale(1);
  transition: transform .36s cubic-bezier(.16,1,.3,1), opacity .2s ease, visibility 0s; transition-delay: 0s;
}
.modal.modal-wide { width: min(790px, calc(100vw - 32px)); }
.modal-body { padding-top: 19px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.stack-form { display: grid; gap: 14px; }
.form-section { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); }
.form-help { margin: -4px 0 0; color: var(--ink-soft); font-size: 9px; line-height: 1.55; }
.check-line { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 8px !important; }
.check-line input { width: 17px !important; min-height: 17px !important; padding: 0 !important; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.lotus-mark { width: 100%; height: 100%; }
.launch-splash {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-content: center; justify-items: center;
  overflow: hidden; color: white; background:
    radial-gradient(circle at 50% 42%,rgba(242,203,117,.2),transparent 25%),
    radial-gradient(circle at 18% 14%,rgba(255,255,255,.06),transparent 32%),
    linear-gradient(155deg,#2f0e32 0%,#531852 58%,#351036 100%);
  opacity: 1; visibility: visible; transition: opacity .1s ease,visibility .1s ease;
}
.launch-splash::before, .launch-splash::after {
  content: ""; position: absolute; width: 74vw; height: 74vw; max-width: 620px; max-height: 620px;
  border: 1px solid rgba(255,255,255,.055); border-radius: 50%;
}
.launch-splash::before { right: -32vw; bottom: -30vw; box-shadow: 0 0 0 70px rgba(255,255,255,.018),0 0 0 140px rgba(255,255,255,.012); }
.launch-splash::after { left: -48vw; top: -45vw; }
.launch-splash img { position: relative; z-index: 1; width: 92px; height: 92px; filter: drop-shadow(0 18px 30px rgba(25,4,25,.28)); animation: splashBreath 1.6s ease-in-out infinite; }
.launch-splash strong { position: relative; z-index: 1; margin-top: 22px; font-family: Georgia,"Songti SC",serif; font-size: 28px; letter-spacing: .22em; text-indent: .22em; }
.launch-splash span { position: relative; z-index: 1; margin-top: 8px; color: rgba(255,255,255,.68); font-size: 12px; letter-spacing: .28em; text-indent: .28em; }
.launch-splash.leaving { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes splashBreath { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.025); } }
.auth-shell {
  position: fixed; inset: 0; z-index: 100; min-height: 100dvh; overflow-y: auto;
  display: grid; grid-template-columns: minmax(420px,1.15fr) minmax(420px,.85fr); background: #f7f2f0;
}
.auth-brand {
  position: relative; min-height: 100dvh; padding: 9vh 8vw; overflow: hidden; color: white;
  background: radial-gradient(circle at 20% 18%,rgba(218,174,89,.28),transparent 30%),linear-gradient(145deg,#2e1134,#60205d 65%,#32123a);
}
.auth-brand::after {
  content: ""; position: absolute; right: -14vw; bottom: -26vw; width: 50vw; height: 50vw;
  border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025),0 0 0 140px rgba(255,255,255,.02);
}
.auth-logo { width: 72px; height: 72px; padding: 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 25px; color: #efd294; background: rgba(255,255,255,.1); backdrop-filter: blur(8px); }
.auth-brand .eyebrow { display: block; margin-top: 13vh; color: #dec0d9; }
.auth-brand h1 { position: relative; z-index: 1; max-width: 620px; margin: 12px 0 24px; font-family: "Songti SC","STSong",Georgia,serif; font-size: clamp(40px,5vw,72px); line-height: 1.18; letter-spacing: .025em; }
.auth-brand > p:not(.eyebrow) { position: relative; z-index: 1; max-width: 540px; margin: 0; color: #e3d7e2; line-height: 1.9; font-size: 16px; }
.auth-pills { position: absolute; left: 8vw; bottom: 7vh; z-index: 1; display: flex; gap: 10px; }
.auth-pills span { padding: 9px 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #eaddea; background: rgba(255,255,255,.08); font-size: 12px; }
.auth-card { align-self: center; justify-self: center; width: min(430px,82%); padding: 36px; border: 1px solid rgba(91,27,88,.09); border-radius: 28px; background: rgba(255,255,255,.9); box-shadow: 0 28px 74px rgba(58,24,55,.14); backdrop-filter: blur(18px); }
.auth-tabs { display: grid; grid-template-columns: repeat(3,1fr); margin-bottom: 30px; padding: 4px; border-radius: 13px; background: #f4eeee; }
.auth-tabs.two-tabs { grid-template-columns: repeat(2,1fr); }
.auth-tab { min-height: 40px; padding: 9px 5px; border: 0; border-radius: 10px; color: var(--ink-soft); background: transparent; font-size: 13px; }
.auth-tab.active { color: var(--plum-700); background: white; box-shadow: 0 3px 12px rgba(50,20,45,.08); font-weight: 800; }
.auth-form { display: grid; gap: 17px; }
.auth-form h2 { margin: 0 0 4px; font-family: Georgia,"Songti SC",serif; font-size: 27px; }
.auth-form p { margin: 0; }
.auth-form label { display: grid; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 750; }
.auth-form input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid #e3d8e0; border-radius: 13px; color: var(--ink); background: white; outline: 0; }
.auth-form input:focus { border-color: #a66599; box-shadow: 0 0 0 4px rgba(127,41,111,.09); }
.form-error { margin: 16px 0 0; padding: 11px 13px; border-radius: 11px; color: #a8424d; background: #fff0f1; font-size: 12px; line-height: 1.55; }
.auth-foot { margin: 20px 0 0; color: #a99da7; text-align: center; font-size: 11px; }
.install-app-button { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 42px; margin-top: 12px; border: 1px solid #e1d5de; border-radius: 12px; color: var(--plum-700); background: rgba(255,255,255,.68); font-size: 12px; font-weight: 800; }
.install-app-button:hover { border-color: #c7afc1; background: white; }
.install-app-button span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 8px; color: white; background: var(--plum-600); font-size: 14px; }
.install-guide { display: grid; gap: 15px; }
.install-guide-head { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 13px; }
.install-guide-logo { width: 58px; height: 58px; overflow: hidden; border-radius: 17px; box-shadow: 0 9px 22px rgba(62,17,58,.17); }
.install-guide-logo img { display: block; width: 100%; height: 100%; }
.install-guide-head strong, .install-guide-head span { display: block; }
.install-guide-head strong { font-size: 16px; }
.install-guide-head span { margin-top: 4px; color: var(--ink-soft); font-size: 10px; }
.install-guide-steps { display: grid; gap: 9px; counter-reset: install-step; }
.install-guide-steps span { position: relative; min-height: 36px; padding: 10px 12px 10px 43px; border-radius: 11px; color: var(--ink-soft); background: #f7f2f5; font-size: 11px; line-height: 1.55; }
.install-guide-steps span::before { counter-increment: install-step; content: counter(install-step); position: absolute; left: 11px; top: 9px; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 8px; color: white; background: var(--plum-600); font-size: 10px; font-weight: 900; }
.install-guide-tip { padding: 11px 13px; border: 1px solid #e7d39e; border-radius: 11px; color: #775512; background: #fff8e8; font-size: 10px; line-height: 1.6; }

@media (display-mode: standalone) {
  .install-app-button { display: none; }
}

.toast-region { position: fixed; right: 24px; top: 24px; z-index: 120; display: grid; gap: 9px; }
.toast {
  min-width: 260px; max-width: 380px; padding: 13px 15px; border-radius: 13px; color: white; background: #352034; box-shadow: 0 15px 40px rgba(35,10,34,.25); font-size: 12px;
  animation: toastIn .34s cubic-bezier(.16,1,.3,1); transition: opacity .22s ease, transform .26s cubic-bezier(.4,0,1,1);
}
.toast.leaving { opacity: 0; transform: translate3d(0,-8px,0) scale(.98); }
.toast.success { background: #216857; }
.toast.error { background: #983f4a; }
@keyframes toastIn { from { opacity: 0; transform: translate3d(0,-10px,0) scale(.96); } }

.filter-pill, .auth-tab, .plan-choice, .member-result, .native-picker-control, .select, .field-input,
.page-search, .search-box, .mobile-quick-action {
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .22s ease, opacity .18s ease, transform .28s cubic-bezier(.2,.82,.2,1);
}
.drawer input, .drawer select, .drawer textarea, .modal input, .modal select, .modal textarea {
  transition: border-color .2s ease, box-shadow .22s ease, background-color .2s ease;
}

.skeleton { position: relative; overflow: hidden; border-radius: 12px; background: #eee7ec; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.62), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.loading-page { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.loading-page .skeleton { height: 130px; }
.loading-page .skeleton:first-child { grid-column: 1 / -1; height: 190px; }

@media (max-width: 1100px) {
  .sidebar { width: 216px; }
  .main-area { margin-left: 216px; }
  body.route-loading::after { left: 216px; }
  .search-box { width: 270px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  body.route-loading::after { left: 0; width: 48vw; }
  .loading-page { gap: 10px; }
  .loading-page .skeleton { height: 116px; }
  .loading-page .skeleton:first-child { height: 210px; }
  :root {
    --shadow: 0 10px 26px rgba(58,24,55,.075);
    --shadow-soft: 0 4px 14px rgba(58,24,55,.06);
  }
  .app-shell, body.overlay-open .app-shell { transform: none; transition: none; }
  .auth-shell { display: block; min-height: 100dvh; background: #f8f3f1; overscroll-behavior-y: none; }
  .auth-brand { min-height: 41dvh; padding: calc(26px + env(safe-area-inset-top)) 28px 102px; }
  .auth-logo { width: 60px; height: 60px; padding: 10px; border-radius: 20px; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .auth-brand .eyebrow { margin-top: 34px; }
  .auth-brand h1 { margin: 8px 0 14px; max-width: 430px; font-size: clamp(32px,8.2vw,42px); line-height: 1.16; }
  .auth-brand > p:not(.eyebrow) { font-size: 13px; line-height: 1.65; }
  .auth-pills { display: none; }
  .auth-card { position: relative; z-index: 2; width: calc(100% - 28px); margin: -50px auto max(12px,env(safe-area-inset-bottom)); padding: 19px 20px calc(18px + env(safe-area-inset-bottom)); border-radius: 26px; background: #fffdfc; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .auth-tabs { min-height: 44px; margin-bottom: 15px; }
  .auth-tab { min-height: 36px; }
  .auth-form { gap: 12px; }
  .auth-form h2 { font-size: 26px; line-height: 1.2; }
  .auth-form > div:first-child .muted { margin-top: 4px; line-height: 1.45; }
  .auth-form label { gap: 6px; font-size: 12px; }
  .auth-form input { min-height: 48px; padding: 10px 13px; font-size: 16px; }
  .auth-form .button { min-height: 48px; }
  .auth-foot { margin-top: 13px; font-size: 10px; }
  .auth-tab { font-size: 12px; }
  .install-app-button { min-height: 41px; margin-top: 8px; font-size: 12px; }
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: 68px; padding: 7px 10px; flex-direction: row; background: var(--plum-950); }
  .brand-lockup, .sidebar-bottom, .nav-divider, .nav-item:nth-last-child(-n+2), .nav-item i { display: none; }
  .nav-list { width: 100%; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
  body.staff-mode .nav-list { grid-template-columns: repeat(3, 1fr); }
  .nav-item { height: 54px; padding: 5px 2px; flex-direction: column; justify-content: center; gap: 3px; text-align: center; }
  .nav-item svg { width: 17px; height: 17px; }
  .nav-item span { font-size: 9px; }
  .nav-item.active { box-shadow: inset 0 -2px var(--gold); }
  .main-area { width: 100%; margin: 0 0 68px; }
  .topbar { min-height: 82px; padding: 15px 18px; background: #f8f5f2; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .page-heading h1 { font-size: 22px; }
  .search-box { display: none; }
  .page-content { width: 100%; max-width: 100%; padding: 17px 14px 45px; overflow-x: clip; }
  .demo-banner { margin: 14px 14px 0; }
  .hero-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .metric-grid { gap: 10px; }
  .metric-card { min-height: 116px; padding: 17px; }
  .metric-card strong { font-size: 24px; }
  .hero-card .hero-actions { position: static; margin-top: 18px; }
  .table-panel { max-width: 100%; overflow-x: auto; overscroll-behavior-x: none; }
  .data-table { min-width: 740px; }
  .backdrop { background: rgba(24,9,24,.34); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .drawer {
    left: 50%; right: auto; top: 50%; bottom: auto; width: calc(100% - 24px); max-width: 720px; max-height: calc(100dvh - 24px);
    padding: 18px; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    border-radius: 26px; box-shadow: 0 24px 62px rgba(44,12,42,.22);
    transform: translate3d(-50%, calc(-50% + 14px), 0) scale(.965); will-change: transform, opacity;
  }
  .drawer.open { transform: translate3d(-50%,-50%,0) scale(1); }
  .drawer-body { contain: inline-size; }
  .drawer label input, .drawer label select, .drawer label textarea, .stack-form input, .stack-form select,
  .stack-form textarea, .modal-body input, .modal-body select, .modal-body textarea, .field-input, .select,
  .page-search input, .search-box input { font-size: 16px; }
  .choice-grid { grid-template-columns: repeat(2,1fr); }
  .form-grid.two { grid-template-columns: 1fr; }
  .donut-layout { grid-template-columns: 120px 1fr; }
  .modal {
    left: 50%; right: auto; top: 50%; bottom: auto; width: calc(100% - 24px); max-width: 720px; max-height: calc(100dvh - 24px);
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); border-radius: 26px;
    transform: translate3d(-50%, calc(-50% + 12px), 0) scale(.965); overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    box-shadow: 0 24px 62px rgba(44,12,42,.22); will-change: transform, opacity;
  }
  .modal.open { transform: translate3d(-50%,-50%,0) scale(1); }
  .modal.modal-wide { width: calc(100% - 24px); max-width: 720px; }
  .mobile-fab-stack {
    position: fixed; right: 15px; bottom: 81px; z-index: 40; display: grid; gap: 9px;
    opacity: 1; transform: translate3d(0,0,0) scale(1); transform-origin: 50% 100%;
    transition: opacity .16s ease, transform .28s cubic-bezier(.16,1,.3,1);
  }
  body[data-route="ledger"] .mobile-fab-stack, body[data-route="visits"] .mobile-fab-stack { display: none; }
  .mobile-quick-action {
    display: grid; place-items: center; width: 60px; height: 60px; padding: 7px 0 6px; border: 0; border-radius: 19px;
    box-shadow: 0 8px 20px rgba(52,15,49,.2), inset 0 1px rgba(255,255,255,.55);
  }
  .mobile-quick-ledger { color: #351334; background: linear-gradient(145deg, #f8da70, #eebe3d); }
  .mobile-quick-visit { color: white; background: linear-gradient(145deg, #7f2773, #5e1458); }
  .mobile-quick-action b { font-size: 22px; line-height: 19px; }
  .mobile-quick-action span { font-size: 10px; font-weight: 800; }
  body.overlay-open:not(.overlay-releasing) .mobile-fab-stack {
    opacity: 0; pointer-events: none; transform: translate3d(0,8px,0) scale(.96);
  }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .period-control-panel { align-items: stretch; flex-direction: column; gap: 11px; }
  .period-control-actions { align-items: stretch; justify-content: space-between; flex-wrap: wrap; }
  .period-control-actions .filter-pills { flex: 1 1 auto; }
  .period-mode-pills { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); width: 100%; }
  .period-mode-pills .filter-pill { min-width: 0; padding: 0 6px; }
  .period-picker { flex: 1 1 170px; justify-content: flex-end; }
  .period-picker > .select, .period-picker > .native-picker-control { width: auto; min-width: 0; flex: 1; }
  .period-range-picker, .ledger-range-picker { width: 100%; min-width: 0; margin-left: 0; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 6px; }
  .period-range-picker .native-picker-control.compact, .ledger-range-picker .native-picker-control.compact { width: 100%; padding: 0 30px 0 8px; font-size: 12px; }
  .period-range-picker .native-picker-control svg, .ledger-range-picker .native-picker-control svg { right: 9px; width: 15px; height: 15px; }
  .filter-bar > label { width: 100%; justify-content: space-between; }
  .filter-bar > label .native-picker-control { width: auto; }
  .ledger-control-panel { padding: 6px 14px; }
  .ledger-control-row { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .ledger-control-label { width: 100%; }
  .ledger-range-pills { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); width: 100%; }
  .ledger-range-pills .filter-pill { min-width: 0; padding: 0 5px; }
  .ledger-picker { width: 100%; margin-left: 0; justify-content: space-between; }
  .ledger-picker .native-picker-control { width: auto; flex: 1; }
  .ledger-action-row { align-items: flex-start; flex-direction: column; }
  .ledger-action-row .toolbar-group { width: 100%; }
  .ledger-action-row .button { flex: 1; }
  .ledger-summary-grid { grid-template-columns: 1fr; }
  .ledger-summary-card { min-height: 198px; padding: 22px; }
  .ledger-summary-card > strong { font-size: 35px; }
  .summary-breakdown { padding-right: 0; padding-bottom: 45px; }
  .summary-breakdown span { min-width: 0; flex: 1; }
  .page-search { width: 100%; }
  .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .plan-settings-grid { grid-template-columns: 1fr; }
  .permission-cards { grid-template-columns: 1fr; }
}

@media (max-width: 820px) and (max-height: 720px) {
  .auth-brand { min-height: 39dvh; padding-top: calc(18px + env(safe-area-inset-top)); padding-bottom: 82px; }
  .auth-logo { width: 52px; height: 52px; border-radius: 17px; }
  .auth-brand .eyebrow { margin-top: 22px; }
  .auth-brand h1 { margin: 6px 0 10px; font-size: clamp(28px,7.7vw,34px); }
  .auth-brand > p:not(.eyebrow) { display: none; }
  .auth-card { margin-top: -42px; padding-top: 15px; }
  .auth-tabs { margin-bottom: 11px; }
  .auth-form { gap: 9px; }
  .auth-form h2 { font-size: 23px; }
  .auth-form > div:first-child .muted { display: none; }
  .auth-form input { min-height: 44px; }
  .auth-form .button { min-height: 44px; }
  .install-app-button { display: none; }
}

@media (max-width: 520px) {
  .topbar { align-items: flex-end; }
  .top-actions .button { min-width: 42px; width: 42px; padding: 0; font-size: 0; }
  .top-actions .button span { font-size: 22px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card small { line-height: 1.4; }
  .page-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-group { width: 100%; flex-wrap: wrap; }
  .report-banner { align-items: flex-start; flex-direction: column; }
  .login-card { padding: 25px; }
  .table-panel { overflow: visible; }
  .ledger-desktop-table { display: none; }
  .ledger-mobile-list { display: grid; gap: 10px; padding: 0 12px 13px; }
  .ledger-summary-card { min-height: 190px; }
  .expense-summary { min-height: 165px; }
  .ledger-summary-card > .button { right: 18px; bottom: 18px; }
  .ledger-control-row .tabs { width: 100%; }
  .ledger-control-row .tabs button { flex: 1; }
  .ledger-action-row .toolbar-group { display: grid; grid-template-columns: 1fr 1fr; }
  .ledger-action-row .toolbar-group .button:last-child { grid-column: 1 / -1; }
  .data-table { min-width: 0; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { padding: 13px 14px; border-top: 1px solid #eee7ed; }
  .data-table tbody tr:first-child { border-top: 0; }
  .data-table td {
    display: grid; grid-template-columns: 92px minmax(0,1fr); align-items: center; min-height: 30px;
    padding: 4px 0; border: 0; text-align: right;
  }
  .data-table td::before { content: attr(data-label); color: #958a94; font-size: 9px; text-align: left; }
  .data-table td:empty { display: none; }
  .data-table td .member-cell, .data-table td .source-cell { justify-content: flex-end; }
  .data-table td .table-actions { justify-content: flex-end; }
  .data-table td[colspan] { display: block; text-align: center; }
  .data-table td[colspan]::before { display: none; }
  .plan-choice-grid { grid-template-columns: 1fr; }
  .owned-card-head { grid-template-columns: 1fr; }
  .owned-card-balance { white-space: normal; }
  .owned-card-status, .toolbar-group { flex-wrap: wrap; }
  .refund-summary { grid-template-columns: 1fr; }
  .refund-record > div { align-items: flex-start; flex-direction: column; gap: 4px; }
  .plan-gift-summary { grid-template-columns: 1fr; }
  .plan-gift-summary small { grid-column: 1; }
  .modal-actions { position: sticky; bottom: -20px; margin-left: -18px; margin-right: -18px; padding: 13px 18px calc(10px + env(safe-area-inset-bottom)); background: #fffcfb; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .modal-actions .button { min-height: 46px; }
  .toast-region { left: 12px; right: 12px; top: 12px; }
  .toast { min-width: 0; width: 100%; max-width: none; }
}

@media (hover: none) and (pointer: coarse) {
  .button:hover, .nav-item:hover { transform: none; }
  .button:active, .icon-button:active, .filter-pill:active, .tabs button:active, .segmented button:active,
  .choice-chip:active, .nav-item:active, .auth-tab:active, .plan-choice:active, .member-result:active, .native-picker-control:active {
    transform: scale(.968);
    opacity: .96;
    transition-duration: .08s;
  }
  .mobile-quick-action:active { transform: scale(.925); opacity: .94; transition-duration: .08s; }
}

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