:root {
    --portal-primary: #2563EB;
    --portal-accent: #14B8A6;
    --portal-ink: #0F172A;
    --portal-muted: #64748B;
    --portal-border: #E2E8F0;
    --portal-bg: #F8FAFC;
    --portal-success: #22C55E;
    --portal-warning: #F59E0B;
    --portal-purple: #8B5CF6;
    --portal-sidebar: #0F172A;
}

body {
    background: var(--portal-bg);
    color: var(--portal-ink);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

h1, .h1-premium {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--portal-ink);
}

h2, .h2-premium {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--portal-ink);
}

.card-title-premium {
    font-size: 20px;
    font-weight: 600;
    color: var(--portal-ink);
}

.form-label, label {
    font-size: 14px;
    font-weight: 500;
    color: var(--portal-ink);
}

.topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--portal-border);
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--portal-primary), var(--portal-accent));
    color: #fff;
    font-weight: 800;
}

/* Premium Card System */
.portal-card {
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glassmorphism Header */
.glass-header {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
}

/* Hover Lift Animation */
.hover-lift {
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
    border-color: var(--portal-primary);
}

/* Shell Layout */
.admin-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 67px);
}

/* Sidebar Styling */
.admin-sidebar {
    background: #ffffff;
    color: #0f172a;
    padding: 1.5rem 1rem;
    border-right: 1px solid #f1f5f9;
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
}

.admin-sidebar a {
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.15s ease;
    margin-bottom: 0.2rem;
}

.admin-sidebar a:hover {
    background: #f8fafc;
    color: #0f172a;
}

.admin-sidebar a.active {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 600;
    box-shadow: none;
}

.admin-sidebar .nav-label {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 700;
    margin: 1.5rem 0.85rem 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.admin-content {
    min-width: 0;
    padding: 2rem;
}

/* Master Data Cards */
.master-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 94px;
}

.master-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #eff6ff;
    color: var(--portal-primary);
    font-size: 1.6rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.hover-lift:hover .master-icon {
    background: var(--portal-primary);
    color: #fff;
}

/* Form and Fields styling */
.form-control, .form-select {
    border-color: var(--portal-border);
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 0.55rem 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--portal-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Gradient Publish Button */
.btn-publish-gradient {
    background: linear-gradient(135deg, var(--portal-success), #10B981);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
    transition: all 0.2s ease;
}

.btn-publish-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.35);
    color: #fff;
}

.btn-publish-gradient:active {
    transform: translateY(1px);
}

/* Stepper Workflow Diagram */
.workflow-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow-x: auto;
    padding: 1rem 0;
}

.workflow-card {
    background: #fff;
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    width: 150px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.workflow-card-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
}

.workflow-arrow {
    font-size: 1.8rem;
    color: #cbd5e1;
    font-weight: bold;
    padding: 0 1rem;
    user-select: none;
}

/* Database ER Table Cards */
.er-diagram-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.er-table-card {
    background: #fff;
    border: 1px solid var(--portal-border);
    border-top: 4px solid var(--portal-primary);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.er-table-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--portal-border);
    padding: 0.6rem 0.8rem;
    font-weight: 700;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--portal-ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.er-table-body {
    padding: 0.4rem 0;
}

.er-field {
    padding: 0.3rem 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: monospace;
    font-size: 0.8rem;
}

.er-field:hover {
    background: #f1f5f9;
}

.er-field-type {
    color: #64748b;
    font-size: 0.75rem;
}

.er-key {
    font-weight: bold;
    font-size: 0.7rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    line-height: 1;
}

.er-key.pk {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.er-key.fk {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

/* Scenario cards style */
.scenario-card {
    border-left: 4px solid var(--portal-primary);
}

/* Utilities */
.chip-select option:checked {
    background: var(--portal-primary);
    color: #fff;
}

.status-pill {
    border: 1px solid #fed7aa;
    background: #fff7ed;
    color: #c2410c;
    border-radius: 6px;
    padding: 0.25rem 0.55rem;
    font-weight: 700;
}

.smart-paste-box {
    border: 1px dashed #9b7cf4;
    border-radius: 8px;
    background: #fbf8ff;
    min-height: 112px;
    display: grid;
    place-items: center;
    color: #6d28d9;
    font-weight: 700;
}

.btn-primary {
    --bs-btn-bg: var(--portal-primary);
    --bs-btn-border-color: var(--portal-primary);
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
}

.stat-tile {
    min-height: 112px;
}

.muted {
    color: var(--portal-muted);
}

.question-shell {
    display: grid;
    grid-template-columns: minmax(230px, 290px) 1fr;
    gap: 1rem;
}

.sticky-panel {
    position: sticky;
    top: 82px;
    align-self: start;
}

.exam-shell {
    display: grid;
    grid-template-columns: 1fr 286px;
    gap: 1rem;
}

.palette {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.45rem;
}

.palette button {
    aspect-ratio: 1;
    border: 1px solid var(--portal-border);
    border-radius: 7px;
    background: #fff;
    font-weight: 700;
}

.palette .answered { background: #16A34A; color: #fff; }
.palette .unanswered { background: #DC2626; color: #fff; }
.palette .review { background: #7C3AED; color: #fff; }
.palette .not_visited { background: #E2E8F0; color: #334155; }

.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
    display: grid;
    gap: 0.65rem;
}

.portal-toast {
    min-width: min(360px, calc(100vw - 2rem));
    padding: 0.85rem 1rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--portal-border);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
}

.portal-toast.success { border-left: 5px solid #16a34a; }
.portal-toast.error { border-left: 5px solid #dc2626; }
.portal-toast.warning { border-left: 5px solid #f59e0b; }

@media (max-width: 991px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none !important;
    }

    .question-shell,
    .exam-shell {
        grid-template-columns: 1fr;
    }

    .sticky-panel {
        position: static;
    }

    .workflow-container {
        justify-content: flex-start;
    }
}

.btn-purple {
    background-color: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}
.btn-purple:hover {
    background-color: #6d28d9;
    border-color: #6d28d9;
    color: #fff;
}
.palette button.active-palette {
    outline: 3px solid var(--portal-primary);
    outline-offset: 1px;
    border-color: var(--portal-primary);
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}
.border-dashed {
    border-style: dashed !important;
}

/* Sidebar Collapse Transition */
.admin-shell {
    transition: grid-template-columns 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-sidebar {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, padding 0.25s ease, width 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left center;
}

.admin-shell.collapsed {
    grid-template-columns: 0px 1fr !important;
}

.admin-shell.collapsed .admin-sidebar {
    transform: scaleX(0);
    opacity: 0;
    padding: 0 !important;
    overflow: hidden;
    border-right: none;
    width: 0 !important;
    min-width: 0 !important;
}

/* Floating Sidebar Toggle Button */
.sidebar-toggle-trigger {
    position: absolute;
    top: 24px;
    left: -15px;
    width: 30px;
    height: 30px;
    background: #ffffff;
    border: 1.5px solid var(--portal-border);
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 !important;
    color: var(--portal-primary);
    z-index: 1000;
}

.sidebar-toggle-trigger:hover {
    background-color: #f8fafc;
    border-color: var(--portal-primary);
    color: var(--portal-primary);
    transform: scale(1.1);
}

.sidebar-toggle-trigger .bi-chevron-left {
    transition: transform 0.25s ease;
    font-size: 0.8rem;
    font-weight: 800;
}

.admin-shell.collapsed .sidebar-toggle-trigger .bi-chevron-left {
    transform: rotate(180deg);
}

/* Position toggle button on the left edge when sidebar is collapsed */
.admin-shell.collapsed .sidebar-toggle-trigger {
    left: 15px !important;
}

/* ==========================================
   NEXUS PREMIUM DASHBOARD STYLE SUITE
   ========================================== */
.nexus-dashboard {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    color: #0f172a;
}

.nexus-card {
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.nexus-card:hover {
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 8px -1px rgba(15, 23, 42, 0.02);
}

.nexus-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

.nexus-stat-title {
    color: #64748b;
    font-size: 0.825rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.nexus-stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #0f172a;
    line-height: 1;
}

.nexus-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.nexus-badge-success {
    background: #ecfdf5;
    color: #059669;
}

.nexus-badge-danger {
    background: #fef2f2;
    color: #dc2626;
}

.nexus-badge-info {
    background: #eff6ff;
    color: #2563eb;
}

.nexus-btn-outline {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
}

.nexus-btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.nexus-btn-primary {
    background: #7c3aed;
    border: 1px solid #7c3aed;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
}

.nexus-btn-primary:hover {
    background: #6d28d9;
    border-color: #6d28d9;
    color: #ffffff;
}

/* Custom Table Styling */
.nexus-table {
    width: 100%;
    border-collapse: collapse;
}

.nexus-table th {
    font-size: 0.725rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.nexus-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
}

.nexus-table tr:last-child td {
    border-bottom: none;
}

.nexus-table tr:hover td {
    background: #f8fafc;
}

.nexus-checkbox {
    width: 18px;
    height: 18px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nexus-checkbox:checked {
    background-color: #7c3aed;
    border-color: #7c3aed;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 600;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
}

.avatar-circle.purple {
    background-color: #f5f3ff;
    color: #7c3aed;
}

.avatar-circle.cyan {
    background-color: #ecfeff;
    color: #0891b2;
}

.avatar-circle.emerald {
    background-color: #ecfdf5;
    color: #059669;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.nexus-progress {
    height: 6px;
    border-radius: 3px;
    background: #f1f5f9;
    overflow: hidden;
}

.nexus-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ==========================================
   GLOBAL PILL BUTTONS & PALETTE SUITE
   ========================================== */
:root {
    --portal-primary: #0a4c3e !important;
    --portal-accent: #10b981 !important;
}

.btn {
    border-radius: 9999px !important;
    font-weight: 600 !important;
    padding: 0.55rem 1.4rem !important;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    font-size: 0.875rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
}

/* Primary Button: Solid Dark Forest Green */
.btn-primary, .nexus-btn-primary {
    background-color: #0a4c3e !important;
    border-color: #0a4c3e !important;
    color: #ffffff !important;
    --bs-btn-bg: #0a4c3e !important;
    --bs-btn-border-color: #0a4c3e !important;
    --bs-btn-hover-bg: #0e6452 !important;
    --bs-btn-hover-border-color: #0e6452 !important;
}

.btn-primary:hover, .nexus-btn-primary:hover {
    background-color: #0e6452 !important;
    border-color: #0e6452 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 76, 62, 0.2) !important;
}

/* Outline Primary / Secondary Outline: Thin Border, Text color matching */
.btn-outline-primary, .nexus-btn-outline {
    background-color: transparent !important;
    border: 1.5px solid #3B82F6 !important;
    color: #3B82F6 !important;
    --bs-btn-color: #3B82F6 !important;
    --bs-btn-border-color: #3B82F6 !important;
    --bs-btn-hover-bg: #f0f9ff !important; /* Very light blue background */
    --bs-btn-hover-border-color: #3b82f6 !important;
}

.btn-outline-primary:hover, .nexus-btn-outline:hover {
    background-color: #f0f9ff !important;
    border-color: #3B82F6 !important;
    color: #2563eb !important;
    transform: translateY(-1px);
}

/* Light / Secondary Button: Light Cream background, grey border */
.btn-light, .btn-secondary {
    background-color: #f7f6f5 !important;
    border: 1px solid #e5e7eb !important;
    color: #1f2937 !important;
    --bs-btn-bg: #f7f6f5 !important;
    --bs-btn-border-color: #e5e7eb !important;
}

.btn-light:hover, .btn-secondary:hover {
    background-color: #efedea !important;
    color: #111827 !important;
    border-color: #cbd5e1 !important;
}

/* Size small & extra small overrides */
.btn-sm, .btn-xs {
    padding: 0.4rem 1.15rem !important;
    font-size: 0.8rem !important;
}

/* ==========================================
   DARK MODE THEME SUITE
   ========================================== */
[data-bs-theme="dark"] {
    --portal-ink: #f8fafc;
    --portal-muted: #94a3b8;
    --portal-border: #334155;
    --portal-bg: #0f172a;
    --portal-sidebar: #1e293b;
    color-scheme: dark;
}

[data-bs-theme="dark"] body {
    background-color: var(--portal-bg) !important;
    color: var(--portal-ink) !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .text-muted, 
[data-bs-theme="dark"] .muted {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .border-light-subtle,
[data-bs-theme="dark"] .border {
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .topbar {
    background: rgba(15, 23, 42, 0.85) !important;
    border-bottom: 1px solid #334155 !important;
}

[data-bs-theme="dark"] .navbar-brand,
[data-bs-theme="dark"] .nav-link {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .navbar-brand:hover,
[data-bs-theme="dark"] .nav-link:hover,
[data-bs-theme="dark"] .nav-link.active {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .admin-sidebar {
    background: #1e293b !important;
    border-right: 1px solid #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .admin-sidebar a {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .admin-sidebar a:hover {
    background: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .admin-sidebar a.active {
    background: #334155 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .portal-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .glass-header {
    background: rgba(30, 41, 59, 0.7) !important;
    border-color: rgba(51, 65, 85, 0.8) !important;
}

[data-bs-theme="dark"] .workflow-card {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .er-table-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .er-table-header {
    background: #334155 !important;
    border-bottom: 1px solid #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .er-field:hover {
    background: #334155 !important;
}

[data-bs-theme="dark"] .smart-paste-box {
    background: rgba(109, 40, 217, 0.1) !important;
    color: #c084fc !important;
    border-color: #a855f7 !important;
}

[data-bs-theme="dark"] .portal-toast {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .palette button {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .palette .not_visited {
    background: #334155 !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .custom-select-head {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .custom-select-body {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .custom-select-item {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .custom-select-item:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .custom-select-item.selected {
    background-color: rgba(10, 76, 62, 0.3) !important;
    color: #4ade80 !important;
}

[data-bs-theme="dark"] .nexus-dashboard {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .nexus-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .nexus-card-title {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .nexus-stat-value {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .nexus-btn-outline {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .nexus-btn-outline:hover {
    background: #334155 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .nexus-table th {
    color: #94a3b8 !important;
    border-bottom-color: #334155 !important;
}

[data-bs-theme="dark"] .nexus-table td {
    border-bottom-color: #334155 !important;
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .nexus-table tr:hover td {
    background: #334155 !important;
}

[data-bs-theme="dark"] .nexus-progress {
    background: #334155 !important;
}

[data-bs-theme="dark"] .btn-outline-primary,
[data-bs-theme="dark"] .nexus-btn-outline {
    background-color: transparent !important;
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
    --bs-btn-hover-bg: rgba(59, 130, 246, 0.1) !important;
    --bs-btn-hover-border-color: #3b82f6 !important;
}

[data-bs-theme="dark"] .btn-outline-primary:hover,
[data-bs-theme="dark"] .nexus-btn-outline:hover {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
}

[data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark"] .btn-secondary {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
    --bs-btn-bg: #334155 !important;
    --bs-btn-border-color: #475569 !important;
}

[data-bs-theme="dark"] .btn-light:hover,
[data-bs-theme="dark"] .btn-secondary:hover {
    background-color: #475569 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .table-light {
    --bs-table-bg: #334155 !important;
    --bs-table-color: #f8fafc !important;
}

[data-bs-theme="dark"] .alert[style*="background-color: #e0eaff"] {
    background-color: #1e3a8a !important;
    color: #e0eaff !important;
}

[data-bs-theme="dark"] .alert[style*="background-color: #e6f4ea"] {
    background-color: rgba(19, 115, 51, 0.2) !important;
    color: #a7f3d0 !important;
}

[data-bs-theme="dark"] .alert[style*="background-color: #fef3c7"] {
    background-color: rgba(146, 64, 14, 0.2) !important;
    color: #fde68a !important;
}



/* Dark mode overrides for specific portal components */

/* Subject card background for dark mode */
[data-bs-theme="dark"] .subject-card {
    background: var(--portal-bg) !important;
    color: var(--portal-ink) !important;
}
[data-bs-theme="dark"] .subject-card:hover {
    background: var(--portal-bg) !important;
    border-color: var(--portal-border) !important;
}

/* Subject icon box */
[data-bs-theme="dark"] .subject-icon-box {
    background: var(--portal-primary) !important;
    color: #fff !important;
}

/* Checkout box (secure checkout) */
[data-bs-theme="dark"] .checkout-box,
[data-bs-theme="dark"] .nexus-card.bg-light,
[data-bs-theme="dark"] .bg-light {
    background: #1e293b !important;
    color: var(--portal-ink) !important;
}

/* Distribution circle (attempted) */
[data-bs-theme="dark"] .distribution-circle,
[data-bs-theme="dark"] .distribution-circle * {
    fill: var(--portal-primary) !important;
    stroke: var(--portal-primary) !important;
}

/* My Mock Paper box on Student Hub */
[data-bs-theme="dark"] .mock-paper-box,
[data-bs-theme="dark"] .hub-card {
    background: #1e293b !important;
    color: var(--portal-ink) !important;
}

/* Admin API credentials box */
[data-bs-theme="dark"] .admin-box,
[data-bs-theme="dark"] .api-credentials-box {
    background: #1e293b !important;
    color: var(--portal-ink) !important;
}

/* Admin Premium Workspace box */
[data-bs-theme="dark"] .premium-box,
[data-bs-theme="dark"] .workspace-box {
    background: #1e293b !important;
    color: var(--portal-ink) !important;
}

/* Custom variables for dark mode evaluations */
:root {
    --donut-empty: #e2e8f0;
}
[data-bs-theme="dark"] {
    --donut-empty: #334155;
}

/* Global overrides for inline style white/light backgrounds in dark mode */
[data-bs-theme="dark"] [style*="background-color: #fff"],
[data-bs-theme="dark"] [style*="background-color: #ffffff"],
[data-bs-theme="dark"] [style*="background-color: white"],
[data-bs-theme="dark"] [style*="background: #fff"],
[data-bs-theme="dark"] [style*="background: #ffffff"],
[data-bs-theme="dark"] [style*="background: white"],
[data-bs-theme="dark"] [style*="background-color:#fff"],
[data-bs-theme="dark"] [style*="background-color:#ffffff"],
[data-bs-theme="dark"] [style*="background:#fff"],
[data-bs-theme="dark"] [style*="background:#ffffff"] {
    background-color: #1e293b !important;
    background: #1e293b !important;
    color: #f8fafc !important;
}

[data-bs-theme="dark"] [style*="background-color: #fafafa"],
[data-bs-theme="dark"] [style*="background-color: #f8fafc"],
[data-bs-theme="dark"] [style*="background: #fafafa"],
[data-bs-theme="dark"] [style*="background: #f8fafc"],
[data-bs-theme="dark"] [style*="background-color:#fafafa"],
[data-bs-theme="dark"] [style*="background-color:#f8fafc"],
[data-bs-theme="dark"] [style*="background:#fafafa"],
[data-bs-theme="dark"] [style*="background:#f8fafc"] {
    background-color: #0f172a !important;
    background: #0f172a !important;
}

/* Developer Sandbox alert override in dark mode */
[data-bs-theme="dark"] .alert[style*="background-color: #f0fdf4"],
[data-bs-theme="dark"] .alert[style*="background-color:#f0fdf4"] {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #a7f3d0 !important;
}

/* Sidebar upgrades and widgets inline override */
[data-bs-theme="dark"] .admin-sidebar .bg-light[style*="background-color: #f8fafc"],
[data-bs-theme="dark"] .admin-sidebar div[style*="background-color: #f8fafc"] {
    background-color: #0f172a !important;
}

/* Subject card title in dark mode */
[data-bs-theme="dark"] .subject-card .text-dark {
    color: #f8fafc !important;
}

/* Donut center background override */
[data-bs-theme="dark"] .donut-center {
    background: #1e293b !important;
    color: #f8fafc !important;
}

