/* ==========================================================================
   THE SETYAWAN'S MOBILE WEB USER - REFERENCE FINTECH DESIGN SYSTEM
   Inspired by modern iOS budgeting aesthetic (Dark Slate, Emerald Card,
   Collapsible Amber Group Cards, Outlined [BUDGET] Badges, Flat 5-Tab Nav)
   ========================================================================== */

:root {
  --m-bg-page: #070a12;
  --m-bg-app: #0f1526;
  --m-bg-card: #161f36;
  --m-bg-card-header: #1d2844;
  --m-bg-card-hover: #243152;

  /* Midnight City Dark Blue Card & Accent Colors */
  --m-emerald-card: #172544;
  --m-emerald-card-border: rgba(96, 165, 250, 0.24);
  --m-emerald-track: #0e172c;
  --m-emerald-fill: rgba(59, 130, 246, 0.32);
  --m-emerald-text: #60a5fa;

  /* Borders & Lines */
  --m-border: rgba(148, 163, 184, 0.1);
  --m-border-circle: rgba(96, 165, 250, 0.42);
  --m-border-icon: rgba(148, 163, 184, 0.16);
  --m-border-dashed: rgba(148, 163, 184, 0.22);

  /* Typography Colors */
  --m-text-main: #f8fafc;
  --m-text-muted: #94a3b8;
  --m-text-sub: #7a89a3;
  --m-amber-group: #f59e0b;

  /* Status Colors */
  --m-accent: #3b82f6;
  --m-success: #38bdf8;
  --m-warning: #f59e0b;
  --m-danger: #ef4444;

  /* Radii */
  --m-radius-xs: 4px;
  --m-radius-sm: 10px;
  --m-radius-md: 14px;
  --m-radius-lg: 18px;
  --m-radius-xl: 22px;
  --m-radius-full: 9999px;

  --m-safe-bottom: env(safe-area-inset-bottom, 8px);
}

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

html, body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background-color: var(--m-bg-page);
  color: var(--m-text-main);
  line-height: 1.4;
  display: flex;
  justify-content: center;
  align-items: center;
  letter-spacing: -0.15px;
}

/* ==========================================================================
   GLOBAL SCROLLBAR ELIMINATION (100% NATIVE MOBILE FEEL)
   ========================================================================== */
.mobile-content-area,
.m-category-grid,
.m-chips-scroll,
.m-envelope-filter-bar,
.m-search-box {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.mobile-content-area::-webkit-scrollbar,
.m-category-grid::-webkit-scrollbar,
.m-chips-scroll::-webkit-scrollbar,
.m-envelope-filter-bar::-webkit-scrollbar,
.m-search-box::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* ==========================================================================
   APP WRAPPER & SMARTPHONE FRAME PROPORTIONS
   ========================================================================== */
.mobile-app-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 50% 25%, #1a2135 0%, #090b11 100%);
  overflow: hidden;
}

.mobile-phone-frame {
  width: 100%;
  max-width: 402px;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background-color: var(--m-bg-app);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Desktop Smartphone Mockup Styling (Screens > 480px) */
@media (min-width: 481px) {
  .mobile-phone-frame {
    height: min(868px, calc(100dvh - 32px));
    border-radius: 44px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
      0 28px 75px -15px rgba(0, 0, 0, 0.95),
      0 0 0 8px #1e2436,
      0 0 0 10px rgba(255, 255, 255, 0.08);
  }
}

/* Mobile Screens (Edge-to-Edge) */
@media (max-width: 480px) {
  .mobile-app-wrapper {
    background: var(--m-bg-app);
  }
  .mobile-phone-frame {
    max-width: 100%;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }
  .ios-status-bar {
    display: none !important;
  }
}

/* ==========================================================================
   iOS STATUS BAR (TOP BAR LIKE REFERENCE)
   ========================================================================== */
.ios-status-bar {
  flex-shrink: 0;
  height: 36px;
  padding: 6px 20px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 200;
  user-select: none;
}

.status-left {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.status-time {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.status-subbrand {
  font-size: 8.5px;
  font-weight: 600;
  color: #cbd5e1;
}

.phone-dynamic-island {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 22px;
  background-color: #000000;
  border-radius: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.status-right {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ffffff;
}

.status-battery {
  background-color: #e2e8f0;
  color: #0f172a;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 5px;
  line-height: 1.2;
}

/* ==========================================================================
   REFERENCE TOP NAVIGATION BAR (February '25 + Circular Outlined Buttons)
   ========================================================================== */
.mobile-header {
  flex-shrink: 0;
  padding: 8px 16px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--m-bg-app);
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.period-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Circular Outlined Action Button (Midnight City Blue Style) */
.circle-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.1);
  border: 1.3px solid var(--m-border-circle);
  color: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  transition: all 0.15s ease;
}

.circle-icon-btn:active {
  transform: scale(0.9);
  background: rgba(59, 130, 246, 0.25);
}

.notify-dot {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ef4444;
  border: 1.5px solid var(--m-bg-app);
}

/* Active Logged-in User Badge (Static, No Switcher) */
.m-active-user-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: var(--m-emerald-text);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--m-radius-full);
  cursor: pointer;
  user-select: none;
}

/* Compact Role Switcher (Legacy Compatibility) */
.m-role-switcher {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-full);
  padding: 1.5px;
}

.m-role-btn {
  background: transparent;
  border: none;
  color: var(--m-text-sub);
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: var(--m-radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.m-role-btn.active {
  background: rgba(59, 130, 246, 0.22);
  color: #60a5fa;
}

/* ==========================================================================
   MAIN SCROLLABLE CONTENT AREA
   ========================================================================== */
.mobile-content-area {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 14px 86px 14px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.mobile-screen {
  display: none;
  animation: fadeInRef 0.18s ease-out;
}

.mobile-screen.active {
  display: block;
}

@keyframes fadeInRef {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   REFERENCE "LEFTOVER" / SISA PAGU TOP ROW
   ========================================================================== */
.ref-leftover-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 12px 2px;
}

.leftover-label-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.leftover-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.info-circle-icon {
  background: transparent;
  border: none;
  color: var(--m-text-sub);
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 2px;
}

.leftover-amount-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.curved-arrow-icon {
  color: var(--m-text-sub);
}

.leftover-amount-val {
  font-size: 21px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.ref-subtitle-muted {
  font-size: 11px;
  font-weight: 600;
  color: var(--m-text-sub);
}

/* ==========================================================================
   REFERENCE EMERALD CARD ("Estimated income" / Safe-to-Spend)
   ========================================================================== */
.ref-income-card {
  background-color: var(--m-emerald-card);
  border: 1px solid var(--m-emerald-card-border);
  border-radius: var(--m-radius-lg);
  padding: 14px 14px 12px 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.ref-income-card:active {
  transform: scale(0.99);
}

.ref-income-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

.ref-income-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: var(--m-emerald-text);
  margin-bottom: 3px;
}

.ref-status-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1.5px 6px;
  border-radius: 4px;
  border: 1px solid rgba(96, 165, 250, 0.42);
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.22);
}

.ref-status-tag.badge-warning {
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.15);
}

.ref-status-tag.badge-danger {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.15);
}

.ref-income-sub {
  font-size: 11.5px;
  color: #9ca3af;
}

.ref-income-sub strong {
  color: #e2e8f0;
  font-weight: 700;
}

.ref-chevron-right {
  color: #9ca3af;
  flex-shrink: 0;
}

/* Inner Progress Bar inside Midnight Blue Card */
.ref-income-progress-box {
  position: relative;
  height: 32px;
  background-color: var(--m-emerald-track);
  border-radius: var(--m-radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ref-income-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background-color: var(--m-emerald-fill);
  border-right: 1.5px solid rgba(96, 165, 250, 0.55);
  transition: width 0.4s ease;
}

.ref-income-progress-labels {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

/* Compact Quick Record Strip */
.ref-quick-record-strip {
  background-color: var(--m-bg-card);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-md);
  padding: 10px 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ref-quick-record-strip:active {
  background-color: var(--m-bg-card-hover);
}

.strip-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.strip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--m-emerald-text);
  box-shadow: 0 0 6px var(--m-emerald-text);
}

.strip-text {
  font-size: 11.5px;
  font-weight: 600;
  color: #e2e8f0;
}

.strip-cta {
  font-size: 11px;
  font-weight: 700;
  color: var(--m-emerald-text);
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.35);
  padding: 3px 9px;
  border-radius: var(--m-radius-full);
}

/* ==========================================================================
   REFERENCE COLLAPSIBLE GROUP CARDS (Sport & Fitness / Food Style)
   ========================================================================== */
.ref-groups-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ref-group-card {
  background-color: var(--m-bg-card);
  border-radius: var(--m-radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.ref-group-header {
  background-color: var(--m-bg-card-header);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.ref-group-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.group-chevron {
  color: #cbd5e1;
  transition: transform 0.2s ease;
}

.ref-group-header.collapsed .group-chevron {
  transform: rotate(180deg);
}

.ref-group-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--m-amber-group);
  letter-spacing: -0.15px;
}

.ref-group-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ref-group-total {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

.six-dots-handle {
  color: #94a3b8;
  display: flex;
  align-items: center;
  opacity: 0.75;
}

.ref-group-body {
  padding: 4px 12px 12px 12px;
}

.ref-group-body.collapsed {
  display: none;
}

/* Individual Category / Transaction Row inside Group Card */
.ref-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.ref-item-row:last-of-type {
  border-bottom: none;
}

.ref-item-row:active {
  opacity: 0.75;
}

.ref-item-left {
  display: flex;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

/* Outlined Circle Icon (Reference Style) */
.ref-item-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.2px solid var(--m-border-icon);
  background-color: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.ref-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.ref-item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ref-item-tags-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Outlined [BUDGET] Badge from Reference */
.ref-budget-tag {
  display: inline-block;
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.25;
}

.ref-budget-tag.tag-danger {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.45);
}

.ref-budget-tag.tag-warning {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
}

.ref-budget-tag.tag-papa {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.4);
}

.ref-budget-tag.tag-mama {
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.4);
}

.ref-item-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ref-item-amounts {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ref-item-primary-val {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}

.ref-item-sub-spent {
  font-size: 10.5px;
  color: var(--m-text-sub);
}

/* Dashed "Edit section" / "+ Catat" Button inside Group Card */
.ref-dashed-btn {
  width: 100%;
  margin-top: 8px;
  padding: 11px 12px;
  background: transparent;
  border: 1.2px dashed var(--m-border-dashed);
  border-radius: var(--m-radius-md);
  color: #f8fafc;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ref-dashed-btn:active {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-ref-link {
  background: transparent;
  border: none;
  color: var(--m-emerald-text);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   SCREEN 2: AMPLOP BELANJA FILTERS & STATUS PILLS
   ========================================================================== */
.m-envelope-summary-pills {
  display: flex;
  gap: 5px;
}

.m-env-pill-stat {
  background: var(--m-bg-card);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-full);
  padding: 4px 8px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.m-env-pill-stat.pill-safe { color: #60a5fa; }
.m-env-pill-stat.pill-warning { color: #fbbf24; }
.m-env-pill-stat.pill-danger { color: #f87171; }
.pill-dot { font-size: 7px; }

.section-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--m-text-muted);
  background: var(--m-bg-card);
  padding: 2px 8px;
  border-radius: var(--m-radius-full);
  border: 1px solid var(--m-border);
}

.m-envelope-filter-bar,
.m-filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
}

.m-filter-pill {
  flex: 1;
  background-color: var(--m-bg-card);
  border: 1px solid var(--m-border);
  color: var(--m-text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: var(--m-radius-md);
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: all 0.15s ease;
}

.m-filter-pill.active {
  background-color: var(--m-emerald-card);
  border-color: rgba(96, 165, 250, 0.45);
  color: var(--m-emerald-text);
  font-weight: 700;
}

.m-envelope-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   SCREEN 3: CATAT PENGELUARAN FORM
   ========================================================================== */
.m-amount-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--m-emerald-text);
  margin-bottom: 6px;
}

.m-amount-input-box {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 12px;
}

.m-currency {
  font-size: 22px;
  font-weight: 800;
  color: var(--m-emerald-text);
}

.m-amount-input {
  width: 100%;
  background: transparent;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: #ffffff;
  outline: none;
  letter-spacing: -0.8px;
}

.m-amount-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.m-chips-scroll {
  display: flex;
  gap: 5px;
  overflow-x: auto;
}

.m-chip-btn {
  background: var(--m-emerald-track);
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: #dbeafe;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--m-radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.m-chip-btn:active {
  background: var(--m-emerald-text);
  color: #091326;
}

.m-chip-btn.chip-reset {
  border-color: rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

/* Category Grid Tiles */
.m-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 7px;
  max-height: 230px;
  overflow-y: auto;
  overflow-x: hidden;
}

.m-cat-card {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-md);
  padding: 8px 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.m-cat-card.active {
  background-color: var(--m-emerald-card);
  border-color: var(--m-emerald-text);
}

.m-cat-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--m-border-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  flex-shrink: 0;
}

.m-cat-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.m-cat-name {
  display: block;
  width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-cat-sub {
  display: block;
  width: 100%;
  font-size: 9.5px;
  color: var(--m-text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Wallet Selector */
.m-wallet-selector {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.m-wallet-pill {
  padding: 8px 10px;
  border-radius: var(--m-radius-md);
  border: 1px solid var(--m-border);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.m-wallet-pill.active {
  background: var(--m-emerald-card);
  border-color: var(--m-emerald-text);
}

.wallet-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wallet-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.wallet-check {
  font-size: 13px;
  font-weight: 800;
  color: transparent;
}

.m-wallet-pill.active .wallet-check {
  color: var(--m-emerald-text);
}

/* Input with Icon */
.m-input-with-icon {
  display: flex;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-md);
  padding: 0 11px;
}

.m-input-with-icon:focus-within {
  border-color: var(--m-emerald-text);
}

.input-icon {
  font-size: 13px;
  margin-right: 8px;
}

.m-text-input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 11px 0;
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}

.m-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: var(--m-radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 13px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.m-submit-btn:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* ==========================================================================
   SCREEN 4 & 5: QUICK-TAP, SEARCH & TRANSACTION DELETE BUTTON
   ========================================================================== */
.m-counter-stats-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 8px;
}

.counter-stat-card {
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-md);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.counter-stat-title {
  font-size: 10.5px;
  color: var(--m-text-sub);
}

.counter-stat-num {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.counter-stat-desc {
  font-size: 10px;
  color: var(--m-emerald-text);
}

.m-search-box {
  display: flex;
  align-items: center;
  background-color: var(--m-bg-card);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-md);
  padding: 0 12px;
  margin-bottom: 10px;
}

.search-icon {
  font-size: 12px;
  margin-right: 8px;
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 0;
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: var(--m-text-sub);
  font-size: 12px;
  cursor: pointer;
}

.btn-m-del-tx {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s ease;
}

.btn-m-del-tx:hover,
.btn-m-del-tx:active {
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   REFERENCE 5-TAB FLAT BOTTOM NAVIGATION + iOS HOME INDICATOR
   ========================================================================== */
.mobile-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(19, 23, 34, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 6px 6px 6px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bottom-nav-tabs {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.nav-tab {
  background: transparent;
  border: none;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 4px 6px;
  flex: 1;
  transition: color 0.15s ease, transform 0.15s ease;
}

.nav-tab:active {
  transform: scale(0.92);
}

.nav-tab.active {
  color: var(--m-emerald-text);
}

.nav-tab .tab-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: -0.1px;
}

.ios-home-indicator {
  width: 120px;
  height: 4px;
  background-color: #ffffff;
  border-radius: 4px;
  margin-top: 7px;
  margin-bottom: 2px;
  opacity: 0.9;
}

/* ==========================================================================
   DELETE CONFIRMATION BOTTOM SHEET MODAL
   ========================================================================== */
.m-bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.m-bottom-sheet-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.m-bottom-sheet {
  width: 100%;
  max-width: 402px;
  background-color: var(--m-bg-card);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px 22px 0 0;
  padding: 14px 18px 22px 18px;
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.m-bottom-sheet-overlay.show .m-bottom-sheet {
  transform: translateY(0);
}

.sheet-handle-bar {
  width: 34px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin-bottom: 14px;
}

.sheet-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.2px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 10px;
}

.sheet-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.sheet-desc {
  font-size: 12px;
  color: var(--m-text-muted);
  margin-bottom: 12px;
}

.sheet-tx-summary {
  width: 100%;
  background: var(--m-bg-app);
  border: 1px solid var(--m-border);
  border-radius: var(--m-radius-md);
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet-tx-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
}

.sheet-tx-label { color: var(--m-text-sub); }
.sheet-tx-amount { font-weight: 800; color: #f87171; }
.sheet-tx-name { font-weight: 700; color: #ffffff; }
.sheet-tx-user { font-weight: 700; color: var(--m-emerald-text); }

.sheet-warning-note {
  font-size: 10px;
  color: #fca5a5;
  margin-bottom: 14px;
}

.sheet-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.btn-sheet-delete {
  width: 100%;
  background-color: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: var(--m-radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 11px;
  cursor: pointer;
}

.btn-sheet-cancel {
  width: 100%;
  background: transparent;
  border: 1.2px dashed var(--m-border-dashed);
  border-radius: var(--m-radius-md);
  color: var(--m-text-muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 10px;
  cursor: pointer;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.mobile-toast {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--m-emerald-card);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--m-radius-full);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 1200;
  white-space: nowrap;
}

.mobile-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.m-loading-text {
  padding: 20px 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--m-text-sub);
}

/* ==========================================================================
   MOBILE AUTHENTICATION SPLASH & LOGIN GATE (FAMILY PHOTO LAYOUT)
   ========================================================================== */
.m-login-overlay {
  position: absolute;
  inset: 0;
  background-color: #05070c;
  z-index: 900;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px 14px 22px 14px;
  overflow: hidden;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.m-login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
}

/* Full Family Portrait Photo Layer */
.m-login-bg-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: 32% center;
  background-repeat: no-repeat;
  z-index: 0;
  transform: scale(1.01);
}

/* Subtle Vignette: Keeps all 4 family faces bright & clear while darkening right side slightly */
.m-login-bg-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 12, 0.0) 0%, rgba(5, 7, 12, 0.05) 42%, rgba(7, 11, 22, 0.55) 100%),
    linear-gradient(180deg, rgba(5, 7, 12, 0.18) 0%, rgba(5, 7, 12, 0.0) 35%, rgba(5, 7, 12, 0.55) 100%);
  z-index: 1;
  pointer-events: none;
}

.m-login-container {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
}

/* Top-Right Title Area (Does not block Papa & Mama on the left/center) */
.m-login-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 4px;
  padding-right: 4px;
}

.m-login-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #93c5fd;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(96, 165, 250, 0.4);
  padding: 3px 10px;
  border-radius: var(--m-radius-full);
}

.m-login-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.4px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

.m-login-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  max-width: 210px;
  line-height: 1.35;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95);
}

/* Full-Width Transparent Form Area at Bottom so Photo Shows Through Clearly */
.m-login-bottom-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.m-login-card {
  width: 100%;
  background: rgba(10, 15, 28, 0.24);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.m-login-field {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.m-login-input-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  background-color: rgba(8, 12, 24, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 999px;
  padding: 0 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.m-login-input-wrap:focus-within {
  background-color: rgba(8, 12, 24, 0.58);
  border-color: var(--m-emerald-text);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.m-login-field-icon {
  font-size: 13px;
  margin-right: 9px;
  flex-shrink: 0;
}

.m-login-input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 11px 0;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.m-login-input::placeholder {
  color: rgba(226, 232, 240, 0.75);
  font-weight: 500;
  font-size: 12.5px;
}

.m-login-eye-btn {
  background: transparent;
  border: none;
  color: #e2e8f0;
  cursor: pointer;
  padding: 4px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.m-login-error {
  background: rgba(239, 68, 68, 0.28);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fecaca;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 12px;
  text-align: center;
}

.m-login-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.82) 0%, rgba(29, 78, 216, 0.88) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  border: 1px solid rgba(96, 165, 250, 0.5);
  border-radius: 999px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  padding: 11.5px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.m-login-submit-btn:active {
  transform: scale(0.98);
  opacity: 0.92;
}

.m-login-cancel-switch {
  width: 100%;
  background: rgba(15, 23, 42, 0.38);
  border: 1px dashed rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  color: #e2e8f0;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}

.m-login-footer {
  width: 100%;
  font-size: 10px;
  color: rgba(226, 232, 240, 0.8);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* ==========================================================================
   SCREEN 6: PROFILE SCREEN (AVATAR, CHANGE PASSWORD, LOGOUT)
   ========================================================================== */
.m-header-avatar-btn {
  overflow: visible;
  padding: 0;
}

.m-header-avatar-btn.active-profile {
  border-color: var(--m-emerald-text);
  background: rgba(59, 130, 246, 0.25);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.m-header-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.m-header-avatar-emoji {
  font-size: 14px;
  line-height: 1;
}

.m-profile-hero-card {
  cursor: default !important;
  padding: 18px 16px;
}

.m-profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.m-profile-avatar-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: var(--m-emerald-track);
  border: 2px solid var(--m-emerald-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.m-profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.m-profile-avatar-fallback {
  font-size: 34px;
  line-height: 1;
}

.m-profile-camera-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--m-bg-card);
  border: 1.5px solid var(--m-emerald-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.m-profile-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.m-profile-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.m-profile-phone {
  font-size: 12px;
  font-weight: 600;
  color: #bfdbfe;
}

.m-profile-photo-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.m-btn-photo-change {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #eff6ff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--m-radius-sm);
  cursor: pointer;
}

.m-btn-photo-remove {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: var(--m-radius-sm);
  cursor: pointer;
}

.m-profile-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.m-profile-logout-note {
  font-size: 11.5px;
  color: var(--m-text-muted);
  line-height: 1.45;
}

.m-btn-logout-full {
  width: 100%;
  background: rgba(239, 68, 68, 0.14);
  border: 1.2px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  border-radius: var(--m-radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.m-btn-logout-full:active {
  background: #ef4444;
  color: #ffffff;
  transform: scale(0.98);
}
