/* ============================================================
   Smart Float — Theme
   Primary: Blue | Secondary: Yellow | Success: Blue | Warning: Orange | Danger: Red
   Typography: Poppins (display) / Inter (body) / Roboto Mono (data)
   ============================================================ */

:root {
  --blue-900: #0B2A5B;
  --blue-700: #1450C7;
  --blue-600: #1D5EE6;
  --blue-100: #E7EEFD;
  --yellow-500: #FFC72C;
  --yellow-400: #FFD861;
  --yellow-100: #FFF6DC;
  --success: #1D5EE6;
  --warning: #F5921B;
  --danger: #E5484D;
  --ink: #101728;
  --ink-soft: #5B6478;
  --bg: #F6F8FC;
  --card: #FFFFFF;
  --border: #E7EAF3;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(16, 23, 40, 0.06), 0 1px 2px rgba(16, 23, 40, 0.04);
  --shadow-lift: 0 16px 40px rgba(16, 23, 40, 0.10);
}

[data-theme="dark"] {
  --ink: #EDF1FB;
  --ink-soft: #9AA5BD;
  --bg: #0B1120;
  --card: #121A2E;
  --border: #1F2A44;
  --blue-100: #16213B;
  --yellow-100: #241D0B;
  --shadow: 0 8px 24px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
}

h1, h2, h3, .brand, .stat-value {
  font-family: 'Poppins', 'Inter', sans-serif;
}

.mono { font-family: 'Roboto Mono', monospace; }

a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--blue-900), #0A2148);
  color: #fff;
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: calc(4px + env(safe-area-inset-top, 0px)) 4px 20px; }
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
}
.sidebar .brand .logo-img, .logo-img {
  width: 36px; height: 36px; border-radius: 10px;
  object-fit: cover; background: #fff; flex-shrink: 0;
}
.sidebar-close-btn {
  display: none;
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255,255,255,0.08); border: none; color: #fff;
  font-size: 15px; cursor: pointer; align-items: center; justify-content: center;
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(11,42,91,0.55);
  z-index: 39; opacity: 0; transition: opacity .2s ease;
}
.sidebar-overlay.show { display: block; opacity: 1; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: #C9D6F5;
  font-size: 14.5px;
  font-weight: 500;
  position: relative;
  transition: background .15s ease, color .15s ease, padding-left .15s ease;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; padding-left: 17px; }
.nav-link.active { background: var(--yellow-500); color: var(--blue-900); font-weight: 700; box-shadow: 0 4px 14px rgba(255,199,44,0.35); }
.nav-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #6E82B5; padding: 18px 14px 6px; }
.sidebar-footer { margin-top: auto; padding: 12px; }

.main {
  flex: 1;
  min-width: 0;
  padding: 22px 28px 60px;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.topbar h1 { font-size: 22px; margin: 0; }
.topbar .sub { color: var(--ink-soft); font-size: 13.5px; margin-top: 2px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  padding: 6px 14px 6px 6px; border-radius: 999px; box-shadow: var(--shadow);
  transition: box-shadow .15s ease;
}
.user-chip:hover { box-shadow: var(--shadow-lift); }
.user-chip .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue-100); color: var(--blue-700);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
  overflow: hidden; flex-shrink: 0;
}
.user-chip .avatar img { width: 100%; height: 100%; object-fit: cover; }

.hamburger-btn, .back-btn {
  display: flex;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--card); border: 1.5px solid var(--border);
  align-items: center; justify-content: center;
  font-size: 17px; cursor: pointer; flex-shrink: 0; color: var(--ink);
}
.hamburger-btn { display: none; }

.sub-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  text-decoration: none; border: 1.5px solid transparent; transition: transform .1s ease;
}
.sub-chip:hover { transform: translateY(-1px); }
.sub-chip-ok { background: var(--blue-100); color: var(--blue-700); }
.sub-chip-warn { background: var(--yellow-100); color: var(--warning); border-color: #FCE6A8; }
.sub-chip-bad { background: #FDE9E9; color: var(--danger); animation: pulse-bad 1.8s infinite; }
@keyframes pulse-bad { 0%,100% { box-shadow: 0 0 0 0 rgba(229,72,77,0.25); } 50% { box-shadow: 0 0 0 5px rgba(229,72,77,0); } }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: box-shadow .2s ease, transform .2s ease;
}
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 14px; }

.stat-card { transition: transform .15s ease, box-shadow .15s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1000px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Mobile: sidebar becomes a slide-in drawer ---------- */
@media (max-width: 860px) {
  .hamburger-btn { display: flex; }
  .sidebar-close-btn { display: flex; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 82vw;
    max-width: 300px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .25s ease;
    overflow-y: auto;
    box-shadow: var(--shadow-lift);
  }
  .sidebar.open { transform: translateX(0); }

  .main { padding: 22px 14px 70px; }
  .topbar { gap: 10px; }
  .topbar h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
  .topbar .sub { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
  .user-chip-text { display: none; }
  .user-chip { padding: 4px; }
  .sub-chip-label { display: none; }
  .sub-chip { padding: 9px; }

  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px; border-radius: 16px; }
  .stat-value { font-size: 21px; }
  table { font-size: 12.5px; }
  th, td { padding: 9px 8px; }
}

@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .main { padding: 20px 12px 70px; }
  .auth-card { padding: 30px 22px; }
}

/* ============================================================
   MyMTN-style mobile home: hero balance card + quick actions +
   persistent bottom navigation bar. Hidden on desktop; the
   existing stat-card grid above is hidden on mobile instead.
   ============================================================ */
.mobile-only { display: none; }
.desktop-only { display: block; }

@media (max-width: 860px) {
  .mobile-only { display: block; }
  .desktop-only { display: none; }
}

.balance-hero {
  background: linear-gradient(135deg, var(--blue-900) 0%, #123a7a 60%, var(--blue-700) 100%);
  border-radius: 22px;
  padding: 22px 20px 18px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 14px 30px rgba(11,42,91,0.28);
}
.balance-hero::after {
  content: '';
  position: absolute; right: -40px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,199,44,0.22), transparent 70%);
}
.balance-hero-label { font-size: 12.5px; color: #B9C7EA; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.balance-hero-value { font-family: 'Poppins', sans-serif; font-size: 32px; font-weight: 700; margin-top: 4px; }
.balance-hero-sub { font-size: 12.5px; color: #C9D6F5; margin-top: 2px; }
.balance-hero-chips { display: flex; gap: 8px; margin-top: 16px; overflow-x: auto; padding-bottom: 2px; }
.balance-chip {
  flex-shrink: 0; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px; padding: 8px 12px; min-width: 92px;
}
.balance-chip .lbl { font-size: 10.5px; color: #C9D6F5; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.balance-chip .val { font-size: 13.5px; font-weight: 700; margin-top: 2px; font-family: 'Roboto Mono', monospace; }

.quick-actions-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.quick-action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 14px 6px 10px;
  box-shadow: var(--shadow);
  transition: transform .1s ease;
}
.quick-action-btn:active { transform: scale(0.95); }
.quick-action-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: var(--blue-100); color: var(--blue-700);
}
.quick-action-btn:nth-child(2) .quick-action-icon { background: #FDE9E9; color: var(--danger); }
.quick-action-btn:nth-child(3) .quick-action-icon { background: var(--yellow-100); color: var(--warning); }
.quick-action-btn:nth-child(4) .quick-action-icon { background: var(--blue-100); color: var(--blue-700); }
.quick-action-label { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; }

/* ---------- Bottom navigation bar (mobile only) ---------- */
.bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(16,23,40,0.06);
  z-index: 30;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav-inner { display: flex; justify-content: space-around; align-items: center; }
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: var(--ink-soft);
  font-size: 10.5px; font-weight: 600;
  padding: 5px 8px; border-radius: 12px; min-width: 56px;
  background: none; border: none; cursor: pointer; font-family: inherit;
  transition: color .15s ease;
}
.bottom-nav-item .bn-icon { font-size: 19px; line-height: 1; }
.bottom-nav-item.active { color: var(--blue-700); }
.bottom-nav-item.active .bn-icon { transform: translateY(-1px); }
.bottom-nav-fab {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--yellow-500); color: var(--blue-900);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-top: -22px;
  box-shadow: 0 8px 18px rgba(255,199,44,0.45);
}

@media (max-width: 860px) {
  .bottom-nav { display: block; }
  .main { padding-bottom: 88px; }
}

.stat-card { position: relative; overflow: hidden; }
.stat-label { color: var(--ink-soft); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat-icon {
  position: absolute; right: 16px; top: 16px;
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--yellow-100); color: var(--warning); font-size: 18px;
}
.stat-card.accent-blue .stat-icon { background: var(--blue-100); color: var(--blue-700); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius-sm);
  padding: 11px 18px; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: transform .08s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--blue-700); color: #fff; box-shadow: 0 6px 16px rgba(20,80,199,0.28); }
.btn-primary:hover { background: var(--blue-600); }
.btn-secondary { background: var(--yellow-500); color: var(--blue-900); }
.btn-secondary:hover { background: var(--yellow-400); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--ink); }
.btn-outline:hover { border-color: var(--blue-600); color: var(--blue-700); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }

/* ---------- Forms ---------- */
label { font-size: 13px; font-weight: 600; color: var(--ink); display: block; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--card); color: var(--ink);
  font-size: 14.5px; font-family: inherit; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.help-text { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.error-text { font-size: 12.5px; color: var(--danger); margin-top: 4px; font-weight: 600; }

.input-icon-wrap { position: relative; }
.input-icon-wrap input { padding-left: 40px; }
.input-icon-wrap .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); }

/* Search bar */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 8px 16px; box-shadow: var(--shadow);
}
.search-bar input { border: none; padding: 4px; box-shadow: none; }
.search-bar input:focus { box-shadow: none; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; font-size: 13.5px; }
thead th { color: var(--ink-soft); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--blue-100); }
tbody tr:last-child { border-bottom: none; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-deposit { background: var(--blue-100); color: var(--blue-700); }
.badge-withdrawal { background: #FDE9E9; color: var(--danger); }
.badge-transfer { background: var(--yellow-100); color: var(--warning); }
.badge-owner { background: var(--blue-100); color: var(--blue-700); }
.badge-cashier { background: #EFEFF5; color: var(--ink-soft); }

/* ---------- Notification card ---------- */
.notif-card { display: flex; gap: 12px; padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--border); }
.notif-card.unread { background: var(--yellow-100); border-color: #FCE6A8; }
.notif-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--yellow-500); color: var(--blue-900); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-card.low_cash .notif-icon, .notif-card.low_float .notif-icon { background: #FDE9E9; color: var(--danger); }

/* ---------- Dialogs / Toasts ---------- */
.alert { padding: 13px 16px; border-radius: var(--radius-md); font-size: 13.5px; font-weight: 600; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.alert-success { background: var(--blue-100); color: var(--blue-700); }
.alert-error { background: #FDE9E9; color: var(--danger); }

.modal-overlay { position: fixed; inset: 0; background: rgba(11,42,91,0.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { background: var(--card); border-radius: var(--radius-lg); padding: 26px; max-width: 460px; width: 100%; box-shadow: var(--shadow-lift); animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--blue-900) 0%, var(--blue-700) 55%, var(--yellow-500) 180%);
  padding: 20px;
}
.auth-card {
  background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-lift);
  padding: 40px 36px; width: 100%; max-width: 420px;
}
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-logo img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.auth-card h1 { font-size: 21px; margin: 0 0 4px; }
.auth-card p.lead { color: var(--ink-soft); font-size: 13.5px; margin: 0 0 24px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--ink-soft); }
.auth-switch a { color: var(--blue-700); font-weight: 700; }

/* Onboarding */
.onboard-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--blue-900); color: #fff; text-align: center; padding: 40px 24px; }
.onboard-dots { display: flex; gap: 6px; margin-top: 26px; }
.onboard-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); }
.onboard-dots span.active { background: var(--yellow-500); width: 22px; border-radius: 5px; }
.onboard-icon { width: 128px; height: 128px; border-radius: 30px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 48px; margin-bottom: 14px; padding: 14px; box-shadow: 0 16px 40px rgba(0,0,0,0.25); }
.onboard-icon img { width: 100%; height: 100%; object-fit: contain; }
.onboard-badge { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; font-size: 19px; margin-bottom: 16px; }

/* Splash */
.splash-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; }
.splash-logo { width: 220px; animation: splash-in .6s cubic-bezier(.2,.8,.2,1); }
.splash-logo img { width: 100%; height: auto; display: block; }
@keyframes splash-in { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.splash-wrap h1 { display: none; }

/* Empty state */
.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-soft); }
.empty-state .icon { font-size: 36px; margin-bottom: 10px; }

/* transitions */
.page-fade { animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.text-muted { color: var(--ink-soft); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8{margin-top:8px} .mt-16{margin-top:16px} .mt-24{margin-top:24px} .mb-16{margin-bottom:16px}

/* ============================================================
   Transactions page — filter tabs
   ============================================================ */
.tabs {
  display: flex;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 16px;
  overflow-x: auto;
  box-shadow: var(--shadow);
}
.tab-btn {
  flex: 1;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.tab-btn.active { background: var(--blue-700); color: #fff; }
.tab-btn:not(.active):hover { background: var(--blue-100); color: var(--blue-700); }

.txn-summary-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.txn-summary-bar .count { font-size: 13px; color: var(--ink-soft); }
.txn-summary-bar .total { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 17px; }

.txn-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--border);
}
.txn-row:last-child { border-bottom: none; }
.txn-row-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: var(--blue-100); color: var(--blue-700);
}
.txn-row-icon.withdrawal { background: #FDE9E9; color: var(--danger); }
.txn-row-icon.transfer { background: var(--yellow-100); color: var(--warning); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; }
.pagination .page-info { font-size: 12.5px; color: var(--ink-soft); }

/* ---------- Float management: two-column layout that actually collapses on phones ---------- */
.float-layout-grid, .stack-layout-grid {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.float-layout-grid > .card, .stack-layout-grid > .card { flex: 1 1 0; min-width: 0; }
.float-layout-grid > .card:first-child, .stack-layout-grid > .card:first-child { flex: 0.72 1 0; }
.float-layout-grid > .card:last-child, .stack-layout-grid > .card:last-child { flex: 1 1 0; }

@media (max-width: 860px) {
  /* On phones: stack in document order — first card on top, second card right
     below it, both full width. Flex-column guarantees this order explicitly. */
  .float-layout-grid, .stack-layout-grid { flex-direction: column; }
  .float-layout-grid > .card:first-child, .stack-layout-grid > .card:first-child,
  .float-layout-grid > .card:last-child, .stack-layout-grid > .card:last-child { flex: 1 1 auto; width: 100%; }
}

/* ---------- Float top-up mobile card row ---------- */
.float-row {
  padding: 12px 2px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.float-row:last-child { border-bottom: none; }
.float-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.float-row-meta { font-size: 11.5px; color: var(--ink-soft); }
.float-row-actions { display: flex; gap: 8px; }
.float-row-actions form, .float-row-actions button, .float-row-actions a { flex: 1; }
.float-row-actions .btn { width: 100%; }

/* ---------- Generic two-panel layout that stacks in document order on phones ---------- */
.stack-layout-grid {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.stack-layout-grid > .card { flex: 1 1 0; min-width: 0; }
.stack-layout-grid > .card:first-child { flex: 0.72 1 0; }
.stack-layout-grid > .card:last-child { flex: 1 1 0; }

@media (max-width: 860px) {
  .stack-layout-grid { flex-direction: column; }
  .stack-layout-grid > .card:first-child,
  .stack-layout-grid > .card:last-child { flex: 1 1 auto; width: 100%; }
}

/* ---------- Search filter form: proper stacking + spacing on phones ---------- */
.search-form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: end;
}
.search-form-grid .col-span-2 { grid-column: span 2; }
.search-form-grid .col-span-4 { grid-column: 1 / -1; }

@media (max-width: 860px) {
  .search-form-grid { grid-template-columns: 1fr; gap: 14px; }
  .search-form-grid .col-span-2,
  .search-form-grid .col-span-4 { grid-column: auto; }
  .search-form-grid .btn-row { display: flex; gap: 10px; }
  .search-form-grid .btn-row .btn { flex: 1; }
}
