:root {
    --rcysc-primary: #0d6efd;
    --rcysc-primary-dark: #006bb7;
    --rcysc-bg-page: #f4f6f8;
    --rcysc-bg-card: #ffffff;
    --rcysc-bg-card-secondary: #f8f9fa;
    --rcysc-bg-card-pinned: #fffdf5;
    --rcysc-border-pinned: #ffeeba;
    --rcysc-modal-backdrop: rgba(0, 0, 0, 0.5);
    --rcysc-dropdown-zindex: 1050;
    --rcysc-overlay-zindex: 1040;
}

/* Modal Backdrops & Containers */
.modal-backdrop-custom {
    background-color: var(--rcysc-modal-backdrop);
}

.container-narrow {
    max-width: 800px;
    width: 100%;
}

.badge-pinned {
    font-size: 0.75rem;
    font-weight: 600;
}

.scrollable-dropdown {
    max-height: 150px;
    overflow-y: auto;
}

/* Responsive Overrides & Mobile Utilities */
@media (max-width: 767.98px) {
    .admin-page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .dashboard-card-header {
        padding: 1rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    /* Added to make the white management cards pop */
    background-color: var(--rcysc-bg-page);
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

/* Validation & Blazor Error States */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Form Styling */
.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ---------------------------------------------------
   Dashboard Layout & Widgets (Home Page)
--------------------------------------------------- */
.dashboard-layout {
    background-color: #f8f9fa;
    min-height: 100vh;
    padding: 1.5rem;
}

.dashboard-card {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-card-header {
    background-color: #ffffff;
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.dashboard-card-body {
    padding: 1.5rem;
    flex: 1 1 auto;
}

.dashboard-menu-btn {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    color: #6c757d;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: all 0.2s ease-in-out;
}

    .dashboard-menu-btn:hover {
        background-color: #e9ecef;
        color: #495057;
    }

.dashboard-dropdown-menu {
    background-color: #ffffff;
    z-index: 1050;
    min-width: 220px;
    border: 1px solid #dee2e6;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    padding: 0;
    overflow: hidden;
}

.dashboard-dropdown-header {
    background-color: #f8f9fa;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
}

.dashboard-dropdown-item {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    color: #212529;
    background-color: transparent;
    border: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s ease;
}

    .dashboard-dropdown-item:hover {
        background-color: #f8f9fa;
    }

/* ---------------------------------------------------
   Admin & Management Pages
--------------------------------------------------- */
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.admin-page-title {
    font-weight: 700;
    margin-bottom: 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.count-badge {
    background-color: #e9ecef;
    color: #495057;
    font-weight: 600;
    border-radius: 12px;
    padding: 0.25em 0.6em;
}

.roster-chip {
    background-color: #6c757d;
    color: #ffffff;
    font-size: 0.8rem;
    padding: 0.3em 0.6em;
}

/* Management Cards & Containers */
.management-card {
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border-radius: 0.5rem;
    background-color: #ffffff;
}

.management-card-header {
    background-color: #ffffff;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-title-text {
    margin-bottom: 0;
    font-weight: 700;
}

.badge-meta {
    background-color: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Management Tables */
.management-table {
    width: 100%;
    vertical-align: middle;
    margin-bottom: 0;
}

.table-toolbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
}

/* Nested Team/Roster Expansion */
.roster-expansion-row {
    background-color: #f8f9fa;
}

.roster-nested-card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
    padding: 0.5rem;
    margin: 0.5rem 0;
}

.empty-state-text {
    color: #6c757d;
    font-size: 0.875rem;
    font-style: italic;
    margin-bottom: 0;
}

.empty-roster-state {
    background-color: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 0.375rem;
    padding: 1.5rem;
    text-align: center;
    color: #6c757d;
    margin: 0.5rem;
}

.empty-roster-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: #adb5bd;
}

.division-gradient-header {
    /* Set a fallback color just in case the data is missing */
    --division-color: #f8f9fa;
    /* The gradient stops at 40% white, then fades to the division color */
    background: linear-gradient(to right, #ffffff 0%, #ffffff 40%, var(--division-color) 100%);
    /* Ensuring standard header spacing and alignment */
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.roster-progress-badge {
    position: relative;
    padding: 0.4rem 0.75rem;
    color: #212529; /* Dark text for contrast against the colors */
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    overflow: hidden;
    /* The hard-stop gradient creates the progress bar visual */
    background: linear-gradient( to right, hsl(var(--progress-hue), 80%, 65%) 0%, hsl(var(--progress-hue), 80%, 65%) var(--fill-percent), #e9ecef var(--fill-percent), #e9ecef 100% );
    /* Optional: A subtle text shadow ensures the numbers remain readable 
       regardless of the background color shifting behind it */
    text-shadow: 0px 0px 3px rgba(255, 255, 255, 0.9);
}

/* Makes the unassigned row look grabbable */
.draggable-player-row {
    cursor: grab;
}

    .draggable-player-row:active {
        cursor: grabbing;
    }

/* Highlights the team row when dragging a player over it */
.drag-hover-active {
    background-color: rgba(40, 167, 69, 0.1) !important; /* Soft green highlight */
    border: 2px dashed #28a745;
}

.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: transparent; /* Remains completely invisible */
    z-index: 1040; /* Sit just below the Bootstrap dropdown menu (1050) */
    cursor: default;
}

.dropdown-menu-inward {
    position: absolute;
    right: 0;
    left: auto;
    z-index: 1050;
    margin-top: 0.25rem;
}

.fc-content-wrapper div {
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================
   Global RCYSC Radzen DataGrid Theme
   ========================================= */

/* Bold Header Styling */
.rcysc-grid .rz-grid-table thead th,
.rcysc-grid .rz-grid-table thead th > div,
.rcysc-grid .rz-grid-table thead th .rz-column-title {
    background-color: #0d6efd !important; /* Bootstrap Primary Blue */
    color: #ffffff !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border-bottom: none !important;
}


    /* Ensure header text doesn't inherit default Radzen link colors */
    .rcysc-grid .rz-grid-table thead th .rz-column-title {
        color: #ffffff !important;
    }

/* Distinct Paginator Footer */
.rcysc-grid .rz-paginator {
    background-color: #e9ecef !important; /* Slightly darker gray to pop against white */
    border-top: 3px solid #343a40 !important; /* Anchors the footer to match the header */
    padding: 0.75rem 1rem;
}

/* Add a subtle hover effect to make rows feel interactive */
.rcysc-grid .rz-grid-table tbody tr:hover {
    background-color: #f1f3f5 !important;
}

.rcysc-grid .rz-grid-table tbody tr.conflict-row > td {
    background-color: #f8d7da !important;
}

/* Flag conflicting rows background and top/bottom borders */
.rcysc-grid .rz-grid-table tbody tr.conflict-row > td {
    background-color: #f8d7da !important;
    border-top: 2px solid #dc3545 !important;
    border-bottom: 2px solid #dc3545 !important;
}

    /* Add the left border to cap the first cell */
    .rcysc-grid .rz-grid-table tbody tr.conflict-row > td:first-child {
        border-left: 2px solid #dc3545 !important;
    }

    /* Add the right border to cap the last cell */
    .rcysc-grid .rz-grid-table tbody tr.conflict-row > td:last-child {
        border-right: 2px solid #dc3545 !important;
    }

.rcysc-grid .rz-grid-table tbody tr.conflict-row + tr.conflict-row > td {
    border-top: none !important;
}

/* Fixed Height Modals & Radzen Tab Panels to Prevent Tab Height Shifts System-Wide */
.modal-body {
    display: flex;
    flex-direction: column;
}

.modal-body .rz-tabview {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.modal-body .rz-tabview-panels {
    min-height: 360px;
    flex: 1;
}

/* System-Wide RadzenSteps Button Styling */
.rz-steps-buttons {
    margin-top: 1.5rem !important;
    padding-top: 1rem !important;
    border-top: 1px solid #e9ecef !important;
    display: flex !important;
    justify-content: space-between !important;
}

.rz-steps-buttons .rz-button {
    padding: 0.5rem 1.25rem !important;
    font-weight: 600 !important;
    border-radius: 0.375rem !important;
}

.rz-steps-buttons .rz-button:not(.rz-button-light):not(.rz-secondary):not([disabled]) {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
}

.rz-steps-buttons .rz-button:not(.rz-button-light):not(.rz-secondary):not([disabled]):hover {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
}

.rz-steps-buttons .rz-button-light,
.rz-steps-buttons .rz-button-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #ffffff !important;
}

.rz-steps-buttons .rz-button-light:hover,
.rz-steps-buttons .rz-button-secondary:hover {
    background-color: #5c636a !important;
    border-color: #565e64 !important;
}

/* ==========================================================================
   Dark Theme System & Overrides
   ========================================================================== */
[data-bs-theme="dark"] {
    --rcysc-bg-page: #0f1115;
    --rcysc-bg-card: #1a1d24;
    --rcysc-bg-card-secondary: #22262f;
    --rcysc-bg-card-pinned: #191c22;
    --rcysc-border-pinned: #2d333b;
    --rcysc-modal-backdrop: rgba(0, 0, 0, 0.75);
}

[data-bs-theme="dark"] body {
    background-color: var(--rcysc-bg-page) !important;
    color: #dee2e6;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #1a1d24 !important;
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #22262f !important;
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .text-dark:not(.badge):not(.alert-warning) {
    color: #e9ecef !important;
}

/* Neutral, Light, and Secondary Badges in Dark Mode */
[data-bs-theme="dark"] .badge.bg-light,
[data-bs-theme="dark"] .badge.bg-body-secondary,
[data-bs-theme="dark"] .badge.bg-secondary-subtle,
[data-bs-theme="dark"] .badge.bg-dark-subtle {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
}

[data-bs-theme="dark"] .badge.bg-light.text-dark,
[data-bs-theme="dark"] .badge.bg-light.text-secondary,
[data-bs-theme="dark"] .badge.bg-light.text-muted,
[data-bs-theme="dark"] .badge.bg-secondary-subtle.text-secondary,
[data-bs-theme="dark"] .badge.bg-secondary-subtle.text-muted {
    color: #cbd5e1 !important;
}

/* Ensure bright badges maintain high contrast dark text */
.sidebar-badge {
    color: #111827 !important;
    font-weight: 700 !important;
}

.sidebar-badge.bg-danger {
    color: #ffffff !important;
}

.sidebar-badge-icon {
    font-size: 0.85em;
    vertical-align: -0.05em;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

[data-bs-theme="dark"] .badge.bg-warning,
[data-bs-theme="dark"] .badge.bg-info,
[data-bs-theme="dark"] .sidebar-badge {
    color: #111827 !important;
}

[data-bs-theme="dark"] .sidebar-badge.bg-danger {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .border-end,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border {
    border-color: #2b303b !important;
}

[data-bs-theme="dark"] .card {
    background-color: #1a1d24 !important;
    border-color: #2b303b !important;
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer {
    background-color: #1a1d24 !important;
    border-color: #2b303b !important;
}

/* Bootstrap Tables & Headers System-Wide */
[data-bs-theme="dark"] .table {
    --bs-table-color: #dee2e6;
    --bs-table-bg: #1a1d24;
    --bs-table-border-color: #2b303b;
    --bs-table-hover-bg: #22262f;
    --bs-table-hover-color: #ffffff;
    --bs-table-striped-bg: #1e222a;
    --bs-table-striped-color: #dee2e6;
}

[data-bs-theme="dark"] .table-light,
[data-bs-theme="dark"] thead.table-light,
[data-bs-theme="dark"] tfoot.table-light,
[data-bs-theme="dark"] tr.table-light,
[data-bs-theme="dark"] th.table-light,
[data-bs-theme="dark"] td.table-light,
[data-bs-theme="dark"] thead.bg-light,
[data-bs-theme="dark"] thead {
    --bs-table-bg: #22262f !important;
    --bs-table-color: #f8f9fa !important;
    --bs-table-border-color: #2b303b !important;
    background-color: #22262f !important;
    color: #f8f9fa !important;
    border-color: #2b303b !important;
}

[data-bs-theme="dark"] .table-hover tbody tr:hover,
[data-bs-theme="dark"] .table-hover tbody tr:hover td,
[data-bs-theme="dark"] .table-hover tbody tr:hover th {
    background-color: #22262f !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .table .text-muted,
[data-bs-theme="dark"] .table .text-secondary {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #16181e !important;
    border-color: #2b303b !important;
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #1a1d24 !important;
    color: #fff !important;
    border-color: #0d6efd !important;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #22262f !important;
    border-color: #2b303b !important;
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .btn-light {
    background-color: #22262f !important;
    border-color: #343a46 !important;
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .btn-light:hover {
    background-color: #2d333f !important;
    border-color: #424a59 !important;
    color: #ffffff !important;
}

/* Modals & Dropdowns System-Wide */
[data-bs-theme="dark"] .modal-content {
    background-color: #1a1d24 !important;
    border-color: #2b303b !important;
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-body,
[data-bs-theme="dark"] .modal-footer {
    border-color: #2b303b !important;
}

[data-bs-theme="dark"] .modal-header.bg-white,
[data-bs-theme="dark"] .modal-body.bg-white,
[data-bs-theme="dark"] .modal-footer.bg-white {
    background-color: #1a1d24 !important;
}

[data-bs-theme="dark"] .dropdown-menu {
    background-color: #1a1d24 !important;
    border-color: #2b303b !important;
    color: #dee2e6 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: #22262f !important;
    color: #ffffff !important;
}

/* Management & Player Management Cards (Image 2) */
[data-bs-theme="dark"] .management-card,
[data-bs-theme="dark"] .management-card-header,
[data-bs-theme="dark"] .roster-nested-card {
    background-color: #1a1d24 !important;
    border-color: #2b303b !important;
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .table-toolbar,
[data-bs-theme="dark"] .roster-expansion-row {
    background-color: #1f232b !important;
    border-color: #2b303b !important;
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .division-gradient-header {
    background: linear-gradient(to right, #1a1d24 0%, #1a1d24 40%, var(--division-color) 100%) !important;
    border-bottom-color: #2b303b !important;
}

[data-bs-theme="dark"] .badge-meta {
    background-color: #22262f !important;
    color: #dee2e6 !important;
    border-color: #343a46 !important;
}

[data-bs-theme="dark"] .count-badge {
    background-color: #22262f !important;
    color: #dee2e6 !important;
}

/* Dashboard Layout & Menu Buttons */
[data-bs-theme="dark"] .dashboard-layout {
    background-color: var(--rcysc-bg-page) !important;
}

[data-bs-theme="dark"] .dashboard-menu-btn {
    background-color: #22262f !important;
    border-color: #343a46 !important;
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .dashboard-dropdown-menu {
    background-color: #1a1d24 !important;
    border-color: #2b303b !important;
}

[data-bs-theme="dark"] .dashboard-dropdown-header {
    background-color: #22262f !important;
    color: #9aa2b1 !important;
    border-bottom-color: #2b303b !important;
}

[data-bs-theme="dark"] .dashboard-dropdown-item {
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .dashboard-dropdown-item:hover {
    background-color: #22262f !important;
    color: #ffffff !important;
}

/* Radzen Dark Mode Overrides (Image 1, Image 5, and Dialogs) */
[data-bs-theme="dark"] .rz-card {
    background-color: #1a1d24 !important;
    color: #dee2e6 !important;
    border-color: #2b303b !important;
}

[data-bs-theme="dark"] .rz-data-grid,
[data-bs-theme="dark"] .rz-grid-table,
[data-bs-theme="dark"] .rz-panel,
[data-bs-theme="dark"] .rz-data-grid-data {
    background-color: #1a1d24 !important;
    color: #e9ecef !important;
    border-color: #2b303b !important;
}

[data-bs-theme="dark"] .rz-grid-table thead th,
[data-bs-theme="dark"] .rz-grid-table thead th > div,
[data-bs-theme="dark"] .rz-grid-table thead th .rz-column-title {
    background-color: #22262f !important;
    color: #f8f9fa !important;
    border-color: #2b303b !important;
}

[data-bs-theme="dark"] .rz-grid-table tbody tr,
[data-bs-theme="dark"] .rz-grid-table tbody td,
[data-bs-theme="dark"] .rz-data-row,
[data-bs-theme="dark"] .rz-cell-data {
    background-color: #1a1d24 !important;
    color: #dee2e6 !important;
    border-color: #2b303b !important;
}

[data-bs-theme="dark"] .rz-grid-table tbody tr:hover,
[data-bs-theme="dark"] .rz-grid-table tbody tr:hover td,
[data-bs-theme="dark"] .rz-grid-table tbody tr:hover .rz-cell-data {
    background-color: #22262f !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .rz-paginator,
[data-bs-theme="dark"] .rcysc-grid .rz-paginator {
    background-color: #1a1d24 !important;
    border-top: 2px solid #2b303b !important;
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .rcysc-grid .rz-grid-table tbody tr:hover,
[data-bs-theme="dark"] .rcysc-grid .rz-grid-table tbody tr:hover td {
    background-color: #22262f !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .rz-paginator-element,
[data-bs-theme="dark"] .rz-paginator-summary {
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .rz-paginator-page.rz-state-active {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .rz-dropdown {
    background-color: #16181e !important;
    border-color: #2b303b !important;
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .rz-dropdown-label {
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .rz-dropdown-items-wrapper,
[data-bs-theme="dark"] .rz-dropdown-panel {
    background-color: #1a1d24 !important;
    border-color: #2b303b !important;
    color: #e9ecef !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] .rz-dropdown-item {
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .rz-dropdown-item:hover,
[data-bs-theme="dark"] .rz-dropdown-item.rz-state-highlight {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .rz-switch {
    background-color: #343a46 !important;
}

[data-bs-theme="dark"] .rz-switch.rz-switch-checked {
    background-color: #0d6efd !important;
}

[data-bs-theme="dark"] .rz-textbox,
[data-bs-theme="dark"] .rz-textarea,
[data-bs-theme="dark"] .rz-numeric-input {
    background-color: #16181e !important;
    border-color: #2b303b !important;
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .rz-dialog,
[data-bs-theme="dark"] .rz-dialog-content {
    background-color: #1a1d24 !important;
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .rz-dialog-title {
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .rz-tabview,
[data-bs-theme="dark"] .rz-tabview-nav,
[data-bs-theme="dark"] .rz-tabview-panels {
    background-color: #1a1d24 !important;
    border-color: #2b303b !important;
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .rz-tabview-title {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .rz-tabview-selected .rz-tabview-title {
    color: #0d6efd !important;
}

/* ==========================================================================
   FullCalendar & Schedule Dark Theme Overrides
   ========================================================================== */
.calendar-container-wrapper {
    background-color: #ffffff;
    border-radius: 0.5rem;
    overflow: hidden;
}

[data-bs-theme="dark"] .calendar-container-wrapper,
[data-bs-theme="dark"] #calendar {
    background-color: #16181e !important;
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .dashboard-card {
    background-color: #1a1d24 !important;
    border-color: #2b303b !important;
}

[data-bs-theme="dark"] .dashboard-card-header {
    background-color: #1a1d24 !important;
    border-color: #2b303b !important;
}

[data-bs-theme="dark"] .division-gradient-header {
    background: linear-gradient(to right, #1a1d24 0%, #1a1d24 40%, color-mix(in srgb, var(--division-color, #1a1d24) 30%, #1a1d24) 100%) !important;
    border-bottom: 1px solid #2b303b !important;
}

[data-bs-theme="dark"] .dashboard-card-body {
    background-color: #1a1d24 !important;
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .empty-roster-state {
    background-color: var(--rcysc-bg-card, #1a1d24) !important;
    border: 1px dashed #2b303b !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .empty-state-text {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .empty-roster-icon {
    color: #64748b !important;
}

/* FullCalendar Variables & Containers */
[data-bs-theme="dark"] .fc {
    --fc-page-bg-color: #16181e;
    --fc-neutral-bg-color: #1f232b;
    --fc-neutral-text-color: #9aa2b1;
    --fc-border-color: #2b303b;
    --fc-today-bg-color: rgba(13, 110, 253, 0.12);
    --fc-highlight-color: rgba(13, 110, 253, 0.2);
    --fc-non-business-color: #121418;
}

/* FullCalendar Grid & Cell Borders */
[data-bs-theme="dark"] .fc-theme-standard th,
[data-bs-theme="dark"] .fc-theme-standard td,
[data-bs-theme="dark"] .fc-theme-standard .fc-scrollgrid {
    border-color: #2b303b !important;
}

/* Column Header (Sun, Mon, Tue...) */
[data-bs-theme="dark"] .fc-col-header-cell {
    background-color: #1f232b !important;
    padding: 6px 0 !important;
}

[data-bs-theme="dark"] .fc-col-header-cell-cushion {
    color: #6ea8fe !important;
    font-weight: 600;
    text-decoration: none !important;
}

/* Day Grid Cells */
[data-bs-theme="dark"] .fc-daygrid-day {
    background-color: #16181e !important;
}

[data-bs-theme="dark"] .fc-daygrid-day.fc-day-other {
    background-color: #121418 !important;
}

[data-bs-theme="dark"] .fc-daygrid-day.fc-day-today {
    background-color: rgba(13, 110, 253, 0.12) !important;
}

/* Day Number Links */
[data-bs-theme="dark"] .fc-daygrid-day-number {
    color: #adb5bd !important;
    font-weight: 600;
    text-decoration: none !important;
    padding: 4px 8px !important;
}

[data-bs-theme="dark"] .fc-daygrid-day.fc-day-other .fc-daygrid-day-number {
    color: #4b5563 !important;
}

[data-bs-theme="dark"] .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
    color: #6ea8fe !important;
    font-weight: 700;
}

/* Month Title ("September 2026") */
[data-bs-theme="dark"] .fc-toolbar-title {
    color: #f8f9fa !important;
    font-weight: 700;
}

/* FullCalendar Toolbar Buttons (<, >, Today) */
[data-bs-theme="dark"] .fc .fc-button-primary {
    background-color: #22262f !important;
    border-color: #343a46 !important;
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .fc .fc-button-primary:hover {
    background-color: #2d333f !important;
    border-color: #424a59 !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .fc .fc-button-primary:disabled {
    background-color: #1a1d24 !important;
    border-color: #282d37 !important;
    color: #6c757d !important;
}

[data-bs-theme="dark"] .fc .fc-button-primary:not(:disabled).fc-button-active,
[data-bs-theme="dark"] .fc .fc-button-primary:not(:disabled):active {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #fff !important;
}

/* TimeGrid View (Week & Day) */
[data-bs-theme="dark"] .fc-timegrid-slot,
[data-bs-theme="dark"] .fc-timegrid-slot-lane {
    background-color: #16181e !important;
    border-color: #262a33 !important;
}

[data-bs-theme="dark"] .fc-timegrid-slot-label-cushion,
[data-bs-theme="dark"] .fc-timegrid-axis-cushion {
    color: #9aa2b1 !important;
}

[data-bs-theme="dark"] .fc-timegrid-col {
    background-color: #16181e !important;
    border-color: #2b303b !important;
}

[data-bs-theme="dark"] .fc-timegrid-col.fc-day-today {
    background-color: rgba(13, 110, 253, 0.08) !important;
}

[data-bs-theme="dark"] .fc-timegrid-now-indicator-line {
    border-color: #ea868f !important;
}

/* Popover & More Links */
[data-bs-theme="dark"] .fc-popover {
    background-color: #1f232b !important;
    border-color: #343a46 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

[data-bs-theme="dark"] .fc-popover-header {
    background-color: #282d37 !important;
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .fc-popover-close {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .fc-more-link {
    color: #6ea8fe !important;
}

/* Legend & Filter Badges */
[data-bs-theme="dark"] .badge.bg-white {
    background-color: #22262f !important;
    color: #e9ecef !important;
    border-color: #343a46 !important;
}

/* ==========================================================================
   Sidebar Navigation Architecture (Expanded & Collapsed Rail)
   ========================================================================== */
.sidebar-wrapper {
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: var(--bs-body-bg);
}

.sidebar-wrapper.sidebar-expanded {
    width: 260px;
    min-width: 260px;
}

.sidebar-wrapper.sidebar-collapsed {
    width: 68px;
    min-width: 68px;
}

/* Sidebar Nav Items */
.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    position: relative;
}

.sidebar-nav-link:hover {
    background-color: rgba(var(--bs-emphasis-color-rgb), 0.06);
    color: var(--bs-emphasis-color);
}

.sidebar-nav-link.active {
    background-color: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--bs-primary);
    font-weight: 600;
}

[data-bs-theme="dark"] .sidebar-nav-link.active {
    background-color: rgba(var(--bs-primary-rgb), 0.2);
    color: #6ea8fe;
}

/* Monochrome Sidebar Icons */
.sidebar-icon {
    font-size: 1.15rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--bs-secondary-color);
    transition: color 0.15s ease;
}

.sidebar-nav-link:hover .sidebar-icon,
.sidebar-nav-link.active .sidebar-icon {
    color: var(--bs-emphasis-color);
}

/* Collapsed Rail Specifics */
.sidebar-collapsed .sidebar-nav-link {
    justify-content: center;
    padding: 0.6rem 0;
    width: 44px;
    margin: 0 auto 0.25rem auto;
}

.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-chevron,
.sidebar-collapsed .sidebar-group-header span {
    display: none !important;
}

.sidebar-collapsed .sidebar-group-header {
    justify-content: center;
    padding: 0.4rem 0;
    border-top: 1px solid var(--bs-border-color);
    margin-top: 0.5rem;
}

.sidebar-collapsed .sidebar-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.6rem;
    padding: 0.15em 0.35em;
}

/* Group Headers */
.sidebar-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.5rem;
    margin-top: 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    cursor: pointer;
    user-select: none;
    border-radius: 0.25rem;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.sidebar-group-header:hover {
    color: var(--bs-emphasis-color);
    background-color: rgba(var(--bs-emphasis-color-rgb), 0.03);
}

.sidebar-chevron {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.sidebar-chevron.collapsed-chevron {
    transform: rotate(-90deg);
}

/* Tooltip floating label in collapsed rail mode */
.sidebar-collapsed .sidebar-nav-link::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    background: #212529;
    color: #fff;
    padding: 0.25rem 0.55rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 1060;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

[data-bs-theme="dark"] .sidebar-collapsed .sidebar-nav-link::after {
    background: #343a40;
    border: 1px solid #495057;
}

.sidebar-collapsed .sidebar-nav-link:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(2px);
}

/* ==========================================================================
   Dark Theme Enhancements for Feed & Lineup Cards
   ========================================================================== */
[data-bs-theme="dark"] .dashboard-card {
    background-color: var(--bs-card-bg, #1a1e24) !important;
    border-color: var(--bs-border-color, #2d3748) !important;
}

[data-bs-theme="dark"] .dashboard-card-header h5,
[data-bs-theme="dark"] .dashboard-card-body h5,
[data-bs-theme="dark"] .dashboard-card .text-dark {
    color: var(--bs-emphasis-color, #f1f5f9) !important;
}

[data-bs-theme="dark"] .dashboard-card .badge.bg-light,
[data-bs-theme="dark"] .dashboard-card .badge.bg-body-secondary {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

[data-bs-theme="dark"] .dashboard-card .card-footer {
    background-color: transparent !important;
    border-color: var(--bs-border-color, #2d3748) !important;
}

/* Match Lineup Feed Card Dark Mode (Applies to all past and future posts) */
[data-bs-theme="dark"] .lineup-feed-card div[style*="background: #e8f5e9"],
[data-bs-theme="dark"] .lineup-feed-card div[style*="background:#e8f5e9"],
[data-bs-theme="dark"] .dashboard-card div[style*="background: #e8f5e9"],
[data-bs-theme="dark"] .dashboard-card div[style*="background:#e8f5e9"] {
    background: rgba(16, 185, 129, 0.16) !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

[data-bs-theme="dark"] .lineup-feed-card div[style*="background: #e8f5e9"] .text-dark,
[data-bs-theme="dark"] .lineup-feed-card div[style*="background:#e8f5e9"] .text-dark,
[data-bs-theme="dark"] .dashboard-card div[style*="background: #e8f5e9"] .text-dark,
[data-bs-theme="dark"] .dashboard-card div[style*="background:#e8f5e9"] .text-dark {
    color: #a7f3d0 !important;
}

[data-bs-theme="dark"] .lineup-feed-card .badge.bg-dark-subtle {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

[data-bs-theme="dark"] .lineup-feed-card .card[style*="background: #ffffff"],
[data-bs-theme="dark"] .lineup-feed-card .card[style*="background:#ffffff"] {
    background: #202630 !important;
    border: 1px solid #334155 !important;
}

[data-bs-theme="dark"] .lineup-feed-card .card .text-dark {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .lineup-feed-card .bg-light {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-bs-theme="dark"] .lineup-feed-card div[style*="background: #fffbeb"],
[data-bs-theme="dark"] .lineup-feed-card div[style*="background:#fffbeb"] {
    background: rgba(245, 158, 11, 0.15) !important;
    border-left: 3px solid #f59e0b !important;
}

[data-bs-theme="dark"] .lineup-feed-card div[style*="background: #fffbeb"] .text-dark {
    color: #fef3c7 !important;
}

/* Tournament Feed Card Dark Mode (Applies to all past and future posts) */
[data-bs-theme="dark"] .tournament-feed-card div[style*="background: #eff6ff"],
[data-bs-theme="dark"] .tournament-feed-card div[style*="background:#eff6ff"],
[data-bs-theme="dark"] .dashboard-card div[style*="background: #eff6ff"],
[data-bs-theme="dark"] .dashboard-card div[style*="background:#eff6ff"] {
    background: rgba(13, 110, 253, 0.18) !important;
    border: 1px solid rgba(13, 110, 253, 0.4) !important;
}

[data-bs-theme="dark"] .tournament-feed-card div[style*="background: #eff6ff"] .text-dark,
[data-bs-theme="dark"] .tournament-feed-card div[style*="background:#eff6ff"] .text-dark,
[data-bs-theme="dark"] .dashboard-card div[style*="background: #eff6ff"] .text-dark,
[data-bs-theme="dark"] .dashboard-card div[style*="background:#eff6ff"] .text-dark {
    color: #93c5fd !important;
}

[data-bs-theme="dark"] .tournament-feed-card .badge.bg-dark-subtle,
[data-bs-theme="dark"] .dashboard-card .badge.bg-dark-subtle {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

[data-bs-theme="dark"] .tournament-feed-card .card[style*="background: #ffffff"],
[data-bs-theme="dark"] .tournament-feed-card .card[style*="background:#ffffff"] {
    background: #202630 !important;
    border: 1px solid #334155 !important;
}

[data-bs-theme="dark"] .tournament-feed-card .card .text-dark {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .tournament-feed-card .bg-light {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-bs-theme="dark"] .tournament-feed-card .table-light {
    background-color: #242b38 !important;
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .tournament-feed-card .table {
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .tournament-feed-card .table td,
[data-bs-theme="dark"] .tournament-feed-card .table th {
    border-color: #334155 !important;
}

/* Board Directory Dark Mode Refinements */
[data-bs-theme="dark"] .board-directory-email-link {
    color: #60a5fa !important;
}

/* Toast Notification Stacking & Visibility Overrides */
.blazored-toast-container {
    z-index: 11000 !important;
    pointer-events: none;
}

.blazored-toast-container > * {
    pointer-events: auto;
}

.blazored-toast-container.position-topcenter {
    top: 1.5rem !important;
}

.blazored-toast {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.25) !important;
}

/* ==========================================================================
   RCYSC Interactive Onboarding Tour & Spotlight Styles
   ========================================================================== */
.rcysc-tour-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.65);
    z-index: 1050;
    pointer-events: auto;
    transition: opacity 0.25s ease-in-out;
}

.rcysc-spotlight-active {
    position: relative !important;
    z-index: 1055 !important;
    box-shadow: 0 0 0 4px #0d6efd, 0 10px 30px rgba(13, 110, 253, 0.45) !important;
    border-radius: 8px !important;
    transition: box-shadow 0.25s ease;
}

#rcysc-tour-popover {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1060;
    width: 360px;
    max-width: calc(100vw - 32px);
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    transition: top 0.2s cubic-bezier(0.4, 0, 0.2, 1), left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-bs-theme="dark"] #rcysc-tour-popover {
    background-color: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

/* Popover Arrow Pointers */
.popover-arrow-left::before {
    content: '';
    position: absolute;
    top: 24px;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #ffffff;
}
[data-bs-theme="dark"] .popover-arrow-left::before {
    border-right-color: #1e293b;
}

.popover-arrow-right::before {
    content: '';
    position: absolute;
    top: 24px;
    right: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #ffffff;
}
[data-bs-theme="dark"] .popover-arrow-right::before {
    border-left-color: #1e293b;
}

.popover-arrow-top::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 28px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ffffff;
}
[data-bs-theme="dark"] .popover-arrow-top::before {
    border-bottom-color: #1e293b;
}

.popover-arrow-bottom::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 28px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffffff;
}
[data-bs-theme="dark"] .popover-arrow-bottom::before {
    border-top-color: #1e293b;
}

/* Floating Page Guide Launcher Button */
.rcysc-tour-floating-btn {
    position: fixed;
    bottom: 72px;
    right: 24px;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: #0d6efd;
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.rcysc-tour-floating-btn:hover {
    background-color: #0b5ed7;
    transform: translateY(-2px);
    color: #ffffff;
}

/* ==========================================================================
   Board Phone Duty - Weekly Rotation Schedule (Light & Dark Theme)
   ========================================================================== */

.duty-schedule-table .current-week-row {
    background-color: rgba(13, 110, 253, 0.07) !important;
    border-left: 4px solid var(--rcysc-primary, #0d6efd) !important;
}

.duty-schedule-table .current-week-row > td {
    background-color: transparent !important;
}

[data-bs-theme="dark"] .duty-schedule-table .current-week-row {
    background-color: rgba(13, 110, 253, 0.18) !important;
    border-left: 4px solid #3b82f6 !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .duty-schedule-table .current-week-row .week-range-text,
[data-bs-theme="dark"] .duty-schedule-table .current-week-row td {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .duty-schedule-table .current-week-row .text-muted,
[data-bs-theme="dark"] .duty-schedule-table .current-week-row .text-body-secondary {
    color: #94a3b8 !important;
}

[data-bs-theme="dark"] .duty-schedule-table thead.table-light th {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: #cbd5e1 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ==========================================================================
   League Standings - My Team Highlighting (Light & Dark Theme)
   ========================================================================== */
.standings-my-team-row {
    background-color: rgba(13, 110, 253, 0.08) !important;
}

.standings-my-team-row > td {
    background-color: transparent !important;
}

[data-bs-theme="dark"] .standings-my-team-row {
    background-color: rgba(13, 110, 253, 0.16) !important;
    border-color: #3b82f6 !important;
}

[data-bs-theme="dark"] .standings-my-team-row > td {
    background-color: transparent !important;
    color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .standings-my-team-row .text-dark,
[data-bs-theme="dark"] .standings-my-team-row .text-body {
    color: #f1f5f9 !important;
}

[data-bs-theme="dark"] table thead.table-light th {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #94a3b8 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ==========================================================================
   Mobile Responsive Navigation & Layout Rules
   ========================================================================== */
.league-context-switcher-dropdown {
    width: 200px;
    max-width: 100%;
}

@media (max-width: 575.98px) {
    .league-context-switcher-dropdown {
        width: 140px !important;
        font-size: 0.8rem !important;
    }
}

@media (max-width: 767.98px) {
    main.col {
        min-width: 0 !important;
    }

    /* On mobile (<768px), sidebar transforms into an offcanvas drawer overlay */
    .sidebar-wrapper {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1055 !important;
        height: 100vh !important;
        width: 280px !important;
        min-width: 280px !important;
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.35) !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        background-color: var(--bs-body-bg) !important;
    }

    .sidebar-wrapper.mobile-open {
        transform: translateX(0) !important;
    }

    /* Mobile backdrop overlay */
    .sidebar-mobile-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(2px);
        z-index: 1050;
        transition: opacity 0.25s ease;
    }

    /* In mobile offcanvas, ensure labels and full navigation are always readable */
    .sidebar-wrapper.sidebar-collapsed {
        width: 280px !important;
        min-width: 280px !important;
    }

    .sidebar-wrapper.sidebar-collapsed .sidebar-label,
    .sidebar-wrapper.sidebar-collapsed .sidebar-chevron,
    .sidebar-wrapper.sidebar-collapsed .sidebar-group-header span {
        display: inline !important;
    }

    .sidebar-wrapper.sidebar-collapsed .sidebar-nav-link {
        justify-content: flex-start !important;
        padding: 0.55rem 0.75rem !important;
        width: auto !important;
        margin: 0 !important;
    }

    .sidebar-wrapper.sidebar-collapsed .sidebar-nav-link::after {
        display: none !important;
    }

    /* Wizard Step Indicator Mobile Polish */
    .wizard-steps-compact {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
    }
}

/* Ensure mobile form inputs don't trigger iOS Safari auto-zoom (min 16px) */
@media (max-width: 768px) {
    input.form-control,
    select.form-select,
    textarea.form-control {
        font-size: 16px !important;
    }
}

/* Dark mode alert styling for late registration notices */
[data-bs-theme="dark"] .late-registration-alert,
[data-bs-theme="dark"] .late-registration-alert *,
[data-bs-theme="dark"] .late-registration-alert i,
[data-bs-theme="dark"] .late-registration-alert span,
[data-bs-theme="dark"] .late-registration-alert strong {
    color: #ffffff !important;
}
