:root {
  --bg: #edf7ff;
  --bg-soft: #fff3f8;
  --surface: rgba(255, 255, 255, .94);
  --surface-strong: rgba(255, 255, 255, .98);
  --surface-accent: rgba(239, 251, 255, .96);
  --text: #172136;
  --muted: #536173;
  --line: rgba(27, 139, 204, .26);
  --line-strong: rgba(255, 116, 55, .52);
  --shadow: 0 16px 34px rgba(22, 70, 120, .16);
  --shadow-strong: 0 20px 46px rgba(31, 88, 148, .24);
  --primary: #0f86d8;
  --primary-2: #23c6a9;
  --primary-3: #ff7a3d;
  --success: #07966e;
  --warning: #d47a00;
  --danger: #c92862;
  --info: #315fd4;
  --pink-glow: rgba(255, 45, 122, .22);
  --blue-glow: rgba(0, 178, 255, .2);
  --mint-glow: rgba(28, 205, 142, .18);
  --led-gradient: linear-gradient(120deg, #ff2d7a, #ffb000, #23c66d, #00b7ff, #7a5cff, #ff2d7a);
  --card-rainbow: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(233, 251, 255, .96) 38%, rgba(255, 246, 232, .94) 69%, rgba(255, 240, 248, .96));
  --nav-h: 62px;
  --keyboard-inset: 0px;
  --vvh: 100vh;
  --radius: 18px;
  --font: "Aptos", "Segoe UI", ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #091522;
  --bg-soft: #142132;
  --surface: rgba(19, 30, 46, .94);
  --surface-strong: rgba(25, 38, 58, .98);
  --surface-accent: rgba(28, 45, 67, .97);
  --text: #f7fbff;
  --muted: #b3c3d4;
  --line: rgba(0, 183, 255, .24);
  --line-strong: rgba(255, 176, 0, .42);
  --shadow: 0 20px 46px rgba(0, 6, 18, .34);
  --shadow-strong: 0 24px 56px rgba(0, 6, 18, .42);
  --pink-glow: rgba(255, 45, 122, .2);
  --blue-glow: rgba(0, 183, 255, .18);
  --mint-glow: rgba(35, 198, 109, .14);
  --card-rainbow: linear-gradient(135deg, rgba(23, 37, 58, .98), rgba(20, 50, 66, .96) 38%, rgba(58, 44, 22, .92) 69%, rgba(45, 29, 52, .94));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 45, 122, .18), transparent 26%),
    radial-gradient(circle at 88% 14%, rgba(0, 183, 255, .18), transparent 30%),
    radial-gradient(circle at 22% 88%, rgba(35, 198, 109, .18), transparent 30%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 48%, #eef5ff 100%);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
}

body {
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  position: relative;
}

#app {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 45, 122, .08), transparent 34%),
    linear-gradient(240deg, rgba(255, 176, 0, .1), transparent 38%),
    linear-gradient(300deg, rgba(0, 183, 255, .1), transparent 42%);
  opacity: .36;
  z-index: 0;
}

button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:disabled {
  opacity: .62;
  cursor: wait;
}

.app-shell {
  width: 100%;
  max-width: 100vw;
  min-width: 0;
  min-height: 100vh;
  padding: env(safe-area-inset-top) 12px calc(var(--nav-h) + var(--keyboard-inset) + env(safe-area-inset-bottom) + 14px);
  position: relative;
  z-index: 1;
  overflow-x: hidden;
}

.app-shell.no-bottom-nav {
  padding-bottom: calc(env(safe-area-inset-bottom) + 16px);
}

.keyboard-open .app-shell {
  min-height: var(--vvh);
}

.keyboard-open .bottom-nav {
  display: none;
}

.keyboard-open .screen {
  padding-bottom: calc(var(--keyboard-inset) + 22px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 0;
  padding: 10px 12px;
  margin: 0 -2px 12px;
  border-radius: 24px;
  border: 1px solid rgba(0, 183, 255, .26);
  background:
    var(--card-rainbow),
    linear-gradient(to bottom, var(--bg) 72%, rgba(255, 255, 255, 0));
  box-shadow: var(--shadow);
}

:root[data-theme="dark"] .topbar {
  background:
    var(--card-rainbow),
    linear-gradient(to bottom, var(--bg) 72%, rgba(15, 17, 21, 0));
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.user-led {
  max-width: calc(100% - 94px);
  overflow: hidden;
}

.led-name {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding: 4px 0;
  overflow: hidden;
  color: #c8146e;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow:
    0 0 4px rgba(200, 20, 110, .24),
    0 0 10px rgba(49, 95, 212, .16);
  animation: led-pulse 2.4s ease-in-out infinite;
}

.led-name::after {
  content: attr(data-text);
  position: absolute;
  inset: 4px 0 auto 0;
  max-width: 100%;
  overflow: hidden;
  color: transparent;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 214, 235, .8) 45%, transparent 72%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: led-scan 2.8s linear infinite;
  pointer-events: none;
}

.brand-mark, .avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #ff7a3d, #23c66d 46%, #00b7ff 100%);
  box-shadow: 0 10px 20px rgba(0, 118, 188, .18);
  font-weight: 800;
  font-size: 13px;
}

.brand-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.1;
  font-weight: 800;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-btn, .small-btn {
  border: 1px solid var(--line);
  color: #075b78;
  background: var(--card-rainbow);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 18px rgba(0, 118, 188, .12);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 13px;
  display: grid;
  place-items: center;
}

.icon-btn:hover, .small-btn:hover {
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px rgba(255, 122, 61, .18);
}

.icon-btn:active, .small-btn:active, .btn:active { transform: scale(.97); }

.screen {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  animation: fade-in .2s ease;
}

.hero-balance {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 24px;
  padding: 16px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .22), transparent 42%),
    linear-gradient(135deg, #ff2d7a 0%, #ff7a3d 30%, #23c66d 58%, #00b7ff 78%, #7a5cff 100%);
  box-shadow: 0 18px 34px rgba(0, 118, 188, .24);
}

.hero-balance::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 232, 244, .14) 50%, transparent 100%);
  transform: translateX(-120%);
  animation: hero-sheen 4.2s linear infinite;
  pointer-events: none;
}

.hero-balance .label {
  font-size: 12px;
  opacity: .96;
  font-weight: 700;
}

.hero-balance .amount {
  margin-top: 4px;
  font-size: 25px;
  font-weight: 850;
  line-height: 1.1;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
}

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

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

@media (min-width: 720px) {
  .app-shell { max-width: 980px; margin: 0 auto; }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.stat-card, .panel, .list-card, .empty-state {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--card-rainbow);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.stat-card::before, .panel::before, .list-card::before, .empty-state::before, .modal::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--led-gradient);
  background-size: 280% 280%;
  animation: border-led 3.6s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.topbar, .hero-balance, .modal-head, .compact-section, .member-summary, .member-stat-tile,
.detail-row, .created-va-line, .beneficiary-editor, .done-summary, .bulk-result-row, .setting-note {
  position: relative;
  overflow: hidden;
}

.topbar::before, .hero-balance::before, .modal-head::before, .compact-section::before,
.member-summary::before, .member-stat-tile::before, .detail-row::before, .created-va-line::before,
.beneficiary-editor::before, .done-summary::before, .bulk-result-row::before, .setting-note::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--led-gradient);
  background-size: 280% 280%;
  animation: border-led 3.6s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.stat-card {
  min-height: 74px;
  border-radius: 18px;
  padding: 10px;
  display: grid;
  gap: 5px;
}

.stat-card.primary {
  min-height: 92px;
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, rgba(201, 29, 106, .98), rgba(217, 55, 139, .97) 54%, rgba(72, 99, 215, .95));
  box-shadow: var(--shadow-strong);
}

.stat-card.primary .stat-label,
.stat-card.primary .stat-note {
  color: rgba(255, 247, 252, .88);
}

.stat-card.primary .stat-icon {
  color: var(--primary);
  background: rgba(255, 247, 252, .94);
}

.stat-card.actionable {
  cursor: pointer;
}

.stat-card.actionable:active {
  transform: scale(.98);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-icon {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #cf216f, #df3b8b 54%, #5069da);
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
}

.stat-value {
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.panel {
  border-radius: 22px;
  padding: 13px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
}

.panel-caption {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.withdraw-balance {
  margin: -2px 0 12px;
  font-size: 28px;
  line-height: 1;
  font-weight: 850;
}

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

.inline-field .small-btn {
  min-height: 42px;
  white-space: nowrap;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-bottom: 9px;
}

.searchbox, .field input, .field select, .field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 9px 11px;
  font-size: 16px;
  outline: none;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 251, 253, 1), rgba(250, 232, 241, .98));
  transition: border-color .18s ease, box-shadow .18s ease;
}

.field textarea {
  resize: vertical;
  min-height: 74px;
}

.searchbox:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(217, 31, 120, .18);
}

.field input[readonly] {
  color: var(--text);
  background: rgba(245, 211, 227, .92);
  cursor: default;
  pointer-events: none;
}

.field {
  display: grid;
  gap: 5px;
  margin-bottom: 9px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.field-hint {
  min-height: 14px;
  color: var(--danger);
  font-size: 11px;
}

.field-hint[data-tone="success"] { color: var(--success); }
.field-hint[data-tone="muted"] { color: var(--muted); }
.field-hint[data-tone="error"] { color: var(--danger); }

.form-grid {
  display: grid;
  gap: 8px;
}

.form-grid > .btn[type="submit"] {
  justify-self: center;
  min-width: min(220px, 100%);
}

.quick-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.quick-create-form .bank-tabs-field,
.quick-create-form .field,
.quick-create-form .btn {
  grid-column: 1 / -1;
}

.quick-create-form .field {
  margin-bottom: 0;
}

.quick-create-form .btn {
  width: min(100%, 220px);
  min-width: 0;
  margin-top: 6px;
  justify-self: center;
}

@media (max-width: 430px) {
  .quick-create-form {
    grid-template-columns: 1fr;
  }

  .quick-create-form .btn {
    margin-top: 0;
  }

  .member-stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid-two {
  display: grid;
  gap: 8px;
}

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

.btn {
  min-height: 40px;
  border: 0;
  border-radius: 14px;
  padding: 9px 13px;
  color: white;
  background: linear-gradient(135deg, #ff2d7a, #ff7a3d 32%, #23c66d 64%, #00b7ff 100%);
  box-shadow: 0 12px 22px rgba(0, 118, 188, .22);
  cursor: pointer;
  font-weight: 750;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.btn.secondary {
  color: #075b78;
  background: var(--card-rainbow);
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(0, 118, 188, .12);
}

.btn.success { background: linear-gradient(135deg, #0ba77b, #078762); box-shadow: 0 12px 22px rgba(7, 150, 110, .22); }
.btn.warning { background: linear-gradient(135deg, #e59c19, #c96f00); box-shadow: 0 12px 22px rgba(212, 122, 0, .22); }
.btn.danger { background: linear-gradient(135deg, #d73872, #b91f55); box-shadow: 0 12px 22px rgba(201, 40, 98, .24); }

.small-btn {
  min-height: 30px;
  border-radius: 11px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(255, 249, 252, .99), rgba(247, 216, 232, .98));
}

.list {
  display: grid;
  gap: 8px;
}

.list-card {
  border-radius: 18px;
  padding: 10px;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 9px;
  align-items: center;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.list-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-strong);
}

.list-card:active { transform: scale(.99); }

.card-main { min-width: 0; }

.card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.card-side {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.member-money {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 150px;
  max-width: 210px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-align: right;
}

.member-money strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.member-money span,
.member-money strong {
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .list-card:has(.member-money) {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .list-card:has(.member-money) .card-side {
    grid-column: 2;
    justify-items: start;
    width: 100%;
  }

  .member-money {
    justify-items: start;
    max-width: 100%;
    text-align: left;
  }
}

.va-money {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 850;
}

.va-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-icon {
  width: 32px;
  height: 32px;
  border-radius: 11px;
}

.mini-icon.active {
  border-color: var(--line-strong);
  color: var(--primary-3);
}

.masked-va {
  font-weight: 800;
  letter-spacing: .4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  color: #264eb8;
  background: rgba(49, 95, 212, .14);
}

.badge.success { color: var(--success); background: rgba(7, 150, 110, .16); }
.badge.warning { color: #9a5a00; background: rgba(212, 122, 0, .18); }
.badge.danger { color: var(--danger); background: rgba(201, 40, 98, .16); }
.badge.muted { color: #075b78; background: rgba(0, 183, 255, .13); }

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar, .bottom-nav::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: #075b78;
  background: var(--card-rainbow);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.chip.active {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, #ff2d7a, #ffb000 34%, #23c66d 68%, #00b7ff);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 244, 250, .96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  transition: transform .18s ease;
}

:root[data-theme="dark"] .bottom-nav { background: rgba(19, 22, 29, .78); }
:root.keyboard-open .bottom-nav { transform: translateY(100%); }

.nav-item {
  min-width: 64px;
  flex: 1 0 64px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.nav-item .nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.nav-item.active {
  color: white;
  background: linear-gradient(135deg, #ff2d7a, #ff7a3d 35%, #23c66d 70%, #00b7ff);
  box-shadow: 0 10px 20px rgba(0, 118, 188, .2);
  transform: translateY(-2px);
}

.empty-state {
  border-radius: 16px;
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(255, 249, 252, .99), rgba(248, 222, 235, .96));
}

.skeleton {
  min-height: 74px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(128, 128, 128, .08), rgba(128, 128, 128, .18), rgba(128, 128, 128, .08));
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(50, 19, 37, .36);
  display: grid;
  place-items: end center;
  padding: 16px 10px calc(16px + var(--keyboard-inset) + env(safe-area-inset-bottom));
  animation: fade-in .16s ease;
}

.modal {
  position: relative;
  width: min(620px, 100%);
  max-height: min(82vh, 720px);
  overflow: auto;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 250, 253, 1), rgba(249, 226, 238, .99));
  box-shadow: 0 24px 60px rgba(103, 27, 70, .24);
  animation: sheet-up .18s ease;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255, 250, 253, 1), rgba(249, 226, 238, .99));
  border-bottom: 1px solid var(--line);
}

.modal-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.modal-head-title .panel-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-back-btn {
  flex: 0 0 auto;
}

.modal-body {
  padding: 12px;
}

.member-modal {
  max-height: min(88vh, 760px);
}

.created-va-modal {
  display: grid;
  gap: 10px;
}

.created-va-result {
  display: grid;
  gap: 8px;
}

.created-va-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 249, 252, .99), rgba(248, 222, 235, .96));
}

.created-va-line span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.created-va-line strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.bulk-result-modal {
  display: grid;
  gap: 10px;
}

.bulk-result-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 250, 253, 1), rgba(249, 229, 240, .97));
}

.bulk-result-main {
  min-width: 0;
}

.bulk-result-main b {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-result-main p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.bulk-result-side {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

@media (max-width: 430px) {
  .bulk-result-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .bulk-result-side {
    grid-column: 2;
    justify-content: flex-start;
  }
}

.member-detail {
  display: grid;
  gap: 10px;
}

.member-summary {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 248, 252, .99), rgba(248, 219, 234, .97));
}

.member-summary h3 {
  margin: 0;
  font-size: 15px;
}

.member-summary p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.member-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.member-stat-tile {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 249, 252, .99), rgba(248, 219, 234, .96));
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.member-stat-tile:active {
  transform: translateY(1px);
}

.member-stat-tile span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.member-stat-tile b {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.member-stat-detail {
  display: grid;
  gap: 10px;
}

.beneficiary-editor {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 250, 253, 1), rgba(248, 222, 235, .96));
}

.compact-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 249, 252, .99), rgba(248, 222, 235, .95));
}

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

.compact-head h3 {
  margin: 0;
  font-size: 14px;
}

.compact-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 250, 253, 1), rgba(249, 229, 240, .97));
}

.mini-row.clickable {
  cursor: pointer;
}

.mini-row b {
  display: block;
  font-size: 13px;
}

.mini-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.rank {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #cf216f, #df3b8b 46%, #5069da);
  font-size: 12px;
  font-weight: 850;
}

.detail-grid {
  display: grid;
  gap: 8px;
}

.detail-row {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 250, 253, .99), rgba(249, 229, 240, .95));
  font-size: 12px;
}

.detail-key { color: var(--muted); }
.detail-val { min-width: 0; overflow-wrap: anywhere; font-weight: 650; }

.detail-val-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.detail-val-action span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-withdraw-card {
  align-items: flex-start;
}

.admin-withdraw-card .card-main {
  min-width: 0;
}

.withdraw-inline-detail {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.admin-withdraw-actions {
  margin-top: 2px;
}

.small-btn.danger {
  color: var(--danger);
  border-color: rgba(201, 40, 98, .42);
}

.qr-modal-body {
  display: grid;
  gap: 12px;
}

.qr-image {
  width: min(100%, 360px);
  margin: 0 auto;
  display: block;
  border-radius: 16px;
  border: 1px solid rgba(249, 179, 218, .42);
  background: #fff;
}

.toast-stack {
  position: fixed;
  left: 12px;
  right: 12px;
  top: calc(env(safe-area-inset-top) + 10px);
  z-index: 100;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  width: min(520px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 10px 12px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 250, 253, 1), rgba(249, 226, 238, .99));
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toast-in .2s ease;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 9px;
  font-weight: 750;
}

.toast.error { border-color: rgba(201, 40, 98, .42); }
.toast.success { border-color: rgba(7, 150, 110, .42); }

.toast-icon {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--info);
}

.toast.success .toast-icon { background: var(--success); }
.toast.error .toast-icon { background: var(--danger); }

.modal-load-more {
  margin-top: 10px;
  display: grid;
  place-items: center;
}

.setting-note {
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(255, 249, 252, .99), rgba(248, 222, 235, .96));
  font-size: 12px;
  font-weight: 800;
}

.setting-note.success { color: var(--success); border-color: rgba(7, 150, 110, .34); }
.setting-note.warning { color: var(--warning); border-color: rgba(212, 122, 0, .34); }

.pre {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(128, 128, 128, .08);
  font-size: 11px;
}

.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;
}

.ctv-hero {
  position: relative;
}

.app-shell:has(.ctv-hero) {
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.hero-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.hero-mini-stats div {
  min-width: 0;
  padding: 9px;
  border-radius: 13px;
  background: rgba(255, 241, 248, .22);
  overflow: hidden;
}

.hero-mini-stats span {
  display: block;
  color: rgba(255, 247, 252, .9);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.hero-mini-stats b {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  min-width: 0;
}

.hero-actions .small-btn {
  min-width: 0;
  min-height: 36px;
  padding: 8px 9px;
  justify-content: center;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.bank-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.bank-tab input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bank-tab span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #075b78;
  background: var(--card-rainbow);
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0, 118, 188, .12);
}

.bank-tab input:checked + span {
  color: #fff;
  border-color: rgba(255, 247, 252, .75);
  background: linear-gradient(135deg, #ff2d7a, #ffb000 34%, #23c66d 68%, #00b7ff);
}

.done-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 249, 252, .99), rgba(248, 219, 234, .97));
}

.done-tx-list {
  display: grid;
  gap: 9px;
}

.done-select-card {
  cursor: pointer;
  grid-template-columns: auto 34px minmax(0, 1fr);
}

.done-select-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.done-select-card.selected {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-strong);
}

.money-history-card {
  grid-template-columns: auto 34px minmax(0, 1fr) auto;
}

.money-history-card:not(:has(input)) {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.money-history-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.money-history-card.selected {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-strong);
}

.va-row.bank-msb {
  background: linear-gradient(135deg, rgba(255, 247, 252, .99), rgba(247, 211, 228, .96));
}

.va-row.bank-bidv {
  background: linear-gradient(135deg, rgba(255, 249, 245, .99), rgba(226, 236, 255, .97));
}

:root[data-theme="dark"],
:root[data-theme="dark"] body {
  background:
    linear-gradient(135deg, rgba(255, 112, 186, .1), transparent 42%),
    linear-gradient(315deg, rgba(112, 153, 255, .1), transparent 46%),
    linear-gradient(180deg, #160f18 0%, #211524 52%, #151b20 100%);
}

:root[data-theme="dark"] body::before {
  opacity: .18;
}

:root[data-theme="dark"] .stat-card,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .list-card,
:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .modal,
:root[data-theme="dark"] .modal-head,
:root[data-theme="dark"] .compact-section,
:root[data-theme="dark"] .mini-row,
:root[data-theme="dark"] .detail-row,
:root[data-theme="dark"] .created-va-line,
:root[data-theme="dark"] .bulk-result-row,
:root[data-theme="dark"] .member-summary,
:root[data-theme="dark"] .member-stat-tile,
:root[data-theme="dark"] .beneficiary-editor,
:root[data-theme="dark"] .done-summary,
:root[data-theme="dark"] .setting-note,
:root[data-theme="dark"] .toast {
  color: var(--text);
  background: linear-gradient(180deg, rgba(58, 32, 52, .98), rgba(42, 25, 43, .96));
}

:root[data-theme="dark"] .searchbox,
:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .field textarea {
  color: var(--text);
  background: linear-gradient(180deg, rgba(43, 29, 45, .98), rgba(35, 24, 38, .98));
  border-color: var(--line);
}

:root[data-theme="dark"] .field input[readonly] {
  color: var(--text);
  background: rgba(49, 35, 51, .96);
}

:root[data-theme="dark"] .icon-btn,
:root[data-theme="dark"] .small-btn,
:root[data-theme="dark"] .btn.secondary,
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .bank-tab span {
  color: #ffe8f4;
  background: linear-gradient(135deg, rgba(66, 38, 58, .98), rgba(48, 31, 51, .98));
  border-color: var(--line);
}

:root[data-theme="dark"] .chip.active,
:root[data-theme="dark"] .bank-tab input:checked + span,
:root[data-theme="dark"] .nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, #c72a72, #875ee8 58%, #1f8c7a);
}

:root[data-theme="dark"] .va-row.bank-msb,
:root[data-theme="dark"] .va-row.bank-bidv {
  background: linear-gradient(135deg, rgba(55, 32, 50, .98), rgba(34, 33, 50, .96));
}

:root[data-theme="dark"] .badge.muted {
  color: #f0bdd7;
  background: rgba(255, 151, 206, .13);
}

:root[data-theme="dark"] .badge.warning {
  color: #ffc76c;
  background: rgba(212, 122, 0, .18);
}

:root[data-theme="dark"] .modal-backdrop {
  background: rgba(8, 6, 10, .58);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheet-up {
  from { transform: translateY(16px) scale(.98); opacity: .7; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes led-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.24); }
}

@keyframes led-scan {
  from { background-position: 160% 0; }
  to { background-position: -160% 0; }
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@keyframes border-led {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

@keyframes hero-sheen {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(160%); }
}
