/**
 * Surya Vistaara Pvt. Ltd. (SVPL)
 * Solar Luminary Design System v3.2 (Permanent Contrast Fixes & Accessible Typography)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800;900&display=swap');

:root {
    --svpl-navy-950: #040B15;
    --svpl-navy-900: #061528;
    --svpl-navy-800: #0B2545;
    --svpl-navy-700: #133E6E;
    
    --svpl-gold: #F59E0B;
    --svpl-gold-bright: #FBBF24;
    --svpl-gold-dark: #D97706;
    --svpl-gold-subtle: rgba(245, 158, 11, 0.15);
    
    --svpl-green: #10B981;
    --svpl-green-dark: #059669;
    --svpl-green-light: #34D399;
    --svpl-green-subtle: rgba(16, 185, 129, 0.15);
    
    --svpl-bg: #F8FAFC;
    --svpl-card: #FFFFFF;
    --svpl-border: #CBD5E1;
    --svpl-border-dark: rgba(255, 255, 255, 0.15);
    
    --svpl-text-primary: #0F172A;
    --svpl-text-secondary: #334155;
    --svpl-text-muted: #475569;
    
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   GLOBAL RESET & TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    color: var(--svpl-text-primary);
    background-color: var(--svpl-bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    color: var(--svpl-navy-800);
}

.text-white, 
.text-white h1, .text-white h2, .text-white h3, .text-white h4, .text-white h5, .text-white h6,
.card.text-white h1, .card.text-white h2, .card.text-white h3, .card.text-white h4, .card.text-white h5, .card.text-white h6 {
    color: #FFFFFF !important;
}

.text-navy { color: var(--svpl-navy-800) !important; }
.bg-navy { background-color: var(--svpl-navy-800) !important; color: #FFFFFF !important; border: 1px solid rgba(245, 158, 11, 0.35); }
.bg-navy-subtle { background-color: rgba(11, 37, 69, 0.12) !important; color: var(--svpl-navy-800) !important; border: 1px solid rgba(11, 37, 69, 0.25) !important; }
.text-gold { color: var(--svpl-gold) !important; }
.text-emerald { color: var(--svpl-green-dark) !important; }

/* Custom Scrollbar for independent scroll areas */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.4);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.7);
}

/* ==========================================================================
   NAVBARS & TOP MENUS (PERMANENT HIGH CONTRAST & VISIBILITY)
   ========================================================================== */
.navbar-svpl {
    background: linear-gradient(180deg, #071426 0%, #0B2545 100%) !important;
    box-shadow: 0 4px 24px rgba(4, 11, 21, 0.35);
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
    padding: 0.75rem 0;
}

.navbar-svpl .navbar-brand,
.navbar-svpl .navbar-brand span,
.navbar-svpl .brand-title {
    color: #FFFFFF !important;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
}

.navbar-svpl .nav-link {
    color: #E2E8F0 !important;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.55rem 0.95rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.navbar-svpl .nav-link:hover,
.navbar-svpl .nav-link.active {
    color: #FFFFFF !important;
    background: rgba(245, 158, 11, 0.22) !important;
}

.live-ticker-bar {
    background: #040B15 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    color: #CBD5E1 !important;
    padding: 6px 0;
}

.live-ticker-bar strong, .live-ticker-bar .text-white {
    color: #FFFFFF !important;
}

/* ==========================================================================
   PORTAL APP LAYOUT SYSTEM (DESKTOP & MOBILE COMPATIBLE)
   ========================================================================== */
.app-layout-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background: #F8FAFC;
    overflow-x: hidden;
}

.app-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #FFFFFF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    width: 100%;
}

.app-body-container {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    min-height: calc(100vh - 100px);
}

.app-main-content {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    background-color: #F8FAFC;
    padding: 1.5rem;
    overflow-x: hidden;
}

.app-footer {
    flex-shrink: 0;
    background: #FFFFFF;
    border-top: 1px solid #CBD5E1;
    padding: 8px 16px;
    font-size: 0.8rem;
    color: #334155 !important;
}

/* ==========================================================================
   EXPANDABLE SIDEBAR NAVIGATION
   ========================================================================== */
.portal-sidebar {
    width: 280px;
    min-width: 280px;
    height: calc(100vh - 88px);
    max-height: calc(100vh - 88px);
    position: sticky;
    top: 88px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
    background: linear-gradient(180deg, #061528 0%, #0B2545 100%);
    color: #E2E8F0;
    border-right: 1px solid rgba(245, 158, 11, 0.15);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1025;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 158, 11, 0.4) rgba(6, 21, 40, 0.6);
}

.portal-sidebar::-webkit-scrollbar {
    width: 5px;
}
.portal-sidebar::-webkit-scrollbar-track {
    background: rgba(6, 21, 40, 0.6);
}
.portal-sidebar::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.4);
    border-radius: 4px;
}
.portal-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 158, 11, 0.8);
}

@media (min-width: 992px) {
    .portal-sidebar {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Collapsed Sidebar State */
.portal-sidebar.collapsed {
    width: 76px;
    min-width: 76px;
}
.portal-sidebar.collapsed .nav-category-header,
.portal-sidebar.collapsed .sidebar-text,
.portal-sidebar.collapsed .badge-tag,
.portal-sidebar.collapsed .user-info-text,
.portal-sidebar.collapsed .collapse-arrow {
    display: none !important;
}
.portal-sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem 0;
    margin: 4px 8px;
}
.portal-sidebar.collapsed .nav-link i {
    font-size: 1.3rem;
}

/* Category Headers & Accordion Toggle */
.portal-sidebar .nav-category-header {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.85rem 1.25rem 0.3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.portal-sidebar .nav-category-header:hover {
    color: #FFFFFF;
}

.portal-sidebar .nav-category-header .collapse-arrow {
    transition: transform 0.2s ease;
    font-size: 0.65rem;
}

.portal-sidebar .nav-category-header.collapsed .collapse-arrow {
    transform: rotate(-90deg);
}

/* Nav Links */
.portal-sidebar .nav-link {
    color: #CBD5E1 !important;
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.55rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
    margin: 2px 10px;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.portal-sidebar .nav-link i {
    font-size: 1.1rem;
    color: #94A3B8;
    transition: color 0.2s ease;
}

.portal-sidebar .nav-link:hover {
    color: #FFFFFF !important;
    background: rgba(255, 255, 255, 0.08);
}

.portal-sidebar .nav-link:hover i {
    color: var(--svpl-gold-bright);
}

.portal-sidebar .nav-link.active {
    color: #FFFFFF !important;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.22) 0%, rgba(245, 158, 11, 0.06) 100%);
    border-left: 3.5px solid var(--svpl-gold);
    font-weight: 700;
}

.portal-sidebar .nav-link.active i {
    color: var(--svpl-gold-bright);
}

.portal-sidebar .user-profile-tile {
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.85rem 1.15rem;
    margin-top: auto;
}

/* ==========================================================================
   HERO CAROUSEL & AUTO-ADVANCING VISUALS
   ========================================================================== */
.hero-carousel {
    position: relative;
    background-color: #040B15;
    overflow: hidden;
}

.hero-carousel .carousel-item {
    height: 560px;
    background-size: cover;
    background-position: center;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}

.hero-carousel .carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(4, 11, 21, 0.94) 0%, rgba(7, 20, 38, 0.85) 50%, rgba(11, 37, 69, 0.70) 100%);
    display: flex;
    align-items: center;
}

.hero-carousel .carousel-indicators [data-bs-target] {
    width: 32px;
    height: 6px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.4);
    border: none;
    transition: all 0.3s ease;
}

.hero-carousel .carousel-indicators .active {
    width: 50px;
    background-color: var(--svpl-gold);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
}

.carousel-control-prev, .carousel-control-next {
    width: 48px;
    height: 48px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(4, 11, 21, 0.7);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.9;
    transition: all 0.2s ease;
    margin: 0 16px;
}

.carousel-control-prev:hover, .carousel-control-next:hover {
    background: var(--svpl-navy-800);
    border-color: var(--svpl-gold);
    opacity: 1;
}

/* ==========================================================================
   CORPORATE FOOTER (DEEP NAVY, HIGH CONTRAST)
   ========================================================================== */
.footer-svpl {
    background: #061528 !important;
    color: #94A3B8 !important;
    border-top: 3px solid var(--svpl-gold);
    padding: 4rem 0 2rem;
}

.footer-svpl h5, 
.footer-svpl h6,
.footer-svpl .footer-brand-title {
    color: #FFFFFF !important;
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 1.25rem;
}

.footer-svpl a {
    color: #CBD5E1 !important;
    text-decoration: none !important;
    display: block;
    padding: 5px 0;
    font-size: 0.9rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-svpl a:hover {
    color: var(--svpl-gold-bright) !important;
    transform: translateX(4px);
}

.footer-svpl .footer-legal-link {
    color: #94A3B8 !important;
    display: inline-block;
    padding: 0 8px;
}

.footer-svpl .footer-legal-link:hover {
    color: #FFFFFF !important;
    transform: none;
}

/* ==========================================================================
   CONTENT HYPERLINKS (SCOPED TO MAIN CONTENT ONLY)
   ========================================================================== */
main a:not(.btn):not(.badge):not(.nav-link):not(.navbar-brand):not(.footer-svpl a),
.app-main-content a:not(.btn):not(.badge):not(.nav-link):not(.navbar-brand) {
    color: #0B2545;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

main a:not(.btn):not(.badge):not(.nav-link):not(.navbar-brand):hover,
.app-main-content a:not(.btn):not(.badge):not(.nav-link):not(.navbar-brand):hover {
    color: var(--svpl-gold-dark);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-svpl-solar {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
    color: #FFFFFF !important;
    font-weight: 700;
    font-family: var(--font-heading);
    border: none !important;
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-svpl-solar:hover {
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%) !important;
    color: #061528 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.4);
}

.btn-svpl-navy {
    background: #0B2545 !important;
    color: #FFFFFF !important;
    font-weight: 600;
    font-family: var(--font-heading);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-svpl-navy:hover {
    background: #061528 !important;
    color: var(--svpl-gold-bright) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    transform: translateY(-1px);
}

.btn-svpl-green {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
    color: #FFFFFF !important;
    font-weight: 700;
    font-family: var(--font-heading);
    border: none !important;
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-svpl-green:hover {
    background: linear-gradient(135deg, #34D399 0%, #10B981 100%) !important;
    color: #FFFFFF !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   STAT CARDS & MODERN COMPONENTS
   ========================================================================== */
.stat-card-modern {
    background: #FFFFFF;
    border-radius: 14px;
    padding: 1.25rem;
    border: 1px solid #E2E8F0;
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(245, 158, 11, 0.4);
}

.stat-icon-modern {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.card-svpl {
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
}

/* ==========================================================================
   10-STAGE HORIZONTAL MOBILE STEPPER
   ========================================================================== */
.stepper-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1 1 0px;
    min-width: 90px;
    padding: 0 6px;
    flex-shrink: 0;
}

.stepper-node::after {
    content: '';
    position: absolute;
    top: 17px;
    left: 50%;
    width: 100%;
    height: 3px;
    background-color: #E2E8F0;
    z-index: 1;
}

.stepper-node:last-child::after {
    display: none;
}

.stepper-node.completed::after {
    background-color: #10B981;
}

.stepper-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F1F5F9;
    border: 2px solid #CBD5E1;
    color: #64748B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.stepper-node.completed .stepper-circle {
    background: #10B981;
    border-color: #10B981;
    color: #FFFFFF;
}

.stepper-node.active .stepper-circle {
    background: #0B2545;
    border-color: var(--svpl-gold);
    color: var(--svpl-gold-bright);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
}

.stepper-label {
    margin-top: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748B;
    text-align: center;
    line-height: 1.2;
}

.stepper-node.active .stepper-label {
    color: var(--svpl-navy-800);
    font-weight: 800;
}

.stepper-node.completed .stepper-label {
    color: #10B981;
    font-weight: 700;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   DESKTOP PORTAL APP LAYOUT & SIDEBAR
   ========================================================================== */
@media (min-width: 992px) {
    body:has(.app-layout-wrapper),
    body.has-portal-app {
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
        margin: 0;
        padding: 0;
    }
    .app-layout-wrapper {
        height: 100vh;
        max-height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: #F8FAFC;
    }
    .app-header {
        flex-shrink: 0;
        z-index: 1030;
        background: #FFFFFF;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    .app-body-container {
        flex: 1 1 0;
        display: flex;
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }
    .portal-sidebar {
        width: 270px;
        min-width: 270px;
        height: 100%;
        max-height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        background: linear-gradient(180deg, #061528 0%, #0B2545 100%);
        color: #FFFFFF;
        border-right: 1px solid rgba(245, 158, 11, 0.25);
        z-index: 1020;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        scrollbar-width: thin;
        scrollbar-color: rgba(245, 158, 11, 0.4) rgba(6, 21, 40, 0.6);
    }
}

@media (max-width: 991.98px) {
    .app-layout-wrapper {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        background: #F8FAFC;
    }
    .app-header {
        position: sticky;
        top: 0;
        z-index: 1030;
        background: #FFFFFF;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    .app-body-container {
        display: flex;
        flex: 1;
        min-height: calc(100vh - 110px);
    }
}

.portal-sidebar.collapsed {
    width: 78px;
    min-width: 78px;
}

.portal-sidebar.collapsed .sidebar-text,
.portal-sidebar.collapsed .collapse-arrow,
.portal-sidebar.collapsed .user-info-text {
    display: none !important;
}

.portal-sidebar.collapsed .nav-category-header span {
    font-size: 0;
}

.portal-sidebar.collapsed .nav-category-header span i {
    font-size: 1rem;
}

.portal-sidebar .nav-category-header {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 1.25rem 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.portal-sidebar .nav-category-header:hover {
    color: #FFFFFF;
}

.portal-sidebar .collapse-arrow {
    transition: transform 0.2s ease;
    font-size: 0.65rem;
}

.portal-sidebar .nav-category-header.collapsed .collapse-arrow {
    transform: rotate(-90deg);
}

.portal-sidebar .nav-link {
    color: #CBD5E1 !important;
    font-weight: 500;
    font-size: 0.88rem;
    padding: 0.55rem 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
    margin: 2px 10px;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.portal-sidebar .nav-link:hover,
.portal-sidebar .nav-link.active {
    color: #FFFFFF !important;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.25) 0%, rgba(245, 158, 11, 0.08) 100%);
    border-left: 3.5px solid var(--svpl-gold);
    font-weight: 700;
}

.portal-sidebar .nav-link i {
    font-size: 1.15rem;
    color: #94A3B8;
    flex-shrink: 0;
}

.portal-sidebar .nav-link.active i,
.portal-sidebar .nav-link:hover i {
    color: var(--svpl-gold-bright);
}

.portal-sidebar .user-profile-tile {
    padding: 0.85rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(6, 21, 40, 0.6);
}

@media (min-width: 992px) {
    .app-main-content {
        flex: 1 1 0;
        min-width: 0;
        height: 100%;
        max-height: 100%;
        padding: 1.75rem 2rem;
        background: #F8FAFC;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #CBD5E1 #F1F5F9;
    }
    .app-main-content::-webkit-scrollbar {
        width: 6px;
    }
    .app-main-content::-webkit-scrollbar-track {
        background: #F1F5F9;
    }
    .app-main-content::-webkit-scrollbar-thumb {
        background: #CBD5E1;
        border-radius: 4px;
    }
    .app-main-content::-webkit-scrollbar-thumb:hover {
        background: #94A3B8;
    }
    .app-footer {
        flex-shrink: 0;
        padding: 0.75rem 1.5rem;
        background: #FFFFFF;
        border-top: 1px solid #E2E8F0;
        font-size: 0.8rem;
        color: #64748B;
        z-index: 1020;
    }
}

@media (max-width: 991.98px) {
    .app-main-content {
        flex: 1;
        min-width: 0;
        padding: 1rem 1rem 80px 1rem;
        background: #F8FAFC;
    }
    .app-footer {
        padding: 0.75rem 1.5rem;
        background: #FFFFFF;
        border-top: 1px solid #E2E8F0;
        font-size: 0.8rem;
        color: #64748B;
    }
}

/* ==========================================================================
   MOBILE-FIRST BOTTOM NAVIGATION & OFFCANVAS DRAWER
   ========================================================================== */
.svpl-mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(6, 21, 40, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(245, 158, 11, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1045;
    padding: 0 4px;
    box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.35);
}

.svpl-mobile-bottom-nav .mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #94A3B8;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 4px 0;
    background: transparent;
    border: none;
    cursor: pointer;
}

.svpl-mobile-bottom-nav .mob-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.svpl-mobile-bottom-nav .mob-nav-item.active,
.svpl-mobile-bottom-nav .mob-nav-item:hover {
    color: #FBBF24;
}

.svpl-mobile-bottom-nav .mob-nav-item.active i {
    transform: translateY(-2px);
    color: #F59E0B;
}

/* Offcanvas Drawer for Mobile */
.offcanvas-svpl {
    background: linear-gradient(180deg, #061528 0%, #0B2545 100%) !important;
    color: #FFFFFF !important;
    border-right: 1px solid rgba(245, 158, 11, 0.25);
    width: 310px !important;
    max-width: 85vw;
}

.offcanvas-svpl .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.25rem;
}

.offcanvas-svpl .nav-category-header {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.75rem 1rem 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.offcanvas-svpl .nav-category-header:hover {
    color: #FFFFFF;
}

.offcanvas-svpl .collapse-arrow {
    transition: transform 0.2s ease;
    font-size: 0.65rem;
}

.offcanvas-svpl .nav-category-header.collapsed .collapse-arrow {
    transform: rotate(-90deg);
}

.offcanvas-svpl .nav-link {
    color: #CBD5E1 !important;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
    margin: 2px 8px;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.offcanvas-svpl .nav-link:hover,
.offcanvas-svpl .nav-link.active {
    color: #FFFFFF !important;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.25) 0%, rgba(245, 158, 11, 0.08) 100%);
    border-left: 3.5px solid var(--svpl-gold);
    font-weight: 700;
}

.offcanvas-svpl .nav-link i {
    font-size: 1.15rem;
    color: #94A3B8;
}

.offcanvas-svpl .nav-link.active i,
.offcanvas-svpl .nav-link:hover i {
    color: var(--svpl-gold-bright);
}

/* ==========================================================================
   MOBILE-FIRST RESPONSIVE MEDIA QUERIES & TOPBAR SYSTEM
   ========================================================================== */
.live-ticker-bar {
    background: linear-gradient(90deg, #061528 0%, #0B2545 100%);
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
    padding: 5px 1rem;
    font-size: 0.72rem;
    color: #E2E8F0;
    line-height: 1.5;
}

.app-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #FFFFFF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    width: 100%;
}

.app-header-strip {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    padding: 0 0.75rem !important;
    background: #FFFFFF !important;
    border-bottom: 1px solid #E2E8F0 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
    position: relative !important;
    z-index: 1020 !important;
    box-sizing: border-box !important;
}

.app-header-left {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.5rem !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
}

.app-header-emblem {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    border-radius: 9px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 900 !important;
    font-size: 1.05rem !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

.app-header-title-wrap {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-width: 0 !important;
    overflow: hidden !important;
    line-height: 1.2 !important;
}

.app-header-title-row {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

.app-header-title {
    font-family: var(--font-heading) !important;
    font-weight: 700 !important;
    font-size: 0.92rem !important;
    color: #0F172A !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.app-header-subtitle {
    font-size: 0.7rem !important;
    color: #64748B !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    line-height: 1.1 !important;
    margin-top: 1px !important;
}

.app-header-right {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.4rem !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
}

.app-header-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    max-width: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    box-sizing: border-box;
}

/* Responsive display enforcement for header action buttons */
.app-header-btn.d-none { display: none !important; }
@media (min-width: 992px) {
    .app-header-btn.d-lg-none { display: none !important; }
    .app-header-btn.d-none.d-lg-inline-flex,
    .app-header-btn.d-lg-inline-flex { display: inline-flex !important; }
}
@media (max-width: 991.98px) {
    .app-header-btn.d-none.d-lg-inline-flex { display: none !important; }
    .app-header-btn.d-lg-none { display: inline-flex !important; }
}
@media (min-width: 768px) {
    .app-header-btn.d-md-none { display: none !important; }
    .app-header-btn.d-none.d-md-inline-flex,
    .app-header-btn.d-md-inline-flex { display: inline-flex !important; }
}
@media (max-width: 767.98px) {
    .app-header-btn.d-none.d-md-inline-flex { display: none !important; }
    .app-header-btn.d-md-none { display: inline-flex !important; }
}

.app-header-btn:hover {
    transform: translateY(-1px);
}

.app-header-btn:active {
    transform: translateY(0);
}

.app-header-logout {
    border: 1px solid #FCA5A5 !important;
    background-color: #FEF2F2 !important;
    color: #DC2626 !important;
}

.app-header-logout:hover {
    background-color: #DC2626 !important;
    color: #FFFFFF !important;
    border-color: #DC2626 !important;
}

@media (max-width: 991.98px) {
    /* Unlock document and body scrolling on mobile */
    html, body {
        overflow-x: hidden !important;
        width: 100%;
        height: auto;
        min-height: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .app-layout-wrapper {
        height: auto !important;
        min-height: 100vh !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        display: flex;
        flex-direction: column;
    }

    .app-body-container {
        display: block !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        flex: 1 0 auto;
    }

    /* Hide desktop static sidebar on mobile */
    .portal-sidebar, .boe-sidebar, .eng-sidebar {
        display: none !important;
    }

    /* Mobile main content view padding & smooth touch scrolling */
    .app-main-content {
        height: auto !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        padding: 0.85rem 0.65rem 85px 0.65rem !important;
    }

    .boe-content, .eng-content {
        margin-left: 0 !important;
        padding: 0.85rem 0.65rem 85px 0.65rem !important;
        min-height: calc(100vh - 120px) !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
    }

    .app-header, .top-navbar {
        position: sticky;
        top: 0;
        z-index: 1030;
        width: 100%;
        margin-left: 0 !important;
    }

    /* Hide desktop footer on mobile to avoid overlap with bottom nav */
    .app-footer {
        display: none !important;
    }

    /* Modern Mobile Table Responsiveness */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0.5rem;
    }

    .table {
        min-width: 550px;
    }

    /* Responsive Headings & Typography */
    h3.font-heading {
        font-size: 1.25rem !important;
    }
    
    h4.font-heading {
        font-size: 1.15rem !important;
    }

    h5.font-heading {
        font-size: 1.05rem !important;
    }

    .stat-card-modern {
        padding: 0.85rem !important;
    }

    .stat-card-modern h4,
    .stat-card-modern h3 {
        font-size: 1.25rem !important;
    }

    .stat-card-modern h5 {
        font-size: 1.05rem !important;
    }

    .stat-icon-modern {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    /* Touch Target Optimization (>= 38px) */
    .btn {
        min-height: 36px;
        padding: 0.4rem 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .app-main-content, .boe-content, .eng-content {
        padding: 0.75rem 0.5rem 85px 0.5rem !important;
    }

    .stat-card-modern {
        border-radius: 12px;
    }

    .card-svpl {
        padding: 0.85rem !important;
        border-radius: 14px;
    }
}

/* =========================================================================
   BOOTSTRAP MODAL STACKING & BACKDROP FIX
   ========================================================================= */
.modal {
    z-index: 1060 !important;
}
.modal.fade.show {
    z-index: 1060 !important;
}
.modal-backdrop {
    z-index: 1050 !important;
}
.modal-dialog {
    z-index: 1065 !important;
    position: relative !important;
}
.modal-content {
    position: relative !important;
    z-index: 1070 !important;
    pointer-events: auto !important;
}
.modal-body {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 180px);
}

