/* Mobile-specific (MAUI BlazorWebView — touch targets, safe area insets)
   --sat / --sab: index.html inline <style> sets 24px/0px defaults so there
   is no cold-start layout jump; MainActivity's InsetsListener overrides with
   real values after 250 ms; env() is a last-resort fallback. */
:root {
  --sat: env(safe-area-inset-top,    24px);
  --sab: env(safe-area-inset-bottom, 0px);
}

/* Top AppBar strip — fills status-bar area with the card background */
.page-shell::before {
  content: '';
  display: block;
  height: var(--sat, 24px);
  background: var(--bg-card);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
}

.page-shell {
  padding-top: var(--sat);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page-content-mobile {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  /* content must clear: fixed tab-bar (60px) + bottom inset + FAB overhang (20px) */
  padding-bottom: calc(var(--sab) + 80px);
}

/* Bottom tab bar */
.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + var(--sab));
  padding-bottom: var(--sab);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding-top: 6px;
  z-index: 1000;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  background: none;
  border: none;
  text-decoration: none;
  min-width: 52px;
}
.tab-item.active, .tab-item[aria-current="page"] {
  color: var(--accent);
}
.tab-item svg { width: 22px; height: 22px; }
.tab-item.active svg, .tab-item[aria-current="page"] svg {
  stroke: var(--accent);
}

/* Central FAB slot */
.tab-fab-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
  position: relative;
}

.tab-fab {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--shadow-button), 0 0 0 4px var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  border: none;
  cursor: pointer;
}
.tab-fab:hover, .tab-fab:active {
  background: var(--accent-hover);
  transform: translateX(-50%) scale(1.06);
}
.tab-fab[aria-current="page"] {
  background: var(--accent-hover);
}

/* Mobile-specific touch targets */
.btn { min-height: 48px; }
.form-control { min-height: 48px; }
.touch-target { min-height: 44px; min-width: 44px; }

/* Mobile card */
.mobile-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-card); }

/* Transaction row */
.tx-row {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.tx-row:last-child { border-bottom: none; }
.tx-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tx-amount-positive { color: #15803D; font-weight: 700; }
.tx-amount-negative { color: #DC2626; font-weight: 700; }

/* Quick action buttons (home screen) */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; }
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 14px 8px; font-size: 11px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.quick-action svg { color: var(--accent); }

/* ── RTL layout for mobile ─────────────────────────────────────────────── */
[dir="rtl"] .bottom-tab-bar { direction: rtl; }
[dir="rtl"] .mobile-topbar { direction: rtl; text-align: right; }
[dir="rtl"] .page-content-mobile { direction: rtl; }
