:root {
  --bg-page: #F6F8FC;
  --bg-subtle: #f1f5fa;
  --bg-elevated: #ffffff;
  --bg-sidebar: #081426;
  --bg-sidebar-soft: #10263f;
  --bg-accent-soft: #eaf2ff;
  --bg-accent-muted: #f4f8ff;
  --bg-danger-soft: #fff1f3;
  --bg-success-soft: #edf8f2;
  --border: #dfe7f1;
  --border-strong: #cbd7e7;
  --text-main: #162033;
  --text-secondary: #475569;
  --text-muted: #76859c;
  --text-inverse: #f8fafc;
  --primary: #2563EB;
  --primary-strong: #1d4ed8;
  --success: #16a34a;
  --warning: #f97316;
  --danger: #dc2626;
  --glass: rgba(255, 255, 255, 0.78);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --line-soft: rgba(255, 255, 255, 0.72);
  --shadow-sm: 0 10px 28px rgba(18, 35, 61, 0.06);
  --shadow-md: 0 22px 56px rgba(18, 35, 61, 0.13);
  --shadow-blue: 0 16px 34px rgba(47, 111, 237, 0.18);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-ui: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text-main);
  background: var(--bg-page);
}

body {
  line-height: 1.5;
  background: linear-gradient(180deg, #fbfdff 0%, var(--bg-page) 100%);
  overflow-x: hidden;
}

button,
input,
select,
table {
  font: inherit;
  outline: none;
}

button {
  cursor: pointer;
  border: none;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-main);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder {
  color: #90a0b6;
}

input:focus,
select:focus {
  border-color: rgba(47, 111, 237, 0.48);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}

main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.page-bg {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f8fc 55%, #f7f9fd 100%);
  pointer-events: none;
}

.page-bg::before {
  content: none;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.auth-card {
  width: min(1360px, calc(100vw - 28px));
  min-height: min(960px, calc(100vh - 32px));
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 560px);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: 0 22px 58px rgba(19, 38, 71, 0.1);
  overflow: hidden;
}

.auth-side {
  position: relative;
  min-height: 100%;
  padding: 68px 60px 56px;
  background: linear-gradient(135deg, #f4f8ff 0%, #edf4ff 48%, #eaf2ff 100%);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 34px;
  overflow: hidden;
}

.auth-side::before {
  content: "";
  position: absolute;
  width: 540px;
  height: 540px;
  right: -150px;
  top: -145px;
  border: 46px solid rgba(255, 255, 255, 0.44);
  border-radius: 50%;
}

.auth-side::after {
  content: "";
  position: absolute;
  left: -90px;
  bottom: -80px;
  width: 420px;
  height: 190px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 22px;
  color: #111b31;
}

.auth-brand-mark {
  width: 48px;
  min-height: 48px;
  border-radius: 9px;
  background: linear-gradient(145deg, #0d7dff 0%, #1259df 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(28, 105, 233, 0.24);
}

.brand-badge,
.auth-status,
.auth-side-note,
.topbar-kicker,
.group-context-kicker,
.sidebar-section-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.brand-badge {
  color: var(--primary-strong);
  background: rgba(47, 111, 237, 0.1);
}

.auth-status,
.topbar-kicker,
.group-context-kicker {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(197, 210, 227, 0.9);
}

.auth-copy,
.auth-feature,
.auth-panel-header {
  display: grid;
  gap: 10px;
}

.auth-copy {
  position: relative;
  z-index: 1;
  margin-top: 34px;
}

.auth-side h1,
.auth-panel-header h2,
.topbar h2,
.card-header h3,
.dialog-header h3 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
}

.auth-side h1 {
  max-width: 570px;
  font-size: 40px;
  letter-spacing: 0;
}

.auth-side p {
  font-size: 20px;
  font-weight: 700;
}

.auth-side p,
.auth-panel-header p,
.topbar p,
.card-header p,
.dialog-header p,
.section-header p {
  margin: 0;
  color: var(--text-secondary);
}

.auth-highlights,
.auth-features {
  display: grid;
  gap: 12px;
}

.auth-features {
  position: relative;
  z-index: 1;
  align-content: start;
  gap: 26px;
  max-width: 430px;
  margin-top: 8px;
}

.auth-feature {
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

.auth-feature-icon {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.people-icon {
  background: linear-gradient(135deg, #eef4ff, #dae8ff);
}

.people-icon::before {
  content: "";
  width: 34px;
  height: 28px;
  background:
    radial-gradient(circle at 34% 28%, #2b7cff 0 7px, transparent 8px),
    radial-gradient(circle at 68% 30%, #2b7cff 0 6px, transparent 7px),
    radial-gradient(ellipse at 34% 100%, #2b7cff 0 12px, transparent 13px),
    radial-gradient(ellipse at 72% 100%, #2b7cff 0 10px, transparent 11px);
}

.shield-icon {
  background: linear-gradient(135deg, #e4f8ed, #cbf0dc);
}

.shield-icon::before {
  content: "";
  width: 34px;
  height: 38px;
  background: #39bf75;
  clip-path: polygon(50% 0, 90% 14%, 88% 58%, 50% 100%, 12% 58%, 10% 14%);
}

.shield-icon::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 8px;
  border-left: 4px solid #fff;
  border-bottom: 4px solid #fff;
  transform: rotate(-45deg);
}

.chart-icon {
  background: linear-gradient(135deg, #eef0ff, #dfe4ff);
}

.chart-icon::before {
  content: "";
  width: 36px;
  height: 32px;
  background:
    linear-gradient(#675ef4, #675ef4) 2px 22px / 6px 10px no-repeat,
    linear-gradient(#675ef4, #675ef4) 13px 15px / 6px 17px no-repeat,
    linear-gradient(#675ef4, #675ef4) 24px 8px / 6px 24px no-repeat;
  border-bottom: 3px solid #675ef4;
}

.auth-feature strong,
.sidebar-current-group strong {
  font-size: 15px;
}

.auth-feature strong {
  font-size: 18px;
}

.auth-feature small {
  display: block;
  color: #53627a;
  font-size: 16px;
  font-weight: 600;
}

.auth-highlight span,
.sidebar-current-group span,
.sidebar-footnote,
.sidebar-brand span,
.user-chip small,
.group-context-header small,
.table-muted {
  color: var(--text-muted);
}

.auth-side-note {
  gap: 8px;
  padding: 12px 14px;
  width: auto;
  display: grid;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
}

.auth-illustration {
  position: relative;
  z-index: 1;
  width: min(510px, 82%);
  height: 310px;
  justify-self: end;
  align-self: end;
  margin: -18px 0 12px;
}

.auth-illustration::before {
  content: "";
  position: absolute;
  inset: 160px 20px 8px 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(233, 241, 255, 0.78));
  box-shadow: 0 22px 44px rgba(72, 123, 219, 0.15);
}

.illustration-panel {
  position: absolute;
  right: 78px;
  bottom: 70px;
  width: 310px;
  height: 178px;
  display: grid;
  grid-template-columns: 1fr 0.78fr;
  gap: 16px;
  padding: 28px 22px;
  border: 1px solid rgba(167, 196, 244, 0.56);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(228, 238, 255, 0.82));
  box-shadow: 0 18px 36px rgba(75, 126, 220, 0.18);
}

.panel-list,
.panel-chart {
  display: grid;
  align-content: center;
  gap: 14px;
}

.panel-list span {
  height: 15px;
  border-radius: 999px;
  background: linear-gradient(90deg, #9bbdff, #d5e3ff);
}

.panel-list span::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  margin-top: -4px;
  margin-left: -2px;
  border-radius: 50%;
  background: #8fb4ff;
}

.panel-chart {
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  height: 82px;
}

.panel-chart span {
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #89b1ff, #2f6fed);
}

.panel-chart span:nth-child(1) {
  height: 28px;
}

.panel-chart span:nth-child(2) {
  height: 44px;
}

.panel-chart span:nth-child(3) {
  height: 62px;
}

.panel-chart span:nth-child(4) {
  height: 76px;
}

.illustration-card {
  position: absolute;
  border: 1px solid rgba(183, 207, 249, 0.64);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 36px rgba(75, 126, 220, 0.16);
}

.user-card {
  left: 26px;
  bottom: 22px;
  width: 118px;
  height: 140px;
}

.user-card::before {
  content: "";
  position: absolute;
  left: 36px;
  top: 27px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(180deg, #76aeff, #2f7df5);
}

.user-card::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 78px;
  width: 62px;
  height: 36px;
  border-radius: 34px 34px 8px 8px;
  background: linear-gradient(180deg, #76aeff, #2f7df5);
}

.shield-card {
  right: 24px;
  bottom: 74px;
  width: 92px;
  height: 112px;
  background: linear-gradient(180deg, #2f86ff, #1266e6);
  clip-path: polygon(50% 0, 90% 12%, 88% 58%, 50% 100%, 12% 58%, 10% 12%);
}

.shield-card::after {
  content: "";
  position: absolute;
  left: 32px;
  top: 45px;
  width: 25px;
  height: 14px;
  border-left: 6px solid #fff;
  border-bottom: 6px solid #fff;
  transform: rotate(-45deg);
}

.auth-main {
  padding: 96px 80px;
  display: grid;
  align-content: center;
  gap: 28px;
}

.auth-main input {
  min-height: 72px;
  border-color: #d8e0eb;
  border-radius: 12px;
  font-size: 16px;
}

.auth-main .large-button {
  min-height: 72px;
  margin-top: 16px;
  border-radius: 9px;
  font-size: 22px;
  box-shadow: 0 18px 28px rgba(31, 96, 224, 0.2);
}

.android-download-button {
  min-height: 56px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid rgba(47, 111, 237, 0.24);
  border-radius: 9px;
  color: var(--primary-strong);
  background: var(--bg-accent-muted);
  text-align: center;
  text-decoration: none;
  font-weight: 800;
}

.android-download-button small {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

body.nexus-android-app .android-download-button {
  display: none;
}

.auth-panel-header {
  gap: 12px;
  margin-bottom: 20px;
}

.auth-panel-header h2 {
  font-size: 40px;
}

.auth-panel-header p {
  font-size: 22px;
  font-weight: 700;
}

.auth-tabs {
  display: none;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 6px;
  padding: 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

.tab-button,
.ghost-button,
.primary-button,
.danger-button,
.icon-button,
.tree-item,
.context-tab,
.user-chip,
.multi-select-trigger {
  border-radius: var(--radius-sm);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tab-button {
  min-height: 40px;
  padding: 10px 14px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
}

.tab-button.active {
  background: #fff;
  color: var(--text-main);
  box-shadow: inset 0 0 0 1px var(--border);
}

.form-panel,
.field,
.dialog-form,
.auth-panel-header,
.section-header div {
  display: grid;
  gap: 8px;
}

.field > span {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.input-shell {
  position: relative;
  display: block;
}

.input-shell input {
  padding-right: 52px;
  padding-left: 54px;
}

.input-shell::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  opacity: 0.75;
  pointer-events: none;
}

.user-input-icon::before {
  border: 2px solid #6f7f99;
  border-radius: 50%;
  box-shadow: 0 13px 0 -5px #6f7f99;
}

.lock-input-icon::before {
  width: 16px;
  height: 14px;
  border: 2px solid #6f7f99;
  border-radius: 4px;
}

.lock-input-icon::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 19px;
  width: 11px;
  height: 10px;
  border: 2px solid #6f7f99;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  pointer-events: none;
}

.password-toggle-button {
  --password-toggle-icon: url("data:image/svg+xml,%3Csvg%20width%3D%2728%27%20height%3D%2728%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M3%203L21%2021%27%20stroke%3D%27%236f7f99%27%20stroke-width%3D%272.1%27%20stroke-linecap%3D%27round%27/%3E%3Cpath%20d%3D%27M10.58%2010.58C10.21%2010.95%2010%2011.45%2010%2012C10%2013.1%2010.9%2014%2012%2014C12.55%2014%2013.05%2013.79%2013.42%2013.42%27%20stroke%3D%27%236f7f99%27%20stroke-width%3D%272.1%27%20stroke-linecap%3D%27round%27/%3E%3Cpath%20d%3D%27M9.9%204.24C10.58%204.08%2011.28%204%2012%204C17%204%2020.27%208.11%2021.54%2010.04C22.15%2010.97%2022.15%2013.03%2021.54%2013.96C21.2%2014.48%2020.75%2015.08%2020.2%2015.7M6.52%206.52C4.6%207.78%203.27%209.54%202.46%2010.04C1.85%2010.97%201.85%2013.03%202.46%2013.96C3.73%2015.89%207%2020%2012%2020C13.65%2020%2015.13%2019.55%2016.4%2018.84%27%20stroke%3D%27%236f7f99%27%20stroke-width%3D%272.1%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27/%3E%3C/svg%3E");
  position: absolute;
  right: 22px;
  top: 50%;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  background: var(--password-toggle-icon) center / 28px 28px no-repeat;
  border: 0;
  transform: translateY(-50%);
}

.password-toggle-button:hover,
.password-toggle-button:focus-visible {
  opacity: 0.86;
}

.password-toggle-button[aria-pressed="true"] {
  --password-toggle-icon: url("data:image/svg+xml,%3Csvg%20width%3D%2728%27%20height%3D%2728%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%3E%3Cpath%20d%3D%27M2.46%2010.04C3.73%208.11%207%204%2012%204C17%204%2020.27%208.11%2021.54%2010.04C22.15%2010.97%2022.15%2013.03%2021.54%2013.96C20.27%2015.89%2017%2020%2012%2020C7%2020%203.73%2015.89%202.46%2013.96C1.85%2013.03%201.85%2010.97%202.46%2010.04Z%27%20stroke%3D%27%236f7f99%27%20stroke-width%3D%272.1%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27/%3E%3Ccircle%20cx%3D%2712%27%20cy%3D%2712%27%20r%3D%273%27%20stroke%3D%27%236f7f99%27%20stroke-width%3D%272.1%27/%3E%3C/svg%3E");
}

.remember-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.remember-option input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}

.auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.forgot-password-button,
.text-button,
.auth-switch-row button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 800;
}

.forgot-password-button {
  color: var(--primary);
  font-size: 16px;
}

.auth-switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 30px;
  color: var(--text-muted);
}

.auth-switch-row span {
  height: 1px;
  background: var(--border);
}

.auth-switch-row p {
  margin: 0;
}

.field-hint {
  font-size: 12px;
}

.field-hint.neutral {
  color: var(--text-muted);
}

.field-hint.success {
  color: var(--success);
}

.field-hint.warning {
  color: var(--warning);
}

.field-hint.error {
  color: var(--danger);
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 40px;
  padding: 10px 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}

.icon-only-button {
  width: 40px;
  min-height: 40px;
  padding: 8px;
  display: inline-grid;
  place-items: center;
  font-size: 28px;
  line-height: 1;
}

.primary-button {
  background: linear-gradient(180deg, #4a8cff 0%, var(--primary) 52%, var(--primary-strong) 100%);
  color: #fff;
  box-shadow: var(--shadow-blue);
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.icon-button:hover,
.tree-item:hover,
.tab-button:hover,
.context-tab:hover,
.user-chip:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  background: linear-gradient(180deg, #5a97ff 0%, #3578f4 52%, var(--primary-strong) 100%);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.84);
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.ghost-button:hover,
.icon-button:hover {
  background: var(--bg-subtle);
}

.danger-button {
  background: linear-gradient(180deg, #df6275 0%, var(--danger) 100%);
  color: #fff;
  box-shadow: 0 12px 26px rgba(198, 61, 84, 0.16);
}

.icon-button {
  background: rgba(255, 255, 255, 0.84);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.primary-button:active,
.ghost-button:active,
.danger-button:active,
.icon-button:active,
.tree-item:active,
.context-tab:active {
  transform: translateY(0);
  box-shadow: none;
}

.inline-action {
  min-width: 120px;
}

.large-button {
  min-height: 44px;
}

.feedback {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-main);
  white-space: pre-line;
}

.feedback.error {
  background: var(--bg-danger-soft);
  border-color: #f2c9d0;
  color: #a23346;
}

.feedback.success {
  background: var(--bg-success-soft);
  border-color: #c7e8d6;
  color: #206545;
}

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

.sidebar-backdrop {
  display: none;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  width: 268px;
  height: 100vh;
  padding: 26px 14px 22px;
  background:
    linear-gradient(180deg, rgba(7, 20, 38, 0.98) 0%, rgba(9, 27, 49, 0.98) 56%, rgba(7, 20, 38, 0.98) 100%);
  color: var(--text-inverse);
  display: grid;
  align-content: start;
  gap: 24px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.sidebar-brand strong,
.group-context-header strong {
  display: block;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #4a8cff 0%, #2f6fed 100%);
  color: #fff;
  font-weight: 800;
}

.sidebar-section {
  display: grid;
  gap: 12px;
}

.mobile-group-section {
  display: none;
}

.sidebar-section-label {
  padding: 0 10px;
  color: rgba(203, 213, 225, 0.86);
  background: transparent;
  border: 0;
}

.sidebar-current-group {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.drawer-group-list {
  display: grid;
  gap: 6px;
}

.tree-nav {
  display: grid;
  gap: 8px;
}

.tree-item {
  width: 100%;
  padding: 12px 12px 12px 46px;
  text-align: left;
  background: transparent;
  color: rgba(248, 250, 252, 0.9);
  border: 1px solid transparent;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  position: relative;
}

.tree-item::before {
  content: "⌁";
  position: absolute;
  left: 16px;
  top: 13px;
  color: rgba(248, 250, 252, 0.88);
  font-size: 16px;
}

.tree-item span,
.tree-item small {
  display: block;
}

.tree-item small {
  color: rgba(203, 213, 225, 0.76);
}

.tree-item.active {
  background: rgba(47, 111, 237, 0.24);
  border-color: rgba(88, 139, 242, 0.42);
  box-shadow: inset 3px 0 0 #2f6fed;
}

.tree-item:disabled {
  cursor: not-allowed;
}

.tree-item.requires-group.is-disabled {
  opacity: 0.45;
}

.sidebar-footnote {
  font-size: 12px;
  line-height: 1.5;
}

.content-shell {
  padding: 34px 34px 18px;
  grid-column: 2;
  min-width: 0;
  width: calc(100vw - 268px);
  max-width: none;
  min-height: 100vh;
  display: grid;
  gap: 24px;
  align-content: start;
}

.topbar {
  position: relative;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.topbar-title-row {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.mobile-nav-button {
  display: none;
}

.topbar h2 {
  font-size: 28px;
  margin-top: 0;
  letter-spacing: 0;
}

.topbar-actions {
  position: relative;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-search-field {
  width: min(340px, 30vw);
  min-width: 220px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text-secondary);
}

.global-search-field input {
  min-width: 0;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
}

.global-search-field input:focus {
  box-shadow: none;
}

.group-switcher-shell {
  position: relative;
  z-index: 50;
}

.group-switcher-trigger {
  min-width: 150px;
  max-width: 260px;
  min-height: 38px;
  padding: 7px 10px 7px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-main);
  box-shadow: 0 8px 18px rgba(18, 35, 61, 0.06);
}

.group-switcher-trigger span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-switcher-caret {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.group-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, calc(100vw - 32px));
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-md);
  z-index: 65;
}

.group-switcher-item {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
  text-align: left;
}

.group-switcher-item:hover {
  background: var(--bg-subtle);
}

.group-switcher-item.active {
  background: var(--bg-accent-soft);
  color: var(--primary-strong);
  font-weight: 800;
}

.group-switcher-check {
  color: var(--primary);
  font-weight: 900;
}

.group-switcher-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-switcher-empty {
  padding: 10px 12px;
  color: var(--text-muted);
}

.drawer-group-list .group-switcher-item {
  color: rgba(248, 250, 252, 0.9);
}

.drawer-group-list .group-switcher-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.drawer-group-list .group-switcher-item.active {
  background: rgba(47, 111, 237, 0.24);
  color: #fff;
}

.drawer-group-list .group-switcher-empty {
  color: rgba(203, 213, 225, 0.72);
}

.user-menu-shell {
  position: relative;
  z-index: 50;
}

.user-chip {
  min-width: 164px;
  padding: 4px 8px;
  background: transparent;
  border: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.user-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(180deg, #4a8cff 0%, #2f6fed 100%);
  color: #fff;
  font-weight: 800;
}

.user-chip-copy {
  display: grid;
  gap: 2px;
  text-align: left;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-md);
  z-index: 60;
}

.user-menu-item {
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-main);
}

.user-menu-item:hover {
  background: var(--bg-subtle);
}

.user-menu-item.danger {
  color: var(--danger);
}

.panel {
  width: 100%;
  max-width: none;
  animation: fadeIn 0.2s ease;
}

.group-context {
  display: grid;
  grid-template-columns: minmax(220px, 0.32fr) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: var(--glass);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.group-context-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.group-context-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.context-tab {
  min-height: 34px;
  padding: 7px 11px;
  background: var(--bg-accent-muted);
  color: var(--text-secondary);
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.context-tab.active {
  background: #fff;
  color: var(--primary-strong);
  border-color: rgba(47, 111, 237, 0.24);
}

.subview-tabs {
  margin-top: 16px;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.subview-tab {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 800;
}

.subview-tab.active {
  background: #fff;
  color: var(--text-main);
  box-shadow: inset 0 0 0 1px var(--border);
}

.context-tabs-toggle {
  display: none;
}

.card,
.stat-card,
.dialog {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}

.card {
  position: relative;
  width: 100%;
  max-width: none;
  padding: 28px;
  overflow: visible;
}

.card::before,
.dialog::before {
  content: none;
}

.dialog {
  position: relative;
  overflow: visible;
}

.card-header,
.dialog-header,
.dialog-actions,
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px;
  display: grid;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.88));
}

.stat-card span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.stat-card strong {
  font-size: 18px;
  line-height: 1.25;
}

.toolbar {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(216, 226, 239, 0.74);
  border-radius: var(--radius-md);
  background: rgba(244, 248, 255, 0.78);
}

.groups-dashboard {
  width: 100%;
  max-width: none;
  display: grid;
  gap: 28px;
  min-height: 690px;
}

.groups-command-bar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
}

.search-field {
  min-width: 0;
  height: 48px;
  padding: 0 12px 0 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.search-field input {
  min-height: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.search-field input:focus {
  border-color: transparent;
  box-shadow: none;
}

.search-field kbd {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  background: #fbfdff;
  font: inherit;
  font-size: 13px;
}

.filter-button::before {
  content: "≡";
  font-size: 18px;
  line-height: 1;
}

.notification-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 25px;
  box-shadow: none;
}

.group-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.group-metric-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 132px;
  padding: 24px 30px;
  border-right: 1px solid var(--border);
}

.group-metric-card:last-child {
  border-right: 0;
}

.group-metric-card div {
  display: grid;
  gap: 4px;
}

.group-metric-card span {
  color: #65758d;
  font-size: 14px;
  font-weight: 800;
}

.group-metric-card strong {
  color: var(--text-main);
  font-size: 26px;
  line-height: 1;
}

.group-metric-card small {
  color: var(--text-muted);
  font-weight: 600;
}

.metric-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 800;
}

.metric-blue {
  color: #2563eb;
  background: #eaf2ff;
}

.metric-green {
  color: #16a34a;
  background: #eaf8ee;
}

.metric-orange {
  color: #d97706;
  background: #fff6e7;
}

.metric-purple {
  color: #7c3aed;
  background: #f4eaff;
}

.group-table-card {
  width: 100%;
  max-width: none;
  min-height: 394px;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: visible;
}

.join-group-card {
  position: absolute;
  left: 28px;
  bottom: -84px;
  z-index: 25;
  width: min(480px, calc(100% - 56px));
  padding: 24px 28px;
  display: grid;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.join-group-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.join-group-panel-header strong {
  font-size: 18px;
}

.join-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.join-tab {
  min-height: 42px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  background: #fff;
}

.join-tab.active {
  color: var(--primary-strong);
  background: #edf4ff;
  box-shadow: inset 0 -2px 0 var(--primary);
}

.join-group-card p {
  margin: -4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.finance-toolbar {
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
}

.bills-toolbar {
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
}

.multi-select {
  position: relative;
  min-width: 0;
}

.multi-select-trigger {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-main);
  font-weight: 600;
}

.multi-select-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  min-width: 100%;
  width: max(100%, 320px);
  max-width: min(520px, calc(100vw - 40px));
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.compact-button {
  width: 100%;
  min-height: 36px;
  padding: 8px 12px;
}

.multi-select-options {
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.multi-select-option:hover {
  background: var(--bg-subtle);
}

.multi-select-option input {
  width: auto;
  min-height: auto;
}

.tag-input-picker {
  min-width: 0;
  position: relative;
}

.tag-input-trigger {
  position: relative;
  width: 100%;
  min-height: 42px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-main);
}

.tag-input-trigger:focus-within,
.tag-input-trigger:focus {
  border-color: rgba(47, 111, 237, 0.48);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}

.tag-input-chips {
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  position: relative;
}

.tag-input-chip {
  flex: 0 0 auto;
  max-width: 104px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: #eef1f5;
  color: #3f4b5f;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-input-overflow {
  position: sticky;
  right: 0;
  flex: 0 0 auto;
  padding: 0 4px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  line-height: 22px;
}

.tag-input-entry {
  flex: 1 1 80px;
  min-width: 80px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.tag-input-entry:focus {
  border-color: transparent;
  box-shadow: none;
}

.tag-preview {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 19;
  width: 420px;
  max-width: 90vw;
  padding: 10px;
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-md);
  display: none !important;
}

.tag-preview.is-empty {
  display: none !important;
}

.join-requests-card {
  margin-top: 18px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fbff;
}

.join-group-card div,
.section-header div {
  display: grid;
  gap: 4px;
}

.join-group-card .join-group-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.join-group-card .dialog-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.join-group-card span,
.section-header p {
  font-size: 13px;
}

.compact-table {
  margin-top: 14px;
}

.table-shell {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
  background: #fff;
  box-shadow: none;
}

.group-table-card .table-shell {
  margin-top: 0;
  border: 0;
  border-radius: 8px 8px 0 0;
  overflow: visible;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 16px 24px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #e8eef6;
}

thead th {
  background: #f8fafc;
  color: #66758d;
  font-size: 13px;
  font-weight: 800;
}

tbody tr:hover {
  background: rgba(234, 242, 255, 0.5);
}

.sort-header {
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
}

.cell-subtext {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.table-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.table-action {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.finance-select-head,
.finance-select-cell {
  width: 64px;
  text-align: center;
  vertical-align: middle;
}

.finance-select-checkbox {
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--danger);
  cursor: pointer;
}

.status-chip,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill.role-admin,
.pill.status-active {
  background: rgba(47, 111, 237, 0.12);
  color: #2559c9;
}

.pill.role-member {
  background: rgba(33, 134, 92, 0.12);
  color: #1c744f;
}

.pill.role-superadmin,
.pill.role-super-admin,
.pill.role-user {
  background: rgba(83, 98, 122, 0.12);
  color: #516174;
}

.pill.status-disabled {
  background: rgba(198, 61, 84, 0.12);
  color: #a63448;
}

.copy-id-button {
  width: auto;
  min-height: 0;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #edf4ff;
  color: var(--primary-strong);
  font-weight: 700;
  line-height: 1.4;
}

.member-count-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-weight: 800;
}

.row-menu-shell {
  position: relative;
}

.row-menu-trigger {
  width: 40px;
  min-height: 40px;
  padding: 0;
  background: #fff;
}

.row-action-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 178px;
  padding: 8px;
  display: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.row-menu-shell:hover .row-action-menu,
.row-menu-shell:focus-within .row-action-menu {
  display: grid;
  gap: 4px;
}

.row-action-item {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  text-align: left;
  border-radius: 6px;
  background: transparent;
  color: var(--text-main);
  font-weight: 700;
}

.row-action-item:hover {
  background: var(--bg-subtle);
}

.row-action-item.danger {
  color: #ef4444;
}

.copy-id-button:hover {
  border-color: rgba(47, 111, 237, 0.5);
  background: var(--bg-accent-muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  max-width: 140px;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: #eef7f1;
  color: #23623f;
  font-size: 12px;
  font-weight: 700;
}

.profile-id-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-accent-muted);
}

.profile-id-grid div {
  display: grid;
  gap: 4px;
}

.profile-id-grid span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.profile-id-grid strong {
  font-size: 14px;
}

.modal-tag-picker {
  margin-bottom: 8px;
}

.stale-green {
  background: rgba(33, 134, 92, 0.12);
  color: #1c744f;
}

.stale-yellow {
  background: rgba(181, 116, 17, 0.14);
  color: #98630e;
}

.stale-orange {
  background: rgba(212, 122, 29, 0.14);
  color: #b16312;
}

.stale-red {
  background: rgba(198, 61, 84, 0.12);
  color: #a63448;
}

.link-button {
  padding: 0;
  background: transparent;
  color: var(--primary-strong);
  font-weight: 700;
}

.link-button.danger {
  color: var(--danger);
}

.pagination-bar {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.group-table-card .pagination-bar {
  min-height: 78px;
  margin-top: 0;
  padding: 16px 30px;
  border-top: 1px solid var(--border);
}

.pager-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
}

.dashboard-footer {
  padding: 8px 0 0;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
}

.empty-state {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: var(--bg-accent-muted);
  display: grid;
  gap: 6px;
  color: var(--text-secondary);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.18);
}

.dialog {
  width: min(560px, 100%);
  padding: 20px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bill-category-mapping-dialog {
  width: min(900px, 100%);
}

.bill-category-mapping-toolbar {
  align-items: end;
}

.bill-category-mapping-toolbar .action-field {
  display: grid;
  gap: 8px;
}

.bill-category-mapping-toolbar .action-field .ghost-button {
  width: fit-content;
}

.compact-table-shell {
  margin-top: 8px;
}

.compact-table-shell tbody td {
  vertical-align: middle;
}

.compact-table-shell select {
  min-width: 180px;
}

.mapping-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.mapping-status.is-default {
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-secondary);
}

.finance-summary {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.finance-summary span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--bg-accent-muted);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.asset-stat-toolbar {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 86px 150px 118px 126px 40px;
  align-items: end;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-accent-muted);
}

.asset-stat-toolbar > div,
.asset-stat-member-filter,
.asset-stat-period {
  display: grid;
  gap: 4px;
}

.asset-stat-toolbar span,
.asset-stat-member-filter > span,
.asset-stat-period span,
.asset-chart-heading span,
.asset-chart-legend em,
.asset-stat-kpis span {
  color: var(--text-secondary);
  font-size: 13px;
}

.asset-stat-period {
  min-width: 0;
  font-weight: 800;
}

.asset-stat-toolbar select,
.asset-stat-toolbar .multi-select-trigger,
.date-range-trigger,
.asset-stat-toolbar .icon-only-button {
  min-height: 40px;
  height: 40px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.asset-stat-toolbar select {
  padding-right: 28px;
  white-space: nowrap;
}

.asset-stat-member-filter .multi-select-trigger {
  text-align: center;
  padding: 7px 8px;
}

.date-range-filter {
  position: relative;
}

.date-range-trigger {
  width: 100%;
  padding: 5px 8px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-main);
  display: grid;
  gap: 1px;
  font-weight: 800;
}

.date-range-trigger small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-range-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(360px, 78vw);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: #fff;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.date-calendar {
  display: grid;
  gap: 6px;
}

.date-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.date-calendar-head strong {
  font-size: 12px;
}

.date-calendar-head button,
.date-calendar-day {
  min-height: 22px;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-main);
}

.date-calendar-head button {
  width: 24px;
  border: 1px solid var(--border);
}

.date-calendar-weekdays,
.date-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  text-align: center;
}

.date-calendar-weekdays span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
}

.date-calendar-day {
  padding: 0;
  border: 1px solid transparent;
  font-size: 11px;
}

.date-calendar-day:hover {
  background: var(--bg-accent-muted);
}

.date-calendar-day.active {
  background: var(--primary);
  color: #fff;
}

.asset-stat-kpis {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.asset-stat-kpis article {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  display: grid;
  gap: 6px;
}

.asset-stat-kpis strong {
  font-size: 20px;
}

.asset-chart-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.asset-chart-grid.single-chart {
  grid-template-columns: 1fr;
}

.asset-chart-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  display: grid;
  gap: 12px;
}

.single-chart .asset-chart-card {
  grid-column: 1 / -1;
}

.asset-chart-pie {
  grid-column: 1 / -1;
  grid-template-columns: minmax(360px, 1.2fr) minmax(260px, 0.8fr);
  align-items: center;
}

.asset-chart-pie .asset-chart-heading {
  grid-column: 1 / -1;
}

.asset-chart-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.asset-chart-card svg {
  width: 100%;
  height: 420px;
  min-height: 0;
  border-radius: var(--radius-sm);
  background: #f8fbff;
}

.asset-chart-pie svg {
  height: 520px;
}

.asset-line-path {
  stroke: #2f6fed;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.asset-line-point {
  fill: #21865c;
  stroke: #fff;
  stroke-width: 3;
}

.asset-chart-bar rect {
  fill: #21865c;
}

.asset-chart-pie circle {
  fill: none;
  stroke-width: 72;
  transform: rotate(-90deg);
  transform-origin: 160px 160px;
}

.chart-value-label {
  fill: var(--text-main);
  font-size: 12px;
  font-weight: 800;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
}

.chart-axis {
  stroke: var(--border-strong);
  stroke-width: 1.5;
}

.chart-grid-line {
  stroke: #dfe7f1;
  stroke-width: 1;
  stroke-dasharray: 5 7;
}

.chart-axis-label,
.chart-tick-label {
  fill: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.pie-total-label {
  font-size: 12px;
}

.pie-slice-0 {
  stroke: #2f6fed;
}

.pie-slice-1 {
  stroke: #21865c;
}

.pie-slice-2 {
  stroke: #c63d54;
}

.pie-slice-3 {
  stroke: #b57411;
}

.pie-slice-4 {
  stroke: #53627a;
}

.pie-slice-5 {
  stroke: #6f58c9;
}

.asset-chart-legend {
  display: grid;
  gap: 8px;
}

.asset-chart-legend span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #edf2f8;
}

.asset-chart-legend em {
  font-style: normal;
}

.asset-stat-empty {
  margin-top: 16px;
}

.confirm-dialog {
  width: min(460px, 100%);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .groups-command-bar {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .groups-command-bar .primary-button {
    grid-column: 3;
  }

  .group-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-metric-card:nth-child(2) {
    border-right: 0;
  }

  .group-metric-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .finance-toolbar,
  .bills-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .group-context {
    grid-template-columns: 1fr;
  }

  .asset-chart-grid,
  .asset-chart-pie,
  .asset-stat-kpis,
  .asset-stat-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .auth-card,
  .app-shell {
    min-width: 100vw;
    grid-template-columns: 1fr;
  }

  .app-shell.sidebar-open {
    overflow: hidden;
  }

  .auth-side {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 24;
    display: block;
    background: rgba(15, 23, 42, 0.45);
    border: none;
    padding: 0;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 25;
    width: min(320px, 88vw);
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 24px 0 54px rgba(15, 23, 42, 0.28);
  }

  .mobile-group-section {
    display: grid;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .content-shell {
    padding: 24px;
    grid-column: 1;
    width: 100%;
    gap: 18px;
  }

  .mobile-nav-button {
    display: inline-flex;
  }

  .toolbar,
  .finance-toolbar,
  .bills-toolbar,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .groups-command-bar {
    grid-template-columns: 1fr 1fr;
  }

  .groups-command-bar .search-field,
  .groups-command-bar .primary-button {
    grid-column: 1 / -1;
  }

  .join-group-card {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }

  .toolbar {
    padding: 10px;
  }

  .profile-id-grid {
    grid-template-columns: 1fr;
  }
}

.app-bottom-nav {
  display: none;
}

@media (max-width: 720px) {
  body {
    overscroll-behavior-y: contain;
    -webkit-tap-highlight-color: transparent;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .auth-shell,
  .overlay {
    padding: 12px;
  }

  :root {
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
  }

  .auth-card {
    border-radius: 20px;
    width: 100%;
    max-width: calc(100vw - 24px);
  }

  .auth-main,
  .card,
  .dialog {
    padding: 16px;
  }

  .auth-panel-header h2,
  .topbar h2 {
    font-size: 24px;
  }

  .auth-side {
    display: none;
  }

  .auth-main {
    min-height: calc(100vh - 24px);
    min-width: 0;
    width: 100%;
  }

  .auth-tabs {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .android-download-button {
    min-height: 52px;
  }

  .topbar,
  .card-header,
  .dialog-header,
  .dialog-actions,
  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-title-row {
    width: 100%;
  }

  .topbar-actions,
  .inline-field,
  .pagination-bar {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .dialog-actions .primary-button,
  .dialog-actions .ghost-button,
  .dialog-actions .danger-button,
  .pagination-bar .ghost-button,
  .row-actions .ghost-button,
  .row-actions .danger-button,
  .row-actions .primary-button {
    width: 100%;
  }

  .user-chip {
    width: 100%;
  }

  .group-context-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .table-shell {
    overflow: visible;
    border: none;
    background: transparent;
  }

  .table-shell table,
  .table-shell thead,
  .table-shell tbody,
  .table-shell tr,
  .table-shell th,
  .table-shell td {
    display: block;
  }

  .table-shell thead {
    display: none;
  }

  .table-shell tbody {
    display: grid;
    gap: 12px;
  }

  .table-shell tbody tr {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    padding: 14px;
  }

  .table-shell tbody td {
    padding: 0;
    border-bottom: none;
  }

  .table-shell tbody td + td {
    margin-top: 10px;
  }

  .table-shell tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
  }

  .table-shell tbody td[colspan] {
    padding: 14px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--bg-accent-muted);
  }

  .table-shell tbody td[colspan]::before {
    content: none;
  }
}

@media (max-width: 720px) {
  .content-shell {
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 10px calc(12px + env(safe-area-inset-bottom));
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 18;
    flex-direction: row;
    align-items: center;
    padding: 10px;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  }

  .topbar-title-row {
    flex: 1;
    min-width: 0;
    align-items: center;
    gap: 8px;
  }

  .topbar-kicker,
  .topbar p,
  .user-chip-copy,
  .sidebar-footnote {
    display: none;
  }

  .topbar h2 {
    margin: 0;
    font-size: 18px;
  }

  .topbar-actions {
    display: flex;
    width: auto;
  }

  .group-switcher-shell {
    display: none;
  }

  .user-chip {
    min-width: 0;
    width: auto;
    padding: 6px;
  }

  .user-avatar {
    width: 34px;
    height: 34px;
  }

  .mobile-nav-button {
    min-height: 34px;
    padding: 7px 10px;
  }

  .group-context {
    gap: 8px;
    padding: 10px;
  }

  .group-context-header {
    flex-direction: row;
    align-items: center;
  }

  .group-context-kicker,
  .group-context-header small {
    display: none;
  }

  .group-context-header strong {
    font-size: 14px;
  }

  .context-tabs-toggle {
    display: inline-flex;
    min-height: 34px;
    padding: 7px 10px;
    white-space: nowrap;
  }

  .group-context-tabs {
    display: none;
  }

  .app-shell.context-tabs-open .group-context-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .context-tab {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 13px;
  }

  .card {
    padding: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  }

  .groups-dashboard {
    min-height: auto;
    gap: 14px;
  }

  .group-metrics-grid,
  .groups-command-bar {
    grid-template-columns: 1fr;
  }

  .group-metric-card,
  .group-metric-card:nth-child(2),
  .group-metric-card:last-child {
    min-height: 104px;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .group-metric-card:last-child {
    border-bottom: 0;
  }

  .group-table-card .pagination-bar {
    padding: 12px;
  }

  .card-header {
    gap: 8px;
  }

  .card-header h3 {
    font-size: 18px;
  }

  .card-header p,
  .join-group-card span,
  .section-header p {
    font-size: 12px;
    line-height: 1.4;
  }

  input,
  select,
  .primary-button,
  .ghost-button,
  .danger-button,
  .icon-button,
  .multi-select-trigger {
    min-height: 44px;
    padding: 9px 10px;
  }

  .primary-button,
  .ghost-button,
  .danger-button {
    min-height: 40px;
  }

  .toolbar,
  .finance-toolbar,
  .bills-toolbar,
  .asset-stat-toolbar {
    margin-top: 10px;
    gap: 8px;
  }

  .subview-tabs {
    width: 100%;
  }

  .asset-stat-toolbar {
    display: grid;
  }

  .join-requests-card,
  .empty-state {
    padding: 10px;
  }

  .table-shell {
    margin-top: 12px;
  }

  .table-shell tbody {
    gap: 8px;
  }

  .table-shell tbody tr {
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    padding: 12px;
  }

  .table-shell tbody td {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    min-height: 22px;
    font-size: 13px;
  }

  .table-shell tbody td + td {
    margin-top: 6px;
  }

  .table-shell tbody td::before {
    margin: 0;
    font-size: 11px;
    line-height: 1.4;
  }

  .table-shell tbody td.actions-cell {
    display: block;
  }

  .table-shell tbody td.actions-cell::before {
    margin-bottom: 6px;
  }

  .row-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .row-menu-shell {
    width: 100%;
  }

  .row-menu-trigger {
    width: 100%;
  }

  .row-action-menu {
    position: static;
    width: 100%;
    min-width: 0;
    margin-top: 8px;
    box-shadow: none;
  }

  .table-shell tbody td.finance-select-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
  }

  .table-shell tbody td.finance-select-cell::before {
    margin: 0;
  }

  .finance-select-checkbox {
    width: 22px;
    height: 22px;
  }

  .row-actions {
    gap: 6px;
  }

  .link-button,
  .table-muted,
  .cell-subtext {
    font-size: 12px;
  }

  .pill,
  .status-chip {
    padding: 3px 7px;
    font-size: 11px;
  }

  .finance-summary {
    margin-top: 10px;
    gap: 6px;
  }

  .finance-summary span {
    padding: 5px 8px;
    font-size: 12px;
  }

  .dialog {
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .date-range-panel,
  .multi-select-panel,
  .tag-preview {
    left: 0;
    right: auto;
    width: min(100%, calc(100vw - 28px));
    max-width: calc(100vw - 28px);
  }
}

@media (max-width: 480px) {
  .content-shell {
    padding: 8px;
  }

  .group-context,
  .topbar,
  .card {
    border-radius: 14px;
  }

  .app-shell.context-tabs-open .group-context-tabs {
    grid-template-columns: 1fr;
  }

  .table-shell tbody td {
    grid-template-columns: 64px minmax(0, 1fr);
  }
}

/* 2026 full console refresh */
:root {
  --bg-page: #f4f7fb;
  --bg-subtle: #f3f6fb;
  --bg-elevated: #ffffff;
  --bg-sidebar: #071426;
  --bg-sidebar-soft: #10243d;
  --bg-accent-soft: #eaf2ff;
  --bg-accent-muted: #f6f9fe;
  --border: #dfe7f2;
  --border-strong: #c6d3e3;
  --text-main: #101a2f;
  --text-secondary: #52627a;
  --text-muted: #7b8aa1;
  --primary: #2368e8;
  --primary-strong: #174fc0;
  --success: #16864f;
  --danger: #e21f2f;
  --warning: #b77910;
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 8px;
  --shadow-sm: 0 12px 28px rgba(17, 34, 64, 0.07);
  --shadow-md: 0 24px 52px rgba(17, 34, 64, 0.14);
  --shadow-blue: 0 12px 24px rgba(35, 104, 232, 0.22);
}

body {
  background: #f4f7fb;
}

.page-bg {
  background: linear-gradient(180deg, #fbfdff 0%, #f4f7fb 58%, #f7f9fc 100%);
}

.app-shell {
  grid-template-columns: 268px minmax(0, 1fr);
  background: transparent;
}

.sidebar {
  padding: 26px 14px 18px;
  background:
    linear-gradient(180deg, rgba(7, 20, 38, 0.98) 0%, rgba(9, 27, 49, 0.98) 56%, rgba(7, 20, 38, 0.98) 100%);
  gap: 22px;
}

.sidebar-brand {
  padding: 8px 10px 14px;
  gap: 12px;
}

.sidebar-brand span,
.sidebar-current-group span,
.tree-item small {
  color: rgba(214, 224, 238, 0.68);
}

.brand-mark,
.user-avatar {
  border-radius: 8px;
  background: linear-gradient(145deg, #2f82ff 0%, #2368e8 72%, #174fc0 100%);
  box-shadow: 0 12px 24px rgba(35, 104, 232, 0.28);
}

.sidebar-section-label {
  padding: 0 10px;
  color: rgba(226, 234, 245, 0.86);
  font-size: 12px;
  letter-spacing: 0;
}

.sidebar-current-group {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  border-color: rgba(255, 255, 255, 0.1);
}

.tree-nav {
  gap: 6px;
}

.tree-item {
  min-height: 46px;
  padding: 10px 12px 10px 46px;
  border-radius: 8px;
  color: rgba(248, 250, 252, 0.94);
}

.tree-item::before {
  content: attr(data-nav-icon);
  left: 16px;
  top: 11px;
  width: 18px;
  text-align: center;
  color: rgba(245, 249, 255, 0.9);
  font-size: 15px;
}

.tree-item.active {
  background: linear-gradient(90deg, rgba(35, 104, 232, 0.36), rgba(255, 255, 255, 0.08));
  border-color: rgba(89, 143, 245, 0.36);
  box-shadow: inset 3px 0 0 #2f82ff;
}

.content-shell {
  max-width: none;
  width: calc(100vw - 268px);
  box-sizing: border-box;
  min-height: 100vh;
  padding: 34px 34px 18px;
  gap: 20px;
  overflow-x: hidden;
}

.topbar {
  min-height: 58px;
  align-items: flex-start;
}

.topbar h2 {
  font-size: 30px;
  font-weight: 900;
}

.topbar p {
  margin-top: 5px;
}

.topbar-actions {
  align-items: center;
}

.user-chip {
  min-width: 156px;
  padding: 2px 6px;
  border-radius: 8px;
}

.notification-button {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: #101a2f;
  font-size: 26px;
}

.group-context {
  grid-template-columns: minmax(270px, 0.38fr) minmax(0, 1fr);
  padding: 16px 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(211, 222, 237, 0.86);
  box-shadow: var(--shadow-sm);
}

.group-context-header strong {
  font-size: 18px;
}

.copy-id-button {
  border-radius: 7px;
  background: #eaf2ff;
  border-color: rgba(35, 104, 232, 0.18);
  color: #2368e8;
  font-weight: 900;
}

.context-tab,
.subview-tab {
  border-radius: 8px;
}

.context-tab.active,
.subview-tab.active {
  color: #2368e8;
  box-shadow: inset 0 0 0 1px rgba(35, 104, 232, 0.18);
}

.card,
.dialog,
.table-shell {
  border-radius: 8px;
  border-color: rgba(211, 222, 237, 0.9);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-sm);
}

.card {
  padding: 24px;
}

.card-header h3,
.dialog-header h3,
.section-header h3 {
  font-size: 22px;
  font-weight: 900;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.tab-button,
.context-tab,
.tree-item,
.user-chip,
.multi-select-trigger,
input,
select {
  border-radius: 8px;
  letter-spacing: 0;
}

.primary-button {
  background: linear-gradient(180deg, #2f82ff 0%, #2368e8 60%, #174fc0 100%);
}

.ghost-button,
.icon-button {
  background: #fff;
  border-color: #dce6f2;
}

.danger-button {
  background: linear-gradient(180deg, #ff5a64 0%, #e21f2f 100%);
}

.toolbar,
.finance-toolbar,
.bills-toolbar,
.asset-stat-toolbar,
.groups-command-bar {
  border-radius: 8px;
  background: #f7faff;
  border: 1px solid #dfe8f4;
  box-shadow: none;
}

.finance-toolbar,
.bills-toolbar {
  grid-template-columns: minmax(160px, 1fr) 170px 150px 150px 150px 42px repeat(3, auto);
  align-items: center;
}

.bills-toolbar #bills-email-config-button,
.bills-toolbar #bills-email-sync-button,
.bills-toolbar #bills-import-email-button,
.bills-toolbar #bills-bulk-cancel-button,
.bills-toolbar #bills-bulk-tag-button,
.bills-toolbar #bills-bulk-delete-button {
  grid-column: auto;
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.finance-summary .summary-card {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px 20px;
  border: 0;
  border-radius: 8px;
  color: #101a2f;
}

.summary-card small,
.summary-card em {
  color: #52627a;
  font-style: normal;
  font-weight: 800;
}

.summary-card strong {
  font-size: 28px;
  line-height: 1.15;
}

.summary-card-total {
  background: linear-gradient(135deg, #edf5ff, #f7fbff);
}

.summary-card-income {
  background: linear-gradient(135deg, #edf8f1, #f8fcf9);
}

.summary-card-expense {
  background: linear-gradient(135deg, #fff0f1, #fff8f8);
}

.summary-card-net {
  background: linear-gradient(135deg, #f2efff, #fbfaff);
}

.summary-card-income strong {
  color: #16864f;
}

.summary-card-expense strong,
.amount-expense {
  color: #e21f2f;
}

.summary-card-net strong {
  color: #6754d9;
}

.table-shell {
  overflow: auto;
  box-shadow: none;
}

thead th {
  padding: 14px 16px;
  background: #f8fbff;
  color: #5d6d84;
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px;
}

tbody tr {
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

tbody tr:hover {
  background: #fbfdff;
  box-shadow: inset 3px 0 0 rgba(35, 104, 232, 0.22);
}

.finance-title-cell {
  font-weight: 900;
  color: #101a2f;
}

.finance-amount-cell {
  font-weight: 900;
  white-space: nowrap;
}

.balance-amount-cell,
.amount-income {
  color: #101a2f;
}

.bill-type-chip,
.platform-chip,
.tag-chip,
.status-chip,
.pill {
  min-height: 24px;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.bill-type-income {
  background: #e9f8ef;
  color: #16864f;
}

.bill-type-expense {
  background: #ffecef;
  color: #e21f2f;
}

.platform-chip {
  background: #edf3fb;
  color: #42546e;
}

.platform-alipay {
  background: #e9f3ff;
  color: #1677ff;
}

.platform-wechat {
  background: #e9f8ef;
  color: #19a15f;
}

.platform-bank_card,
.platform-credit_card {
  background: #eef2ff;
  color: #4b5fc7;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-chip {
  background: #eaf2ff;
  color: #2368e8;
}

.pagination-bar {
  justify-content: center;
  gap: 8px;
}

.pager-button,
.pagination-bar .ghost-button {
  border-radius: 8px;
}

@media (max-width: 1180px) {
  .content-shell {
    padding: 26px 22px 16px;
  }

  .finance-toolbar,
  .bills-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .finance-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .app-shell {
    min-width: 100vw;
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: min(318px, 88vw);
  }

  .content-shell {
    max-width: none;
    width: 100%;
  }

  .group-context {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    background: #f5f7fb;
  }

  .content-shell {
    padding: calc(10px + env(safe-area-inset-top)) 10px calc(88px + env(safe-area-inset-bottom));
    gap: 10px;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
  }

  .app-bottom-nav {
    position: fixed;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 12px;
    z-index: 32;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    min-height: 58px;
    padding: 6px;
    border: 1px solid rgba(199, 213, 232, 0.92);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(14px);
  }

  .app-bottom-nav button {
    display: grid;
    place-items: center;
    gap: 3px;
    min-width: 0;
    min-height: 46px;
    padding: 4px 2px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #60708a;
    font-size: 12px;
    font-weight: 800;
  }

  .app-bottom-nav button::before {
    content: attr(data-nav-icon);
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: transparent;
    color: currentColor;
    font-size: 13px;
    font-weight: 900;
  }

  .app-bottom-nav button.active {
    background: #eef5ff;
    color: #2368e8;
  }

  .app-bottom-nav button.active::before {
    background: #2368e8;
    color: #fff;
  }

  body.nexus-android-app .content-shell {
    max-width: 430px;
    margin: 0 auto;
  }

  body.nexus-android-app .app-bottom-nav {
    right: max(12px, calc((100vw - 406px) / 2));
    left: max(12px, calc((100vw - 406px) / 2));
    max-width: 406px;
    margin: 0 auto;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 18;
    min-height: 54px;
    padding: 10px;
    align-items: center;
    border: 1px solid rgba(211, 222, 237, 0.92);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 24px rgba(17, 34, 64, 0.08);
  }

  .topbar h2 {
    font-size: 19px;
  }

  .mobile-nav-button {
    display: inline-flex;
  }

  .group-context,
  .card,
  .dialog,
  .table-shell {
    border-radius: 8px;
  }

  .group-context {
    padding: 12px;
  }

  .card {
    padding: 12px;
  }

  .card-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .card-header h3 {
    font-size: 18px;
  }

  .card-header p {
    display: none;
  }

  .card-header .primary-button {
    min-width: 44px;
    width: auto;
    padding: 0 12px;
    white-space: nowrap;
  }

  .toolbar,
  .finance-toolbar,
  .bills-toolbar,
  .asset-stat-toolbar,
  .groups-command-bar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
    overflow: hidden;
  }

  .search-field,
  .groups-command-bar .search-field {
    grid-column: 1 / -1;
  }

  .bills-toolbar #bills-owner-filter,
  .bills-toolbar #bills-month-filter,
  .bills-toolbar #bills-type-filter,
  .bills-toolbar #bills-category-filter,
  .bills-toolbar #bills-platform-filter {
    min-width: 0;
  }

  .bills-toolbar .primary-button,
  .bills-toolbar .ghost-button,
  .bills-toolbar .danger-button {
    width: 100%;
    min-width: 0;
    font-size: 13px;
  }

  .finance-summary {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .finance-summary .summary-card {
    min-width: 148px;
    min-height: 82px;
    padding: 12px;
    scroll-snap-align: start;
  }

  .summary-card strong {
    font-size: 18px;
  }

  .table-shell {
    margin-top: 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .table-shell tbody {
    gap: 10px;
  }

  .table-shell tbody tr,
  .table-shell tbody tr.finance-row {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid #dfe7f2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(17, 34, 64, 0.06);
  }

  .table-shell tbody tr:hover {
    box-shadow: 0 8px 18px rgba(17, 34, 64, 0.08);
  }

  .table-shell tbody td {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
    min-height: 21px;
    font-size: 13px;
  }

  .table-shell tbody tr.finance-row td.finance-title-cell {
    display: block;
    order: -3;
    font-size: 15px;
  }

  .table-shell tbody tr.finance-row td.finance-title-cell::before {
    display: none;
  }

  .table-shell tbody tr.finance-row td.finance-amount-cell {
    display: block;
    order: -2;
    font-size: 18px;
  }

  .table-shell tbody tr.finance-row td.finance-amount-cell::before {
    display: none;
  }

  .table-shell tbody tr.finance-row td.actions-cell {
    margin-top: 8px;
  }

  .row-actions {
    grid-template-columns: 1fr;
  }

  .row-menu-trigger,
  .row-menu-shell,
  .row-action-menu {
    width: 100%;
  }

  .pagination-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }
}

@media (max-width: 480px) {
  .content-shell {
    padding: calc(8px + env(safe-area-inset-top)) 8px calc(74px + env(safe-area-inset-bottom));
  }

  .toolbar,
  .finance-toolbar,
  .bills-toolbar {
    grid-template-columns: 1fr;
  }

  .table-shell tbody td {
    grid-template-columns: 64px minmax(0, 1fr);
  }
}

/* Bills page: desktop finance console and mobile card list */
#balances-panel,
#bills-panel {
  --bill-blue: #2563eb;
  --bill-bg: #f6f8fc;
  --bill-border: #dbe5f2;
  --bill-text: #0f172a;
  --bill-muted: #64748b;
  --bill-green: #16a34a;
  --bill-red: #dc2626;
  background: var(--bill-bg);
}

#balances-panel .balances-page,
#bills-panel .bills-page {
  display: grid;
  gap: 16px;
}

#balances-panel .balances-mobile-head,
#balances-panel .balances-mobile-list,
#bills-panel .bills-mobile-head,
#bills-panel .bills-mobile-list {
  display: none;
}

#balances-panel .balances-group-card,
#balances-panel .balances-filter-card,
#balances-panel .balances-table-shell,
#bills-panel .bills-group-card,
#bills-panel .bills-filter-card,
#bills-panel .bills-table-shell {
  border: 1px solid rgba(219, 229, 242, 0.92);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

#balances-panel .balances-group-card,
#bills-panel .bills-group-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  padding: 20px 22px;
}

#balances-panel .balances-group-eyebrow,
#bills-panel .bills-group-eyebrow {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

#balances-panel .balances-group-card h3,
#bills-panel .bills-group-card h3 {
  margin: 8px 0 8px;
  color: var(--bill-text);
  font-size: 20px;
  line-height: 1.2;
}

#balances-panel .balances-group-meta,
#bills-panel .bills-group-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--bill-muted);
  font-size: 13px;
}

#balances-panel .balances-group-meta strong,
#bills-panel .bills-group-meta strong {
  color: var(--bill-blue);
}

#balances-panel .balances-group-actions,
#bills-panel .bills-group-actions,
#bills-panel .bill-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  white-space: nowrap;
}

#balances-panel .primary-button,
#balances-panel .ghost-button,
#bills-panel .primary-button,
#bills-panel .ghost-button {
  min-height: 40px;
  border-radius: 10px;
}

#balances-panel .finance-action-button,
#bills-panel .finance-action-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#balances-panel .finance-action-icon,
#bills-panel .finance-action-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

#balances-panel .primary-button .finance-action-icon,
#bills-panel .primary-button .finance-action-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

#balances-panel .ghost-button .finance-action-icon,
#bills-panel .ghost-button .finance-action-icon {
  background: #eef4ff;
  color: var(--bill-blue);
}

#balances-panel .balances-action-menu,
#balances-panel .balances-mobile-action-menu,
#bills-panel .bills-action-menu,
#bills-panel .bills-mobile-action-menu,
#bills-panel .row-menu-shell {
  position: relative;
}

#balances-panel .balances-action-menu summary,
#balances-panel .balances-mobile-action-menu summary,
#bills-panel .bills-action-menu summary,
#bills-panel .bills-mobile-action-menu summary,
#bills-panel .row-menu-shell summary {
  list-style: none;
  cursor: pointer;
}

#balances-panel .balances-action-menu summary::-webkit-details-marker,
#balances-panel .balances-mobile-action-menu summary::-webkit-details-marker,
#bills-panel .bills-action-menu summary::-webkit-details-marker,
#bills-panel .bills-mobile-action-menu summary::-webkit-details-marker,
#bills-panel .row-menu-shell summary::-webkit-details-marker {
  display: none;
}

#balances-panel .balances-action-menu-panel,
#balances-panel .balances-mobile-action-menu-panel,
#bills-panel .bills-action-menu-panel,
#bills-panel .bills-mobile-action-menu-panel,
#bills-panel .row-action-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 22;
  display: grid;
  width: 176px;
  padding: 8px;
  border: 1px solid var(--bill-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
}

#balances-panel .balances-action-menu:not([open]) .balances-action-menu-panel,
#balances-panel .balances-mobile-action-menu:not([open]) .balances-action-menu-panel,
#bills-panel .bills-action-menu:not([open]) .bills-action-menu-panel,
#bills-panel .bills-mobile-action-menu:not([open]) .bills-action-menu-panel,
#bills-panel .row-menu-shell:not([open]) .row-action-menu {
  display: none;
}

#balances-panel .row-action-item,
#bills-panel .row-action-item {
  justify-content: flex-start;
  width: 100%;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--bill-text);
  font-size: 13px;
  text-align: left;
}

#balances-panel .row-action-item:hover,
#bills-panel .row-action-item:hover {
  background: #f2f6ff;
}

#balances-panel .row-action-item.danger,
#bills-panel .row-action-item.danger {
  color: var(--bill-red);
}

#balances-panel .balances-filter-card,
#bills-panel .bills-filter-card {
  padding: 18px 20px;
}

#balances-panel .balances-primary-filter {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 132px 44px;
  gap: 14px;
  align-items: center;
}

#bills-panel .bills-primary-filter {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 320px) minmax(150px, 180px) minmax(124px, 148px);
  gap: 14px;
  align-items: center;
}

#bills-panel #bills-search-button {
  display: none;
}

#balances-panel .balances-search-field,
#balances-panel .balances-filter-grid label,
#balances-panel .balances-amount-range,
#balances-panel .balances-sort-row,
#bills-panel .bills-search-field,
#bills-panel .bills-date-range-field,
#bills-panel .bills-filter-grid label,
#bills-panel .bills-amount-range,
#bills-panel .bills-sort-row {
  display: flex;
  align-items: center;
}

#balances-panel .balances-search-field,
#bills-panel .bills-search-field,
#bills-panel .bills-date-range-field {
  height: 42px;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--bill-border);
  border-radius: 10px;
  background: #fff;
}

#balances-panel input,
#balances-panel select,
#bills-panel input,
#balances-panel select,
#bills-panel select {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--bill-border);
  border-radius: 10px;
  background: #fff;
  color: var(--bill-text);
  font-size: 14px;
}

#bills-panel select {
  appearance: none;
  padding: 0 34px 0 12px;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

#balances-panel .balances-search-field input,
#bills-panel .bills-search-field input,
#bills-panel .bills-date-range-field input {
  flex: 1;
  height: 38px;
  border: 0;
  padding: 0;
  background: transparent;
}

#bills-panel .bills-quick-times {
  display: none;
}

#balances-panel .balances-filter-drawer.hidden,
#bills-panel .bills-filter-drawer.hidden {
  display: none;
}

#balances-panel .balances-filter-drawer,
#bills-panel .bills-filter-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
}

#balances-panel .balances-filter-drawer-backdrop,
#bills-panel .bills-filter-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
}

#balances-panel .balances-filter-drawer-panel,
#bills-panel .bills-filter-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(430px, 92vw);
  height: 100%;
  padding: 22px;
  background: #fff;
  box-shadow: -18px 0 40px rgba(15, 23, 42, 0.18);
}

#balances-panel .balances-filter-drawer-header,
#balances-panel .balances-filter-drawer-actions,
#bills-panel .bills-filter-drawer-header,
#bills-panel .bills-filter-drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#balances-panel .balances-filter-grid,
#bills-panel .bills-filter-grid {
  display: grid;
  gap: 14px;
  overflow-y: auto;
  padding: 18px 0;
}

#balances-panel .balances-filter-grid label,
#bills-panel .bills-filter-grid label {
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
  color: var(--bill-muted);
  font-size: 13px;
  font-weight: 700;
}

#balances-panel .balances-filter-grid input,
#balances-panel .balances-filter-grid select,
#bills-panel .bills-filter-grid input,
#bills-panel .bills-filter-grid select {
  width: 100%;
}

#balances-panel .balances-amount-range,
#balances-panel .balances-sort-row,
#bills-panel .bills-amount-range,
#bills-panel .bills-sort-row {
  gap: 8px;
}

#balances-panel #balances-summary,
#bills-panel #bills-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

#balances-panel #balances-summary.hidden,
#bills-panel #bills-summary.hidden {
  display: none;
}

#balances-panel #balances-summary .summary-card,
#bills-panel #bills-summary .summary-card {
  min-height: 116px;
  border: 0;
  border-radius: 12px;
  box-shadow: none;
}

#balances-panel #balances-summary .summary-card-total,
#bills-panel #bills-summary .summary-card-total {
  background: linear-gradient(135deg, #eff6ff, #fff);
}

#balances-panel #balances-summary .summary-card-income,
#bills-panel #bills-summary .summary-card-income {
  background: linear-gradient(135deg, #ecfdf5, #fff);
}

#balances-panel #balances-summary .summary-card-expense,
#bills-panel #bills-summary .summary-card-expense {
  background: linear-gradient(135deg, #fef2f2, #fff);
}

#bills-panel #bills-summary .summary-card-net {
  background: linear-gradient(135deg, #f5f3ff, #fff);
}

#balances-panel .balances-table-shell,
#bills-panel .bills-table-shell {
  overflow-x: auto;
}

#bills-panel .bills-table-shell {
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
}

/* Bills table toolbar (batch entry button) */
#bills-panel .bills-table-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 12px 0;
}

/* Batch toolbar */
#bills-panel .bills-batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
  background: #F8FAFC;
  border: 1px solid #E5EAF3;
  border-bottom: 1px solid #E5EAF3;
  border-radius: 12px 12px 0 0;
}

#bills-panel .bills-batch-toolbar.hidden {
  display: none;
}

#bills-panel .bills-batch-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

#bills-panel #bills-batch-status {
  font-size: 14px;
  font-weight: 600;
  color: #0F172A;
}

#bills-panel #bills-batch-clear-button {
  color: var(--bill-blue);
  font-weight: 600;
  font-size: 13px;
}

#bills-panel #bills-batch-clear-button.hidden {
  display: none;
}

#bills-panel .bills-batch-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#bills-panel .bills-batch-right button {
  height: 36px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 8px;
}

#bills-panel .bills-batch-right button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#bills-panel .danger-outline-button {
  border: 1px solid #fecaca;
  background: #fff;
  color: #DC2626;
}

#bills-panel .danger-outline-button:hover {
  background: #fff1f2;
}

#bills-panel .bill-batch-tag-anchor {
  position: relative;
}

/* Batch delete confirmation */
#bills-panel .bills-batch-delete-confirm {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  margin-top: 4px;
  border-radius: 8px;
  background: #FFF1F0;
  border: 1px solid #FFCCC7;
  font-size: 14px;
  color: #DC2626;
}

#bills-panel .bills-batch-delete-confirm.hidden {
  display: none;
}

#bills-panel .bills-batch-delete-confirm span {
  flex: 1;
  font-weight: 600;
}

#bills-panel .bills-batch-delete-confirm .ghost-button {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

#bills-panel .bills-batch-delete-confirm .danger-button {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

/* Batch tag popover */
#bills-panel .bills-batch-tag-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 28;
  width: 380px;
  padding: 16px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid #E5EAF3;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

#bills-panel .bills-batch-tag-popover.hidden {
  display: none;
}

#bills-panel .batch-popover-title {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: #0F172A;
}

#bills-panel .batch-popover-hint {
  margin: 4px 0 0 0;
  font-size: 13px;
  line-height: 20px;
  color: #64748B;
}

#bills-panel .batch-popover-hint strong {
  color: var(--bill-blue);
}

#bills-panel .batch-popover-label {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
}

#bills-panel .batch-tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

#bills-panel .batch-tag-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #D8E0EE;
  background: #FFFFFF;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

#bills-panel .batch-tag-option:hover {
  border-color: #2F6BFF;
}

#bills-panel .batch-tag-option.is-selected {
  border-color: #2F6BFF;
  background: #EEF4FF;
  color: #1D4ED8;
  font-weight: 500;
}

#bills-panel .batch-tag-option input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #2F6BFF;
}

#bills-panel .batch-tag-empty {
  margin-top: 8px;
  font-size: 13px;
  color: #94A3B8;
}

#bills-panel .batch-tag-empty.hidden {
  display: none;
}

#bills-panel .batch-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

#bills-panel .batch-popover-actions button {
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
}

#balances-panel .balances-table-shell table,
#bills-panel .bills-table-shell table {
  width: 100%;
  min-width: 1080px;
  table-layout: fixed;
}

/* Default 10-column bill table (no selection column) */
#bills-panel .bills-table-shell th:nth-child(1),
#bills-panel .bills-table-shell td:nth-child(1) {
  width: 96px;
}

#bills-panel .bills-table-shell th:nth-child(2),
#bills-panel .bills-table-shell td:nth-child(2) {
  width: 120px;
}

#bills-panel .bills-table-shell th:nth-child(3),
#bills-panel .bills-table-shell td:nth-child(3) {
  width: 72px;
}

#bills-panel .bills-table-shell th:nth-child(4),
#bills-panel .bills-table-shell td:nth-child(4) {
  width: 120px;
}

#bills-panel .bills-table-shell th:nth-child(5),
#bills-panel .bills-table-shell td:nth-child(5),
#bills-panel .bills-table-shell th:nth-child(6),
#bills-panel .bills-table-shell td:nth-child(6),
#bills-panel .bills-table-shell th:nth-child(7),
#bills-panel .bills-table-shell td:nth-child(7) {
  width: 148px;
}

#bills-panel .bills-table-shell th:nth-child(8),
#bills-panel .bills-table-shell td:nth-child(8) {
  width: 210px;
}

#bills-panel .bills-table-shell th:nth-child(9),
#bills-panel .bills-table-shell td:nth-child(9) {
  width: 124px;
}

#bills-panel .bills-table-shell th:nth-child(10),
#bills-panel .bills-table-shell td:nth-child(10) {
  width: 108px;
}

/* Batch mode: 11-column table (selection + 10 data) */
#bills-panel .bills-table-shell.is-batch-mode th:nth-child(1),
#bills-panel .bills-table-shell.is-batch-mode td:nth-child(1) {
  width: 48px;
}

#bills-panel .bills-table-shell.is-batch-mode th:nth-child(2),
#bills-panel .bills-table-shell.is-batch-mode td:nth-child(2) {
  width: 88px;
}

#bills-panel .bills-table-shell.is-batch-mode th:nth-child(3),
#bills-panel .bills-table-shell.is-batch-mode td:nth-child(3) {
  width: 112px;
}

#bills-panel .bills-table-shell.is-batch-mode th:nth-child(4),
#bills-panel .bills-table-shell.is-batch-mode td:nth-child(4) {
  width: 68px;
}

#bills-panel .bills-table-shell.is-batch-mode th:nth-child(5),
#bills-panel .bills-table-shell.is-batch-mode td:nth-child(5) {
  width: 112px;
}

#bills-panel .bills-table-shell.is-batch-mode th:nth-child(6),
#bills-panel .bills-table-shell.is-batch-mode td:nth-child(6),
#bills-panel .bills-table-shell.is-batch-mode th:nth-child(7),
#bills-panel .bills-table-shell.is-batch-mode td:nth-child(7),
#bills-panel .bills-table-shell.is-batch-mode th:nth-child(8),
#bills-panel .bills-table-shell.is-batch-mode td:nth-child(8) {
  width: 138px;
}

#bills-panel .bills-table-shell.is-batch-mode th:nth-child(9),
#bills-panel .bills-table-shell.is-batch-mode td:nth-child(9) {
  width: 196px;
}

#bills-panel .bills-table-shell.is-batch-mode th:nth-child(10),
#bills-panel .bills-table-shell.is-batch-mode td:nth-child(10) {
  width: 116px;
}

#bills-panel .bills-table-shell.is-batch-mode th:nth-child(11),
#bills-panel .bills-table-shell.is-batch-mode td:nth-child(11) {
  width: 100px;
}

#balances-panel .balances-table-shell th,
#balances-panel .balances-table-shell td,
#bills-panel .bills-table-shell th,
#bills-panel .bills-table-shell td {
  height: 56px;
  white-space: nowrap;
}

#balances-panel .balance-amount-cell,
#bills-panel .bill-amount-cell {
  font-weight: 800;
}

#bills-panel .amount-income {
  color: var(--bill-green);
}

#bills-panel .amount-expense {
  color: var(--bill-red);
}

#bills-panel .bill-type-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

#bills-panel .bill-type-income {
  background: #dcfce7;
  color: #15803d;
}

#bills-panel .bill-type-expense {
  background: #fee2e2;
  color: #dc2626;
}

#bills-panel .bill-platform-chip {
  gap: 6px;
  background: transparent;
  color: var(--bill-text);
}

#bills-panel .platform-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bill-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

#bills-panel .platform-alipay .platform-icon {
  background: #1677ff;
}

#bills-panel .platform-wechat .platform-icon {
  background: #16a34a;
}

#bills-panel .platform-douyin .platform-icon {
  background: #111827;
}

#bills-panel .platform-cash .platform-icon {
  background: #f59e0b;
}

#bills-panel .bill-remark-cell {
  max-width: 210px;
}

#bills-panel .bill-remark-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#bills-panel .actions-cell {
  min-width: 124px;
}

#balances-panel .pagination-bar,
#bills-panel .pagination-bar {
  margin-top: 0;
  padding: 10px 0 0;
}

@media (max-width: 720px) {
  .app-shell:has(#balances-panel:not(.hidden)) .topbar {
    display: none;
  }

  #balances-panel {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    margin: 0;
    overflow-x: hidden;
  }

  #balances-panel .balances-page {
    gap: 12px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  #balances-panel .balances-mobile-head {
    position: sticky;
    top: 0;
    z-index: 15;
    order: -2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 4px 2px;
    background: var(--bill-bg);
  }

  #balances-panel .mobile-head-actions,
  #bills-panel .mobile-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  #balances-panel .finance-mobile-title,
  #bills-panel .finance-mobile-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  #balances-panel .finance-mobile-menu-button,
  #bills-panel .finance-mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    width: 38px;
    min-height: 38px;
    height: 38px;
    padding: 0;
    border-radius: 8px;
  }

  #balances-panel .balances-mobile-head h3 {
    margin: 0;
    font-size: 20px;
  }

  #balances-panel .balances-mobile-add {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
  }

  #balances-panel .balances-group-card {
    order: -1;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 12px;
    padding: 14px;
  }

  #bills-panel .bills-group-card,
  #balances-panel .balances-group-card {
    min-height: 66px;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  }

  #balances-panel .balances-filter-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 12px;
    padding: 14px;
  }

  #balances-panel .balances-group-actions {
    display: none;
  }

  #balances-panel .balances-group-card h3 {
    font-size: 17px;
  }

  #balances-panel .balances-subview-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-top: 0;
  }

  #balances-panel .balances-subview-tabs .subview-tab {
    min-width: 0;
    padding: 8px 10px;
    white-space: nowrap;
  }

  #balances-panel .balances-primary-filter {
    grid-template-columns: minmax(0, 1fr) 78px;
    gap: 10px;
  }

  #balances-panel #balances-platform-filter,
  #balances-panel #balances-search-button {
    display: none;
  }

  #balances-panel #balances-more-filter-button {
    width: 78px;
    min-width: 78px;
    padding: 0;
    font-size: 0;
  }

  #balances-panel #balances-more-filter-button::before {
    content: "筛选";
    font-size: 14px;
  }

  #balances-panel #balances-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    padding-bottom: 2px;
  }

  #balances-panel #balances-summary .summary-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 78px;
    padding: 10px;
  }

  #balances-panel #balances-summary .summary-card strong {
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  #balances-panel .balances-table-shell {
    display: none;
  }

  #balances-panel .balances-mobile-list {
    display: grid;
    gap: 10px;
  }

  #balances-panel .pagination-bar,
  #bills-panel .pagination-bar {
    display: grid;
    grid-template-columns: minmax(78px, auto) minmax(0, 1fr) minmax(78px, auto);
    align-items: center;
    gap: 8px;
  }

  #balances-panel .pagination-bar {
    grid-template-columns: minmax(70px, auto) minmax(0, 1fr) minmax(70px, auto);
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #balances-panel .pagination-bar .ghost-button,
  #bills-panel .pagination-bar .ghost-button {
    width: auto;
  }

  #balances-panel .balances-mobile-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid rgba(219, 229, 242, 0.96);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  }

  #balances-panel .balances-mobile-card-main {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 14px 34px 14px 12px;
    border: 0;
    background: transparent;
    color: var(--bill-text);
    text-align: left;
  }

  #balances-panel .balances-mobile-card-platform,
  #balances-panel .balances-mobile-card-owner,
  #balances-panel .balances-mobile-card-remark {
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #balances-panel .balances-mobile-card-account {
    overflow: hidden;
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #balances-panel .balances-mobile-card-amount {
    justify-self: end;
    max-width: 100%;
    min-width: 0;
    font-size: 16px;
    font-weight: 900;
    overflow-wrap: anywhere;
    text-align: right;
  }

  #balances-panel .balances-mobile-card-remark {
    grid-column: 1 / -1;
  }

  #balances-panel .balances-mobile-card-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    color: #64748b;
    font-size: 22px;
    transform: translateY(-50%);
  }

  #balances-panel .balances-filter-drawer-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(82dvh, 660px);
    border-radius: 18px 18px 0 0;
    padding: 18px;
  }

  #balances-panel .balances-filter-drawer-actions {
    padding-top: 10px;
  }

  #balances-panel .balances-filter-drawer-actions .ghost-button,
  #balances-panel .balances-filter-drawer-actions .primary-button {
    flex: 1;
  }

  .app-shell:has(#bills-panel:not(.hidden)) .topbar {
    display: none;
  }

  #bills-panel {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    margin: 0;
    overflow-x: hidden;
  }

  #bills-panel .bills-page {
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  #bills-panel .bills-mobile-head {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 4px 2px;
    background: var(--bill-bg);
    order: -2;
  }

  #bills-panel .bills-group-card {
    order: -1;
  }

  #bills-panel .bills-mobile-head h3 {
    margin: 0;
    font-size: 20px;
  }

  #bills-panel .bills-mobile-add {
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
  }

  #balances-panel .balances-mobile-action-menu .icon-only-button,
  #bills-panel .bills-mobile-action-menu .icon-only-button {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    font-size: 22px;
  }

  #balances-panel .balances-mobile-action-menu .balances-action-menu-panel,
  #bills-panel .bills-mobile-action-menu .bills-action-menu-panel {
    right: 0;
    width: 180px;
  }

  #bills-panel .bills-group-card,
  #bills-panel .bills-filter-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 12px;
    padding: 14px;
  }

  #bills-panel .bills-group-card {
    align-items: flex-start;
  }

  #bills-panel .bills-group-actions {
    display: none;
  }

  #bills-panel .bills-group-card h3 {
    font-size: 17px;
  }

  #bills-panel .bills-primary-filter {
    grid-template-columns: minmax(0, 1fr) 78px;
    gap: 10px;
  }

  #bills-panel .bills-date-range-field,
  #bills-panel #bills-type-filter,
  #bills-panel #bills-search-button {
    display: none;
  }

  #bills-panel #bills-more-filter-button {
    width: 78px;
    min-width: 78px;
    padding: 0;
    font-size: 14px;
  }

  #bills-panel #bills-more-filter-button::before {
    content: "筛选";
  }

  #bills-panel #bills-more-filter-button {
    font-size: 0;
  }

  #bills-panel #bills-more-filter-button::before {
    font-size: 14px;
  }

  #bills-panel .bills-quick-times {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-top: 12px;
  }

  #bills-panel .bills-quick-time {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    font-weight: 700;
  }

  #bills-panel .bills-quick-time.active {
    background: #eaf2ff;
    color: var(--bill-blue);
  }

  #bills-panel #bills-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow-x: hidden;
    padding-bottom: 2px;
  }

  #bills-panel #bills-summary .summary-card {
    min-width: 0;
    min-height: 78px;
    padding: 10px;
  }

  #bills-panel #bills-summary .summary-card strong {
    font-size: 16px;
    overflow-wrap: anywhere;
  }

  #bills-panel #bills-summary .summary-card-total {
    display: none;
  }

  #bills-panel .bills-table-shell {
    display: none;
  }

  #bills-panel .bills-mobile-list {
    display: grid;
    gap: 10px;
  }

  #bills-panel .bills-mobile-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid rgba(219, 229, 242, 0.96);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  }

  #bills-panel .bills-mobile-card-main {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 14px 34px 14px 12px;
    border: 0;
    background: transparent;
    color: var(--bill-text);
    text-align: left;
  }

  #bills-panel .bills-mobile-card-date {
    color: #64748b;
    font-size: 12px;
  }

  #bills-panel .bills-mobile-card-amount {
    grid-column: 2;
    justify-self: end;
    font-size: 16px;
    font-weight: 900;
  }

  #bills-panel .bills-mobile-card-category,
  #bills-panel .bills-mobile-card-platform-category,
  #bills-panel .bills-mobile-card-owner,
  #bills-panel .bills-mobile-card-remark {
    grid-column: 1 / -1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #bills-panel .bills-mobile-card-category {
    font-size: 14px;
    font-weight: 800;
  }

  #bills-panel .bills-mobile-card-owner,
  #bills-panel .bills-mobile-card-platform-category,
  #bills-panel .bills-mobile-card-remark {
    color: #64748b;
    font-size: 12px;
  }

  #bills-panel .bills-mobile-card-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    color: #64748b;
    font-size: 22px;
    transform: translateY(-50%);
  }

  #bills-panel .bills-filter-drawer-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(82dvh, 660px);
    border-radius: 18px 18px 0 0;
    padding: 18px;
  }

  #bills-panel .bills-filter-drawer-actions {
    padding-top: 10px;
  }

  #bills-panel .bills-filter-drawer-actions .ghost-button,
  #bills-panel .bills-filter-drawer-actions .primary-button {
    flex: 1;
  }
}

.mobile-workbench-label {
  display: none;
}

@media (max-width: 720px) {
  body {
    background: #f6f9ff;
    color: #0f172a;
  }

  .content-shell {
    padding: calc(8px + env(safe-area-inset-top)) 10px calc(86px + env(safe-area-inset-bottom));
    gap: 10px;
    background: #f6f9ff;
  }

  .topbar {
    min-height: 54px;
    padding: 8px 10px;
    border: 1px solid rgba(219, 229, 242, 0.96);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
  }

  .topbar-title-row {
    gap: 8px;
    min-width: 0;
  }

  .topbar-title-row > div {
    display: none;
  }

  .mobile-workbench-label {
    display: inline-flex;
    align-items: center;
    height: 36px;
    color: #10213f;
    font-size: 16px;
    font-weight: 900;
  }

  .mobile-nav-button,
  .finance-mobile-menu-button {
    border: 1px solid rgba(219, 229, 242, 0.96);
    border-radius: 10px;
    background: #fff;
    color: #10213f;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  }

  .topbar-actions {
    gap: 8px;
  }

  .topbar .group-switcher-shell,
  .topbar .user-chip-copy {
    display: none;
  }

  .notification-button,
  .user-avatar {
    width: 34px;
    min-width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #eef5ff;
    color: #2563eb;
  }

  .panel,
  .card,
  .groups-dashboard {
    border-radius: 14px;
  }

  .groups-dashboard,
  .group-context-card,
  .entity-card,
  .form-card {
    border: 1px solid rgba(219, 229, 242, 0.96);
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  }

  .groups-command-bar,
  .toolbar,
  .finance-toolbar {
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(219, 229, 242, 0.96);
    border-radius: 14px;
    background: #fff;
  }

  .group-metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .group-metric-card {
    grid-template-columns: 1fr;
    gap: 6px;
    min-width: 0;
    padding: 10px 8px;
    border-radius: 12px;
    background: #f8fbff;
  }

  .group-metric-card .metric-icon {
    width: 30px;
    height: 30px;
  }

  .group-metric-card span,
  .group-metric-card small {
    font-size: 11px;
  }

  .group-metric-card strong {
    font-size: 18px;
  }

  .table-shell tbody tr {
    border: 1px solid rgba(219, 229, 242, 0.96);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  }

  .table-shell tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid #eef3fb;
  }

  .table-shell tbody td::before {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
  }

  .app-shell:has(#balances-panel:not(.hidden)) .topbar,
  .app-shell:has(#bills-panel:not(.hidden)) .topbar {
    display: none;
  }

  .finance-mobile-head,
  #balances-panel .balances-mobile-head,
  #bills-panel .bills-mobile-head {
    position: sticky;
    top: 0;
    z-index: 18;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 54px;
    padding: 6px 0 8px;
    background: #f6f9ff;
  }

  .finance-mobile-title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }

  .finance-mobile-workbench {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(219, 229, 242, 0.96);
    border-radius: 10px;
    background: #fff;
    color: #10213f;
    font-size: 15px;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  }

  .finance-mobile-group-pill {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-width: 0;
    height: 42px;
    padding: 5px 10px 5px 7px;
    border: 1px solid #d7e6ff;
    border-radius: 12px;
    background: #eef5ff;
    color: #2563eb;
    text-align: left;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
  }

  .finance-mobile-group-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
  }

  .finance-mobile-group-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
  }

  .finance-mobile-group-copy strong,
  .finance-mobile-group-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .finance-mobile-group-copy strong {
    font-size: 12px;
    font-weight: 900;
    line-height: 1.15;
  }

  .finance-mobile-group-copy small {
    color: #4775c9;
    font-size: 10px;
    font-weight: 800;
  }

  #balances-panel .balances-group-card,
  #bills-panel .bills-group-card {
    display: none;
  }

  #balances-panel .balances-group-card {
    display: none;
  }

  #bills-panel .bills-group-card {
    display: none;
  }

  #balances-panel .balances-page,
  #bills-panel .bills-page {
    gap: 10px;
    background: #f6f9ff;
  }

  #balances-panel .balances-filter-card,
  #bills-panel .bills-filter-card {
    padding: 10px;
    border: 1px solid rgba(219, 229, 242, 0.96);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  }

  #balances-panel .balances-primary-filter,
  #bills-panel .bills-primary-filter {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 8px;
  }

  #balances-panel .balances-search-field,
  #bills-panel .bills-search-field {
    min-height: 40px;
    border: 1px solid #dbe5f2;
    border-radius: 10px;
    background: #f8fbff;
  }

  #balances-panel #balances-more-filter-button,
  #bills-panel #bills-more-filter-button {
    height: 40px;
    min-height: 40px;
    border-radius: 10px;
    background: #fff;
    color: #10213f;
  }

  #balances-panel #balances-summary,
  #bills-panel #bills-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow-x: hidden;
  }

  #balances-panel #balances-summary .summary-card,
  #bills-panel #bills-summary .summary-card {
    min-width: 0;
    min-height: 72px;
    padding: 10px 8px;
    border: 1px solid rgba(219, 229, 242, 0.96);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  }

  #balances-panel #balances-summary .summary-card small,
  #bills-panel #bills-summary .summary-card small {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
  }

  #balances-panel #balances-summary .summary-card strong,
  #bills-panel #bills-summary .summary-card strong {
    font-size: 15px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  #balances-panel .balances-subview-tabs,
  #bills-panel .bills-quick-times {
    padding: 3px;
    border: 1px solid #dbe5f2;
    border-radius: 12px;
    background: #edf4ff;
  }

  #balances-panel .balances-subview-tabs .subview-tab,
  #bills-panel .bills-quick-times .ghost-button {
    min-height: 34px;
    border-radius: 9px;
    color: #315070;
    font-weight: 900;
  }

  #balances-panel .balances-subview-tabs .subview-tab.active,
  #bills-panel .bills-quick-times .ghost-button.active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.08);
  }

  #balances-panel .balances-mobile-card,
  #bills-panel .bills-mobile-card {
    border: 1px solid rgba(219, 229, 242, 0.96);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  }

  #balances-panel .balances-mobile-card-main,
  #bills-panel .bills-mobile-card-main {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 34px 14px 12px;
  }

  #balances-panel .balances-mobile-card-amount,
  #bills-panel .bills-mobile-card-amount {
    justify-self: end;
    color: #0f172a;
    font-size: 16px;
    font-weight: 900;
  }

  #balances-panel .balances-mobile-card-title,
  #bills-panel .bills-mobile-card-category {
    color: #10213f;
    font-size: 14px;
    font-weight: 900;
  }

  #balances-panel .pagination-bar,
  #bills-panel .pagination-bar {
    grid-template-columns: minmax(70px, auto) minmax(0, 1fr) minmax(70px, auto);
    max-width: 100%;
    padding: 4px 0 0;
  }

  .app-bottom-nav {
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 12px;
    min-height: 60px;
    padding: 6px;
    border: 1px solid rgba(219, 229, 242, 0.96);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.13);
  }

  .app-bottom-nav button {
    min-height: 48px;
    border-radius: 12px;
    color: #60708a;
    font-size: 11px;
    font-weight: 900;
  }

  .app-bottom-nav button::before {
    width: 24px;
    height: 24px;
    border-radius: 8px;
  }

  .app-bottom-nav button.active {
    background: #eef5ff;
    color: #2563eb;
  }

  .app-bottom-nav button.active::before {
    background: #2563eb;
    color: #fff;
  }
}

@media (max-width: 720px) {
  .topbar {
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
  }

  .finance-mobile-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }
}

.entity-cell {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.entity-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #eaf2ff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
}

.group-avatar {
  background: #2563eb;
  color: #fff;
}

.tag-avatar {
  background: #f1f5f9;
  color: #64748b;
}

.entity-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.entity-copy strong,
.entity-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-copy strong {
  color: #10213f;
  font-size: 14px;
  font-weight: 900;
}

.entity-copy small {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.entity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.entity-tags em,
.permission-access {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef5ff;
  color: #2563eb;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.permission-access.access-write {
  background: #fff7ed;
  color: #ea580c;
}

.permission-access.access-admin {
  background: #fff1f2;
  color: #e11d48;
}

@media (max-width: 720px) {
  .sidebar {
    width: min(390px, 92vw);
    padding: calc(14px + env(safe-area-inset-top)) 14px calc(18px + env(safe-area-inset-bottom));
    gap: 14px;
    background: #f6f8fc;
    color: #10213f;
    border-right: 1px solid #e5eaf3;
  }

  .sidebar-brand {
    display: none;
  }

  .sidebar-section {
    gap: 8px;
  }

  .sidebar-section-label {
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: #2563eb;
    font-size: 13px;
    font-weight: 900;
  }

  .sidebar-current-group {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dbe7f8;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #2f6bff);
    color: #fff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
  }

  .sidebar-current-group-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    font-weight: 900;
  }

  .sidebar-current-group strong,
  .sidebar-current-group span {
    color: #fff;
  }

  .sidebar-current-group span {
    display: block;
    font-size: 12px;
    opacity: 0.82;
  }

  .drawer-group-list {
    gap: 8px;
  }

  .drawer-group-list .group-switcher-item {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    min-height: 54px;
    padding: 9px 10px;
    border: 1px solid #e5eaf3;
    border-radius: 12px;
    background: #fff;
    color: #10213f;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  }

  .drawer-group-list .group-switcher-item.active {
    border-color: #bfdbfe;
    background: #eef5ff;
    color: #2563eb;
  }

  .group-switcher-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
  }

  .group-switcher-copy small,
  .drawer-group-recent {
    color: #64748b;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
  }

  .workspace-drawer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .workspace-drawer-actions [data-route="groups"] {
    grid-column: 1 / -1;
  }

  .workspace-drawer-actions .ghost-button,
  .workspace-drawer-actions .primary-button {
    min-height: 40px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 900;
  }

  .tree-nav {
    gap: 8px;
  }

  .tree-item {
    min-height: 48px;
    padding: 10px 34px 10px 44px;
    border: 1px solid #e5eaf3;
    border-radius: 12px;
    background: #fff;
    color: #10213f;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  }

  .tree-item::before {
    left: 14px;
    top: 13px;
    color: #2563eb;
  }

  .tree-item::after {
    content: "›";
    position: absolute;
    right: 13px;
    top: 11px;
    color: #94a3b8;
    font-size: 20px;
  }

  .tree-item small {
    display: none;
  }

  .tree-item.active {
    border-color: #bfdbfe;
    background: #eef5ff;
    color: #2563eb;
    box-shadow: inset 3px 0 0 #2563eb, 0 8px 18px rgba(37, 99, 235, 0.08);
  }

  .sidebar-footnote {
    display: none;
  }

  .mobile-segment-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid #e5eaf3;
    border-radius: 12px;
    background: #eef4fb;
  }

  .mobile-segment-tabs button {
    min-height: 34px;
    border-radius: 9px;
    background: transparent;
    color: #53627a;
    font-size: 13px;
    font-weight: 900;
  }

  .mobile-segment-tabs button.active {
    background: #fff;
    color: #2563eb;
    box-shadow: 0 5px 12px rgba(37, 99, 235, 0.08);
  }

  .overview-mobile-dashboard {
    display: grid;
    gap: 12px;
  }

  .overview-hero-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #2f6bff);
    color: #fff;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
  }

  .overview-hero-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    font-weight: 900;
  }

  .overview-hero-card strong,
  .overview-hero-card small,
  .overview-hero-card em {
    display: block;
    color: #fff;
    font-style: normal;
  }

  .overview-hero-card strong {
    font-size: 18px;
    font-weight: 900;
  }

  .overview-hero-card small,
  .overview-hero-card em {
    font-size: 12px;
    opacity: 0.86;
  }

  .overview-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .overview-stats-grid .stat-card {
    min-width: 0;
    padding: 10px 8px;
    border-radius: 12px;
  }

  .overview-stats-grid .stat-card span {
    font-size: 11px;
  }

  .overview-stats-grid .stat-card strong {
    font-size: 18px;
  }

  .overview-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .overview-quick-actions button {
    min-height: 64px;
    padding: 8px 6px;
    border: 1px solid #e5eaf3;
    border-radius: 12px;
    background: #fff;
    color: #10213f;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  }

  .current-group-row {
    border-color: #bfdbfe !important;
    background: #f8fbff !important;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.1) !important;
  }

  .table-shell tbody tr.group-row td[data-label="Group ID"],
  .table-shell tbody tr.group-row td[data-label="描述"],
  .table-shell tbody tr.group-row td[data-label="更新时间"],
  .table-shell tbody tr.member-row td[data-label="User ID"],
  .table-shell tbody tr.member-row td[data-label="用户名"],
  .table-shell tbody tr.member-row td[data-label="邮箱"],
  .table-shell tbody tr.user-row td[data-label="User ID"],
  .table-shell tbody tr.user-row td[data-label="用户名"],
  .table-shell tbody tr.user-row td[data-label="邮箱"],
  .table-shell tbody tr.user-row td[data-label="创建时间"] {
    display: none;
  }

  .entity-cell {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .table-shell tbody td:has(.entity-cell) {
    display: block;
  }

  .table-shell tbody td:has(.entity-cell)::before,
  .table-shell tbody td.actions-cell::before {
    display: none;
  }

  .table-shell tbody td.actions-cell {
    display: flex;
    justify-content: flex-end;
    padding-top: 0;
    border-bottom: 0;
  }

  .row-actions .compact-button,
  .row-actions .link-button,
  .table-action,
  .danger-button.table-action {
    min-height: 30px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 12px;
  }

  .pagination-bar {
    grid-template-columns: minmax(58px, auto) minmax(0, 1fr) minmax(58px, auto);
    align-items: center;
    gap: 8px;
    padding: 4px 0;
  }

  .pagination-bar .ghost-button,
  .pagination-bar .pager-button {
    width: auto;
    min-width: 58px;
    height: 34px;
    min-height: 34px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 12px;
  }

  .pagination-bar span {
    justify-self: center;
    font-size: 12px;
  }

  #tags-panel #tag-form {
    padding: 10px;
    border: 1px solid #e5eaf3;
    border-radius: 14px;
    background: #fff;
  }

  #group-finance-summary.finance-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .audit-row {
    position: relative;
    padding-left: 16px;
  }

  .audit-row::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 0 0 4px #eaf2ff;
  }
}

@media (max-width: 720px) {
  .content-shell {
    padding: calc(8px + env(safe-area-inset-top)) 16px calc(86px + env(safe-area-inset-bottom));
    gap: 12px;
    background: #f6f8fc;
  }

  body.nexus-android-app .content-shell {
    max-width: 414px;
  }

  .topbar,
  .finance-mobile-head,
  #balances-panel .balances-mobile-head,
  #bills-panel .bills-mobile-head {
    min-height: 56px;
  }

  .topbar {
    padding: 8px 10px;
    border-color: #e5eaf3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  }

  .finance-mobile-head,
  #balances-panel .balances-mobile-head,
  #bills-panel .bills-mobile-head {
    grid-template-columns: auto minmax(0, 1fr) 34px;
    gap: 8px;
    padding: 0 0 10px;
  }

  .finance-mobile-workbench,
  .finance-mobile-menu-button {
    height: 36px;
    min-height: 36px;
    border-radius: 10px;
  }

  .finance-mobile-group-pill {
    height: 40px;
    padding: 5px 9px 5px 6px;
    border-radius: 12px;
    background: #eef5ff;
  }

  .finance-mobile-notification-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    border: 1px solid #e5eaf3;
    border-radius: 50%;
    background: #fff;
    color: #0f1f3a;
    font-size: 15px;
    font-weight: 900;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
  }

  .finance-mobile-notification-button::before {
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 9px 9px 5px 5px;
    content: "";
    transform: translateY(1px);
  }

  .finance-mobile-notification-button::after {
    position: absolute;
    bottom: 8px;
    width: 5px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
  }

  #balances-panel .balances-mobile-add,
  #bills-panel .bills-mobile-add,
  #balances-panel .balances-mobile-action-menu,
  #bills-panel .bills-mobile-action-menu {
    display: none;
  }

  #balances-panel .balances-page,
  #bills-panel .bills-page {
    gap: 12px;
  }

  #balances-panel .balances-subview-tabs,
  #bills-panel .bills-quick-times,
  .mobile-segment-tabs {
    border-radius: 12px;
    background: #eef4fb;
  }

  #balances-panel .balances-filter-card,
  #bills-panel .bills-filter-card,
  .groups-command-bar,
  .toolbar,
  .finance-toolbar {
    padding: 10px;
    border: 1px solid #e5eaf3;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  }

  #balances-panel .balances-primary-filter,
  #bills-panel .bills-primary-filter {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 8px;
  }

  #balances-panel #balances-summary,
  #bills-panel #bills-summary,
  #group-finance-summary.finance-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  #balances-panel #balances-summary .summary-card,
  #bills-panel #bills-summary .summary-card,
  #group-finance-summary.finance-summary .summary-card {
    min-height: 72px;
    padding: 10px 8px;
    border: 1px solid #e5eaf3;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  }

  #balances-panel .balances-mobile-list,
  #bills-panel .bills-mobile-list {
    gap: 10px;
  }

  #balances-panel .balances-mobile-card,
  #bills-panel .bills-mobile-card,
  .table-shell tbody tr {
    border: 1px solid rgba(219, 229, 242, 0.96);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  }

  #balances-panel .balances-mobile-card-main {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 14px 32px 14px 12px;
  }

  #balances-panel .balances-mobile-card-title {
    grid-column: 1;
    color: #10213f;
    font-size: 15px;
    font-weight: 900;
  }

  #balances-panel .balances-mobile-card-platform {
    grid-column: 1;
    width: fit-content;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef5ff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 900;
  }

  #balances-panel .balances-mobile-card-amount {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    font-size: 16px;
  }

  #balances-panel .balances-mobile-card-meta-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 12px;
    margin-top: 4px;
  }

  #balances-panel .balances-mobile-card-meta-grid span {
    display: grid;
    gap: 1px;
    min-width: 0;
  }

  #balances-panel .balances-mobile-card-meta-grid em {
    color: #8b9ab2;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
  }

  #balances-panel .balances-mobile-card-meta-grid strong {
    overflow: hidden;
    color: #53627a;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #balances-panel .balances-mobile-card-tags {
    grid-column: 1 / -1;
  }

  #balances-panel .pagination-bar,
  #bills-panel .pagination-bar {
    grid-template-columns: minmax(32px, auto) minmax(0, 1fr) minmax(32px, auto);
    padding: 0 2px;
  }

  #balances-panel .pagination-bar .ghost-button,
  #bills-panel .pagination-bar .ghost-button {
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0 8px;
    border-radius: 10px;
  }

  .table-shell tbody tr.group-row td[data-label="成员数"],
  .table-shell tbody tr.group-row td[data-label="我的角色"],
  .table-shell tbody tr.group-row td[data-label="状态"],
  .table-shell tbody tr.member-row td[data-label="全局角色"],
  .table-shell tbody tr.member-row td[data-label="组内角色"],
  .table-shell tbody tr.member-row td[data-label="状态"],
  .table-shell tbody tr.user-row td[data-label="全局角色"],
  .table-shell tbody tr.user-row td[data-label="状态"] {
    display: none;
  }
}

/* P0 console unification: keep the final cascade aligned with the required tokens. */
body {
  overflow-x: hidden;
  background: #F6F8FC;
}

.card {
  border-radius: 12px;
  background: #fff;
}

.primary-button {
  min-height: 40px;
  background: #2563EB;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.danger-button {
  min-height: 40px;
  background: #dc2626;
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.16);
}

tbody td {
  height: 56px;
}

.actions-cell {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  box-shadow: -10px 0 18px rgba(15, 23, 42, 0.04);
}

tbody tr:hover .actions-cell {
  background: #fbfdff;
}

.pill.status-active,
.pill.status-approved,
.status-chip.status-active {
  background: #dcfce7;
  color: #15803d;
}

.pill.status-pending,
.pill.status-warning,
.status-chip.status-pending,
.status-chip.status-warning {
  background: #ffedd5;
  color: #c2410c;
}

.pill.status-disabled,
.pill.status-deleted,
.status-chip.status-disabled,
.status-chip.status-deleted {
  background: #f1f5f9;
  color: #475569;
}

.pill.status-rejected,
.pill.status-removed,
.status-chip.status-rejected,
.status-chip.status-removed {
  background: #fee2e2;
  color: #dc2626;
}

.finance-amount-cell,
.bill-amount-cell,
.balance-amount-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 920px) {
  .sidebar {
    position: fixed;
  }
}

@media (max-width: 720px) {
  .global-search-field {
    display: none;
  }

  .actions-cell {
    position: static;
    background: transparent;
    box-shadow: none;
  }

  body tbody td {
    height: auto;
  }
}

.pill.status-active {
  background: #dcfce7;
  color: #15803d;
}

.pill.status-pending {
  background: #ffedd5;
  color: #c2410c;
}

.pill.status-disabled {
  background: #f1f5f9;
  color: #475569;
}

.pill.status-rejected {
  background: #fee2e2;
  color: #dc2626;
}
