/* ==========================================================================
   BINGWA SMART WIFI — MASTER EXECUTIVE PORTAL THEME (SENIOR PRO 10/10)
   Exact Color Parity with Captive Portal:
     - Pure White:       #FFFFFF
     - Icy Blue:         #EAF5FF
     - Pale Blue:        #D9ECFF
     - Soft Sky:         #B9DEFF
     - Electric Sapphire:#2495FF
     - Deep Royal Blue:  #0867E8
     - Midnight Navy:    #102C69
     - Slate Muted:      #557099
     - Gold Accent:      #FFD44A / #F59E0B
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600;1,700&family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
    /* ── MASTER PORTAL COLOR TOKENS ── */
    --icy-blue:          #EAF5FF;
    --pale-blue:         #D9ECFF;
    --soft-sky:          #B9DEFF;
    --bright-blue:       #2495FF;
    --sapphire:          #2495FF;
    --deep-blue:         #0867E8;
    --navy-text:         #102C69;
    --slate-muted:       #557099;
    --gold-accent:       #FFD44A;
    --white:             #FFFFFF;

    /* ── OVERRIDE SYSTEM / BENNYWIFI TOKENS ── */
    --bw-primary:        #2495FF !important;
    --bw-primary-dark:   #0867E8 !important;
    --bw-primary-light:  #EAF5FF !important;
    --bw-primary-border: #B9DEFF !important;
    --bw-royal-blue:     #2495FF !important;
    --bw-royal-blue-dark:#0867E8 !important;
    --bw-royal-blue-deep:#102C69 !important;
    --bw-royal-light:    #EAF5FF !important;
    --bw-royal-border:   #B9DEFF !important;
    --bw-royal-glow:     rgba(36, 149, 255, 0.28) !important;

    --brand-blue:        #2495FF !important;
    --brand-blue-light:  #EAF5FF !important;
    --brand-blue-dark:   #0867E8 !important;

    /* ── SURFACES & CANVAS ── */
    --bw-bg-light:       #f4f8fd !important;
    --bw-card-bg:        #ffffff !important;
    --bw-text-main:      #102C69 !important;
    --bw-text-secondary: #334155 !important;
    --bw-text-muted:     #557099 !important;
    --bw-text-light:     #8ba2c4 !important;
    --bw-border:         #B9DEFF !important;
    --bw-border-light:   #EAF5FF !important;

    /* Semantic Status */
    --bw-success:        #10b981;
    --bw-danger:         #ef4444;
    --bw-warning:        #f59e0b;
    --bw-info:           #0867E8;

    /* Shadows */
    --portal-card-shadow: 0 6px 24px rgba(8, 103, 232, 0.06);
    --portal-hover-shadow:0 12px 32px rgba(36, 149, 255, 0.16);
    --portal-glow:        0 4px 18px rgba(36, 149, 255, 0.35);
}

/* ── 1. GLOBAL BODY & ATMOSPHERE ── */
body {
    background: radial-gradient(circle at 50% 12%, #ffffff 0%, #f0f7ff 50%, #e8f3ff 100%) !important;
    background-attachment: fixed !important;
    color: var(--navy-text) !important;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    min-height: 100vh !important;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    height: 380px;
    background: radial-gradient(ellipse at 50% 0%, rgba(36, 149, 255, 0.09) 0%, rgba(234, 245, 255, 0.02) 65%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.app-layout-wrapper {
    background: transparent !important;
    position: relative;
    z-index: auto !important;
}

.main-content-layout {
    background: transparent !important;
}

/* ── 2. TOPBAR: EXECUTIVE PORTAL WHITE GLASSMORPHISM ── */
.bw-royal-topbar {
    height: var(--topbar-height, 70px) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1030 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 1.75rem !important;
    border-bottom: 1.5px solid #B9DEFF !important;
    box-shadow: 0 4px 20px rgba(8, 103, 232, 0.05) !important;
    color: #102C69 !important;
}

.topbar-logo-box {
    width: 44px !important;
    height: 44px !important;
    background: #EAF5FF !important;
    border: 1.5px solid #B9DEFF !important;
    border-radius: 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #2495FF !important;
    font-size: 1.4rem !important;
    box-shadow: 0 2px 10px rgba(36, 149, 255, 0.15) !important;
    flex-shrink: 0 !important;
}

.topbar-logo-box i {
    color: #2495FF !important;
}

.topbar-business-title {
    font-size: 1.25rem !important;
    font-weight: 900 !important;
    color: #102C69 !important;
    letter-spacing: -0.02em !important;
    text-transform: uppercase !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 360px !important;
}

.topbar-welcome-msg {
    font-size: 0.94rem !important;
    font-weight: 700 !important;
    color: #557099 !important;
    letter-spacing: 0.01em !important;
}

.topbar-toggle-btn {
    background: #EAF5FF !important;
    border: 1.5px solid #B9DEFF !important;
    color: #0867E8 !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.3rem !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.topbar-toggle-btn:hover {
    background: #D9ECFF !important;
    border-color: #2495FF !important;
    color: #0867E8 !important;
    transform: translateY(-1px) !important;
}

.topbar-bell-btn {
    position: relative !important;
    background: #EAF5FF !important;
    border: 1.5px solid #B9DEFF !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #0867E8 !important;
    font-size: 1.15rem !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
    text-decoration: none !important;
}

.topbar-bell-btn:hover {
    background: #D9ECFF !important;
    border-color: #2495FF !important;
    color: #0867E8 !important;
    transform: translateY(-1px) !important;
}

.topbar-bell-badge {
    position: absolute !important;
    top: -4px !important;
    right: -4px !important;
    background: #ef4444 !important;
    color: #ffffff !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    padding: 2px 6px !important;
    border-radius: 999px !important;
    border: 2px solid #ffffff !important;
    line-height: 1 !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4) !important;
}

.topbar-user-pill {
    background: #EAF5FF !important;
    border: 1.5px solid #B9DEFF !important;
    color: #0867E8 !important;
    padding: 7px 18px !important;
    border-radius: 999px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.topbar-user-pill:hover {
    background: #D9ECFF !important;
    border-color: #2495FF !important;
    color: #0867E8 !important;
    transform: translateY(-1px) !important;
}

.topbar-user-pill i {
    color: #2495FF !important;
}

/* ── 3. MODERN BREATHEABLE SIDEBAR ── */
#mainSidebar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1.5px solid #B9DEFF !important;
    box-shadow: 4px 0 24px rgba(8, 103, 232, 0.04) !important;
}

.sb-link {
    color: #475569 !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.sb-link i {
    color: #64748b !important;
    transition: all 0.2s ease !important;
}

.sb-link:hover {
    background: #EAF5FF !important;
    color: #0867E8 !important;
    transform: translateX(3px) !important;
}

.sb-link:hover i {
    color: #2495FF !important;
}

/* Active Link State */
.sb-link.active {
    background: linear-gradient(135deg, #EAF5FF 0%, #D9ECFF 100%) !important;
    color: #0867E8 !important;
    border: 1.5px solid #B9DEFF !important;
    box-shadow: 0 4px 14px rgba(36, 149, 255, 0.14) !important;
    font-weight: 800 !important;
}

.sb-link.active i {
    color: #2495FF !important;
}

.sb-divider {
    background: #B9DEFF !important;
    opacity: 0.6;
}

/* Sidebar Badges */
.sb-pill-new {
    background: #EAF5FF !important;
    color: #0867E8 !important;
    border: 1px solid #B9DEFF !important;
    font-weight: 800 !important;
}

/* ── 4. CARDS & HERO SURFACES ── */
.bw-card,
.card,
.page-header-card,
.bw-hero-card,
.plans-header-card,
.bw-kpi-card,
.bw-stat-card {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1.5px solid #B9DEFF !important;
    border-radius: 18px !important;
    box-shadow: var(--portal-card-shadow) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.bw-kpi-card:hover,
.card:hover,
.bw-stat-card:hover {
    border-color: #2495FF !important;
    box-shadow: var(--portal-hover-shadow) !important;
    transform: translateY(-2px) !important;
}

.bw-stat-card {
    padding: 22px 24px !important;
}

.bw-stat-value {
    color: #102C69 !important;
    font-weight: 900 !important;
}

.bw-stat-label {
    color: #557099 !important;
    font-weight: 700 !important;
}

.page-header-title,
.bw-hero-title,
h3.fw-bold.text-dark,
.page-title {
    color: var(--navy-text) !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
}

.page-header-subtitle,
.bw-hero-sub,
.text-muted {
    color: var(--slate-muted) !important;
}

/* Card Headers */
.card-header,
div[style*="background: #f8fafc"],
div[style*="background:#f8fafc"] {
    background: #EAF5FF !important;
    border-bottom: 1.5px solid #B9DEFF !important;
    color: var(--navy-text) !important;
}

/* ── 5. STAT ICONS & ROUND ACCENTS ── */
.bw-kpi-icon,
.bw-stat-icon-circle,
.plan-left-circle {
    background: #EAF5FF !important;
    color: #2495FF !important;
    border: 1.5px solid #B9DEFF !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 8px rgba(36, 149, 255, 0.12) !important;
}

.bw-kpi-icon i,
.bw-stat-icon-circle i {
    color: #2495FF !important;
}

/* ── 6. BUTTON SYSTEM (PORTAL SAPPHIRE ENGINE) ── */
.btn-primary,
.btn-bw-primary,
.btn-connect,
button.btn-primary,
a.btn-primary {
    background: linear-gradient(135deg, #2495FF 0%, #0867E8 100%) !important;
    border: none !important;
    color: #FFFFFF !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    padding: 10px 22px !important;
    box-shadow: var(--portal-glow) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    text-decoration: none !important;
}

.btn-primary:hover,
.btn-bw-primary:hover,
.btn-connect:hover,
button.btn-primary:hover,
a.btn-primary:hover {
    background: linear-gradient(135deg, #0867E8 0%, #2495FF 100%) !important;
    color: #FFFFFF !important;
    box-shadow: 0 6px 22px rgba(36, 149, 255, 0.48) !important;
    transform: translateY(-1px) !important;
}

.btn-primary:active,
.btn-bw-primary:active,
.btn-connect:active {
    transform: scale(0.98) !important;
}

/* Soft Primary & Edit Buttons */
.btn-soft-primary,
.btn-edit {
    background: #EAF5FF !important;
    color: #0867E8 !important;
    border: 1.5px solid #B9DEFF !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
}

.btn-soft-primary:hover,
.btn-edit:hover {
    background: #D9ECFF !important;
    color: #0867E8 !important;
    border-color: #2495FF !important;
    transform: translateY(-1px);
}

/* Soft Warning / Smart Setup */
.btn-soft-warning {
    background: #FFFBEB !important;
    color: #D97706 !important;
    border: 1.5px solid #FDE68A !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    transition: all 0.2s ease !important;
}

.btn-soft-warning:hover {
    background: #FEF3C7 !important;
    color: #B45309 !important;
    border-color: #F59E0B !important;
}

/* ── 7. VOUCHER SYSTEM & CHIPS ── */
.voucher-code-chip {
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    letter-spacing: 0.5px !important;
    background: #EAF5FF !important;
    color: #0867E8 !important;
    padding: 5px 12px !important;
    border-radius: 10px !important;
    border: 1.5px solid #B9DEFF !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: 0 2px 6px rgba(8, 103, 232, 0.05) !important;
    transition: all 0.2s ease !important;
}

.voucher-code-chip:hover {
    background: #D9ECFF !important;
    border-color: #2495FF !important;
    color: #0867E8 !important;
}

.btn-copy-code:hover {
    color: #2495FF !important;
    background: #EAF5FF !important;
}

/* ── 8. BADGES & STATUS PILLS ── */
.badge[style*="#eff6ff"],
.badge[style*="#2563eb"],
.bw-pill-blue {
    background: #EAF5FF !important;
    color: #0867E8 !important;
    border: 1.5px solid #B9DEFF !important;
    border-radius: 999px !important;
    font-weight: 800 !important;
    padding: 4px 12px !important;
}

.badge.bg-light.text-dark {
    background: #EAF5FF !important;
    color: #102C69 !important;
    border: 1px solid #B9DEFF !important;
}

/* ── 9. FORM INPUTS & CONTROLS ── */
.form-control,
.form-select {
    background-color: #FFFFFF !important;
    border: 1.5px solid #B9DEFF !important;
    border-radius: 12px !important;
    padding: 10px 14px !important;
    font-size: 0.92rem !important;
    color: var(--navy-text) !important;
    transition: all 0.2s ease !important;
}

.form-control:focus,
.form-select:focus {
    background-color: #FFFFFF !important;
    border-color: #2495FF !important;
    box-shadow: 0 0 0 3.5px rgba(36, 149, 255, 0.18) !important;
    outline: none !important;
    color: var(--navy-text) !important;
}

.form-label {
    font-weight: 700 !important;
    color: var(--navy-text) !important;
    font-size: 0.88rem !important;
    margin-bottom: 6px !important;
}

/* ── 10. TABLES & FINANCIAL LEDGERS ── */
.table,
.bw-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
}

.table th,
.bw-table th {
    background: #EAF5FF !important;
    color: var(--navy-text) !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    padding: 14px 18px !important;
    border-bottom: 1.5px solid #B9DEFF !important;
    border-top: none !important;
}

.table td,
.bw-table td {
    padding: 14px 18px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid rgba(185, 222, 255, 0.5) !important;
    color: var(--navy-text) !important;
    font-size: 0.88rem !important;
}

.table tbody tr:hover,
.bw-table tbody tr:hover {
    background-color: #F4F9FF !important;
}

/* ── 11. MODAL DIALOGS ── */
.modal-content {
    background: #FFFFFF !important;
    border: 1.5px solid #B9DEFF !important;
    border-radius: 20px !important;
    box-shadow: 0 16px 48px rgba(8, 103, 232, 0.16) !important;
    overflow: hidden !important;
}

.modal-header {
    background: #EAF5FF !important;
    border-bottom: 1.5px solid #B9DEFF !important;
    padding: 18px 24px !important;
}

.modal-title {
    color: var(--navy-text) !important;
    font-weight: 800 !important;
}

.modal-footer {
    border-top: 1px solid #B9DEFF !important;
    background: #FFFFFF !important;
    padding: 16px 24px !important;
}

/* ── 12. HIGH-SPECIFICITY OVERRIDES FOR BENNYWIFI INLINE STYLES ── */
[style*="color: #2563eb"],
[style*="color:#2563eb"],
[style*="color: #1d4ed8"],
[style*="color:#1d4ed8"],
[style*="color: #1e40af"],
[style*="color:#1e40af"],
[style*="color: var(--brand-blue)"],
[style*="color:var(--brand-blue)"] {
    color: #2495FF !important;
}

[style*="background: #2563eb"],
[style*="background:#2563eb"],
[style*="background: #1d4ed8"],
[style*="background:#1d4ed8"] {
    background: linear-gradient(135deg, #2495FF 0%, #0867E8 100%) !important;
    color: #FFFFFF !important;
}

[style*="background: #eff6ff"],
[style*="background:#eff6ff"],
[style*="background: var(--brand-blue-light)"],
[style*="background:var(--brand-blue-light)"] {
    background: #EAF5FF !important;
}

[style*="border: 1px solid #bfdbfe"],
[style*="border:1px solid #bfdbfe"],
[style*="border: 1.5px solid #bfdbfe"],
[style*="border-color: #bfdbfe"] {
    border-color: #B9DEFF !important;
}

[style*="border: 1px solid #e2e8f0"],
[style*="border:1px solid #e2e8f0"],
[style*="border: 1.5px solid #e2e8f0"] {
    border-color: rgba(185, 222, 255, 0.75) !important;
}

.text-primary {
    color: #2495FF !important;
}

.bg-primary {
    background: linear-gradient(135deg, #2495FF 0%, #0867E8 100%) !important;
}

.border-primary {
    border-color: #2495FF !important;
}

/* ── 13. AUTHENTICATION PAGES (LOGIN / REGISTER) HARMONIZATION ── */
.auth-card,
.login-card {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1.5px solid #B9DEFF !important;
    border-radius: 22px !important;
    box-shadow: 0 12px 36px rgba(8, 103, 232, 0.1) !important;
}

.btn-auth-submit {
    background: linear-gradient(135deg, #2495FF 0%, #0867E8 100%) !important;
    border: none !important;
    color: #FFFFFF !important;
    border-radius: 12px !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 18px rgba(36, 149, 255, 0.38) !important;
}

.btn-auth-submit:hover {
    background: linear-gradient(135deg, #0867E8 0%, #2495FF 100%) !important;
    box-shadow: 0 6px 24px rgba(36, 149, 255, 0.5) !important;
}

/* ── 14. LANDING, WELCOME & AUTH ROYAL BLUE OVERRIDES ── */
.auth-card-luxury {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1.5px solid #B9DEFF !important;
    border-radius: 22px !important;
    box-shadow: 0 16px 40px rgba(8, 103, 232, 0.08), 0 0 0 1px rgba(185, 222, 255, 0.6) !important;
}

.brand-logo-box {
    background: linear-gradient(135deg, #2495FF 0%, #0867E8 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(36, 149, 255, 0.35) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.btn-royal-primary {
    background: linear-gradient(135deg, #2495FF 0%, #0867E8 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 6px 20px rgba(36, 149, 255, 0.32) !important;
}

.btn-royal-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0867E8 0%, #2495FF 100%) !important;
    box-shadow: 0 10px 28px rgba(8, 103, 232, 0.4) !important;
}

.btn-royal-secondary {
    background: #EAF5FF !important;
    color: #0867E8 !important;
    border: 1.5px solid #B9DEFF !important;
}

.btn-royal-secondary:hover {
    background: #D9ECFF !important;
    color: #102C69 !important;
    border-color: #2495FF !important;
}

.gradient-text-royal {
    background: linear-gradient(135deg, #2495FF 0%, #0867E8 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.pulse-dot-royal {
    background: #2495FF !important;
    box-shadow: 0 0 0 0 rgba(36, 149, 255, 0.7) !important;
}

.hero-pill-badge {
    background: #EAF5FF !important;
    color: #0867E8 !important;
    border: 1.5px solid #B9DEFF !important;
}

.luxury-navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-bottom: 1.5px solid #B9DEFF !important;
    box-shadow: 0 4px 20px rgba(8, 103, 232, 0.05) !important;
}

.ambient-mesh-glow {
    background: 
        radial-gradient(circle at 50% 12%, rgba(36, 149, 255, 0.14) 0%, transparent 60%),
        radial-gradient(circle at 85% 85%, rgba(8, 103, 232, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 15% 70%, rgba(185, 222, 255, 0.15) 0%, transparent 50%) !important;
}



/* ════════════════════════════════════════════════════════════════
   CRITICAL MODAL & BACKDROP STACKING CONTEXT RESCUE
   Guarantees modals are ALWAYS on top of backdrops and 100% interactive
   ════════════════════════════════════════════════════════════════ */
.modal {
    z-index: 1060 !important;
}
.modal-backdrop {
    z-index: 1050 !important;
}
.modal-backdrop.show {
    opacity: 0.45 !important;
}
.modal-dialog {
    z-index: 1065 !important;
    position: relative !important;
    pointer-events: auto !important;
}
.modal-content {
    position: relative !important;
    z-index: 1070 !important;
    pointer-events: auto !important;
}
