/* =====================================================
   FinTrack — Shared Responsive CSS
   Include in every page: <link rel="stylesheet" href="responsive.css">
   ===================================================== */

/* ── Bottom Nav (mobile only) ── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #130f2a;
  border-top: 1px solid #2a2550;
  z-index: 100;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  font-size: 10px;
  color: #9893c0;
  padding: 6px 0;
  transition: color .2s;
}
.bottom-nav a.active { color: #7c5af5; }
.bottom-nav a span.nav-icon { font-size: 18px; line-height: 1; }

/* ── Mobile hamburger (index.html) ── */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #130f2a;
  border-bottom: 1px solid #2a2550;
  position: sticky;
  top: 0;
  z-index: 50;
}
.mobile-header .brand { font-size: 16px; font-weight: 700; color: #e8e5ff; display: flex; align-items: center; gap: 6px; }

/* =====================================================
   BREAKPOINTS
   ===================================================== */

/* ── Tablet (≤900px) ── */
@media (max-width: 900px) {
  /* Shared grid collapses */
  .two-col        { grid-template-columns: 1fr !important; }
  .three-col      { grid-template-columns: 1fr 1fr !important; }
  .charts-row     { grid-template-columns: 1fr !important; }
  .summary-row    { grid-template-columns: 1fr 1fr !important; }
  .overview-strip { grid-template-columns: 1fr 1fr !important; }
  .stats-row      { grid-template-columns: 1fr 1fr !important; }
  .values-strip   { grid-template-columns: 1fr !important; }
  .team-grid      { grid-template-columns: 1fr 1fr !important; }
  .features-grid  { grid-template-columns: 1fr 1fr !important; }
  .hero-grid      { grid-template-columns: 1fr !important; }
  .hero-visual    { display: none !important; }

  /* CTA band */
  .cta-band { grid-template-columns: 1fr !important; text-align: center; padding: 28px 20px !important; }
  .cta-actions { align-items: center !important; }
}

/* ── Mobile (≤600px) ── */
@media (max-width: 600px) {

  /* ─ Global ─ */
  body { padding-bottom: 70px; }

  /* ─ Sidebar: hide on mobile ─ */
  .sidebar { display: none !important; }

  /* ─ Show bottom nav ─ */
  .bottom-nav { display: flex; }

  /* ─ Show mobile header ─ */
  .mobile-header { display: flex; }

  /* ─ Index dashboard grid → single column ─ */
  .dash {
    display: block !important;
  }
  .main  { padding: 12px !important; }
  .right {
    border-left: none !important;
    border-top: 1px solid #2a2550;
    padding: 12px !important;
  }

  /* ─ Top metric row ─ */
  .top-row { grid-template-columns: 1fr !important; gap: 10px !important; }

  /* ─ Reports / Groups / About page layout ─ */
  body[data-page] { grid-template-columns: 1fr !important; }
  .page { padding: 14px 14px 80px !important; }
  .inner { padding: 14px !important; }

  /* ─ Topbar wrapping ─ */
  .topbar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }
  .topbar-right { flex-wrap: wrap; gap: 8px !important; width: 100%; }
  .topbar-right .sel,
  .topbar-right .btn-export,
  .topbar-right .btn-ghost { width: 100%; justify-content: center; }

  /* ─ Summary / overview cards ─ */
  .summary-row    { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .overview-strip { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .stats-row      { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }

  /* ─ Charts ─ */
  .charts-row  { grid-template-columns: 1fr !important; }
  .chart-wrap,
  .chart-wrap-sm { height: 160px !important; }

  /* ─ Month comparison ─ */
  .three-col { grid-template-columns: 1fr !important; gap: 10px !important; }

  /* ─ Insights row ─ */
  .insights-row { grid-template-columns: 1fr !important; }

  /* ─ Transaction table: hide some cols ─ */
  .hide-mobile { display: none !important; }
  .table-topbar { flex-direction: column !important; gap: 10px !important; }
  .filter-row { flex-direction: column !important; width: 100%; }
  .search-inp { width: 100% !important; }

  /* ─ Groups ─ */
  .two-col { grid-template-columns: 1fr !important; gap: 10px !important; }
  .perm-table th:nth-child(3),
  .perm-table td:nth-child(3) { display: none; }

  /* ─ Invite row ─ */
  .invite-form { flex-wrap: wrap !important; }
  .invite-inp  { width: 100% !important; }
  .invite-sel  { flex: 1; }

  /* ─ About page ─ */
  .hero-grid     { grid-template-columns: 1fr !important; }
  .hero-visual   { display: none !important; }
  .hero-title    { font-size: 26px !important; }
  .values-strip  { grid-template-columns: 1fr !important; }
  .team-grid     { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .features-grid { grid-template-columns: 1fr !important; }
  .cta-band {
    grid-template-columns: 1fr !important;
    padding: 22px 16px !important;
    text-align: center;
  }
  .cta-actions { align-items: center !important; flex-direction: row !important; flex-wrap: wrap; justify-content: center; }
  .cta-text-title { font-size: 19px !important; }

  /* ─ Footer ─ */
  .footer { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* ─ Cards & cards padding ─ */
  .card, .rec-card, .ai-card, .alert-card, .sum-card, .month-card,
  .ov-card, .insight-card, .feat-card, .val-card, .stat-card { padding: 12px 14px !important; }

  /* ─ Input row for expense tracker ─ */
  .input-row { flex-wrap: wrap !important; }
  .inp  { width: 80px !important; }

  /* ─ Risk tabs ─ */
  .risk-tabs { flex-wrap: wrap; }

  /* ─ Auth page ─ */
  .auth-card { padding: 24px 18px !important; border-radius: 14px !important; }
}
