:root {
    --bg-color: #fdfdfd;
    --dark-bg: #ffffff;
    --card-bg: #ffffff;
    --card-border: #e8ecf0;
    --accent: #2E5AAC;
    --accent-red: #D32F2F;
    --accent-blue: #2E5AAC;
    --accent-dark: #2E5AAC;
    --text-light: #ffffff;
    --text-muted: #64748b;
    --text-dark: #0f172a;
    --radius-sm: 12px;
    --radius-md: 24px;
    --radius-lg: 40px;
    --radius-full: 9999px;

    --sidebar-width: 280px;
    --sidebar-collapsed-width: 96px;
    --header-height: 80px;
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Universal scrollbar policy: keep scrolling, hide scrollbar UI */
* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

body {
    font-family: var(--font-body);
    background: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1200;
    padding: 30px 20px;
    transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    white-space: nowrap;
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}


.sidebar-logo {
    margin-bottom: 50px;
    padding: 0 0 0 35px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
}

.sidebar-logo img {
    height: 120px;
    width: auto;
    max-width: 100%;
    display: block;
}

.sidebar-logo a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(46, 90, 172, 0.1);
    color: var(--accent);
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Live Pulse Badge */
.live-pulse {
    position: relative;
}

@keyframes liveDot {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.5; transform: translateY(-50%) scale(1.3); }
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 1300;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 16px;
    background: #ffffff;
    color: var(--text-dark);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    align-items: center;
    justify-content: center;
}

.mobile-header-brand {
    display: none;
    position: fixed;
    top: 42px;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1260;
    width: auto;
    max-width: none;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0;
    text-align: center;
    pointer-events: none;
}

.mobile-header-title {
    font-family: 'Orbitron', 'Public Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.15em;
    color: #2e4b82;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    text-align: center;
    width: 100%;
}

.mobile-sidebar-close {
    display: none;
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1301;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    background: #eef3fb;
    color: var(--text-dark);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-close svg {
    width: 16px;
    height: 16px;
}

.mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 32, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1100;
}

.mobile-sidebar-backdrop[hidden] {
    display: none;
}

@media screen and (min-width: 769px) {
    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-collapsed-width);
        padding-left: 12px;
        padding-right: 12px;
    }

    body.sidebar-collapsed .sidebar-logo {
        padding-left: 0;
        justify-content: center;
    }

    body.sidebar-collapsed .sidebar-logo img {
        height: 56px;
    }

    body.sidebar-collapsed .nav-link {
        justify-content: center;
        width: 52px;
        height: 52px;
        margin: 0 auto;
        padding: 0;
        gap: 0;
        border-radius: 50%;
    }

    body.sidebar-collapsed .nav-text {
        width: 0;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
    }

    body.sidebar-collapsed .sidebar-footer {
        display: flex;
        justify-content: center;
    }

    body.sidebar-collapsed .main-content {
        margin-left: var(--sidebar-collapsed-width);
        width: calc(100% - var(--sidebar-collapsed-width));
    }
}

/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
}


.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.welcome-section {
    display: block;
}

.welcome-section h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.welcome-section p {
    color: #777;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-search {
    display: flex;
    align-items: center;
    background: white;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.03);
    width: 300px;
}

.header-search input {
    border: none;
    outline: none;
    background: transparent;
    padding-left: 10px;
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
}

.header-search svg {
    color: #999;
}

.user-profile-thumb {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 6px 10px 6px 6px;
    background: #ffffff;
    border-radius: var(--radius-full);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-profile-thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    background: #f8f9fa;
    border-color: var(--accent);
}

.avatar {
    width: 42px;
    height: 42px;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1rem;
}

.user-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(46, 90, 172, 0.08);
    color: var(--accent);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 4px;
    border: 1px solid rgba(46, 90, 172, 0.1);
    min-width: 110px;
    justify-content: center;
}

.admin-badge::before {
    content: '';
    display: block;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 4px var(--accent);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: #ffffff;
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.02);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(46, 90, 172, 0.03) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}

.stat-card:hover .stat-icon {
    transform: rotate(-10deg) scale(1.1);
}

.icon-1 {
    background: linear-gradient(135deg, rgba(46, 90, 172, 0.1) 0%, rgba(46, 90, 172, 0.2) 100%);
    color: var(--accent);
}

.icon-2 {
    background: linear-gradient(135deg, rgba(46, 90, 172, 0.1) 0%, rgba(46, 90, 172, 0.2) 100%);
    color: var(--accent-blue);
}

.icon-3 {
    background: linear-gradient(135deg, rgba(255, 162, 58, 0.1) 0%, rgba(255, 162, 58, 0.2) 100%);
    color: #ffa23a;
}

.icon-4 {
    background: linear-gradient(135deg, rgba(46, 90, 172, 0.1) 0%, rgba(46, 90, 172, 0.2) 100%);
    color: var(--accent);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 5px;
    background: linear-gradient(90deg, var(--text-dark), #666);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.9rem;
    color: #999;
    font-weight: 600;
}

/* Content Layouts */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.section-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    min-width: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.section-header p {
    max-width: 100%;
}

.bookings-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
}

.bookings-filter-summary {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #6b7280;
    font-weight: 600;
}

#booking-filter-reset {
    white-space: nowrap;
}

/* Tables */
.data-table-container {
    width: 100%;
    overflow-x: auto;
    /* enables scrolling horizontally */
    padding-bottom: 10px;
}

.data-table {
    width: 100%;
    min-width: 1200px;
    /* stops cells from squishing below this threshold */
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 15px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    border-bottom: 2px solid #f8f9fa;
}

.data-table td {
    padding: 20px 15px;
    font-size: 0.95rem;
    color: var(--text-dark);
    border-bottom: 1px solid #f8f9fa;
}

/* All Bookings table enhancements */
.bookings-table {
    min-width: 1460px;
    table-layout: fixed;
}

.bookings-table th,
.bookings-table td {
    vertical-align: middle;
}

.bookings-table thead th {
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 2;
}

.bookings-table thead .bookings-head-row th {
    top: 0;
    z-index: 3;
}

.bookings-table thead .bookings-filter-row th {
    top: 49px;
    z-index: 3;
    padding: 8px 10px;
    background: #f7f9fc;
    border-bottom: 1px solid #e7edf5;
}

.table-filter-control {
    width: 100%;
    height: 34px;
    padding: 7px 10px;
    border: 1px solid #d5deea;
    border-radius: 10px;
    background: #ffffff;
    color: #1f2a37;
    font-size: 0.78rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.table-filter-control:hover {
    border-color: #b8c8dd;
}

.table-filter-control:focus {
    border-color: #2e5aac;
    box-shadow: 0 0 0 3px rgba(46, 90, 172, 0.12);
}

/* Dropdown styling */
.table-filter-control[type="search"],
.table-filter-control[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.table-filter-control select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232e5aac' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
    padding-right: 30px;
}

.table-filter-control select option {
    color: #1f2a37;
    background: #ffffff;
    padding: 4px 8px;
}

.bookings-table .col-booking-id { width: 12%; }
.bookings-table .col-facility { width: 22%; }
.bookings-table .col-user { width: 13%; }
.bookings-table .col-datetime { width: 18%; }
.bookings-table .col-fee { width: 10%; }
.bookings-table .col-payment { width: 11%; }
.bookings-table .col-status { width: 11%; }
.bookings-table .col-actions { width: 13%; }

.bookings-table td:nth-child(2),
.bookings-table td:nth-child(3),
.bookings-table td:nth-child(4) {
    font-weight: 600;
}

.bookings-table td:nth-child(5) {
    font-weight: 700;
    color: #2f3c4d;
}

.bookings-table td:nth-child(8),
.bookings-table .booking-actions {
    white-space: nowrap;
}

.bookings-table .booking-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bookings-table .delete-booking-btn {
    background: rgba(211, 47, 47, 0.12);
    color: #d32f2f;
    border-color: rgba(211, 47, 47, 0.2);
}

.bookings-table .delete-booking-btn:hover {
    background: rgba(211, 47, 47, 0.16);
    color: #ad2424;
    border-color: rgba(211, 47, 47, 0.35);
}

.bookings-table tbody tr:hover {
    background: rgba(46, 90, 172, 0.04);
}

/* Polished module tables (users, invoices, facilities, etc.) */
.module-table {
    min-width: 1320px;
    table-layout: fixed;
}

.module-table th,
.module-table td {
    vertical-align: middle;
}

.module-table thead th {
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 2;
}

.module-table tbody tr:hover {
    background: rgba(46, 90, 172, 0.04);
}

.module-table td:last-child {
    white-space: nowrap;
}

.module-table td:last-child .action-btn + .action-btn {
    margin-left: 8px;
}

/* Invoices table column widths */
#invoices-table {
    min-width: 1560px;
}

#invoices-table thead .bookings-head-row th {
    top: 0;
    z-index: 3;
}

#invoices-table thead .bookings-filter-row th {
    top: 49px;
    z-index: 3;
    padding: 8px 10px;
    background: #f7f9fc;
    border-bottom: 1px solid #e7edf5;
}

#invoices-table thead .bookings-filter-row th input,
#invoices-table thead .bookings-filter-row th select {
    width: 100%;
    box-sizing: border-box;
}

#invoices-table th:nth-child(1),
#invoices-table td:nth-child(1) { width: 12%; }

#invoices-table th:nth-child(2),
#invoices-table td:nth-child(2) { width: 12%; }

#invoices-table th:nth-child(3),
#invoices-table td:nth-child(3) { width: 22%; }

#invoices-table th:nth-child(4),
#invoices-table td:nth-child(4) { width: 18%; }

#invoices-table th:nth-child(5),
#invoices-table td:nth-child(5) { width: 12%; }

#invoices-table th:nth-child(6),
#invoices-table td:nth-child(6) { width: 14%; }

#payments-table {
    min-width: 1760px;
}

#payments-table th:nth-child(1),
#payments-table td:nth-child(1) { width: 10%; }

#payments-table th:nth-child(2),
#payments-table td:nth-child(2) { width: 9%; }

#payments-table th:nth-child(3),
#payments-table td:nth-child(3) { width: 12%; }

#payments-table th:nth-child(4),
#payments-table td:nth-child(4) { width: 12%; }

#payments-table th:nth-child(5),
#payments-table td:nth-child(5) { width: 8%; }

#payments-table th:nth-child(6),
#payments-table td:nth-child(6) { width: 7%; }

#payments-table th:nth-child(7),
#payments-table td:nth-child(7) { width: 11%; }

#payments-table th:nth-child(8),
#payments-table td:nth-child(8) { width: 11%; }

#payments-table th:nth-child(9),
#payments-table td:nth-child(9) { width: 10%; }

#payments-table th:nth-child(10),
#payments-table td:nth-child(10) { width: 10%; }

#payments-table td:nth-child(3),
#payments-table td:nth-child(4),
#payments-table td:nth-child(8),
#payments-table td:nth-child(9),
#payments-table td:nth-child(10) {
    white-space: nowrap;
}

#payments-table thead .bookings-head-row th {
    top: 0;
    z-index: 3;
}

#payments-table thead .bookings-filter-row th {
    top: 49px;
    z-index: 3;
    padding: 8px 10px;
    background: #f7f9fc;
    border-bottom: 1px solid #e7edf5;
}

#payments-table thead .bookings-filter-row th input,
#payments-table thead .bookings-filter-row th select {
    width: 100%;
    box-sizing: border-box;
}

#zsl-table {
    min-width: 2010px;
    table-layout: auto !important;
}

#zsl-table th:nth-child(1),
#zsl-table td:nth-child(1) { min-width: 170px; }

#zsl-table th:nth-child(2),
#zsl-table td:nth-child(2) { min-width: 170px; }

#zsl-table th:nth-child(3),
#zsl-table td:nth-child(3) { min-width: 170px; }

#zsl-table th:nth-child(4),
#zsl-table td:nth-child(4) { min-width: 220px; }

#zsl-table th:nth-child(5),
#zsl-table td:nth-child(5) { min-width: 150px; }

#zsl-table th:nth-child(6),
#zsl-table td:nth-child(6) { min-width: 150px; }

#zsl-table th:nth-child(7),
#zsl-table td:nth-child(7) { min-width: 150px; }

#zsl-table th:nth-child(8),
#zsl-table td:nth-child(8) { min-width: 130px; }

#zsl-table th:nth-child(9),
#zsl-table td:nth-child(9) { min-width: 130px; }

#zsl-table th:nth-child(10),
#zsl-table td:nth-child(10) { min-width: 190px; }

#zsl-table th:nth-child(11),
#zsl-table td:nth-child(11) { min-width: 130px; }

#zsl-table td:nth-child(1),
#zsl-table td:nth-child(2),
#zsl-table td:nth-child(3),
#zsl-table td:nth-child(8),
#zsl-table td:nth-child(9),
#zsl-table td:nth-child(10),
#zsl-table td:nth-child(11) {
    white-space: nowrap;
}

#invoices-table th:nth-child(7),
#invoices-table td:nth-child(7) { width: 10%; }

#invoices-table th:nth-child(8),
#invoices-table td:nth-child(8) { width: 12%; }

/* Registered users table column widths */
#users-table {
    min-width: 2360px;
    table-layout: auto !important;
}

#users-table thead .bookings-head-row th {
    top: 0;
    z-index: 3;
}

#users-table thead .bookings-filter-row th {
    top: 49px;
    z-index: 3;
    padding: 8px 10px;
    background: #f7f9fc;
    border-bottom: 1px solid #e7edf5;
}

#users-table th:nth-child(1),
#users-table td:nth-child(1) { min-width: 120px; }

#users-table th:nth-child(2),
#users-table td:nth-child(2) { min-width: 220px; }

#users-table th:nth-child(3),
#users-table td:nth-child(3) { min-width: 320px; }

#users-table th:nth-child(4),
#users-table td:nth-child(4) { min-width: 190px; }

#users-table th:nth-child(5),
#users-table td:nth-child(5) { min-width: 210px; }

#users-table th:nth-child(6),
#users-table td:nth-child(6) { min-width: 290px; }

#users-table th:nth-child(7),
#users-table td:nth-child(7) { min-width: 300px; }

#users-table th:nth-child(8),
#users-table td:nth-child(8) { min-width: 150px; }

#users-table th:nth-child(9),
#users-table td:nth-child(9) { min-width: 190px; }

#users-table td:nth-child(3),
#users-table td:nth-child(4),
#users-table td:nth-child(5),
#users-table td:nth-child(6),
#users-table td:nth-child(7),
#users-table td:nth-child(8),
#users-table td:nth-child(9) {
    white-space: nowrap;
}

/* Admin users table width tuning */
.admin-users-table {
    min-width: 1600px;
    table-layout: auto !important;
}

.admin-users-table td:nth-child(1),
.admin-users-table td:nth-child(3),
.admin-users-table td:nth-child(5),
.admin-users-table td:nth-child(7) {
    white-space: nowrap;
}

.admin-users-table th:nth-child(1), .admin-users-table td:nth-child(1) { min-width: 140px; }
.admin-users-table th:nth-child(2), .admin-users-table td:nth-child(2) { min-width: 200px; }
.admin-users-table th:nth-child(3), .admin-users-table td:nth-child(3) { min-width: 360px; }
.admin-users-table th:nth-child(4), .admin-users-table td:nth-child(4) { min-width: 180px; }
.admin-users-table th:nth-child(5), .admin-users-table td:nth-child(5) { min-width: 220px; }
.admin-users-table th:nth-child(6), .admin-users-table td:nth-child(6) { min-width: 120px; }
.admin-users-table th:nth-child(7), .admin-users-table td:nth-child(7) { min-width: 130px; }

.admin-users-table .admin-email-cell {
    padding-right: 30px;
}

.admin-users-table .admin-email-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-users-table .admin-role-cell {
    padding-left: 18px;
}

.admin-users-table .admin-role-cell .admin-badge {
    margin-top: 0;
}

/* User roles table width tuning */
#roles-table {
    min-width: 1280px;
}

#roles-table th:nth-child(1),
#roles-table td:nth-child(1) { width: 16%; }

#roles-table th:nth-child(2),
#roles-table td:nth-child(2) { width: 24%; }

#roles-table th:nth-child(3),
#roles-table td:nth-child(3) { width: 34%; }

#roles-table th:nth-child(4),
#roles-table td:nth-child(4) { width: 10%; }

#roles-table th:nth-child(5),
#roles-table td:nth-child(5) { width: 16%; }

#roles-table .roles-description-cell {
    color: #334155;
    font-weight: 500;
}

#roles-table .roles-permissions-cell {
    font-size: 0.85rem;
    color: #475569;
}

#roles-table .roles-permissions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#roles-table .permission-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid rgba(46, 90, 172, 0.18);
    background: rgba(46, 90, 172, 0.08);
    color: #1e3a6f;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: capitalize;
    line-height: 1.2;
}

#roles-table .permission-chip-more {
    border-color: rgba(15, 23, 42, 0.15);
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
}

#roles-table .permission-chip-all {
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

#roles-table .roles-no-permissions {
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 600;
}

#roles-table .roles-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#roles-table .roles-system-lock {
    color: #94a3b8;
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.id-text {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    color: var(--accent-blue);
}

.status-badge {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.status-active,
.status-completed {
    background: rgba(46, 90, 172, 0.1);
    color: var(--accent);
}

.status-pending {
    background: rgba(255, 162, 58, 0.1);
    color: #ffa23a;
}

.status-cancelled,
.status-inactive {
    background: rgba(211, 47, 47, 0.1);
    color: var(--accent-red);
}

.status-suspended {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

/* Activity List Enhanced */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: var(--radius-md);
    background: #fcfdfe;
    border: 1px solid rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: #ffffff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    transform: translateX(5px);
}

.act-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-dark);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.act-details h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--text-dark);
}

.act-details p {
    font-size: 0.85rem;
    color: #666;
}

.act-time {
    margin-left: auto;
    font-size: 0.75rem;
    color: #bbb;
    font-weight: 600;
    background: #f8f9fa;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

/* Professional Charts & Visuals */
.chart-container {
    height: 240px;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 8px;
    padding: 16px 10px 10px 10px;
    background: linear-gradient(to bottom, #ffffff 0%, #fcfdfe 100%);
    border-radius: var(--radius-md);
    position: relative;
    border: 1px solid rgba(0,0,0,0.02);
}

/* Add subtle horizontal grid lines */
.chart-container::before {
    content: '';
    position: absolute;
    top: 16px; bottom: 34px; left: 10px; right: 10px;
    background-image: linear-gradient(transparent 95%, rgba(0,0,0,0.03) 95%);
    background-size: 100% 25%;
    pointer-events: none;
}

.revenue-line-svg {
    width: 100%;
    height: 190px;
    z-index: 1;
}

.revenue-line-labels {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: center;
    text-align: center;
    z-index: 1;
}

.revenue-point {
    fill: #ffffff;
    stroke: var(--accent);
    stroke-width: 2.5;
}

.revenue-point-value {
    font-size: 10px;
    font-weight: 800;
    fill: #4a4a4a;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 1;
}

.chart-bar {
    width: 32px; /* Increased from flex-basis */
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-radius: 8px 8px 4px 4px; /* More rounded */
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    height: 0;
    box-shadow: 0 4px 10px rgba(46, 90, 172, 0.2);
    cursor: pointer;
}

.chart-bar:hover {
    filter: brightness(1.1);
    transform: scaleX(1.1);
    box-shadow: 0 8px 20px rgba(46, 90, 172, 0.3);
}

/* Value labels on top of bars */
.chart-bar .value-tag {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-dark);
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.05);
    white-space: nowrap;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    opacity: 0.9;
    pointer-events: none;
}

.chart-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* Views Handling */
.admin-view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view-active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn-primary {
    background: var(--accent);
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f0f4f8;
    color: var(--text-dark);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #e1e7ed;
}

/* Enhanced Action Buttons */
.action-btn {
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.action-btn:hover {
    background: #ffffff;
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(46, 90, 172, 0.15);
    transform: translateY(-1px);
}

.action-btn.delete:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.15);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #64748b;
    border: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.btn-icon:hover {
    background: #ffffff;
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 20px rgba(46, 90, 172, 0.15);
}

.btn-icon.delete-fac:hover {
    color: var(--accent-red);
    border-color: var(--accent-red);
    box-shadow: 0 8px 20px rgba(211, 47, 47, 0.15);
}

.admin-role-preview {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    min-height: 46px;
    font-size: 0.8rem;
    color: #475569;
}

.admin-role-preview-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 700;
}

.admin-role-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-role-preview-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    border: 1px solid rgba(46, 90, 172, 0.18);
    background: rgba(46, 90, 172, 0.08);
    color: #1e3a6f;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: capitalize;
    line-height: 1.2;
}

.admin-role-preview-empty {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    background: #f8f9fa;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.modal-header h3 {
    font-weight: 800;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--accent-red);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex-grow: 1;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(46, 90, 172, 0.1);
}

/* Remove native spinner controls on number fields. */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

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

.password-field-wrap .form-control {
    padding-right: 44px;
}

.admin-password-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.admin-password-toggle:hover {
    color: #2e5aac;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #eee;
    transition: .4s;
    border: 1px solid #e0e0e0;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Print Invoice Styles */
@media print {
    body * {
        visibility: hidden;
    }
    #invoice-print-area, #invoice-print-area * {
        visibility: visible;
    }
    #invoice-print-area {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .modal-overlay {
        background: none !important;
        backdrop-filter: none !important;
        position: absolute !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    .modal-content {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: none !important;
        transform: none !important;
        margin: 0 !important;
    }
    .no-print, .modal-header, .sidebar, .dashboard-header {
        display: none !important;
    }
    .invoice-container {
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Calendar View Styles */
#calendar-view {
    height: calc(100dvh - 160px);
}

@supports not (height: 100dvh) {
    #calendar-view {
        height: calc(100vh - 160px);
    }
}

.calendar-wrapper {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 460px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.calendar-nav h2 {
    font-size: 1.5rem;
    font-weight: 800;
    min-width: 250px;
    text-align: center;
}

.calendar-filters {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.65));
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#cal-sport-filter {
    width: 220px !important;
    min-width: 140px;
    border-radius: 12px;
    border: 1px solid rgba(46, 90, 172, 0.26);
    background-color: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    font-weight: 700;
    padding: 10px 38px 10px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23546a2d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    transition: all 0.2s ease;
}

#cal-sport-filter:hover {
    border-color: rgba(46, 90, 172, 0.55);
    background-color: #ffffff;
}

#cal-sport-filter:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(46, 90, 172, 0.14);
}

#cal-fullscreen-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
}

#cal-fullscreen-btn svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

/* Ensure calendar fills the viewport properly when opened in browser fullscreen */
#calendar-view:fullscreen,
#calendar-view:-webkit-full-screen,
#calendar-view:-moz-full-screen,
#calendar-view:-ms-fullscreen {
    width: 100vw;
    height: 100dvh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: #f8fafc;
    overflow: hidden;
}

@supports not (height: 100dvh) {
    #calendar-view:fullscreen,
    #calendar-view:-webkit-full-screen,
    #calendar-view:-moz-full-screen,
    #calendar-view:-ms-fullscreen {
        height: 100vh;
    }
}

#calendar-view:fullscreen .calendar-wrapper,
#calendar-view:-webkit-full-screen .calendar-wrapper,
#calendar-view:-moz-full-screen .calendar-wrapper,
#calendar-view:-ms-fullscreen .calendar-wrapper {
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    max-height: none;
}

@supports not (height: 100dvh) {
    #calendar-view:fullscreen .calendar-wrapper,
    #calendar-view:-webkit-full-screen .calendar-wrapper,
    #calendar-view:-moz-full-screen .calendar-wrapper,
    #calendar-view:-ms-fullscreen .calendar-wrapper {
        height: calc(100vh - 24px);
    }
}

.calendar-grid-container {
    flex-grow: 1;
    overflow: hidden;
    border: 1px solid #f0f2f5;
    border-radius: var(--radius-md);
    position: relative;
    background: #f8f9fa;
}

.calendar-body-scroll {
    width: 100%;
    height: 100%;
    overflow: auto;
    background: #ffffff;
    scroll-behavior: smooth;
    position: relative;
}

.calendar-body-grid {
    display: flex;
    flex-direction: column;
    min-width: fit-content;
}

.calendar-sticky-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 400;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid #eee;
}

.time-corner {
    width: 80px;
    flex-shrink: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.92);
    border-right: 1px solid #eee;
    position: sticky;
    left: 0;
    z-index: 450;
}

.court-headers {
    display: flex;
    flex: 0 0 auto;
}

.court-header {
    flex: 0 0 200px;
    min-width: 200px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #eee;
    background: rgba(255, 255, 255, 0.66);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.court-header .court-name {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.court-header .sport-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
}

.calendar-rows-wrapper {
    display: flex;
    position: relative;
}

.calendar-timeline {
    width: 80px;
    flex-shrink: 0;
    background: #f8f9fa;
    border-right: 1px solid #eee;
    position: sticky;
    left: 0;
    z-index: 50;
}

.time-slot-label {
    height: 80px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #666;
    border-bottom: 1px solid #f0f0f0;
}

.grid-content {
    flex: 0 0 auto;
    position: relative;
    background-image: 
        linear-gradient(to right, #f0f0f0 1px, transparent 1px),
        linear-gradient(to bottom, #f0f0f0 1px, transparent 1px);
    background-size: 200px 100%, 100% 80px; /* 200px matches court-header min-width */
    min-height: 1920px; /* 24 hrs * 80px */
}

.booking-card {
    position: absolute;
    z-index: 40;
    padding: 10px 14px 24px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 5px solid var(--accent);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    background: #ffffff;
    margin: 2px;
}

.booking-card:hover {
    transform: scale(1.02);
    z-index: 60;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.booking-card .booking-name {
    font-weight: 800;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.booking-card .booking-time {
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
}

.booking-card .calendar-payment-label {
    display: inline-flex;
    align-items: center;
    position: absolute;
    right: 8px;
    bottom: 6px;
    margin-top: 0;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1;
}

.booking-card .calendar-payment-label.unpaid {
    color: #8a2f12;
    background: #ffe7dd;
    border: 1px solid #ffc7b2;
}

.booking-card.sport-padel { border-left-color: var(--accent); background: rgba(46, 90, 172, 0.15); }
.booking-card.sport-football { border-left-color: var(--accent-blue); background: rgba(46, 90, 172, 0.15); }
.booking-card.sport-pickleball { border-left-color: #ffa23a; background: rgba(255, 162, 58, 0.15); }

.pin-badge {
    background: #f0f2f5;
    color: var(--text-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    font-size: 0.85rem;
    border: 1px solid #ddd;
}

@media screen and (max-width: 768px) {
    body::before {
        content: '';
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        height: 64px;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.55);
        border: 1px solid rgba(255, 255, 255, 0.65);
        box-shadow: 0 10px 30px rgba(13, 24, 39, 0.1);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 1240;
        pointer-events: none;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open::before {
        z-index: 1000;
    }

    body.sidebar-open .mobile-menu-toggle {
        opacity: 0;
        pointer-events: none;
    }

    body.sidebar-open .dashboard-header {
        z-index: 1000;
        pointer-events: none;
    }

    body.sidebar-open .mobile-header-brand {
        z-index: 1000;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .mobile-header-brand {
        display: inline-flex;
    }

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

    .sidebar {
        width: 66.666vw;
        max-width: 420px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
        box-shadow: 20px 0 40px rgba(0, 0, 0, 0.12);
    }

    .sidebar-logo {
        padding-left: 0;
        padding-top: 0;
        justify-content: center;
        margin-bottom: 36px;
    }

    .sidebar-logo a {
        width: 100%;
    }

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

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 88px 16px 24px;
    }

    .dashboard-header {
        position: fixed;
        top: 18px;
        right: 18px;
        z-index: 1250;
        margin: 0;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
        border-radius: 0;
    }

    .header-left,
    .header-actions,
    .user-profile-thumb {
        width: auto;
    }

    .header-left,
    .user-meta {
        display: none;
    }

    .welcome-section {
        display: none;
    }

    .header-actions {
        display: block;
    }

    .user-profile-thumb {
        width: 48px;
        height: 48px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    }

    .avatar {
        width: 48px;
        height: 48px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        min-width: 0;
    }

    .stat-card,
    .section-card {
        padding: 20px;
        border-radius: 28px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-header .form-control,
    .section-header .btn-secondary,
    .section-header .btn-primary {
        width: 100% !important;
    }

    .bookings-header-actions {
        width: 100%;
    }

    #booking-filter-reset {
        width: 100%;
    }

    .bookings-table thead .bookings-filter-row th {
        top: 48px;
    }


    .chart-container {
        padding: 16px 8px 8px;
        overflow-x: auto;
    }

    .revenue-line-svg {
        min-width: 520px;
    }

    .data-table {
        min-width: 720px;
    }

    .bookings-table {
        min-width: 1200px;
    }

    .module-table {
        min-width: 1100px;
    }

    .data-table-container {
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #calendar-view { height: calc(100dvh - 130px); }
    .calendar-wrapper { padding: 15px; min-height: 380px; }
    .calendar-header { gap: 10px; }
    .calendar-nav { width: 100%; gap: 10px; }
    .calendar-nav h2 { font-size: 1rem; min-width: 0; width: 100%; text-align: left; order: 4; }
    .calendar-filters { width: 100%; }
    #cal-sport-filter { width: auto !important; flex: 1 1 220px; min-width: 0; }
    #cal-fullscreen-btn { width: 44px; flex: 0 0 44px; }
    .time-corner, .calendar-timeline { width: 60px; }
}

@media screen and (max-width: 480px) {
    .sidebar {
        padding: 24px 16px;
    }

    .sidebar-logo {
        justify-content: center;
        margin-bottom: 32px;
    }

    .sidebar-logo img {
        height: 92px;
    }

    .nav-link {
        padding: 11px 12px;
        gap: 12px;
        font-size: 0.92rem;
    }

    .main-content {
        padding: 84px 12px 20px;
    }

    .dashboard-header {
        margin-bottom: 24px;
    }

    .stats-grid {
        gap: 14px;
        margin-bottom: 24px;
    }

    #calendar-view { height: calc(100dvh - 118px); }

    .calendar-wrapper {
        padding: 12px;
        min-height: 320px;
    }

    .calendar-nav {
        gap: 8px;
    }

    .calendar-nav .btn-secondary,
    .calendar-nav .btn-primary {
        padding: 9px 12px;
    }

    .calendar-filters {
        width: 100%;
        gap: 6px;
        padding: 3px;
        flex-wrap: nowrap;
    }

    #cal-sport-filter {
        flex: 1 1 auto;
        width: auto !important;
        min-width: 0;
    }

    #cal-fullscreen-btn {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
    }

    .content-grid {
        gap: 14px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .activity-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .act-time {
        margin-left: 0;
    }

    .chart-container {
        height: 220px;
    }

    .revenue-line-svg {
        height: 175px;
    }
}