/* ==========================================================================
   FinGov B2B Partner Portal - Complete Responsive Design System v2.0
   Premium Multi-Device: Mobile / Tablet / Desktop / Wide Screen
   ========================================================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800;900&family=Roboto:wght@400;500;700&family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   1. CSS VARIABLES - DESIGN TOKENS
   ========================================================================== */
:root {
  /* Primary Brand Colors */
  --md-primary: #6366f1;
  --md-primary-container: rgba(99, 102, 241, 0.15);
  --md-primary-dark: #4f46e5;
  --md-on-primary: #ffffff;

  /* Emerald (Success / Green) */
  --md-emerald: #10b981;
  --md-emerald-dark: #059669;
  --md-emerald-container: rgba(16, 185, 129, 0.15);

  /* Dark Theme Surfaces (Default) */
  --md-surface: #0f172a;
  --md-surface-container: #1e293b;
  --md-surface-container-high: #334155;
  --md-surface-elevated: #243044;

  /* Text */
  --md-on-surface: #f1f5f9;
  --md-on-surface-variant: #94a3b8;
  --md-on-surface-dim: #64748b;

  /* Borders */
  --md-outline: rgba(255, 255, 255, 0.10);
  --md-outline-strong: rgba(255, 255, 255, 0.18);
  --md-outline-accent: rgba(99, 102, 241, 0.4);

  /* Elevations */
  --elevation-1: 0 1px 4px rgba(0, 0, 0, 0.3);
  --elevation-2: 0 4px 16px rgba(0, 0, 0, 0.4);
  --elevation-3: 0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.25);

  /* Typography */
  --font-android: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;

  /* Border Radius Scale */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Transitions */
  --transition-android: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  --transition-fast: all 0.18s cubic-bezier(0.2, 0, 0, 1);
  --transition-spring: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --navbar-height: 60px;
  --sidebar-width: 270px;
  --bottom-nav-height: 64px;
}

/* Update navbar height variable at each breakpoint */
@media (min-width: 640px)  { :root { --navbar-height: 64px; } }
@media (min-width: 1024px) { :root { --navbar-height: 68px; } }

/* Light Theme Overrides */
[data-theme="light"] {
  --md-surface: #f1f5f9;
  --md-surface-container: #ffffff;
  --md-surface-container-high: #e8edf4;
  --md-surface-elevated: #f8fafc;

  --md-on-surface: #0f172a;
  --md-on-surface-variant: #475569;
  --md-on-surface-dim: #94a3b8;

  --md-outline: rgba(0, 0, 0, 0.09);
  --md-outline-strong: rgba(0, 0, 0, 0.15);

  --elevation-1: 0 1px 4px rgba(15, 23, 42, 0.07);
  --elevation-2: 0 4px 16px rgba(15, 23, 42, 0.10);
  --elevation-3: 0 8px 32px rgba(15, 23, 42, 0.14);
}

/* ==========================================================================
   2. RESET & NATIVE TOUCH DEFAULTS
   ========================================================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-android);
  background-color: var(--md-surface);
  color: var(--md-on-surface);
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
  padding-bottom: var(--bottom-nav-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 1024px) {
  body {
    padding-bottom: 0;
  }
}

input, textarea, button, select {
  font-family: var(--font-android);
}

input, textarea {
  user-select: text;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

button {
  cursor: pointer;
  border: none;
  background: transparent;
}

/* ==========================================================================
   3. UTILITY CLASSES
   ========================================================================== */
.desktop-only { display: none !important; }
.desktop-only-inline { display: none !important; }
.mobile-only { display: block; }

@media (min-width: 768px) {
  .desktop-only { display: block !important; }
  .desktop-only-inline { display: inline-flex !important; }
  .mobile-only { display: none !important; }
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

/* ==========================================================================
   4. LAYOUT SKELETON
   ========================================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* Push content below the fixed navbar */
  padding-top: var(--navbar-height);
}

/* DESKTOP: lock the viewport so only panes scroll independently */
@media (min-width: 1024px) {
  .app-container {
    height: 100vh;
    overflow: hidden;  /* window never scrolls on desktop */
  }
}

.main-wrapper {
  display: flex;
  flex: 1;
  position: relative;
  min-height: 0;     /* allow flex children to shrink below content size */
}

/* DESKTOP: clip the wrapper so each pane scrolls on its own */
@media (min-width: 1024px) {
  .main-wrapper {
    overflow: hidden;
    height: 100%;    /* fill the remaining locked viewport */
  }
}

.content-area {
  flex: 1;
  padding: 16px;
  min-width: 0;
  overflow-x: hidden;
}

/* DESKTOP: content pane scrolls independently */
@media (min-width: 1024px) {
  .content-area {
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    padding: 24px 32px;
    /* Nice custom scrollbar for the content pane */
    scrollbar-width: thin;
    scrollbar-color: var(--md-outline-strong) transparent;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .content-area {
    padding: 20px 24px;
  }
}

@media (min-width: 1400px) {
  .content-area {
    padding: 28px 40px;
  }
}

/* ==========================================================================
   5. TOP APP BAR (NAVBAR) — FIXED, Always on top
   ========================================================================== */
.navbar {
  height: var(--navbar-height);
  background: var(--md-surface-container);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--md-outline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  /* FIXED — bulletproof across all scroll contexts */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  box-shadow: 0 1px 8px rgba(0,0,0,0.2);
  gap: 6px;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .navbar {
    padding: 0 20px;
    height: 64px;
    gap: 8px;
  }
}

@media (min-width: 1024px) {
  .navbar {
    padding: 0 28px;
    height: 68px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  }
}

/* ── Navbar Left/Right groups ── */
.navbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .navbar-left { gap: 10px; }
  .navbar-right { gap: 6px; }
}

@media (min-width: 1024px) {
  .navbar-right { gap: 8px; }
}

/* Brand */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-heading);
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--md-primary), #8b5cf6);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.brand-icon svg { width: 16px; height: 16px; }

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.brand-badge {
  font-size: 0.58rem;
  color: var(--md-emerald);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1;
}

/* Search bar */
.nav-search {
  position: relative;
  flex: 1;
  max-width: 380px;
  margin: 0 6px;
  display: none;
}

@media (min-width: 700px) {
  .nav-search {
    display: block;
  }
}

.nav-search input {
  width: 100%;
  padding: 8px 16px 8px 38px;
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  color: var(--md-on-surface);
  transition: var(--transition-fast);
  height: 36px;
}

.nav-search input:focus {
  outline: none;
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px var(--md-primary-container);
  background: var(--md-surface-container);
}

.nav-search input::placeholder {
  color: var(--md-on-surface-dim);
}

.nav-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--md-on-surface-variant);
  width: 15px;
  height: 15px;
  pointer-events: none;
}

/* Keep backward compat with .nav-actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

@media (min-width: 640px) { .nav-actions { gap: 8px; } }

/* Wallet Chip */
.wallet-chip {
  background: var(--md-emerald-container);
  border: 1px solid rgba(16, 185, 129, 0.22);
  padding: 5px 8px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  min-height: 34px;
}

.wallet-chip:hover { background: rgba(16, 185, 129, 0.25); }

/* Hide add button on very small screens to save space */
@media (max-width: 399px) {
  .wallet-add-btn { display: none; }
}

.wallet-icon {
  color: var(--md-emerald);
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0;
}

.wallet-balance {
  font-weight: 700;
  color: var(--md-emerald);
  font-family: var(--font-heading);
  font-size: 0.8rem;
}

.wallet-add-btn {
  width: 18px;
  height: 18px;
  background: rgba(16, 185, 129, 0.3);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-emerald);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.wallet-add-btn svg { width: 10px !important; height: 10px !important; }

.wallet-add-btn:hover { background: rgba(16, 185, 129, 0.5); }

/* Icon Button */
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-on-surface);
  position: relative;
  transition: var(--transition-fast);
  cursor: pointer;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .icon-btn {
    width: 38px;
    height: 38px;
  }
}

.icon-btn:hover {
  background: var(--md-surface-container-high);
  border-color: var(--md-outline-strong);
}

.icon-btn:active { transform: scale(0.9); }

.icon-btn svg {
  width: 17px;
  height: 17px;
}

/* Hide theme toggle on very small screens to free up space */
@media (max-width: 399px) {
  .nav-theme-btn { display: none !important; }
}

/* Badge Dot */
.badge-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--md-surface-container);
}

/* User Nav Pill */
.user-nav-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  padding: 3px 8px 3px 3px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  min-height: 34px;
}

@media (min-width: 640px) {
  .user-nav-pill { min-height: 38px; padding: 4px 10px 4px 4px; }
}

.user-nav-pill:hover {
  border-color: var(--md-primary);
  background: var(--md-surface-container-high);
}

.user-nav-avatar {
  width: 27px;
  height: 27px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--md-primary);
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .user-nav-avatar { width: 30px; height: 30px; }
}

.user-nav-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--md-on-surface);
  white-space: nowrap;
}

/* Login button — compact on mobile */
.nav-login-btn {
  padding: 6px 10px !important;
  font-size: 0.8rem !important;
  min-height: 34px !important;
  border-radius: var(--radius-full) !important;
  gap: 4px !important;
}

@media (min-width: 640px) {
  .nav-login-btn {
    padding: 8px 16px !important;
    min-height: 38px !important;
  }
}

/* Android Status Bar */
.android-status-bar {
  height: 26px;
  background: var(--md-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--md-on-surface-variant);
  border-bottom: 1px solid var(--md-outline);
}

/* ==========================================================================
   6. SIDEBAR NAVIGATION
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--md-surface-container);
  border-right: 1px solid var(--md-outline);
  padding: 16px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Mobile: drawer slides in from left, BELOW the sticky navbar */
@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: 0;
    z-index: 160;   /* above backdrop(150), below navbar(200) */
    box-shadow: none;
    transform: translateX(calc(-1 * var(--sidebar-width)));
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  }
}

/* Desktop: sidebar is a fixed-height pane that scrolls independently */
@media (min-width: 1024px) {
  .sidebar {
    /* No position:sticky needed — the wrapper is already height-clipped */
    position: relative;
    height: 100%;           /* fill the main-wrapper height */
    overflow-y: auto;       /* sidebar scrolls on its own */
    overflow-x: hidden;
    flex-shrink: 0;
    transform: none !important;
    /* Custom thin scrollbar so it's subtle */
    scrollbar-width: thin;
    scrollbar-color: var(--md-outline-strong) transparent;
  }
}

/* Sidebar User Card */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--md-surface-container-high);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  cursor: pointer;
  border: 1px solid var(--md-outline);
  transition: var(--transition-fast);
}

.sidebar-user-card:hover {
  border-color: var(--md-primary);
  background: var(--md-surface-elevated, var(--md-surface));
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--md-primary);
  flex-shrink: 0;
}

.sidebar-user-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-name {
  font-family: var(--font-heading) !important;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--md-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-phone {
  font-size: 0.72rem;
  color: var(--md-on-surface-variant);
  margin-top: 1px;
}

/* Nav Item */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--md-on-surface-variant);
  font-weight: 500;
  font-size: 0.84rem;
  transition: var(--transition-fast);
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  min-height: 42px;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: var(--md-surface-container-high);
  color: var(--md-on-surface);
}

.nav-item:active {
  transform: scale(0.98);
}

/* Active Nav Item — readable in BOTH dark & light modes */
.nav-item.active,
.nav-item.active:hover {
  color: var(--md-primary) !important;
  background: var(--md-primary-container) !important;
  border-left: 3px solid var(--md-primary);
  font-weight: 700;
  padding-left: 11px;
}

.nav-item.active svg {
  color: var(--md-primary);
}

/* Sidebar Divider */
.sidebar-divider {
  height: 1px;
  background: var(--md-outline);
  margin: 10px 4px;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--md-outline);
}

/* ==========================================================================
   7. MOBILE BOTTOM NAVIGATION
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--md-surface-container);
  border-top: 1px solid var(--md-outline);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 900;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (min-width: 1024px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--md-on-surface-variant);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  cursor: pointer;
  flex: 1;
  min-height: 48px;
  justify-content: center;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
}

.bottom-nav-item.active {
  color: var(--md-primary);
}

.bottom-nav-item.active svg {
  background: var(--md-primary-container);
  padding: 4px;
  border-radius: var(--radius-full);
  width: 30px;
  height: 30px;
}

/* ==========================================================================
   8. FAB BUTTON
   ========================================================================== */
.fab-btn {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px);
  right: 16px;
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--md-primary), #4338ca);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
  z-index: 890;
  border: none;
  transition: var(--transition-spring);
  cursor: pointer;
}

.fab-btn:hover {
  transform: scale(1.05);
}

.fab-btn:active {
  transform: scale(0.9);
}

@media (min-width: 1024px) {
  .fab-btn {
    display: none;
  }
}

/* ==========================================================================
   9. BUTTONS
   ========================================================================== */
.btn-primary {
  background: linear-gradient(135deg, var(--md-primary), var(--md-primary-dark));
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  min-height: 40px;
}

.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: var(--md-surface-container-high);
  border: 1px solid var(--md-outline-strong);
  color: var(--md-on-surface);
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
  cursor: pointer;
  min-height: 40px;
}

.btn-secondary:hover {
  background: var(--md-surface-container);
  border-color: var(--md-primary);
}

.btn-secondary:active {
  transform: scale(0.97);
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  transition: var(--transition-fast);
  cursor: pointer;
  min-height: 40px;
}

.btn-emerald:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-emerald:active {
  transform: scale(0.97);
}

/* Mobile: full-width buttons */
@media (max-width: 479px) {
  .btn-primary, .btn-emerald {
    min-height: 44px;
  }

  .btn-secondary {
    min-height: 44px;
  }
}

/* ==========================================================================
   10. CARDS & KPI GRID
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
  }
}

.card {
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline) !important;
  border-radius: var(--radius-md) !important;
  padding: 16px;
  box-shadow: var(--elevation-1);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.22s ease;
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.35) !important;
  box-shadow: var(--elevation-2);
  transform: translateY(-1px);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kpi-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-android);
}

.kpi-value {
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 800;
  font-family: var(--font-heading);
  margin-bottom: 4px;
  line-height: 1.1;
}

/* ==========================================================================
   11. PAGE HEADER
   ========================================================================== */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
  }
}

.page-title {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 800;
  font-family: var(--font-heading);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--md-on-surface-variant);
  margin-top: 3px;
  line-height: 1.4;
}

/* ==========================================================================
   12. FORMS & INPUTS
   ========================================================================== */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  margin-bottom: 6px;
  color: var(--md-on-surface-variant) !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-android) !important;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: var(--md-surface);
  border: 1.5px solid var(--md-outline);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--md-on-surface);
  transition: var(--transition-fast);
  min-height: 44px;
}

.form-control:focus {
  outline: none;
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px var(--md-primary-container);
}

.form-control::placeholder {
  color: var(--md-on-surface-dim);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 540px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-section-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--md-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--md-outline);
  margin-bottom: 14px;
  margin-top: 20px;
}

/* ==========================================================================
   13. STATUS BADGES
   ========================================================================== */
.status-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.status-approved { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.status-review { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.status-disbursed { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.status-rejected { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.status-underreview { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.status-submitted { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.status-processing { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

/* ==========================================================================
   14. DATA TABLE
   ========================================================================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--md-outline);
  background: var(--md-surface-container);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 600px;
}

.data-table th {
  background: var(--md-surface);
  padding: 11px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--md-on-surface-variant);
  border-bottom: 1px solid var(--md-outline);
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--md-outline);
  font-size: 0.85rem;
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: var(--md-surface-container-high);
}

/* ==========================================================================
   15. SIDE-SHEET DRAWER
   ========================================================================== */
.side-sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  justify-content: flex-end;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.side-sheet-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.side-sheet-content {
  width: 100%;
  max-width: 100%;
  height: 100%;
  background: var(--md-surface-container);
  border-left: 1px solid var(--md-outline);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
}

@media (min-width: 540px) {
  .side-sheet-content {
    max-width: 520px;
  }
}

@media (min-width: 768px) {
  .side-sheet-content {
    max-width: 640px;
  }
}

@media (min-width: 1200px) {
  .side-sheet-content {
    max-width: 720px;
  }
}

.side-sheet-overlay.active .side-sheet-content {
  transform: translateX(0);
}

.side-sheet-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--md-outline);
  background: var(--md-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
}

.side-sheet-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 768px) {
  .side-sheet-body {
    padding: 24px;
  }
}

.side-sheet-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--md-outline);
  background: var(--md-surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ==========================================================================
   16. MODAL (CENTERED / BOTTOM SHEET)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--md-surface-container);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--elevation-3);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  border: 1px solid var(--md-outline);
}

@media (min-width: 640px) {
  .modal-content {
    border-radius: var(--radius-xl);
    transform: scale(0.95);
  }
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .modal-overlay.active .modal-content {
    transform: scale(1);
  }
}

.bottom-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--md-on-surface-variant);
  opacity: 0.35;
  border-radius: 10px;
  margin: 10px auto 4px auto;
}

@media (min-width: 640px) {
  .bottom-sheet-handle {
    display: none;
  }
}

.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--md-outline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-body {
  padding: 20px;
}

@media (min-width: 640px) {
  .modal-body {
    padding: 24px;
  }
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--md-outline);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: var(--md-surface);
  flex-wrap: wrap;
}

/* ==========================================================================
   17. AUTH / LOGIN PAGE
   ========================================================================== */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 80vh;
  padding: 16px;
  padding-top: 24px;
}

@media (min-width: 640px) {
  .auth-container {
    align-items: center;
  }
}

.auth-card {
  width: 100%;
  max-width: 640px;
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline);
  border-radius: var(--radius-xl);
  box-shadow: var(--elevation-3);
  overflow: hidden;
  animation: fadeInUp 0.3s ease-out;
}

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

.auth-tabs {
  display: flex;
  background: var(--md-surface);
  border-bottom: 1px solid var(--md-outline);
}

.auth-tab-btn {
  flex: 1;
  padding: 14px 16px;
  border: none;
  background: transparent;
  color: var(--md-on-surface-variant);
  font-weight: 700;
  font-size: 0.88rem;
  font-family: var(--font-heading);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: var(--transition-fast);
  border-bottom: 3px solid transparent;
}

.auth-tab-btn.active {
  color: var(--md-primary);
  border-bottom-color: var(--md-primary);
  background: var(--md-primary-container);
}

.auth-body {
  padding: 20px 16px;
}

@media (min-width: 480px) {
  .auth-body {
    padding: 28px 28px;
  }
}

@media (min-width: 640px) {
  .auth-body {
    padding: 36px 40px;
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-icon-badge {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--md-primary), #8b5cf6);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
  color: #fff;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.auth-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-header p {
  color: var(--md-on-surface-variant);
  font-size: 0.84rem;
}

.demo-account-chip {
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--md-on-surface);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.demo-account-chip:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
}

/* Input with Prefix */
.input-with-prefix {
  display: flex;
  align-items: center;
  background: var(--md-surface);
  border: 1.5px solid var(--md-outline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  min-height: 44px;
}

.input-with-prefix:focus-within {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px var(--md-primary-container);
}

.input-prefix {
  padding: 10px 12px;
  font-weight: 700;
  background: var(--md-surface-container-high);
  color: var(--md-on-surface-variant);
  font-size: 0.88rem;
  border-right: 1px solid var(--md-outline);
  white-space: nowrap;
  flex-shrink: 0;
}

.input-with-prefix .form-control {
  border: none;
  background: transparent;
  box-shadow: none;
}

/* OTP Inputs */
.otp-verification-box {
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
}

.otp-autofill-banner {
  background: rgba(99, 102, 241, 0.10);
  border: 1px dashed var(--md-primary);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 0.83rem;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-autofill {
  background: var(--md-primary);
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.otp-inputs-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 14px 0;
}

.otp-digit {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--md-surface-container);
  border: 2px solid var(--md-outline);
  border-radius: var(--radius-md);
  color: var(--md-on-surface);
  transition: var(--transition-fast);
}

.otp-digit:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px var(--md-primary-container);
  outline: none;
}

/* ==========================================================================
   18. PHOTO UPLOAD
   ========================================================================== */
.photo-upload-container {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--md-surface);
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--md-outline);
  flex-wrap: wrap;
}

.photo-preview-box {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 3px solid var(--md-primary);
  box-shadow: var(--elevation-2);
  flex-shrink: 0;
}

.photo-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-type-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  text-align: center;
  padding: 3px 0;
  text-transform: uppercase;
}

.photo-controls {
  flex: 1;
  min-width: 200px;
}

.photo-type-toggle {
  display: flex;
  background: var(--md-surface-container);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  margin-bottom: 12px;
}

.photo-type-btn {
  flex: 1;
  padding: 8px 6px;
  border: none;
  background: transparent;
  color: var(--md-on-surface-variant);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: var(--transition-fast);
}

.photo-type-btn.active {
  background: var(--md-primary);
  color: #fff;
}

/* ==========================================================================
   19. GENDER PILLS & INCOME OPTIONS
   ========================================================================== */
.gender-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gender-pill { cursor: pointer; }
.gender-pill input { display: none; }

.gender-pill span {
  display: inline-block;
  padding: 8px 16px;
  background: var(--md-surface);
  border: 1.5px solid var(--md-outline);
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  color: var(--md-on-surface-variant);
  transition: var(--transition-fast);
  user-select: none;
}

.gender-pill input:checked + span {
  background: var(--md-primary);
  color: #fff;
  border-color: var(--md-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.income-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 480px) {
  .income-options-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .income-options-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.income-option-card {
  cursor: pointer;
  position: relative;
}

.income-option-card input { display: none; }

.income-card-content {
  background: var(--md-surface);
  border: 2px solid var(--md-outline);
  border-radius: var(--radius-lg);
  padding: 14px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition-fast);
}

.income-option-card input:checked + .income-card-content {
  border-color: var(--md-emerald);
  background: rgba(16, 185, 129, 0.07);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.18);
}

.income-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.income-card-content strong {
  display: block;
  font-size: 0.9rem;
  font-family: var(--font-heading);
  margin-bottom: 3px;
}

.income-card-content p {
  font-size: 0.72rem;
  color: var(--md-on-surface-variant);
  line-height: 1.3;
}

/* ==========================================================================
   20. PROFILE PAGE
   ========================================================================== */
.profile-header-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.profile-avatar-wrapper {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
  object-fit: cover;
  border: 3px solid var(--md-primary);
  box-shadow: var(--elevation-2);
}

.profile-header-info {
  flex: 1;
  min-width: 200px;
}

.income-badge {
  background: rgba(99, 102, 241, 0.13);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: var(--md-primary);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

/* ==========================================================================
   21. INCOME TRACKS BANNER
   ========================================================================== */
.income-tracks-banner {
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
}

.income-tracks-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .income-tracks-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .income-tracks-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.income-track-card {
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.income-track-card:hover {
  border-color: var(--md-primary);
  transform: translateY(-2px);
  box-shadow: var(--elevation-1);
}

.track-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.income-track-card strong {
  display: block;
  font-size: 0.85rem;
}

.income-track-card p {
  font-size: 0.7rem;
  color: var(--md-on-surface-variant);
}

.track-arrow {
  margin-left: auto;
  width: 16px;
  height: 16px;
  color: var(--md-on-surface-variant);
}

/* ==========================================================================
   22. PAN / PASSPORT SERVICE STYLES
   ========================================================================== */
.pan-featured-hero-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.10), rgba(99, 102, 241, 0.10));
  border: 2px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-xl);
  padding: 20px 16px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .pan-featured-hero-card {
    padding: 24px;
  }
}

.pan-hero-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.pan-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  flex-shrink: 0;
}

.pan-pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 480px) {
  .pan-pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pan-price-box {
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pan-price-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--md-on-surface-variant);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.pan-price-value {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 800;
  font-family: var(--font-heading);
}

.pan-price-sub {
  font-size: 0.72rem;
  color: var(--md-on-surface-variant);
  margin-top: 2px;
}

.pan-sla-notice {
  background: rgba(245, 158, 11, 0.10);
  border: 1px dashed #f59e0b;
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 0.82rem;
  color: var(--md-on-surface);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.pan-type-toggle {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pan-type-pill { flex: 1; cursor: pointer; min-width: 140px; }
.pan-type-pill input { display: none; }

.pan-type-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 10px;
  background: var(--md-surface);
  border: 2px solid var(--md-outline);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--md-on-surface-variant);
  transition: var(--transition-fast);
  user-select: none;
}

.pan-type-pill.active span,
.pan-type-pill input:checked + span {
  background: var(--md-emerald);
  color: #fff;
  border-color: var(--md-emerald);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.pan-doc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

@media (min-width: 480px) {
  .pan-doc-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.pan-doc-box {
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: var(--radius-md);
  padding: 11px 13px;
}

.doc-upload-status {
  display: block;
  font-size: 0.7rem;
  color: var(--md-on-surface-variant);
  margin-top: 5px;
  font-weight: 600;
}

.pan-wallet-check-banner {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.pan-wallet-check-banner.insufficient {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.38);
}

.pan-disclaimer-warning {
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.correction-options-box {
  background: var(--md-surface);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-top: 12px;
}

.correction-checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 480px) {
  .correction-checkbox-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.correction-check-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--md-on-surface);
  cursor: pointer;
  min-height: 40px;
}

.correction-check-pill input { accent-color: #f59e0b; }

/* ==========================================================================
   23. RECEIPT MODAL
   ========================================================================== */
.receipt-modal-header {
  background: linear-gradient(135deg, #10b981, #059669);
  padding: 22px;
  text-align: center;
}

.receipt-success-icon {
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px auto;
  color: #fff;
  font-size: 1.8rem;
}

.receipt-id-banner {
  background: var(--md-surface);
  border: 2px solid var(--md-primary);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.receipt-details-table {
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--md-outline);
  gap: 8px;
  flex-wrap: wrap;
}

.receipt-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.receipt-row span {
  color: var(--md-on-surface-variant);
}

.receipt-email-notice {
  background: rgba(99, 102, 241, 0.10);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
}

/* ==========================================================================
   24. LOAN EXECUTION OPTIONS & PAYOUT MATRIX
   ========================================================================== */
.loan-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .loan-options-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.loan-option-box {
  background: var(--md-surface);
  border: 2px solid var(--md-outline);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.loan-option-box.active {
  border-color: var(--md-emerald);
  background: rgba(16, 185, 129, 0.07);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.18);
}

.payout-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.payout-card-item {
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: var(--radius-md);
  padding: 13px;
  text-align: center;
  transition: var(--transition-fast);
}

.payout-card-item:hover {
  border-color: var(--md-primary);
  transform: translateY(-2px);
}

.payout-loan-title {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--md-on-surface-variant);
  margin-bottom: 4px;
}

.payout-rate-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--md-emerald);
  font-family: var(--font-heading);
}

.payout-subtext {
  font-size: 0.68rem;
  color: var(--md-on-surface-variant);
}

/* ==========================================================================
   25. CALCULATOR STYLES (EMI & ELIGIBILITY)
   ========================================================================== */
.bank-calc-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

@media (min-width: 1100px) {
  .bank-calc-container {
    flex-direction: row;
    align-items: stretch;
  }

  .bank-calc-column {
    flex: 1;
    width: 50%;
  }
}

.bank-card {
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline) !important;
  border-radius: var(--radius-md) !important;
  padding: 20px;
  box-shadow: var(--elevation-1);
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .bank-card {
    padding: 24px;
  }
}

.bank-header {
  border-bottom: 2px solid var(--md-outline);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.bank-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--md-on-surface);
  font-family: var(--font-heading);
}

.bank-subtitle {
  font-size: 0.76rem;
  color: var(--md-on-surface-variant);
  margin-top: 2px;
}

.bank-value-display {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-family: var(--font-heading);
}

.bank-input-group {
  margin-bottom: 14px;
}

.bank-label {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  color: var(--md-on-surface-variant) !important;
  margin-bottom: 5px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-android) !important;
}

.bank-input-box {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--md-outline);
  background: var(--md-surface);
  color: var(--md-on-surface);
  transition: border-color 0.18s ease;
  min-height: 42px;
}

.bank-input-box:focus {
  border-color: var(--md-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--md-primary-container);
}

/* Calculator Responsive Grids */
.bank-inputs-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 540px) {
  .bank-inputs-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.bank-inputs-grid-5 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 400px) {
  .bank-inputs-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 700px) {
  .bank-inputs-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1250px) {
  .bank-inputs-grid-5 {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ==========================================================================
   26. STEPPER PROGRESS BAR
   ========================================================================== */
.stepper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  padding: 0 8px;
}

.stepper-header::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 28px;
  right: 28px;
  height: 2px;
  background: var(--md-outline);
  z-index: 1;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  position: relative;
  flex: 1;
  gap: 5px;
}

.step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--md-surface-container-high);
  border: 2px solid var(--md-outline);
  color: var(--md-on-surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.step-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--md-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.step-item.active .step-circle {
  background: var(--md-primary);
  border-color: var(--md-primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.step-item.active .step-label { color: var(--md-primary); }

.step-item.completed .step-circle {
  background: var(--md-emerald);
  border-color: var(--md-emerald);
  color: #fff;
}

.step-item.completed .step-label { color: var(--md-emerald); }

/* ==========================================================================
   27. TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + 12px);
  right: 14px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 28px);
}

@media (min-width: 640px) {
  .toast-container {
    max-width: 380px;
  }
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  line-height: 1.4;
  border-left: 4px solid transparent;
  box-shadow: var(--elevation-2);
  pointer-events: auto;
  animation: slideInRight 0.28s cubic-bezier(0.2, 0, 0, 1);
  word-break: break-word;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success { background: rgba(16, 185, 129, 0.18); border-left-color: #10b981; color: var(--md-on-surface); }
.toast-error { background: rgba(239, 68, 68, 0.18); border-left-color: #ef4444; color: var(--md-on-surface); }
.toast-warning { background: rgba(245, 158, 11, 0.18); border-left-color: #f59e0b; color: var(--md-on-surface); }
.toast-info { background: rgba(99, 102, 241, 0.18); border-left-color: #6366f1; color: var(--md-on-surface); }

/* ==========================================================================
   28. NOTIFICATION PANEL
   ========================================================================== */
.notification-panel {
  position: fixed;
  top: var(--navbar-height);
  right: 0;
  width: 100%;
  max-width: 360px;
  background: var(--md-surface-container);
  border: 1px solid var(--md-outline);
  border-radius: 0 0 0 var(--radius-lg);
  box-shadow: var(--elevation-3);
  z-index: 950;
  max-height: calc(100vh - var(--navbar-height));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   29. ANIMATIONS & SPECIAL EFFECTS
   ========================================================================== */

/* Open Challenge Banner */
.open-challenge-trust-banner {
  animation: bannerPulse 4s infinite alternate ease-in-out;
}

@keyframes bannerPulse {
  0% { border-color: rgba(245, 158, 11, 0.45); box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1); }
  100% { border-color: rgba(239, 68, 68, 0.75); box-shadow: 0 6px 25px rgba(239, 68, 68, 0.22); }
}

@media (prefers-reduced-motion: reduce) {
  .open-challenge-trust-banner {
    animation: none;
  }
}

/* Live Chat FAB */
.live-chat-fab-wrapper {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 16px);
  right: 16px;
  z-index: 999;
}

@media (min-width: 1024px) {
  .live-chat-fab-wrapper {
    bottom: 24px;
    right: 24px;
  }
}

.live-chat-fab-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.live-chat-fab-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 35px rgba(16, 185, 129, 0.6);
}

.live-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid var(--md-surface-container);
  letter-spacing: 0.4px;
}

/* Dashboard header avatar */
.dashboard-header-avatar {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 2px solid var(--md-primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ==========================================================================
   30. CHALLENGE HEADER CHIP (EYE CATCHER)
   ========================================================================== */
.challenge-header-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  border-radius: 20px;
  padding: 6px 11px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  animation: challengePulse 2.5s infinite alternate ease-in-out;
  min-height: 34px;
}

.challenge-chip-text {
  display: none;
}

@media (min-width: 480px) {
  .challenge-chip-text {
    display: inline;
  }
}

.challenge-header-chip:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.6);
}

@keyframes challengePulse {
  0% { box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4); }
  100% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.8), 0 0 0 5px rgba(239, 68, 68, 0.2); }
}

@media (prefers-reduced-motion: reduce) {
  .challenge-header-chip { animation: none; }
}

/* ==========================================================================
   31. TYPOGRAPHY OVERRIDE (UNIFIED ACROSS THEMES)
   ========================================================================== */
h1, h2, h3, h4, h5, h6,
.page-title, .bank-title, .nav-brand, .kpi-value, .bank-value-display,
.brand-name, .auth-header h2 {
  font-family: var(--font-heading) !important;
}

body, input, select, textarea, button,
.nav-item, .form-control, .bank-input-box, .form-label, .bank-label {
  font-family: var(--font-android);
}

/* ==========================================================================
   32. SCROLLBARS
   ========================================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--md-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--md-outline-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--md-primary);
}
