@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('bo-pages.css?v=8');

:root {
    --bo-primary: #316cff;
    --bo-primary-light: #eef4ff;

    --bo-bg: #f7f9fc;
    --bo-surface: #ffffff;
    --bo-surface-soft: #fafbfe;

    --bo-text: #111827;
    --bo-text-soft: #667085;
    --bo-text-muted: #98a2b3;

    --bo-border: #e6eaf0;

    --bo-success: #16a34a;
    --bo-success-bg: #eaf8ef;

    --bo-warning: #f59e0b;
    --bo-warning-bg: #fff6e5;

    --bo-danger: #ef4444;
    --bo-danger-bg: #fff0f0;

    --bo-info: #2563eb;
    --bo-info-bg: #edf4ff;

    --bo-sidebar-width: 228px;
    --bo-topbar-height: 80px;

    --bo-radius-sm: 8px;
    --bo-radius-md: 12px;
    --bo-radius-lg: 16px;

    --bo-shadow:
        0 1px 2px rgba(16, 24, 40, 0.04),
        0 4px 16px rgba(16, 24, 40, 0.04);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bo-bg);
    color: var(--bo-text);
    font-size: 14px;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================
   APP LAYOUT
========================= */

.bo-app {
    min-height: 100vh;
}

.bo-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--bo-sidebar-width);
    background: var(--bo-surface);
    border-right: 1px solid var(--bo-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.bo-main {
    min-height: 100vh;
    margin-left: var(--bo-sidebar-width);
}

.bo-topbar {
    position: sticky;
    top: 0;
    height: var(--bo-topbar-height);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--bo-border);
    backdrop-filter: blur(14px);
    z-index: 900;

    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.bo-content {
    padding: 26px 32px 40px;
}

/* =========================
   SIDEBAR
========================= */

.bo-brand {
    height: var(--bo-topbar-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--bo-border);
}

.bo-brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #316cff, #6f8dff);
    font-weight: 800;
}

.bo-brand-name {
    font-size: 18px;
    font-weight: 700;
}

.bo-nav {
    padding: 18px 14px;
    overflow-y: auto;
}

.bo-nav-section {
    margin: 18px 12px 8px;
    color: var(--bo-text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.bo-nav-link {
    min-height: 46px;
    padding: 0 14px;
    margin-bottom: 4px;
    border-radius: 10px;

    display: flex;
    align-items: center;
    gap: 13px;

    color: #344054;
    font-weight: 500;
    transition: 0.18s ease;
}

.bo-nav-link:hover {
    background: #f6f8fc;
    color: var(--bo-primary);
}

.bo-nav-link.active {
    background: var(--bo-primary-light);
    color: var(--bo-primary);
    font-weight: 600;
}

.bo-nav-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.bo-nav-arrow {
    margin-left: auto;
    color: var(--bo-text-muted);
}

.bo-sidebar-footer {
    margin-top: auto;
    padding: 16px 14px;
    border-top: 1px solid var(--bo-border);
}

/* =========================
   TOPBAR
========================= */

.bo-topbar-left,
.bo-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bo-menu-toggle {
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    border-radius: 9px;
    cursor: pointer;
}

.bo-menu-toggle:hover {
    background: #f3f5f9;
}

.bo-page-title {
    margin: 0;
    font-size: 25px;
    line-height: 1.2;
    font-weight: 700;
}

.bo-icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.bo-icon-button:hover {
    background: #f4f6fa;
}

.bo-admin {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bo-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(135deg, #316cff, #8b7cf6);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 16px;
    font-weight: 700;
}

.bo-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bo-admin-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.bo-admin-name {
    overflow: hidden;
    color: var(--bo-text);
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bo-admin-role {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: var(--bo-text-soft);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =========================
   PAGE HEADER
========================= */

.bo-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.bo-page-header h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.bo-page-description {
    margin: 0;
    color: var(--bo-text-soft);
}

.bo-page-actions {
    display: flex;
    gap: 10px;
}

/* =========================
   GRID
========================= */

.bo-grid {
    display: grid;
    gap: 20px;
}

.bo-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bo-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bo-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* =========================
   KPI CARDS
========================= */

.bo-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.bo-stat-card {
    min-height: 156px;
    padding: 26px 24px;
    background: var(--bo-surface);
    border: 1px solid var(--bo-border);
    border-radius: var(--bo-radius-md);
    box-shadow: var(--bo-shadow);
}

.bo-stat-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bo-stat-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 24px;
    flex: 0 0 58px;
}

.bo-stat-icon.blue {
    background: linear-gradient(135deg, #4677ff, #7294ff);
}

.bo-stat-icon.green {
    background: linear-gradient(135deg, #35b968, #75d994);
}

.bo-stat-icon.purple {
    background: linear-gradient(135deg, #8058df, #b690ff);
}

.bo-stat-icon.orange {
    background: linear-gradient(135deg, #ff9a27, #ffbd5d);
}

.bo-stat-label {
    color: #344054;
    font-size: 14px;
    margin-bottom: 8px;
}

.bo-stat-value {
    font-size: 28px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.bo-stat-change {
    margin-top: 20px;
    color: var(--bo-text-soft);
    font-size: 13px;
}

.bo-stat-change strong {
    color: var(--bo-success);
    font-weight: 600;
}

/* =========================
   CARDS
========================= */

.bo-card {
    background: var(--bo-surface);
    border: 1px solid var(--bo-border);
    border-radius: var(--bo-radius-md);
    box-shadow: var(--bo-shadow);
    overflow: hidden;
}

.bo-card-header {
    min-height: 58px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--bo-border);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.bo-card-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.bo-card-body {
    padding: 20px;
}

.bo-card-link {
    color: var(--bo-primary);
    font-size: 13px;
    font-weight: 500;
}

/* =========================
   BUTTONS
========================= */

.bo-btn {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid var(--bo-border);
    background: #fff;
    color: #344054;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    font-weight: 500;
    cursor: pointer;
    transition: 0.18s ease;
}

.bo-btn:hover {
    border-color: #cbd3df;
    background: #f8fafc;
}

.bo-btn-primary {
    color: #fff;
    background: var(--bo-primary);
    border-color: var(--bo-primary);
}

.bo-btn-primary:hover {
    color: #fff;
    background: #245fe7;
    border-color: #245fe7;
}

.bo-btn-danger {
    color: #fff;
    background: var(--bo-danger);
    border-color: var(--bo-danger);
}

/* =========================
   FORMS
========================= */

.bo-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.bo-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.bo-label {
    font-size: 13px;
    font-weight: 600;
    color: #344054;
}

.bo-input,
.bo-select,
.bo-textarea {
    width: 100%;
    border: 1px solid var(--bo-border);
    border-radius: 8px;
    background: #fff;
    color: var(--bo-text);
    outline: none;
    transition: 0.18s ease;
}

.bo-input,
.bo-select {
    height: 42px;
    padding: 0 13px;
}

.bo-textarea {
    min-height: 120px;
    resize: vertical;
    padding: 12px 13px;
}

.bo-input:focus,
.bo-select:focus,
.bo-textarea:focus {
    border-color: #8babff;
    box-shadow: 0 0 0 3px rgba(49, 108, 255, 0.12);
}

/* =========================
   TABLE
========================= */

.bo-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.bo-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.bo-table th,
.bo-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--bo-border);
    text-align: left;
    vertical-align: middle;
}

.bo-table th {
    color: #475467;
    background: #fbfcfe;
    font-size: 12px;
    font-weight: 600;
}

.bo-table td {
    color: #344054;
    font-size: 13px;
}

.bo-table tbody tr:hover {
    background: #fafcff;
}

.bo-table tbody tr:last-child td {
    border-bottom: 0;
}

/* =========================
   STATUS BADGES
========================= */

.bo-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 9px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
}

.bo-badge-success {
    color: #13833c;
    background: var(--bo-success-bg);
    border: 1px solid #c7ecd3;
}

.bo-badge-warning {
    color: #d97706;
    background: var(--bo-warning-bg);
    border: 1px solid #fde3b4;
}

.bo-badge-danger {
    color: #dc2626;
    background: var(--bo-danger-bg);
    border: 1px solid #fecaca;
}

.bo-badge-info {
    color: #2563eb;
    background: var(--bo-info-bg);
    border: 1px solid #cddcff;
}

/* =========================
   FILTER BAR
========================= */

.bo-filter-bar {
    padding: 16px;
    background: var(--bo-surface);
    border: 1px solid var(--bo-border);
    border-radius: var(--bo-radius-md);
    box-shadow: var(--bo-shadow);
    margin-bottom: 20px;

    display: flex;
    align-items: end;
    gap: 14px;
    flex-wrap: wrap;
}

.bo-filter-item {
    min-width: 180px;
    flex: 1;
}

/* =========================
   MODAL
========================= */

.bo-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bo-modal.open {
    display: flex;
}

.bo-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.bo-modal-dialog {
    position: relative;
    width: min(720px, 100%);
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
    overflow: hidden;
}

.bo-modal-header,
.bo-modal-footer {
    padding: 17px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bo-modal-header {
    border-bottom: 1px solid var(--bo-border);
}

.bo-modal-footer {
    border-top: 1px solid var(--bo-border);
    justify-content: flex-end;
    gap: 10px;
}

.bo-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 170px);
}

/* =========================
   PAGINATION
========================= */

.bo-pagination {
    padding: 16px 18px;
    border-top: 1px solid var(--bo-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bo-pagination-buttons {
    display: flex;
    gap: 6px;
}

.bo-page-button {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--bo-border);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.bo-page-button.active {
    color: #fff;
    background: var(--bo-primary);
    border-color: var(--bo-primary);
}

/* =========================
   SIDEBAR EXTENSIONS
========================= */

.bo-brand-link {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
}

.bo-brand-image {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.bo-nav-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.bo-sidebar-account {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.bo-sidebar-account-info {
    min-width: 0;
}

.bo-sidebar-account-info strong,
.bo-sidebar-account-info span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bo-sidebar-account-info strong {
    color: var(--bo-text);
    font-size: 13px;
    font-weight: 600;
}

.bo-sidebar-account-info span {
    margin-top: 3px;
    color: var(--bo-text-muted);
    font-size: 11px;
}

.bo-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 950;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(2px);
}

.bo-sidebar-overlay[hidden] {
    display: none;
}

.bo-field-error {
    display: block;
    margin-top: 1px;
    color: var(--bo-danger);
    font-size: 12px;
    line-height: 1.45;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1200px) {
    .bo-stats-grid,
    .bo-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bo-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 901px) {
    .bo-sidebar-overlay {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .bo-sidebar {
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }

    .bo-sidebar.open {
        transform: translateX(0);
    }

    .bo-main {
        margin-left: 0;
    }

    .bo-topbar {
        padding: 0 18px;
    }

    .bo-content {
        padding: 20px 18px 32px;
    }

    .bo-admin-info {
        display: none;
    }
}

@media (max-width: 640px) {
    .bo-topbar {
        height: 66px;
    }

    .bo-page-title {
        font-size: 20px;
    }

    .bo-stats-grid,
    .bo-grid-2,
    .bo-grid-3,
    .bo-grid-4,
    .bo-form-grid {
        grid-template-columns: 1fr;
    }

    .bo-stat-card {
        min-height: auto;
    }

    .bo-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .bo-page-actions {
        width: 100%;
    }

    .bo-page-actions .bo-btn {
        flex: 1;
    }
}

/* =========================================================
   LOGIN PAGE
========================================================= */

body.bo-login-page {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(49, 108, 255, 0.12),
            transparent 32%
        ),
        radial-gradient(
            circle at 90% 90%,
            rgba(111, 141, 255, 0.1),
            transparent 34%
        ),
        var(--bo-bg);
}

.bo-login-background {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.bo-login-background::before {
    position: absolute;
    inset: 0;
    content: "";
    background-image:
        linear-gradient(
            rgba(49, 108, 255, 0.025) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(49, 108, 255, 0.025) 1px,
            transparent 1px
        );
    background-size: 42px 42px;
}

.bo-login-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.18;
}

.bo-login-glow-one {
    top: -180px;
    left: -140px;
    width: 430px;
    height: 430px;
    background: var(--bo-primary);
}

.bo-login-glow-two {
    right: -160px;
    bottom: -200px;
    width: 460px;
    height: 460px;
    background: #8b7cf6;
}

.bo-login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
    padding: 32px 20px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.bo-login-card {
    width: 100%;
    max-width: 440px;
    padding: 34px;
    border: 1px solid var(--bo-border);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 24px 70px rgba(16, 24, 40, 0.12),
        0 4px 20px rgba(16, 24, 40, 0.05);
    backdrop-filter: blur(16px);
}

.bo-login-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 32px;
}

.bo-login-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.bo-login-logo img {
    display: block;
    width: auto;
    max-width: 160px;
    height: 42px;
    object-fit: contain;
}

.bo-login-logo-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(
        135deg,
        var(--bo-primary),
        #6f8dff
    );
    box-shadow: 0 10px 22px rgba(49, 108, 255, 0.22);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
}

.bo-login-logo-text {
    color: var(--bo-text);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.bo-login-badge {
    padding: 7px 10px;
    border: 1px solid #d9e4ff;
    border-radius: 999px;
    background: var(--bo-primary-light);
    color: var(--bo-primary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.bo-login-heading {
    margin-bottom: 25px;
}

.bo-login-eyebrow {
    margin: 0 0 8px;
    color: var(--bo-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.bo-login-heading h1 {
    margin: 0 0 9px;
    color: var(--bo-text);
    font-size: clamp(28px, 5vw, 35px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.bo-login-heading p:last-child {
    margin: 0;
    color: var(--bo-text-soft);
    font-size: 14px;
    line-height: 1.6;
}

.bo-login-form {
    display: grid;
    gap: 19px;
}

.bo-login-form .form-group {
    display: grid;
    gap: 8px;
}

.bo-login-form label {
    color: #344054;
    font-size: 13px;
    font-weight: 600;
}

.input-icon-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 1;
    display: flex;
    color: var(--bo-text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.bo-login-form input {
    width: 100%;
    height: 50px;
    padding: 0 48px;
    border: 1px solid var(--bo-border);
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--bo-text);
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.bo-login-form input::placeholder {
    color: var(--bo-text-muted);
}

.bo-login-form input:hover {
    border-color: #d0d6df;
}

.bo-login-form input:focus {
    border-color: #8babff;
    box-shadow: 0 0 0 3px rgba(49, 108, 255, 0.12);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    z-index: 2;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--bo-text-muted);
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    background: #f3f5f9;
    color: var(--bo-text-soft);
}

.bo-login-submit {
    width: 100%;
    min-height: 50px;
    margin-top: 2px;
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(49, 108, 255, 0.2);
}

.bo-login-submit:hover:not(:disabled) {
    box-shadow: 0 16px 28px rgba(49, 108, 255, 0.25);
    transform: translateY(-1px);
}

.bo-login-submit:disabled {
    cursor: wait;
    opacity: 0.72;
}

.button-spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bo-login-spin 0.75s linear infinite;
}

.bo-login-submit.is-loading .button-spinner {
    display: inline-block;
}

.bo-login-security {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-top: 23px;
    color: var(--bo-text-muted);
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

.bo-login-security-icon {
    display: flex;
    flex: 0 0 auto;
    color: var(--bo-primary);
}

.bo-login-footer {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 20px;
    color: var(--bo-text-muted);
    font-size: 12px;
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.5;
    transition:
        opacity 0.22s ease,
        transform 0.22s ease;
}

.alert-success {
    border-color: #c7ecd3;
    background: var(--bo-success-bg);
    color: #13833c;
}

.alert-warning {
    border-color: #fde3b4;
    background: var(--bo-warning-bg);
    color: #d97706;
}

.alert-error,
.alert-danger {
    border-color: #fecaca;
    background: var(--bo-danger-bg);
    color: #dc2626;
}

.alert-info {
    border-color: #cddcff;
    background: var(--bo-info-bg);
    color: var(--bo-info);
}

@keyframes bo-login-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 520px) {
    .bo-login-wrapper {
        padding: 18px 14px;
    }

    .bo-login-card {
        padding: 26px 20px;
        border-radius: 18px;
    }

    .bo-login-brand {
        margin-bottom: 27px;
    }

    .bo-login-badge {
        padding: 6px 8px;
        font-size: 9px;
    }

    .bo-login-footer {
        flex-direction: column;
        gap: 3px;
    }

    .bo-login-footer-separator {
        display: none;
    }
}

/* =========================================================
   GLOBAL JAVASCRIPT COMPONENTS
========================================================= */

body.bo-sidebar-open,
body.bo-modal-open,
body.bo-loading {
    overflow: hidden;
}

.alert.is-hiding {
    opacity: 0;
    transform: translateY(-5px);
}

.bo-loader {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    background: rgba(247, 249, 252, 0.72);
    backdrop-filter: blur(3px);
}

.bo-loader[hidden] {
    display: none;
}

.bo-loader-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #dbe5ff;
    border-top-color: var(--bo-primary);
    border-radius: 50%;
    animation: bo-global-spin 0.75s linear infinite;
}

.bo-toast-container {
    position: fixed;
    top: 96px;
    right: 24px;
    z-index: 5500;
    display: grid;
    width: min(380px, calc(100vw - 32px));
    gap: 10px;
    pointer-events: none;
}

.bo-toast {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 15px;
    border: 1px solid var(--bo-border);
    border-radius: 11px;
    background: var(--bo-surface);
    box-shadow: 0 16px 40px rgba(16, 24, 40, 0.14);
    opacity: 0;
    pointer-events: auto;
    transform: translateX(16px);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease;
}

.bo-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.bo-toast-success {
    border-left: 4px solid var(--bo-success);
}

.bo-toast-error {
    border-left: 4px solid var(--bo-danger);
}

.bo-toast-warning {
    border-left: 4px solid var(--bo-warning);
}

.bo-toast-info {
    border-left: 4px solid var(--bo-info);
}

.bo-toast-message {
    color: var(--bo-text);
    font-size: 13px;
    line-height: 1.5;
}

.bo-toast-close {
    display: grid;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--bo-text-muted);
    font-size: 20px;
    cursor: pointer;
}

.bo-toast-close:hover {
    background: #f3f5f9;
    color: var(--bo-text);
}

.bo-dropdown {
    position: absolute;
    z-index: 1500;
    min-width: 210px;
    padding: 8px;
    border: 1px solid var(--bo-border);
    border-radius: 11px;
    background: var(--bo-surface);
    box-shadow: 0 18px 45px rgba(16, 24, 40, 0.14);
}

.bo-dropdown[hidden] {
    display: none;
}

@keyframes bo-global-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 640px) {
    .bo-toast-container {
        top: 78px;
        right: 16px;
        left: 16px;
        width: auto;
    }
}

/* =========================================================
   DASHBOARD
========================================================= */

.bo-dashboard-section {
    margin-top: 20px;
}

.bo-dashboard-money {
    color: var(--bo-text);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.bo-dashboard-money-positive {
    color: var(--bo-success);
}

.bo-dashboard-money-label {
    margin: 9px 0 0;
    color: var(--bo-text-soft);
    font-size: 13px;
}

.bo-empty-state {
    padding: 24px 10px;
    color: var(--bo-text-muted);
    text-align: center;
}

.bo-sidebar-logout {
    margin-bottom: 0;
    color: var(--bo-danger);
}

.bo-sidebar-logout:hover {
    background: var(--bo-danger-bg);
    color: var(--bo-danger);
}

/* =========================================================
   PLAYERS PAGE
========================================================= */

.bo-player-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.bo-player-summary-card {
    position: relative;
    min-height: 118px;
    padding: 22px 22px 20px;
    overflow: hidden;
    border: 1px solid #e8edf5;
    border-radius: var(--bo-radius-lg);
    background: linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
    box-shadow:
        0 1px 2px rgba(16, 24, 40, 0.03),
        0 8px 24px rgba(16, 24, 40, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bo-player-summary-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: var(--bo-radius-lg) 0 0 var(--bo-radius-lg);
    background: #316cff;
}

.bo-player-summary-card::after {
    content: '';
    position: absolute;
    top: -34px;
    right: -28px;
    width: 98px;
    height: 98px;
    border-radius: 50%;
    background: rgba(49, 108, 255, 0.08);
}

.bo-player-summary-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 2px 4px rgba(16, 24, 40, 0.04),
        0 14px 30px rgba(16, 24, 40, 0.09);
}

.bo-player-summary-card:nth-child(2)::before {
    background: var(--bo-success);
}

.bo-player-summary-card:nth-child(2)::after {
    background: rgba(22, 163, 74, 0.09);
}

.bo-player-summary-card:nth-child(3)::before {
    background: var(--bo-danger);
}

.bo-player-summary-card:nth-child(3)::after {
    background: rgba(239, 68, 68, 0.09);
}

.bo-player-summary-card:nth-child(4)::before {
    background: #8b5cf6;
}

.bo-player-summary-card:nth-child(4)::after {
    background: rgba(139, 92, 246, 0.09);
}

.bo-player-summary-card span {
    position: relative;
    z-index: 1;
    display: block;
    margin-bottom: 14px;
    color: var(--bo-text-soft);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.bo-player-summary-card strong {
    position: relative;
    z-index: 1;
    display: block;
    color: var(--bo-primary);
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.035em;
}

.bo-player-summary-card strong.is-success {
    color: var(--bo-success);
}

.bo-player-summary-card strong.is-danger {
    color: var(--bo-danger);
}

.bo-player-summary-card:nth-child(4) strong {
    color: #7c3aed;
}

.bo-filter-search {
    min-width: 290px;
    flex: 2;
}

.bo-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bo-card-subtitle {
    margin: 5px 0 0;
    color: var(--bo-text-muted);
    font-size: 12px;
}

.bo-page-size-form {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--bo-text-soft);
    font-size: 12px;
}

.bo-page-size-select {
    width: 76px;
    height: 36px;
}

.bo-player-identity {
    display: flex;
    gap: 11px;
    align-items: center;
    min-width: 210px;
}

.bo-player-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 50%;
    background: var(--bo-primary-light);
    color: var(--bo-primary);
    font-weight: 700;
}

.bo-player-identity-text {
    min-width: 0;
}

.bo-player-name {
    display: block;
    overflow: hidden;
    color: var(--bo-text);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bo-player-name:hover {
    color: var(--bo-primary);
}

.bo-player-identity-text span {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--bo-text-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bo-player-contact span,
.bo-player-contact small {
    display: block;
}

.bo-player-contact span {
    color: var(--bo-text);
    font-size: 12px;
}

.bo-player-contact small {
    margin-top: 4px;
    color: var(--bo-text-muted);
    font-size: 11px;
}

.bo-player-balance {
    color: var(--bo-text);
    font-size: 13px;
}

.bo-vip-badge {
    display: inline-flex;
    min-height: 25px;
    padding: 3px 9px;
    align-items: center;
    border: 1px solid color-mix(
        in srgb,
        var(--vip-color) 35%,
        transparent
    );
    border-radius: 999px;
    background: color-mix(
        in srgb,
        var(--vip-color) 12%,
        white
    );
    color: var(--vip-color);
    font-size: 11px;
    font-weight: 600;
}

.bo-text-muted {
    color: var(--bo-text-muted);
}

.bo-table-actions-heading {
    text-align: right !important;
}

.bo-table-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.bo-action-button {
    display: inline-flex;
    min-height: 32px;
    padding: 0 10px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bo-border);
    border-radius: 7px;
    background: #fff;
    color: #475467;
    font-size: 11px;
    font-weight: 600;
}

.bo-action-button:hover {
    border-color: #b9c9f5;
    background: var(--bo-primary-light);
    color: var(--bo-primary);
}

.bo-empty-state strong,
.bo-empty-state span {
    display: block;
}

.bo-empty-state strong {
    color: var(--bo-text);
}

.bo-empty-state span {
    margin-top: 5px;
}

.bo-pagination-summary {
    color: var(--bo-text-soft);
    font-size: 12px;
}

.bo-page-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--bo-text);
    text-decoration: none;
}

@media (max-width: 1100px) {
    .bo-player-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .bo-player-summary {
        grid-template-columns: 1fr;
    }

    .bo-filter-search,
    .bo-filter-item {
        width: 100%;
        min-width: 100%;
    }

    .bo-filter-actions {
        width: 100%;
    }

    .bo-filter-actions .bo-btn {
        flex: 1;
    }

    .bo-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .bo-pagination {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .bo-pagination-buttons {
        max-width: 100%;
        overflow-x: auto;
    }
}

/* =========================================================
   PLAYER DETAILS
========================================================= */

.bo-player-profile-heading {
    display: flex;
    gap: 14px;
    align-items: center;
}

.bo-player-profile-heading h2 {
    margin: 0 0 5px;
}

.bo-player-profile-avatar {
    display: grid;
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--bo-primary),
        #7897ff
    );
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.bo-player-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 20px;
}

.bo-player-detail-main,
.bo-player-detail-side {
    min-width: 0;
}

.bo-detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
}

.bo-detail-list > div {
    padding: 14px 0;
    border-bottom: 1px solid var(--bo-border);
}

.bo-detail-list > div:nth-child(odd) {
    padding-right: 20px;
}

.bo-detail-list > div:nth-child(even) {
    padding-left: 20px;
}

.bo-detail-list dt {
    margin-bottom: 6px;
    color: var(--bo-text-muted);
    font-size: 11px;
}

.bo-detail-list dd {
    margin: 0;
    color: var(--bo-text);
    font-size: 13px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.bo-detail-list-single {
    grid-template-columns: 1fr;
}

.bo-detail-list-single > div {
    padding-right: 0 !important;
    padding-left: 0 !important;
}

.bo-player-contact-item + .bo-player-contact-item {
    margin-top: 22px;
}

.bo-player-contact-item span,
.bo-player-contact-item strong,
.bo-player-contact-item small {
    display: block;
}

.bo-player-contact-item span {
    margin-bottom: 6px;
    color: var(--bo-text-muted);
    font-size: 11px;
}

.bo-player-contact-item strong {
    color: var(--bo-text);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.bo-player-contact-item small {
    margin-top: 6px;
    font-size: 11px;
}

.is-verified {
    color: var(--bo-success);
}

.is-unverified {
    color: var(--bo-danger);
}

.bo-session-list {
    padding-top: 8px;
    padding-bottom: 8px;
}

.bo-session-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 13px 0;
    border-bottom: 1px solid var(--bo-border);
}

.bo-session-item:last-child {
    border-bottom: 0;
}

.bo-session-item strong,
.bo-session-item span {
    display: block;
}

.bo-session-item strong {
    color: var(--bo-text);
    font-size: 12px;
}

.bo-session-item span {
    margin-top: 4px;
    color: var(--bo-text-muted);
    font-size: 10px;
    line-height: 1.5;
}

.bo-session-item small {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 600;
}

@media (max-width: 1050px) {
    .bo-player-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .bo-detail-list {
        grid-template-columns: 1fr;
    }

    .bo-detail-list > div {
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    .bo-player-profile-heading {
        align-items: flex-start;
    }
}

/* =========================================================
   CREATE PLAYER
========================================================= */

.bo-player-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 360px);
    gap: 20px;
    align-items: start;
}

.bo-player-form-main,
.bo-player-form-side {
    min-width: 0;
}

.bo-form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bo-required {
    color: var(--bo-danger);
}

.bo-password-field {
    position: relative;
}

.bo-password-field .bo-input {
    padding-right: 62px;
}

.bo-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    min-width: 46px;
    height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    background: var(--bo-primary-light);
    color: var(--bo-primary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transform: translateY(-50%);
}

.bo-password-toggle:hover {
    background: #dfe9ff;
}

.bo-phone-input {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
}

.bo-country-code-input {
    text-align: center;
}

.bo-form-spacing {
    margin-top: 18px;
}

.bo-field-help {
    display: block;
    margin-top: 6px;
    color: var(--bo-text-muted);
    font-size: 11px;
    line-height: 1.5;
}

.bo-btn-block {
    width: 100%;
}

.bo-form-cancel {
    margin-top: 10px;
}

@media (max-width: 1050px) {
    .bo-player-form-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .bo-form-grid-2 {
        grid-template-columns: 1fr;
    }

    .bo-phone-input {
        grid-template-columns: 82px minmax(0, 1fr);
    }
}

.bo-form-section-note {
    margin: 0 0 18px;
    color: var(--bo-text-soft);
    font-size: 12px;
    line-height: 1.6;
}

.bo-verification-list {
    display: grid;
    gap: 15px;
}

.bo-verification-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--bo-border);
}

.bo-verification-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.bo-verification-list span {
    color: var(--bo-text-soft);
    font-size: 12px;
}

.bo-verification-list strong {
    font-size: 11px;
}

/* =========================================================
   PLAYER SESSIONS
========================================================= */

.bo-session-table {
    min-width: 1180px;
}

.bo-session-device {
    display: block;
    color: var(--bo-text);
    font-size: 12px;
    font-weight: 600;
}

.bo-user-agent {
    display: block;
    max-width: 260px;
    margin-top: 4px;
    overflow: hidden;
    color: var(--bo-text-muted);
    font-size: 10px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bo-session-token {
    display: inline-block;
    max-width: 170px;
    padding: 5px 7px;
    overflow: hidden;
    border: 1px solid var(--bo-border);
    border-radius: 6px;
    background: var(--bo-surface-soft);
    color: var(--bo-text-soft);
    font-family: monospace;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bo-inline-form {
    display: inline-flex;
    margin: 0;
}

.bo-action-danger {
    border-color: #fecaca;
    background: var(--bo-danger-bg);
    color: var(--bo-danger);
}

.bo-action-danger:hover {
    border-color: var(--bo-danger);
    background: var(--bo-danger);
    color: #fff;
}

/* =========================================================
   PLAYER LOGIN LOGS
========================================================= */

.bo-login-log-table {
    min-width: 980px;
}

.bo-login-log-table .bo-user-agent {
    max-width: 330px;
}

/* =========================================================
   PROVIDERS PAGE
========================================================= */

.bo-provider-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.bo-provider-summary-card {
    padding: 18px 20px;
    border: 1px solid var(--bo-border);
    border-radius: var(--bo-radius-md);
    background: var(--bo-surface);
    box-shadow: var(--bo-shadow);
}

.bo-provider-summary-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--bo-text-soft);
    font-size: 12px;
}

.bo-provider-summary-card strong {
    color: var(--bo-text);
    font-size: 24px;
    line-height: 1;
}

.bo-provider-summary-card strong.is-success {
    color: var(--bo-success);
}

.bo-provider-summary-card strong.is-warning {
    color: var(--bo-warning);
}

.bo-provider-summary-card strong.is-primary {
    color: var(--bo-primary);
}

.bo-provider-table {
    min-width: 1180px;
}

.bo-provider-identity {
    display: flex;
    gap: 11px;
    align-items: center;
    min-width: 190px;
}

.bo-provider-logo {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--bo-border);
    border-radius: 10px;
    background: var(--bo-surface-soft);
}

.bo-provider-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bo-provider-logo span {
    color: var(--bo-primary);
    font-size: 16px;
    font-weight: 700;
}

.bo-provider-identity-text {
    min-width: 0;
}

.bo-provider-name {
    display: block;
    overflow: hidden;
    color: var(--bo-text);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bo-provider-name:hover {
    color: var(--bo-primary);
}

.bo-provider-identity-text span {
    display: block;
    margin-top: 4px;
    color: var(--bo-text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.bo-provider-category,
.bo-provider-wallet-mode {
    display: inline-flex;
    min-height: 25px;
    padding: 3px 9px;
    align-items: center;
    border: 1px solid var(--bo-border);
    border-radius: 999px;
    background: var(--bo-surface-soft);
    color: var(--bo-text-soft);
    font-size: 11px;
    font-weight: 600;
}

.bo-provider-meta {
    display: block;
    margin-top: 4px;
    color: var(--bo-text-muted);
    font-size: 10px;
}

.bo-provider-maintenance {
    display: block;
    max-width: 150px;
    margin-top: 5px;
    overflow: hidden;
    color: var(--bo-warning);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .bo-provider-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .bo-provider-summary {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   THEME SWITCHER
   Base/default theme is intentionally left untouched.
   Bright mode only overrides shared visual tokens/surfaces.
========================================================= */

html[data-theme="bright"] {
    --bo-primary: #316cff;
    --bo-primary-light: #eaf1ff;
    --bo-bg: #f3f6ff;
    --bo-surface: rgba(255, 255, 255, 0.94);
    --bo-surface-soft: rgba(248, 250, 255, 0.92);
    --bo-text: #111827;
    --bo-text-soft: #667085;
    --bo-text-muted: #8a94a6;
    --bo-border: #dfe6f2;
    --bo-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 34px rgba(49, 108, 255, 0.07);
}

html[data-theme="bright"] body:not(.bo-login-page) {
    background:
        radial-gradient(circle at 8% 0%, rgba(49, 108, 255, 0.10), transparent 30%),
        radial-gradient(circle at 94% 12%, rgba(139, 124, 246, 0.10), transparent 32%),
        linear-gradient(145deg, #f8fbff 0%, #f1f5ff 48%, #f8f5ff 100%);
    background-attachment: fixed;
}

html[data-theme="bright"] .bo-sidebar {
    background: rgba(255, 255, 255, 0.90);
    backdrop-filter: blur(18px);
}

html[data-theme="bright"] .bo-topbar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
}

html[data-theme="bright"] .bo-card,
html[data-theme="bright"] .bo-panel,
html[data-theme="bright"] .bo-table-card {
    box-shadow: var(--bo-shadow);
}

html[data-theme="bright"] .bo-nav-link {
    color: #344054;
}

html[data-theme="bright"] .bo-nav-link:hover {
    background: rgba(49, 108, 255, 0.07);
}

html[data-theme="bright"] .bo-menu-toggle:hover,
html[data-theme="bright"] .bo-icon-button:hover {
    background: rgba(49, 108, 255, 0.07);
}

.bo-theme-toggle {
    position: relative;
}

.bo-theme-toggle .bo-theme-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.bo-theme-toggle .bo-theme-icon-sun {
    display: none;
}

html[data-theme="bright"] .bo-theme-toggle .bo-theme-icon-sun {
    display: block;
}

html[data-theme="bright"] .bo-theme-toggle .bo-theme-icon-moon {
    display: none;
}

/* === MEGABOX PREMIUM SHELL V3 === */


/* Default = existing premium dark direction. Bright is the companion theme. */
html[data-theme="dark"] {
    --bo-primary: #6f8cff;
    --bo-primary-light: rgba(111, 140, 255, .14);
    --bo-bg: #0b1020;
    --bo-surface: #121a2d;
    --bo-surface-soft: #182238;
    --bo-text: #f4f7ff;
    --bo-text-soft: #aab5cc;
    --bo-text-muted: #74809a;
    --bo-border: rgba(255,255,255,.08);
    --bo-success-bg: rgba(22,163,74,.14);
    --bo-warning-bg: rgba(245,158,11,.14);
    --bo-danger-bg: rgba(239,68,68,.14);
    --bo-info-bg: rgba(37,99,235,.14);
    --bo-shadow: 0 18px 50px rgba(0,0,0,.22);
}

html[data-theme="bright"] {
    --bo-primary: #4268ff;
    --bo-primary-light: #edf1ff;
    --bo-bg: #eef3ff;
    --bo-surface: rgba(255,255,255,.90);
    --bo-surface-soft: #f7f9ff;
    --bo-text: #172033;
    --bo-text-soft: #64718b;
    --bo-text-muted: #98a2b7;
    --bo-border: rgba(82,101,150,.14);
    --bo-shadow: 0 16px 42px rgba(57,74,130,.10);
}

body:not(.bo-login-page) {
    background:
        radial-gradient(circle at 90% 0%, rgba(100,92,255,.14), transparent 30%),
        radial-gradient(circle at 10% 10%, rgba(48,124,255,.12), transparent 32%),
        var(--bo-bg);
    transition: background .25s ease, color .25s ease;
}

html[data-theme="dark"] body:not(.bo-login-page) {
    background:
        radial-gradient(circle at 88% -10%, rgba(90,72,255,.22), transparent 32%),
        radial-gradient(circle at 8% 8%, rgba(36,105,255,.17), transparent 34%),
        linear-gradient(180deg, #0b1020 0%, #0e1526 100%);
}

.bo-sidebar {
    width: 248px;
    background: color-mix(in srgb, var(--bo-surface) 94%, transparent);
    border-right: 1px solid var(--bo-border);
    box-shadow: 18px 0 45px rgba(9,16,34,.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: width .24s ease, transform .24s ease;
}

.bo-main {
    margin-left: 248px;
    transition: margin-left .24s ease;
}

.bo-brand {
    padding: 0 20px;
    background: linear-gradient(180deg, rgba(255,255,255,.025), transparent);
}

.bo-brand-link { display:flex; align-items:center; gap:11px; min-width:0; }
.bo-brand-image { max-width: 142px; max-height: 40px; object-fit: contain; }
.bo-brand-name { white-space: nowrap; }

.bo-nav { padding: 14px 12px 22px; }
.bo-nav-section { margin: 22px 12px 8px; font-size: 10px; letter-spacing: .12em; }
.bo-nav-link {
    color: var(--bo-text-soft);
    border: 1px solid transparent;
    min-height: 44px;
    border-radius: 12px;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.bo-nav-link:hover {
    color: var(--bo-text);
    background: color-mix(in srgb, var(--bo-primary) 9%, transparent);
    transform: translateX(2px);
}
.bo-nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #3f67ff, #7b61ff);
    border-color: rgba(255,255,255,.10);
    box-shadow: 0 10px 26px rgba(77,92,255,.24);
}
.bo-nav-icon { display:grid; place-items:center; }
.bo-nav-icon svg { width:20px; height:20px; }

.bo-topbar {
    height: 76px;
    padding: 0 26px;
    background: color-mix(in srgb, var(--bo-surface) 82%, transparent);
    border-bottom: 1px solid var(--bo-border);
    box-shadow: 0 8px 28px rgba(10,18,38,.06);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.bo-topbar-left, .bo-topbar-right { gap: 12px; }
.bo-title-wrap { display:flex; flex-direction:column; gap:2px; }
.bo-page-title { font-size: 22px; letter-spacing: -.025em; }
.bo-topbar-kicker { color: var(--bo-text-muted); font-size: 11px; font-weight:600; letter-spacing:.04em; }

.bo-menu-toggle,
.bo-icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--bo-border);
    background: color-mix(in srgb, var(--bo-surface-soft) 90%, transparent);
    color: var(--bo-text-soft);
}
.bo-menu-toggle:hover,
.bo-icon-button:hover {
    background: color-mix(in srgb, var(--bo-primary) 10%, var(--bo-surface));
    color: var(--bo-text);
    border-color: color-mix(in srgb, var(--bo-primary) 24%, var(--bo-border));
}

.bo-notification-button { position:relative; }
.bo-notification-dot {
    position:absolute; top:9px; right:9px; width:7px; height:7px; border-radius:50%;
    background:#ff5b73; border:2px solid var(--bo-surface);
}

.bo-profile-wrap { position: relative; }
.bo-admin-button {
    border: 1px solid var(--bo-border);
    background: color-mix(in srgb, var(--bo-surface-soft) 88%, transparent);
    padding: 6px 9px 6px 7px;
    border-radius: 14px;
    cursor: pointer;
    color: inherit;
    min-width: 178px;
    transition: .18s ease;
}
.bo-admin-button:hover { border-color: color-mix(in srgb, var(--bo-primary) 28%, var(--bo-border)); transform: translateY(-1px); }
.bo-avatar { box-shadow: 0 7px 18px rgba(75,96,255,.22); }
.bo-profile-chevron { margin-left:auto; color:var(--bo-text-muted); transition:transform .18s ease; }
.bo-admin-button[aria-expanded="true"] .bo-profile-chevron { transform: rotate(180deg); }

.bo-dropdown {
    position:absolute;
    top: calc(100% + 10px);
    right:0;
    min-width: 248px;
    padding: 8px;
    border: 1px solid var(--bo-border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--bo-surface) 97%, transparent);
    box-shadow: 0 24px 60px rgba(0,0,0,.22);
    z-index: 1200;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.bo-dropdown[hidden] { display:none !important; }
.bo-profile-dropdown-head { display:flex; align-items:center; gap:12px; padding:10px; }
.bo-profile-dropdown-head strong { display:block; color:var(--bo-text); font-size:14px; }
.bo-profile-dropdown-head div > span { display:block; margin-top:3px; color:var(--bo-text-muted); font-size:12px; }
.bo-avatar-lg { width:44px; height:44px; flex:0 0 44px; }
.bo-dropdown-divider { height:1px; background:var(--bo-border); margin:6px 2px; }
.bo-dropdown-item {
    display:flex; align-items:center; gap:11px; min-height:42px; padding:0 11px; border-radius:10px;
    color:var(--bo-text-soft); font-weight:600; transition:.16s ease;
}
.bo-dropdown-item:hover { color:var(--bo-text); background:color-mix(in srgb, var(--bo-primary) 9%, transparent); }
.bo-dropdown-item-danger { color:#ff6b7c; }

.bo-content { padding: 28px 28px 42px; }
.bo-page-header { margin-bottom: 22px; }
.bo-page-header h2 { font-size: 24px; letter-spacing: -.025em; }

.bo-card,
.bo-stat-card {
    background: color-mix(in srgb, var(--bo-surface) 94%, transparent);
    border-color: var(--bo-border);
    box-shadow: var(--bo-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.bo-card { border-radius: 16px; }
.bo-stat-card { border-radius: 17px; min-height:150px; }
.bo-stat-card:hover { transform: translateY(-2px); box-shadow: 0 22px 54px rgba(0,0,0,.14); }
.bo-stat-card { transition: transform .18s ease, box-shadow .18s ease; }

html[data-theme="dark"] .bo-stat-label,
html[data-theme="dark"] .bo-label,
html[data-theme="dark"] .bo-table td { color: var(--bo-text-soft); }
html[data-theme="dark"] .bo-table th { color:var(--bo-text-muted); background:rgba(255,255,255,.025); }
html[data-theme="dark"] .bo-input,
html[data-theme="dark"] .bo-select,
html[data-theme="dark"] .bo-textarea,
html[data-theme="dark"] .bo-btn { background:#151f34; color:var(--bo-text); border-color:var(--bo-border); }
html[data-theme="dark"] .bo-btn:hover { background:#1b2943; }

.bo-btn { border-radius:10px; font-weight:650; }
.bo-btn-primary { background:linear-gradient(135deg,#3f67ff,#725dff); border-color:transparent; box-shadow:0 9px 20px rgba(66,92,255,.22); }
.bo-btn-primary:hover { background:linear-gradient(135deg,#365eea,#684fe9); border-color:transparent; }

/* Theme icon logic */
.bo-theme-icon-sun { display:none; }
html[data-theme="bright"] .bo-theme-icon-sun { display:block; }
html[data-theme="bright"] .bo-theme-icon-moon { display:none; }
html[data-theme="dark"] .bo-theme-icon-moon { display:block; }
html[data-theme="dark"] .bo-theme-icon-sun { display:none; }

/* Desktop collapsed sidebar */
@media (min-width: 901px) {
    html.bo-sidebar-collapsed-preload .bo-sidebar,
    body.bo-sidebar-collapsed .bo-sidebar { width: 78px; }
    html.bo-sidebar-collapsed-preload .bo-main,
    body.bo-sidebar-collapsed .bo-main { margin-left: 78px; }
    body.bo-sidebar-collapsed .bo-brand { padding:0 18px; justify-content:center; }
    body.bo-sidebar-collapsed .bo-brand-name,
    body.bo-sidebar-collapsed .bo-brand-image,
    body.bo-sidebar-collapsed .bo-nav-section,
    body.bo-sidebar-collapsed .bo-nav-link > span:not(.bo-nav-icon) { display:none; }
    body.bo-sidebar-collapsed .bo-brand-logo { display:grid; }
    body.bo-sidebar-collapsed .bo-nav { padding:14px 10px; }
    body.bo-sidebar-collapsed .bo-nav-link { justify-content:center; padding:0; }
    body.bo-sidebar-collapsed .bo-nav-link:hover { transform:none; }
}

@media (max-width: 900px) {
    .bo-sidebar { width: 260px; transform: translateX(-102%); box-shadow: 20px 0 60px rgba(0,0,0,.30); }
    .bo-sidebar.open { transform: translateX(0); }
    .bo-main { margin-left: 0; }
    .bo-sidebar-overlay { position:fixed; inset:0; z-index:950; background:rgba(4,8,18,.54); backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px); }
    .bo-topbar { padding:0 16px; }
    .bo-content { padding:20px 16px 34px; }
    .bo-admin-button { min-width:0; padding:5px; }
    .bo-admin-info, .bo-profile-chevron { display:none; }
}

@media (max-width: 640px) {
    .bo-topbar-kicker { display:none; }
    .bo-page-title { font-size:18px; }
    .bo-notification-button { display:none; }
    .bo-topbar-right { gap:7px; }
    .bo-menu-toggle,.bo-icon-button { width:40px; height:40px; }
    .bo-profile-dropdown { position:fixed; top:68px; right:12px; left:12px; min-width:0; }
    .bo-stats-grid { grid-template-columns:1fr 1fr; gap:12px; }
    .bo-stat-card { min-height:132px; padding:18px 16px; }
    .bo-stat-icon { width:46px; height:46px; flex-basis:46px; }
    .bo-stat-value { font-size:24px; }
}

@media (max-width: 430px) {
    .bo-stats-grid { grid-template-columns:1fr; }
}


/* =========================================================
   BO Shell Polish — responsive navigation / profile / footer
   ========================================================= */
.bo-main {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.bo-content {
    width: 100%;
    flex: 1 0 auto;
}

.bo-sidebar-close {
    display: none;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid var(--bo-border);
    border-radius: 11px;
    background: color-mix(in srgb, var(--bo-surface-soft) 92%, transparent);
    color: var(--bo-text-soft);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.bo-sidebar-close:hover {
    color: var(--bo-text);
    background: color-mix(in srgb, var(--bo-primary) 10%, var(--bo-surface));
}

.bo-dropdown-button {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.bo-dropdown-icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    display: grid;
    place-items: center;
}

.bo-dropdown-icon svg {
    width: 19px;
    height: 19px;
}

.bo-profile-dropdown {
    overflow: hidden;
}

.bo-footer {
    flex: 0 0 auto;
    padding: 0 28px calc(14px + env(safe-area-inset-bottom));
    color: var(--bo-text-muted);
    font-size: 12px;
}

.bo-footer-inner {
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid var(--bo-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--bo-surface) 84%, transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.bo-footer-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.bo-footer-dot { opacity: .55; }

@media (max-width: 900px) {
    .bo-sidebar {
        width: min(82vw, 300px);
        max-width: 300px;
        padding-left: env(safe-area-inset-left);
        z-index: 1200;
    }

    .bo-sidebar-overlay {
        z-index: 1100;
    }

    body.bo-sidebar-open {
        overflow: hidden;
        touch-action: none;
    }

    .bo-brand {
        padding-right: 12px;
    }

    .bo-brand-link {
        flex: 1 1 auto;
        min-width: 0;
    }

    .bo-sidebar-close {
        display: inline-flex;
    }

    .bo-topbar {
        min-height: 68px;
        height: 68px;
        padding-top: env(safe-area-inset-top);
        padding-left: max(14px, env(safe-area-inset-left));
        padding-right: max(14px, env(safe-area-inset-right));
    }

    .bo-content {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .bo-footer {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

@media (max-width: 640px) {
    .bo-topbar-left {
        min-width: 0;
        flex: 1 1 auto;
    }

    .bo-title-wrap {
        min-width: 0;
    }

    .bo-page-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bo-topbar-right {
        flex: 0 0 auto;
    }

    .bo-profile-dropdown {
        top: calc(68px + env(safe-area-inset-top));
        right: max(10px, env(safe-area-inset-right));
        left: max(10px, env(safe-area-inset-left));
        width: auto;
        max-height: calc(100dvh - 84px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        overflow-y: auto;
        border-radius: 15px;
    }

    .bo-dropdown-item {
        min-height: 48px;
        font-size: 14px;
    }

    .bo-footer-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .bo-footer-meta {
        flex-wrap: wrap;
        white-space: normal;
    }
}

@media (max-width: 390px) {
    .bo-page-title { font-size: 17px; }
    .bo-theme-toggle { display: none; }
    .bo-content { padding-top: 16px; }
    .bo-footer { font-size: 11px; }
}
\n\n/* =========================================================\n   Players table header — compact single-row bulk controls\n   2026-08-15\n========================================================= */\n.bo-player-table-header {\n    display: flex;\n    align-items: center;\n    justify-content: flex-start;\n    gap: 14px;\n    flex-wrap: nowrap;\n}\n\n.bo-player-table-heading {\n    flex: 0 0 auto;\n    min-width: 175px;\n}\n\n.bo-player-table-header .bo-bulk-toolbar {\n    display: inline-flex;\n    align-items: center;\n    gap: 7px;\n    flex: 0 1 auto;\n    width: auto;\n    margin: 0;\n    white-space: nowrap;\n}\n\n.bo-player-table-header .bo-bulk-toolbar strong {\n    display: inline-flex;\n    align-items: center;\n    min-height: 36px;\n    margin: 0 2px 0 0;\n    font-size: 12px;\n    font-weight: 700;\n    white-space: nowrap;\n}\n\n.bo-player-table-header .bo-bulk-toolbar .bo-select {\n    width: 158px;\n    min-width: 158px;\n    max-width: 158px;\n    height: 36px;\n    min-height: 36px;\n    padding-top: 0;\n    padding-bottom: 0;\n    flex: 0 0 158px;\n}\n\n.bo-player-table-header .bo-bulk-toolbar [data-bulk-value]:disabled {\n    display: none !important;\n}\n\n.bo-player-table-header .bo-bulk-toolbar [data-bulk-value]:not(:disabled) {\n    display: inline-block !important;\n}\n\n.bo-player-table-header .bo-bulk-toolbar .bo-btn {\n    min-width: 68px;\n    width: auto;\n    min-height: 36px;\n    height: 36px;\n    padding: 0 13px;\n    flex: 0 0 auto;\n}\n\n.bo-player-table-header .bo-page-size-form {\n    margin-left: auto;\n    flex: 0 0 auto;\n}\n\n.bo-player-table-header .bo-page-size-select {\n    width: 76px;\n    min-width: 76px;\n}\n\n@media (max-width: 900px) {\n    .bo-player-table-header {\n        flex-wrap: wrap;\n    }\n\n    .bo-player-table-heading {\n        flex: 1 1 100%;\n        min-width: 0;\n    }\n\n    .bo-player-table-header .bo-page-size-form {\n        margin-left: auto;\n    }\n}\n\n@media (max-width: 640px) {\n    .bo-player-table-header {\n        display: flex;\n        flex-direction: column;\n        align-items: stretch;\n        gap: 10px;\n    }\n\n    .bo-player-table-header .bo-bulk-toolbar {\n        display: grid;\n        grid-template-columns: 1fr auto;\n        width: 100%;\n        white-space: normal;\n    }\n\n    .bo-player-table-header .bo-bulk-toolbar strong {\n        grid-column: 1 / -1;\n        min-height: auto;\n    }\n\n    .bo-player-table-header .bo-bulk-toolbar .bo-select {\n        width: 100%;\n        min-width: 0;\n        max-width: none;\n        flex: none;\n    }\n\n    .bo-player-table-header .bo-bulk-toolbar [data-bulk-value]:not(:disabled) {\n        display: block !important;\n        grid-column: 1 / 2;\n    }\n\n    .bo-player-table-header .bo-page-size-form {\n        margin-left: 0;\n        align-self: flex-end;\n    }\n}\n

/* =========================================================
   BO BULK TOOLBAR V2 — shared fix
   One-row desktop controls for Players / Providers / Games.
   ========================================================= */
@media (min-width: 901px) {
    .bo-bulk-form .bo-card-header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 14px !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }

    .bo-bulk-form .bo-card-header > :first-child {
        flex: 0 0 auto !important;
        min-width: 185px !important;
        margin: 0 8px 0 0 !important;
    }

    .bo-bulk-form .bo-bulk-toolbar {
        display: inline-flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
        width: auto !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }

    .bo-bulk-form .bo-bulk-toolbar strong {
        display: inline-flex !important;
        align-items: center !important;
        min-height: 36px !important;
        margin: 0 !important;
        white-space: nowrap !important;
        font-size: 12px !important;
    }

    .bo-bulk-form .bo-bulk-toolbar .bo-select {
        width: 165px !important;
        min-width: 165px !important;
        max-width: 165px !important;
        height: 36px !important;
        min-height: 36px !important;
        flex: 0 0 165px !important;
    }

    .bo-bulk-form .bo-bulk-toolbar [data-bulk-value]:disabled {
        display: none !important;
    }

    .bo-bulk-form .bo-bulk-toolbar [data-bulk-value]:not(:disabled) {
        display: inline-block !important;
    }

    .bo-bulk-form .bo-bulk-toolbar .bo-btn {
        width: auto !important;
        min-width: 72px !important;
        height: 36px !important;
        min-height: 36px !important;
        padding: 0 14px !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }

    .bo-bulk-form .bo-page-size-form {
        margin-left: auto !important;
        flex: 0 0 auto !important;
    }
}

@media (max-width: 900px) {
    .bo-bulk-form .bo-card-header {
        flex-wrap: wrap !important;
    }
}


/* ===== Game Catalogue V1 ===== */
.bo-catalogue-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px}.bo-catalogue-tab{display:inline-flex;align-items:center;min-height:38px;padding:0 15px;border:1px solid var(--bo-border,#28364f);border-radius:10px;color:inherit;text-decoration:none;background:rgba(255,255,255,.03)}.bo-catalogue-tab.active{background:var(--bo-primary,#316cff);border-color:var(--bo-primary,#316cff);color:#fff}.bo-sort-list{display:grid;gap:10px}.bo-sort-item{display:grid;grid-template-columns:34px 62px minmax(0,1fr) auto auto auto;align-items:center;gap:12px;padding:11px 12px;border:1px solid rgba(128,148,180,.22);border-radius:12px;background:rgba(255,255,255,.025);transition:.16s ease;cursor:default}.bo-sort-item:hover{border-color:rgba(80,130,255,.55);transform:translateY(-1px)}.bo-sort-item.is-dragging{opacity:.5;transform:scale(.995)}.bo-sort-item.is-disabled,.bo-row-disabled{opacity:.48;filter:grayscale(1)}.bo-drag-handle{font-size:22px;line-height:1;cursor:grab;user-select:none;text-align:center;opacity:.72}.bo-drag-handle:active{cursor:grabbing}.bo-catalogue-thumb{width:58px;height:58px;border-radius:10px;overflow:hidden;background:rgba(120,140,170,.14);display:flex;align-items:center;justify-content:center;font-weight:800}.bo-catalogue-thumb img{width:100%;height:100%;object-fit:cover;display:block}.bo-catalogue-copy{min-width:0}.bo-catalogue-copy strong,.bo-catalogue-copy span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.bo-catalogue-copy span{font-size:12px;opacity:.68;margin-top:3px}.bo-upload-preview{margin-top:10px;width:150px;max-height:120px;border-radius:10px;overflow:hidden;border:1px solid rgba(128,148,180,.25)}.bo-upload-preview img{width:100%;height:100%;max-height:120px;object-fit:cover;display:block}@media(max-width:760px){.bo-sort-item{grid-template-columns:28px 52px minmax(0,1fr);gap:9px}.bo-sort-item>.bo-badge,.bo-sort-item>.bo-action-button{grid-column:3}.bo-catalogue-thumb{width:50px;height:50px}}

/* Games & Providers nested sidebar */
.bo-nav-group{margin:2px 0}.bo-nav-group-toggle{width:100%;border:0;font:inherit;text-align:left;cursor:pointer}.bo-nav-group-toggle .bo-nav-arrow{margin-left:auto;font-size:18px;transition:transform .18s ease}.bo-nav-group.open .bo-nav-arrow{transform:rotate(180deg)}
.bo-nav-submenu{display:none;margin:2px 0 8px 25px;padding-left:13px;border-left:1px solid rgba(142,155,180,.2)}.bo-nav-group.open .bo-nav-submenu{display:grid;gap:2px}
.bo-nav-sublink{position:relative;display:flex;align-items:center;gap:10px;min-height:34px;padding:6px 10px;color:var(--bo-text-soft);font-size:13px;text-decoration:none;border-radius:8px}.bo-nav-sublink:hover{color:var(--bo-text);background:rgba(116,86,255,.08)}.bo-nav-sublink.active{color:#fff;background:rgba(105,70,255,.18);font-weight:700}.bo-nav-dot{width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.65}.bo-nav-sublink.active .bo-nav-dot{background:#7c55ff;opacity:1;box-shadow:0 0 0 4px rgba(124,85,255,.12)}
body.bo-sidebar-collapsed .bo-nav-submenu,body.bo-sidebar-collapsed .bo-nav-arrow{display:none!important}

/* =========================================================
   MEGABOX BO THEME HARDENING V4 — 2026-09-08
   Global dark/bright readability compatibility layer.
   Keep page-specific layouts; normalize visual surfaces only.
========================================================= */
html[data-theme="dark"] {
    --bo-card-bg: var(--bo-surface);
    --bo-input-bg: #0f182b;
    --bo-table-head-bg: #172238;
    --bo-table-hover-bg: rgba(111, 140, 255, .075);
    --bo-control-hover-bg: rgba(111, 140, 255, .10);
    --bo-overlay-bg: rgba(3, 8, 20, .72);
    --bo-success-text: #70e69a;
    --bo-warning-text: #ffd079;
    --bo-danger-text: #ff8d9a;
    --bo-info-text: #8cb1ff;
}

html[data-theme="bright"] {
    --bo-card-bg: var(--bo-surface);
    --bo-input-bg: #ffffff;
    --bo-table-head-bg: #f8faff;
    --bo-table-hover-bg: #f6f8ff;
    --bo-control-hover-bg: rgba(49, 108, 255, .07);
    --bo-overlay-bg: rgba(15, 23, 42, .45);
    --bo-success-text: #13833c;
    --bo-warning-text: #b86800;
    --bo-danger-text: #c92a36;
    --bo-info-text: #2563eb;
}

/* Shared navigation / controls */
body:not(.bo-login-page) .bo-nav-link { color: var(--bo-text-soft); }
body:not(.bo-login-page) .bo-nav-link:hover { background: var(--bo-control-hover-bg); color: var(--bo-text); }
body:not(.bo-login-page) .bo-menu-toggle:hover,
body:not(.bo-login-page) .bo-icon-button:hover { background: var(--bo-control-hover-bg); }

body:not(.bo-login-page) .bo-btn,
body:not(.bo-login-page) .bo-action-button,
body:not(.bo-login-page) .bo-page-button {
    background: var(--bo-input-bg);
    color: var(--bo-text-soft);
    border-color: var(--bo-border);
}
body:not(.bo-login-page) .bo-btn:hover,
body:not(.bo-login-page) .bo-action-button:hover,
body:not(.bo-login-page) .bo-page-button:hover {
    background: var(--bo-control-hover-bg);
    color: var(--bo-text);
    border-color: color-mix(in srgb, var(--bo-primary) 38%, var(--bo-border));
}
body:not(.bo-login-page) .bo-btn-primary,
body:not(.bo-login-page) .bo-page-button.active {
    background: var(--bo-primary);
    color: #fff;
    border-color: var(--bo-primary);
}
body:not(.bo-login-page) .bo-btn-danger {
    background: var(--bo-danger);
    color: #fff;
    border-color: var(--bo-danger);
}

/* Shared labels, forms and native controls used by legacy pages */
body:not(.bo-login-page) .bo-label { color: var(--bo-text-soft); }
body:not(.bo-login-page) .bo-input,
body:not(.bo-login-page) .bo-select,
body:not(.bo-login-page) .bo-textarea,
body:not(.bo-login-page) .bo-content input[type="text"],
body:not(.bo-login-page) .bo-content input[type="search"],
body:not(.bo-login-page) .bo-content input[type="email"],
body:not(.bo-login-page) .bo-content input[type="password"],
body:not(.bo-login-page) .bo-content input[type="number"],
body:not(.bo-login-page) .bo-content input[type="date"],
body:not(.bo-login-page) .bo-content input[type="datetime-local"],
body:not(.bo-login-page) .bo-content input[type="time"],
body:not(.bo-login-page) .bo-content input[type="url"],
body:not(.bo-login-page) .bo-content select,
body:not(.bo-login-page) .bo-content textarea {
    background: var(--bo-input-bg);
    color: var(--bo-text);
    border-color: var(--bo-border);
}
body:not(.bo-login-page) .bo-content input::placeholder,
body:not(.bo-login-page) .bo-content textarea::placeholder { color: var(--bo-text-muted); opacity: 1; }
body:not(.bo-login-page) .bo-content option { background: var(--bo-surface); color: var(--bo-text); }

/* Shared tables, including older page-local mb-safe/AI tables */
body:not(.bo-login-page) .bo-table th,
body:not(.bo-login-page) .mb-safe-table th,
body:not(.bo-login-page) .ai-table th {
    background: var(--bo-table-head-bg);
    color: var(--bo-text-soft);
    border-color: var(--bo-border);
}
body:not(.bo-login-page) .bo-table td,
body:not(.bo-login-page) .mb-safe-table td,
body:not(.bo-login-page) .ai-table td {
    color: var(--bo-text);
    border-color: var(--bo-border);
}
body:not(.bo-login-page) .bo-table tbody tr:hover,
body:not(.bo-login-page) .mb-safe-table tbody tr:hover,
body:not(.bo-login-page) .ai-table tbody tr:hover { background: var(--bo-table-hover-bg); }

/* Shared surfaces */
body:not(.bo-login-page) .bo-modal-dialog,
body:not(.bo-login-page) .bo-card,
body:not(.bo-login-page) .bo-panel,
body:not(.bo-login-page) .bo-table-card,
body:not(.bo-login-page) .mb-safe-card,
body:not(.bo-login-page) .mb-safe-wrap,
body:not(.bo-login-page) .mb-ai-card,
body:not(.bo-login-page) .mb-ai-table-wrap,
body:not(.bo-login-page) .ai-card,
body:not(.bo-login-page) .ai-panel,
body:not(.bo-login-page) .ai-box,
body:not(.bo-login-page) .ai-table-wrap,
body:not(.bo-login-page) .ai-batch,
body:not(.bo-login-page) .panel,
body:not(.bo-login-page) .fin-card,
body:not(.bo-login-page) .demo-wrap,
body:not(.bo-login-page) .mb-support-list,
body:not(.bo-login-page) .mb-support-chat {
    background: var(--bo-card-bg);
    color: var(--bo-text);
    border-color: var(--bo-border);
}
body:not(.bo-login-page) .bo-modal-backdrop { background: var(--bo-overlay-bg); }

/* Player summary cards were legacy light-only surfaces. */
body:not(.bo-login-page) .bo-player-summary-card {
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--bo-surface) 96%, var(--bo-primary) 4%) 0%,
        var(--bo-surface-soft) 100%);
    border-color: var(--bo-border);
    color: var(--bo-text);
    box-shadow: var(--bo-shadow);
}

/* Alerts/statuses: preserve meaning with readable contrast in both themes. */
body:not(.bo-login-page) .mb-safe-alert {
    background: var(--bo-danger-bg) !important;
    color: var(--bo-danger-text) !important;
    border-color: color-mix(in srgb, var(--bo-danger) 48%, var(--bo-border)) !important;
}
body:not(.bo-login-page) .bo-badge-success { color: var(--bo-success-text); border-color: color-mix(in srgb, var(--bo-success) 36%, var(--bo-border)); }
body:not(.bo-login-page) .bo-badge-warning { color: var(--bo-warning-text); border-color: color-mix(in srgb, var(--bo-warning) 36%, var(--bo-border)); }
body:not(.bo-login-page) .bo-badge-danger { color: var(--bo-danger-text); border-color: color-mix(in srgb, var(--bo-danger) 36%, var(--bo-border)); }
body:not(.bo-login-page) .bo-badge-info { color: var(--bo-info-text); border-color: color-mix(in srgb, var(--bo-info) 36%, var(--bo-border)); }

/* Custom page text helpers */
body:not(.bo-login-page) .mb-safe-sub,
body:not(.bo-login-page) .fin-sub,
body:not(.bo-login-page) .fin-kv small,
body:not(.bo-login-page) .bo-pagination-summary,
body:not(.bo-login-page) .bo-table-subtext { color: var(--bo-text-muted); }

/* Game catalogue note needed a dark-mode text counterpart. */
html[data-theme="dark"] .mb-note { color: #b8a8ff; }
html[data-theme="bright"] .mb-note { color: #5e3ce0; }

/* Disabled/read-only controls remain distinguishable without becoming unreadable. */
body:not(.bo-login-page) .bo-content input:disabled,
body:not(.bo-login-page) .bo-content select:disabled,
body:not(.bo-login-page) .bo-content textarea:disabled,
body:not(.bo-login-page) .bo-content input[readonly],
body:not(.bo-login-page) .bo-content textarea[readonly] {
    background: color-mix(in srgb, var(--bo-surface-soft) 90%, transparent);
    color: var(--bo-text-soft);
    opacity: .78;
}

/* Native autofill can otherwise flash white in Chromium dark mode. */
html[data-theme="dark"] body:not(.bo-login-page) .bo-content input:-webkit-autofill,
html[data-theme="dark"] body:not(.bo-login-page) .bo-content input:-webkit-autofill:hover,
html[data-theme="dark"] body:not(.bo-login-page) .bo-content input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--bo-text);
    -webkit-box-shadow: 0 0 0 1000px var(--bo-input-bg) inset;
    caret-color: var(--bo-text);
}

/* Page-specific legacy color fixes that previously stayed light-only. */
html[data-theme="dark"] .mb-support-message { background: #1b2740; color: var(--bo-text); }
html[data-theme="dark"] .mb-support-message.admin { background: rgba(22,163,74,.16); color: #bdf5cf; }
html[data-theme="dark"] .mb-support-message.player { background: #5568ff; color: #fff; }
html[data-theme="bright"] .mb-support-message { background: #eef1f8; color: var(--bo-text); }
html[data-theme="bright"] .mb-support-message.admin { background: #e7f7ef; color: #185d37; }

html[data-theme="dark"] .ai-ok { color: var(--bo-success-text); }
html[data-theme="dark"] .ai-warn { color: var(--bo-warning-text); }

/* Ensure row/status pills inherit readable foregrounds. */
body:not(.bo-login-page) .mb-safe-status,
body:not(.bo-login-page) .mb-safe-dir {
    color: var(--bo-text-soft);
    border: 1px solid var(--bo-border);
}

/* MegaBox Technical BO shared components */
.bo-tech-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0 0 18px}
.bo-tech-card{background:var(--bo-card-bg,var(--bo-surface));border:1px solid var(--bo-border);border-radius:14px;padding:16px;min-width:0}
.bo-tech-card h3,.bo-tech-card h4{margin:0 0 6px;color:var(--bo-text)}
.bo-tech-card p{margin:0;color:var(--bo-text-muted);font-size:13px;line-height:1.55}
.bo-tech-kpi{display:block;font-size:25px;font-weight:800;color:var(--bo-text);margin-top:8px}
.bo-tech-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.bo-tech-form-grid .bo-field-full{grid-column:1/-1}
.bo-tech-section{margin-bottom:18px}
.bo-tech-env-banner{display:flex;align-items:center;justify-content:space-between;gap:14px;border:1px solid var(--bo-border);background:var(--bo-card-bg,var(--bo-surface));border-radius:14px;padding:15px 16px;margin-bottom:16px}
.bo-tech-env-banner strong{font-size:16px;color:var(--bo-text)}
.bo-tech-env-banner small{display:block;color:var(--bo-text-muted);margin-top:4px}
.bo-tech-danger{border-color:color-mix(in srgb,#ef4444 45%,var(--bo-border));}
.bo-code-box{width:100%;min-height:340px;background:var(--bo-input-bg,var(--bo-surface));color:var(--bo-text);border:1px solid var(--bo-border);border-radius:12px;padding:14px;font:13px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;tab-size:4;resize:vertical}
.bo-secret{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.02em}
.bo-tech-note{padding:12px 14px;border:1px solid var(--bo-border);border-radius:12px;background:var(--bo-surface-soft);color:var(--bo-text-soft);font-size:13px;line-height:1.55}
.bo-health-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid var(--bo-border)}
.bo-health-row:last-child{border-bottom:0}.bo-health-row span{color:var(--bo-text-soft)}
@media(max-width:1100px){.bo-tech-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.bo-tech-grid,.bo-tech-form-grid{grid-template-columns:1fr}.bo-tech-form-grid .bo-field-full{grid-column:auto}.bo-tech-env-banner{align-items:flex-start;flex-direction:column}}
