/* ==========================================================================
   Solar Voyage Premium Glassmorphism Aurora Theme & Layout System (Vanilla CSS)
   ========================================================================== */

/* --- Base Variables & Core Style Reset --- */
:root {
    /* Color Palette - Premium Azure & Sky Blue */
    --bg-dark-deep: #0a1526;
    --bg-dark-card: rgba(13, 27, 49, 0.5);
    --bg-dark-input: rgba(255, 255, 255, 0.04);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-focus: rgba(56, 189, 248, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1; /* Enhanced brightness for superior readability */
    --text-muted: #94a3b8;
    
    /* Transitions & Shadows */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --box-shadow-glow: 0 10px 40px 0 rgba(0, 0, 0, 0.3);
    --glass-blur: blur(25px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.2);
}

/* Body and Global Background Setup */
body.dashboard-body {
    background: linear-gradient(135deg, #071120 0%, #0d2242 50%, #0a1a33 100%);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    letter-spacing: -0.01em;
    position: relative;
}

/* Shifting Aurora Blobs (Dynamic & Animated) */
body.dashboard-body::before,
body.dashboard-body::after,
.guest-wrapper::before,
.guest-wrapper::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -2;
    opacity: 0.55; /* Vibrant background colors */
    pointer-events: none;
}

/* Blob 1: Vibrant Azure */
body.dashboard-body::before, .guest-wrapper::before {
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #0ea5e9 0%, rgba(14, 165, 233, 0) 70%);
    top: -10vw;
    left: -5vw;
    animation: aurora-shift-1 20s infinite alternate ease-in-out;
}

/* Blob 2: Luminous Sky Blue */
body.dashboard-body::after, .guest-wrapper::after {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #38bdf8 0%, rgba(56, 189, 248, 0) 70%);
    bottom: -15vw;
    right: -5vw;
    animation: aurora-shift-2 25s infinite alternate ease-in-out;
}

/* Deep Aurora Blob 3 inside wrappers to add dimensional depth */
.dashboard-wrapper::before, .guest-container::before {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -2;
    opacity: 0.35;
    pointer-events: none;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #2563eb 0%, rgba(37, 99, 235, 0) 70%);
    top: 30vh;
    left: 25vw;
    animation: aurora-shift-3 18s infinite alternate ease-in-out;
}

@keyframes aurora-shift-1 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(6vw, 8vw) scale(1.1); }
    100% { transform: translate(-3vw, 10vw) scale(0.95); }
}

@keyframes aurora-shift-2 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-8vw, -6vw) scale(0.9); }
    100% { transform: translate(5vw, -3vw) scale(1.15); }
}

@keyframes aurora-shift-3 {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-4vw, 4vh) scale(1.1); }
    100% { transform: translate(4vw, -4vh) scale(0.9); }
}

h1, h2, h3, h4, h5, h6, .page-title, .brand-name-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* --- Glassmorphism Helper Classes --- */
.bg-glass {
    background: var(--bg-dark-card);
    backdrop-filter: var(--glass-blur) saturate(180%);
    -webkit-backdrop-filter: var(--glass-blur) saturate(180%);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-glow);
}

.bg-glass-deep {
    background: rgba(10, 20, 40, 0.8);
    backdrop-filter: var(--glass-blur) saturate(180%);
    -webkit-backdrop-filter: var(--glass-blur) saturate(180%);
    border: 1px solid var(--border-color);
}

/* --- Layout Structure (Sidebar + Main) --- */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Embedded Full-height Sidebar Navigation */
.dashboard-sidebar {
    width: 280px;
    background: rgba(8, 18, 36, 0.45);
    backdrop-filter: var(--glass-blur) saturate(180%);
    -webkit-backdrop-filter: var(--glass-blur) saturate(180%);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.brand-logo-fallback {
    font-size: 24px;
}

.brand-name-text {
    font-size: 20px;
    background: linear-gradient(135deg, #ffffff 0%, var(--brand-accent, #38bdf8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(56, 189, 248, 0.2);
}

.sidebar-menu {
    flex-grow: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition-smooth);
    font-weight: 500;
    font-size: 15px;
    border: 1px solid transparent;
}

.menu-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.06);
    border-color: rgba(56, 189, 248, 0.2);
    box-shadow: inset 0 0 12px rgba(56, 189, 248, 0.05), 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.menu-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 4px;
    background: var(--brand-accent, #38bdf8);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--brand-accent, #38bdf8);
}

.menu-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: var(--transition-smooth);
}

.menu-item:hover .menu-icon {
    opacity: 0.95;
    transform: scale(1.05);
}

.menu-item.active .menu-icon {
    color: var(--brand-accent, #38bdf8);
    opacity: 1;
    filter: drop-shadow(0 0 4px var(--brand-accent, rgba(56, 189, 248, 0.4)));
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-avatar {
    font-size: 20px;
    background: rgba(255, 255, 255, 0.03);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-color);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout-sidebar {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.btn-logout-sidebar:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}

.logout-icon {
    width: 18px;
    height: 18px;
}

/* Main Dashboard Panel */
.dashboard-main {
    flex-grow: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main-header {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(8, 18, 36, 0.2);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.header-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-root {
    color: var(--text-muted);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.breadcrumb-active {
    color: var(--text-primary);
    font-weight: 500;
}

.main-content-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding: 32px;
}

/* --- Guest / Setup Card Layouts --- */
.guest-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #071120 0%, #0d2242 50%, #0a1a33 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.guest-container {
    width: 100%;
    max-width: 480px;
    transition: var(--transition-smooth);
    z-index: 10;
}

.guest-container.setup-container {
    max-width: 1100px;
}

.guest-login-card {
    background: rgba(13, 27, 49, 0.5);
    backdrop-filter: var(--glass-blur) saturate(180%);
    -webkit-backdrop-filter: var(--glass-blur) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-badge {
    font-size: 32px;
    display: inline-block;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.3));
}

.login-header h2 {
    font-size: 28px;
    margin-bottom: 6px;
    color: #ffffff;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Setup Wizard Card */
.setup-wizard-card {
    max-width: 1000px;
    width: 100%;
    background: rgba(13, 27, 49, 0.45);
    backdrop-filter: var(--glass-blur) saturate(180%);
    -webkit-backdrop-filter: var(--glass-blur) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    margin: 40px auto;
}

.wizard-header {
    text-align: center;
    margin-bottom: 40px;
}

.wizard-header h2 {
    font-size: 32px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 0%, var(--brand-accent, #38bdf8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 15px rgba(56, 189, 248, 0.25);
}

.wizard-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Step indicator dots */
.step-indicator-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 600px;
    margin: 32px auto 0 auto;
}

.step-line {
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    z-index: 1;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(8, 18, 36, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    font-weight: 700;
    font-size: 13px;
    cursor: default;
    transition: var(--transition-smooth);
    position: relative;
}

.step-dot span {
    position: absolute;
    top: 38px;
    font-size: 11px;
    white-space: nowrap;
    font-weight: 500;
    color: var(--text-muted);
}

.step-dot.active {
    border-color: var(--brand-accent, #38bdf8);
    color: #ffffff;
    background: var(--brand-accent, #38bdf8);
    box-shadow: 0 0 15px var(--brand-accent-glow, rgba(56, 189, 248, 0.25));
}

.step-dot.active span {
    color: var(--text-primary);
    font-weight: 600;
}

.wizard-step-panel {
    display: none;
}

.wizard-step-panel.active {
    display: block;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    border-left: 3px solid var(--brand-accent, #38bdf8);
    padding-left: 12px;
}

.wizard-footer {
    display: flex;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

/* --- Form Fields & Input Styling --- */
.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control, .form-select {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    transition: var(--transition-smooth) !important;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
}

.form-control-color {
    padding: 6px !important;
    height: 48px !important;
}

.form-control:focus, .form-select:focus {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--brand-accent, #38bdf8) !important;
    box-shadow: 0 0 0 4px var(--brand-accent-glow, rgba(56, 189, 248, 0.25)) !important;
    outline: none !important;
}

/* --- Buttons & Action Elements --- */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 24px;
    font-size: 14px;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-accent, #38bdf8) 0%, var(--brand-primary, #0ea5e9) 100%);
    border: none;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover, .btn-primary:focus {
    box-shadow: 0 0 20px var(--brand-accent-glow, rgba(56, 189, 248, 0.25)), 0 4px 15px rgba(0, 0, 0, 0.25);
    opacity: 0.95;
    transform: translateY(-1px);
}

.btn-outline-brand {
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #e0f2fe;
    background: rgba(56, 189, 248, 0.02);
}

.btn-outline-brand:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--brand-accent, #38bdf8);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

/* --- Table & Grid Styling --- */
.table-responsive {
    border-radius: 14px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.dark-table {
    background: transparent;
    color: var(--text-primary);
    margin-bottom: 0;
}

.dark-table th {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 16px 20px;
    font-weight: 700;
}

.dark-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary); /* Upgraded from text-primary to secondary for rich legibility */
    background: transparent;
}

.dark-table td strong {
    color: var(--text-primary); /* Keep strong bold titles perfectly white */
}

.dark-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* --- Dashboard Customizer Drawer --- */
.dashboard-customizer-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    right: -340px;
    width: 340px;
    background: rgba(10, 20, 38, 0.65);
    backdrop-filter: var(--glass-blur) saturate(180%);
    -webkit-backdrop-filter: var(--glass-blur) saturate(180%);
    border-left: 1px solid var(--border-color);
    z-index: 1050;
    transition: var(--transition-smooth);
    padding: 28px;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.3);
}

.dashboard-customizer-drawer.active {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.btn-close-drawer {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-close-drawer:hover {
    color: var(--text-primary);
}

/* --- Dashboard Components --- */
.card.dark-card {
    background: var(--bg-dark-card);
    backdrop-filter: var(--glass-blur) saturate(160%);
    -webkit-backdrop-filter: var(--glass-blur) saturate(160%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--box-shadow-glow);
}

.kpi-card {
    padding: 24px;
    border-radius: 16px;
    background: var(--bg-dark-card);
    backdrop-filter: var(--glass-blur) saturate(160%);
    -webkit-backdrop-filter: var(--glass-blur) saturate(160%);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-glow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-smooth);
}

.kpi-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(56, 189, 248, 0.25);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.kpi-icon {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.02);
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.kpi-value {
    font-size: 28px;
    margin: 4px 0;
    color: #ffffff;
}

.kpi-subtext {
    font-size: 11px;
    color: var(--text-muted);
}

/* --- Dark Accordion --- */
.dark-accordion .accordion-item {
    background: rgba(255, 255, 255, 0.01) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    margin-bottom: 12px !important;
    overflow: hidden;
}

.dark-accordion .accordion-button {
    background: transparent !important;
    color: var(--text-primary) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
}

.dark-accordion .accordion-button:not(.collapsed) {
    background: rgba(255, 255, 255, 0.02) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.dark-accordion .accordion-body {
    background: rgba(0, 0, 0, 0.1) !important;
    color: var(--text-secondary) !important;
}

/* --- Dark Tabs --- */
.dark-tabs {
    border-bottom: 1px solid var(--border-color) !important;
}

.dark-tabs .nav-link {
    color: var(--text-secondary) !important;
    background: transparent !important;
    border: none !important;
    font-weight: 600 !important;
    padding: 12px 20px !important;
}

.dark-tabs .nav-link:hover {
    color: var(--text-primary) !important;
}

.dark-tabs .nav-link.active {
    color: var(--brand-accent, #38bdf8) !important;
    border-bottom: 3px solid var(--brand-accent, #38bdf8) !important;
    background: transparent !important;
}

/* --- Node Builder UI --- */
.node-builder-card {
    padding: 20px;
    border-radius: 14px;
    position: relative;
    background: rgba(255, 255, 255, 0.01);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--brand-accent, #38bdf8) !important;
    transition: var(--transition-smooth);
}

.node-builder-card:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.12);
    border-left: 4px solid var(--brand-accent, #38bdf8) !important;
}

.btn-close-node {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
}

.btn-close-node:hover {
    color: #ef4444;
}

.dark-progress {
    background-color: rgba(255, 255, 255, 0.04) !important;
    height: 8px !important;
    border-radius: 4px !important;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Customize Syncfusion dialog colors to dark theme */
.e-chart {
    font-family: inherit !important;
}

/* --- Dark Modal & Help Styling --- */
.dark-modal .modal-content {
    background: rgba(15, 25, 45, 0.65) !important;
    backdrop-filter: var(--glass-blur) saturate(180%) !important;
    -webkit-backdrop-filter: var(--glass-blur) saturate(180%) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4) !important;
    border-radius: 20px !important;
    color: var(--text-primary) !important;
}

.dark-modal .modal-header {
    border-bottom: 1px solid var(--border-color) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
}

.dark-modal .modal-footer {
    border-top: 1px solid var(--border-color) !important;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 0 4px;
    margin: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-close-modal:hover {
    color: var(--text-primary);
}

.btn-help {
    border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
    color: var(--text-secondary) !important;
    transition: var(--transition-smooth) !important;
    background: transparent !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
}

.btn-help:hover {
    background: var(--brand-accent-glow, rgba(56, 189, 248, 0.25)) !important;
    color: var(--brand-accent, #38bdf8) !important;
    border-color: var(--brand-accent, #38bdf8) !important;
    box-shadow: 0 0 10px var(--brand-accent-glow, rgba(56, 189, 248, 0.25)) !important;
}

.custom-field-help-banner {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
    border-radius: 8px;
}

/* --- Custom Utility & Badge Overlays --- */
.border-dashed {
    border-style: dashed !important;
    border-width: 1.5px !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.badge {
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    letter-spacing: 0.02em;
}

.badge.bg-secondary {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: var(--text-secondary) !important;
}

.badge.bg-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    color: #10b981 !important;
}

.badge.bg-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #ef4444 !important;
}

.badge.bg-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    color: #f59e0b !important;
}

.badge.bg-info {
    background-color: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: #3b82f6 !important;
}

.badge.bg-outline-primary {
    background-color: rgba(56, 189, 248, 0.08) !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    color: #38bdf8 !important;
}

/* ==========================================================================
   EXPLICIT GLOBAL OVERRIDES (ELIMINATE DARK GREY / BLACK TEXT)
   ========================================================================== */

/* Forces all Bootstrap text-muted, text-secondary, text-dark, and text-black to be bright and readable */
.text-muted, 
.text-secondary,
.sidebar-footer .user-role,
.sidebar-footer .btn-logout-sidebar,
.kpi-subtext,
.breadcrumb-root,
.breadcrumb-separator,
.form-text,
.small,
small {
    color: #cbd5e1 !important; /* Luminous cool grey/blue */
}

/* Elevate primary text colors */
.text-primary,
.text-light,
.page-title,
.card-title,
.modal-title,
.wizard-header h2,
.login-header h2,
.menu-item.active,
.form-label,
label,
h1, h2, h3, h4, h5, h6,
strong {
    color: #ffffff !important; /* Force true white for maximum contrast */
}

.text-dark,
.text-black {
    color: #f8fafc !important; /* Force bright light slate instead of dark/black */
}

/* Guarantee text inside alerts is light colored */
.alert {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px !important;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.08) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
}
.alert-danger * {
    color: #fca5a5 !important;
}

.alert-success {
    background: rgba(16, 185, 129, 0.08) !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
    color: #a7f3d0 !important;
}
.alert-success * {
    color: #a7f3d0 !important;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.08) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
    color: #fde047 !important;
}
.alert-warning * {
    color: #fde047 !important;
}

.alert-info {
    background: rgba(56, 189, 248, 0.08) !important;
    border-color: rgba(56, 189, 248, 0.25) !important;
    color: #bae6fd !important;
}
.alert-info * {
    color: #bae6fd !important;
}

/* Ensure step dots inactive text is readable */
.step-dot:not(.active) span {
    color: #94a3b8 !important;
}

/* Form controls inputs color styling overrides */
.form-control, 
.form-select {
    color: #ffffff !important;
}

.form-control::placeholder, 
.form-select::placeholder {
    color: #64748b !important;
}

/* Style dropdown options to have a dark background and white text, fixing the white-on-white text bug */
.form-select option,
select option {
    background-color: #0d1a30 !important; /* Premium dark navy-azure */
    color: #ffffff !important; /* Prominent white text */
}


/* Force card and modal containers to resolve generic text, spans, and divs in readable light blue-gray */
.card,
.card-body,
.kpi-card,
.modal-content,
.modal-body {
    color: #cbd5e1 !important; /* Luminous light grey/blue */
}

/* Ensure all nested generic text tags within cards and modals inherit readability styling */
.card span, .card p, .card div, .card li, .card td,
.kpi-card span, .kpi-card p, .kpi-card div,
.modal-content span, .modal-content p, .modal-content div, .modal-content label {
    color: inherit;
}

/* Ensure all headers, bold tags, and table headers inside cards/modals are prominent white */
.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.kpi-card h1, .kpi-card h2, .kpi-card h3, .kpi-card h4, .kpi-card h5, .kpi-card h6,
.modal-content h1, .modal-content h2, .modal-content h3, .modal-content h4, .modal-content h5, .modal-content h6,
strong, th {
    color: #ffffff !important;
}

/* --- Select2 Glassmorphic Dark Theme Overrides --- */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    transition: var(--transition-smooth) !important;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--single:active {
    border-color: rgba(56, 189, 248, 0.4) !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #ffffff !important;
    padding-left: 12px !important;
    font-size: 14px !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #64748b !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    right: 8px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #cbd5e1 transparent transparent transparent !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #cbd5e1 transparent !important;
}

/* Dropdown Menu styling */
.select2-dropdown {
    background: rgba(15, 25, 45, 0.95) !important;
    backdrop-filter: var(--glass-blur) saturate(180%) !important;
    -webkit-backdrop-filter: var(--glass-blur) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    z-index: 10000 !important; /* Stack above modals */
}

/* Search Box inside Select2 Dropdown */
.select2-search--dropdown {
    padding: 8px !important;
    background: transparent !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 6px !important;
    color: #ffffff !important;
    padding: 6px 10px !important;
    font-size: 14px !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    outline: none !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15) !important;
}

/* Options / Results */
.select2-results__options {
    max-height: 200px !important;
}

.select2-container--default .select2-results__option {
    padding: 8px 12px !important;
    color: #cbd5e1 !important;
    font-size: 14px !important;
    background-color: transparent !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: rgba(56, 189, 248, 0.15) !important;
    color: #38bdf8 !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: rgba(56, 189, 248, 0.25) !important;
    color: #ffffff !important;
}

/* Fix dropdown positioning in Bootstrap modals */
.select2-container--open {
    z-index: 1060 !important; /* Modal z-index is 1055, so select2 must be higher */
}