/* ==========================================================================
   Blue Peak Ltd. - Super Clean, Smart & Modern Fintech Design System
   Palette: Obsidian Dark (#050814), Midnight Navy (#0c1324), Frosted Glass (#0f1a36)
   Accents: Electric Blue (#3b82f6), Emerald Glow (#10b981), Amber Gold (#f59e0b), Rose (#f43f5e)
   Animations: Smooth micro-interactions, subtle entrance staggered delays, card hover lift
   ========================================================================== */

:root {
    --bg-base: #050814;
    --bg-sidebar: #070d1d;
    --bg-topbar: rgba(7, 13, 29, 0.88);
    --bg-card: rgba(12, 20, 41, 0.65);
    --bg-card-subtle: rgba(8, 15, 33, 0.5);
    --bg-card-hover: rgba(16, 26, 53, 0.85);
    
    --border-subtle: rgba(255, 255, 255, 0.045);
    --border-glow: rgba(59, 130, 246, 0.24);
    --border-accent: rgba(59, 130, 246, 0.35);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary-blue: #3b82f6;
    --primary-blue-hover: #2563eb;
    --primary-blue-glow: rgba(59, 130, 246, 0.35);
    
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.35);
    
    --accent-amber: #f59e0b;
    --accent-amber-glow: rgba(245, 158, 11, 0.35);
    
    --accent-rose: #f43f5e;
    --accent-rose-glow: rgba(244, 63, 94, 0.35);
    
    --accent-cyan: #0ea5e9;
    --accent-indigo: #6366f1;
}

html.light, [data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-topbar: rgba(255, 255, 255, 0.94);
    --bg-card: #ffffff;
    --bg-card-subtle: #f1f5f9;
    --bg-card-hover: #e2e8f0;
    
    --border-subtle: rgba(15, 23, 42, 0.08);
    --border-glow: rgba(59, 130, 246, 0.2);
    --border-accent: rgba(59, 130, 246, 0.35);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
}

html.light body {
    background-color: var(--bg-base) !important;
    color: var(--text-primary) !important;
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.04) 0%, transparent 35%),
        radial-gradient(circle at 85% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.03) 0%, transparent 45%);
}

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

html {
    color-scheme: dark;
    scroll-behavior: smooth;
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-base) !important;
    color: var(--text-primary) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    touch-action: pan-x pan-y;
    -webkit-font-smoothing: antialiased;
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.08) 0%, transparent 35%),
        radial-gradient(circle at 85% 20%, rgba(99, 102, 241, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.05) 0%, transparent 45%);
    background-attachment: fixed;
}

/* Typography Helpers */
.font-inter { font-family: 'Inter', sans-serif; }
.font-hind { font-family: 'Hind Siliguri', 'Inter', sans-serif; }
.tabular-nums { font-variant-numeric: tabular-nums; }

/* Custom Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.2); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.4); }

/* ==========================================
   ANIMATIONS & MICRO-INTERACTIONS
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.15);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.animate-fade-in { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-scale-in { animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-pulse-glow { animation: pulseGlow 2.5s infinite; }

/* Staggered Card Entrances */
.stagger-1 { animation: fadeInUp 0.35s 0.03s cubic-bezier(0.16, 1, 0.3, 1) both; }
.stagger-2 { animation: fadeInUp 0.35s 0.07s cubic-bezier(0.16, 1, 0.3, 1) both; }
.stagger-3 { animation: fadeInUp 0.35s 0.11s cubic-bezier(0.16, 1, 0.3, 1) both; }
.stagger-4 { animation: fadeInUp 0.35s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both; }
.stagger-5 { animation: fadeInUp 0.35s 0.19s cubic-bezier(0.16, 1, 0.3, 1) both; }
.stagger-6 { animation: fadeInUp 0.35s 0.23s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================
   CARD & CONTAINER ARCHITECTURE
   ========================================== */
.glass-panel {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 1.25rem !important;
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.glass-panel-hover:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.28) !important;
    box-shadow: 0 16px 30px -8px rgba(0, 0, 0, 0.5), 0 0 15px -3px rgba(59, 130, 246, 0.15);
}

.glass-hero {
    background: radial-gradient(130% 130% at 50% 0%, rgba(30, 58, 138, 0.35) 0%, rgba(12, 20, 41, 0.85) 60%, rgba(8, 15, 32, 0.95) 100%) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-radius: 1.5rem !important;
    backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 0 25px -5px rgba(59, 130, 246, 0.15) inset;
}

.stat-card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 1.125rem !important;
    padding: 1.125rem !important;
    box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.3);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.25) !important;
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.45);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.stat-label {
    font-size: 0.6875rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    color: var(--text-secondary) !important;
    display: block !important;
    margin-bottom: 0.35rem !important;
}

.stat-value {
    font-size: 1.125rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.25 !important;
    font-variant-numeric: tabular-nums !important;
    white-space: nowrap !important;
}

@media (min-width: 640px) {
    .stat-value { font-size: 1.25rem !important; }
}

@media (min-width: 1280px) {
    .stat-value { font-size: 1.375rem !important; }
}

/* ==========================================
   BUTTONS & BADGES
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    border: none;
    outline: none;
    user-select: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px -1px var(--primary-blue-glow);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
    box-shadow: 0 6px 20px 0 var(--primary-blue-glow);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px -1px var(--accent-emerald-glow);
}
.btn-success:hover {
    background: linear-gradient(135deg, #047857, #059669) !important;
    box-shadow: 0 6px 20px 0 var(--accent-emerald-glow);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #e11d48, #f43f5e) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px -1px var(--accent-rose-glow);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #be123c, #e11d48) !important;
    box-shadow: 0 6px 20px 0 var(--accent-rose-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.07) !important;
    color: #f1f5f9 !important;
    border: 1px solid var(--border-subtle) !important;
}
.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.13) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.btn-outline-amber {
    background-color: rgba(245, 158, 11, 0.12) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    box-shadow: 0 4px 14px -2px rgba(245, 158, 11, 0.2);
}
.btn-outline-amber:hover {
    background-color: rgba(245, 158, 11, 0.22) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    transform: translateY(-1px);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
}

.badge-blue {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}
.badge-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}
.badge-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
.badge-danger {
    background-color: rgba(244, 63, 94, 0.15) !important;
    color: #fb7185 !important;
    border: 1px solid rgba(244, 63, 94, 0.3) !important;
}

/* ==========================================
   FORMS & INPUTS (PROFESSIONAL FINTECH)
   ========================================== */
.form-group {
    margin-bottom: 1.15rem;
    position: relative;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.form-label {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    display: block !important;
    margin-bottom: 0.4rem !important;
    letter-spacing: 0.015em !important;
}

.form-control,
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="range"]),
select,
textarea {
    display: block;
    width: 100% !important;
    min-height: 46px !important;
    padding: 0.7rem 1rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    font-family: inherit !important;
    color: #ffffff !important;
    background-color: rgba(11, 19, 41, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.25) inset;
    transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
    font-weight: 400 !important;
    font-size: 0.875rem !important;
}

.form-control:hover,
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="range"]):hover,
select:hover,
textarea:hover {
    border-color: rgba(255, 255, 255, 0.24) !important;
}

.form-control:focus,
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="range"]):focus,
select:focus,
textarea:focus {
    border-color: #3b82f6 !important;
    background-color: #0d1a3b !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28), 0 2px 8px -2px rgba(0, 0, 0, 0.5) !important;
}

.form-control:disabled,
.form-control[readonly],
input:disabled,
input[readonly] {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    background-color: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

select.form-control,
select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 1.15rem !important;
    padding-right: 2.75rem !important;
    cursor: pointer !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

select option {
    background-color: #0b1329 !important;
    color: #ffffff !important;
    padding: 0.6rem !important;
}

textarea.form-control,
textarea {
    min-height: 96px !important;
    padding: 0.75rem 1rem !important;
    resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
    width: 1.15rem !important;
    height: 1.15rem !important;
    min-height: 1.15rem !important;
    accent-color: #3b82f6 !important;
    cursor: pointer;
    vertical-align: middle;
}

input[type="date"],
input[type="datetime-local"] {
    color-scheme: dark !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    min-height: 46px !important;
    height: 46px !important;
    box-sizing: border-box !important;
    display: block !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-color: rgba(11, 19, 41, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 0.75rem !important;
    padding: 0.65rem 2.6rem 0.65rem 0.85rem !important;
    font-size: 0.875rem !important;
    font-family: inherit !important;
    line-height: normal !important;
    overflow: hidden !important;
    position: relative !important;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value {
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 1.3em !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Fix WebKit calendar picker indicator: Position absolute to completely prevent layout blowing/overflow on iOS */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    position: absolute !important;
    right: 0.85rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    -webkit-transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    cursor: pointer !important;
    filter: invert(0.85) !important;
    opacity: 0.85 !important;
    z-index: 2 !important;
}

.form-control-compact {
    min-height: 42px !important;
    padding: 0.55rem 0.85rem !important;
    font-size: 0.875rem !important;
}

/* ==========================================
   DATA TABLES (SUPER CLEAN FINTECH)
   ========================================== */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    background-color: #080f21 !important;
    color: var(--text-secondary) !important;
    font-size: 0.6875rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 0.875rem 1rem !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    white-space: nowrap !important;
}

tbody td {
    padding: 0.875rem 1rem !important;
    font-size: 0.8125rem !important;
    color: #e2e8f0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    transition: background-color 0.15s ease;
}

tbody tr:hover td {
    background-color: rgba(59, 130, 246, 0.04) !important;
}

/* ==========================================
   MODALS (UNIVERSAL HIGH Z-INDEX GLASSMORPHIC OVERLAYS)
   ========================================== */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    width: 100vw !important;
    height: 100% !important;
    height: 100dvh !important;
    background-color: rgba(3, 7, 18, 0.88) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.25rem 1rem !important;
    z-index: 99999999 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
}

.modal-overlay.active {
    display: flex !important;
    animation: fadeIn 0.2s ease forwards;
}

.modal-card {
    background-color: #0b1329 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 1.25rem !important;
    color: #ffffff !important;
    width: 100% !important;
    max-width: 32rem !important;
    max-height: calc(100dvh - 2.5rem) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 1.5rem !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 25px 0 rgba(59, 130, 246, 0.15) !important;
    animation: scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    margin: auto !important;
    box-sizing: border-box !important;
    position: relative !important;
}

/* ==========================================
   GLOBAL OVERRIDES (Immunity against white boxes)
   ========================================== */
.bg-white { background-color: var(--bg-card) !important; color: #f8fafc !important; }
.bg-slate-50 { background-color: var(--bg-card-subtle) !important; color: #f8fafc !important; }
.bg-slate-100 { background-color: #121c38 !important; color: #f8fafc !important; }
.border-slate-100, .border-slate-200, .border-slate-300 { border-color: var(--border-subtle) !important; }
.text-slate-900, .text-slate-800 { color: #ffffff !important; }
.text-slate-700, .text-slate-600 { color: #cbd5e1 !important; }
.text-slate-500, .text-slate-400 { color: #94a3b8 !important; }

/* ==========================================
   MICRO-LOADING PROGRESS BAR (Item 5)
   ========================================== */
#pageProgressBar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    z-index: 99999999 !important;
    pointer-events: none !important;
    opacity: 0;
    transition: opacity 0.15s ease !important;
}

#pageProgressBarFill {
    height: 100% !important;
    background: linear-gradient(90deg, #2563eb, #38bdf8, #06b6d4) !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.9), 0 0 20px rgba(59, 130, 246, 0.6) !important;
    width: 0%;
    transition: width 0.2s ease-out !important;
}

/* ==========================================
   BULLETPROOF RESPONSIVE LAYOUT & MOBILE BOTTOM NAVIGATION
   ========================================== */
@media (max-width: 767.98px) {
    aside {
        display: none !important;
    }
    
    /* Mobile Modal - Centered, Beautiful Touch Scrolling, NO Empty Voids */
    .modal-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        height: 100dvh !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0.75rem 0.5rem !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        z-index: 99999999 !important;
        box-sizing: border-box !important;
    }
    .modal-card {
        max-height: calc(100dvh - 1.5rem) !important;
        height: auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin: auto !important;
        padding: 1.15rem 0.95rem !important;
        border-radius: 1.25rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure forms, grids, and date containers never cause horizontal overflow */
    .form-group,
    form,
    .grid,
    .modal-card .grid,
    form .grid {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .grid > *,
    form .grid > *,
    .modal-card .grid > * {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Mobile Form Controls - Clean, Simple, Touch-Friendly & Auto-Zoom Proof */
    .form-group {
        margin-bottom: 0.85rem !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    
    .form-label {
        font-size: 0.8125rem !important;
        font-weight: 600 !important;
        color: #94a3b8 !important;
        margin-bottom: 0.35rem !important;
        letter-spacing: 0.01em !important;
    }
    
    .form-control,
    input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="range"]),
    select,
    textarea {
        font-size: 16px !important; /* Prevents iOS Safari/Chrome auto-zoom on focus */
        min-height: 48px !important;
        padding: 0.72rem 0.95rem !important;
        border-radius: 0.75rem !important;
        line-height: 1.4 !important;
        background-color: rgba(11, 19, 41, 0.9) !important;
        box-sizing: border-box !important;
    }
    
    /* Bulletproof Mobile Date Input: Never overflows on iOS Safari/WebKit */
    input[type="date"],
    input[type="datetime-local"] {
        font-size: 16px !important;
        min-height: 48px !important;
        height: 48px !important;
        padding: 0.7rem 2.6rem 0.7rem 0.95rem !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        position: relative !important;
        display: block !important;
    }
    
    select.form-control,
    select {
        font-size: 16px !important;
        min-height: 48px !important;
        height: 48px !important;
        padding-right: 2.75rem !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    textarea.form-control,
    textarea {
        font-size: 16px !important;
        min-height: 90px !important;
        padding: 0.72rem 0.95rem !important;
    }
    
    .modal-card .btn,
    form .btn {
        min-height: 46px;
        font-size: 0.875rem !important;
    }

    .mobile-bottom-nav,
    nav.mobile-bottom-nav {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 64px !important;
        z-index: 999999 !important;
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
        background-color: #0b1329 !important;
        background: rgba(11, 19, 41, 0.98) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.6) !important;
    }
    
    /* Footer has clean clearance via mb-16; eliminate excessive 72px body padding void (Item 6) */
    body {
        padding-bottom: 0 !important;
    }
}

@media (max-width: 640px) {
    /* Auto-stack 2-column grids inside modal cards & forms to guarantee zero horizontal breakage (Item 12) */
    .modal-card .grid,
    form .grid,
    .modal-card .grid.grid-cols-2,
    .modal-card .grid.sm\:grid-cols-2,
    .grid.sm\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 768px) {
    .mobile-bottom-nav,
    nav.mobile-bottom-nav {
        display: none !important;
    }
    aside {
        display: flex !important;
    }
}
