/* ─── Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
/* mobile: body must not block fixed-position touch targets */
@media (max-width: 720px) {
  html, body { overflow: visible; height: auto; }
  .app { height: auto; min-height: 100dvh; overflow: visible; }
}
body { font-family: 'DM Sans', sans-serif; background: #07091A; color: #E8EAF0; }

/* ─── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  --bg-deep:     #07091A;
  --bg-panel:    #0D1B3E;
  --bg-card:     #0D1B3E;
  --bg-row:      rgba(255,255,255,0.03);
  --bg-row-hover:rgba(255,255,255,0.06);
  --border:      rgba(255,255,255,0.07);
  --border-mid:  rgba(255,255,255,0.10);
  --text-primary:#E8EAF0;
  --text-muted:  rgba(232,234,240,0.45);
  --text-dim:    rgba(232,234,240,0.28);
  --accent-teal: #00C9A7;
  --accent-amber:#F5A623;
  --accent-violet:#7B5EA7;
  --accent-violet-soft:#B89FD4;
  --accent-red:  #E05B6A;
  --accent-blue: #3A8FD4;
  --radius-sm:   6px;
  --radius-md:   9px;
  --radius-lg:   12px;
  --sidebar-w:   210px;
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s;
}

.logo-bar {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.logo-icon {
  width: 34px; height: 34px;
  background: var(--accent-teal);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 15px;
  color: #07091A;
  flex-shrink: 0;
  position: relative;
}
.logo-icon::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 13px;
  border: 1px solid rgba(0,201,167,0.28);
  animation: orbit 3s ease-in-out infinite;
}
@keyframes orbit {
  0%,100% { opacity:.4; transform:scale(1);   }
  50%      { opacity:.1; transform:scale(1.14); }
}
.logo-text { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 15px; }
.logo-text span { color: var(--accent-teal); }

.nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.nav::-webkit-scrollbar { width: 0; }

.nav-section {
  padding: 10px 14px 3px;
  font-size: 9px; font-weight: 600;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-dim);
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 400;
  color: rgba(232,234,240,0.58);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.14s;
  user-select: none;
}
.nav-item .ti { font-size: 15px; flex-shrink: 0; }
.nav-item:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.nav-item.active { color: var(--accent-teal); background: rgba(0,201,167,0.08); border-left-color: var(--accent-teal); font-weight: 500; }

.nav-badge {
  margin-left: auto;
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 8px;
}
.badge-amber { background: rgba(245,166,35,0.18); color: var(--accent-amber); }
.badge-teal  { background: rgba(0,201,167,0.14);  color: var(--accent-teal); }
.badge-violet{ background: rgba(123,94,167,0.2);  color: var(--accent-violet-soft); }

.sidebar-footer {
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 9px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-violet), var(--accent-teal));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-name  { font-size: 12px; font-weight: 500; color: var(--text-primary); }
.user-plan  { font-size: 10px; color: var(--accent-violet-soft); font-weight: 500; margin-top: 1px; }

/* ─── Main ───────────────────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  padding: 11px 20px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.page-title { font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 600; flex: 1; }

.search-box {
  display: flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 6px 10px; width: 200px;
}
.search-box .ti { font-size: 13px; color: var(--text-dim); }
.search-box input {
  background: none; border: none; outline: none;
  font-family: 'DM Sans', sans-serif; font-size: 12px;
  color: var(--text-primary); width: 100%;
}
.search-box input::placeholder { color: var(--text-dim); }

.icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: rgba(232,234,240,0.55);
  font-size: 14px; position: relative; transition: all 0.14s;
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(255,255,255,0.09); color: var(--text-primary); }
.notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 5px; height: 5px;
  background: var(--accent-amber); border-radius: 50%;
  border: 1px solid var(--bg-panel);
}

.content { flex: 1; overflow-y: auto; padding: 18px 20px; }
.content::-webkit-scrollbar { width: 4px; }
.content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ─── Pages ──────────────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ─── Shared components ──────────────────────────────────────────────────── */
.section-label {
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--text-dim);
  margin: 18px 0 9px;
}
.section-label:first-child { margin-top: 0; }
.section-label-row { display: flex; align-items: baseline; justify-content: space-between; margin: 18px 0 9px; }
.section-label-row:first-child { margin-top: 0; }
.section-label-row .section-label { margin: 0; }
.section-period { font-size: 10px; font-weight: 600; color: var(--text-dim); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 13px;
}
.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 7px;
}
.card-title .ti { font-size: 15px; }

.card-action {
  font-size: 10px; font-weight: 600;
  padding: 3px 9px; border-radius: 5px;
  background: rgba(0,201,167,0.1);
  border: 1px solid rgba(0,201,167,0.22);
  color: var(--accent-teal);
  cursor: pointer; transition: background 0.14s;
  white-space: nowrap;
}
.card-action:hover { background: rgba(0,201,167,0.2); }

/* stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; margin-bottom: 12px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  position: relative; overflow: hidden;
}
.stat-card::before { content:''; position:absolute; top:0;left:0;right:0;height:2px; }
.stat-card.teal::before   { background: var(--accent-teal); }
.stat-card.amber::before  { background: var(--accent-amber); }
.stat-card.violet::before { background: var(--accent-violet); }
.stat-card.red::before    { background: var(--accent-red); }
.stat-label { font-size: 9.5px; font-weight: 600; letter-spacing:.5px; text-transform:uppercase; color: var(--text-muted); margin-bottom: 5px; }
.stat-label-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 5px; }
.stat-label-row .stat-label { margin-bottom: 0; }
.stat-toggle-btn {
  background: none; border: none; padding: 0; margin: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 13px; line-height: 1;
  cursor: pointer; transition: color 0.14s;
  flex-shrink: 0;
}
.stat-toggle-btn:hover { color: var(--text-primary); }
.stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 21px; font-weight: 700; }
.stat-value.masked { letter-spacing: 2px; color: var(--text-muted); }
.stat-sub   { font-size: 10px; margin-top: 3px; }
.stat-sub.up   { color: var(--accent-teal); }
.stat-sub.down { color: var(--accent-red); }
.stat-sub.warn { color: var(--accent-amber); }

/* row items */
.row-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--bg-row);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  transition: background 0.13s;
  cursor: pointer;
}
.row-item:hover { background: var(--bg-row-hover); }
.row-item + .row-item { margin-top: 5px; }

.row-icon {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.row-info { flex: 1; min-width: 0; }
.row-name { font-size: 12px; font-weight: 500; }
.row-sub  { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

/* amounts */
.amount { font-family: 'Space Grotesk',sans-serif; font-size: 12px; font-weight: 600; white-space: nowrap; }
.amount.neg { color: var(--accent-red); }
.amount.pos { color: var(--accent-teal); }

/* chips */
.chip {
  display: inline-flex; align-items: center;
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 5px;
  text-transform: uppercase; letter-spacing: .5px; white-space: nowrap;
}
.chip.success { background: rgba(0,201,167,0.14);  color: var(--accent-teal); }
.chip.warning { background: rgba(245,166,35,0.14); color: var(--accent-amber); }
.chip.danger  { background: rgba(224,91,106,0.14); color: var(--accent-red); }
.chip.info    { background: rgba(123,94,167,0.18); color: var(--accent-violet-soft); }
.chip.work    { background: rgba(0,201,167,0.14);  color: var(--accent-teal); }
.chip.personal{ background: rgba(123,94,167,0.18); color: var(--accent-violet-soft); }
.chip.urgent  { background: rgba(224,91,106,0.14); color: var(--accent-red); }
.chip.travel  { background: rgba(245,166,35,0.14); color: var(--accent-amber); }

/* progress bar */
.progress { height: 3px; background: rgba(255,255,255,0.07); border-radius: 2px; }
.progress-fill { height: 100%; border-radius: 2px; transition: width .4s; }

/* divider */
hr.divider { border: none; border-top: 1px solid var(--border); margin: 11px 0; }

/* quick-action strip */
.quick-strip { display: flex; gap: 7px; margin-bottom: 14px; flex-wrap: wrap; }
.quick-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600;
  cursor: pointer; transition: background 0.14s; border: 1px solid;
}
.quick-btn .ti { font-size: 13px; }
.qb-teal   { background: rgba(0,201,167,0.09); border-color: rgba(0,201,167,0.22); color: var(--accent-teal); }
.qb-teal:hover { background: rgba(0,201,167,0.18); }
.qb-amber  { background: rgba(245,166,35,0.09); border-color: rgba(245,166,35,0.22); color: var(--accent-amber); }
.qb-amber:hover { background: rgba(245,166,35,0.18); }
.qb-violet { background: rgba(123,94,167,0.09); border-color: rgba(123,94,167,0.22); color: var(--accent-violet-soft); }
.qb-violet:hover{ background: rgba(123,94,167,0.18); }
.qb-red    { background: rgba(224,91,106,0.09); border-color: rgba(224,91,106,0.22); color: var(--accent-red); }
.qb-red:hover { background: rgba(224,91,106,0.18); }

/* two-column grid */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.col-span { grid-column: 1 / -1; }

/* bar chart */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 88px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bar-value { font-size: 9px; font-weight: 700; color: var(--text-dim); font-family: 'Space Grotesk',sans-serif; white-space: nowrap; }
.bar { width: 100%; border-radius: 4px 4px 0 0; cursor: pointer; transition: opacity .15s; }
.bar:hover { opacity: .75; }
.bar-label { font-size: 9px; color: var(--text-dim); }

/* category bar list — expandable rows with a bar-fill per category/subcategory,
   replaces the old donut+legend pair for the "By category" card */
.cat-bar-list { display: flex; flex-direction: column; gap: 3px; }
.cat-bar-empty { font-size: 11px; color: var(--text-dim); padding: 8px 2px; }

.cat-bar-head { display: flex; align-items: center; gap: 7px; padding: 5px 4px; border-radius: 6px; cursor: pointer; }
.cat-bar-head:hover { background: rgba(255,255,255,0.045); }
.cat-bar-head[data-empty="true"] { cursor: default; }
.cat-bar-head[data-empty="true"]:hover { background: none; }

.cat-bar-chevron { font-size: 10px; width: 10px; flex-shrink: 0; color: var(--text-dim); transition: transform .15s ease; }
.cat-bar-chevron.cat-bar-chevron-hidden { visibility: hidden; }
.cat-bar-chevron.open { transform: rotate(90deg); }

.cat-bar-info { flex: 1; min-width: 0; }
.cat-bar-name-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11px; margin-bottom: 4px; }
.cat-bar-name { color: rgba(232,234,240,0.85); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-bar-pct { font-family: 'Space Grotesk',sans-serif; font-weight: 700; font-size: 11px; flex-shrink: 0; }
.cat-bar-track { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.06); overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }

.cat-sub-list { display: flex; flex-direction: column; gap: 6px; margin: 0 0 0 21px; max-height: 0; overflow: hidden; transition: max-height .2s ease, margin .2s ease, padding .2s ease; }
.cat-sub-list.open { max-height: 900px; margin: 6px 0 6px 21px; padding-bottom: 2px; }
.cat-sub-name-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 10px; margin-bottom: 3px; color: var(--text-dim); }
.cat-sub-pct { font-family: 'Space Grotesk',sans-serif; font-weight: 600; }
.cat-sub-track { height: 4px; border-radius: 3px; background: rgba(255,255,255,0.045); overflow: hidden; }
.cat-sub-fill { height: 100%; border-radius: 3px; transition: width .5s ease; }

/* category card — Banking transactions by category */
.category-chart-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.category-chart-label { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); }

/* tasks */
.task-check {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid rgba(232,234,240,0.28);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--accent-teal);
  flex-shrink: 0; transition: all .14s;
}
.row-item.done .task-check { background: rgba(0,201,167,0.18); border-color: var(--accent-teal); }
.row-item.done .row-name   { text-decoration: line-through; opacity: .55; }

/* ── vault grid ─────────────────────────────────────────────────────────── */
.vault-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.vault-item {
  background: rgba(123,94,167,0.07);
  border: 1px solid rgba(123,94,167,0.18);
  border-radius: var(--radius-md);
  padding: 13px 12px;
  cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.vault-item:hover { background: rgba(123,94,167,0.16); border-color: rgba(123,94,167,0.36); transform: translateY(-1px); }
.vault-item.selected { border-color: var(--accent-teal); background: rgba(0,201,167,0.06); }
.vault-item.add-new {
  background: rgba(0,201,167,0.04);
  border: 1px dashed rgba(0,201,167,0.28);
  align-items: center; justify-content: center; min-height: 96px; gap: 4px;
}
.vault-item.add-new:hover { background: rgba(0,201,167,0.1); border-color: rgba(0,201,167,0.5); }
.vault-icon {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0; margin-bottom: 2px;
}
.vault-name { font-size: 11.5px; font-weight: 600; line-height: 1.3; word-break: break-all; }
.vault-cat  { font-size: 9px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.vault-enc  { font-size: 9px; color: rgba(184,159,212,.42); display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.vault-enc .ti { font-size: 10px; }
.vault-actions {
  position: absolute; top: 8px; right: 8px;
  display: none; gap: 4px;
}
.vault-item:hover .vault-actions,
.vault-item.selected .vault-actions { display: flex; }
.vault-act-btn {
  width: 22px; height: 22px; border-radius: 5px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; cursor: pointer; color: var(--text-muted);
  transition: all .13s;
}
.vault-act-btn:hover { background: rgba(255,255,255,0.18); color: var(--text-primary); }
.vault-act-btn.del:hover { background: rgba(224,91,106,0.2); color: var(--accent-red); border-color: rgba(224,91,106,0.3); }

/* category color badges */
.vcat-Bank     { background: rgba(58,143,212,0.16);  color: #3A8FD4; }
.vcat-Card     { background: rgba(245,166,35,0.16);  color: #F5A623; }
.vcat-API\ Key { background: rgba(0,201,167,0.14);   color: var(--accent-teal); }
.vcat-Server   { background: rgba(224,91,106,0.14);  color: var(--accent-red); }
.vcat-Identity { background: rgba(123,94,167,0.22);  color: var(--accent-violet-soft); }
.vcat-Cloud    { background: rgba(58,143,212,0.14);  color: #7ab8e8; }
.vcat-Login    { background: rgba(0,201,167,0.12);   color: var(--accent-teal); }
.vcat-Other    { background: rgba(255,255,255,0.07); color: var(--text-muted); }

/* ── vault preview panel ────────────────────────────────────────────────── */
.vault-layout { display: grid; grid-template-columns: 1fr 340px; gap: 12px; align-items: start; }
.vault-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.vault-preview-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 11px;
}
.vault-preview-icon {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.vault-preview-name { font-family:'Space Grotesk',sans-serif; font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.vault-preview-cat  { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; }
.vault-preview-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.vault-field-row { display: flex; flex-direction: column; gap: 3px; }
.vault-field-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-dim); }
.vault-field-value {
  font-family: 'DM Mono', 'Fira Code', monospace; font-size: 11.5px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 9px;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  word-break: break-all;
}
.vault-field-value span { flex: 1; color: var(--text-primary); font-size: 11px; }
.vault-copy-btn {
  width: 20px; height: 20px; border-radius: 4px;
  background: transparent; border: none;
  color: var(--text-dim); cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: color .13s;
}
.vault-copy-btn:hover { color: var(--accent-teal); }
.vault-masked { letter-spacing: 3px; color: var(--text-muted) !important; }
.vault-toggle-vis {
  background: none; border: none; color: var(--text-dim);
  font-size: 12px; cursor: pointer; padding: 0; flex-shrink: 0;
  display: flex; align-items: center;
}
.vault-toggle-vis:hover { color: var(--accent-teal); }
.vault-preview-empty {
  padding: 32px 16px; text-align: center;
  color: var(--text-muted); font-size: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.vault-preview-empty .ti { font-size: 28px; color: var(--text-dim); }
.vault-preview-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex; gap: 7px; justify-content: flex-end;
}
.vault-preview-ts { font-size: 9px; color: var(--text-dim); padding: 10px 16px 0; }

/* ── vault search/filter bar ────────────────────────────────────────────── */
.vault-toolbar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.vault-search-box {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm); padding: 6px 10px; flex: 1; min-width: 140px;
}
.vault-search-box input {
  background: none; border: none; outline: none;
  font-family:'DM Sans',sans-serif; font-size: 12px; color: var(--text-primary); width: 100%;
}
.vault-search-box input::placeholder { color: var(--text-dim); }

/* transactions page — client-side search box, same look as vault-search-box */
.tx-search-box {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm); padding: 6px 10px; margin-bottom: 10px;
}
.tx-search-box input {
  background: none; border: none; outline: none;
  font-family:'DM Sans',sans-serif; font-size: 12px; color: var(--text-primary); width: 100%;
}
.tx-search-box input::placeholder { color: var(--text-dim); }
.vault-cat-filter {
  display: flex; gap: 5px; flex-wrap: wrap;
}
.vault-cat-chip {
  font-size: 9px; font-weight: 700; padding: 3px 8px;
  border-radius: 5px; cursor: pointer; text-transform: uppercase; letter-spacing: .4px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted); transition: all .13s; user-select: none;
}
.vault-cat-chip.active, .vault-cat-chip:hover {
  background: rgba(123,94,167,0.18); border-color: rgba(123,94,167,0.4); color: var(--accent-violet-soft);
}

/* ── vault modal fields ─────────────────────────────────────────────────── */
.vault-secrets-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.vault-secret-row   { display: flex; gap: 6px; align-items: center; }
.vault-secret-row .field-input { font-size: 12px; padding: 6px 8px; }
.vault-secret-del {
  width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0;
  background: rgba(224,91,106,0.1); border: 1px solid rgba(224,91,106,0.2);
  color: var(--accent-red); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center; transition: background .13s;
}
.vault-secret-del:hover { background: rgba(224,91,106,0.22); }
.add-secret-btn {
  font-size: 11px; font-weight: 600; color: var(--accent-teal);
  background: rgba(0,201,167,0.08); border: 1px dashed rgba(0,201,167,0.3);
  border-radius: var(--radius-sm); padding: 6px 10px; cursor: pointer;
  width: 100%; text-align: center; transition: background .13s; margin-top: 2px;
}
.add-secret-btn:hover { background: rgba(0,201,167,0.16); }
.vault-del-confirm {
  background: rgba(224,91,106,0.1); border: 1px solid rgba(224,91,106,0.22);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 10px;
  font-size: 12px; color: var(--accent-red); text-align: center;
  display: none;
}
.vault-del-confirm.show { display: block; }

.vault-form-error {
  background: rgba(224,91,106,0.1); border: 1px solid rgba(224,91,106,0.28);
  border-radius: var(--radius-sm); padding: 10px 12px; margin-top: 10px;
  display: none;
}
.vault-form-error.show { display: block; }
.vault-form-error .vfe-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--accent-red);
}
.vault-form-error .vfe-list {
  margin: 6px 0 0; padding-left: 18px;
  font-size: 11.5px; color: var(--accent-red); line-height: 1.5;
}
.vault-form-error .vfe-list li { margin-bottom: 2px; }

/* reports grid */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.report-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px;
  cursor: pointer; transition: border-color .14s;
}
.report-card:hover { border-color: rgba(0,201,167,0.32); }
.report-icon {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; margin-bottom: 10px;
}
.report-name { font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.report-desc { font-size: 10px; color: var(--text-muted); line-height: 1.45; }

/* budget bars */
.budget-row + .budget-row { margin-top: 12px; }
.budget-header { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 5px; }
.budget-name   { font-weight: 500; }
.budget-amounts{ color: var(--text-muted); }

/* search */
.search-results-section { margin-bottom: 12px; }
.search-results-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chip {
  font-size: 10px; padding: 4px 9px;
  border-radius: 5px; cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted); transition: all .13s;
  user-select: none;
}
.filter-chip.active, .filter-chip:hover {
  background: rgba(0,201,167,0.1); border-color: rgba(0,201,167,0.25); color: var(--accent-teal);
}

/* empty state */
/* ─── Retail page ────────────────────────────────────────────────────────── */
.retail-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }

.retail-layout { display: grid; grid-template-columns: 1fr 240px; gap: 12px; align-items: start; }
.retail-filters { position: sticky; top: 0; }

.retail-date-input {
  color-scheme: dark; /* keeps the native calendar icon/picker readable on the dark theme */
  cursor: pointer;
}
.retail-date-input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
.retail-date-input::-webkit-calendar-picker-indicator:hover { opacity: 1; }

.retail-filter-error {
  font-size: 10.5px; color: var(--accent-red);
  background: rgba(224,91,106,0.1); border: 1px solid rgba(224,91,106,0.24);
  border-radius: var(--radius-sm); padding: 6px 9px; margin-bottom: 10px; line-height: 1.4;
}

.retail-filter-active-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  background: rgba(58,143,212,0.16); color: var(--accent-blue);
  padding: 2px 7px; border-radius: 20px;
}

.retail-filter-actions { display: flex; gap: 8px; margin-top: 6px; }
.retail-filter-btn {
  flex: 1; padding: 8px 10px;
  border-radius: var(--radius-sm); font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: opacity .14s, background .14s;
  background: var(--accent-teal); color: #07091A; border: none;
}
.retail-filter-btn:hover { opacity: .88; }
.retail-filter-btn.ghost {
  background: rgba(255,255,255,0.04); color: var(--text-muted);
  border: 1px solid var(--border-mid);
}
.retail-filter-btn.ghost:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }

@media (max-width: 900px) {
  .retail-layout { grid-template-columns: 1fr; }
  .retail-filters { position: static; }
}

.retail-match-chip {
  display: inline-block;
  font-size: 9.5px;
  background: rgba(58,143,212,0.14);
  color: var(--accent-blue);
  padding: 2px 7px;
  border-radius: 20px;
  margin-top: 4px;
}

.retail-pagination {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 14px; font-size: 11px; color: var(--text-muted);
}
.retail-pagination button {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .14s;
}
.retail-pagination button:hover:not(:disabled) { background: rgba(255,255,255,0.08); }
.retail-pagination button:disabled { opacity: .35; cursor: not-allowed; }

.retail-store-meta { font-size: 11px; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }

.retail-items-list { max-height: 320px; overflow-y: auto; padding-right: 2px; }

.retail-item-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.retail-item-row:last-child { border-bottom: none; }
.retail-item-info { flex: 1; min-width: 0; }
.retail-item-name { font-weight: 500; color: var(--text-primary); }
.retail-item-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.retail-item-price {
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.retail-item-price.discounted { color: var(--accent-teal); }

.retail-badge {
  font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  padding: 1px 6px; border-radius: 20px; margin-left: 6px; vertical-align: 1px;
}
.retail-badge.promo  { background: rgba(245,166,35,0.16); color: var(--accent-amber); }
.retail-badge.member { background: rgba(0,201,167,0.16);  color: var(--accent-teal); }

.retail-summary-row { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; color: var(--text-muted); }
.retail-summary-row.total {
  color: var(--text-primary); font-weight: 700; font-size: 13.5px;
  border-top: 1px solid var(--border-mid); margin-top: 6px; padding-top: 8px;
}

.retail-ai-note {
  margin-top: 12px; padding: 9px 11px;
  background: rgba(245,166,35,0.08); border: 1px solid rgba(245,166,35,0.22);
  border-radius: var(--radius-sm); color: var(--accent-amber);
  font-size: 11px; line-height: 1.5;
}

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; gap: 7px; text-align: center; }
.empty .ti { font-size: 28px; color: var(--text-dim); }
.empty-text { font-size: 12px; color: var(--text-muted); }

/* modal overlay */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(7,9,26,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity .15s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #111d3f; border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg); padding: 22px 24px;
  width: 380px; max-width: 94vw;
  transform: translateY(12px); transition: transform .15s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title { font-family: 'Space Grotesk',sans-serif; font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.modal-close { cursor: pointer; color: var(--text-muted); font-size: 16px; }
.modal-close:hover { color: var(--text-primary); }

/* Retail row delete (list row → inline confirm, no modal needed) */
.row-main { display: flex; align-items: center; gap: 10px; width: 100%; }

/* Without this, the .row-main/.row-delete-confirm `display: flex` rules
   above (author stylesheet) beat the browser's built-in `[hidden] { display:
   none }` rule (user-agent stylesheet) regardless of source order, so
   toggling the `hidden` property alone would never actually hide either
   panel. Explicitly re-asserting `display: none` here restores that. */
.row-main[hidden],
.row-delete-confirm[hidden] { display: none; }

.row-delete-btn {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 13px; transition: all .14s;
}
.row-delete-btn:hover { background: rgba(224,91,106,0.14); color: var(--accent-red); }

.row-delete-confirm {
  display: flex; align-items: center; gap: 10px; width: 100%;
  font-size: 11.5px; color: var(--text-primary);
}
.row-delete-confirm > .ti { color: var(--accent-red); font-size: 15px; flex-shrink: 0; }
.row-delete-confirm > span { flex: 1; line-height: 1.4; }
.row-delete-confirm-actions { display: flex; gap: 6px; flex-shrink: 0; }
.row-delete-confirm-actions button {
  border: none; border-radius: 5px; padding: 5px 11px;
  font-size: 11px; font-weight: 600; cursor: pointer; transition: opacity .14s, background .14s;
}
.row-delete-confirm-actions button:disabled { opacity: .5; cursor: not-allowed; }
.row-delete-cancel-btn { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.row-delete-cancel-btn:hover { background: rgba(255,255,255,0.1); }
.row-delete-confirm-btn { background: var(--accent-red); color: #fff; }
.row-delete-confirm-btn:hover { opacity: .85; }

.field-group { margin-bottom: 12px; }
.field-label { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-bottom: 5px; display: block; }
.field-input {
  width: 100%; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm); padding: 8px 10px;
  font-family: 'DM Sans',sans-serif; font-size: 13px;
  color: var(--text-primary); outline: none; transition: border-color .14s;
}
.field-input:focus { border-color: rgba(0,201,167,0.4); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-primary {
  width: 100%; padding: 10px;
  background: var(--accent-teal); border: none;
  border-radius: var(--radius-sm); font-family: 'DM Sans',sans-serif;
  font-size: 13px; font-weight: 600; color: #07091A;
  cursor: pointer; transition: opacity .14s; margin-top: 4px;
}
.btn-primary:hover { opacity: .88; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

/* Retail receipt upload */
.receipt-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center;
  padding: 26px 14px;
  border: 1.5px dashed var(--border-mid);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: border-color .14s, background .14s;
}
.receipt-dropzone:hover,
.receipt-dropzone.drag-over {
  border-color: rgba(0,201,167,0.45);
  background: rgba(0,201,167,0.05);
}
.receipt-dropzone .ti { font-size: 26px; color: var(--accent-teal); }
.receipt-dropzone-text { font-size: 12px; color: var(--text-primary); }
.receipt-dropzone-hint { font-size: 10px; color: var(--text-dim); }

/* These have their own `display: flex` rules above, which — being author
   styles — beat the browser's default `[hidden] { display: none }` UA rule
   regardless of source order. Re-assert it explicitly so toggling `.hidden`
   from JS actually hides them. */
.receipt-dropzone[hidden],
.receipt-preview[hidden],
.receipt-upload-success[hidden] { display: none; }

.receipt-preview {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
}
.receipt-preview img {
  width: 46px; height: 46px; object-fit: cover;
  border-radius: 5px; flex-shrink: 0;
  border: 1px solid var(--border-mid);
}
.receipt-preview-info {
  flex: 1; min-width: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.receipt-preview-name {
  font-size: 12px; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.receipt-remove-btn {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 13px; flex-shrink: 0;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 5px; transition: all .14s;
}
.receipt-remove-btn:hover { background: rgba(224,91,106,0.14); color: var(--accent-red); }

.receipt-upload-success {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px; padding: 10px 4px 4px;
}
/* Icon swaps look per status: spinning ring while in flight, solid check
   on success, solid alert on failure. Default (no modifier) covers the
   'uploaded'/'processing' in-flight look so markup doesn't need every
   status pre-declared. */
.receipt-success-icon { font-size: 34px; line-height: 1; color: var(--accent-amber); }
.receipt-success-icon .ti-loader-2 { animation: btn-spin 0.9s linear infinite; display: inline-block; }
.receipt-success-icon.status-completed { color: var(--accent-teal); }
.receipt-success-icon.status-failed   { color: var(--accent-red); }
.receipt-status-message { font-size: 12.5px; color: var(--text-primary); line-height: 1.5; }
.receipt-status-meta {
  font-size: 11px; color: var(--text-muted); line-height: 1.5;
  display: flex; flex-direction: column; gap: 2px;
}
.receipt-status-meta .error-line { color: var(--accent-red); }
.receipt-status-ref-id { font-size: 10px; color: var(--text-dim); word-break: break-all; margin-bottom: 4px; }
.receipt-upload-another-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 11.5px; cursor: pointer; padding: 4px; margin-top: -2px;
  transition: color .14s;
}
.receipt-upload-another-btn:hover { color: var(--accent-teal); }

/* ─── Retail page: in-flight/recent receipt upload status panel ─────────
   Lives above the retail list so a status stays visible even after the
   upload modal is closed — the backend keeps processing asynchronously,
   so this is where the user checks back on it.
──────────────────────────────────────────────────────────────────────────── */
.upload-status-panel {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 14px;
}
.upload-status-panel[hidden] { display: none; }

.upload-status-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  background: var(--bg-row);
}
.upload-status-row.status-completed { border-color: rgba(0,201,167,0.28); }
.upload-status-row.status-failed    { border-color: rgba(224,91,106,0.30); }

.upload-status-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: rgba(245,166,35,0.14); color: var(--accent-amber);
}
.upload-status-icon .ti-loader-2 { animation: btn-spin 0.9s linear infinite; display: inline-block; }
.upload-status-row.status-completed .upload-status-icon { background: rgba(0,201,167,0.14); color: var(--accent-teal); }
.upload-status-row.status-failed    .upload-status-icon { background: rgba(224,91,106,0.14); color: var(--accent-red); }

.upload-status-info { flex: 1; min-width: 0; }
.upload-status-name {
  font-size: 12.5px; color: var(--text-primary); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upload-status-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.upload-status-sub.error-line { color: var(--accent-red); }

.upload-status-dismiss {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 13px; flex-shrink: 0;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 5px; transition: all .14s;
}
.upload-status-dismiss:hover { background: rgba(224,91,106,0.14); color: var(--accent-red); }
.upload-status-dismiss:disabled { opacity: .25; cursor: not-allowed; }
.upload-status-dismiss:disabled:hover { background: none; color: var(--text-dim); }

/* Toast */
.toast {
  position: fixed; bottom: 18px; right: 18px; z-index: 200;
  background: #1a3060; border: 1px solid rgba(0,201,167,0.3);
  border-radius: var(--radius-md); padding: 10px 16px;
  font-size: 12px; font-weight: 500; color: var(--accent-teal);
  display: flex; align-items: center; gap: 7px;
  transform: translateY(20px); opacity: 0;
  transition: all .22s; pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Settings */
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0;
}
.settings-row + .settings-row { border-top: 1px solid var(--border); }
.settings-key   { font-size: 12px; font-weight: 400; }
.settings-value { font-size: 12px; color: var(--text-muted); }
.settings-value.teal { color: var(--accent-teal); font-weight: 600; }

/* ── Bank sync providers ────────────────────────────────────────────────── */
.bsp-provider-link { color: var(--accent-teal); }
.row-item:hover .bsp-provider-link { text-decoration: underline; }
.bsp-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; margin-bottom: 14px; transition: color .14s; user-select: none;
}
.bsp-back:hover { color: var(--text-primary); }
.field-input:disabled { opacity: .5; cursor: not-allowed; }
.bsp-back .ti { font-size: 14px; }

/* trip */
.trip-flag {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.trip-budget-col { text-align: right; flex-shrink: 0; }
.trip-spent { font-family: 'Space Grotesk',sans-serif; font-size: 13px; font-weight: 600; color: var(--accent-amber); }
.trip-of    { font-size: 10px; color: var(--text-muted); }

/* vault lock banner */
.vault-banner {
  background: rgba(123,94,167,0.08);
  border: 1px solid rgba(123,94,167,0.22);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 13px;
}
.vault-banner-icon {
  width: 32px; height: 32px; background: rgba(123,94,167,0.2);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--accent-violet-soft); flex-shrink: 0;
}
.vault-banner-text strong { font-size: 12px; font-weight: 600; display: block; margin-bottom: 2px; }
.vault-banner-text span   { font-size: 10px; color: rgba(184,159,212,.65); }
.vault-unlock-btn {
  margin-left: auto;
  background: rgba(123,94,167,0.14);
  border: 1px solid rgba(123,94,167,0.3);
  border-radius: var(--radius-sm);
  color: var(--accent-violet-soft);
  font-size: 11px; font-weight: 600;
  padding: 6px 14px; cursor: pointer;
  font-family: 'DM Sans',sans-serif;
  transition: background .14s; white-space: nowrap;
}
.vault-unlock-btn:hover { background: rgba(123,94,167,0.25); }

/* ─── Hamburger button (hidden on desktop) ───────────────────────────────── */
.hamburger {
  display: none;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-mid);
  align-items: center; justify-content: center;
  cursor: pointer; color: rgba(232,234,240,0.7);
  font-size: 16px; flex-shrink: 0;
  transition: background 0.14s;
}
.hamburger:hover { background: rgba(255,255,255,0.09); color: var(--text-primary); }

/* ─── Sidebar overlay backdrop ───────────────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(7,9,26,0.72);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.sidebar-backdrop.visible { opacity: 1; pointer-events: all; }

/* ─── Bottom nav bar (mobile only) ───────────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  z-index: 48;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}
.bottom-nav-inner {
  display: flex; justify-content: space-around; align-items: center;
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 10px;
  color: var(--text-muted); cursor: pointer;
  font-size: 9px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  border-radius: var(--radius-sm); transition: color 0.14s;
  position: relative;
}
.bottom-nav-item .ti { font-size: 18px; }
.bottom-nav-item.active { color: var(--accent-teal); }
.bottom-nav-item .bnav-dot {
  position: absolute; top: 5px; right: 8px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-amber);
}

@media (max-width: 720px) {
  /* ── Layout: override desktop scroll-lock ── */
  html, body { overflow: visible !important; height: auto !important; }
  .app   { height: auto !important; min-height: 100dvh; overflow: visible !important; flex-direction: column; }
  .main  { overflow: visible !important; min-width: 0; }
  .content { overflow-y: visible !important; height: auto !important; padding-bottom: 88px; }

  /* ── Grids ── */
  .stat-grid    { grid-template-columns: 1fr 1fr; gap: 7px; }
  .two-col      { grid-template-columns: 1fr; }
  .vault-layout { grid-template-columns: 1fr; }
  .vault-grid   { grid-template-columns: 1fr 1fr; }
  .report-grid  { grid-template-columns: 1fr; }
  .stat-card   { padding: 10px 11px; }
  .stat-value  { font-size: 17px; }

  /* ── Hamburger ── */
  .hamburger { display: flex !important; }

  /* ── Sidebar → fixed slide-over drawer ── */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 200;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
  }
  .sidebar.open { transform: translateX(0) !important; }
  .sidebar-backdrop { display: block !important; }

  /* ── Topbar ── */
  .topbar { padding: 10px 14px; gap: 8px; }
  .search-box { display: none !important; }
  .page-title { font-size: 14px; }

  /* ── Bottom nav ── */
  .bottom-nav { display: block !important; }

  /* ── Quick-strip horizontal scroll ── */
  .quick-strip { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .quick-strip::-webkit-scrollbar { height: 0; }
  .quick-btn { white-space: nowrap; flex-shrink: 0; }

  /* ── Mobile search bar ── */
  .search-box-mobile {
    display: flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    padding: 7px 10px; margin: 0 14px 10px;
  }
  .search-box-mobile .ti { font-size: 13px; color: var(--text-dim); }
  .search-box-mobile input {
    background: none; border: none; outline: none;
    font-family: 'DM Sans',sans-serif; font-size: 12px;
    color: var(--text-primary); width: 100%;
  }
  .search-box-mobile input::placeholder { color: var(--text-dim); }

  /* ── Modal ── */
  .modal { width: 94vw; padding: 18px 16px; }
  .field-row { grid-template-columns: 1fr; }

  /* ── Toast above bottom nav ── */
  .toast { bottom: 76px; right: 12px; left: 12px; }
}

@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr; }
}

/* ─── Reusable page-loading skeleton ─────────────────────────────────────
   Pulsing placeholder blocks shown the instant a page is navigated to,
   before that page's real content has come back from the backend. Same
   markup/animation is reused across every view via app.js's PAGE_SKELETONS
   map — nothing view-specific lives here.
──────────────────────────────────────────────────────────────────────────── */
.skeleton-block {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}
.skeleton-block::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(100deg,
    transparent 20%,
    rgba(255,255,255,0.07) 45%,
    rgba(255,255,255,0.14) 50%,
    rgba(255,255,255,0.07) 55%,
    transparent 80%);
  transform: translateX(-100%);
  animation: skeleton-sweep 1.5s ease-in-out infinite;
}
@keyframes skeleton-sweep {
  100% { transform: translateX(100%); }
}

.skeleton-stat { height: 78px; border-radius: var(--radius-md); }

.skeleton-row {
  height: 50px; border-radius: var(--radius-sm); margin-bottom: 5px;
}

.skeleton-card { height: 100px; border-radius: var(--radius-lg); }

/* Sits inside .cat-bar-list (cat-bars-banking / cat-bars-retail), which is
   already `display:flex; flex-direction:column`, so these just stack as
   short lines standing in for legend rows while category data loads. */
.skeleton-legend { height: 11px; border-radius: 4px; width: 100%; border-width: 0; background-color: rgba(255,255,255,0.06); }
.skeleton-legend:nth-child(1) { width: 92%; }
.skeleton-legend:nth-child(2) { width: 78%; }
.skeleton-legend:nth-child(3) { width: 85%; }
.skeleton-legend:nth-child(4) { width: 65%; }
.skeleton-legend:nth-child(5) { width: 72%; }

/* Sits inside #bar-chart, which is already `display:flex; align-items:flex-end`,
   so these just need to be flexible-width columns of varying height. */
.skeleton-bar { flex: 1; border-radius: 4px 4px 0 0; align-self: flex-end; border-width: 0; background-color: rgba(255,255,255,0.06); }
.skeleton-bar:nth-child(1) { height: 46%; }
.skeleton-bar:nth-child(2) { height: 68%; }
.skeleton-bar:nth-child(3) { height: 52%; }
.skeleton-bar:nth-child(4) { height: 88%; }
.skeleton-bar:nth-child(5) { height: 60%; }
.skeleton-bar:nth-child(6) { height: 100%; }

/* ─── Global API loading indicator ───────────────────────────────────────
   Slim animated bar pinned to the top of the viewport. Shown automatically
   whenever a backend call is in flight (see Services wrapper in app.js).
──────────────────────────────────────────────────────────────────────────── */
.api-progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.api-progress-bar.active { opacity: 1; }
.api-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-teal, #00C9A7), #3A8FD4, var(--accent-teal, #00C9A7));
  background-size: 200% 100%;
  box-shadow: 0 0 8px rgba(0,201,167,0.55);
  border-radius: 0 3px 3px 0;
}
.api-progress-bar.active .api-progress-fill {
  animation: api-progress-grow 1.1s cubic-bezier(.4,0,.2,1) infinite,
             api-progress-shimmer 1.3s linear infinite;
}
.api-progress-bar.leaving .api-progress-fill {
  animation: none;
  width: 100%;
  transition: width .2s ease, opacity .2s ease .1s;
}
@keyframes api-progress-grow {
  0%   { width: 0%; }
  55%  { width: 68%; }
  100% { width: 90%; }
}
@keyframes api-progress-shimmer {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* ─── Button loading state ───────────────────────────────────────────────
   Applied to a button mid-request: hides label, disables interaction, and
   shows a small inline spinner without changing the button's size.
──────────────────────────────────────────────────────────────────────────── */
.btn-primary.btn-loading {
  color: transparent !important;
  pointer-events: none;
  position: relative;
}
.btn-primary.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 15px; height: 15px;
  margin: -7.5px 0 0 -7.5px;
  border-radius: 50%;
  border: 2px solid rgba(7,9,26,0.28);
  border-top-color: #07091A;
  animation: btn-spin .6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
/* ─── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .skeleton-block::after,
  .api-progress-bar.active .api-progress-fill,
  .auth-spinner,
  .btn-primary.btn-loading::after,
  .receipt-success-icon .ti-loader-2,
  .upload-status-icon .ti-loader-2 {
    animation: none !important;
  }
}