/* Money Tracker — Brankas Pribadi Design System */
:root {
  --bg: #eff4fb;
  --surface: #ffffff;
  --surface-soft: #f6f9fe;
  --surface-muted: #eaf0f8;
  --navy: #102446;
  --navy-2: #173463;
  --navy-deep: #0b1933;
  --navy-glass: rgba(255, 255, 255, 0.08);
  --navy-line: rgba(255, 255, 255, 0.14);
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-soft: #eff6ff;
  --blue-border: #bfdbfe;
  --lime: #c2f72f;
  --lime-hover: #b3e820;
  --lime-ink: #0d1f3c;
  --ink: #0f1d36;
  --ink-2: #334155;
  --muted: #5b6b82;
  --line: #e2eaf4;
  --line-strong: #cbd7e8;
  --green: #059669;
  --green-soft: #ecfdf5;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --red-border: #fecaca;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 10px rgba(16, 36, 70, 0.04);
  --shadow: 0 10px 30px rgba(16, 36, 70, 0.06);
  --shadow-lg: 0 22px 54px rgba(16, 36, 70, 0.14);
  font-family: 'Plus Jakarta Sans', 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 460px at 8% -4%, rgba(37, 99, 235, 0.09), transparent 60%),
    radial-gradient(760px 420px at 94% 2%, rgba(56, 189, 248, 0.09), transparent 58%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.dark-widget button:focus-visible,
.dark-widget a:focus-visible,
.tx-detail-pane button:focus-visible,
.tx-detail-pane a:focus-visible,
.tx-row.is-selected:focus-visible,
.wallet-summary button:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

.icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  vertical-align: middle;
}

h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -0.03em; line-height: 1.2; font-weight: 800; color: var(--ink); }
h2 { font-size: 19px; letter-spacing: -0.02em; line-height: 1.3; font-weight: 700; color: var(--ink); }
h3 { font-size: 16px; line-height: 1.35; font-weight: 700; color: var(--ink); }
h4 { font-size: 15px; font-weight: 700; }

.quiet { color: var(--muted); font-size: 14px; line-height: 1.6; }
.positive { color: var(--green); }
.negative, .warning-text { color: var(--red); }
.center { text-align: center; }
.block { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.tabular,
.hero-balance-value,
.stat-card strong,
.networth-value,
.amount-cell,
.wallet-balance,
.goal-amount,
.budget-values span,
.budget-overview strong,
.tx-row-amount,
.tx-detail-amount,
.favorite-value {
  font-variant-numeric: tabular-nums;
}

/* Loading & Error States */
.loading, .load-error {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.loading-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--blue-border);
  border-top-color: var(--blue);
  animation: mt-spin 0.8s linear infinite;
}
@keyframes mt-spin { to { transform: rotate(360deg); } }

/* App Shell — Top Navigation Layout */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main-shell {
  width: 100%;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(239, 244, 251, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(203, 215, 232, 0.55);
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 6px 15px 6px 7px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.brand:hover {
  text-decoration: none;
  border-color: var(--blue-border);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--lime);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  position: relative;
  flex-shrink: 0;
}
.brand-mark span {
  position: absolute;
  font-size: 10px;
  right: 4px;
  top: 3px;
  color: #7dd3fc;
}
.brand-text { display: inline-flex; align-items: baseline; gap: 2px; }
.brand-light { font-weight: 500; color: var(--muted); }

/* Center Capsule Navigation */
.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 5px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.nav-pill {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-pill .icon { width: 16px; height: 16px; opacity: 0.78; }
.nav-pill:hover { background: var(--surface-soft); color: var(--ink); }
.nav-pill.active {
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(194, 247, 47, 0.4);
}
.nav-pill.active .icon { opacity: 1; color: var(--lime-ink); }
.nav-pill .nav-caret { width: 14px; height: 14px; transition: transform 0.16s; }
.nav-pill[aria-expanded="true"] .nav-caret { transform: rotate(90deg); }

.nav-dropdown-wrap { position: relative; }
.nav-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 310px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px;
  z-index: 60;
}
.nav-popover.wide-popover {
  width: 520px;
  right: -40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.popover-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 10px 8px;
}
.popover-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: background 0.14s, color 0.14s;
}
.popover-item .icon { width: 17px; height: 17px; color: var(--muted); }
.popover-item:hover { background: var(--surface-soft); color: var(--ink); }
.popover-item:hover .icon { color: var(--blue); }
.popover-item.active {
  background: var(--navy);
  color: #ffffff;
  font-weight: 600;
}
.popover-item.active .icon { color: var(--lime); }
.popover-item.danger-item { color: var(--red); }
.popover-item.danger-item .icon { color: var(--red); }
.popover-item.danger-item:hover { background: var(--red-soft); }
.popover-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  color: var(--ink-2);
}
.popover-item.active .popover-badge {
  background: var(--lime);
  color: var(--lime-ink);
}

/* Topbar Right Utility & Account Area */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.topbar-sync-slot { display: inline-flex; align-items: center; }

.sync-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--radius-pill);
  padding: 8px 13px;
  min-height: 38px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, background 0.15s;
}
.sync-button:hover { border-color: var(--blue-border); background: var(--blue-soft); color: var(--blue-hover); }
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}
.sync-button.is-pending { border-color: var(--amber-border); background: var(--amber-soft); color: var(--amber); }
.sync-button.is-pending .sync-dot { background: #d97706; }
.sync-button.is-conflict { border-color: var(--red-border); background: var(--red-soft); color: var(--red); }
.sync-button.is-conflict .sync-dot { background: var(--red); }

.account-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px;
  box-shadow: var(--shadow-sm);
}
.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 2px 10px 2px 2px;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.account-trigger:hover { background: var(--surface-soft); }
.mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--lime);
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.account-name-label {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-popover-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 10px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.account-popover-header strong {
  display: block;
  font-size: 14.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-popover-header small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vault-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 10px 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
}
.vault-chip .icon { width: 14px; height: 14px; color: var(--blue); }
.account-vault-actions {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-quick-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--ink-2);
  transition: background 0.14s, color 0.14s;
}
.topbar-quick-lock:hover { background: var(--navy); color: var(--lime); }

.mobile-context-title { display: none; }
.mobile-bottom-nav { display: none; }
.menu-scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: transparent;
}

/* Main Content Area */
main {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px 28px 44px;
}

/* Buttons & Controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 16px;
  min-height: 40px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.btn .icon { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-soft); border-color: #b4c5dc; text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.24);
}
.btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #ffffff; }

.btn.lime-btn {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--lime-ink);
  font-weight: 700;
}
.btn.lime-btn:hover { background: var(--lime-hover); border-color: var(--lime-hover); }

.btn.navy-ghost {
  background: var(--navy-glass);
  border-color: var(--navy-line);
  color: #f8fafc;
}
.btn.navy-ghost:hover { background: rgba(255, 255, 255, 0.15); color: #ffffff; }

.btn.navy-danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.36);
  color: #fecaca;
}
.btn.navy-danger:hover { background: rgba(239, 68, 68, 0.28); color: #ffffff; }

.btn.text-btn {
  background: transparent;
  border-color: transparent;
  color: var(--blue);
  padding: 8px 12px;
}
.btn.text-btn:hover { background: var(--blue-soft); color: var(--blue-hover); }

.btn.danger-button {
  background: var(--red-soft);
  border-color: var(--red-border);
  color: var(--red);
}
.btn.danger-button:hover { background: #fee2e2; border-color: #fca5a5; }

.btn-quick-add {
  padding: 9px 16px;
  min-height: 38px;
  font-size: 13px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  position: relative;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.icon-btn:hover { background: var(--surface-muted); color: var(--ink); text-decoration: none; }
.icon-btn.surface-btn { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); color: var(--ink-2); }
.icon-btn.surface-btn:hover { border-color: var(--blue-border); color: var(--blue); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }

.notification-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid var(--surface);
  right: 6px;
  top: 6px;
}

/* Page Heading */
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 6px;
}
.page-heading p { color: var(--muted); font-size: 14px; margin-top: 6px; line-height: 1.5; }
.heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Period / Month Picker Pill */
.month-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 3px 6px;
  min-height: 40px;
  box-shadow: var(--shadow-sm);
}
.month-control .month-step {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  display: inline-grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
}
.month-control .month-step:hover { background: var(--surface-soft); color: var(--blue); }
.month-control .icon { width: 15px; height: 15px; color: var(--blue); margin-left: 4px; }
.month-control input[type="month"] {
  border: 0;
  background: transparent;
  padding: 4px 6px;
  min-height: 32px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  width: auto;
  max-width: 155px;
}
.month-control input[type="month"]:focus-visible { outline: none; }
.month-control:focus-within { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

/* Dashboard Hero — Concept C: Ice Light + Aurora Navy Wallet Cards + 4 Quick Actions */
.dashboard-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr);
  gap: 24px 28px;
  align-items: center;
}
.hero-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.hero-period-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--blue-soft);
  color: var(--blue-hover);
  font-size: 12px;
  font-weight: 700;
}
.hero-balance-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.hero-balance-value {
  font-size: clamp(32px, 3.8vw, 46px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.hero-balance-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.hero-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}
.hero-meta-pill.positive-pill {
  background: var(--green-soft);
  border-color: #a7f3d0;
  color: #047857;
}
.hero-meta-pill.clickable {
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}
.hero-meta-pill.clickable:hover {
  border-color: var(--blue-border);
  background: var(--blue-soft);
  color: var(--blue-hover);
}
.hero-meta-pill.warn {
  background: var(--amber-soft);
  border-color: var(--amber-border);
  color: var(--amber);
}

/* 4 Circular Quick Actions (Concept C / Pinterest Fintech Rhythm) */
.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
  max-width: 400px;
}
.quick-action-btn {
  border: 0;
  background: transparent;
  padding: 6px 4px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.14s, color 0.14s;
}
.quick-action-btn:hover { transform: translateY(-2px); color: var(--ink); }
.quick-action-circle {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--navy);
  display: inline-grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.quick-action-btn:hover .quick-action-circle {
  background: var(--blue-soft);
  border-color: var(--blue-border);
  color: var(--blue);
}
.quick-action-btn.is-primary .quick-action-circle {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}
.quick-action-btn.is-primary:hover .quick-action-circle { background: var(--blue-hover); }
.quick-action-btn.is-ocr .quick-action-circle {
  background: linear-gradient(145deg, #132c57 0%, #1d4ed8 100%);
  border-color: transparent;
  color: var(--lime);
  box-shadow: 0 8px 18px rgba(16, 36, 70, 0.2);
}

/* Tactile Aurora Wallet Strip inside Hero (Concept C) */
.hero-right-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.hero-right-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.aurora-wallet-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.95fr);
  gap: 12px;
  align-items: stretch;
}
.aurora-card {
  position: relative;
  overflow: hidden;
  border: 0;
  text-align: left;
  border-radius: 22px;
  padding: 20px 22px;
  min-height: 162px;
  background:
    radial-gradient(180px 140px at 88% 18%, rgba(56, 189, 248, 0.42), transparent 68%),
    radial-gradient(180px 150px at 66% 86%, rgba(129, 140, 248, 0.36), transparent 70%),
    linear-gradient(135deg, #0c1a38 0%, #142c5c 55%, #1d3c7c 100%);
  color: #ffffff;
  box-shadow: 0 16px 36px rgba(12, 26, 56, 0.24);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.16s, box-shadow 0.16s;
}
.aurora-card:hover { transform: translateY(-2px); box-shadow: 0 20px 42px rgba(12, 26, 56, 0.3); }
.aurora-card:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.aurora-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-chip-icon {
  width: 34px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(255,255,255,0.34), rgba(255,255,255,0.12));
  border: 1px solid rgba(255,255,255,0.28);
  position: relative;
}
.card-chip-icon::after {
  content: '';
  position: absolute;
  inset: 6px 5px;
  border-top: 1px solid rgba(255,255,255,0.38);
  border-bottom: 1px solid rgba(255,255,255,0.38);
}
.aurora-card-type {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  letter-spacing: 0.03em;
}
.aurora-card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #cbd5e1;
  margin-top: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aurora-card-balance {
  font-size: clamp(20px, 2vw, 25px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.aurora-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11.5px;
  color: #93c5fd;
}
.aurora-card-dots {
  display: inline-flex;
  align-items: center;
}
.aurora-card-dots i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(194, 247, 47, 0.78);
  display: inline-block;
}
.aurora-card-dots i + i {
  background: rgba(125, 211, 252, 0.78);
  margin-left: -6px;
}

.mini-wallet-tile {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 22px;
  padding: 18px 20px;
  min-height: 162px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.mini-wallet-tile:hover { border-color: var(--blue-border); background: var(--blue-soft); transform: translateY(-2px); }
.mini-wallet-tile .wallet-logo { width: 38px; height: 38px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.mini-wallet-tile-name { font-size: 13.5px; font-weight: 700; color: var(--ink); margin-top: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-wallet-tile-bal { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mini-wallet-tile-sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* Inline Receipt Preview inside Deep Navy Detail Panel (Concept C) */
.tx-receipt-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}
.tx-receipt-thumb {
  width: 68px;
  height: 86px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.22);
  background: #ffffff;
  flex-shrink: 0;
}

/* Local Receipt OCR Scanner Modal */
.ocr-trust-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  background: var(--blue-soft);
  border: 1px solid var(--blue-border);
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 16px;
}
.ocr-trust-chip .icon { width: 16px; height: 16px; color: var(--blue); }
.ocr-dropzone {
  border: 2px dashed var(--blue-border);
  background: var(--surface-soft);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ocr-dropzone:hover { border-color: var(--blue); background: var(--blue-soft); }
.ocr-dropzone .ocr-cam-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, #102446 0%, #2563eb 100%);
  color: var(--lime);
  display: inline-grid;
  place-items: center;
}
.ocr-dropzone .ocr-cam-badge .icon { width: 24px; height: 24px; }
.ocr-dropzone input[type="file"] { display: none; }
.ocr-progress-box {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.ocr-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.ocr-result-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
  align-items: start;
}
.ocr-preview-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.ocr-preview-img {
  width: 100%;
  max-height: 230px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #f8fafc;
}
.ocr-raw-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-soft);
}
.ocr-raw-details summary { font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.ocr-raw-details pre {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 130px;
  overflow-y: auto;
  color: var(--ink-2);
}
.ocr-inline-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #0f2347 0%, #1d3c7a 100%);
  color: #ffffff;
}
.ocr-inline-banner strong { display: block; font-size: 13.5px; color: #ffffff; }
.ocr-inline-banner small { display: block; font-size: 12px; color: #cbd5e1; margin-top: 2px; }
.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.hero-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* KPI Stat Row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stat-card > span,
.stat-card-head > span {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  gap: 8px;
}
.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.stat-icon .icon { width: 16px; height: 16px; }
.stat-icon.income { background: var(--blue-soft); color: var(--blue); }
.stat-icon.expense { background: var(--red-soft); color: var(--red); }
.stat-icon.saved { background: var(--navy); color: var(--lime); }
.stat-card strong {
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 800;
  letter-spacing: -0.03em;
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.stat-card strong.positive { color: var(--green); }
.stat-card strong.negative { color: var(--red); }
.stat-card small { font-size: 12.5px; color: var(--muted); display: block; }

/* Banners */
.welcome-banner,
.info-banner {
  border: 1px solid var(--blue-border);
  background: var(--blue-soft);
  border-radius: var(--radius-lg);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  margin-bottom: 20px;
  color: var(--navy);
}
.welcome-banner.sync-alert {
  background: var(--amber-soft);
  border-color: var(--amber-border);
  color: #78350f;
}
.welcome-banner strong, .info-banner strong { font-size: 15px; display: block; }
.welcome-banner p, .info-banner small { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; display: block; line-height: 1.55; }
.welcome-banner > div:last-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.info-banner .icon { width: 22px; height: 22px; color: var(--blue); flex-shrink: 0; }

/* Section Toolbar & Modular Widget Grid */
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.section-toolbar > div:first-child { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-toolbar > div:last-child { display: flex; gap: 8px; flex-wrap: wrap; }

.widget-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 84px;
  gap: 18px;
  align-items: stretch;
}
.widget {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  min-width: 0;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.widget-content {
  padding: 22px 24px;
  height: 100%;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.widget-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.widget-title h3 { font-size: 16px; font-weight: 700; color: var(--ink); }
.widget-title > .icon { color: var(--blue); width: 20px; height: 20px; }

/* Deep Navy Highlight Widget (Gambar 1 & Gambar 2 Navy Surface) */
.dark-widget {
  background: linear-gradient(155deg, #132b54 0%, #0d1e3b 100%);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}
.dark-widget .widget-title h3 { color: #f8fafc; }
.dark-widget .widget-title > .icon { color: var(--lime); }
.networth-value {
  font-size: clamp(22px, 2.3vw, 32px);
  letter-spacing: -0.03em;
  margin-top: 6px;
  font-weight: 800;
  color: #ffffff;
  overflow-wrap: anywhere;
}
.networth-caption { font-size: 12px; color: #cbd5e1; margin-top: 6px; line-height: 1.5; }
.networth-rule { height: 1px; background: var(--navy-line); margin: 16px 0 12px; }
.wallet-mini-list { font-size: 13px; }
.wallet-mini-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
}
.wallet-mini-list span { display: flex; align-items: center; gap: 8px; color: #e2e8f0; overflow-wrap: anywhere; }
.wallet-mini-list b { font-size: 13px; font-weight: 700; color: #ffffff; white-space: nowrap; }
.wallet-mini-list i, .category-list i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dark-link {
  background: var(--navy-glass);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-pill);
  color: var(--lime);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 12px;
  transition: background 0.14s;
}
.dark-link:hover { background: rgba(255, 255, 255, 0.14); }
.dark-link .icon { width: 15px; height: 15px; }
.muted-light { color: #cbd5e1; font-size: 13px; }

/* Cashflow Chart */
.cashflow-chart {
  display: block;
  width: 100%;
  height: calc(100% - 62px);
  max-height: 205px;
  min-height: 130px;
}
.chart-legend {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  gap: 6px;
}
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.chart-legend .green { background: var(--blue); }
.chart-legend .gray { background: var(--navy); margin-left: 8px; }
.chart-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
  gap: 8px;
}

/* Donut Expenses Widget */
.tag {
  display: inline-flex;
  align-items: center;
  background: var(--surface-muted);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  white-space: nowrap;
}
.donut-wrap { display: flex; justify-content: center; margin: 10px 0 16px; }
.donut {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
}
.donut > div {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
}
.donut span { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.donut strong { font-size: 16.5px; font-weight: 800; letter-spacing: -0.02em; margin-top: 3px; color: var(--ink); }
.category-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-top: 9px;
  gap: 8px;
}
.category-list span { display: flex; align-items: center; gap: 8px; color: var(--ink-2); overflow-wrap: anywhere; }
.category-list b { font-size: 13px; font-weight: 700; color: var(--ink); }

.text-link {
  background: var(--blue-soft);
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  white-space: nowrap;
  transition: background 0.14s;
}
.text-link:hover { background: var(--blue-border); color: var(--blue-hover); }

/* Recent Transactions Widget */
.recent-list { display: flex; flex-direction: column; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  background: transparent;
  padding: 12px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.14s;
}
.recent-item:last-child { border-bottom: 0; }
.recent-item:hover { background: var(--surface-soft); }
.recent-item:hover .recent-description strong { color: var(--blue); }

.category-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.category-icon .icon { width: 17px; height: 17px; }
.category-icon.income { background: var(--green-soft); color: var(--green); }
.category-icon.expense { background: var(--red-soft); color: var(--red); }
.category-icon.transfer { background: var(--blue-soft); color: var(--blue); }

.recent-description { min-width: 0; flex: 1; }
.recent-description strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.recent-description small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.recent-item > b { font-size: 13.5px; font-weight: 700; white-space: nowrap; color: var(--ink); }
.recent-item > b.positive { color: var(--green); }

/* Goals & Progress */
.goal-mini { margin-top: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.goal-mini:last-child { border-bottom: 0; padding-bottom: 0; }
.goal-mini-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.goal-mini-icon {
  width: 30px;
  height: 30px;
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.goal-mini-icon .icon { width: 16px; height: 16px; }
.goal-mini strong { font-size: 13.5px; font-weight: 600; color: var(--ink); display: block; }
.goal-progress-label { display: flex; justify-content: space-between; margin: 6px 0; font-size: 12px; color: var(--muted); }
.goal-progress-label b { font-weight: 700; color: var(--ink); }
.progress { height: 8px; background: var(--surface-muted); border-radius: var(--radius-pill); overflow: hidden; }
.progress > div { background: var(--blue); height: 100%; border-radius: var(--radius-pill); transition: width 0.25s ease; }
.goal-mini > small { color: var(--muted); font-size: 11.5px; display: block; margin-top: 6px; }

/* Widget Editing Mode */
.is-editing .widget { outline: 2px dashed var(--blue); outline-offset: -2px; }
.widget-edit-bar {
  background: var(--blue-soft);
  border-bottom: 1px solid var(--blue-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  height: 42px;
  padding: 0 8px;
}
.drag-handle {
  border: 0;
  background: none;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: grab;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  min-width: 0;
  flex: 1;
}
.drag-handle .icon { width: 15px; height: 15px; }
.drag-handle span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.widget-edit-bar .icon-btn { width: 28px; height: 28px; color: var(--navy); font-weight: 700; }
.widget-edit-bar .icon-btn:hover { background: var(--blue-border); }
.is-editing .widget-content { height: calc(100% - 42px); }
.resize-handle {
  position: absolute;
  width: 24px;
  height: 24px;
  right: 4px;
  bottom: 4px;
  cursor: nwse-resize;
  touch-action: none;
  background: repeating-linear-gradient(135deg, transparent 0px, transparent 3px, var(--blue) 3px, var(--blue) 5px);
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}
.drag-over { outline: 2px dashed var(--blue); outline-offset: 6px; border-radius: var(--radius-xl); }

/* General Panel & Empty State */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.empty-state > .icon {
  width: 44px;
  height: 44px;
  padding: 10px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  margin-bottom: 14px;
}
.empty-state h3 { color: var(--ink); font-size: 16px; font-weight: 700; }
.empty-state p { font-size: 13.5px; max-width: 360px; margin: 8px 0 18px; line-height: 1.6; }
.widget .empty-state { padding: 20px 8px; }
.widget .empty-state p { font-size: 12.5px; margin: 6px 0 14px; }

/* =========================================================
   TRANSAKSI MASTER-DETAIL WORKSPACE (Gambar 2 Inspired)
   ========================================================= */
.tx-filters-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tx-filter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.tx-type-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-muted);
  padding: 4px;
  border-radius: var(--radius-pill);
  flex-wrap: wrap;
}
.tx-type-tab {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.14s, color 0.14s;
}
.tx-type-tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.7); }
.tx-type-tab.active {
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(194, 247, 47, 0.35);
}
.tx-type-tab .tab-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(15, 29, 54, 0.08);
  color: inherit;
}
.tx-type-tab.active .tab-count { background: rgba(13, 31, 60, 0.14); }

.tx-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 210px;
  max-width: 340px;
  background: var(--surface-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 0 14px;
  min-height: 40px;
}
.search-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12); background: var(--surface); }
.search-box .icon { width: 16px; height: 16px; color: var(--muted); }
.search-box input {
  width: 100%;
  font-size: 13.5px;
  background: transparent;
  border: 0;
  padding: 8px 0;
  min-height: 38px;
  color: var(--ink);
}
.search-box input:focus-visible { outline: none; }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters select {
  height: 40px;
  min-height: 40px;
  width: auto;
  max-width: 190px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  padding: 0 14px;
  background: var(--surface-soft);
}

.date-range-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.date-range-row label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  min-width: 140px;
  max-width: 210px;
}
.date-range-row input, .date-range-row select {
  min-height: 38px;
  padding: 7px 11px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.tx-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(350px, 0.85fr);
  gap: 20px;
  align-items: start;
}
.tx-list-pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.tx-list-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.tx-list-header h2 { font-size: 16px; }
.tx-list-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tx-row {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 18px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  text-align: left;
  transition: background 0.14s, border-color 0.14s, transform 0.12s;
}
.tx-row:hover {
  background: var(--surface-soft);
  border-color: var(--line);
}
.tx-row.is-selected {
  background: var(--navy);
  border-color: var(--navy);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(16, 36, 70, 0.22);
}
.tx-row.is-selected .category-icon {
  background: rgba(255, 255, 255, 0.12);
  color: var(--lime);
}
.tx-row-main { min-width: 0; }
.tx-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tx-row-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.tx-row.is-selected .tx-row-title { color: #ffffff; }
.tx-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--muted);
}
.tx-row.is-selected .tx-row-meta { color: #cbd5e1; }
.tx-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.tx-row-amount {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.tx-row-amount.positive { color: var(--green); }
.tx-row.is-selected .tx-row-amount { color: #ffffff; }
.tx-row.is-selected .tx-row-amount.positive { color: var(--lime); }
.tx-row-subamount { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.tx-row.is-selected .tx-row-subamount { color: #cbd5e1; }

.tx-row.is-selected .pill {
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 700;
}

/* Deep Navy Detail Panel (Gambar 2 Signature) */
.tx-detail-pane {
  position: sticky;
  top: 86px;
  background: linear-gradient(160deg, #132c57 0%, #0b1a36 100%);
  color: #f8fafc;
  border-radius: var(--radius-xl);
  padding: 26px;
  box-shadow: var(--shadow-lg);
  min-width: 0;
}
.tx-detail-back {
  display: none;
  margin-bottom: 16px;
}
.tx-detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tx-detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--lime);
  color: var(--lime-ink);
  font-size: 12px;
  font-weight: 800;
}
.tx-detail-date { font-size: 13px; color: #cbd5e1; font-weight: 500; }
.tx-detail-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.tx-detail-amount {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-top: 10px;
  overflow-wrap: anywhere;
}
.tx-detail-amount.positive { color: var(--lime); }
.tx-detail-idr {
  font-size: 13px;
  color: #93c5fd;
  margin-top: 4px;
}
.tx-detail-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}
.tx-detail-tile {
  background: var(--navy-glass);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  padding: 13px 15px;
  min-width: 0;
}
.tx-detail-tile.full { grid-column: 1 / -1; }
.tx-detail-tile > span {
  display: block;
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tx-detail-tile strong {
  display: block;
  font-size: 14.5px;
  color: #ffffff;
  font-weight: 600;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.tx-detail-tile small {
  display: block;
  font-size: 12px;
  color: #cbd5e1;
  margin-top: 3px;
}
.tx-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--navy-line);
}
.tx-detail-actions .btn.lime-btn { flex: 1; }
.tx-detail-empty {
  text-align: center;
  padding: 36px 16px;
  color: #cbd5e1;
}
.tx-detail-empty .icon {
  width: 40px;
  height: 40px;
  color: var(--lime);
  margin-bottom: 12px;
}
.tx-detail-empty h3 { color: #ffffff; margin-bottom: 8px; }
.tx-detail-empty p { font-size: 13.5px; color: #cbd5e1; line-height: 1.6; }

/* Inputs & Tables */
input, select, textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  min-height: 42px;
}
textarea { resize: vertical; line-height: 1.55; }
input[type="color"] { height: 44px; width: 76px; padding: 5px; cursor: pointer; }
input[type="checkbox"] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--blue); flex-shrink: 0; }
input[type="file"] { padding: 8px; font-size: 13px; min-height: 40px; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th {
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-soft);
}
td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-soft); }
td strong { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.table-description { display: flex; align-items: center; gap: 11px; max-width: 300px; }
.table-description strong { display: block; max-width: 220px; white-space: normal; overflow-wrap: anywhere; }
.table-description small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.amount-cell { text-align: right; font-weight: 700; color: var(--ink); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  background: var(--surface-muted);
  color: var(--ink-2);
}
.pill.income { color: #047857; background: var(--green-soft); }
.pill.expense { color: #b91c1c; background: var(--red-soft); }
.pill.transfer { color: var(--blue-hover); background: var(--blue-soft); }
.pill.both { color: var(--navy); background: var(--surface-muted); }

.row-actions { white-space: nowrap; text-align: right; padding-right: 16px; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.row-actions .btn { min-height: 34px; padding: 6px 12px; font-size: 12.5px; }
.table-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-soft);
}
.table-footer .pagination { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Wallets */
.wallet-summary {
  margin-bottom: 24px;
  padding: 26px 30px;
  border-radius: var(--radius-xl);
  background: linear-gradient(155deg, #132b54 0%, #0d1e3b 100%);
  color: #f8fafc;
  box-shadow: var(--shadow-lg);
}
.wallet-summary > span { font-size: 13.5px; color: #cbd5e1; font-weight: 600; }
.wallet-summary > strong {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  display: block;
  margin-top: 8px;
  color: #ffffff;
}
.wallet-summary .warning-text { color: #fde68a; font-size: 13px; margin-top: 10px; }

.wallet-grid, .goal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.wallet-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  border-top: 4px solid var(--wallet-color);
  box-shadow: var(--shadow);
  min-width: 0;
}
.wallet-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 18px; }
.wallet-logo {
  color: var(--wallet-color);
  background: var(--surface-soft);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
}
.wallet-card h3 { font-size: 17px; overflow-wrap: anywhere; }
.wallet-balance { font-size: 26px; font-weight: 800; margin-top: 10px; letter-spacing: -0.03em; overflow-wrap: anywhere; color: var(--ink); }
.wallet-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.add-wallet-card {
  min-height: 210px;
  border: 2px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.add-wallet-card:hover { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-hover); }
.add-wallet-card strong { font-size: 15px; font-weight: 700; }
.add-wallet-card span { font-size: 13px; }
.add-wallet-card > .icon { width: 28px; height: 28px; }
.help-note { font-size: 13px; color: var(--muted); line-height: 1.65; margin-top: 20px; }

/* Budgets */
.budget-overview {
  padding: 24px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 22px;
}
.budget-overview span { font-size: 13px; font-weight: 600; color: var(--muted); }
.budget-overview strong { font-size: 26px; font-weight: 800; display: block; margin-top: 8px; overflow-wrap: anywhere; color: var(--ink); }
.budget-overview small { color: var(--muted); font-size: 14px; font-weight: 500; }
.budget-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.budget-item { padding: 22px 24px; }
.widget .budget-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.widget .budget-item:last-child { border-bottom: 0; padding-bottom: 0; }
.budget-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.budget-heading strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.budget-heading b {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--blue-soft);
  color: var(--blue-hover);
}
.budget-values { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 10px; flex-wrap: wrap; }
.budget-values span { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.widget .budget-values span { font-size: 17px; }
.budget-values small { font-size: 12.5px; color: var(--muted); }
.budget-status { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.budget-status b { font-weight: 700; color: var(--ink-2); }
.near .progress > div { background: #f59e0b; }
.near .budget-heading b { background: var(--amber-soft); color: var(--amber); }
.near .budget-status { color: var(--amber); }
.over .progress > div { background: var(--red); }
.over .budget-heading b { background: var(--red-soft); color: var(--red); }
.over .budget-status { color: var(--red); }
.budget-hint { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Goals & Favorites & Reports */
.goal-card { padding: 24px; }
.goal-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.goal-large-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--blue-soft);
  color: var(--blue);
  display: grid;
  place-items: center;
}
.goal-card h3 { font-size: 18px; margin-bottom: 4px; overflow-wrap: anywhere; }
.goal-amount { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin: 18px 0 14px; overflow-wrap: anywhere; color: var(--ink); }
.goal-amount small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-top: 4px; }
.goal-status { display: flex; justify-content: space-between; font-size: 12.5px; margin: 10px 0 20px; color: var(--muted); gap: 8px; }
.goal-status b { font-weight: 700; color: var(--blue); }
.goal-card > .btn { width: 100%; margin-top: 8px; }

.report-filter { margin-bottom: 20px; padding: 16px 20px; }
.report-filter .date-range-row { border: 0; padding: 0; }
.report-detail { margin-top: 20px; }

.favorite-card { padding: 24px; }
.favorite-card h3 { margin-bottom: 6px; }
.favorite-card p { margin-bottom: 10px; overflow-wrap: anywhere; }
.favorite-value { display: block; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 14px 0; color: var(--ink); }
.favorite-card .settings-actions { margin-top: 18px; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: 20px; align-items: start; }
.settings-panel { padding: 26px; }
.settings-panel h2 { margin-bottom: 16px; }
.settings-panel form label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.settings-panel form input { display: block; margin: 7px 0 16px; }
.settings-panel p { margin-bottom: 16px; }
.rates-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.rate-source { font-size: 12px; margin-top: 16px; margin-bottom: 0 !important; overflow-wrap: anywhere; }
.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.danger-panel { border-color: var(--red-border); background: #fffafa; }
.danger-panel h2 { color: var(--red); }

/* Footer */
footer {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  font-size: 12px;
  color: var(--muted);
  padding: 20px 28px 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

/* Toast */
#toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 16px);
  background: var(--navy);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 13px 20px;
  z-index: 120;
  border-radius: var(--radius-pill);
  max-width: min(92vw, 560px);
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
#toast.visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast.error { background: #991b1b; border-color: #f87171; }
#toast .btn { min-height: 32px; padding: 5px 12px; font-size: 12.5px; background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }

/* Modals */
.modal {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 0;
  width: min(94vw, 540px);
  max-height: 90vh;
  color: var(--ink);
  background: var(--surface);
  overflow: hidden;
}
.modal[open] {
  display: flex;
  flex-direction: column;
}
.modal.large { width: min(94vw, 840px); }
.modal::backdrop { background: rgba(11, 25, 51, 0.56); backdrop-filter: blur(4px); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}
.modal-header h2 { font-size: 18px; }
#entity-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.form-fields { padding: 20px 26px 12px; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; flex: 1; }
.form-fields label { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; gap: 7px; color: var(--ink-2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row > * { min-width: 0; }
.form-hint { font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  flex-shrink: 0;
}
.form-error {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  padding: 10px 14px;
  margin: 10px 26px;
  white-space: pre-wrap;
  flex-shrink: 0;
}
.form-error:empty { display: none; }
.modal-body { padding: 22px 26px; overflow-y: auto; }
.modal-body p { font-size: 14px; color: var(--ink-2); line-height: 1.65; margin-bottom: 16px; }
.modal-body > .modal-footer { padding: 16px 0 0; background: transparent; }
.modal-body form > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 14px; }
.modal-body form > label input, .modal-body form > label select { margin-top: 7px; }
.modal-body .form-error { margin: 12px 0 0; }

.file-label {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 15px;
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.file-label small { font-size: 12px; font-weight: 400; color: var(--muted); }
.file-label input { border: 0; background: none; padding: 0; min-height: 30px; }
.checkbox-label { flex-direction: row !important; align-items: flex-start; display: flex !important; gap: 10px; line-height: 1.5; font-weight: 500 !important; }
.receipt-existing { display: flex; align-items: center; justify-content: space-between; font-size: 13px; gap: 14px; flex-wrap: wrap; }
.smart-category { font-size: 12.5px; font-weight: 600; color: var(--blue); line-height: 1.5; }
.smart-category:empty { display: none; }
.export-options { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.widget-picker { display: grid; gap: 10px; }
.widget-picker .btn { justify-content: flex-start; border-radius: var(--radius-sm); }
#csv-preview { margin: 18px 0; }
#csv-preview h3 { margin-bottom: 10px; }
#csv-preview .table-scroll { max-height: 240px; }
.receipt-preview { max-width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--radius-sm); margin-bottom: 14px; }

/* =========================================================
   AUTH, UNLOCK VAULT & RECOVERY SCREENS
   ========================================================= */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
}
.auth-card {
  max-width: 490px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.auth-card-banner {
  background: linear-gradient(150deg, #132b54 0%, #0b1a36 100%);
  color: #ffffff;
  padding: 24px 30px 22px;
}
.auth-card-banner .brand-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 14px;
}
.auth-card-banner .brand-inline .brand-mark {
  background: var(--lime);
  color: var(--lime-ink);
  width: 30px;
  height: 30px;
  font-size: 15px;
}
.auth-card-banner .eyebrow { color: var(--lime); margin-bottom: 6px; }
.auth-card-banner h1 { font-size: 24px; color: #ffffff; }
.auth-card-banner p { color: #cbd5e1; font-size: 13.5px; margin-top: 6px; line-height: 1.5; }
.auth-card-body { padding: 26px 30px 28px; }
.auth-card-body p { margin: 0 0 14px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.auth-card-body p.quiet { color: var(--muted); font-size: 13px; }
.auth-card form { margin: 16px 0 18px; }
.auth-card form > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0; }
.auth-card input:not([type="checkbox"]),
.auth-card select { display: block; width: 100%; margin-top: 7px; }
.auth-card .btn.primary { width: 100%; min-height: 44px; margin-top: 6px; }
.auth-card .form-error { margin: 12px 0; }
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
}
.auth-links .btn.text-btn { flex: 1; font-size: 12.5px; min-height: 34px; padding: 6px 10px; color: var(--ink-2); }
.auth-links .btn.text-btn.active-mode {
  background: var(--lime);
  color: var(--lime-ink);
  font-weight: 700;
}
.auth-footer-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 10px; }
.recovery-code {
  background: var(--navy);
  color: var(--lime);
  padding: 18px 20px;
  border: 1px solid var(--navy-2);
  border-radius: var(--radius);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.7;
  user-select: all;
  margin: 14px 0;
}

/* Mobile "Lainnya" Sheet */
.mobile-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 25, 51, 0.52);
  backdrop-filter: blur(3px);
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.mobile-sheet {
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  padding: 16px 18px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
}
.mobile-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.mobile-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.mobile-sheet-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
}
.mobile-sheet-btn .icon { width: 18px; height: 18px; color: var(--blue); }
.mobile-sheet-btn.featured {
  grid-column: 1 / -1;
  background: var(--navy);
  border-color: var(--navy);
  color: #ffffff;
}
.mobile-sheet-btn.featured .icon { color: var(--lime); }
.mobile-sheet-btn.active {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--lime-ink);
}
.mobile-sheet-btn.active .icon { color: var(--lime-ink); }
.mobile-sheet-btn.danger-item { background: var(--red-soft); border-color: var(--red-border); color: var(--red); }
.mobile-sheet-btn.danger-item .icon { color: var(--red); }

#print-report { display: none; }
[hidden] { display: none !important; }

/* =========================================================
   RESPONSIVE BREAKPOINTS (1440 / 1024 / 768 / 390)
   ========================================================= */
@media (max-width: 1180px) {
  .topbar-inner { padding: 10px 18px; gap: 10px; }
  .nav-pill { padding: 8px 12px; font-size: 13px; }
  .nav-pill .icon { display: none; }
  .account-name-label { display: none; }
  .btn-quick-add .quick-add-full { display: none; }
  .wallet-grid, .goal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  main { padding: 20px 18px 36px; }
  .topbar-inner { padding: 10px 14px; gap: 8px; }
  .brand-text { display: none; }
  .brand { padding: 5px; }
  .top-nav { padding: 4px; gap: 2px; }
  .nav-pill { padding: 7px 10px; font-size: 12.5px; gap: 4px; }
  .topbar-right { gap: 6px; }
  .btn-quick-add { width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 50%; }
  .btn-quick-add > span { display: none; }
  .sync-button { padding: 6px 10px; min-height: 34px; font-size: 11.5px; }
  .topbar-quick-lock { display: none; }
  .account-trigger { padding: 2px 6px 2px 2px; gap: 4px; }
  .nav-popover.wide-popover { width: min(92vw, 460px); right: -10px; }
  .dashboard-hero { grid-template-columns: 1fr; padding: 22px; gap: 16px; }
  .hero-actions { align-items: flex-start; }
  .hero-action-row { justify-content: flex-start; }
  .stat-row { gap: 12px; }
  .stat-card { padding: 16px 18px; }
  .stat-card strong { font-size: 21px; }
  .widget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: 16px; }
  .widget { grid-column: auto !important; grid-row: auto !important; min-height: 290px; max-height: 430px; }
  .widget[data-widget="cashflow"] { grid-column: span 2 !important; }
  .resize-handle { display: none; }
  .budget-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .budget-overview > div:last-child { grid-column: span 2; }
  .budget-grid { grid-template-columns: 1fr; }

  /* Transactions Master-Detail collapses cleanly into List OR Dedicated Detail Screen */
  .tx-workspace { grid-template-columns: 1fr; }
  .tx-detail-pane { display: none; position: static; }
  .tx-workspace.mobile-detail-open .tx-list-pane { display: none; }
  .tx-workspace.mobile-detail-open .tx-detail-pane { display: block; }
  .tx-detail-back { display: inline-flex; }
  .tx-page-wrap.mobile-detail-open .tx-filters-card,
  .tx-page-wrap.mobile-detail-open .page-heading { display: none; }
}

@media (max-width: 767px) {
  .top-nav { display: none; }
  .topbar-inner { padding: 10px 12px; gap: 6px; }
  .brand-text { display: none; }
  .mobile-context-title {
    display: block;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-right: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .btn-quick-add { display: none; }
  .sync-button { padding: 6px 9px; min-height: 34px; font-size: 11px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  .topbar-quick-lock { display: none; }
  .account-trigger { padding: 2px; }
  .account-trigger .nav-caret { display: none; }

  main { padding: 16px 14px 108px; }
  footer { padding: 16px 14px 108px; flex-direction: column; gap: 4px; }

  .dashboard-hero { padding: 20px 18px; border-radius: var(--radius-lg); gap: 18px; }
  .hero-balance-value { font-size: 32px; }
  .quick-actions-row { max-width: none; gap: 6px; }
  .quick-action-circle { width: 46px; height: 46px; }
  .aurora-wallet-strip { grid-template-columns: 1fr; }
  .aurora-card, .mini-wallet-tile { min-height: 138px; }
  .hero-right-top { justify-content: stretch; }
  .hero-right-top .month-control { flex: 1; justify-content: space-between; }
  .ocr-result-grid { grid-template-columns: 1fr; }
  .ocr-inline-banner { flex-direction: column; align-items: stretch; }
  .hero-action-row { width: 100%; }
  .hero-action-row .month-control { flex: 1; justify-content: space-between; }
  .hero-action-row .btn.primary { width: 100%; }

  .stat-row { grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
  .stat-card {
    padding: 15px 17px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    align-items: center;
  }
  .stat-card-head { grid-column: 1; }
  .stat-card strong { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-size: 19px; }
  .stat-card small { grid-column: 1; }

  .widget-grid { grid-template-columns: 1fr; gap: 14px; }
  .widget[data-widget="cashflow"] { grid-column: auto !important; }
  .widget { max-height: none; min-height: 240px; border-radius: var(--radius-lg); }
  .widget-content { padding: 18px; }

  .wallet-grid, .goal-grid { grid-template-columns: 1fr; gap: 14px; }
  .wallet-summary { padding: 20px; }
  .budget-overview { grid-template-columns: 1fr; padding: 18px; gap: 14px; }
  .budget-overview > div:last-child { grid-column: auto; }
  .rates-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .tx-filters-card { padding: 14px; border-radius: var(--radius-lg); }
  .tx-type-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -ms-overflow-style: none; }
  .tx-type-tabs::-webkit-scrollbar { display: none; }
  .tx-type-tab { white-space: nowrap; }
  .search-box { max-width: none; width: 100%; }
  .filters { width: 100%; }
  .filters select { flex: 1; max-width: none; min-width: 120px; }
  .tx-row { padding: 12px; gap: 10px; }
  .tx-row-amount { font-size: 14px; }
  .tx-detail-pane { padding: 20px 18px; border-radius: var(--radius-lg); }
  .tx-detail-tiles { grid-template-columns: 1fr; }

  /* Mobile Bottom Navigation Dock */
  .mobile-bottom-nav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
    pointer-events: none;
  }
  .mobile-bottom-bar {
    pointer-events: auto;
    max-width: 480px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 12px 34px rgba(16, 36, 70, 0.16);
    padding: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    align-items: center;
    gap: 4px;
  }
  .mobile-nav-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 16px;
    padding: 7px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 600;
    min-height: 48px;
  }
  .mobile-nav-btn .icon { width: 19px; height: 19px; }
  .mobile-nav-btn.active {
    background: var(--lime);
    color: var(--lime-ink);
    font-weight: 800;
  }
  .mobile-add-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 0;
    background: var(--blue);
    color: #ffffff;
    display: inline-grid;
    place-items: center;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.36);
    margin: 0 4px;
  }
  .mobile-add-btn:hover { background: var(--blue-hover); }
  .mobile-add-btn .icon { width: 22px; height: 22px; }

  #toast { bottom: 86px; }
  .auth-card-banner { padding: 20px 22px; }
  .auth-card-body { padding: 20px 22px 24px; }
  .recovery-code { font-size: 14px; }
}

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

@media print {
  @page { size: A4; margin: 16mm; }
  body { background: white; font-size: 11px; color: #0f1d36; }
  #app, #modal-root, #toast { display: none !important; }
  #print-report { display: block; }
  #print-report h1 { font-size: 24px; }
  #print-report h2 { font-size: 15px; margin: 22px 0 10px; }
  .report-header { display: flex; justify-content: space-between; border-bottom: 2px solid #102446; padding-bottom: 16px; }
  .report-header p { margin-top: 6px; font-size: 13px; }
  .report-header > span { text-align: right; line-height: 1.7; font-size: 11px; }
  .report-summary { display: flex; justify-content: space-between; margin: 20px 0; padding: 16px; background: #eff4fb; border-radius: 8px; }
  .report-summary strong { display: block; font-size: 17px; margin-top: 6px; }
  #print-report table { white-space: normal; font-size: 10px; }
  #print-report th, #print-report td { padding: 7px; font-size: 10px; }
  #print-report td strong { font-size: 10px; }
  #print-report thead { display: table-header-group; }
  #print-report tr { break-inside: avoid; }
  #print-report .table-description small { font-size: 9px; }
  #print-report .report-note { margin-top: 18px; font-size: 10px; color: #5b6b82; line-height: 1.7; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
