/* CSS Design System for Periodização Modelo 2 App */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette */
    --bg-main: #0a0d14;
    --bg-sidebar: #101422;
    --bg-card: rgba(22, 28, 45, 0.7);
    --bg-input: #1b2136;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent: #00f2fe;
    --accent-hover: #4facfe;
    --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Layout */
    --sidebar-width: 280px;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-radius: 16px;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

h1, h2, h3, h4, .brand, .week-num {
    font-family: 'Outfit', sans-serif;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
}

.brand {
    padding: 24px;
    font-size: 22px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 16px 8px;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu li {
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.sidebar-menu li:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.sidebar-menu li.active {
    background: var(--accent-gradient);
    color: var(--bg-main);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.25);
}

.sidebar-menu li i {
    margin-right: 12px;
    font-size: 18px;
}

.sidebar-footer {
    padding: 16px 24px;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    line-height: 1.4;
}

/* App Shell Layout */
.app-shell {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    display: block;
    height: 100vh;
}

/* Form Group Styling */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}

/* Main Content Area */
.main-content {
    padding: 24px;
    overflow-y: auto;
    height: 100vh;
    background-color: var(--bg-main);
}

.main-content section {
    display: none;
}

.main-content section.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

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

.section-header {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2px;
}

.section-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Active Week Badge */
.active-week-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.15);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    margin-top: 6px;
    width: fit-content;
}

/* Apresentação Grid layout */
.apresentacao-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: start;
}

.profile-card {
    height: auto;
}

/* Periodization Curve (SVG + Controls) */
.periodization-ctrl {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.slider-container input[type="range"] {
    flex-grow: 1;
    -webkit-appearance: none;
    background: var(--bg-input);
    height: 6px;
    border-radius: 3px;
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
    transition: var(--transition);
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

.slider-container input[type="number"] {
    width: 65px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

/* SVG Curve Line styling */
.chart-point:hover {
    fill: var(--accent-hover) !important;
    r: 7px !important;
}

.chart-point.active {
    filter: drop-shadow(0 0 8px var(--accent-hover));
}

/* Weekly Info Grid */
.week-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.info-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
}

.info-card span {
    display: block;
}

.info-card .label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.info-card .val {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.info-card .val-accent {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

/* Calculators Layout Grid */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title i {
    color: var(--accent);
}

.data-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.data-row:last-child {
    border-bottom: none;
}

.data-row .label {
    font-size: 13px;
    color: var(--text-secondary);
}

.data-row .value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Prescription Output Card */
.prescription-card {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.08) 0%, rgba(79, 172, 254, 0.04) 100%);
    border: 1px dashed rgba(0, 242, 254, 0.3);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.prescription-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.prescription-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.prescription-card p:last-child {
    margin-bottom: 0;
}

.prescription-card strong {
    color: var(--accent-hover);
}

/* Training Week Calendar Grid */
.week-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.calendar-day-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.calendar-day-card.active-day {
    border-color: rgba(0, 242, 254, 0.4);
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(0, 242, 254, 0.02) 100%);
}

.day-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 6px;
}

.exercise-list {
    list-style: none;
}

.exercise-list li {
    font-size: 12px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.exercise-list li:last-child {
    margin-bottom: 0;
}

.exercise-list li .ex-name {
    font-weight: 600;
    color: var(--text-primary);
}

.exercise-list li .ex-load {
    color: var(--text-secondary);
    font-size: 11px;
}

.exercise-list li .ex-load small {
    color: var(--text-muted);
}

.empty-day {
    color: var(--text-muted) !important;
    font-style: italic;
    font-size: 11px;
    text-align: center;
    padding: 10px 0;
}

/* Apresentação styling */
.about-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

.about-card h3 {
    font-size: 22px;
    color: var(--accent);
    margin-bottom: 16px;
    font-weight: 600;
}

.about-card p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.about-card ul {
    list-style-type: none;
    margin-bottom: 16px;
    padding-left: 10px;
}

.about-card ul li {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.about-card ul li::before {
    content: "✓";
    color: var(--accent);
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
}

.credits {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.panel-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

/* Responsive adjust */
@media(max-width: 1024px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-bottom: 1px solid var(--border-color);
        border-right: none;
    }
    .brand {
        padding: 16px;
        text-align: center;
    }
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 8px;
        flex-direction: row;
        white-space: nowrap;
    }
    .sidebar-menu li {
        margin-bottom: 0;
        margin-right: 8px;
        display: inline-flex;
    }
    .sidebar-footer {
        display: none;
    }
    .app-shell {
        margin-left: 0;
        width: 100%;
        height: auto;
    }
    .main-content {
        height: auto;
    }
    .apresentacao-grid {
        grid-template-columns: 1fr;
    }
}

/* Button styling */
.btn {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn.active {
    background: var(--accent-gradient);
    color: var(--bg-main);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 242, 254, 0.2);
}

.btn-accent {
    background: var(--accent-gradient);
    color: var(--bg-main);
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-accent:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

/* Alert Box */
.alert-box {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 14px;
    color: var(--warning);
    font-size: 13px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert-box i {
    font-size: 16px;
    margin-top: 2px;
}
.alert-box strong {
    color: var(--text-primary);
}

/* Borg Scale buttons */
.borg-scale-container {
    margin-top: 10px;
}

.borg-btn {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 4px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.borg-btn span {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.borg-btn small {
    font-size: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.borg-btn:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Color Coding for Borg Scale intensity levels */
.borg-btn[data-val="0"].active { background: #3b82f6; color: #fff; border-color: transparent; }
.borg-btn[data-val="1"].active { background: #10b981; color: #fff; border-color: transparent; }
.borg-btn[data-val="2"].active { background: #10b981; color: #fff; border-color: transparent; }
.borg-btn[data-val="3"].active { background: #84cc16; color: #fff; border-color: transparent; }
.borg-btn[data-val="4"].active { background: #eab308; color: #fff; border-color: transparent; }
.borg-btn[data-val="5"].active { background: #f97316; color: #fff; border-color: transparent; }
.borg-btn[data-val="6"].active { background: #f97316; color: #fff; border-color: transparent; }
.borg-btn[data-val="8"].active { background: #ef4444; color: #fff; border-color: transparent; }
.borg-btn[data-val="9"].active { background: #ef4444; color: #fff; border-color: transparent; }
.borg-btn[data-val="10"].active { background: #7f1d1d; color: #fff; border-color: transparent; }

/* History log styling */
.history-item {
    background-color: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 6px;
}

.history-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

.history-badge {
    background-color: rgba(0, 242, 254, 0.1);
    border: 1px solid rgba(0, 242, 254, 0.2);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11px;
    color: var(--accent);
}

.history-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    font-size: 13px;
}

.history-sub-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-text {
    color: var(--text-secondary);
    line-height: 1.4;
}

.history-pse-display {
    position: absolute;
    right: 16px;
    bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 8px;
}

.history-pse-num {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.history-delete-btn {
    color: var(--danger);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-left: 12px;
    transition: var(--transition);
}

.history-delete-btn:hover {
    transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════
   MOBILE RESPONSIVE LAYOUT
   ═══════════════════════════════════════════════════════ */

/* Mobile header — hidden on desktop */
.mobile-header {
    display: none;
}

/* Mobile overlay backdrop */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    z-index: 305; /* above header(300), below sidebar(310) */
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.mobile-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Close btn inside sidebar brand — hidden on desktop */
.sidebar-close-btn {
    display: none;
}

/* Mobile sidebar header — hidden on desktop */
.sidebar-mobile-header {
    display: none;
}

/* Mobile bottom nav — hidden on desktop */
.mobile-bottom-nav {
    display: none;
}

/* ─ Mobile popup menu nav items ─ */
.mob-popup-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 20px;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    margin-bottom: 4px;
    border: 1px solid transparent;
}
.mob-popup-item i {
    font-size: 17px;
    width: 22px;
    text-align: center;
    color: #64748b;
    transition: color 0.18s;
}
.mob-popup-item:hover  { background: rgba(0,242,254,0.06); color: #e2e8f0; }
.mob-popup-item.active {
    background: linear-gradient(135deg,rgba(0,242,254,0.15),rgba(79,71,228,0.15));
    color: #00f2fe;
    border-color: rgba(0,242,254,0.25);
    font-weight: 700;
}
.mob-popup-item.active i { color: #00f2fe; }

/* ─ Leaderboard Ranking Styles ─ */
.rank-filter-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.rank-filter-btn:hover {
    background: rgba(0,242,254,0.1);
    color: var(--text-primary);
}
.rank-filter-btn.active {
    background: var(--accent);
    color: #0b0f19;
    border-color: var(--accent);
    font-weight: 700;
}
.rank-user-row {
    background: rgba(0, 242, 254, 0.08) !important;
    border-left: 3px solid var(--accent);
}
.rank-user-row td {
    color: #f8fafc !important;
    font-weight: 700;
}
.podium-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}
.podium-card:hover {
    transform: translateY(-2px);
}
.podium-card.gold {
    border-color: rgba(234, 179, 8, 0.4);
    background: linear-gradient(180deg, rgba(234, 179, 8, 0.1) 0%, rgba(15, 20, 35, 0.6) 100%);
}
.podium-card.silver {
    border-color: rgba(148, 163, 184, 0.4);
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.1) 0%, rgba(15, 20, 35, 0.6) 100%);
}
.podium-card.bronze {
    border-color: rgba(180, 83, 9, 0.4);
    background: linear-gradient(180deg, rgba(180, 83, 9, 0.1) 0%, rgba(15, 20, 35, 0.6) 100%);
}

.badge-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}
.badge-card.unlocked {
    border-color: rgba(0, 242, 254, 0.35);
    background: rgba(0, 242, 254, 0.05);
}
.badge-card.special {
    border: 2px solid #eab308 !important;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.25);
}
.badge-card.special .badge-icon-box {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.3), rgba(245, 158, 11, 0.3)) !important;
    color: #eab308 !important;
    border: 1px solid rgba(234, 179, 8, 0.6) !important;
}
.badge-card.locked {
    opacity: 0.55;
    filter: grayscale(80%);
}
.badge-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.badge-card.unlocked .badge-icon-box {
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(79, 71, 228, 0.2));
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.4);
}
.badge-card.locked .badge-icon-box {
    background: rgba(255, 255, 255, 0.05);
    color: #64748b;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.xp-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}
.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00f2fe, #4f46e5);
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* ── Mobile breakpoint ── */
@media (max-width: 768px) {

    body {
        flex-direction: column;
    }

    /* ─ Mobile Header ─ */
    .mobile-header {
        display: flex;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: var(--bg-sidebar);
        border-bottom: 1px solid var(--border-color);
        padding: 0 16px;
        z-index: 300;
        gap: 12px;
    }

    .mobile-brand {
        flex: 1;
        font-family: 'Outfit', sans-serif;
        font-size: 18px;
        font-weight: 700;
        background: var(--accent-gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        letter-spacing: 0.5px;
    }

    .mobile-header-week {
        font-family: 'Outfit', sans-serif;
        font-size: 13px;
        font-weight: 700;
        color: var(--accent);
        background: rgba(0,242,254,0.08);
        border: 1px solid rgba(0,242,254,0.2);
        border-radius: 8px;
        padding: 4px 10px;
    }

    /* ─ Hamburger Button ─ */
    .hamburger-btn {
        background: none;
        border: none;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 32px;
        height: 32px;
        padding: 4px;
        border-radius: 8px;
        transition: background 0.2s;
    }
    .hamburger-btn:hover {
        background: rgba(255,255,255,0.06);
    }
    .hamburger-btn span {
        display: block;
        height: 2px;
        background: var(--text-primary);
        border-radius: 2px;
        transition: var(--transition);
    }
    .hamburger-btn.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .hamburger-btn.open span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .hamburger-btn.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* ─ Sidebar as full-screen slide-in drawer (Grid layout) ─ */
    .sidebar {
        position: fixed !important;
        left: -100% !important;
        top: 0 !important;
        width: min(300px, 88vw) !important;
        height: 100vh !important;
        z-index: 310 !important;
        display: grid !important;
        grid-template-rows: auto 1fr auto !important;
        overflow: hidden !important;
        transition: left 0.3s cubic-bezier(0.4,0,0.2,1) !important;
        box-shadow: 4px 0 40px rgba(0,0,0,0.6) !important;
    }
    .sidebar.open {
        left: 0 !important;
    }

    /* Hide internal brand on mobile */
    .sidebar .brand {
        display: none !important;
    }

    /* Menu fills grid row 2 and scrolls */
    .sidebar .sidebar-menu {
        overflow-y: auto !important;
        padding: 12px 8px !important;
    }

    /* Footer anchored to grid row 3 */
    .sidebar .sidebar-footer {
        border-top: 1px solid var(--border-color);
    }

    /* Mobile sidebar top bar with title + close btn */
    .sidebar-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        font-family: 'Outfit', sans-serif;
        font-size: 16px;
        font-weight: 700;
        color: var(--text-primary);
        flex-shrink: 0;
    }
    .sidebar-mobile-header button {
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 20px;
        cursor: pointer;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s, color 0.2s;
    }
    .sidebar-mobile-header button:hover {
        background: rgba(255,255,255,0.08);
        color: var(--text-primary);
    }

    /* Close X button inside sidebar */
    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 18px;
        cursor: pointer;
        margin-left: auto;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        transition: background 0.2s, color 0.2s;
    }
    .sidebar-close-btn:hover {
        background: rgba(255,255,255,0.08);
        color: var(--text-primary);
    }

    /* Brand row: icon+title + close button */
    .brand {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* ─ App shell shifts down by header height ─ */
    .app-shell {
        margin-left: 0;
        width: 100%;
        margin-top: 56px;
        margin-bottom: 64px; /* space for bottom nav */
        height: auto;
    }

    .main-content {
        height: auto;
        min-height: calc(100vh - 56px - 64px);
        padding: 16px;
    }

    /* ─ Bottom Navigation Bar ─ */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: var(--bg-sidebar);
        border-top: 1px solid var(--border-color);
        z-index: 300;
        padding: 0 4px;
        align-items: stretch;
    }

    .mob-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 10px;
        font-family: 'Inter', sans-serif;
        font-weight: 500;
        cursor: pointer;
        padding: 6px 4px;
        border-radius: 12px;
        margin: 6px 2px;
        transition: var(--transition);
        position: relative;
    }
    .mob-nav-btn i {
        font-size: 18px;
        transition: var(--transition);
    }
    .mob-nav-btn.active {
        color: var(--accent);
    }
    .mob-nav-btn.active i {
        filter: drop-shadow(0 0 6px rgba(0,242,254,0.6));
    }
    .mob-nav-btn.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 24px;
        height: 3px;
        background: var(--accent-gradient);
        border-radius: 0 0 3px 3px;
    }
    .mob-nav-btn:active {
        transform: scale(0.92);
    }

    /* ─ Section header sizing on mobile ─ */
    .section-header h2 {
        font-size: 22px;
    }

    /* ─ calc-grid single column on mobile ─ */
    .calc-grid {
        grid-template-columns: 1fr !important;
    }
}
