/*
 * GymNivo — Core Application Styles
 * Version: 1.0.0
 * Author: GymNivo
 * Description: Main layout, header, navigation, footer
 * Envato Policy: No !important abuse, clean cascade, no duplicates
 *
 * Table of Contents:
 *   1. CSS Custom Properties (Design Tokens)
 *   2. CSS Reset & Base
 *   3. Layout Shell
 *   4. Header & Brand
 *   5. Theme Toggle
 *   6. Profile Dropdown
 *   7. Navigation Menu Bar
 *   8. Menu Dropdown
 *   9. Mobile Hamburger & Sidebar
 *  10. Main Content Area
 *  11. Footer
 *  12. Responsive Breakpoints
 */

/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */

:root {
    --bg:           #f3f5fb;
    --surface:      #ffffff;
    --text:         #1f2937;
    --muted:        #6b7280;
    --line:         #e4e8f1;
    --primary:      #18d2e7;
    --primary-soft: rgba(24, 210, 231, 0.12);
    --danger:       #c0392b;

    --body-bg:      linear-gradient(180deg, #f7f8fc 0%, #eef2fb 100%);
    --workspace-bg: linear-gradient(180deg, #f8faff 0%, #eef3fb 100%);

    --header-chip-bg:     rgba(255, 255, 255, 0.96);
    --header-chip-border: rgba(31, 41, 55, 0.1);
    --header-chip-shadow:
        0 1px 0 rgba(255,255,255,.8) inset,
        0 8px 24px rgba(31, 41, 55, 0.1),
        0 2px 8px rgba(31, 41, 55, 0.06);

    --brand-title-color:    #111827;
    --brand-subtitle-color: #6b7280;

    --profile-title-color:    #0f172a;
    --profile-subtitle-color: #6b7280;
    --profile-caret-color:    #6b7280;
    --profile-menu-bg:        #ffffff;
    --profile-menu-border:    rgba(31, 41, 55, 0.08);
    --profile-menu-shadow:    0 20px 40px rgba(31, 41, 55, 0.14);
    --profile-menu-hover:     #f4f7fb;
    --dropdown-hover-bg:      rgba(99, 102, 241, 0.1);
    --dropdown-hover-text:    #6366f1;

    --menu-bar-border: rgba(255, 255, 255, 0.08);
    --menu-bar-bg:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
        linear-gradient(135deg, #1f2648 0%, #161d39 52%, #10162d 100%);
    --menu-bar-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 22px 44px rgba(17, 24, 48, 0.22);
    --menu-top-line:   linear-gradient(90deg, transparent, rgba(255, 207, 112, 0.58), transparent);
    --menu-text-color: rgba(236, 242, 255, 0.9);
    --menu-icon-color: rgba(128, 230, 222, 0.96);
    --menu-accent:     #ffcf70;

    --menu-active-text:   #ffffff;
    --menu-active-start:  rgba(44, 208, 186, 0.2);
    --menu-active-end:    rgba(79, 115, 243, 0.18);
    --menu-active-border: rgba(255, 255, 255, 0.08);
    --menu-active-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 10px 20px rgba(5, 10, 24, 0.18);

    --card-border:  rgba(15, 23, 42, 0.06);
    --card-shadow:  0 18px 45px rgba(31, 41, 55, 0.06);

    --stage-border: rgba(30, 41, 59, 0.08);
    --stage-bg:
        radial-gradient(circle at top left, rgba(110, 144, 255, 0.14), transparent 26%),
        radial-gradient(circle at bottom right, rgba(69, 206, 191, 0.1), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(240, 245, 255, 0.95) 100%);
    --stage-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.88),
        0 28px 60px rgba(86, 108, 160, 0.12);
    --stage-grid:     rgba(74, 96, 146, 0.06);
    --stage-mask:     linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 92%);
    --stage-top-line: linear-gradient(90deg, transparent, rgba(122, 149, 255, 0.52), transparent);

    --detail-bg:      #f8faff;
    --detail-strong:  #111827;
    --role-chip-text: #0f6474;
    --alert-danger-bg: #fff0ee;
    --alert-danger-border: #f3c1ba;
    --mobile-sidebar-close-hover-bg: rgba(220, 38, 38, 0.2);
    --mobile-sidebar-close-hover-text: #f87171;
    --mobile-nav-text: rgba(255, 255, 255, 0.75);
    --mobile-nav-hover-bg: rgba(255, 255, 255, 0.08);
    --mobile-nav-hover-text: #ffffff;
    --mobile-nav-sub-text: rgba(255, 255, 255, 0.6);
    --mobile-nav-sub-hover-bg: rgba(255, 255, 255, 0.07);
    --mobile-nav-sub-hover-text: #ffffff;
}

html[data-theme="dark"] {
    --bg:      #0a0d14;
    --surface: #111624;
    --text:    #eef2ff;
    --muted:   #a4adbf;
    --line:    rgba(255, 255, 255, 0.08);

    --body-bg:
        radial-gradient(circle at top center, rgba(44, 65, 132, 0.16), transparent 24%),
        linear-gradient(180deg, #080b12 0%, #0b0f18 42%, #0d111b 100%);
    --workspace-bg:
        radial-gradient(circle at top center, rgba(43, 62, 122, 0.18), transparent 24%),
        linear-gradient(180deg, #06070c 0%, #090b12 38%, #0b0e16 100%);

    --header-chip-bg:     rgba(14, 20, 36, 0.96);
    --header-chip-border: rgba(255, 255, 255, 0.1);
    --header-chip-shadow:
        0 1px 0 rgba(255,255,255,.05) inset,
        0 8px 24px rgba(0, 0, 0, 0.32),
        0 2px 8px rgba(0, 0, 0, 0.2);

    --brand-title-color:    #f6f8ff;
    --brand-subtitle-color: #aab3c8;

    --profile-title-color:    #f8faff;
    --profile-subtitle-color: #aab3c8;
    --profile-caret-color:    #aab3c8;
    --profile-menu-bg:        #101624;
    --profile-menu-border:    rgba(255, 255, 255, 0.08);
    --profile-menu-shadow:    0 20px 40px rgba(0, 0, 0, 0.28);
    --profile-menu-hover:     rgba(255, 255, 255, 0.04);
    --dropdown-hover-bg:      rgba(99, 102, 241, 0.14);
    --dropdown-hover-text:    #a5b4fc;

    --menu-bar-bg:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
        linear-gradient(135deg, #1a2242 0%, #12182f 52%, #0d1225 100%);
    --menu-bar-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 22px 44px rgba(13, 18, 37, 0.22);
    --menu-top-line:     linear-gradient(90deg, transparent, rgba(255, 207, 112, 0.65), transparent);
    --menu-text-color:   rgba(238, 243, 255, 0.92);
    --menu-icon-color:   rgba(143, 238, 230, 0.98);
    --menu-active-start: rgba(57, 225, 221, 0.18);
    --menu-active-end:   rgba(80, 140, 255, 0.16);

    --card-border:  rgba(255, 255, 255, 0.06);
    --card-shadow:  0 18px 45px rgba(0, 0, 0, 0.22);

    --stage-border: rgba(255, 255, 255, 0.06);
    --stage-bg:
        radial-gradient(circle at top left, rgba(86, 122, 255, 0.12), transparent 24%),
        radial-gradient(circle at bottom right, rgba(47, 212, 191, 0.08), transparent 22%),
        linear-gradient(180deg, rgba(17, 21, 34, 0.98) 0%, rgba(11, 14, 24, 0.98) 100%);
    --stage-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 28px 60px rgba(0, 0, 0, 0.24);
    --stage-grid:     rgba(255, 255, 255, 0.025);
    --stage-mask:     linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 92%);
    --stage-top-line: linear-gradient(90deg, transparent, rgba(255, 207, 112, 0.7), transparent);

    --detail-bg:      #131a2a;
    --detail-strong:  #f5f7ff;
    --role-chip-text: #78d5e4;
    --alert-danger-bg: rgba(127, 29, 29, 0.24);
    --alert-danger-border: rgba(248, 113, 113, 0.36);
    --mobile-sidebar-close-hover-bg: rgba(248, 113, 113, 0.18);
    --mobile-sidebar-close-hover-text: #fca5a5;
    --mobile-nav-text: rgba(255, 255, 255, 0.75);
    --mobile-nav-hover-bg: rgba(255, 255, 255, 0.08);
    --mobile-nav-hover-text: #ffffff;
    --mobile-nav-sub-text: rgba(255, 255, 255, 0.6);
    --mobile-nav-sub-hover-bg: rgba(255, 255, 255, 0.07);
    --mobile-nav-sub-hover-text: #ffffff;
}

/* ============================================================
   2. CSS RESET & BASE
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

html             { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--body-bg);
    color: var(--text);
}

body.dashboard-blackout { background: var(--workspace-bg); }

a      { color: inherit; text-decoration: none; }
button { font: inherit; }
input  { font: inherit; }

::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 999px; }

[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

/* ============================================================
   3. LAYOUT SHELL
   ============================================================ */

.shell { min-height: 100vh; }

.app-shell {
    width: min(1540px, calc(100% - 40px));
    margin: 20px auto 0;
    overflow: visible;
}

/* Header chip — premium floating card */
.app-header {
    background: var(--header-chip-bg);
    border: 1px solid var(--header-chip-border);
    border-radius: 20px;
    padding: 10px 18px;
    box-shadow: var(--header-chip-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.content {
    width: min(1540px, calc(100% - 40px));
    margin: 18px auto 32px;
}

/* ============================================================
   4. HEADER & BRAND
   ============================================================ */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-block { min-width: 0; }

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand-logo-box {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(145deg, #ffd668 0%, #efb122 100%);
    display: grid;
    place-items: center;
    color: #18202f;
    font-size: 24px;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(239, 177, 34, 0.2);
    flex-shrink: 0;
}

.brand-logo-box img { width: 100%; height: 100%; object-fit: cover; }

.brand-logo-box-sm {
    width: 38px;
    height: 38px;
    font-size: 18px;
}

.brand-copy { display: flex; flex-direction: column; gap: 2px; }

.brand-copy strong {
    font-size: 16px;
    color: var(--brand-title-color);
    text-shadow: 0 1px 0 rgba(0,0,0,0.12);
}

.brand-copy span {
    font-size: 13px;
    color: var(--brand-subtitle-color);
    text-shadow: 0 1px 0 rgba(0,0,0,0.12);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

/* Hamburger — hidden on desktop, shown on mobile via media query */
/* ── Hamburger Button — light=dark bg, dark=light bg ── */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    transition: all 0.18s ease;
}

/* LIGHT MODE — dark button (navy) */
html[data-theme="light"] .mobile-menu-toggle {
    background: linear-gradient(135deg, #1e2640 0%, #151c32 100%);
    border: 1.5px solid rgba(255,255,255,.12);
    color: #eef2ff;
    box-shadow: 0 4px 14px rgba(15,20,48,.28);
}
html[data-theme="light"] .mobile-menu-toggle:hover {
    background: linear-gradient(135deg, #252e52 0%, #1a2240 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15,20,48,.36);
}
html[data-theme="light"] .mobile-menu-toggle .menu-text { color: #eef2ff; }

/* DARK MODE — light button (white/light) */
html[data-theme="dark"] .mobile-menu-toggle {
    background: linear-gradient(135deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.09) 100%);
    border: 1.5px solid rgba(255,255,255,.22);
    color: #f0f4ff;
    box-shadow: 0 4px 14px rgba(0,0,0,.22);
}
html[data-theme="dark"] .mobile-menu-toggle:hover {
    background: linear-gradient(135deg, rgba(255,255,255,.2) 0%, rgba(255,255,255,.14) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
html[data-theme="dark"] .mobile-menu-toggle .menu-text { color: #f0f4ff; }

.mobile-menu-toggle svg {
    width: 18px; height: 18px;
    stroke: currentColor; fill: none;
    stroke-width: 2.2; stroke-linecap: round;
    flex-shrink: 0;
}
.mobile-menu-toggle .menu-text { white-space: nowrap; }

/* Toggle states */
.mobile-menu-toggle .icon-close             { display: none; }
.mobile-menu-toggle.is-open .icon-hamburger { display: none; }
.mobile-menu-toggle.is-open .icon-close     { display: block; }
.mobile-menu-toggle.is-open .menu-text      { display: none; }

/* ============================================================
   5. THEME TOGGLE
   ============================================================ */

.theme-toggle { border: 0; background: transparent; padding: 0; cursor: pointer; }

.theme-toggle-track {
    width: 74px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    position: relative;
    background: var(--header-chip-bg);
    border: 1px solid var(--header-chip-border);
    box-shadow: var(--header-chip-shadow);
}

.theme-toggle-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffd868 0%, #efb122 100%);
    box-shadow: 0 8px 18px rgba(239, 177, 34, 0.24);
    transition: transform 0.25s ease;
}

html[data-theme="dark"] .theme-toggle-thumb { transform: translateX(32px); }

.theme-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #74809a;
    z-index: 1;
}

.theme-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html[data-theme="dark"]  .theme-icon-moon,
html[data-theme="light"] .theme-icon-sun  { color: #0f172a; }
html[data-theme="dark"]  .theme-icon-sun  { color: #8a96b0; }
html[data-theme="light"] .theme-icon-moon { color: #8a96b0; }

/* ============================================================
   6. PROFILE DROPDOWN
   ============================================================ */

.profile-dropdown { position: relative; }

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--header-chip-border);
    background: var(--header-chip-bg);
    border-radius: 18px;
    padding: 8px 12px 8px 8px;
    box-shadow: var(--header-chip-shadow);
    cursor: pointer;
}

.profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(145deg, #2dd4bf, #2563eb);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    min-width: 0;
}

.profile-copy strong {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    color: var(--profile-title-color);
}

.profile-copy span {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: var(--profile-subtitle-color);
}

.profile-caret {
    width: 18px;
    height: 18px;
    stroke: var(--profile-caret-color);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

.profile-dropdown.is-open .profile-caret { transform: rotate(180deg); }

.profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 210px;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--profile-menu-border);
    background: var(--profile-menu-bg);
    box-shadow: var(--profile-menu-shadow);
    z-index: 100;
    display: none;
}

.profile-dropdown.is-open .profile-menu { display: block; }

.profile-menu-item {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--profile-title-color);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.profile-menu-item:hover  { background: var(--profile-menu-hover); }
.profile-menu-logout      { color: var(--danger); }

/* ============================================================
   7. NAVIGATION MENU BAR
   ============================================================ */

.menu-bar {
    position: relative;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: visible;
    padding: 10px 16px;
    border-radius: 22px;
    border: 1px solid var(--menu-bar-border);
    background: var(--menu-bar-bg);
    box-shadow: var(--menu-bar-shadow);
    z-index: 50;
}

.menu-bar::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: var(--menu-top-line);
    pointer-events: none;
    border-radius: 22px 22px 0 0;
}

.menu-item,
.menu-item-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 17px;
    font-weight: 500;
    border-radius: 13px;
    white-space: nowrap;
    border: 1px solid transparent;
    background: transparent;
    color: var(--menu-text-color);
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

.menu-item:hover,
.menu-item-btn:hover,
.menu-item.is-active,
.menu-dropdown-wrap.is-active .menu-item-btn {
    color: var(--menu-active-text);
    border-color: var(--menu-active-border);
    background: linear-gradient(135deg, var(--menu-active-start) 0%, var(--menu-active-end) 100%);
    box-shadow: var(--menu-active-shadow);
    transform: translateY(-1px);
}

.menu-item:hover .menu-icon,
.menu-item.is-active .menu-icon,
.menu-item-btn:hover .menu-icon { color: var(--menu-accent); }

.menu-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--menu-icon-color);
    flex-shrink: 0;
}

.menu-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.menu-chevron {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    margin-left: 2px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

/* ============================================================
   8. MENU DROPDOWN
   ============================================================ */

.menu-dropdown-wrap {
    position: relative;
    flex-shrink: 0;
    z-index: 200;
}

.menu-dropdown-wrap:hover .menu-chevron,
.menu-dropdown-wrap.is-open .menu-chevron {
    transform: rotate(180deg);
}

.menu-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    min-width: 220px;
    background: var(--surface);
    border: 1.5px solid rgba(255, 255, 255, 0.13);
    border-radius: 16px;
    padding: 6px;
    box-shadow:
        0 24px 56px rgba(0, 0, 0, 0.28),
        0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0.18s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

[data-theme="dark"] .menu-dropdown {
    background: rgba(12, 18, 36, 0.97);
    border-color: rgba(255, 255, 255, 0.09);
}

.menu-dropdown-wrap:hover .menu-dropdown,
.menu-dropdown-wrap.is-open .menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.menu-dropdown::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 10px solid transparent;
    border-bottom-color: rgba(255, 255, 255, 0.13);
}

.menu-dropdown::after {
    content: '';
    position: absolute;
    bottom: calc(100% - 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 9px solid transparent;
    border-bottom-color: var(--surface);
}

[data-theme="dark"] .menu-dropdown::after {
    border-bottom-color: rgba(12, 18, 36, 0.97);
}

.menu-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease;
}

.menu-dropdown-item:hover {
    background: var(--dropdown-hover-bg);
    color: var(--dropdown-hover-text);
}

.menu-dropdown-item svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    opacity: 0.65;
}

/* ============================================================
   9. MOBILE HAMBURGER & SIDEBAR
   ============================================================ */

.mobile-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-sidebar-overlay.is-open { opacity: 1; visibility: visible; }

.mobile-sidebar {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 70%;
    max-width: 320px;
    z-index: 1001;
    background: var(--menu-bar-bg, #0f1b2d);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.34, 1.2, 0.64, 1);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

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

.mobile-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.04);
}

.mobile-sidebar-brand { display: flex; align-items: center; gap: 12px; }

.mobile-sidebar-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    opacity: 0.9;
}

.mobile-sidebar-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.mobile-sidebar-close:hover {
    background: var(--mobile-sidebar-close-hover-bg);
    color: var(--mobile-sidebar-close-hover-text);
}

.mobile-sidebar-close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.mobile-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mobile-sidebar-nav::-webkit-scrollbar       { width: 4px; }
.mobile-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 999px; }

.msb-item-wrap { display: flex; flex-direction: column; }

.msb-item,
.msb-item-btn {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 14px;
    border-radius: 13px;
    font-size: 15px;
    font-weight: 600;
    color: var(--mobile-nav-text);
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    font-family: inherit;
    width: 100%;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
}

.msb-item:hover,
.msb-item-btn:hover {
    background: var(--mobile-nav-hover-bg);
    color: var(--mobile-nav-hover-text);
}

.msb-item.is-active,
.msb-item-btn.is-active {
    background: linear-gradient(
        135deg,
        var(--menu-active-start, rgba(13, 148, 136, 0.3)) 0%,
        var(--menu-active-end,   rgba(13, 148, 136, 0.1)) 100%
    );
    color: #fff;
    border-color: rgba(255, 255, 255, 0.12);
}

.msb-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.msb-item:hover     .msb-icon,
.msb-item-btn:hover .msb-icon     { background: rgba(255, 255, 255, 0.14); }
.msb-item.is-active .msb-icon,
.msb-item-btn.is-active .msb-icon { background: rgba(13, 148, 136, 0.3); }

.msb-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--menu-icon-color, rgba(128, 230, 222, 0.96));
}

.msb-label { flex: 1; }

.msb-chevron {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    opacity: 0.5;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.msb-item-wrap.is-dd-open .msb-chevron { transform: rotate(180deg); }

.msb-dropdown {
    display: none;
    flex-direction: column;
    padding: 4px 0 4px 20px;
    gap: 2px;
}

.msb-item-wrap.is-dd-open .msb-dropdown { display: flex; }

.msb-sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--mobile-nav-sub-text);
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
}

.msb-sub-item:hover {
    background: var(--mobile-nav-sub-hover-bg);
    color: var(--mobile-nav-sub-hover-text);
}

.msb-sub-item svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.6;
    flex-shrink: 0;
}

.mobile-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.msb-footer-version {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 500;
}

/* ============================================================
   10. MAIN CONTENT AREA
   ============================================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--card-border);
    border-radius: 22px;
    box-shadow: var(--card-shadow);
}

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

.page-head h1 { margin: 0; font-size: 28px; }
.page-head p  { margin: 6px 0 0; color: var(--muted); }

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

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

.stat        { padding: 20px; }
.stat-label  { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat-value  { font-size: 30px; font-weight: 700; }

.panel { padding: 24px; margin-top: 22px; }

.list { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.7; }

.alert {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-danger {
    background: var(--alert-danger-bg);
    color: var(--danger);
    border: 1px solid var(--alert-danger-border);
}

/* ============================================================
   11. FOOTER
   ============================================================ */

.app-footer {
    width: min(1540px, calc(100% - 40px));
    margin: 16px auto 24px;
    padding: 16px 24px;
    border-radius: 18px;
    background: var(--menu-bar-bg);
    border: 1px solid var(--menu-bar-border);
    box-shadow: var(--menu-bar-shadow);
}

.app-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.app-footer-brand { display: flex; align-items: center; gap: 10px; }

.footer-dumbbell {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--menu-icon-color);
    animation: footerPump 2.4s ease-in-out infinite;
}

.footer-dumbbell svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes footerPump {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.15); }
}

.footer-brand-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--menu-text-color);
    opacity: 0.85;
}

.app-footer-center {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--menu-text-color);
    opacity: 0.6;
}

.app-footer-center strong { color: var(--menu-icon-color); font-weight: 700; opacity: 1; }

.footer-dot { opacity: 0.4; }

.app-footer-right {
    font-size: 12px;
    color: var(--menu-text-color);
    opacity: 0.5;
}

/* ============================================================
   12. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ── 1400px ──────────────────────────────────────────────────── */
@media (max-width: 1400px) {
    .menu-item,
    .menu-item-btn {
        padding: 9px 13px;
        font-size: 15px;
        gap: 7px;
    }
}

/* ── 1200px ──────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .menu-item,
    .menu-item-btn {
        padding: 9px 11px;
        font-size: 14px;
        gap: 6px;
    }

    .menu-icon,
    .menu-icon svg { width: 17px; height: 17px; }

    .profile-copy strong { max-width: 130px; }
    .profile-copy span   { max-width: 130px; }
    .brand-copy strong   { font-size: 15px; }
    .brand-copy span     { font-size: 12px; }

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

/* ── 992px ───────────────────────────────────────────────────── */
@media (max-width: 992px) {
    .app-shell,
    .content { width: calc(100% - 32px); }

    .menu-bar  { gap: 2px; padding: 8px; }

    .menu-item,
    .menu-item-btn {
        padding: 9px 10px;
        font-size: 13px;
        gap: 5px;
    }

    .menu-icon,
    .menu-icon svg { width: 16px; height: 16px; }

    .menu-chevron        { display: none; }

    .brand-copy strong   { font-size: 14px; }
    .brand-copy span     { display: none; }
    .brand-logo-box      { width: 44px; height: 44px; font-size: 20px; }

    .theme-toggle-track  { width: 64px; height: 38px; }
    .theme-toggle-thumb  { width: 28px; height: 28px; }
    html[data-theme="dark"] .theme-toggle-thumb { transform: translateX(26px); }

    .profile-trigger     { padding: 6px 10px 6px 6px; gap: 8px; }
    .profile-avatar      { width: 38px; height: 38px; font-size: 14px; }
    .profile-copy strong { max-width: 110px; font-size: 13px; }
    .profile-copy span   { display: none; }
    .header-actions      { gap: 10px; }
}

/* ── 768px: Mobile ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .menu-bar            { display: none; }
    .mobile-menu-toggle  { display: inline-flex; }

    .app-shell,
    .content { width: calc(100% - 24px); margin-top: 10px; }

    .app-header { gap: 12px; }

    .brand-logo-box    { width: 40px; height: 40px; font-size: 18px; border-radius: 13px; }
    .brand-link        { gap: 10px; }
    .brand-copy strong { font-size: 14px; }
    .brand-copy span   { display: none; }

    .theme-toggle-track  { width: 56px; height: 34px; padding: 0 8px; }
    .theme-toggle-thumb  { width: 24px; height: 24px; top: 5px; left: 5px; }
    html[data-theme="dark"] .theme-toggle-thumb { transform: translateX(22px); }
    .theme-icon,
    .theme-icon svg { width: 14px; height: 14px; }

    .profile-trigger { padding: 4px; border-radius: 50%; gap: 0; }
    .profile-avatar  { width: 36px; height: 36px; font-size: 13px; }
    .profile-copy    { display: none; }
    .profile-caret   { display: none; }
    .header-actions  { gap: 8px; }

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

    .app-footer { width: calc(100% - 24px); margin: 12px auto 16px; padding: 12px 16px; }
    .app-footer-inner { flex-direction: column; gap: 8px; text-align: center; }
    .app-footer-brand { justify-content: center; }
}

/* ── 576px ───────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .app-shell,
    .content { width: calc(100% - 16px); margin-top: 8px; }

    .menu-bar { border-radius: 16px; }

    .brand-copy          { display: none; }
    .brand-logo-box      { width: 38px; height: 38px; border-radius: 12px; }

    .theme-toggle-track  { width: 50px; height: 30px; padding: 0 6px; }
    .theme-toggle-thumb  { width: 22px; height: 22px; top: 4px; left: 4px; }
    html[data-theme="dark"] .theme-toggle-thumb { transform: translateX(20px); }

    .header-actions      { gap: 6px; }

    .grid { grid-template-columns: 1fr; }

    .app-footer       { width: calc(100% - 16px); }
    .app-footer-right { display: none; }
}

/* ── Desktop only: hide mobile elements ──────────────────────── */
@media (min-width: 769px) {
    .mobile-menu-toggle      { display: none; }
    .mobile-sidebar-overlay  { display: none; }
    .mobile-sidebar          { display: none; }
}