/* ==========================================================================
   SharvayaGym - Commercial Gym Management System UI
   Modern, athletic, responsive, and production-ready design architecture
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Brand Colors - Athletic Red / Crimson */
    --gym-primary: #e63946;
    --gym-primary-hover: #d62828;
    --gym-primary-light: rgba(230, 57, 70, 0.08);
    --gym-primary-glow: rgba(230, 57, 70, 0.25);

    /* Gym Surface / Dark Architecture */
    --gym-dark-950: #090d16;
    --gym-dark-900: #0f172a;
    --gym-dark-800: #1e293b;
    --gym-dark-700: #334155;
    
    /* Semantic Status Accents */
    --gym-success: #10b981;
    --gym-success-bg: rgba(16, 185, 129, 0.1);
    --gym-warning: #f59e0b;
    --gym-warning-bg: rgba(245, 158, 11, 0.1);
    --gym-danger: #ef4444;
    --gym-danger-bg: rgba(239, 68, 68, 0.1);
    --gym-info: #0284c7;
    --gym-info-bg: rgba(2, 132, 199, 0.1);
    --gym-purple: #8b5cf6;
    --gym-purple-bg: rgba(139, 92, 246, 0.1);

    /* Clean Body & Card Surfaces */
    --gym-bg: #f8fafc;
    --gym-card: #ffffff;
    --gym-surface-2: #f1f5f9;
    --gym-input-bg: #ffffff;
    --gym-border: #e2e8f0;
    --gym-border-light: #f1f5f9;
    --gym-text-main: #0f172a;
    --gym-text-muted: #64748b;
    --gym-text-light: #94a3b8;

    /* Shadows */
    --gym-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --gym-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --gym-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --gym-shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);

    /* Dimensions */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 68px;
    --header-height: 64px;
}

/* ==========================================================================
   Multi-Palette Coordinated 5-Color Theme Engine (data-palette)
   Exact Designer 5-Color Palettes (--color-1 to --color-5)
   ========================================================================== */
/* 1. Gold & Obsidian */
html[data-palette="gold"] {
    --color-1: #F2F2F2;
    --color-2: #FFD60A;
    --color-3: #FFC300;
    --color-4: #2B2B2B;
    --color-5: #0D0D0D;

    --gym-primary: #FFC300;
    --gym-primary-hover: #e6b000;
    --gym-primary-light: rgba(255, 195, 0, 0.12);
    --gym-primary-glow: rgba(255, 195, 0, 0.32);
    --gym-secondary: #FFD60A;
    --gym-secondary-light: rgba(255, 214, 10, 0.14);
}

/* 2. Crimson Sport (MAIN / DEFAULT - Athletic Red) */
html[data-palette="crimson"] {
    --color-1: #EDEDED;
    --color-2: #E63946;
    --color-3: #B71C2B;
    --color-4: #3D3D3D;
    --color-5: #1A1A1A;

    --gym-primary: #E63946;
    --gym-primary-hover: #B71C2B;
    --gym-primary-light: rgba(230, 57, 70, 0.1);
    --gym-primary-glow: rgba(230, 57, 70, 0.28);
    --gym-secondary: #B71C2B;
    --gym-secondary-light: rgba(183, 28, 43, 0.12);
}

/* 3. Sunset Flame */
html[data-palette="flame"] {
    --color-1: #FFF3E6;
    --color-2: #FF9F1C;
    --color-3: #FF6B00;
    --color-4: #2E2E2E;
    --color-5: #121212;

    --gym-primary: #FF6B00;
    --gym-primary-hover: #e66000;
    --gym-primary-light: rgba(255, 107, 0, 0.12);
    --gym-primary-glow: rgba(255, 107, 0, 0.32);
    --gym-secondary: #FF9F1C;
    --gym-secondary-light: rgba(255, 159, 28, 0.14);
}

/* 4. Royal Cobalt */
html[data-palette="cobalt"] {
    --color-1: #EAF0FF;
    --color-2: #4D7CFE;
    --color-3: #1F4FE0;
    --color-4: #1B2340;
    --color-5: #0B0F1E;

    --gym-primary: #4D7CFE;
    --gym-primary-hover: #1F4FE0;
    --gym-primary-light: rgba(77, 124, 254, 0.12);
    --gym-primary-glow: rgba(77, 124, 254, 0.3);
    --gym-secondary: #1F4FE0;
    --gym-secondary-light: rgba(31, 79, 224, 0.14);
}

/* 5. Volt Lime */
html[data-palette="volt"] {
    --color-1: #F4F6F0;
    --color-2: #C6F432;
    --color-3: #8FD400;
    --color-4: #4B4F54;
    --color-5: #1F2226;

    --gym-primary: #8FD400;
    --gym-primary-hover: #7bb800;
    --gym-primary-light: rgba(143, 212, 0, 0.14);
    --gym-primary-glow: rgba(143, 212, 0, 0.34);
    --gym-secondary: #C6F432;
    --gym-secondary-light: rgba(198, 244, 50, 0.16);
}

/* 6. Earthy Sage */
html[data-palette="sage"] {
    --color-1: #F7F3EC;
    --color-2: #E8DECF;
    --color-3: #C8B8A2;
    --color-4: #A3B49A;
    --color-5: #6B7C66;

    --gym-primary: #6B7C66;
    --gym-primary-hover: #556351;
    --gym-primary-light: rgba(107, 124, 102, 0.12);
    --gym-primary-glow: rgba(107, 124, 102, 0.28);
    --gym-secondary: #A3B49A;
    --gym-secondary-light: rgba(163, 180, 154, 0.14);
}

/* 7. Ocean Aqua */
html[data-palette="aqua"] {
    --color-1: #FFFFFF;
    --color-2: #DFF6F7;
    --color-3: #7AD7DC;
    --color-4: #1BA8B4;
    --color-5: #0E5F6B;

    --gym-primary: #1BA8B4;
    --gym-primary-hover: #0E5F6B;
    --gym-primary-light: rgba(27, 168, 180, 0.12);
    --gym-primary-glow: rgba(27, 168, 180, 0.3);
    --gym-secondary: #7AD7DC;
    --gym-secondary-light: rgba(122, 215, 220, 0.16);
}

/* 8. Neon Magenta */
html[data-palette="magenta"] {
    --color-1: #FCE7F3;
    --color-2: #F472B6;
    --color-3: #C026D3;
    --color-4: #6D28D9;
    --color-5: #2E1065;

    --gym-primary: #C026D3;
    --gym-primary-hover: #6D28D9;
    --gym-primary-light: rgba(192, 38, 211, 0.12);
    --gym-primary-glow: rgba(192, 38, 211, 0.32);
    --gym-secondary: #F472B6;
    --gym-secondary-light: rgba(244, 114, 182, 0.16);
}

/* 9. Industrial Steel */
html[data-palette="industrial"] {
    --color-1: #D9D9D6;
    --color-2: #A6A6A0;
    --color-3: #F26B1D;
    --color-4: #4A4A46;
    --color-5: #22221F;

    --gym-primary: #F26B1D;
    --gym-primary-hover: #d85a12;
    --gym-primary-light: rgba(242, 107, 29, 0.12);
    --gym-primary-glow: rgba(242, 107, 29, 0.32);
    --gym-secondary: #A6A6A0;
    --gym-secondary-light: rgba(166, 166, 160, 0.14);
}

/* 10. Crimson Navy */
html[data-palette="crimsonnavy"] {
    --color-1: #FFFFFF;
    --color-2: #D90429;
    --color-3: #8D99AE;
    --color-4: #2B2D42;
    --color-5: #0B0C10;

    --gym-primary: #D90429;
    --gym-primary-hover: #b80323;
    --gym-primary-light: rgba(217, 4, 41, 0.12);
    --gym-primary-glow: rgba(217, 4, 41, 0.32);
    --gym-secondary: #2B2D42;
    --gym-secondary-light: rgba(43, 45, 66, 0.12);
}

/* 11. Cyber Ice */
html[data-palette="cyberice"] {
    --color-1: #E6FAFD;
    --color-2: #4CC9F0;
    --color-3: #1F7AE0;
    --color-4: #1B2A4A;
    --color-5: #0E1626;

    --gym-primary: #1F7AE0;
    --gym-primary-hover: #1562b8;
    --gym-primary-light: rgba(31, 122, 224, 0.12);
    --gym-primary-glow: rgba(31, 122, 224, 0.3);
    --gym-secondary: #4CC9F0;
    --gym-secondary-light: rgba(76, 201, 240, 0.16);
}

/* 12. Forest Evergreen */
html[data-palette="evergreen"] {
    --color-1: #F4F0E6;
    --color-2: #D8CFBA;
    --color-3: #7A9A6B;
    --color-4: #2F5D45;
    --color-5: #1A3328;

    --gym-primary: #2F5D45;
    --gym-primary-hover: #1A3328;
    --gym-primary-light: rgba(47, 93, 69, 0.14);
    --gym-primary-glow: rgba(47, 93, 69, 0.32);
    --gym-secondary: #7A9A6B;
    --gym-secondary-light: rgba(122, 154, 107, 0.16);
}

/* Sidebar Appearance Modes: Dark Carbon uses the palette's deep dark colors */
html[data-sidebar="dark"]:not([data-theme="dark"]) .sidebar {
    background: linear-gradient(180deg, var(--color-5, #090d16) 0%, var(--color-4, #1e293b) 100%) !important;
    color: #e2e8f0 !important;
    border-right: 1px solid var(--color-4, #1e293b) !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25) !important;
}

html[data-sidebar="dark"]:not([data-theme="dark"]) .sidebar .sidebar-brand {
    background: rgba(0, 0, 0, 0.35) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

html[data-sidebar="dark"]:not([data-theme="dark"]) .sidebar .menu-category-btn {
    color: #cbd5e1 !important;
}

html[data-sidebar="dark"]:not([data-theme="dark"]) .sidebar .menu-category-btn:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
}

html[data-sidebar="dark"]:not([data-theme="dark"]) .sidebar .menu-category-btn.active {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

html[data-sidebar="dark"]:not([data-theme="dark"]) .sidebar .submenu-collapse {
    background: rgba(0, 0, 0, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-sidebar="dark"]:not([data-theme="dark"]) .sidebar .submenu-item {
    color: #94a3b8 !important;
}

html[data-sidebar="dark"]:not([data-theme="dark"]) .sidebar .submenu-item:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.07) !important;
}

html[data-sidebar="dark"]:not([data-theme="dark"]) .sidebar .submenu-item.active {
    color: #ffffff !important;
    background: var(--gym-primary) !important;
    border-left: 3px solid #ffffff !important;
    box-shadow: 0 4px 14px var(--gym-primary-glow) !important;
}

html[data-sidebar="light"]:not([data-theme="dark"]) .sidebar {
    background: #ffffff !important;
    color: #1e293b !important;
    border-right: 1px solid var(--gym-border) !important;
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.04) !important;
}

html[data-sidebar="light"]:not([data-theme="dark"]) .sidebar .sidebar-brand {
    background: #ffffff !important;
    border-bottom: 1px solid var(--gym-border) !important;
}

html[data-sidebar="light"]:not([data-theme="dark"]) .sidebar .submenu-item.active {
    color: var(--gym-primary) !important;
    background: var(--gym-primary-light) !important;
    border-left: 3px solid var(--gym-primary) !important;
    font-weight: 700 !important;
}

html[data-sidebar="brand"]:not([data-theme="dark"]) .sidebar {
    background: linear-gradient(165deg, var(--gym-primary-light) 0%, #ffffff 50%, var(--gym-primary-light) 100%) !important;
    border-right: 1px solid var(--gym-border) !important;
}

html[data-sidebar="brand"]:not([data-theme="dark"]) .sidebar .sidebar-brand {
    background: linear-gradient(135deg, var(--gym-primary-light) 0%, #ffffff 100%) !important;
    border-bottom: 1px solid var(--gym-border) !important;
}

/* Border Radius Density */
html[data-radius="compact"] {
    --gym-radius: 6px;
    --bs-border-radius: 6px;
    --bs-border-radius-sm: 4px;
    --bs-border-radius-lg: 8px;
}
html[data-radius="rounded"] {
    --gym-radius: 12px;
    --bs-border-radius: 12px;
    --bs-border-radius-sm: 8px;
    --bs-border-radius-lg: 14px;
}
html[data-radius="curved"] {
    --gym-radius: 18px;
    --bs-border-radius: 18px;
    --bs-border-radius-sm: 10px;
    --bs-border-radius-lg: 20px;
}

/* Base Reset & Typography */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Modal active scroll lock: prevent background page scroll */
html:has(body.modal-open),
body.modal-open {
    overflow: hidden !important;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--gym-bg);
    color: var(--gym-text-main);
    min-height: 100vh;
    margin: 0;
    line-height: 1.5;
    transition: background-color 0.2s ease, color 0.2s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   Sidebar Navigation (Desktop, Collapsed & Mobile Off-Canvas)
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(165deg, var(--gym-primary-light) 0%, #ffffff 55%, var(--gym-primary-light) 100%);
    min-height: 100vh;
    height: 100vh;
    height: 100dvh;
    color: #1e293b;
    border-right: 1px solid var(--gym-border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1055;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 4px 0 20px rgba(15, 23, 42, 0.06);
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    overflow: visible !important;
}

/* Brand Header */
.sidebar-brand {
    height: var(--header-height);
    flex-shrink: 0;
    padding: 0 0.85rem 0 1.15rem;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #0f172a;
    border-bottom: 1px solid #fecdd3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    white-space: nowrap;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe4e6 100%);
}

.sidebar-brand-inner {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--gym-primary) 0%, #b91c1c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.35);
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 1.15rem;
    font-weight: 800;
}

.sidebar-brand-text span {
    color: var(--gym-primary);
}

.sidebar.collapsed .sidebar-brand {
    padding: 0;
    justify-content: center;
}

.sidebar.collapsed .sidebar-brand-inner,
.sidebar.collapsed .sidebar-brand-text {
    display: none;
}

.sidebar-toggle-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #fecdd3;
    color: #334155;
    font-size: 0.95rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-toggle-btn:hover {
    background-color: var(--gym-primary);
    color: #ffffff;
    border-color: var(--gym-primary);
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.25);
}

.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 1.25rem;
    padding: 0.25rem;
    cursor: pointer;
}

.sidebar-close-btn:hover {
    color: #0f172a;
}

/* Menu Category Groups */
.sidebar-menu-wrapper {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 0.6rem 1.5rem;
}

.menu-category-group {
    margin-bottom: 0.35rem;
    position: relative;
}

.menu-category-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: #1e293b;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.menu-category-btn:hover {
    background-color: rgba(230, 57, 70, 0.08);
    color: #0f172a;
}

.menu-category-btn.active {
    color: #b91c1c;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.1);
}

.menu-category-btn .menu-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.menu-category-btn .menu-icon {
    width: 22px;
    min-width: 22px;
    text-align: center;
    font-size: 1rem;
    color: #64748b;
    transition: color 0.15s ease;
}

.menu-category-btn:hover .menu-icon,
.menu-category-btn.active .menu-icon {
    color: var(--gym-primary);
}

.menu-category-btn .arrow {
    font-size: 0.75rem;
    color: #64748b;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-category-btn.expanded .arrow {
    transform: rotate(90deg);
    color: var(--gym-primary);
}

/* Submenu collapse */
.submenu-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(230, 57, 70, 0.1);
    border-radius: 8px;
    margin: 0.25rem 0;
}

.submenu-collapse.show {
    max-height: 2000px;
}

.submenu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem 0.6rem 2.5rem;
    color: #334155;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 500;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    margin: 0.15rem 0;
    border-left: 3px solid transparent;
}

.submenu-item:hover {
    color: #0f172a;
    background: rgba(230, 57, 70, 0.08);
}

.submenu-item.active {
    color: #b91c1c;
    background: #ffe4e6;
    font-weight: 700;
    border-left: 3px solid var(--gym-primary);
    padding-left: calc(2.5rem - 3px);
}

.submenu-item .child-icon {
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
}

.submenu-item.active .child-icon {
    color: var(--gym-primary) !important;
}

/* Collapsed Sidebar Mode (Icons Only) */
.sidebar.collapsed .menu-category-btn {
    padding: 0.75rem 0;
    justify-content: center;
    border-radius: 10px;
    margin: 0.25rem auto;
    width: 44px;
    height: 44px;
}

.sidebar.collapsed .menu-category-btn:hover {
    background-color: rgba(230, 57, 70, 0.08);
    color: var(--gym-primary);
}

.sidebar.collapsed .menu-category-btn.active {
    background-color: #ffe4e6;
    color: var(--gym-primary);
    box-shadow: 0 2px 10px rgba(230, 57, 70, 0.2);
}

.sidebar.collapsed .menu-category-btn.active .menu-icon {
    color: var(--gym-primary);
}

.sidebar.collapsed .menu-category-btn .menu-item-content {
    justify-content: center;
    gap: 0;
    width: 100%;
}

.sidebar.collapsed .menu-category-btn .menu-text,
.sidebar.collapsed .menu-category-btn .arrow,
.sidebar.collapsed .submenu-collapse {
    display: none !important;
}

.sidebar.collapsed .menu-category-btn .menu-icon {
    font-size: 1.25rem;
    width: 100%;
}

/* Floating Submenu Panel (Hover Flyout in Collapsed Mode) */
.floating-submenu-panel {
    position: fixed;
    z-index: 99999;
    width: 230px;
    background: #ffffff;
    border: 1px solid #fecdd3;
    border-radius: 10px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    animation: floatingFlyoutIn 0.16s ease-out;
}

@keyframes floatingFlyoutIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.floating-submenu-header {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe4e6 100%);
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 10px 14px;
    border-bottom: 1px solid #fecdd3;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.floating-submenu-header i {
    color: var(--gym-primary);
}

.floating-submenu-list {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 0.35rem 0;
}

.floating-submenu-list a {
    color: #334155;
    text-decoration: none;
    padding: 9px 15px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    border-left: 3px solid transparent;
}

.floating-submenu-list a:hover {
    background: rgba(230, 57, 70, 0.08);
    color: #0f172a;
}

.floating-submenu-list a.active {
    background: #ffe4e6;
    color: #b91c1c;
    font-weight: 700;
    border-left: 3px solid var(--gym-primary);
    padding-left: 12px;
}

.floating-submenu-list a .child-icon {
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
}

.floating-submenu-list a.active .child-icon {
    color: var(--gym-primary) !important;
}

/* Mobile Backdrop Overlay */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.22s ease-in-out;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

/* ==========================================================================
   Main Content Layout Architecture
   ========================================================================== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    transition: margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1), width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Sticky Top Navbar */
.top-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--gym-border);
    min-height: var(--header-height);
    padding: 0.45rem 1.75rem;
    gap: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
}

.btn-toggle-menu {
    background: #f1f5f9;
    border: 1px solid var(--gym-border);
    color: #334155;
    font-size: 1.1rem;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-toggle-menu:hover {
    background-color: var(--gym-primary);
    color: #ffffff;
    border-color: var(--gym-primary);
}

/* Top Navbar Badges */
.gym-brand-pill {
    background: rgba(230, 57, 70, 0.08);
    color: var(--gym-primary);
    border: 1px solid rgba(230, 57, 70, 0.2);
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.fy-pill {
    background: #f8fafc;
    color: #475569;
    border: 1px solid var(--gym-border);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* User Badge Pill */
.user-badge {
    background-color: #f8fafc;
    padding: 0.3rem 0.85rem 0.3rem 0.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    border: 1px solid var(--gym-border);
}

.user-badge-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gym-primary) 0%, #b91c1c 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.role-pill {
    font-size: 0.68rem;
    background-color: var(--gym-primary);
    color: #ffffff;
    padding: 0.15rem 0.55rem;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.4px;
}

/* Page Content Container */
.content-container {
    padding: 1.75rem 2rem;
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.content-container > *,
.row > * {
    min-width: 0;
}

/* Footer */
.footer {
    background: #ffffff;
    border-top: 1px solid var(--gym-border);
    padding: 0.9rem 2rem;
    font-size: 0.82rem;
    color: var(--gym-text-muted);
}

/* ==========================================================================
   Commercial Gym KPI Cards & Stat Widgets
   ========================================================================== */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--gym-border);
    border-radius: 14px;
    padding: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: var(--gym-shadow-card);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    height: 100%;
}

.stat-card > div:first-child {
    min-width: 0;
    flex: 1;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--gym-shadow-md);
    border-color: #cbd5e1;
}

a.stat-card,
a.quick-analysis-tile {
    text-decoration: none !important;
    color: inherit;
    cursor: pointer;
}

a.stat-card:hover,
a.quick-analysis-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px -5px rgba(15, 23, 42, 0.12);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gym-text-muted);
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gym-text-main);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-subtext {
    font-size: 0.78rem;
    margin-top: 0.35rem;
    font-weight: 600;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* Stat Icon Color Variants */
.stat-icon-crimson {
    background: var(--gym-primary-light);
    color: var(--gym-primary);
}

.stat-icon-emerald {
    background: var(--gym-success-bg);
    color: var(--gym-success);
}

.stat-icon-amber {
    background: var(--gym-warning-bg);
    color: var(--gym-warning);
}

.stat-icon-blue {
    background: var(--gym-info-bg);
    color: var(--gym-info);
}

.stat-icon-purple {
    background: var(--gym-purple-bg);
    color: var(--gym-purple);
}

/* ==========================================================================
   Shared Cards, Headers & Quick Actions
   ========================================================================== */
.card-custom {
    background: #ffffff;
    border: 1px solid var(--gym-border);
    border-radius: 14px;
    box-shadow: var(--gym-shadow-card);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-header-clean {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gym-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-header-clean h5,
.card-header-clean h6 {
    margin: 0;
    font-weight: 700;
}

/* Sub-Header Toolbar */
.page-header-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gym-border);
}

.page-header-bar > div,
.card-header-clean > div {
    min-width: 0;
    max-width: 100%;
}

.page-title {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--gym-text-main);
    margin: 0 0 0.2rem 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    word-break: break-word;
}

.toolbar-search-input {
    width: 240px;
    max-width: 100%;
}

.toolbar-filter-select {
    width: 175px;
    max-width: 100%;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--gym-text-muted);
    font-weight: 500;
    margin: 0;
}

/* ==========================================================================
   Modern Table Architecture
   ========================================================================== */
.table-responsive {
    border-radius: 12px;
}

.table-custom,
.table {
    margin-bottom: 0;
    width: 100%;
}

.table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    color: #475569;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--gym-border);
    border-top: none;
    padding: 0.95rem 1rem;
    white-space: nowrap;
}

.table td {
    padding: 0.9rem 1rem;
    font-size: 0.88rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: var(--gym-text-main);
}

.table tbody tr {
    transition: background-color 0.12s ease;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Empty State Box */
.empty-state-box {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--gym-text-muted);
}

.empty-state-icon {
    font-size: 2.75rem;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.empty-state-title {
    font-weight: 700;
    color: var(--gym-text-main);
    margin-bottom: 0.25rem;
}

/* ==========================================================================
   Buttons & Action Pill Styles
   ========================================================================== */
.btn {
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: all 0.15s ease;
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 10px;
}

.btn-gym-primary,
.btn-danger {
    background-color: var(--gym-primary);
    border-color: var(--gym-primary);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(230, 57, 70, 0.2);
}

.btn-gym-primary:hover,
.btn-danger:hover {
    background-color: var(--gym-primary-hover);
    border-color: var(--gym-primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(230, 57, 70, 0.28);
}

.btn-outline-danger {
    color: var(--gym-primary);
    border-color: rgba(230, 57, 70, 0.4);
}

.btn-outline-danger:hover {
    background-color: var(--gym-primary);
    border-color: var(--gym-primary);
    color: #ffffff;
}

/* Action Icon Buttons */
.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* ==========================================================================
   Form Controls & Validation States
   ========================================================================== */
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--gym-text-main);
    border: 1px solid var(--gym-border);
    border-radius: 8px;
    padding: 0.58rem 0.85rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background-color: #ffffff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gym-primary);
    box-shadow: 0 0 0 3px var(--gym-primary-light);
    outline: none;
}

.input-group-text {
    background-color: #f8fafc;
    border-color: var(--gym-border);
    color: var(--gym-text-muted);
}

/* Validation Feedback */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--gym-danger) !important;
    background-image: none !important;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 3px var(--gym-danger-bg) !important;
}

.invalid-feedback {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gym-danger);
}

/* ==========================================================================
   Status Badges & Pills
   ========================================================================== */
.badge {
    font-weight: 600;
    font-size: 0.74rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    letter-spacing: 0.2px;
}

.badge.badge-status-active,
.badge-status-active {
    background-color: #d1fae5;
    --bs-badge-color: #065f46;
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.badge.badge-status-inactive,
.badge-status-inactive {
    background-color: #f1f5f9;
    --bs-badge-color: #475569;
    color: #475569;
    border: 1px solid var(--gym-border);
}

.badge.badge-status-expired,
.badge-status-expired {
    background-color: #fee2e2;
    --bs-badge-color: #991b1b;
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge.badge-status-warning,
.badge-status-warning {
    background-color: #fef3c7;
    --bs-badge-color: #92400e;
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge.badge-status-info,
.badge-status-info {
    background-color: #e0f2fe;
    --bs-badge-color: #075985;
    color: #075985;
    border: 1px solid rgba(2, 132, 199, 0.35);
}

.badge.badge-status-danger,
.badge-status-danger {
    background-color: #fee2e2;
    --bs-badge-color: #991b1b;
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge.badge-status-orange,
.badge-status-orange {
    background-color: #ffedd5;
    --bs-badge-color: #c2410c;
    color: #c2410c;
    border: 1px solid #fdba74;
}

.badge.badge-status-secondary,
.badge-status-secondary {
    background-color: #f1f5f9;
    --bs-badge-color: #475569;
    color: #475569;
    border: 1px solid var(--gym-border);
}

/* ==========================================================================
   Modals & Dialogs
   ========================================================================== */
.modal-content {
    border-radius: 14px;
    overflow: hidden;
    border: none;
    box-shadow: var(--gym-shadow-lg);
}

.modal-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--gym-border);
}

.modal-header-gym,
.modal-header.bg-dark {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe4e6 60%, #fef2f2 100%) !important;
    color: #0f172a !important;
    border-bottom: 1px solid #fecdd3 !important;
}

.modal-header-gym .modal-title,
.modal-header.bg-dark .modal-title {
    color: #0f172a !important;
}

.modal-header-gym .modal-title.text-danger,
.modal-header.bg-dark .modal-title.text-danger {
    color: var(--gym-primary) !important;
}

.modal-header-gym .btn-close,
.modal-header.bg-dark .btn-close-white {
    filter: none !important;
    opacity: 0.72;
}

.modal-header-gym .btn-close:hover,
.modal-header.bg-dark .btn-close-white:hover {
    opacity: 1;
}

.avatar-initials {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%) !important;
    color: #be123c !important;
    border: 1px solid #fecdd3;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gym-border);
}

/* ==========================================================================
   Modern Athletic Gym Toast Notification System
   ========================================================================== */
#appToastContainer, .toast-container {
    position: fixed !important;
    top: 24px !important;
    right: 24px !important;
    z-index: 1000000 !important;
    pointer-events: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    max-width: 440px !important;
    width: calc(100% - 48px) !important;
}

.gym-toast {
    pointer-events: auto !important;
    background: #ffffff !important;
    border-radius: 14px !important;
    box-shadow: 0 14px 34px -4px rgba(15, 23, 42, 0.16), 0 4px 14px -2px rgba(15, 23, 42, 0.08) !important;
    border: 1px solid #e2e8f0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important;
    transform-origin: top right;
    animation: gymToastSlideIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    transition: all 0.28s ease !important;
}

.gym-toast.gym-toast-leaving {
    animation: gymToastSlideOut 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.gym-toast-inner {
    display: flex;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 14px;
}

.gym-toast-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
}

.gym-toast-success .gym-toast-icon-wrapper {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}
.gym-toast-error .gym-toast-icon-wrapper {
    background: rgba(230, 57, 70, 0.14);
    color: #e63946;
}
.gym-toast-warning .gym-toast-icon-wrapper {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}
.gym-toast-info .gym-toast-icon-wrapper {
    background: rgba(59, 130, 246, 0.14);
    color: #2563eb;
}

.gym-toast-content {
    flex-grow: 1;
    min-width: 0;
    padding-top: 1px;
}

.gym-toast-header-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.gym-toast-title {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    line-height: 1.25;
}

.gym-toast-success .gym-toast-title { color: #065f46; }
.gym-toast-error .gym-toast-title { color: #991b1b; }
.gym-toast-warning .gym-toast-title { color: #92400e; }
.gym-toast-info .gym-toast-title { color: #1e40af; }

.gym-toast-time {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
}

.gym-toast-message {
    font-size: 0.86rem;
    color: #334155;
    line-height: 1.45;
    word-break: break-word;
    font-weight: 500;
}

.gym-toast-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all 0.2s;
    margin-left: 4px;
    margin-top: -2px;
}

.gym-toast-close-btn:hover {
    color: #1e293b;
    background: rgba(148, 163, 184, 0.15);
}

/* Bottom Countdown Progress Bar */
.gym-toast-progress-bar {
    height: 3px;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.04);
}

.gym-toast-progress-fill {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: gymToastProgress 4.5s linear forwards;
}

.gym-toast:hover .gym-toast-progress-fill {
    animation-play-state: paused;
}

.gym-toast-success .gym-toast-progress-fill { background: #10b981; }
.gym-toast-error .gym-toast-progress-fill { background: #e63946; }
.gym-toast-warning .gym-toast-progress-fill { background: #f59e0b; }
.gym-toast-info .gym-toast-progress-fill { background: #3b82f6; }

@keyframes gymToastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@keyframes gymToastSlideIn {
    0% {
        opacity: 0;
        transform: translateX(110%) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes gymToastSlideOut {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
        max-height: 120px;
        margin-bottom: 12px;
    }
    100% {
        opacity: 0;
        transform: translateX(115%) scale(0.92);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* ==========================================================================
   Grid Pagination Footer & Theme Switcher Controls
   ========================================================================== */
.gym-grid-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background-color: var(--gym-surface-2);
    border-top: 1px solid var(--gym-border);
    font-size: 0.82rem;
    color: var(--gym-text-muted);
}

.gym-grid-pagesize {
    width: auto !important;
    min-width: 74px;
    padding: 0.25rem 1.75rem 0.25rem 0.6rem !important;
    font-size: 0.82rem !important;
    border-radius: 6px;
}

.gym-grid-pager {
    margin: 0;
    gap: 0.25rem;
}

.gym-grid-pager .page-link {
    border-radius: 6px !important;
    border-color: var(--gym-border);
    color: var(--gym-text-main);
    background-color: var(--gym-card);
    padding: 0.3rem 0.65rem;
    font-weight: 600;
    font-size: 0.8rem;
}

.gym-grid-pager .page-link:hover {
    background-color: var(--gym-primary-light);
    color: var(--gym-primary);
    border-color: rgba(230, 57, 70, 0.3);
}

.gym-grid-pager .page-item.active .page-link {
    background-color: var(--gym-primary);
    border-color: var(--gym-primary);
    color: #ffffff;
}

.gym-grid-pager .page-item.disabled .page-link {
    opacity: 0.45;
    pointer-events: none;
}

.theme-toggle-btn {
    background: var(--gym-surface-2);
    border: 1px solid var(--gym-border);
    color: var(--gym-text-main);
    border-radius: 50px;
    padding: 0.38rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    transition: all 0.16s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--gym-primary);
    color: var(--gym-primary);
}

/* ==========================================================================
   Dark Theme Architecture (html[data-theme="dark"])
   ========================================================================== */
html[data-theme="dark"] {
    --gym-bg: #0b1120;
    --gym-card: #111827;
    --gym-surface-2: #1a2436;
    --gym-input-bg: #0f172a;
    --gym-border: #263248;
    --gym-border-light: #1e293b;
    --gym-text-main: #f1f5f9;
    --gym-text-muted: #94a3b8;
    --gym-text-light: #64748b;
    --gym-shadow-card: 0 2px 6px rgba(0, 0, 0, 0.35);
    --gym-shadow-md: 0 6px 14px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] body {
    background-color: var(--gym-bg);
    color: var(--gym-text-main);
}

html[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, var(--gym-dark-950) 0%, var(--gym-dark-900) 100%);
    color: #e2e8f0;
    border-right: 1px solid #1e293b;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .sidebar-brand {
    background: rgba(0, 0, 0, 0.25);
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .sidebar-toggle-btn,
html[data-theme="dark"] .sidebar-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: #cbd5e1;
}

html[data-theme="dark"] .sidebar-toggle-btn:hover,
html[data-theme="dark"] .sidebar-close-btn:hover {
    color: #ffffff;
}

html[data-theme="dark"] .sidebar-toggle-btn:hover {
    background-color: var(--gym-primary);
    border-color: var(--gym-primary);
}

html[data-theme="dark"] .menu-category-btn {
    color: #cbd5e1;
}

html[data-theme="dark"] .menu-category-btn:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

html[data-theme="dark"] .menu-category-btn.active {
    color: #ffffff;
    background: rgba(230, 57, 70, 0.16);
    box-shadow: none;
}

html[data-theme="dark"] .menu-category-btn .menu-icon,
html[data-theme="dark"] .menu-category-btn .arrow {
    color: #94a3b8;
}

html[data-theme="dark"] .menu-category-btn.expanded .arrow {
    color: #cbd5e1;
}

html[data-theme="dark"] .submenu-collapse {
    background: rgba(0, 0, 0, 0.25);
    border-color: transparent;
}

html[data-theme="dark"] .submenu-item {
    color: #94a3b8;
}

html[data-theme="dark"] .submenu-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .submenu-item.active {
    color: #ffffff;
    background: rgba(230, 57, 70, 0.18);
}

html[data-theme="dark"] .sidebar.collapsed .menu-category-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

html[data-theme="dark"] .sidebar.collapsed .menu-category-btn.active {
    background-color: rgba(230, 57, 70, 0.18);
    color: var(--gym-primary);
    box-shadow: 0 0 10px rgba(230, 57, 70, 0.25);
}

html[data-theme="dark"] .floating-submenu-panel {
    background: #0f172a;
    border-color: #334155;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .floating-submenu-header {
    background: #1e293b;
    color: #ffffff;
    border-bottom-color: #334155;
}

html[data-theme="dark"] .floating-submenu-list a {
    color: #cbd5e1;
}

html[data-theme="dark"] .floating-submenu-list a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

html[data-theme="dark"] .floating-submenu-list a.active {
    background: rgba(230, 57, 70, 0.18);
    color: #ffffff;
}

html[data-theme="dark"] .top-navbar,
html[data-theme="dark"] .footer {
    background-color: var(--gym-card);
    border-color: var(--gym-border);
    color: var(--gym-text-muted);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .card-custom,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .quick-analysis-tile,
html[data-theme="dark"] .category-option-card {
    background-color: var(--gym-card) !important;
    border-color: var(--gym-border) !important;
    color: var(--gym-text-main);
}

html[data-theme="dark"] .card-header-clean,
html[data-theme="dark"] .card-header {
    background-color: var(--gym-surface-2) !important;
    border-color: var(--gym-border) !important;
    color: var(--gym-text-main);
}

html[data-theme="dark"] .bg-white {
    background-color: var(--gym-card) !important;
}

html[data-theme="dark"] .bg-light {
    background-color: var(--gym-surface-2) !important;
}

html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .page-title,
html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .empty-state-title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .page-subtitle,
html[data-theme="dark"] .form-label {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-end {
    border-color: var(--gym-border) !important;
}

html[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: #e2e8f0;
    --bs-table-hover-bg: #1e293b;
    --bs-table-hover-color: #ffffff;
    color: #e2e8f0;
}

html[data-theme="dark"] .table th {
    background-color: #162033;
    color: #cbd5e1;
    border-bottom-color: var(--gym-border);
}

html[data-theme="dark"] .table td {
    color: #e2e8f0;
    border-bottom-color: var(--gym-border);
}

html[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: #1e293b;
}

html[data-theme="dark"] .table-light {
    --bs-table-bg: #162033;
    --bs-table-color: #cbd5e1;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
    background-color: var(--gym-input-bg) !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .form-control::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .user-badge,
html[data-theme="dark"] .fy-pill,
html[data-theme="dark"] .btn-toggle-menu,
html[data-theme="dark"] .theme-toggle-btn {
    background-color: var(--gym-surface-2);
    border-color: var(--gym-border);
    color: #e2e8f0;
}

html[data-theme="dark"] .badge.bg-light,
html[data-theme="dark"] .badge.bg-secondary-subtle,
html[data-theme="dark"] .badge.bg-white {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .badge.badge-status-active {
    background-color: rgba(16, 185, 129, 0.2) !important;
    --bs-badge-color: #6ee7b7;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.45) !important;
}

html[data-theme="dark"] .badge.badge-status-warning {
    background-color: rgba(245, 158, 11, 0.2) !important;
    --bs-badge-color: #fcd34d;
    color: #fcd34d !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
}

html[data-theme="dark"] .badge.badge-status-orange {
    background-color: rgba(249, 115, 22, 0.22) !important;
    --bs-badge-color: #fdba74;
    color: #fdba74 !important;
    border-color: rgba(249, 115, 22, 0.5) !important;
}

html[data-theme="dark"] .badge.badge-status-danger,
html[data-theme="dark"] .badge.badge-status-expired {
    background-color: rgba(239, 68, 68, 0.22) !important;
    --bs-badge-color: #fca5a5;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.45) !important;
}

html[data-theme="dark"] .badge.badge-status-info {
    background-color: rgba(2, 132, 199, 0.22) !important;
    --bs-badge-color: #7dd3fc;
    color: #7dd3fc !important;
    border-color: rgba(2, 132, 199, 0.45) !important;
}

html[data-theme="dark"] .badge.badge-status-inactive,
html[data-theme="dark"] .badge.badge-status-secondary {
    background-color: #1e293b !important;
    --bs-badge-color: #cbd5e1;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .modal-body {
    background-color: var(--gym-card);
    color: var(--gym-text-main);
}

html[data-theme="dark"] .modal-header-gym,
html[data-theme="dark"] .modal-header.bg-dark {
    background: linear-gradient(135deg, var(--gym-dark-950) 0%, var(--gym-dark-900) 100%) !important;
    color: #f1f5f9 !important;
    border-bottom: 1px solid var(--gym-border) !important;
}

html[data-theme="dark"] .modal-header-gym .modal-title,
html[data-theme="dark"] .modal-header.bg-dark .modal-title {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .modal-header-gym .modal-title.text-danger,
html[data-theme="dark"] .modal-header.bg-dark .modal-title.text-danger {
    color: #f87171 !important;
}

html[data-theme="dark"] .modal-header-gym .btn-close,
html[data-theme="dark"] .modal-header.bg-dark .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
    opacity: 0.8;
}

html[data-theme="dark"] .avatar-initials {
    background: rgba(230, 57, 70, 0.18) !important;
    color: #fda4af !important;
    border-color: rgba(230, 57, 70, 0.35);
}

html[data-theme="dark"] .modal-footer {
    background-color: var(--gym-surface-2) !important;
    border-color: var(--gym-border);
}

html[data-theme="dark"] .gym-toast {
    background: #111827 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .gym-toast-message {
    color: #e2e8f0;
}

html[data-theme="dark"] .btn-outline-secondary {
    color: #cbd5e1;
    border-color: #475569;
}

html[data-theme="dark"] .btn-outline-dark {
    color: #e2e8f0;
    border-color: #475569;
}

html[data-theme="dark"] .alert-filter-btn.active {
    background-color: var(--gym-primary) !important;
    border-color: var(--gym-primary) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .text-warning-emphasis {
    color: #fbbf24 !important;
}

/* ==========================================================================
   Responsive Architecture (Desktop, Tablet, Mobile)
   ========================================================================== */

/* Large screens / Desktops */
@media (min-width: 992px) {
    .sidebar {
        transform: none !important;
    }
}

/* Small Desktop / Large Tablet (<= 1199px) */
@media (max-width: 1199.98px) {
    .content-container {
        padding: 1.4rem 1.35rem;
    }

    .stat-card {
        padding: 1.15rem;
    }

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

    .stat-icon {
        width: 46px;
        height: 46px;
        font-size: 1.25rem;
    }
}

/* Tablets and Mobile (<= 991px) */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 270px !important;
        max-width: 82vw !important;
        overflow: hidden !important;
        z-index: 1055;
        box-shadow: 6px 0 28px rgba(0, 0, 0, 0.45);
    }

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

    /* Reset any desktop collapsed styles so mobile drawer always renders full labels & submenus */
    .sidebar.collapsed .sidebar-brand {
        padding: 0 0.85rem 0 1.15rem !important;
        justify-content: space-between !important;
    }

    .sidebar.collapsed .sidebar-brand-inner {
        display: flex !important;
    }

    .sidebar.collapsed .sidebar-brand-text {
        display: block !important;
    }

    .sidebar.collapsed .menu-category-btn {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0.7rem 0.9rem !important;
        justify-content: space-between !important;
        border-radius: 8px !important;
    }

    .sidebar.collapsed .menu-category-btn .menu-item-content {
        justify-content: flex-start !important;
        gap: 0.75rem !important;
        width: auto !important;
    }

    .sidebar.collapsed .menu-category-btn .menu-icon {
        font-size: 1rem !important;
        width: 22px !important;
    }

    .sidebar.collapsed .menu-category-btn .menu-text,
    .sidebar.collapsed .menu-category-btn .arrow {
        display: inline-block !important;
    }

    .sidebar.collapsed .submenu-collapse {
        display: block !important;
    }

    .sidebar-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 8px;
        background: rgba(230, 57, 70, 0.1);
        color: #475569;
    }

    .main-wrapper,
    .main-wrapper.sidebar-collapsed {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .top-navbar {
        padding: 0.4rem 1rem;
        min-height: 60px;
    }

    .btn-toggle-menu {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .content-container {
        padding: 1.1rem 1rem;
    }

    .page-header-bar {
        margin-bottom: 1.25rem;
        padding-bottom: 0.85rem;
        gap: 0.75rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .page-subtitle {
        font-size: 0.8rem;
    }

    .btn {
        font-size: 0.84rem;
        padding: 0.48rem 0.85rem;
    }

    .btn-sm {
        font-size: 0.78rem;
        padding: 0.32rem 0.6rem;
    }

    .btn-lg {
        font-size: 0.94rem;
        padding: 0.65rem 1.25rem;
    }

    .stat-card {
        padding: 1.05rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

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

    .stat-subtext {
        font-size: 0.74rem;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 1.15rem;
        border-radius: 10px;
    }

    .card-header-clean {
        padding: 0.95rem 1.1rem;
    }

    .table th {
        padding: 0.75rem 0.8rem;
        font-size: 0.72rem;
    }

    .table td {
        padding: 0.75rem 0.8rem;
        font-size: 0.84rem;
    }

    .toolbar-search-input {
        width: 210px;
    }

    .toolbar-filter-select {
        width: 160px;
    }

    .gym-brand-pill {
        display: none;
    }
}

/* Mobile Phones (< 576px) */
@media (max-width: 575.98px) {
    .top-navbar {
        padding: 0.35rem 0.75rem;
        min-height: 54px;
    }

    .top-navbar .fy-pill {
        display: none;
    }

    .top-navbar .navbar-mobile-brand {
        font-size: 0.95rem;
        gap: 0.35rem !important;
    }

    .top-navbar .theme-toggle-btn {
        padding: 0.3rem 0.55rem;
        font-size: 0.76rem;
    }

    .top-navbar .btn-outline-danger {
        padding: 0.3rem 0.55rem;
        font-size: 0.78rem;
    }

    .user-badge {
        padding: 0.22rem 0.45rem 0.22rem 0.3rem;
        gap: 0.3rem;
        font-size: 0.76rem;
    }

    .user-badge-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .role-pill {
        font-size: 0.62rem;
        padding: 0.12rem 0.42rem;
    }

    .user-badge span:first-of-type {
        display: none;
    }

    .content-container {
        padding: 0.85rem 0.7rem;
    }

    .content-container .card.p-4 {
        padding: 1rem !important;
    }

    .page-header-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }

    .page-header-bar .d-flex {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .page-title {
        font-size: 1.12rem;
        gap: 0.4rem;
    }

    .page-subtitle {
        font-size: 0.76rem;
    }

    .btn {
        font-size: 0.81rem;
        padding: 0.44rem 0.75rem;
        gap: 0.35rem;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 0.28rem 0.52rem;
    }

    .btn-lg {
        font-size: 0.88rem;
        padding: 0.58rem 1.05rem;
    }

    .btn-action {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .form-control,
    .form-select {
        font-size: 0.84rem;
        padding: 0.48rem 0.72rem;
    }

    .form-label {
        font-size: 0.78rem;
    }

    .stat-card {
        padding: 0.9rem 0.95rem;
        border-radius: 12px;
    }

    .stat-label {
        font-size: 0.67rem;
    }

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

    .stat-subtext {
        font-size: 0.72rem;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
    }

    .card-header-clean {
        padding: 0.8rem 0.95rem;
        gap: 0.6rem;
    }

    .toolbar-search-input,
    .toolbar-filter-select {
        width: 100% !important;
        flex: 1 1 100%;
    }

    .table th {
        padding: 0.65rem 0.65rem;
        font-size: 0.69rem;
    }

    .table td {
        padding: 0.65rem 0.65rem;
        font-size: 0.79rem;
    }

    .badge {
        font-size: 0.69rem;
        padding: 0.26rem 0.5rem;
    }

    .form-actions-bar {
        flex-wrap: wrap;
        justify-content: stretch !important;
    }

    .form-actions-bar > .btn {
        flex: 1 1 auto;
    }

    .gym-grid-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 0.75rem 0.85rem;
        gap: 0.55rem;
        font-size: 0.76rem;
    }

    .gym-grid-footer > div:first-child {
        justify-content: center;
    }

    .gym-grid-footer nav {
        display: flex;
        justify-content: center;
    }

    .gym-grid-pager {
        flex-wrap: wrap;
        justify-content: center;
    }

    .gym-grid-pager .page-link {
        padding: 0.26rem 0.55rem;
        font-size: 0.75rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-header {
        padding: 0.85rem 1rem;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    #appToastContainer,
    .toast-container {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: none !important;
    }

    .footer {
        flex-direction: column;
        gap: 0.35rem;
        text-align: center;
        padding: 0.8rem 1rem;
        font-size: 0.76rem;
    }
}

/* Extra small phones (< 400px) */
@media (max-width: 399.98px) {
    .top-navbar .navbar-mobile-brand span {
        display: none;
    }

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

/* ==========================================================================
   Gym Profile & Theme Settings Styling
   ========================================================================== */
.custom-profile-tabs {
    background: var(--gym-card);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--gym-border);
    display: inline-flex;
    list-style: none;
    margin: 0;
}

.custom-profile-tabs .nav-link {
    border-radius: 8px;
    padding: 0.65rem 1.4rem;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--gym-text-muted);
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    background: transparent;
}

.custom-profile-tabs .nav-link:hover {
    color: var(--gym-text-main);
    background: var(--gym-surface-2);
}

.custom-profile-tabs .nav-link.active {
    background: var(--gym-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--gym-primary-glow);
}

/* Header theme dot */
.theme-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    background-color: var(--gym-primary);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
    margin-left: 6px;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

html[data-theme="dark"] .theme-color-dot {
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
}

/* Theme Configurator Cards */
.theme-mode-card {
    border: 2px solid var(--gym-border);
    background: var(--gym-card);
    border-radius: 12px;
    padding: 1.25rem 1.15rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.theme-mode-card:hover {
    border-color: var(--gym-primary);
    transform: translateY(-2px);
    box-shadow: var(--gym-shadow-md);
}

.theme-mode-card.active {
    border-color: var(--gym-primary);
    background: var(--gym-primary-light);
    box-shadow: 0 0 0 1px var(--gym-primary), 0 4px 14px var(--gym-primary-glow);
}

.palette-choice-card {
    border: 2px solid var(--gym-border);
    background: var(--gym-card);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.palette-choice-card:hover {
    border-color: var(--gym-primary);
    transform: translateY(-3px);
    box-shadow: var(--gym-shadow-md);
}

.palette-choice-card.active {
    border-color: var(--gym-primary);
    background: var(--gym-primary-light);
    box-shadow: 0 0 0 1px var(--gym-primary), 0 6px 16px var(--gym-primary-glow);
}

.palette-swatches {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.palette-swatches-5 {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 0.75rem;
}

.palette-swatch-chip {
    flex: 1;
    height: 24px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease;
}

.palette-choice-card:hover .palette-swatch-chip {
    transform: translateY(-2px);
}

.palette-swatch-main {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid #ffffff;
}

.palette-swatch-sub {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
    opacity: 0.9;
}

.theme-check-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gym-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.2s ease;
}

.theme-mode-card.active .theme-check-badge,
.palette-choice-card.active .theme-check-badge,
.radius-choice-card.active .theme-check-badge {
    opacity: 1;
    transform: scale(1);
}

.radius-choice-card {
    border: 2px solid var(--gym-border);
    background: var(--gym-card);
    border-radius: 12px;
    padding: 1rem 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
    text-align: center;
    height: 100%;
}

.radius-choice-card:hover {
    border-color: var(--gym-primary);
    transform: translateY(-2px);
    box-shadow: var(--gym-shadow-sm);
}

.radius-choice-card.active {
    border-color: var(--gym-primary);
    background: var(--gym-primary-light);
    box-shadow: 0 0 0 1px var(--gym-primary);
}

.mini-wireframe-box {
    border-radius: 6px;
    border: 1px solid var(--gym-border);
    padding: 8px;
    margin-bottom: 0.85rem;
    height: 64px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f8fafc;
}

.mini-wireframe-box.dark-box {
    background: #0f172a;
    border-color: #334155;
}

.mini-wireframe-box.system-box {
    background: linear-gradient(90deg, #f8fafc 50%, #0f172a 50%);
}

.mini-wireframe-bar {
    height: 8px;
    border-radius: 3px;
    background: #cbd5e1;
    width: 60%;
}

.mini-wireframe-box.dark-box .mini-wireframe-bar {
    background: #475569;
}

.mini-wireframe-box.system-box .mini-wireframe-bar {
    background: var(--gym-primary);
}

.theme-sandbox-card {
    background: var(--gym-card);
    border: 1px solid var(--gym-border);
    border-radius: 14px;
    padding: 1.5rem;
    position: relative;
    box-shadow: var(--gym-shadow-sm);
}

.theme-sandbox-badge {
    position: absolute;
    top: 14px;
    right: 14px;
}
