/* ============================================================
   दिप्र फ़ाउंडेशन — Mobile Web App Experience
   Dipra Foundation — Native App-like Mobile UI
   Version: 2.0 (All Pages Unified)
   
   Usage (हर page के <head> में):
   <link rel="stylesheet" href="style.css">
   <link rel="stylesheet" href="mobile-app.css" media="(max-width: 860px)">
   
   Features:
   - Native app-style bottom navigation
   - Slide-in drawer with backdrop blfur
   - Sticky translucent app-bar (iOS style)
   - Safe-area support for notched phones
   - Bottom-sheet modals
   - Touch-optimized (min 44px targets)
   - Auto-hide bottom nav on scroll
   - Horizontal scroll pills (tabs, districts, timeline)
   - Card-style tables on mobile
   - Skeleton loaders
   - Pull-to-refresh feel
   - Landscape handling
   ============================================================ */

@media (max-width: 860px) {
  /* Footer को bottom nav के ऊपर रखने के लिए proper padding */
  body {
    padding-bottom: 0 !important; /* पुराना padding हटाएँ */
  }

  /* Main content का padding-bottom */
  main {
    padding-bottom: calc(var(--bottom-nav-total) + 24px) !important;
  }

  /* Footer के अंदर extra padding */
  footer {
    margin-bottom: 0 !important;
    padding-bottom: calc(var(--bottom-nav-total) + 20px) !important;
    position: relative;
    z-index: 1;
  }

  /* अगर body > main + footer structure है */
  body > main + footer {
    margin-bottom: 0 !important;
  }

  /* bottom-nav के ऊपर footer content दिखे */
  .foot-bottom {
    padding-bottom: calc(var(--bottom-nav-total) - 20px) !important;
  }
}

  /* ============================================================
     01. ROOT VARIABLES
     ============================================================ */
  :root {
    /* Safe area insets for notched phones */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);

    /* Bottom nav */
    --bottom-nav-h: 64px;
    --bottom-nav-total: calc(var(--bottom-nav-h) + var(--safe-bottom));

    /* App bar */
    --appbar-h: 60px;

    /* Touch targets */
    --touch-min: 44px;
    --touch-comfort: 48px;
    --touch-large: 52px;

    /* Mobile radius */
    --mobile-radius: 16px;
    --mobile-radius-lg: 20px;
    --mobile-radius-xl: 24px;

    /* Mobile shadows */
    --mobile-shadow-sm: 0 2px 8px rgba(139, 21, 56, 0.06);
    --mobile-shadow: 0 4px 16px rgba(139, 21, 56, 0.08);
    --mobile-shadow-lg: 0 8px 32px rgba(139, 21, 56, 0.12);
    --mobile-shadow-xl: 0 16px 48px rgba(139, 21, 56, 0.18);
  }

  /* ============================================================
     02. BODY — App-like feel
     ============================================================ */
  html {
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
    scroll-padding-top: calc(var(--appbar-h) + var(--safe-top) + 12px);
    scroll-padding-bottom: calc(var(--bottom-nav-total) + 12px);
  }

  body {
    overscroll-behavior-y: none;
    padding-bottom: var(--bottom-nav-total);
    -webkit-text-size-adjust: 100%;
    -webkit-touch-callout: none;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
    font-size: 16px;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* Prevent long-press select on UI chrome */
  button,
  .btn,
  nav a,
  nav .nav-link-btn,
  .nav-links a,
  .portal-tab,
  .admin-tab,
  .lang-btn,
  .burger,
  .step-tab,
  .ebook-tab,
  .share-btn,
  .tag,
  .bottom-nav-item,
  .quick-btn,
  .district-item,
  .state-header,
  .slider-btn,
  .slider-dot,
  .cat-card,
  .amount-preset,
  .tbl-btn {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  /* ============================================================
     03. TOP APP BAR (Sticky, iOS-style blur)
     ============================================================ */
  header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding-top: var(--safe-top);
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(240, 220, 188, 0.6);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.2s ease;
  }

  header.scrolled {
    box-shadow: 0 2px 12px rgba(139, 21, 56, 0.08);
  }

  /* Hide topbar & tricolor on mobile — cleaner look */
  .topbar,
  .tricolor {
    display: none;
  }

  /* App bar layout */
  .header-inner,
  .nav-wrap {
    height: var(--appbar-h);
    padding: 0 14px;
    display: flex;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
  }

  /* Compact brand */
  .brand {
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    padding: 4px;
    border-width: 1.5px;
    flex: none;
  }

  .brand-text {
    min-width: 0;
    overflow: hidden;
  }

  .brand-text b {
    font-size: 0.95rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-text span {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  /* Header actions */
  .header-actions,
  .nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
  }

  /* Hide CTA buttons from header — moved to bottom nav FAB */
  .header-actions .btn,
  .nav-actions .btn {
    display: none !important;
  }

  /* Compact language switch */
  .lang-switch {
    padding: 2px;
    border-radius: 9px;
    border-width: 1.5px;
  }

  .lang-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    min-width: 40px;
    min-height: 34px;
    border-radius: 7px;
  }

  /* Burger as app-menu button */
  .burger {
    display: flex;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255, 122, 0, 0.08);
    border: 1.5px solid var(--border-2);
  }

  .burger span {
    width: 20px;
    height: 2px;
  }

  /* Hide desktop nav */
  nav.desktop-nav {
    display: none !important;
  }

  /* Push content below fixed header */
  main,
  .main-content {
    padding-top: calc(var(--appbar-h) + var(--safe-top) + 16px);
  }

  body > section:first-of-type,
  body > .hero:first-of-type,
  body > .page-hero:first-of-type {
    padding-top: calc(var(--appbar-h) + var(--safe-top) + 24px);
  }

  /* ============================================================
     04. SLIDE-IN DRAWER NAV
     ============================================================ */
  nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(320px, 85vw);
    padding: calc(var(--safe-top) + 60px) 16px
             calc(var(--safe-bottom) + 24px);
    background: #fff;
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: -8px 0 40px rgba(139, 21, 56, 0.25);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  nav.open {
    transform: translateX(0);
  }

  /* Backdrop overlay */
  nav::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(20, 5, 15, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease;
    z-index: -1;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
  }

  nav.open::before {
    opacity: 1;
    pointer-events: auto;
  }

  /* Drawer close button (top-right) */
  nav .drawer-close {
    position: absolute;
    top: calc(var(--safe-top) + 14px);
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--saffron-soft);
    color: var(--saffron-3);
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 5;
  }

  nav .drawer-close:hover {
    background: var(--saffron);
    color: #fff;
  }

  /* Drawer nav list */
  nav ul,
  nav .nav-links {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
    width: 100%;
    margin-top: 4px;
  }

  nav li {
    width: 100%;
  }

  nav a,
  nav .nav-link-btn,
  nav .nav-links a {
    padding: 15px 18px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    transition: background 0.15s ease, transform 0.1s ease;
    min-height: 52px;
  }

  nav a:active,
  nav .nav-link-btn:active,
  nav .nav-links a:active {
    background: var(--saffron-soft);
    transform: scale(0.98);
  }

  nav a.active,
  nav .nav-links a.active {
    background: linear-gradient(135deg, var(--saffron-soft), #fff);
    color: var(--saffron-3);
    border-left: 4px solid var(--saffron);
    padding-left: 14px;
  }

  /* Drawer CTA at bottom */
  nav .drawer-cta {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
  }

  nav .drawer-cta .btn {
    width: 100%;
    justify-content: center;
    display: inline-flex !important;
  }

  /* ============================================================
     05. BOTTOM NAVIGATION (Native app pattern)
     ============================================================ */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-total);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(240, 220, 188, 0.9);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    z-index: 900;
    box-shadow: 0 -4px 20px rgba(139, 21, 56, 0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .bottom-nav.hidden {
    transform: translateY(100%);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease, transform 0.1s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
  }

  .bottom-nav-item .bn-icon {
    font-size: 1.35rem;
    line-height: 1;
    transition: transform 0.15s ease;
  }

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

  .bottom-nav-item.active {
    color: var(--saffron-3);
  }

  .bottom-nav-item.active .bn-icon {
    transform: translateY(-2px);
  }

  /* Active indicator pill */
  .bottom-nav-item.active::before {
    content: "";
    position: absolute;
    top: 4px;
    width: 32px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--saffron), var(--green));
  }

  /* FAB-style center button */
  .bottom-nav-item.bn-fab .bn-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--saffron), var(--saffron-3));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    margin-top: -20px;
    box-shadow: 0 6px 20px rgba(255, 122, 0, 0.45);
    border: 3px solid #fff;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .bottom-nav-item.bn-fab:active .bn-icon {
    transform: scale(0.9);
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.5);
  }

  /* Haptic-style active state */
  .bottom-nav-item.bn-fab.active .bn-icon {
    background: linear-gradient(135deg, var(--green), var(--green-3));
    box-shadow: 0 6px 20px rgba(13, 122, 58, 0.45);
  }

  /* ============================================================
     06. SECTIONS & CONTAINERS
     ============================================================ */
  section {
    padding: 36px 0;
  }

  section:first-of-type {
    padding-top: 20px;
  }

  .container,
  .container-narrow,
  .container-wide {
    width: 92%;
    padding-inline: 0;
  }

  .section-head {
    margin-bottom: 24px;
    padding: 0 4px;
  }

  .section-head h2 {
    font-size: 1.25rem;
    line-height: 1.4;
  }

  .section-head p {
    font-size: 0.92rem;
  }

  /* ============================================================
     07. HERO — Full-width app-style
     ============================================================ */
  .hero {
    padding: 24px 0 36px;
    border-radius: 0 0 var(--mobile-radius-xl) var(--mobile-radius-xl);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero h1 {
    font-size: 1.55rem;
    line-height: 1.25;
    margin-bottom: 14px;
  }

  .hero-sub {
    font-size: 0.98rem;
    line-height: 1.7;
    margin-bottom: 22px;
  }

  .hero-badges {
    gap: 8px;
    margin-bottom: 22px;
  }

  .hero-badges span {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .hero-btns {
    flex-direction: column;
    gap: 10px;
  }

  .hero-btns .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-card {
    padding: 20px;
    border-radius: var(--mobile-radius-lg);
    max-width: 100%;
  }

  .hero-card li {
    padding: 10px 0;
    font-size: 0.88rem;
  }

  /* ============================================================
     08. PAGE HERO
     ============================================================ */
  .page-hero {
    padding: 30px 0 40px;
    border-radius: 0 0 var(--mobile-radius-xl) var(--mobile-radius-xl);
  }

  .page-hero .hero-icon {
    font-size: 2.6rem;
    margin-bottom: 12px;
  }

  .page-hero h1 {
    font-size: 1.5rem;
    line-height: 1.25;
  }

  .page-hero p {
    font-size: 0.96rem;
    line-height: 1.75;
    padding: 0 4px;
  }

  .page-head {
    padding: 20px 0 12px;
    margin-bottom: 20px;
  }

  .page-head h1 {
    font-size: 1.5rem;
  }

  .page-head p {
    font-size: 0.94rem;
  }

  /* ============================================================
     09. BUTTONS — Larger touch targets
     ============================================================ */
  .btn {
    padding: 14px 22px;
    font-size: 0.98rem;
    min-height: var(--touch-large);
    border-radius: 14px;
    font-weight: 700;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
  }

  .btn:active:not(:disabled) {
    transform: scale(0.96);
  }

  .btn-sm {
    min-height: var(--touch-min);
    padding: 10px 16px;
    font-size: 0.88rem;
  }

  .btn-lg {
    min-height: 58px;
    padding: 16px 26px;
    font-size: 1rem;
  }

  .btn-block {
    width: 100%;
  }

  /* ============================================================
     10. CARDS — Rounded, tappable
     ============================================================ */
  .card,
  .info-card,
  .stat,
  .ebook-card,
  .highlight,
  .why-card,
  .info-box,
  .support-card,
  .impact-card,
  .usage-card,
  .pillar,
  .bearer,
  .value-item,
  .way-item,
  .download-card,
  .quote-box {
    border-radius: var(--mobile-radius-lg);
  }

  .card,
  .info-card {
    padding: 20px;
  }

  .card:active,
  .info-card:active,
  .ebook-card:active,
  .support-card:active,
  .impact-card:active,
  .usage-card:active {
    transform: scale(0.985);
    transition: transform 0.1s ease;
  }

  .card::before,
  .ebook-card::before,
  .support-card::before,
  .impact-card::before,
  .usage-card::before {
    height: 4px;
  }

  .card .ico {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
    border-radius: 12px;
    margin-bottom: 12px;
  }

  .card h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
  }

  .card p {
    font-size: 0.92rem;
    line-height: 1.65;
  }

  /* Stats — 2 col grid, app tiles */
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat {
    padding: 18px 12px;
    border-radius: var(--mobile-radius);
  }

  .stat b {
    font-size: 1.7rem;
  }

  .stat span {
    font-size: 0.78rem;
  }

  /* ============================================================
     11. FORMS — Mobile-optimized
     ============================================================ */
  .form-section,
  .login-card,
  #inputCard,
  .donate-form-card {
    padding: 22px 18px;
    border-radius: var(--mobile-radius-lg);
    margin: 16px auto;
  }

  .field {
    margin-bottom: 16px;
  }

  .field label {
    font-size: 0.92rem;
    margin-bottom: 7px;
  }

  .field input,
  .field select,
  .field textarea {
    padding: 15px 16px;
    font-size: 16px; /* prevents iOS zoom */
    min-height: var(--touch-large);
    border-radius: 12px;
  }

  .field textarea {
    min-height: 110px;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Check grid single column on very small */
  .check-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .check {
    padding: 14px 16px;
    min-height: var(--touch-large);
    border-radius: 12px;
  }

  .consent-box {
    padding: 14px;
    border-radius: 12px;
  }

  /* OTP inputs — bigger, more tappable */
  .otp-inputs {
    gap: 6px;
    margin: 18px 0;
  }

  .otp-box {
    width: 46px;
    height: 56px;
    font-size: 1.4rem;
    border-radius: 12px;
    border-width: 2px;
  }

  /* File upload */
  .file-upload {
    padding: 20px 16px;
    border-radius: 14px;
  }

  /* Category cards */
  .category-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
  }

  .cat-card {
    padding: 16px 12px;
    border-radius: 14px;
  }

  .cat-card .c-ico {
    font-size: 1.7rem;
  }

  .cat-card h4 {
    font-size: 0.92rem;
  }

  .cat-card p {
    font-size: 0.74rem;
  }

  /* Amount presets */
  .amount-presets {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .amount-preset {
    padding: 12px 6px;
    font-size: 0.94rem;
    min-height: 48px;
    border-radius: 12px;
  }

  /* ============================================================
     12. PORTAL / ADMIN TABS — Horizontal scroll pills
     ============================================================ */
  .portal-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 4px 12px;
    margin-bottom: 20px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .portal-tabs::-webkit-scrollbar {
    display: none;
  }

  .portal-tab {
    flex: none;
    padding: 11px 18px;
    font-size: 0.88rem;
    min-height: 46px;
    border-radius: 999px;
    scroll-snap-align: start;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .portal-tab .pt-ico {
    font-size: 1.1rem;
  }

  /* Admin tabs */
  .admin-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 2px;
    border-bottom: 2px solid var(--border);
  }

  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .admin-tab {
    flex: none;
    padding: 12px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  /* Admin stats grid */
  .admin-stat-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .admin-stat {
    padding: 14px 10px;
    border-radius: 12px;
  }

  .admin-stat b {
    font-size: 1.4rem;
  }

  .admin-stat span {
    font-size: 0.68rem;
  }

  /* ============================================================
     13. DASHBOARD — Card-based
     ============================================================ */
  .dash-head {
    padding: 18px;
    border-radius: var(--mobile-radius-lg) var(--mobile-radius-lg) 0 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .dash-head h3 {
    font-size: 1.1rem;
  }

  .dash-head p {
    font-size: 0.82rem;
  }

  .dash-body {
    padding: 18px;
    border-radius: 0 0 var(--mobile-radius-lg) var(--mobile-radius-lg);
  }

  .dash-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .mini {
    padding: 14px;
    border-radius: 12px;
  }

  .mini small {
    font-size: 0.7rem;
  }

  .mini b {
    font-size: 0.92rem;
  }

  .section-title {
    font-size: 0.78rem;
    margin: 20px 0 10px;
  }

  /* Log form */
  .log-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* ============================================================
     14. TIMELINE — Horizontal scroll
     ============================================================ */
  .timeline {
    padding: 10px 4px 16px;
    gap: 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .timeline::-webkit-scrollbar {
    display: none;
  }

  .tl-step {
    min-width: 90px;
    scroll-snap-align: start;
    font-size: 0.72rem;
  }

  .tl-dot {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  /* Story timeline */
  .timeline-story {
    padding-left: 30px;
  }

  .tl-item {
    padding-bottom: 20px;
  }

  .tl-item h4 {
    font-size: 0.94rem;
  }

  .tl-item .tl-date {
    font-size: 0.78rem;
  }

  .tl-item p {
    font-size: 0.88rem;
  }

  /* ============================================================
     15. TABLES — Card-style on mobile
     ============================================================ */
  .table-wrap,
  .admin-table-wrap {
    border-radius: var(--mobile-radius);
    border-width: 1px;
    box-shadow: var(--mobile-shadow-sm);
  }

  /* Convert table rows to cards (for .responsive-table) */
  .responsive-table thead {
    display: none;
  }

  .responsive-table tbody tr {
    display: block;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--mobile-shadow-sm);
  }

  .responsive-table tbody tr:hover {
    background: #fff;
  }

  .responsive-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.86rem;
    text-align: right;
  }

  .responsive-table tbody td:last-child {
    border-bottom: none;
  }

  .responsive-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    text-align: left;
    flex: none;
    max-width: 45%;
  }

  /* Fallback — regular tables */
  table:not(.responsive-table),
  .admin-table {
    min-width: 100%;
    font-size: 0.82rem;
  }

  th,
  td {
    padding: 10px 12px;
  }

  /* Small tables — scroll horizontally */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ============================================================
     16. MODALS — Bottom sheet style
     ============================================================ */
  .modal {
    padding: 0;
    align-items: flex-end;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  .modal-box {
    max-width: 100%;
    width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: var(--mobile-radius-xl) var(--mobile-radius-xl) 0 0;
    border: none;
    border-top: 3px solid var(--gold-2);
    margin: 0;
    animation: slideUp 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  }

  .modal-box.modal-sm,
  .modal-box.modal-md,
  .modal-box.modal-lg {
    max-width: 100%;
  }

  /* Drag handle indicator */
  .modal-box::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    background: var(--border-2);
    border-radius: 999px;
    margin: 10px auto 4px;
    flex: none;
  }

  .modal-head {
    padding: 14px 20px;
    border-radius: 0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    border-bottom: 1px solid var(--border);
  }

  .modal-head h3 {
    font-size: 1.02rem;
  }

  .close-x {
    width: 40px;
    height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--saffron-soft);
    font-size: 1.3rem;
    color: var(--saffron-3);
  }

  .close-x:active {
    background: var(--saffron);
    color: #fff;
  }

  .modal-body {
    padding: 18px 20px calc(24px + var(--safe-bottom));
  }

  @keyframes slideUp {
    from {
      transform: translateY(100%);
      opacity: 0.5;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  /* ============================================================
     17. TOAST — Above bottom nav
     ============================================================ */
  .toast {
    bottom: calc(var(--bottom-nav-total) + 16px);
    left: 16px;
    right: 16px;
    transform: translateY(140%);
    max-width: none;
    padding: 14px 20px;
    font-size: 0.92rem;
    border-radius: 14px;
    line-height: 1.5;
    text-align: left;
    box-shadow: 0 8px 32px rgba(139, 21, 56, 0.35);
  }

  .toast.show {
    transform: translateY(0);
  }

  /* ============================================================
     18. CONFIRMATION
     ============================================================ */
  .confirm {
    padding: 24px 16px;
  }

  .confirm .tick {
    width: 76px;
    height: 76px;
    font-size: 2.2rem;
    margin-bottom: 16px;
  }

  .confirm h3 {
    font-size: 1.1rem;
  }

  .confirm p {
    font-size: 0.92rem;
  }

  .id-box {
    padding: 14px 24px;
    border-radius: 14px;
    margin: 14px 0;
  }

  .id-box b {
    font-size: 1.3rem;
  }

  /* ============================================================
     19. CERTIFICATE — Mobile optimized
     ============================================================ */
  .cert-frame {
    border-width: 6px;
    border-radius: 12px;
  }

  .cert-frame::before {
    inset: 6px;
    border-width: 2px;
    border-radius: 6px;
  }

  .cert-frame::after {
    inset: 11px;
  }

  .cert-inner {
    padding: 22px 14px 18px;
  }

  .cert-logo {
    width: 64px;
    height: 64px;
    padding: 6px;
  }

  .cert-logo-fallback {
    font-size: 1.2rem;
  }

  .cert-org {
    font-size: 1.15rem;
  }

  .cert-subtitle {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
  }

  .cert-regno {
    font-size: 0.72rem;
  }

  .cert-title {
    font-size:
