/* Global compact spacing layer. Loaded after page and theme styles. */
body.premium-theme {
    line-height: 1.3;
}

/* Sidebar header, menu rows, and footer. */
body.premium-theme .premium-sidebar .premium-brand {
    min-height: 58px;
    padding: .45rem .65rem;
    gap: .55rem;
}

body.premium-theme .premium-sidebar .premium-brand-logo {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 1.05rem;
}

body.premium-theme .premium-sidebar .premium-brand-name {
    font-size: 1.1rem;
}

body.premium-theme .premium-sidebar .premium-sidebar-nav {
    padding: .4rem .45rem .3rem;
}

body.premium-theme .premium-sidebar .premium-nav-section-title {
    margin: .1rem 0 .2rem;
    padding-left: .5rem;
    font-size: .62rem;
}

body.premium-theme .premium-sidebar .premium-nav-list {
    margin-bottom: .35rem;
}

body.premium-theme .premium-sidebar .premium-nav-item {
    margin-bottom: .05rem;
}

body.premium-theme .premium-sidebar .premium-nav-link {
    min-height: 34px;
    gap: .5rem;
    padding: .28rem .5rem;
    font-size: .82rem;
}

body.premium-theme .premium-sidebar .premium-nav-icon {
    width: 23px;
    flex-basis: 23px;
    font-size: 1rem;
}

body.premium-theme .premium-sidebar .premium-sidebar-footer {
    padding: .4rem;
}

body.premium-theme .premium-sidebar-footer .mb-3,
body.premium-theme .premium-sidebar-footer .mb-2 {
    margin-bottom: .35rem !important;
}

body.premium-theme .premium-sidebar-footer .mb-1 {
    margin-bottom: .15rem !important;
}

body.premium-theme .premium-sidebar-footer .form-select,
body.premium-theme .premium-sidebar-footer .premium-theme-toggle-btn,
body.premium-theme .premium-sidebar-footer .premium-sidebar-logout-btn {
    min-height: 34px;
    height: 34px;
    padding: .25rem .5rem !important;
    font-size: .78rem;
}

body.premium-theme .premium-sidebar .premium-user-card {
    margin: .2rem 0 .35rem;
    gap: .5rem;
}

body.premium-theme .premium-sidebar .premium-user-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    font-size: .75rem;
}

body.premium-theme .premium-sidebar .premium-user-name {
    margin-bottom: .05rem;
    font-size: .82rem;
    line-height: 1.15;
}

body.premium-theme .premium-sidebar .premium-user-role {
    font-size: .68rem;
}

/* Shared page header and content spacing. */
body.premium-theme .premium-topbar {
    height: 54px;
    min-height: 54px;
    padding: 0 .65rem;
}

body.premium-theme .premium-topbar-leading,
body.premium-theme .premium-topbar-actions {
    gap: .4rem;
}

body.premium-theme .premium-header-back,
body.premium-theme .premium-header-quick,
body.premium-theme .premium-mobile-toggle,
body.premium-theme .premium-topbar-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
}

body.premium-theme .premium-page-title {
    font-size: 1.05rem;
}

body.premium-theme .premium-hdr-stat {
    min-height: 32px;
    padding: .15rem .42rem;
}

body.premium-theme .premium-bottombar {
    height: 48px;
    padding-top: 0;
}

body.premium-theme .premium-bottom-item {
    gap: .05rem;
    font-size: .6rem;
    line-height: 1.1;
}

body.premium-theme .premium-bottom-icon {
    font-size: 1.1rem;
}

body.premium-theme .premium-content {
    padding: .7rem;
}

body.premium-theme .premium-content .row {
    --bs-gutter-x: .75rem;
    --bs-gutter-y: .5rem;
}

body.premium-theme .premium-content h1,
body.premium-theme .premium-content h2,
body.premium-theme .premium-content h3,
body.premium-theme .premium-content h4,
body.premium-theme .premium-content h5,
body.premium-theme .premium-content h6 {
    margin-bottom: .4rem;
}

body.premium-theme .premium-content .mb-5 { margin-bottom: 1rem !important; }
body.premium-theme .premium-content .mb-4 { margin-bottom: .8rem !important; }
body.premium-theme .premium-content .mb-3 { margin-bottom: .55rem !important; }
body.premium-theme .premium-content .mt-4 { margin-top: .8rem !important; }
body.premium-theme .premium-content .mt-3 { margin-top: .55rem !important; }

/* Compact cards, fields, buttons, alerts, and rows on every page. */
body.premium-theme .card,
body.premium-theme .market-card,
body.premium-theme .rate-card,
body.premium-theme .session-box {
    padding: .65rem !important;
    margin-bottom: .55rem !important;
}

body.premium-theme .card-header,
body.premium-theme .card-footer {
    padding: .45rem .6rem !important;
}

body.premium-theme .card-body,
body.premium-theme .modal-body,
body.premium-theme .alert {
    padding: .55rem .65rem !important;
}

body.premium-theme .modal-header,
body.premium-theme .modal-footer,
body.premium-theme .list-group-item,
body.premium-theme .accordion-button {
    padding: .5rem .65rem;
}

body.premium-theme .form-label {
    margin-bottom: .2rem;
}

body.premium-theme .form-control,
body.premium-theme .form-select,
body.premium-theme .input-group-text {
    min-height: 34px;
    padding: .35rem .6rem !important;
    line-height: 1.2;
}

body.premium-theme .btn:not(.btn-close),
body.premium-theme .play-btn,
body.premium-theme .admin-primary-btn,
body.premium-theme .admin-outline-btn,
body.premium-theme .accounts-create-btn,
body.premium-theme .accounts-tool-btn {
    min-height: 34px;
    padding: .35rem .65rem !important;
    line-height: 1.2;
}

body.premium-theme .badge {
    padding: .25rem .4rem !important;
}

body.premium-theme .table th,
body.premium-theme .table td,
body.premium-theme .accounts-table th,
body.premium-theme .accounts-table td,
body.premium-theme .admin-table th,
body.premium-theme .admin-table td,
body.premium-theme .report-results .table th,
body.premium-theme .report-results .table td {
    height: auto;
    min-height: 0;
    padding: .38rem .45rem !important;
    line-height: 1.2;
}

body.premium-theme .accounts-shell,
body.premium-theme .user-create-shell,
body.premium-theme .load-panel-shell,
body.premium-theme .report-shell,
body.premium-theme .admin-page-shell {
    padding: .7rem;
}

body.premium-theme .bids-count,
body.premium-theme .hisab-count {
    padding: .4rem .55rem;
}

body.premium-theme .bids-filters,
body.premium-theme .hisab-filters,
body.premium-theme .load-panel-filters,
body.premium-theme .admin-form-panel,
body.premium-theme .admin-session-panel,
body.premium-theme .report-builder-body,
body.premium-theme .bids-detail,
body.premium-theme .accounting-bet-detail {
    gap: .5rem;
    margin-bottom: .55rem;
    padding: .55rem;
}

body.premium-theme .hisab-group-path,
body.premium-theme .result-preview,
body.premium-theme .user-details-notice {
    margin-bottom: .55rem;
    padding: .5rem .6rem;
}

body.premium-theme .bids-pagination,
body.premium-theme .hisab-pagination {
    gap: .4rem;
    padding: .45rem;
}

body.premium-theme .bids-empty,
body.premium-theme .hisab-empty {
    padding: 1rem .6rem;
}

body.premium-theme .accounts-heading,
body.premium-theme .load-panel-header,
body.premium-theme .report-header,
body.premium-theme .admin-page-heading,
body.premium-theme .user-details-heading {
    margin-bottom: .45rem;
}

@media (max-width: 991px) {
    body.premium-theme .premium-sidebar {
        overflow: hidden;
    }

    body.premium-theme .premium-sidebar .premium-brand {
        min-height: 54px;
    }

    body.premium-theme .premium-sidebar .premium-sidebar-nav {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    body.premium-theme .premium-sidebar .premium-sidebar-footer {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        width: 100%;
        margin-top: auto;
    }

    body.premium-theme .premium-sidebar .premium-sidebar-footer form {
        display: block !important;
        width: 100%;
        margin: 0;
    }

    body.premium-theme .premium-sidebar .premium-sidebar-logout-btn {
        width: 100%;
        margin: 0;
    }

    body.premium-theme .premium-sidebar,
    body.premium-theme .premium-drawer-overlay {
        bottom: calc(58px + .8rem + env(safe-area-inset-bottom));
    }

    body.premium-theme .premium-main {
        padding-bottom: 64px;
    }

    body.premium-theme .premium-content {
        padding: .5rem;
    }
}

@media (max-width: 760px) {
    body.premium-theme .accounts-shell,
    body.premium-theme .user-create-shell,
    body.premium-theme .load-panel-shell,
    body.premium-theme .report-shell,
    body.premium-theme .admin-page-shell {
        margin: -.5rem;
        padding: .55rem;
    }
}
