@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
  --ink: #1d2925;
  --muted: #78827d;
  --line: #e6e8e1;
  --paper: #ffffff;
  --canvas: #f5f6f1;
  --green: #164f3b;
  --green-2: #2e765d;
  --mint: #dcebe1;
  --lime: #dbe8a4;
  --amber: #dca442;
  --danger: #b9504b;
  --shadow: 0 12px 40px rgba(25, 42, 34, 0.06);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "DM Sans", "Noto Sans SC", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 254px; display: flex; flex-direction: column; padding: 32px 22px 24px; background: #fdfdf9; border-right: 1px solid var(--line); }
.brand-block { display: flex; align-items: center; gap: 13px; padding: 0 8px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--green); border-radius: 13px 13px 13px 4px; font-size: 19px; font-weight: 700; box-shadow: 0 8px 18px rgba(22,79,59,.18); }
.eyebrow { margin: 0 0 4px; color: #9aa39e; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.studio-name { display: flex; align-items: center; gap: 7px; padding: 0; border: 0; background: none; font-size: 16px; font-weight: 700; }
.studio-name svg { width: 13px; opacity: 0; transition: opacity .2s; }
.studio-name:hover svg { opacity: .55; }
.main-nav { display: grid; gap: 7px; margin-top: 55px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 0; border-radius: 11px; background: none; color: #747f79; font-size: 14px; font-weight: 500; text-align: left; transition: .2s ease; }
.nav-item:hover { color: var(--green); background: #f1f5ef; }
.nav-item.active { color: var(--green); background: var(--mint); font-weight: 700; }
.nav-item svg { width: 18px; }
.sidebar-bottom { margin-top: auto; }
.side-label { margin: 0 0 8px 5px; color: #9aa39e; font-size: 11px; }
.current-person { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); text-align: left; transition: .2s; }
.current-person:hover { border-color: #c9d5cd; transform: translateY(-1px); box-shadow: var(--shadow); }
.current-person > svg { width: 15px; color: #a2aaa6; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #234337; background: #dbe8a4; font-size: 13px; font-weight: 700; }
.person-meta { min-width: 0; flex: 1; display: grid; gap: 2px; }
.person-meta strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.person-meta small { color: #a1aaa5; font-size: 10px; }
.storage-note { display: flex; align-items: center; gap: 7px; margin: 13px 7px 0; color: #adb4b0; font-size: 9px; }
.storage-note span { width: 6px; height: 6px; background: #7dac92; border-radius: 50%; box-shadow: 0 0 0 3px #e8f1eb; }

.main-content { min-height: 100vh; margin-left: 254px; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: center; padding: 0 4vw; border-bottom: 1px solid var(--line); background: rgba(245,246,241,.9); backdrop-filter: blur(12px); }
.month-control { display: flex; align-items: center; gap: 4px; }
.month-control button { width: 33px; height: 33px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #89938e; background: transparent; }
.month-control button:hover { background: #e9ece5; color: var(--ink); }
.month-control button svg { width: 16px; }
.month-control label { position: relative; min-width: 124px; padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 700; text-align: center; }
.month-control input { position: absolute; inset: 0; width: 100%; opacity: 0; }
.top-add { position: absolute; right: 4vw; }
.mobile-brand { display: none; }
.page { display: none; max-width: 1440px; margin: 0 auto; padding: 43px 4vw 70px; animation: fadeIn .25s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.page-heading.compact { align-items: center; }
.page-heading h1 { margin: 0; font-family: "Noto Sans SC", sans-serif; font-size: clamp(25px, 2.3vw, 34px); letter-spacing: -.04em; }
.heading-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.primary-button, .secondary-button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 10px; font-size: 13px; font-weight: 700; transition: .2s; }
.primary-button { color: white; background: var(--green); border: 1px solid var(--green); box-shadow: 0 7px 15px rgba(22,79,59,.12); }
.primary-button:hover { background: #0e3f2f; transform: translateY(-1px); }
.secondary-button { color: #55615b; background: var(--paper); border: 1px solid var(--line); }
.secondary-button:hover { color: var(--green); border-color: #c9d4cc; }
.primary-button svg, .secondary-button svg { width: 16px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { min-height: 145px; display: flex; flex-direction: column; justify-content: space-between; padding: 21px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 5px 25px rgba(37,52,45,.025); }
.stat-featured { color: white; border-color: var(--green); background: var(--green); background-image: radial-gradient(circle at 90% 0, rgba(219,232,164,.16), transparent 48%); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: #87918c; font-size: 12px; }
.stat-featured .stat-top { color: #b9cfc6; }
.stat-icon { width: 25px; height: 25px; display: grid; place-items: center; color: var(--green); background: var(--lime); border-radius: 50%; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.amber { background: var(--amber); box-shadow: 0 0 0 4px #fbf2df; }
.dot.green { background: #55a47c; box-shadow: 0 0 0 4px #e7f3ec; }
.stat-card strong { font-size: clamp(23px, 2vw, 29px); letter-spacing: -.04em; }
.stat-card strong em { font-size: 13px; font-style: normal; font-weight: 500; }
.stat-card small { color: #9ca49f; font-size: 10px; }
.stat-featured small { color: #a9c2b8; }
.people-mini { display: flex; flex-direction: row-reverse; justify-content: flex-start; }
.people-mini .avatar { width: 24px; height: 24px; margin-left: -6px; border: 2px solid white; font-size: 8px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, .85fr); gap: 14px; margin-top: 14px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 5px 25px rgba(37,52,45,.025); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 23px 16px; }
.panel-header h2 { margin: 0 0 4px; font-size: 15px; }
.panel-header p { margin: 0; color: #9aa39e; font-size: 10px; }
.legend { display: flex; align-items: center; gap: 7px; color: #98a19d; font-size: 10px; }
.legend i { width: 18px; height: 3px; background: var(--green-2); border-radius: 2px; }
.chart-wrap { position: relative; height: 254px; padding: 8px 22px 28px 53px; }
.line-chart { width: 100%; height: 100%; overflow: visible; }
.chart-y-labels { position: absolute; inset: 8px auto 28px 20px; display: flex; flex-direction: column; justify-content: space-between; color: #aab1ad; font-size: 9px; text-align: right; }
.chart-grid { stroke: #edf0ea; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-area { fill: url(#areaGradient); stroke: none; }
.chart-line { fill: none; stroke: var(--green-2); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-point { fill: white; stroke: var(--green-2); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-label { fill: #aab1ad; font-size: 10px; }
.rank-panel { min-width: 0; }
.text-button { padding: 0; border: 0; color: var(--green-2); background: none; font-size: 11px; font-weight: 700; }
.person-rank-list { display: grid; gap: 18px; padding: 6px 23px 23px; }
.rank-item { display: grid; grid-template-columns: 35px 1fr auto; align-items: center; gap: 10px; }
.rank-item .avatar { width: 34px; height: 34px; font-size: 11px; }
.rank-content { min-width: 0; }
.rank-name { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 11px; font-weight: 700; }
.rank-name span:last-child { margin-left: 8px; }
.rank-bar { height: 5px; overflow: hidden; border-radius: 5px; background: #eef0eb; }
.rank-bar i { display: block; height: 100%; border-radius: inherit; background: var(--green-2); }
.rank-count { color: #a3aba7; font-size: 9px; }
.empty-mini { padding: 28px 10px; color: #9ca5a0; font-size: 12px; text-align: center; }
.recent-panel { margin-top: 14px; }
.expense-list { padding: 0 10px 10px; }
.expense-row { display: grid; grid-template-columns: minmax(230px, 1.5fr) 130px 110px 105px 38px; align-items: center; gap: 15px; padding: 13px; border-top: 1px solid #eef0eb; }
.expense-main { min-width: 0; display: flex; align-items: center; gap: 12px; }
.category-icon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: #eef3ed; font-size: 16px; }
.expense-main strong { display: block; overflow: hidden; margin-bottom: 3px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.expense-main small, .expense-date { color: #9da5a1; font-size: 10px; }
.expense-person { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.expense-person .avatar { width: 25px; height: 25px; font-size: 9px; }
.expense-amount { font-size: 12px; text-align: right; }
.status-badge { justify-self: end; padding: 4px 8px; border-radius: 12px; font-size: 9px; font-weight: 600; white-space: nowrap; }
.status-badge.pending { color: #99702e; background: #fbf1dd; }
.status-badge.paid { color: #38725a; background: #e6f2eb; }
.row-menu { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #a1a9a5; }
.row-menu:hover { background: #f0f2ed; color: var(--ink); }
.row-menu svg { width: 15px; }

.filters { display: grid; grid-template-columns: 1fr 160px 150px; gap: 10px; padding: 18px; border-bottom: 1px solid var(--line); }
.filters select, .search-box { height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fafbf8; }
.filters select { padding: 0 12px; color: #59645e; font-size: 12px; outline: none; }
.search-box { display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.search-box svg { width: 16px; color: #9ea6a2; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 12px; }
.expense-table-panel .expense-row { grid-template-columns: minmax(250px, 1.5fr) 150px 120px 110px 100px 80px; padding: 14px 20px; }
.expense-table-head { display: grid; grid-template-columns: minmax(250px, 1.5fr) 150px 120px 110px 100px 80px; gap: 15px; padding: 11px 20px; color: #9da5a1; background: #fafbf8; font-size: 9px; font-weight: 700; letter-spacing: .06em; }
.table-actions { display: flex; justify-content: flex-end; gap: 4px; }
.table-action { padding: 4px 6px; border: 0; border-radius: 6px; color: #8f9893; background: none; font-size: 10px; }
.table-action:hover { color: var(--green); background: #edf2ee; }
.table-action.delete:hover { color: var(--danger); background: #faeceb; }
.empty-state { display: grid; place-items: center; padding: 58px 20px; color: #9aa39e; text-align: center; }
.empty-state .empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 15px; background: #edf1eb; font-size: 22px; }
.empty-state strong { color: #59645e; font-size: 13px; }
.empty-state p { margin: 5px 0 0; font-size: 11px; }

.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.person-card { position: relative; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.person-card::after { content: ""; position: absolute; right: -30px; top: -35px; width: 100px; height: 100px; border-radius: 50%; background: var(--person-color); opacity: .12; }
.person-card-top { display: flex; align-items: center; gap: 12px; }
.person-card .avatar { width: 45px; height: 45px; font-size: 15px; }
.person-card h3 { margin: 0 0 3px; font-size: 15px; }
.person-card small { color: #9da5a1; font-size: 10px; }
.current-tag { margin-left: auto; padding: 4px 7px; border-radius: 10px; color: var(--green); background: var(--mint); font-size: 8px; font-weight: 700; }
.person-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.person-totals div { padding: 11px; border-radius: 10px; background: #f6f7f3; }
.person-totals span { display: block; margin-bottom: 4px; color: #9ba39f; font-size: 9px; }
.person-totals strong { font-size: 13px; }
.person-card-actions { display: flex; gap: 8px; margin-top: 14px; }
.person-card-actions button { flex: 1; padding: 8px; border: 1px solid var(--line); border-radius: 8px; color: #69736e; background: white; font-size: 10px; }
.person-card-actions button:hover { border-color: #c9d4cc; color: var(--green); }
.person-card-actions .danger:hover { color: var(--danger); border-color: #e9c6c3; background: #fff8f7; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(19,34,28,.38); backdrop-filter: blur(5px); opacity: 0; visibility: hidden; transition: .2s; }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 27px; border-radius: 20px; background: #fff; box-shadow: 0 24px 70px rgba(13,29,22,.2); transform: translateY(10px) scale(.98); transition: .22s; }
.modal-backdrop.open .modal { transform: none; }
.small-modal { width: min(430px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 23px; }
.modal-header h2 { margin: 0; font-size: 21px; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #7c8681; background: #f2f3ef; font-size: 22px; line-height: 1; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span { color: #65706a; font-size: 11px; font-weight: 700; }
.field input, .field select { width: 100%; height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--ink); background: #fafbf8; font-size: 13px; }
.field input:focus, .field select:focus { border-color: #7ca08e; box-shadow: 0 0 0 3px rgba(73,123,98,.1); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.amount-field > div { position: relative; }
.amount-field b { position: absolute; left: 14px; top: 10px; font-size: 19px; }
.amount-field input { height: 50px; padding-left: 37px; font-size: 20px; font-weight: 700; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 10px; background: #eff1ec; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 8px; border-radius: 8px; color: #89918d; font-size: 11px; font-weight: 600; text-align: center; cursor: pointer; }
.segmented input:checked + label { color: var(--green); background: white; box-shadow: 0 2px 8px rgba(34,52,43,.08); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-actions button { min-width: 92px; }
.color-options { display: flex; flex-wrap: wrap; gap: 10px; }
.color-option { width: 31px; height: 31px; padding: 0; border: 3px solid white; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px #dfe3dc; }
.color-option.selected { box-shadow: 0 0 0 2px var(--green); }
.switcher-list { display: grid; gap: 8px; }
.switch-person { display: flex; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: white; text-align: left; }
.switch-person:hover, .switch-person.active { border-color: #9cb3a7; background: #f2f7f3; }
.switch-person strong { flex: 1; font-size: 13px; }
.switch-person span:last-child { color: var(--green); font-size: 10px; }
.data-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.file-button input { display: none; }
.form-hint { margin: 12px 0 0; color: #9ba39f; font-size: 10px; line-height: 1.6; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 28px; padding: 10px 16px; border-radius: 9px; color: white; background: #24352e; box-shadow: 0 8px 25px rgba(19,34,28,.2); font-size: 12px; opacity: 0; transform: translate(-50%, 15px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-nav { display: none; }

/* 云端登录与初始化 */
.cloud-gate { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; overflow-y: auto; padding: 28px 18px; background: #f4f6f0; background-image: radial-gradient(circle at 15% 15%, rgba(216,232,164,.45), transparent 25%), radial-gradient(circle at 85% 80%, rgba(191,217,207,.4), transparent 28%); }
.cloud-gate.ready { display: none; }
.gate-card { width: min(430px, 100%); padding: 34px; border: 1px solid rgba(220,225,216,.9); border-radius: 24px; background: rgba(255,255,252,.94); box-shadow: 0 24px 80px rgba(22,58,43,.12); }
.gate-card[hidden] { display: none; }
.gate-card [hidden] { display: none !important; }
.gate-loading { display: grid; place-items: center; width: 240px; text-align: center; }
.gate-loading p { margin: 16px 0 0; color: #7f8984; font-size: 12px; }
.gate-logo { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 0 18px; color: white; background: var(--green); border-radius: 15px 15px 15px 5px; box-shadow: 0 10px 25px rgba(22,79,59,.2); font-size: 21px; font-weight: 700; }
.gate-loading .gate-logo { margin: 0; }
.loading-ring { width: 25px; height: 25px; margin-top: 22px; border: 2px solid #dce5df; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gate-card h1 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.gate-note { margin: 9px 0 24px; color: #7f8984; font-size: 12px; line-height: 1.7; }
.gate-note code { padding: 2px 5px; color: var(--green); background: #e8f0ea; border-radius: 5px; font-size: 10px; }
.gate-submit { width: 100%; min-height: 46px; margin-top: 5px; }
.security-note { margin: -4px 0 14px; color: #9a7950; font-size: 10px; line-height: 1.5; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 20px; padding: 4px; border-radius: 11px; background: #ecefe9; }
.auth-tabs button { padding: 9px; border: 0; border-radius: 8px; color: #8b948f; background: transparent; font-size: 11px; font-weight: 700; }
.auth-tabs button.active { color: var(--green); background: white; box-shadow: 0 3px 10px rgba(33,53,44,.07); }
.auth-message { min-height: 16px; margin: 13px 0 0; color: var(--danger); font-size: 10px; line-height: 1.5; text-align: center; }
.auth-message.success { color: var(--green-2); }
.gate-link { width: 100%; margin-top: 17px; border: 0; color: #88928d; background: none; font-size: 10px; text-decoration: underline; }
.invite-box { display: grid; place-items: center; padding: 23px; border: 1px dashed #b8c8bf; border-radius: 15px; background: #f5f8f4; }
.invite-box > span { color: #8d9792; font-size: 10px; }
.invite-box strong { margin: 8px 0 15px; color: var(--green); font-size: 28px; letter-spacing: .18em; }
.account-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 15px; border-radius: 13px; background: #f5f7f3; }
.account-summary > div { min-width: 0; flex: 1; display: grid; gap: 3px; }
.account-summary strong, .account-summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-summary strong { font-size: 13px; }
.account-summary small { color: #929b96; font-size: 10px; }
.role-tag { padding: 4px 8px; border-radius: 10px; color: var(--green); background: var(--mint); font-size: 9px; font-weight: 700; }
.full-button { width: 100%; }
.cloud-error { padding: 10px 12px; border-radius: 9px; color: #9c4743; background: #fbeceb; font-size: 10px; line-height: 1.5; }
.syncing .storage-note span { background: var(--amber); box-shadow: 0 0 0 3px #fbf2df; }
.syncing .storage-note { color: #a6854f; }
.field input:disabled, .field select:disabled { color: #8b948f; background: #f1f2ee; cursor: not-allowed; }

@media (max-width: 1080px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: 1fr 1fr; }
  .expense-table-panel .expense-row, .expense-table-head { grid-template-columns: minmax(220px, 1.4fr) 120px 110px 100px 80px; }
  .expense-table-panel .expense-date { display: none; }
  .expense-table-head span:nth-child(3) { display: none; }
}

@media (max-width: 760px) {
  body { padding-bottom: 76px; }
  .sidebar { display: none; }
  .main-content { margin: 0; }
  .topbar { position: sticky; top: 0; z-index: 30; height: 65px; justify-content: space-between; padding: 0 17px; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; }
  .mobile-brand .brand-mark { width: 33px; height: 33px; border-radius: 10px 10px 10px 3px; font-size: 15px; }
  .mobile-brand strong { max-width: 105px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .top-add { display: none; }
  .month-control label { min-width: 105px; padding-inline: 5px; font-size: 12px; }
  .month-control button { width: 26px; }
  .page { padding: 26px 15px 25px; }
  .page-heading { align-items: flex-start; margin-bottom: 20px; }
  .page-heading h1 { font-size: 24px; }
  .page-heading .secondary-button { display: none; }
  .page-heading.compact .primary-button { display: none; }
  .stats-grid { gap: 10px; }
  .stat-card { min-height: 125px; padding: 16px; border-radius: 15px; }
  .stat-card strong { font-size: 21px; }
  .dashboard-grid { gap: 10px; margin-top: 10px; }
  .panel { border-radius: 15px; }
  .chart-wrap { height: 220px; padding-left: 45px; }
  .recent-panel { margin-top: 10px; }
  .recent-panel .expense-row { grid-template-columns: 1fr auto; gap: 8px; }
  .recent-panel .expense-person, .recent-panel .expense-date, .recent-panel .status-badge { display: none; }
  .recent-panel .expense-amount { grid-column: 2; grid-row: 1; }
  .recent-panel .row-menu { grid-column: 2; grid-row: 1; opacity: 0; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .expense-table-head { display: none; }
  .expense-table-panel .expense-row { grid-template-columns: 1fr auto; position: relative; padding: 14px; }
  .expense-table-panel .expense-person, .expense-table-panel .expense-date { display: none; }
  .expense-table-panel .expense-amount { grid-column: 2; grid-row: 1; align-self: start; margin-top: 4px; }
  .expense-table-panel .status-badge { grid-column: 2; grid-row: 1; align-self: end; margin-bottom: 3px; }
  .expense-table-panel .table-actions { grid-column: 1 / -1; justify-content: flex-start; padding-left: 47px; }
  .people-grid { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; z-index: 50; inset: auto 0 0; height: 71px; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); background: rgba(255,255,252,.96); backdrop-filter: blur(12px); }
  .mobile-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0; border: 0; color: #9ba39f; background: none; font-size: 9px; }
  .mobile-nav button.active { color: var(--green); }
  .mobile-nav svg { width: 19px; height: 19px; }
  .mobile-nav .mobile-add { color: var(--green); }
  .mobile-add > span { position: absolute; top: -18px; width: 47px; height: 47px; display: grid; place-items: center; color: white; background: var(--green); border: 5px solid var(--canvas); border-radius: 50%; }
  .mobile-add em { position: absolute; bottom: 8px; font-style: normal; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; padding: 23px 19px 26px; border-radius: 22px 22px 0 0; }
  .gate-card { padding: 27px 22px; border-radius: 20px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 390px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 118px; }
  .filters { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
