/* ============================================
   BUDGGT - Mobile-First Finance App CSS
   Pink Pastel Theme
   ============================================ */

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

:root {
  --primary:      #f97316;
  --primary-soft: #fff0e6;
  --pink:         #f43f5e;
  --pink-soft:    #fff0f3;
  --purple:       #6366f1;
  --purple-soft:  #f0f0ff;
  --green:        #22c55e;
  --green-soft:   #f0fdf4;
  --red:          #ef4444;
  --yellow:       #eab308;
  --bg:           #f8f8fb;
  --card:         #ffffff;
  --border:       #f0f0f4;
  --text:         #1a1a2e;
  --text-muted:   #9ca3af;
  --text-light:   #6b7280;
  --dark-card:    #1e1b2e;
  --dark-card2:   #2a2542;
  --radius:       16px;
  --radius-sm:    10px;
  --shadow:       0 2px 12px rgba(0,0,0,0.06);
  --shadow-md:    0 4px 24px rgba(0,0,0,0.10);
  --max-w:        430px;
  --nav-h:        68px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ── App Shell ── */
.app-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

/* ── Page content area ── */
.page-content {
  padding: 20px 16px calc(var(--nav-h) + 20px);
}

/* ── Top Header ── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}
.top-bar .logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.logo-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 14px;
}
.top-bar .actions { display: flex; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px;
  background: var(--bg);
  border: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-light);
  font-size: 18px; transition: background 0.2s;
}
.icon-btn:hover { background: var(--border); }

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: var(--max-w);
  height: var(--nav-h);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 8px;
  z-index: 200;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 8px 14px;
  color: var(--text-muted); font-size: 10px; font-weight: 600;
  text-decoration: none; border-radius: 12px;
  transition: color 0.2s;
  cursor: pointer;
  background: none; border: none;
  min-width: 52px;
}
.nav-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }
.nav-item.active { color: var(--primary); }
.nav-item.active svg { stroke: var(--primary); }

.nav-fab {
  width: 52px; height: 52px;
  background: var(--primary);
  border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px; font-weight: 300;
  cursor: pointer; box-shadow: 0 4px 16px rgba(249,115,22,0.4);
  text-decoration: none;
  margin-top: -12px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-fab:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(249,115,22,0.5); }

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card-dark {
  background: var(--dark-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  color: #fff;
}

/* ── Summary Card (Hero) ── */
.hero-card {
  background: linear-gradient(135deg, #1e1b2e 0%, #2a2542 100%);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 14px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: rgba(249,115,22,0.12);
  border-radius: 50%;
}
.hero-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 8px;
}
.hero-amount {
  font-size: 34px; font-weight: 800;
  margin-bottom: 4px; line-height: 1.1;
}
.hero-subtitle {
  font-size: 13px; color: rgba(255,255,255,0.65);
  margin-bottom: 18px; display: flex; align-items: center; gap: 6px;
}
.hero-row {
  display: flex; gap: 12px; margin-top: 4px;
}
.hero-stat {
  flex: 1;
}
.hero-stat-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: rgba(255,255,255,0.45); margin-bottom: 3px;
}
.hero-stat-val { font-size: 15px; font-weight: 700; }
.hero-stat-val.income { color: #4ade80; }
.hero-stat-val.expense { color: #f87171; }
.hero-divider { width: 1px; background: rgba(255,255,255,0.1); }

/* ── Wallet chips ── */
.wallet-scroll {
  display: flex; gap: 10px; overflow-x: auto;
  padding-bottom: 4px; margin-bottom: 14px;
  scrollbar-width: none;
}
.wallet-scroll::-webkit-scrollbar { display: none; }
.wallet-chip {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  min-width: 120px;
  max-width: 150px;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
  overflow: hidden;
}
.wallet-chip.active { border-color: var(--primary); }
.wallet-chip-name {
  font-size: 12px; font-weight: 600; color: var(--text-light);
  margin-bottom: 4px; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wallet-chip-balance {
  font-weight: 800;
  word-break: break-all;
  line-height: 1.2;
}
.wallet-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}

/* ── Section headers ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title { font-size: 16px; font-weight: 700; }
.section-link {
  font-size: 13px; font-weight: 600; color: var(--primary);
  text-decoration: none;
}

/* ── Transaction list ── */
.tx-list { display: flex; flex-direction: column; gap: 2px; }
.tx-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  transition: background 0.15s;
}
.tx-item:hover,
.tx-item:active { background: var(--bg); }
.tx-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.tx-info { flex: 1; min-width: 0; }
.tx-name {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tx-meta {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
}
.tx-who {
  font-size: 11px; background: var(--bg);
  border-radius: 4px; padding: 1px 6px;
  color: var(--text-light); font-weight: 500;
}
.tx-amount { font-size: 15px; font-weight: 700; white-space: nowrap; }
.tx-amount.income { color: var(--green); }
.tx-amount.expense { color: var(--red); }
.tx-amount.transfer { color: var(--purple); }

/* ── Form styles ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-muted); margin-bottom: 7px;
}
.form-control {
  width: 100%; padding: 13px 16px;
  background: var(--bg); border: 2px solid transparent;
  border-radius: var(--radius-sm); font-family: inherit;
  font-size: 15px; color: var(--text);
  outline: none; transition: border-color 0.2s, background 0.2s;
  appearance: none; -webkit-appearance: none;
}
.form-control:focus { border-color: var(--primary); background: var(--card); }
.form-control::placeholder { color: var(--text-muted); }
.form-control select { cursor: pointer; }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
[data-theme="dark"] .form-control {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}
[data-theme="dark"] .form-control:focus {
  background: var(--card);
  color: var(--text);
}
[data-theme="dark"] select.form-control,
[data-theme="dark"] select.form-control option {
  background-color: var(--card);
  color: var(--text);
}
[data-theme="dark"] input.form-control[type="date"] {
  color: var(--text);
  color-scheme: dark;
}
[data-theme="dark"] input.form-control[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.2);
  opacity: 0.9;
}

/* Amount input big */
.amount-input-wrap { position: relative; }
.amount-prefix {
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  font-size: 18px; font-weight: 700; color: var(--text-muted);
}
.amount-input {
  padding-left: 52px !important;
  font-size: 24px !important; font-weight: 800 !important;
}

/* Type tabs */
.type-tabs {
  display: flex; gap: 8px; margin-bottom: 20px;
}
.type-tab {
  flex: 1; padding: 11px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg); text-align: center;
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  color: var(--text-muted);
}
.type-tab.active[data-type="expense"] { border-color: var(--red); background: #fff0f0; color: var(--red); }
.type-tab.active[data-type="income"]  { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.type-tab.active[data-type="transfer"] { border-color: var(--purple); background: var(--purple-soft); color: var(--purple); }

/* ── Buttons ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 14px rgba(249,115,22,0.35);
}
.btn-primary:hover { background: #ea6c0f; box-shadow: 0 6px 18px rgba(249,115,22,0.45); }
.btn-outline {
  background: transparent; color: var(--text);
  border: 2px solid var(--border);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fff0f0; color: var(--red); }
.btn-sm { padding: 9px 16px; font-size: 13px; width: auto; }
.btn-ghost { background: var(--bg); color: var(--text-light); }

/* ── Chips / badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.badge-income  { background: var(--green-soft); color: var(--green); }
.badge-expense { background: #fff0f0; color: var(--red); }
.badge-transfer { background: var(--purple-soft); color: var(--purple); }
.badge-owner  { background: #fff7ed; color: var(--primary); }
.badge-admin  { background: var(--purple-soft); color: var(--purple); }
.badge-member { background: var(--bg); color: var(--text-light); }

/* ── Progress bar ── */
.progress-wrap { margin: 8px 0; }
.progress-bar-bg {
  height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--pink));
  transition: width 0.5s ease;
}
.progress-bar-fill.over { background: var(--red); }
.progress-bar-fill.ok { background: var(--green); }

/* ── Donut chart area ── */
.chart-wrap {
  position: relative;
  width: 180px; height: 180px;
  margin: 0 auto 20px;
}
.chart-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.chart-center-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.chart-center-val { font-size: 18px; font-weight: 800; }

/* ── Goals ── */
.goal-card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.goal-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.goal-icon { font-size: 28px; }
.goal-name { font-size: 15px; font-weight: 700; }
.goal-target { font-size: 12px; color: var(--text-muted); }
.goal-amounts { display: flex; justify-content: space-between; margin-bottom: 8px; }
.goal-current { font-size: 16px; font-weight: 800; color: var(--primary); }
.goal-pct { font-size: 13px; font-weight: 700; color: var(--text-muted); }

/* ── Flash messages ── */
.flash {
  padding: 13px 16px; border-radius: var(--radius-sm);
  margin-bottom: 14px; font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.flash-success { background: var(--green-soft); color: #15803d; }
.flash-error   { background: #fff0f0; color: #b91c1c; }
.flash-info    { background: #eff6ff; color: #1d4ed8; }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text-light); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px 20px;
  background: var(--bg);
  max-width: var(--max-w); margin: 0 auto;
}
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 32px;
}
.auth-logo-icon {
  width: 48px; height: 48px; background: var(--primary);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff;
}
.auth-logo-text { font-size: 26px; font-weight: 800; }
.auth-card {
  background: var(--card);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
  width: 100%;
}
.auth-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.auth-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

/* ── Team member card ── */
.member-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.member-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: var(--primary);
  flex-shrink: 0;
}
.member-info { flex: 1; }
.member-name { font-size: 15px; font-weight: 700; }
.member-email { font-size: 12px; color: var(--text-muted); }
.member-last-login { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Report chart bar ── */
.bar-chart { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; height: 100px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-income, .bar-expense {
  width: 100%; border-radius: 6px 6px 0 0;
  min-height: 4px; transition: height 0.5s;
}
.bar-income { background: var(--green); }
.bar-expense { background: var(--red); }
.bar-label { font-size: 10px; color: var(--text-muted); font-weight: 600; }

/* ── Misc ── */
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.fw-bold { font-weight: 700; }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-purple { color: var(--purple); }
.text-primary { color: var(--primary); }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mb-1 { margin-bottom: 4px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.w-full { width: 100%; }

/* Category grid picker */
.cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-top: 8px;
}
.cat-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s;
  background: var(--bg);
}
.cat-item:hover, .cat-item.selected { border-color: var(--primary); background: var(--primary-soft); }
.cat-item .cat-emoji { font-size: 22px; }
.cat-item .cat-name { font-size: 10px; font-weight: 600; color: var(--text-light); text-align: center; line-height: 1.2; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ── Date filter strip ── */
.month-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.month-btn {
  background: none; border: none; cursor: pointer;
  color: var(--primary); font-size: 20px; font-weight: 700;
  padding: 4px 8px;
}
.month-label { font-size: 15px; font-weight: 700; }

/* ── Input with icon ── */
.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; }
.input-icon + .form-control { padding-left: 42px; }

/* Floating label for form */
.page-title {
  font-size: 24px; font-weight: 800;
  margin-bottom: 4px;
}
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

/* ── Responsive tweaks ── */
@media (min-width: 430px) {
  .app-shell { box-shadow: 0 0 40px rgba(0,0,0,0.08); }
  .bottom-nav { border-radius: 0; }
}

/* ════════════════════════════════════════════════════
   TABLET  ≥ 768px
   Expand container, 2-col grids where needed
════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  :root { --max-w: 768px; }

  .page-content { padding: 24px 28px calc(var(--nav-h) + 24px); }

  /* Transaction list: show more info */
  .tx-item { padding: 14px 16px; }
  .tx-name  { font-size: 15px; }

  /* Wider wallet chips */
  .wallet-chip { min-width: 140px; }

  /* 2-col form layout */
  .form-2col {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  }
  .form-2col .form-group { margin-bottom: 0; }
}

/* ════════════════════════════════════════════════════
   DESKTOP  ≥ 1024px
════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
  :root { --max-w: 100%; --nav-h: 0px; --sidebar-w: 220px; }

  /* Push the entire shell to the right of the sidebar */
  .app-shell {
    margin-left: 220px !important;
    margin-right: 0 !important;
    max-width: calc(100vw - 220px) !important;
    width: calc(100vw - 220px) !important;
    box-shadow: none;
    overflow-x: visible;
  }

  /* Top bar and page-content: no extra margin needed */
  .top-bar        { margin-left: 0 !important; padding: 12px 40px; }
  .page-content   {
    margin-left: 0 !important;
    padding: 32px 40px 56px !important;
    max-width: 960px;
  }

  /* ── Hero card ── */
  .hero-card   { padding: 28px 32px; border-radius: 20px; }
  .hero-amount { font-size: 42px; }

  /* ── Cards & layout ── */
  .card        { padding: 24px; border-radius: 18px; }
  .card-dark   { padding: 24px; border-radius: 18px; }
  .goal-card   { padding: 20px; }
  .section-title { font-size: 18px; }
  .page-title    { font-size: 28px; }
  .month-nav     { padding: 14px 20px; border-radius: 14px; }

  /* ── Wallet grid ── */
  .wallet-scroll {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    overflow-x: visible; gap: 12px; padding-bottom: 0;
  }
  .wallet-chip { min-width: auto !important; max-width: 100% !important; border-radius: 14px !important; }

  /* ══════════════════════════════════════════════
     TRANSACTION LIST → TABLE-STYLE on desktop
  ══════════════════════════════════════════════ */
  .tx-list {
    background: var(--card);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    gap: 0;
  }

  /* Table header row (inject via CSS pseudo, actual done with .tx-table-head) */
  .tx-table-head {
    display: grid;
    grid-template-columns: 44px 1fr 140px 120px 110px 80px;
    gap: 0;
    padding: 10px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 11px; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .6px;
  }

  .tx-item {
    display: grid;
    grid-template-columns: 44px 1fr 140px 120px 110px 80px;
    align-items: center;
    gap: 0;
    padding: 13px 20px;
    border-radius: 0 !important;
    border-bottom: 1px solid var(--border);
    transition: background .12s;
  }
  .tx-item:last-child { border-bottom: none; }
  .tx-item:hover { background: var(--primary-soft); }

  /* Icon col */
  .tx-item .tx-icon {
    width: 36px; height: 36px;
    border-radius: 10px; font-size: 16px;
  }

  /* Info col */
  .tx-item .tx-info { padding: 0 12px; min-width: 0; }
  .tx-item .tx-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tx-item .tx-meta { margin-top: 2px; font-size: 11px; flex-wrap: nowrap; }

  /* Amount col — shown in dedicated column */
  .tx-item .tx-amount {
    font-size: 14px; font-weight: 700;
    white-space: nowrap; text-align: right;
    padding-right: 8px;
  }

  /* Amount+action col — span remaining columns */
  .tx-item > div:last-child {
    grid-column: 3 / -1;
    flex-direction: row !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    align-items: center !important;
    padding-right: 4px;
  }

  /* Summary bar → 3-col card row */
  .tx-summary-bar {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
  }
  .tx-summary-bar > div {
    border-radius: 14px !important;
    padding: 14px 18px !important;
    text-align: left !important;
  }
  .tx-summary-bar > div > div:first-child {
    font-size: 11px !important;
    margin-bottom: 4px;
  }
  .tx-summary-bar > div > div:last-child {
    font-size: 16px !important;
  }

  /* Filter tabs → stay inline, no scroll */
  .tx-filter-bar {
    display: flex !important;
    overflow-x: visible !important;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
  }

  /* Month nav → compact on desktop */
  .month-nav { margin-bottom: 20px; }

  /* Date group header */
  #tx-list-container > div > div:first-child {
    font-size: 11px;
    padding: 4px 20px 8px;
    margin-bottom: 0 !important;
    background: transparent;
  }
  #tx-list-container > div {
    margin-bottom: 20px;
  }

  /* ══════════════════════════════════════════════
     FORM LAYOUT on desktop
  ══════════════════════════════════════════════ */
  .form-2col {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  }
  .form-3col {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  }
  .form-group { margin-bottom: 20px; }
  .form-control { border-radius: 12px; }
  .btn { border-radius: 12px; }

  /* ══════════════════════════════════════════════
     PAGE HEADER on desktop
  ══════════════════════════════════════════════ */
  .page-header-desktop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
  }
  .page-header-desktop h1 {
    font-size: 24px; font-weight: 800; color: var(--text);
    margin: 0;
  }

  /* ══════════════════════════════════════════════
     GENERIC DATA TABLE (akuntansi, laporan, dll)
  ══════════════════════════════════════════════ */
  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    background: var(--card);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  table thead th {
    background: var(--bg);
    padding: 11px 16px;
    text-align: left;
    font-size: 11px; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .6px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }
  table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
    vertical-align: middle;
  }
  table tbody tr:last-child td { border-bottom: none; }
  table tbody tr:hover td { background: var(--primary-soft); }
  table tfoot td {
    padding: 12px 16px;
    font-weight: 700; color: var(--text);
    border-top: 2px solid var(--border);
    background: var(--bg);
  }

  /* Scrollable table wrapper */
  .table-responsive {
    overflow-x: auto;
    border-radius: 14px;
    box-shadow: var(--shadow);
    -webkit-overflow-scrolling: touch;
  }
  .table-responsive table {
    border-radius: 0;
    box-shadow: none;
    min-width: 600px;
  }

  /* ══════════════════════════════════════════════
     MEMBER / WALLET / GOAL CARDS on desktop
  ══════════════════════════════════════════════ */
  /* Grid layout for card lists */
  .cards-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .cards-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  .member-card {
    border-radius: 14px;
    padding: 16px 18px;
    transition: box-shadow .15s;
  }
  .member-card:hover { box-shadow: var(--shadow-md); }

  /* Flash messages wider */
  .flash { border-radius: 12px; padding: 14px 20px; font-size: 14px; }
}

/* ════════════════════════════════════════════════════
   WIDE DESKTOP  ≥ 1280px
════════════════════════════════════════════════════ */
@media (min-width: 1280px) {
  :root { --sidebar-w: 240px; }
  .app-shell {
    margin-left: 240px !important;
    max-width: calc(100vw - 240px) !important;
    width: calc(100vw - 240px) !important;
  }
  .top-bar      { padding: 12px 48px; }
  .page-content { padding: 32px 48px 56px !important; max-width: 1040px; }
  .hero-amount { font-size: 46px; }
  .wallet-scroll { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .tx-item {
    grid-template-columns: 44px 1fr 180px 140px 130px 90px;
  }
  .tx-table-head {
    grid-template-columns: 44px 1fr 180px 140px 130px 90px;
  }
}

/* ── Invoice document (preview / publik) ─────────────────────── */
.inv-sheet {
  position: relative;
}
.inv-doc-accent {
  height: 3px;
  background: linear-gradient(90deg, #f97316, #fb923c);
  border-radius: 2px;
  margin: -4px 0 18px;
}
.inv-doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.inv-doc-head-left { flex: 1; min-width: 0; }
.inv-doc-head-right {
  flex: 0 0 48%;
  max-width: 340px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.inv-doc-biz-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}
.inv-doc-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.inv-doc-client-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.inv-doc-type {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 2px;
}
.inv-doc-meta-box {
  margin-top: 10px;
  padding: 10px 12px;
  width: 100%;
  max-width: 320px;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.inv-doc-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 10px;
}
.inv-doc-meta-item { min-width: 0; }
.inv-doc-meta-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.inv-doc-meta-val {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}
.inv-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  margin-bottom: 10px;
  text-align: left;
}
.inv-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.inv-status-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}
.inv-status-text strong {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.inv-status-text small {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.9;
}
.inv-status--paid {
  background: #ecfdf5;
  border-color: #86efac;
  color: #047857;
}
.inv-status--paid .inv-status-dot { background: #22c55e; }
.inv-status--partial {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}
.inv-status--partial .inv-status-dot { background: #f97316; }
.inv-status--unpaid {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}
.inv-status--unpaid .inv-status-dot { background: #94a3b8; }