/* Reset e variabili */
:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --dark-color: #2d3436;
    --light-color: #f9f9f9;
    --accent-color: #ffeaa7;
    --danger-color: #ff7675;
    --warning-color: #f1c40f;
    --success-color: #00b894;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --footer-height: 40px;
    --footer-logo-height: 32px;
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --footer-safe-height: calc(var(--footer-height) + var(--safe-area-bottom));
    --app-height: 100vh;
    --transition-speed: 0.3s;
    --border-color: #e0e0e0;
    --text-secondary: #666;
    --text-muted: #999;
    --surface-color: #ffffff;
    --surface-muted: #f8f9fa;
    --surface-alt: #f3f3f3;
    --surface-translucent: rgba(255, 255, 255, 0.7);
    --glass-surface: rgba(255, 255, 255, 0.58);
    --glass-border-color: rgba(255, 255, 255, 0.42);
    --glass-highlight: linear-gradient(145deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.2) 24%, rgba(255, 255, 255, 0.06) 54%, rgba(255, 255, 255, 0.24) 100%);
    --panel-surface: var(--surface-color);
    --panel-border: var(--border-color);
    --panel-shadow: var(--shadow);
    --footer-bg: rgba(255, 255, 255, 0.95);
    --success-bg: #e8f5e9;
    --success-border: #c8e6c9;
    --danger-bg: #ffebee;
    --danger-border: #ffcdd2;
    --warning-bg: #fff8e1;
    --warning-border: #ffe082;
    --info-bg: rgba(255, 107, 107, 0.12);
    --info-border: rgba(255, 107, 107, 0.28);
    --info-color: var(--dark-color);
    --solid-button-ink: #ffffff;
    --button-secondary-bg: #6c757d;
    --button-secondary-hover: #5a6268;
    --button-danger-bg: #dc3545;
    --button-danger-hover: #c82333;
    --hero-gradient-start: #ff6b6b;
    --hero-gradient-mid: #ff8a5b;
    --hero-gradient-end: #ffd166;
    --hero-border-color: #2b1d1d;
    --hero-shadow-step: rgba(43, 29, 29, 0.18);
    --hero-title-color: #1f1717;
    --hero-copy-color: #2b1d1d;
    --hero-pill-bg: rgba(255, 255, 255, 0.88);
    --hero-pill-border: #1f1717;
    --hero-pill-ink: #111111;
    --hero-pill-shadow: rgba(255, 255, 255, 0.9);
    --hero-action-bg: #1f1717;
    --hero-action-hover: #2b1d1d;
    --hero-action-ink: #fff4e6;
    --bg-light: var(--surface-muted);
    --page-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --hover-transform: translateY(-2px);
    --pizza-counter-bg: url('../images/pizza-margherita-round.png');
    --ui-pizza-pattern-image: url('../images/pizza-pattern.png');

    --aside-width: 96px;

    @media (max-width: 1280px) and (max-height: 720px) {
        --footer-height: 34px;
        --aside-width: 88px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        --footer-height: 32px;
        --aside-width: 72px;
    }
}

@supports (height: 100svh) {
    :root {
        --app-height: 100svh;
    }
}

@supports (height: 100dvh) {
    :root {
        --app-height: 100dvh;
    }
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: "Bungee", sans-serif;

    strong {
        font-family: "Bungee", sans-serif;
    }
}

.title-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.title-with-icon .title-icon {
    color: var(--primary-color);
    font-size: 0.95em;
    line-height: 1;
}

[hidden] {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--page-bg);
    min-height: 100vh;
    min-height: 100svh;
    min-height: var(--app-height);
    color: var(--dark-color);
    color-scheme: light;
}

body.modal-open {
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    :root {
        --page-bg: linear-gradient(135deg, #0f1115 0%, #1f2430 100%);
        --surface-color: #1b2029;
        --surface-muted: #242a35;
        --surface-alt: #2b323f;
        --surface-translucent: rgba(27, 32, 41, 0.7);
        --glass-surface: rgba(27, 32, 41, 0.58);
        --glass-border-color: rgba(255, 255, 255, 0.16);
        --glass-highlight: linear-gradient(145deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.1) 24%, rgba(255, 255, 255, 0.02) 54%, rgba(255, 255, 255, 0.12) 100%);
        --footer-bg: rgba(27, 32, 41, 0.95);
        --dark-color: #f2f4f7;
        --text-secondary: #a7b0bc;
        --text-muted: #8b94a3;
        --border-color: #3a4250;
        --shadow: 0 6px 12px rgba(0, 0, 0, 0.45);
        --success-bg: rgba(0, 184, 148, 0.18);
        --success-border: rgba(0, 184, 148, 0.45);
        --danger-bg: rgba(255, 118, 117, 0.18);
        --danger-border: rgba(255, 118, 117, 0.45);
        --warning-bg: rgba(241, 196, 15, 0.2);
        --warning-border: rgba(241, 196, 15, 0.45);
    }

    body {
        color-scheme: dark;
    }
}

html[data-theme="light"] {
    --page-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --surface-color: #ffffff;
    --surface-muted: #f8f9fa;
    --surface-alt: #f3f3f3;
    --surface-translucent: rgba(255, 255, 255, 0.7);
    --glass-surface: rgba(255, 255, 255, 0.58);
    --glass-border-color: rgba(255, 255, 255, 0.42);
    --glass-highlight: linear-gradient(145deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.2) 24%, rgba(255, 255, 255, 0.06) 54%, rgba(255, 255, 255, 0.24) 100%);
    --footer-bg: rgba(255, 255, 255, 0.95);
    --dark-color: #2d3436;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --success-bg: #e8f5e9;
    --success-border: #c8e6c9;
    --danger-bg: #ffebee;
    --danger-border: #ffcdd2;
    color-scheme: light;
}

html[data-theme="dark"] {
    --page-bg: linear-gradient(135deg, #0f1115 0%, #1f2430 100%);
    --surface-color: #1b2029;
    --surface-muted: #242a35;
    --surface-alt: #2b323f;
    --surface-translucent: rgba(27, 32, 41, 0.7);
    --glass-surface: rgba(27, 32, 41, 0.58);
    --glass-border-color: rgba(255, 255, 255, 0.16);
    --glass-highlight: linear-gradient(145deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.1) 24%, rgba(255, 255, 255, 0.02) 54%, rgba(255, 255, 255, 0.12) 100%);
    --footer-bg: rgba(27, 32, 41, 0.95);
    --dark-color: #f2f4f7;
    --text-secondary: #a7b0bc;
    --text-muted: #8b94a3;
    --border-color: #3a4250;
    --shadow: 0 6px 12px rgba(0, 0, 0, 0.45);
    --success-bg: rgba(0, 184, 148, 0.18);
    --success-border: rgba(0, 184, 148, 0.45);
    --danger-bg: rgba(255, 118, 117, 0.18);
    --danger-border: rgba(255, 118, 117, 0.45);
    color-scheme: dark;
}

.site-footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: var(--footer-safe-height);
    padding-bottom: var(--safe-area-bottom);
    background: var(--footer-bg);
    /* border-top: 1px solid var(--border-color); */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    
    .footer-content {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 16px;
        color: var(--text-secondary);
        font-size: 0.9rem;
        
        .footer-logo {
            height: var(--footer-logo-height);
            width: auto;
            display: block;
        }
        
        .footer-text i {
            margin-right: 6px;
            color: var(--text-secondary);
        }
    }
}

html[data-ui-pizza-pattern="1"] .dashboard-sidebar,
html[data-ui-pizza-pattern="1"] .site-footer,
html[data-ui-pizza-pattern="1"] .greeting-section,
html[data-ui-pizza-pattern="1"] .stat-card,
html[data-ui-pizza-pattern="1"] .account-topbar,
html[data-ui-pizza-pattern="1"] .modal .modal-header,
html[data-ui-pizza-pattern="1"] .fullscreen-modal .modal-content .modal-header {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

html[data-ui-pizza-pattern-theme="salamino_piccante"] {
    --ui-pizza-pattern-image: url('../images/pizza-pattern.png');
}

html[data-ui-pizza-pattern-theme="olive_funghi"] {
    --ui-pizza-pattern-image: url('../images/olive-funghi-pattern.png');
}

html[data-ui-pizza-pattern-theme="quattro_formaggi"] {
    --ui-pizza-pattern-image: url('../images/4-formaggi-pattern.png');
}

html[data-ui-pizza-pattern-theme="fit"] {
    --ui-pizza-pattern-image: url('../images/fit-pattern.png');
}

html[data-ui-pizza-pattern="1"] .dashboard-sidebar::before,
html[data-ui-pizza-pattern="1"] .site-footer::before,
html[data-ui-pizza-pattern="1"] .greeting-section::before,
html[data-ui-pizza-pattern="1"] .stat-card:not(.main-stat)::before,
html[data-ui-pizza-pattern="1"] .account-topbar::before,
html[data-ui-pizza-pattern="1"] .modal .modal-header::before,
html[data-ui-pizza-pattern="1"] .fullscreen-modal .modal-content .modal-header::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: var(--ui-pizza-pattern-image);
    background-repeat: repeat;
    background-size: 80%;
    opacity: 0.25;
    mix-blend-mode: color-dodge;
}

html[data-ui-pizza-pattern="1"] .dashboard-sidebar::before {
    background-size: 430%;
    opacity: 0.25;
}

html[data-ui-pizza-pattern="1"] .dashboard-page .stats-grid .stat-card::before {
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

html[data-ui-pizza-pattern="1"] .stat-card.main-stat {
    overflow: visible;
}

html[data-ui-pizza-pattern="1"] .dashboard-sidebar > *:not(.version),
html[data-ui-pizza-pattern="1"] .site-footer > *,
html[data-ui-pizza-pattern="1"] .greeting-section > *,
html[data-ui-pizza-pattern="1"] .stat-card > *,
html[data-ui-pizza-pattern="1"] .account-topbar > *,
html[data-ui-pizza-pattern="1"] .modal .modal-header > *,
html[data-ui-pizza-pattern="1"] .fullscreen-modal .modal-content .modal-header > * {
    position: relative;
    z-index: 1;
}

html[data-ui-pizza-pattern="1"] .dashboard-sidebar .sidebar-btn {
    border: 1px solid rgba(0, 0, 0, 0.16);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
}

html[data-ui-pizza-pattern="1"] .dashboard-sidebar .sidebar-btn i {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

html[data-ui-pizza-pattern="1"] .dashboard-sidebar .version {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
    background: linear-gradient(180deg, #ff5a5a 0%, #d92f2f 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.28);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

html[data-ui-pizza-pattern="1"] .dashboard-sidebar .sidebar-username,
html[data-ui-pizza-pattern="1"] .dashboard-sidebar .theme-label,
html[data-ui-pizza-pattern="1"] .dashboard-sidebar .sidebar-logout,
html[data-ui-pizza-pattern="1"] .site-footer .footer-content,
html[data-ui-pizza-pattern="1"] .site-footer .footer-text,
html[data-ui-pizza-pattern="1"] .greeting-section h2,
html[data-ui-pizza-pattern="1"] .greeting-section p,
html[data-ui-pizza-pattern="1"] .stat-card .stat-label,
html[data-ui-pizza-pattern="1"] .stat-card .stat-value,
html[data-ui-pizza-pattern="1"] .modal .modal-header .modal-title,
html[data-ui-pizza-pattern="1"] .modal .modal-header h2,
html[data-ui-pizza-pattern="1"] .fullscreen-modal .modal-content .modal-header h2 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

html[data-ui-pizza-pattern="1"] .modal .modal-header .modal-close,
html[data-ui-pizza-pattern="1"] .fullscreen-modal .modal-content .modal-header .close-modal,
html[data-ui-pizza-pattern="1"] .fullscreen-modal .modal-content .modal-header .modal-close {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

/* Messaggi di errore e successo */
.error-message {
    background: var(--danger-bg);
    border: 2px solid var(--danger-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    color: var(--danger-color);
    box-shadow: var(--shadow);

    i {
        margin-right: 8px;
    }
}

.success-message {
    background: var(--success-bg);
    border: 2px solid var(--success-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    color: var(--success-color);
    box-shadow: var(--shadow);

    i {
        margin-right: 8px;
    }
}

.warning-message {
    background: var(--warning-bg);
    border: 2px solid var(--warning-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    color: var(--warning-color);
    box-shadow: var(--shadow);

    i {
        margin-right: 8px;
    }
}

.info-message {
    background: var(--info-bg);
    border: 2px solid var(--info-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    color: var(--info-color);
    box-shadow: var(--shadow);

    i {
        margin-right: 8px;
    }
}

.toast-container {
    position: fixed;
    top: calc(var(--safe-area-top) + 16px);
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100% - 32px));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: start;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.toast.is-hiding {
    opacity: 0;
    transform: translateY(-6px);
}

.toast--success {
    background: var(--success-bg);
    border-color: var(--success-border);
}

.toast--error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
}

.toast--warning {
    background: var(--warning-bg);
    border-color: var(--warning-border);
}

.toast__icon {
    margin-top: 2px;
    font-size: 1.1rem;
}

.toast--success .toast__icon {
    color: var(--success-color);
}

.toast--error .toast__icon {
    color: var(--danger-color);
}

.toast--warning .toast__icon {
    color: var(--warning-color);
}

.toast__message {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--dark-color);
}

.toast__close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px;
}

@media (max-width: 600px) {
    .toast-container {
        left: 16px;
        right: 16px;
    }
}

/* Pagina di login */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: var(--app-height);
    padding: 20px;
    background-image: url('../images/pizza.webp');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;

    @media (prefers-color-scheme: dark) {
        background-image: linear-gradient(135deg, rgba(15, 17, 21, 0.7), rgba(31, 36, 48, 0.7)), url('../images/pizza.webp');
    }

    @media (max-width: 1280px) and (max-height: 720px) {
        padding: 12px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        padding: 8px;
    }

    > main {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

html[data-theme="light"] {
    .login-page {
        background-image: url('../images/pizza.webp');
    }
}

html[data-theme="dark"] {
    .login-page {
        background-image: linear-gradient(135deg, rgba(15, 17, 21, 0.7), rgba(31, 36, 48, 0.7)), url('../images/pizza.webp');
    }
}

.container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);

    @media (max-width: 768px) {
        flex-direction: column;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        max-width: 920px;
    }
}

.login-card {
    flex: 1;
    padding: 40px;
    background: var(--surface-color);

    @media (max-width: 1280px) and (max-height: 720px) {
        padding: 28px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        padding: 20px;
    }
}

.logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;

    img {
        position: relative;
        display: block;
        max-width: 140px;
        height: auto;

        @media (max-width: 1280px) and (max-height: 720px) {
            max-width: 120px;
        }

        @media (max-width: 960px) and (max-height: 540px) {
            max-width: 96px;
        }
    }

    span {
        i {
            font-size: 2.5rem;
            color: var(--primary-color);
        }
    
        h1 {
            font-size: 1.8rem;
            color: var(--dark-color);

            @media (max-width: 1280px) and (max-height: 720px) {
                font-size: 1.6rem;
            }

            @media (max-width: 960px) and (max-height: 540px) {
                font-size: 1.4rem;
            }
        }
        
        h3 {
            font-size: 1.2rem;
            color: var(--dark-color);

            @media (max-width: 1280px) and (max-height: 720px) {
                font-size: 1.05rem;
            }

            @media (max-width: 960px) and (max-height: 540px) {
                font-size: 0.95rem;
            }
        }
    }

    @media (max-width: 960px) and (max-height: 540px) {
        gap: 8px;
    }
}

.welcome-message {
    margin-bottom: 30px;

    @media (max-width: 1280px) and (max-height: 720px) {
        margin-bottom: 20px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        margin-bottom: 14px;
    }

    h2 {
        font-size: 1.5rem;
        color: var(--dark-color);
        margin-bottom: 10px;
    }

    p {
        color: var(--text-secondary);
    }
}

.form-group {
    margin-bottom: 20px;

    @media (max-width: 1280px) and (max-height: 720px) {
        margin-bottom: 16px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        margin-bottom: 12px;
    }

    label {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
        color: var(--dark-color);
        font-weight: 500;

        @media (max-width: 960px) and (max-height: 540px) {
            margin-bottom: 4px;
            font-size: 0.9rem;
        }
    }

    input {
        width: 100%;
        padding: 12px 16px;
        border: 2px solid var(--border-color);
        border-radius: 8px;
        font-size: 1rem;
        background: var(--surface-color);
        color: var(--dark-color);
        transition: border-color var(--transition-speed);

        &:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        @media (max-width: 1280px) and (max-height: 720px) {
            padding: 10px 14px;
        }

        @media (max-width: 960px) and (max-height: 540px) {
            padding: 8px 12px;
            font-size: 0.95rem;
        }
    }
}

.password-input-wrapper {
    position: relative;

    input {
        padding-right: 44px;
    }

    .password-toggle {
        position: absolute;
        top: 50%;
        right: 12px;
        transform: translateY(-50%);
        border: none;
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        padding: 4px;
        display: inline-flex;
        align-items: center;
        justify-content: center;

        &:hover,
        &:focus-visible {
            color: var(--primary-color);
        }

        &:focus-visible {
            outline: 2px solid rgba(255, 107, 107, 0.35);
            outline-offset: 2px;
        }
    }
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 25px;

    @media (max-width: 1280px) and (max-height: 720px) {
        margin-bottom: 18px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        margin-bottom: 12px;
    }
}

.remember-login-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 220px;
}

.checkbox-hint,
.checkbox-hint-warning {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.25;
    padding-left: 4px;
}

.checkbox-hint {
    color: var(--text-muted);
}

.checkbox-hint-warning {
    color: #b78500;
    font-weight: 700;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;

    @media (max-width: 960px) and (max-height: 540px) {
        font-size: 0.85rem;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-decoration: none;

    &.btn-primary {
        background: var(--primary-color);
        color: white;
        width: 100%;

        &:hover {
            background: #ff5252;
            transform: var(--hover-transform);
        }

        @media (max-width: 1280px) and (max-height: 720px) {
            padding: 10px 18px;
        }

        @media (max-width: 960px) and (max-height: 540px) {
            padding: 8px 14px;
            font-size: 0.95rem;
        }
    }

    &.btn-round {
        width: 80px;
        height: 80px;
        padding: 0;
        border-radius: 50%;
        flex-direction: column;
        gap: 5px;

        @media (max-width: 768px) {
            width: 64px;
            height: 64px;
        }

        i {
            line-height: 1;
            font-size: 1.5rem;
        }
    }

    &.btn-small {
        padding: 6px 12px;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    &.btn-large {
        padding: 15px 40px;
        font-size: 1.1rem;
    }

    &.btn-secondary {
        background: var(--button-secondary-bg);
        color: var(--solid-button-ink);
        border: none;

        &:hover {
            background: var(--button-secondary-hover);
        }
    }

    &.btn-danger {
        background: var(--button-danger-bg);
        color: var(--solid-button-ink);

        &:hover {
            background: var(--button-danger-hover);
        }
    }

    &.btn-icon-round,
    &.btn-icon-action {
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 50%;
        gap: 0;

        i {
            font-size: 0.95rem;
        }
    }
}

.btn-inline-action {
    width: auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 999px;
    gap: 6px;
    line-height: 1;
    justify-content: center;

    i {
        font-size: 0.85rem;
    }
}

.btn-inline-action-label {
    font-size: 0.75rem;
    font-weight: 700;
}

@media (max-width: 640px) {
    .btn-inline-action {
        width: 44px;
        height: 44px;
        padding: 0;
        gap: 0;
    }

    .btn-inline-action-label {
        display: none;
    }
}

.divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: var(--text-muted);

    &::before,
    &::after {
        content: '';
        flex: 1;
        height: 1px;
        background: var(--border-color);
    }

    span {
        padding: 0 15px;
        font-size: 0.9rem;
    }
}

.social-login {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;

    .btn-social {
        flex: 1;
        padding: 12px;
        border: 2px solid var(--border-color);
        background: var(--surface-color);
        border-radius: 8px;
        font-size: 0.9rem;
        cursor: pointer;
        transition: all var(--transition-speed);

        &:hover {
            border-color: var(--primary-color);
            transform: var(--hover-transform);
        }
    }
}

.register-link {
    margin-top: 25px;
    text-align: center;
    color: var(--text-secondary);

    @media (max-width: 1280px) and (max-height: 720px) {
        margin-top: 18px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        margin-top: 12px;
        font-size: 0.9rem;
    }

    a {
        color: var(--primary-color);
        text-decoration: none;
        font-weight: 600;
    }
}

.pizza-illustration {
    isolation: isolate;
    position: relative;
    overflow: hidden;
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--accent-color) 0%, #ffde7d 100%);

    .pizza-slice {
        position: absolute;
        z-index: 2;
        width: 100px;
        height: 100px;
        background: transparent;
        background-image: url('../images/power-pizza-counter.png');
        background-position: center;
        background-size: auto 100%;
        animation: float 6s ease-in-out infinite;

        @media (max-width: 1280px) and (max-height: 720px) {
            width: 86px;
            height: 86px;
        }

        @media (max-width: 960px) and (max-height: 540px) {
            width: 70px;
            height: 70px;
        }

        &:nth-child(1) {
            top: 20%;
            left: 20%;
            animation-delay: 0s;
        }

        &:nth-child(2) {
            top: 25%;
            right: 20%;
            animation-delay: 2s;
        }

        &:nth-child(3) {
            bottom: 20%;
            left: 40%;
            animation-delay: 4s;
        }

        &:nth-child(4) {
            bottom: 30%;
            left: 80%;
            animation-delay: 5s;
        }
        
        &:nth-child(5) {
            top: 30%;
            right: 80%;
            animation-delay: 1s;
        }
        
        &:nth-child(6) {
            top: 50%;
            left: 50%;
            animation-delay: 0s;
        }
    }

    .video {
        position: absolute;
        z-index: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        mix-blend-mode: multiply;
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0) rotate(0deg); 
    }
    50% { 
        transform: translateY(-20px) rotate(10deg); 
    }
}

/* Avatar */
.user-avatar {
    overflow: visible;
    width: 44px;
    height: 44px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;

    img {
        overflow: hidden;
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        aspect-ratio: 1/1;
        border-radius: 50%;
        border: 1px solid var(--border-color);
    }
}

.avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Account */
.account-page {
    background: var(--page-bg);
    min-height: 100vh;
    min-height: var(--app-height);

    @media (prefers-color-scheme: dark) {
        background-image: linear-gradient(135deg, rgba(15, 17, 21, 0.85), rgba(31, 36, 48, 0.85)), url('../images/pizza.webp');
    }
}

html[data-theme="light"] {
    .account-page {
        background-image: url('../images/pizza.webp');
    }
}

html[data-theme="dark"] {
    .account-page {
        background-image: linear-gradient(135deg, rgba(15, 17, 21, 0.85), rgba(31, 36, 48, 0.85)), url('../images/pizza.webp');
    }
}

.account-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-mid) 58%, var(--hero-gradient-end) 100%);
    border-radius: 14px;
    border: 2px solid var(--hero-border-color);
    box-shadow: 0 12px 0 var(--hero-shadow-step), var(--shadow);
    margin: 20px 0 16px;
    min-height: 110px;

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
        align-items: flex-start;
        padding: 16px 18px;
    }
}

.account-topbar-text {
    h1 {
        margin: 0 0 4px 0;
        font-size: 1.6rem;
        color: var(--hero-title-color);
        text-shadow: 0 3px 0 rgba(255, 255, 255, 0.8);
    }

    .title-with-icon .title-icon {
        width: 34px;
        height: 34px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--hero-pill-ink);
        background: var(--hero-pill-bg);
        border: 2px solid var(--hero-pill-border);
        box-shadow: 0 3px 0 var(--hero-pill-shadow);
    }

    p {
        margin: 0;
        color: var(--hero-copy-color);
        font-weight: 700;
    }
}

.account-topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.account-topbar .back-btn {
    background: var(--hero-action-bg);
    color: var(--hero-action-ink);
    border-radius: 999px;
    font-weight: 700;
    border: 2px solid var(--hero-border-color);
}

.account-topbar .back-btn:hover {
    background: var(--hero-action-hover);
    transform: translateX(-3px);
}

.stat-page .stat-topbar {
    margin-bottom: 22px;
}

.stat-topbar-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 10px;
    margin: 0 0 10px 0;
    border-radius: 999px;
    background: var(--hero-pill-bg);
    border: 2px solid var(--hero-pill-border);
    box-shadow: 0 3px 0 var(--hero-pill-shadow);
    color: var(--hero-pill-ink);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
}

.stat-add-btn {
    width: auto;
    min-height: 44px;
    border-radius: 999px;
    font-weight: 700;
    gap: 8px;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;

    h2 {
        margin: 0 0 4px 0;
        font-size: 1.35rem;
        color: var(--dark-color);
    }

    p {
        margin: 0;
        color: var(--text-secondary);
    }

    @media (max-width: 768px) {
        flex-direction: column;
        align-items: flex-start;
    }
}

.section-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 107, 107, 0.08);
    color: var(--dark-color);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.stat-overview {
    margin-bottom: 26px;
}

.stat-overview-grid .stat-card {
    min-height: 0;
}

.stat-overview-card .stat-value {
    word-break: break-word;
}

@media (max-width: 768px) {
    .stat-topbar .account-topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .stat-add-btn {
        align-self: flex-start;
    }
}

.account-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dashboard-page.account-page .dashboard-content.account-content {
    overflow-y: scroll;
    scrollbar-gutter: stable both-edges;
    -webkit-overflow-scrolling: touch;
}

.account-form {
    .profile-layout {
        display: flex;
        gap: 24px;
        align-items: flex-start;
        flex-wrap: wrap;

        @media (max-width: 768px) {
            flex-direction: column;
            align-items: stretch;
        }
    }

    .profile-avatar {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .avatar-preview {
        width: 140px;
        height: 140px;
        border-radius: 16px;
        border: 2px solid var(--border-color);
        background: var(--surface-color);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;

        img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .avatar-placeholder {
            font-size: 1.4rem;
        }
    }

    .avatar-upload {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px;
        border-radius: 999px;
        border: 2px solid var(--border-color);
        background: var(--surface-color);
        color: var(--dark-color);
        font-weight: 600;
        cursor: pointer;
        transition: border-color 0.2s, background 0.2s, transform 0.2s;

        input {
            display: none;
        }

        &:hover {
            border-color: var(--primary-color);
            background: rgba(255, 107, 107, 0.08);
            transform: var(--hover-transform);
        }
    }

    .avatar-hint {
        font-size: 0.85rem;
        color: var(--text-secondary);
        max-width: 220px;
    }

    .profile-fields {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 16px;
        flex: 1;
        min-width: 240px;

        @media (max-width: 768px) {
            grid-template-columns: 1fr;
        }
    }

    .account-meta-value {
        padding: 10px 12px;
        border: 2px dashed var(--border-color);
        border-radius: 8px;
        background: var(--surface-muted);
        color: var(--dark-color);
        font-weight: 600;
    }

    .account-note {
        display: block;
        margin-top: 6px;
        font-size: 0.78rem;
        color: var(--text-secondary);
    }

    .user-id-block {
        h2 {
            margin: 0;
            font-size: 1.2rem;
            color: var(--dark-color);
        }
    }

    .password-section {
        background: var(--surface-muted);
        outline: 2px solid rgba(255, 107, 107, 0.35);
        border-radius: 16px;
        padding: 20px;
        box-shadow: var(--shadow);
        border-bottom: none;
    }

    .security-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .security-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 16px;

        @media (max-width: 768px) {
            grid-template-columns: 1fr;
        }
    }

    .section-hint {
        color: var(--text-secondary);
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .preference-block {
        background: var(--surface-color);
        border-radius: 12px;
        padding: 16px 18px;
        margin-bottom: 14px;
        border: 2px solid var(--border-color);
        display: flex;
        flex-direction: column;
        gap: 12px;

        @media (max-width: 768px) {
            padding: 14px;
            gap: 10px;
        }
    }

    .preference-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 18px;

        > div:first-child {
            flex: 1 1 auto;
            min-width: 0;
        }

        @media (max-width: 768px) {
            flex-direction: column;
            align-items: flex-start;
            gap: 10px;
        }

        h3 {
            margin: 0 0 4px 0;
            font-size: 1.05rem;
        }

        p {
            margin: 0;
            color: var(--text-secondary);
            line-height: 1.35;
        }
    }

    .pwa-install-block {
        background: linear-gradient(135deg, rgba(255, 107, 107, 0.08), rgba(0, 184, 148, 0.08));
    }

    .pwa-install-header {
        align-items: center;

        @media (max-width: 768px) {
            align-items: flex-start;
        }
    }

    .pwa-install-button {
        white-space: nowrap;
        min-width: 132px;
    }

    .pwa-install-status {
        margin: 0;
        font-size: 0.92rem;
        font-weight: 600;
        color: var(--dark-color);

        &.is-success {
            color: var(--success-color);
        }

        &.is-warning {
            color: #b96a00;
        }

        &.is-error {
            color: var(--danger-color);
        }
    }

    .pwa-install-manual {
        border-radius: 10px;
        border: 2px dashed var(--border-color);
        padding: 12px 14px;
        background: var(--surface-color);
    }

    .pwa-install-manual-title {
        margin: 0 0 8px;
        display: inline-flex;
        align-items: center;
        gap: 7px;
        font-size: 0.86rem;
        color: var(--text-secondary);
        font-weight: 600;
    }

    .pwa-install-manual-steps {
        margin: 0;
        padding-left: 18px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        color: var(--dark-color);
        font-size: 0.89rem;
        line-height: 1.35;
    }

    .remember-slots-badge {
        display: inline-flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
        min-width: 122px;
        padding: 8px 10px;
        border-radius: 10px;
        border: 2px solid var(--border-color);
        background: var(--surface-muted);

        strong {
            font-size: 1rem;
            line-height: 1;
        }

        span {
            font-size: 0.76rem;
            color: var(--text-secondary);
            white-space: nowrap;
        }

        &.is-ok strong {
            color: var(--success-color);
        }

        &.is-full strong {
            color: var(--danger-color);
        }
    }

    .remember-table-wrapper {
        overflow-x: auto;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        background: var(--surface-color);
    }

    .remember-table {
        width: 100%;
        min-width: 980px;
        border-collapse: collapse;
        font-size: 0.84rem;

        th,
        td {
            padding: 10px 12px;
            text-align: left;
            vertical-align: top;
            border-bottom: 1px solid var(--border-color);
        }

        thead th {
            background: var(--surface-muted);
            font-size: 0.74rem;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: var(--text-secondary);
            font-weight: 700;
        }

        tbody tr:last-child td {
            border-bottom: 0;
        }

        tbody tr.is-current {
            background: rgba(0, 184, 148, 0.08);
        }

        code {
            font-size: 0.78rem;
            background: var(--surface-muted);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 2px 5px;
            display: inline-block;
            word-break: break-all;
        }

        td strong {
            display: block;
            font-size: 0.84rem;
            color: var(--dark-color);
            margin-bottom: 4px;
        }
    }

    .remember-device-meta {
        display: block;
        font-size: 0.73rem;
        color: var(--text-secondary);
        line-height: 1.3;
        word-break: break-word;
    }

    .remember-current-tag {
        display: inline-flex;
        margin-left: 8px;
        margin-top: 6px;
        padding: 2px 8px;
        border-radius: 999px;
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #0b5b4e;
        background: rgba(0, 184, 148, 0.22);
    }

    .remember-empty {
        margin: 0;
        color: var(--text-secondary);
        font-size: 0.9rem;
    }

    .remember-revoke-btn {
        padding: 6px 10px;
        min-height: 32px;
        line-height: 1;
        white-space: nowrap;
    }

    .privacy-header {
        position: relative;
    }

    .toggle-text {
        max-width: 650px;
        font-weight: 600;
        color: var(--dark-color);
    }

    .profile-controls {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        flex: 0 0 auto;
        margin-left: auto;

        @media (max-width: 768px) {
            justify-content: flex-start;
            margin-left: 0;
        }

        .theme-label {
            font-size: 0.55rem;
            font-weight: 700;
            letter-spacing: 0.08em;
            color: var(--text-secondary);
        }

        .theme-switch {
            position: relative;
            width: 48px;
            height: 24px;

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

            .theme-slider {
                position: absolute;
                inset: 0;
                background: var(--surface-alt);
                border: 1px solid var(--border-color);
                border-radius: 999px;
                transition: background 0.2s, border-color 0.2s;

                &::before {
                    content: '';
                    position: absolute;
                    height: 18px;
                    width: 18px;
                    left: 3px;
                    top: 2px;
                    background: var(--surface-color);
                    border-radius: 50%;
                    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
                    transition: transform 0.2s, background 0.2s;
                }
            }

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

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

            input:focus-visible + .theme-slider {
                outline: 2px solid rgba(255, 107, 107, 0.4);
                outline-offset: 2px;
            }
        }
    }
}

/* Dashboard */
.dashboard-page {
    min-height: 100vh;
    min-height: 100svh;
    min-height: var(--app-height);
    background-image: url('../images/pizza.webp');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    overflow: hidden;

    @media (prefers-color-scheme: dark) {
        background-image: linear-gradient(135deg, rgba(15, 17, 21, 0.85), rgba(31, 36, 48, 0.85)), url('../images/pizza.webp');
    }
}

html[data-theme="light"] {
    .dashboard-page {
        background-image: url('../images/pizza.webp');
    }
}

html[data-theme="dark"] {
    .dashboard-page {
        background-image: linear-gradient(135deg, rgba(15, 17, 21, 0.85), rgba(31, 36, 48, 0.85)), url('../images/pizza.webp');
    }
}

.dashboard-container {
    display: grid;
    grid-template-columns: var(--aside-width) 1fr;
    grid-template-rows: 1fr var(--footer-safe-height);
    grid-template-areas:
        "sidebar main"
        "sidebar footer";
    height: var(--app-height);
    min-height: var(--app-height);
    width: 100%;
    position: relative;

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr var(--footer-safe-height);
        grid-template-areas:
            "sidebar"
            "main"
            "footer";
    }

    .site-footer {
        grid-area: footer;
        position: static;
        margin: 0;
        width: auto;
        height: var(--footer-safe-height);
        padding-bottom: var(--safe-area-bottom);
        background: var(--footer-bg);

        @media (max-width: 768px) {
            margin: 0;
        }
    }
}

.dashboard-sidebar {
    grid-area: sidebar;
    position: relative;
    background: var(--surface-color);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    gap: 16px;
    width: var(--aside-width);

    @media (max-width: 768px) {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        width: 100%;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        padding: 10px 4px;
        gap: 10px;
        overflow-y: auto;
    }

    .sidebar-logo {
        img {
            width: 64px;
            height: auto;
            display: block;
        }
    }

    .sidebar-top {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
        width: 100%;

        @media (max-width: 768px) {
            flex-direction: row;
            gap: 12px;
        }
    }

    .sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
        width: 100%;

        @media (max-width: 768px) {
            flex-direction: row;
            gap: 8px;
            width: auto;
        }
    }

    .sidebar-theme {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 4px 0;

        @media (max-width: 768px) {
            flex-direction: row;
            gap: 8px;

            .theme-label {
                display: none;
            }
        }

        .theme-label {
            font-size: 0.55rem;
            font-weight: 700;
            letter-spacing: 0.08em;
            color: var(--text-secondary);
        }

        .theme-switch {
            position: relative;
            width: 48px;
            height: 24px;

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

            .theme-slider {
                position: absolute;
                inset: 0;
                background: var(--surface-alt);
                border: 1px solid var(--border-color);
                border-radius: 999px;
                transition: background 0.2s, border-color 0.2s;

                &::before {
                    content: '';
                    position: absolute;
                    height: 18px;
                    width: 18px;
                    left: 3px;
                    top: 2px;
                    background: var(--surface-color);
                    border-radius: 50%;
                    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
                    transition: transform 0.2s, background 0.2s;
                }
            }

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

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

            input:focus-visible + .theme-slider {
                outline: 2px solid rgba(255, 107, 107, 0.4);
                outline-offset: 2px;
            }
        }
    }

    .sidebar-btn {
        width: 100%;
        min-height: 60px;
        padding: 8px 6px;
        border-radius: 14px;
        background: var(--surface-alt);
        color: var(--dark-color);
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        gap: 5px;
        transition: background 0.2s, color 0.2s, transform 0.2s, border-color 0.2s;

        &:hover {
            background: rgba(255, 107, 107, 0.12);
            color: var(--primary-color);
            transform: translateY(-1px);
        }

        &.is-active {
            background: var(--primary-color);
            color: white;
        }

        @media (max-width: 960px) and (max-height: 540px) {
            width: 44px;
            height: 44px;
            min-height: 44px;
            padding: 0;
            gap: 0;
        }

        @media (max-width: 768px) {
            width: 44px;
            height: 44px;
            min-height: 44px;
            padding: 0;
            gap: 0;
            border-radius: 10px;
        }
    }

    .sidebar-btn-label {
        display: block;
        max-width: 100%;
        text-align: center;
        font-size: 0.66rem;
        line-height: 1.05;
        font-weight: 700;
        color: inherit;
        text-wrap: balance;
    }

    @media (max-width: 960px) and (max-height: 540px), (max-width: 768px) {
        .sidebar-btn-label {
            display: none;
        }
    }

    .sidebar-user {
        margin-top: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding-bottom: 8px;
        width: 100%;

        @media (max-width: 768px) {
            margin-top: 0;
            flex-direction: row;
            gap: 8px;
            padding-bottom: 0;
        }

        .sidebar-user-profile {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            text-decoration: none;
            color: inherit;
            width: 100%;

            @media (max-width: 768px) {
                flex-direction: row;
                gap: 8px;
                width: auto;
            }
        }

        .sidebar-username {
            font-size: 0.7rem;
            color: var(--text-secondary);
            text-align: center;
            max-width: 50px;
            word-break: break-word;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;

            @media (max-width: 960px) and (max-height: 540px) {
                font-size: 0.65rem;
            }

            @media (max-width: 768px) {
                max-width: 120px;
            }
        }

        @media (max-width: 768px) {
            .user-avatar {
                width: 32px;
                height: 32px;
            }
        }

        .sidebar-logout {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            background: rgba(255, 107, 107, 0.12);
            color: var(--danger-color);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            text-decoration: none;
            transition: background 0.2s, color 0.2s, transform 0.2s;

            &:hover {
                background: var(--danger-color);
                color: white;
                transform: translateY(-1px);
            }

            @media (max-width: 960px) and (max-height: 540px) {
                width: 44px;
                height: 44px;
            }

            @media (max-width: 768px) {
                width: 44px;
                height: 44px;
                border-radius: 10px;
            }
        }
    }

    .version {
        position: absolute;
        bottom: 0;
        left: 0;
        display: flex;
        align-items: center;
        justify-content: center;

        width: 100%;
        height: 18px;
        text-align: center;
        font-size: 0.65rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        color: white;
        background: linear-gradient(180deg, rgba(45, 52, 54, 0.92) 0%, rgba(45, 52, 54, 0.82) 100%);
    }
}

.dashboard-content {
    grid-area: main;
    overflow-y: auto;
    padding: 0 24px 0 24px;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;

    @media (max-width: 1280px) and (max-height: 720px) {
        padding: 0 20px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        padding: 0 16px;
    }

    @media (max-width: 768px) {
        padding: 20px;
    }
}

.greeting-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin: 20px 0 16px;
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-mid) 58%, var(--hero-gradient-end) 100%);
    border-radius: 14px;
    border: 2px solid var(--hero-border-color);
    box-shadow: 0 12px 0 var(--hero-shadow-step), var(--shadow);

    @media (max-width: 1280px) and (max-height: 720px) {
        margin-block: 20px;
        padding: 16px 18px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        margin-block: 16px;
        padding: 14px 16px;
    }

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
        gap: 14px;
        text-align: left;
        margin: 16px 0;
        align-items: flex-start;
        padding: 16px 18px;
    }

    .greeting {
        position: relative;
        min-width: 0;
        padding: 0;

        @media (max-width: 960px) and (max-height: 540px) {
            padding: 0;
        }

        @media (max-width: 768px) {
            width: 100%;
            padding: 0;
            text-align: left;
        }

        .greeting-title {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 6px;
            color: var(--hero-title-color);
            margin: 0 0 4px 0;
            line-height: 1;
            letter-spacing: 0;

            strong {
                display: block;
                max-width: 100%;
                color: var(--hero-title-color);
                font-size: 1.6rem;
                line-height: 1;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                text-shadow: 0 3px 0 rgba(255, 255, 255, 0.8);
            }

            @media (max-width: 960px) and (max-height: 540px) {
                strong {
                    font-size: 1.45rem;
                }
            }

            @media (max-width: 768px) {
                align-items: flex-start;
                margin-bottom: 6px;

                strong {
                    font-size: 1.4rem;
                }
            }
        }

        .greeting-kicker {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 30px;
            min-width: 30px;
            padding: 4px 10px;
            border-radius: 999px;
            background: var(--hero-pill-bg);
            border: 2px solid var(--hero-pill-border);
            box-shadow: 0 3px 0 var(--hero-pill-shadow);
            color: var(--hero-pill-ink);
            font-size: 0.75rem;
            font-weight: 800;
            line-height: 1;
            text-transform: uppercase;
            letter-spacing: 0;
        }

        p {
            margin: 0;
            font-size: 1rem;
            font-weight: 700;
            color: var(--hero-copy-color);
            letter-spacing: 0;
            text-wrap: balance;

            @media (max-width: 768px) {
                font-size: 0.96rem;
            }
        }
    }

    .add-pizza-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;

        @media (max-width: 768px) {
            width: auto;
            justify-content: flex-start;
            padding: 0;
        }
    }

    .add-pizza-cta {
        width: auto;
        min-height: 52px;
        padding: 0 18px;
        border-radius: 999px;
        font-weight: 700;
        box-shadow: 0 8px 18px rgba(31, 23, 23, 0.16);
    }

    .add-pizza-cta i {
        font-size: 0.95rem;
    }

    .add-pizza-cta:hover {
        box-shadow: 0 12px 22px rgba(31, 23, 23, 0.2);
    }

    .add-pizza-round {
        position: relative;
        width: 62px;
        height: 62px;
        border-radius: 50%;
        border: 3px solid #1f1717;
        background: #1f1717;
        transition: transform 0.2s ease, box-shadow 0.2s ease;

        &:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 0 #ffffff, 0 18px 24px rgba(43, 29, 29, 0.32);
        }

        @media (max-width: 768px) {
            width: 58px;
            height: 58px;
        }
    }

    .add-pizza-round .add-pizza-icon {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }

    .add-pizza-round .add-pizza-icon .fa-pizza-slice {
        font-size: 1.35rem;
        color: #ffd166;
        filter: none;
    }

    .add-pizza-round .add-pizza-icon .fa-plus {
        position: absolute;
        right: 12px;
        bottom: 10px;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: #ff6b6b;
        color: #1f1717;
        font-size: 0.62rem;
        font-weight: 900;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 0 0 2px #fff4e6;
    }

    .add-pizza-round .add-pizza-icon i {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .add-pizza-round:hover .add-pizza-icon .fa-pizza-slice {
        transform: rotate(-8deg) scale(1.05);
    }

    .add-pizza-round:hover .add-pizza-icon .fa-plus {
        transform: scale(1.1);
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
    }

    @media (max-width: 768px) {
        .add-pizza-round .add-pizza-icon .fa-plus {
            right: 10px;
            bottom: 8px;
        }
    }
}

.stats-cards {
    display: grid;
    grid-template-columns: minmax(260px, 1.1fr) minmax(0, 1.9fr);
    gap: 20px;
    margin-bottom: 30px;

    @media (max-width: 1280px) and (max-height: 720px) {
        gap: 16px;
        margin-bottom: 20px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        gap: 12px;
        margin-bottom: 16px;
    }

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
    }
}

.friends-section {
    margin-bottom: 30px;
}

.friends-card {
    background: var(--surface-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.friends-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;

    @media (max-width: 768px) {
        flex-direction: column;
        align-items: flex-start;
    }

    h2 {
        margin: 0 0 4px 0;
        color: var(--dark-color);
        font-size: 1.55rem;
    }

    p {
        margin: 0;
        color: var(--text-secondary);
    }
}

.friends-invite {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    border: 2px dashed rgba(255, 107, 107, 0.4);
    background: rgba(255, 107, 107, 0.06);
    margin-bottom: 18px;
}

.friends-search {
    position: relative;
}

.friends-search input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--surface-color);
    color: var(--dark-color);
}

.friends-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-height: 220px;
    overflow-y: auto;
    z-index: 10;
}

.friend-result {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark-color);
    font-weight: 600;
}

.friend-result:hover {
    background: rgba(255, 107, 107, 0.08);
}

.friend-result.empty {
    cursor: default;
    font-weight: 500;
    color: var(--text-secondary);
}

.friends-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.friends-message {
    font-size: 0.9rem;
    color: var(--success-color);
}

.friends-message.is-error {
    color: var(--danger-color);
}

.friends-toggle {
    width: auto;
    border-radius: 999px;
    padding-inline: 14px;
    font-weight: 700;
    gap: 8px;
}

.friends-toggle i {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .friends-toggle {
        align-self: flex-start;
    }
}

.friends-requests,
.friends-list {
    margin-top: 10px;
}

.friends-requests h3,
.friends-list h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.friends-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(255, 107, 107, 0.08);
    border-radius: 999px;
    padding: 3px 10px;
}

.friends-request-list,
.friends-grid {
    display: grid;
    gap: 12px;
}

.friend-request,
.friend-card {
    background: var(--surface-muted);
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    @media (max-width: 768px) {
        gap: 8px;
    }
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.friend-name {
    font-weight: 700;
    color: var(--dark-color);
}

.friend-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.friend-card-actions {
    display: inline-flex;
    gap: 8px;
    position: relative;
}

.friend-message-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--primary-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    position: relative;
}

.friend-message-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.friend-message-popover {
    position: absolute;
    right: 0;
    left: auto;
    bottom: calc(100% + 10px);
    transform: translateY(6px);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 0.8rem;
    color: var(--dark-color);
    box-shadow: var(--shadow);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 3;
    min-width: 240px;
    max-width: 320px;
    text-align: left;
}

.friend-message-popover::after {
    content: '';
    position: absolute;
    right: 10px;
    bottom: -6px;
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: var(--surface-color) transparent transparent transparent;
}

.friend-message-popover::before {
    content: '';
    position: absolute;
    right: 9px;
    bottom: -7px;
    border-width: 7px 7px 0 7px;
    border-style: solid;
    border-color: var(--border-color) transparent transparent transparent;
}

.friend-message-popover.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.friend-message-popover strong {
    font-weight: 700;
}

.friend-message-indicator {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--surface-color);
    background: var(--primary-color);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.friend-message-bubble {
    position: absolute;
    left: 0;
    top: -6px;
    transform: translateY(-100%);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 28px 10px 12px;
    min-width: 180px;
    max-width: 280px;
    box-shadow: var(--shadow);
    z-index: 2;
}

.friend-message-bubble::after {
    content: '';
    position: absolute;
    left: 18px;
    bottom: -8px;
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: var(--surface-color) transparent transparent transparent;
}

.friend-message-bubble::before {
    content: '';
    position: absolute;
    left: 18px;
    bottom: -9px;
    border-width: 9px 9px 0 9px;
    border-style: solid;
    border-color: var(--border-color) transparent transparent transparent;
}

.friend-message-bubble.is-hidden {
    display: none;
}

@media (max-width: 768px) {
    .friend-message-bubble {
        max-width: 200px;
    }
}

.friend-message-text {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.3;
    color: var(--dark-color);
    white-space: pre-wrap;
    word-break: break-word;
}

.friend-message-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
}

.friend-message-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    resize: vertical;
    background: var(--surface-color);
    color: var(--dark-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.friend-message-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

.friend-message-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.friend-message-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.friend-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.friend-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.friend-action-btn.accept {
    background: rgba(0, 184, 148, 0.18);
    color: var(--success-color);
}

.friend-action-btn.reject {
    background: rgba(255, 118, 117, 0.18);
    color: var(--danger-color);
}

.friend-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.friend-remove {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--danger-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.friend-remove:hover {
    background: var(--danger-color);
    color: white;
    transform: translateY(-1px);
}

.friends-empty {
    margin: 0;
    color: var(--text-secondary);
}

.stat-card {
    background: var(--surface-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);

    @media (max-width: 1280px) and (max-height: 720px) {
        padding: 16px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        padding: 14px;
    }

    &.main-stat {
        overflow: hidden;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: space-between;
        position: relative;
        align-self: stretch;
        justify-self: stretch;
        width: 100%;
        max-width: none;
        min-height: 240px;
        padding: 24px;
        border-radius: 18px;
        background: linear-gradient(135deg, #ff6b6b 0%, #ff9159 58%, #ffd166 100%);
        border: 2px solid #2b1d1d;
        box-shadow: 0 12px 0 rgba(43, 29, 29, 0.16), var(--shadow);
        color: #1f1717;

        &::before {
            content: '';
            position: absolute;
            right: -48px;
            bottom: -56px;
            width: 220px;
            height: 220px;
            background-image: var(--pizza-counter-bg);
            background-repeat: no-repeat;
            background-position: center;
            background-size: contain;
            opacity: 0.16;
        }

        > * {
            position: relative;
            z-index: 1;
        }

        .main-stat-top {
            width: 100%;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;

            @media (max-width: 768px) {
                flex-direction: column;
                align-items: flex-start;
            }
        }

        .main-stat-eyebrow {
            margin: 0;
            font-size: 0.8rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: rgba(31, 23, 23, 0.78);
        }

        .main-stat-link {
            width: auto;
            border-radius: 999px;
            background: rgba(31, 23, 23, 0.1);
            color: #1f1717;
            border: 1px solid rgba(31, 23, 23, 0.14);
            backdrop-filter: none;
        }

        .main-stat-link:hover {
            background: rgba(31, 23, 23, 0.16);
        }

        .stat-number {
            font-family: "Bungee", sans-serif;
            font-size: clamp(3.2rem, 5vw, 4.6rem);
            line-height: 1;
            font-weight: 400;
            letter-spacing: -0.08em;
            color: #1f1717;
            text-shadow: 0 3px 0 rgba(255, 255, 255, 0.62);
        }

        .main-stat-copy {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-width: 30rem;
        }

        .main-stat-title {
            margin: 0;
            font-size: 1.2rem;
            font-weight: 800;
            color: #1f1717;
        }

        .main-stat-subtitle {
            margin: 0;
            font-size: 0.95rem;
            line-height: 1.45;
            color: rgba(31, 23, 23, 0.82);
        }

        @media (max-width: 1280px) and (max-height: 720px) {
            padding: 22px;
        }

        @media (max-width: 960px) and (max-height: 540px) {
            padding: 18px;
        }
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-content: center;
    gap: 15px;

    @media (max-width: 960px) and (max-height: 540px) {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }

    @media (max-width: 768px) {
        .dashboard-page &:not(.detailed-stats) {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    &.detailed-stats-single {
        grid-template-columns: 1fr;

        @media (max-width: 768px) {
            .dashboard-page & {
                grid-template-columns: 1fr;
            }
        }
    }

    @media (max-width: 768px) {
        .dashboard-page &.detailed-stats {
            grid-template-columns: 1fr;
        }
    }

    .stat-card {
        display: flex;
        flex-direction: column;
        gap: 12px;
        justify-content: flex-start;
        min-height: 150px;
    }

    .stat-details {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        color: var(--primary-color);
        background: rgba(255, 107, 107, 0.1);
        margin-bottom: 0;

        @media (max-width: 960px) and (max-height: 540px) {
            width: 38px;
            height: 38px;
        }
    }

    .stat-title {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--text-secondary);
        margin-bottom: 0;
    }

    .stat-value {
        font-size: 1.35rem;
        font-weight: 700;
        color: var(--dark-color);
        line-height: 1.1;

        @media (max-width: 960px) and (max-height: 540px) {
            font-size: 1.15rem;
        }
        
        &.large {
            font-size: 1.75rem;
        }
    }

    .stat-caption {
        font-size: 0.85rem;
        line-height: 1.35;
        color: var(--text-secondary);
    }
}

.recent-pizzas {
    background: var(--surface-color);
    margin-block: 30px;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);

    h2 {
        margin-bottom: 20px;
        font-size: 1.5rem;
        color: var(--dark-color);
    }

    &.recent-pizzas-compact {
        .pizza-list {
            display: grid;
            gap: 12px;
        }

        .pizza-item {
            display: grid;
            grid-template-columns: minmax(160px, 2fr) minmax(120px, 1fr) minmax(140px, 1fr) auto;
            grid-template-areas: "type date rating actions";
            align-items: center;
            column-gap: 16px;
            row-gap: 8px;

            @media (max-width: 768px) {
                display: grid;
                grid-template-columns: minmax(0, 1fr) auto;
                grid-template-areas:
                    "type actions"
                    "date rating";
                column-gap: 12px;
                row-gap: 6px;
            }

            @media (max-width: 560px) {
                grid-template-columns: 1fr auto;
                grid-template-areas:
                    "type actions"
                    "date rating";
                
                .pizza-rating {
                    justify-self: end;
                }
            }

            .pizza-type {
                grid-area: type;
                min-width: 0;
            }

            .pizza-date {
                grid-area: date;
                font-size: 0.9rem;
                color: var(--text-secondary);
            }

            .pizza-rating {
                grid-area: rating;

                @media (max-width: 768px) {
                    justify-self: end;
                }
            }

            .pizza-actions {
                grid-area: actions;
                justify-self: end;

                @media (max-width: 768px) {
                    justify-self: end;
                }
            }
        }
    }
}

.recent-pizzas-archive .section-header {
    margin-bottom: 20px;
}

.recent-pizzas-archive .pizza-list {
    display: grid;
    gap: 12px;
}

.recent-pizzas-archive .pizza-item.detailed {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px 20px;
    padding: 18px;
    border: 1px solid var(--border-color);
    background: var(--surface-muted);

    @media (max-width: 768px) {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: flex-start;
        gap: 12px 12px;
        padding: 14px;
    }
}

.recent-pizzas-archive .pizza-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.recent-pizzas-archive .pizza-date {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.recent-pizzas-archive .pizza-location {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.93rem;

    i {
        color: var(--primary-color);
        margin-top: 2px;
    }
}

.recent-pizzas-archive .pizza-toppings,
.recent-pizzas-archive .pizza-notes {
    margin-top: 0;
}

.recent-pizzas-archive .pizza-toppings small,
.recent-pizzas-archive .pizza-notes small {
    display: block;
    line-height: 1.45;
}

.recent-pizzas-archive .pizza-notes {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 107, 107, 0.06);
}

.recent-pizzas-archive .pizza-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    justify-self: end;
    align-self: center;

    @media (max-width: 768px) {
        align-items: flex-end;
        align-self: flex-start;
        gap: 8px;
    }
}

.recent-pizzas-archive .pizza-rating-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.recent-pizzas-archive .pizza-rating-value {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--dark-color);
}

.recent-pizzas-archive .pizza-actions {
    justify-content: flex-end;
    flex-wrap: wrap;

    @media (max-width: 768px) {
        flex-direction: column;
        align-items: flex-end;
        justify-content: flex-start;
        gap: 6px;
    }
}

@media (max-width: 768px) {
    .recent-pizzas-archive .pizza-type {
        gap: 8px;
        align-items: flex-start;
    }

    .recent-pizzas-archive .pizza-type > strong {
        font-size: 0.98rem;
        line-height: 1.2;
        white-space: normal;
    }

    .recent-pizzas-archive .pizza-info {
        gap: 6px;
    }

    .recent-pizzas-archive .pizza-date {
        font-size: 0.82rem;
    }

    .recent-pizzas-archive .pizza-location {
        font-size: 0.86rem;
        gap: 6px;
    }

    .recent-pizzas-archive .pizza-toppings small,
    .recent-pizzas-archive .pizza-notes small {
        font-size: 0.8rem;
    }

    .recent-pizzas-archive .btn-inline-action-label {
        display: none;
    }

    .recent-pizzas-archive .btn-inline-action {
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        gap: 0;
    }

    .recent-pizzas-archive .pizza-rating-summary {
        gap: 6px;
    }

    .recent-pizzas-archive .pizza-rating {
        justify-content: flex-end;
    }
}

.pizza-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pizza-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    transition: transform var(--transition-speed);

    &:hover {
        transform: translateY(-1px);
    }

    &.detailed {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .pizza-info {
        flex: 1;
    }

    .pizza-stats {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .pizza-toppings,
    .pizza-notes {
        margin-top: 5px;
        color: var(--text-secondary);
    }
}

.pizza-type {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;

    i {
        color: var(--primary-color);
    }

    > span:not(.pizza-thumb-placeholder),
    > strong {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.pizza-thumb-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    aspect-ratio: 1 / 1;
    flex: 0 0 44px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    overflow: hidden;
    padding: 0;
    background: var(--surface-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, transform 0.2s;

    &:hover {
        border-color: var(--primary-color);
        transform: translateY(-1px);
    }

    img {
        width: 100%;
        height: 100%;
        aspect-ratio: 1 / 1;
        border-radius: 50%;
        object-fit: cover;
        display: block;
    }
}

.pizza-thumb-placeholder {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    aspect-ratio: 1 / 1;
    flex: 0 0 44px;
    border: 2px dashed var(--border-color);
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;

    i {
        font-size: 1rem;
    }
}

.rating-slice {
    color: var(--text-muted);
    margin: 0 1px;
    font-size: 0.9rem;

    &.active {
        color: var(--primary-color);
    }
}

.pizza-rating {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0px;
    justify-content: center;
}

.pizza-rating-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.pizza-rating-value {
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    color: var(--dark-color);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .pizza-item:not(.detailed) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: flex-start;
        gap: 8px 12px;
        padding: 12px;
    }

    .pizza-item:not(.detailed) .pizza-type,
    .pizza-item:not(.detailed) .pizza-date {
        grid-column: 1;
    }

    .pizza-item:not(.detailed) .pizza-rating-summary,
    .pizza-item:not(.detailed) .pizza-actions {
        grid-column: 2;
        justify-self: end;
    }

    .pizza-item:not(.detailed) .pizza-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: 6px;
    }

    .pizza-list .pizza-rating-summary {
        gap: 6px;
    }

    .pizza-list .pizza-rating {
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
    }

    .pizza-list .pizza-rating .rating-slice:not(:first-child) {
        display: none;
    }
}

.pizza-actions {
    display: inline-flex;
    gap: 8px;
}

.inline-form {
    display: inline;
    margin: 0;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);

    i {
        font-size: 3rem;
        color: var(--text-muted);
        margin-bottom: 10px;
    }

    p {
        margin: 2rem 0;
        font-size: 1.15rem;
    }
}

.stat-page .empty-state {
    background: var(--surface-color);
    border: 1px dashed rgba(255, 107, 107, 0.32);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 10px;
}

.stat-empty-action {
    min-height: 44px;
    padding-inline: 18px;
    border-radius: 999px;
    font-weight: 700;
}

/* Add Pizza Page */
.add-pizza-page {
    background: var(--page-bg);
    min-height: 100vh;
    min-height: var(--app-height);
    padding: 20px;

    @media (max-width: 1280px) and (max-height: 720px) {
        padding: 16px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        padding: 12px;
    }

    .container {
        padding-bottom: var(--footer-safe-height);
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);

    @media (max-width: 1280px) and (max-height: 720px) {
        margin-bottom: 20px;
        padding: 16px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        margin-bottom: 16px;
        padding: 12px;
    }
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-light);
    color: var(--dark-color);
    text-decoration: none;
    border-radius: 6px;
    transition: all var(--transition-speed);

    &:hover {
        background: var(--surface-alt);
        transform: translateX(-5px);
    }
}

.add-pizza-form {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);

    @media (max-width: 1280px) and (max-height: 720px) {
        padding: 24px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        padding: 18px;
    }

    @media (max-width: 768px) {
        padding: 20px;
        min-width: 0;
    }
}

.recent-pizzas,
.friends-card,
.add-pizza-form {
    overflow: hidden;
    position: relative;
    isolation: isolate;
    margin-bottom: 20px;
    background: var(--panel-surface);
    border: 1px solid var(--panel-border);
    box-shadow: var(--panel-shadow);
}

.recent-pizzas::after,
.friends-card::after,
.add-pizza-form::after {
    display: none;
}

.recent-pizzas > *,
.friends-card > *,
.add-pizza-form > * {
    position: relative;
    z-index: 1;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);

    @media (max-width: 1280px) and (max-height: 720px) {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    @media (max-width: 768px) {
        margin-bottom: 18px;
        padding-bottom: 18px;
    }

    h2 {
        font-size: 1.3rem;
        color: var(--dark-color);
        margin-bottom: 20px;

        @media (max-width: 1280px) and (max-height: 720px) {
            font-size: 1.2rem;
            margin-bottom: 14px;
        }

        @media (max-width: 960px) and (max-height: 540px) {
            font-size: 1.1rem;
            margin-bottom: 10px;
        }

        @media (max-width: 768px) {
            font-size: 1.05rem;
            margin-bottom: 12px;
            overflow-wrap: anywhere;
        }
    }
}

.pizza-type-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
    margin-bottom: 15px;

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
    }
}

.pizza-type-search {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;

    label {
        font-weight: 600;
        color: var(--dark-color);
    }
}

.pizza-type-search-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface-color);
    color: var(--dark-color);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;

    &:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
    }
}

.pizza-type-search-helper,
.pizza-type-search-empty {
    margin: 0;
    font-size: 0.85rem;
}

.pizza-type-search-helper {
    color: var(--text-secondary);
}

.pizza-type-search-empty {
    color: var(--primary-color);
    font-weight: 600;
}

.theme-category {
    margin-bottom: 24px;
}

.theme-category-title {
    margin: 0 0 14px;
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.theme-selector {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.theme-selector .pizza-type-option {
    text-align: center;
}

.theme-selector .pizza-type-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.theme-selector .theme-preview {
    width: 120px;
    height: 120px;
    object-fit: contain;
    display: block;
}

.theme-selector .selected-badge {
    margin-left: 0;
    margin-top: 6px;
}

@media (max-width: 768px) {
    .theme-selector .theme-preview {
        width: 96px;
        height: 96px;
    }
}

@media (max-width: 1280px) and (max-height: 720px) {
    .theme-category {
        margin-bottom: 16px;
    }

    .theme-category-title {
        margin-bottom: 10px;
        font-size: 0.95rem;
    }

    .theme-selector {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
        gap: 8px;
    }

    .theme-selector .theme-preview {
        width: 88px;
        height: 88px;
    }

    .theme-selector .pizza-type-option {
        padding: 8px;
    }
}

@media (max-width: 1024px) {
    .theme-selector {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }

    .theme-selector .theme-preview {
        width: 92px;
        height: 92px;
    }
}

.pizza-type-option {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    background: var(--surface-muted);
    cursor: pointer;
    transition: all var(--transition-speed);

    &:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }

    &.selected {
        border-color: var(--primary-color);
        background: rgba(255, 107, 107, 0.05);

        .selected-badge {
            display: inline-block;
        }
    }

    input {
        display: none;
    }

    label {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        cursor: pointer;
        margin-bottom: 4px;
    }

    label strong {
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .selected-badge {
        display: none;
        background: var(--primary-color);
        color: white;
        padding: 1px 6px;
        border-radius: 4px;
        font-size: 0.7rem;
        margin-left: 8px;
    }

    .pizza-description {
        font-size: 0.82rem;
        color: var(--text-secondary);
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        box-orient: vertical;
        overflow: hidden;
    }
}

.custom-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.35);
    pointer-events: none;

    @media (max-width: 768px) {
        width: 22px;
        height: 22px;
        font-size: 0.65rem;
    }
}

.pizza-image-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;

    label {
        font-weight: 600;
        color: var(--dark-color);
    }

    .pizza-image-input-native {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        border: 0;
        clip: rect(0 0 0 0);
        clip-path: inset(100%);
        overflow: hidden;
        white-space: nowrap;
    }

    .pizza-image-file-field {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 12px;
        border: 2px dashed rgba(255, 107, 107, 0.55);
        border-radius: 12px;
        background: linear-gradient(180deg, rgba(255, 107, 107, 0.08) 0%, rgba(255, 107, 107, 0.02) 100%);
        color: var(--dark-color);
        transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.2s;

        &:focus-within {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.2);
        }
    }

    .pizza-file-trigger {
        flex: 0 0 auto;
        border: 0;
        border-radius: 999px;
        padding: 8px 14px;
        background: var(--primary-color);
        color: #fff;
        font-weight: 700;
        cursor: pointer;
        transition: background 0.2s, transform 0.2s;
        line-height: 1;

        &:hover {
            background: #ff5252;
            transform: translateY(-1px);
        }
    }

    .pizza-file-name {
        min-width: 0;
        flex: 1 1 auto;
        font-size: 0.9rem;
        color: var(--dark-color);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.pizza-image-hint {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.pizza-upload-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-alt);
}

.pizza-upload-progress__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--dark-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.pizza-upload-progress__top strong {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}

.pizza-upload-progress__track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--border-color);
}

.pizza-upload-progress__track span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--primary-color);
}

.pizza-image-preview {
    width: min(100%, 240px);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    background: var(--surface-alt);

    img {
        width: 100%;
        height: auto;
        display: block;
        object-fit: cover;
        aspect-ratio: 1 / 1;
    }
}

.custom-type {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;

    .custom-type-header {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;

        @media (max-width: 768px) {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    .custom-type-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        border: 2px dashed rgba(255, 107, 107, 0.4);
        background: rgba(255, 107, 107, 0.06);
        color: var(--dark-color);
        font-weight: 700;
        border-radius: 12px;
        padding: 12px 16px;
        cursor: pointer;
        text-align: left;
        transition: border-color 0.2s, background 0.2s, transform 0.2s;

        @media (max-width: 1280px) and (max-height: 720px) {
            padding: 10px 14px;
        }

        @media (max-width: 960px) and (max-height: 540px) {
            padding: 8px 12px;
        }

        @media (max-width: 768px) {
            padding: 10px 12px;
            justify-content: flex-start;
        }

        &:hover {
            border-color: var(--primary-color);
            background: rgba(255, 107, 107, 0.12);
            transform: var(--hover-transform);
        }

        &[aria-expanded="true"] {
            border-color: var(--primary-color);
            background: rgba(255, 107, 107, 0.18);
            box-shadow: 0 6px 16px rgba(255, 107, 107, 0.2);
        }

        i {
            color: var(--primary-color);
        }

        .custom-type-plus {
            display: inline-flex;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: var(--primary-color);
            color: white;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            margin-right: 0;
        }
    }

    .custom-type-text-short {
        display: none;

        @media (max-width: 768px) {
            display: inline;
        }
    }

    .custom-type-text-full {
        display: inline;

        @media (max-width: 768px) {
            display: none;
        }
    }

    .custom-type-manage-toggle {
        border-style: solid;
        background: var(--surface-color);
        font-weight: 600;
    }

    .custom-type-box {
        position: relative;
        border: 2px solid rgba(255, 107, 107, 0.2);
        border-radius: 12px;
        padding: 14px;
        background: var(--surface-color);
        box-shadow: 0 10px 20px rgba(255, 107, 107, 0.08);
    }

    .custom-type-box-title {
        margin: 0 36px 12px 0;
        font-size: 1rem;
        color: var(--dark-color);
    }

    .custom-type-close {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        border: 1px solid var(--border-color);
        background: var(--surface-alt);
        color: var(--text-secondary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;

        &:hover {
            color: var(--primary-color);
            border-color: rgba(255, 107, 107, 0.4);
            background: rgba(255, 107, 107, 0.08);
            transform: scale(1.05);
        }
    }

    .custom-type-edit-panel {
        margin-bottom: 14px;
        padding-bottom: 12px;
        border-bottom: 1px dashed var(--border-color);
    }

    .custom-type-fields {
        display: flex;
        flex-direction: column;
        gap: 8px;

        label {
            font-weight: 600;
            color: var(--dark-color);
        }

        input,
        textarea {
            width: 100%;
            padding: 12px 14px;
            border: 2px solid var(--border-color);
            border-radius: 10px;
            font-size: 1rem;
            resize: vertical;
            background: var(--surface-color);
            color: var(--dark-color);
            transition: border-color 0.2s, box-shadow 0.2s;

            &:focus {
                outline: none;
                border-color: var(--primary-color);
                box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
            }
        }
    }

    .custom-type-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 6px;

        .custom-type-cancel {
            background: var(--surface-alt);
            color: var(--dark-color);
            border: 1px solid var(--border-color);
        }
    }

    .custom-type-hint {
        margin: 0;
        color: var(--text-secondary);
        font-size: 0.85rem;
    }

    .custom-type-list {
        margin-top: 16px;
        padding-top: 12px;
        border-top: 1px dashed var(--border-color);
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .custom-type-list h3 {
        font-size: 0.95rem;
        color: var(--dark-color);
        margin: 0;
    }

    .custom-type-empty {
        margin: 0;
        color: var(--text-secondary);
        font-size: 0.9rem;
    }

    .custom-type-items {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .custom-type-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 12px;
        border-radius: 10px;
        border: 1px solid var(--border-color);
        background: var(--surface-muted);

        @media (max-width: 768px) {
            align-items: flex-start;
        }
    }

    .custom-type-info {
        display: flex;
        flex-direction: column;
        gap: 4px;

        @media (max-width: 768px) {
            flex: 1;
            min-width: 0;
        }
    }

    .custom-type-name {
        color: var(--dark-color);
    }

    .custom-type-ingredients {
        color: var(--text-secondary);
        font-size: 0.85rem;
    }

    .custom-type-item-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;

        @media (max-width: 768px) {
            margin-left: auto;
            align-self: flex-start;
        }
    }
}

.section-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 2px dashed rgba(255, 107, 107, 0.4);
    background: rgba(255, 107, 107, 0.06);
    color: var(--dark-color);
    font-weight: 700;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
    margin-bottom: 12px;

    @media (max-width: 1280px) and (max-height: 720px) {
        padding: 10px 14px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        padding: 8px 12px;
    }

    @media (max-width: 768px) {
        padding: 10px 12px;
    }

    &:hover {
        border-color: var(--primary-color);
        background: rgba(255, 107, 107, 0.12);
        transform: var(--hover-transform);
    }

    &[aria-expanded="true"] {
        border-color: var(--primary-color);
        background: rgba(255, 107, 107, 0.18);
        box-shadow: 0 6px 16px rgba(255, 107, 107, 0.2);
    }

    i {
        color: var(--primary-color);
    }
}

.section-text-short {
    display: none;

    @media (max-width: 768px) {
        display: inline;
    }
}

.section-text-full {
    display: inline;

    @media (max-width: 768px) {
        display: none;
    }
}

.section-box {
    position: relative;
    border: 2px solid rgba(255, 107, 107, 0.2);
    border-radius: 12px;
    padding: 14px;
    background: var(--surface-color);
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.08);
}

.section-box-title {
    margin: 0 36px 12px 0;
    font-size: 1rem;
    color: var(--dark-color);
}

.section-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface-alt);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;

    &:hover {
        color: var(--primary-color);
        border-color: rgba(255, 107, 107, 0.4);
        background: rgba(255, 107, 107, 0.08);
        transform: scale(1.05);
    }
}

.date-selector {
    position: relative;
    width: 100%;

    & label {
        display: block;
        margin-bottom: 6px;
        font-weight: 600;
        color: var(--dark-color);
    }

    & input {
        max-width: 180px;
        padding: 12px;
        border: 2px solid var(--border-color);
        border-radius: 8px;
        font-size: 1rem;
        background: var(--surface-color);
        color: var(--dark-color);
    }

    & .date-hint {
        font-size: 0.9rem;
        color: var(--text-secondary);
        margin-top: 5px;
    }

    @media (max-width: 768px) {
        min-width: 0;
        
        input[type="date"] {
            min-width: 0;
            max-width: 100%;
        }
    }
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 10px;

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
    }
}

.choice-option {
    position: relative;

    input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .choice-card {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        border: 2px solid var(--border-color);
        border-radius: 10px;
        background: var(--surface-color);
        cursor: pointer;
        transition: all var(--transition-speed);
        font-weight: 600;
        color: var(--dark-color);

        @media (max-width: 1280px) and (max-height: 720px) {
            padding: 10px 12px;
        }

        @media (max-width: 960px) and (max-height: 540px) {
            padding: 8px 10px;
            font-size: 0.9rem;
        }

        @media (max-width: 768px) {
            padding: 10px 12px;
            font-size: 0.95rem;
        }

        i {
            color: var(--primary-color);
        }
    }

    input:checked + .choice-card {
        border-color: var(--primary-color);
        background: rgba(255, 107, 107, 0.08);
    }

    .choice-card:hover {
        border-color: var(--primary-color);
    }
}

.platform-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 10px;

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
    }
}

.platform-option {
    position: relative;

    input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .platform-card {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        border: 2px solid var(--border-color);
        border-radius: 10px;
        background: var(--surface-color);
        cursor: pointer;
        transition: all var(--transition-speed);
        font-weight: 600;
        color: var(--dark-color);

        @media (max-width: 1280px) and (max-height: 720px) {
            padding: 10px 12px;
        }

        @media (max-width: 960px) and (max-height: 540px) {
            padding: 8px 10px;
            font-size: 0.9rem;
        }

        @media (max-width: 768px) {
            padding: 10px 12px;
            font-size: 0.95rem;
        }
    }

    input:checked + .platform-card {
        border-color: var(--primary-color);
        background: rgba(255, 107, 107, 0.08);
    }

    .platform-icon {
        width: 36px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;

        svg {
            width: 36px;
            height: 36px;
            display: block;
        }
    }
}

.restaurant-select-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;

    select {
        width: 100%;
        padding: 12px;
        border: 2px solid var(--border-color);
        border-radius: 8px;
        font-size: 1rem;
        background: var(--surface-color);
        color: var(--dark-color);

        &:disabled {
            background: var(--surface-alt);
            color: var(--text-muted);
        }
    }
}

.restaurant-flag-row {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.restaurant-input-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;

    @media (max-width: 768px) {
        flex-direction: column;
        align-items: stretch;
    }
}

.restaurant-input {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;

    @media (max-width: 768px) {
        min-width: 0;
        width: 100%;
    }

    input {
        width: 100%;
        padding: 12px;
        border: 2px solid var(--border-color);
        border-radius: 8px;
        font-size: 1rem;
        background: var(--surface-color);
        color: var(--dark-color);

        &:disabled {
            background: var(--surface-alt);
            color: var(--text-muted);
        }
    }
}

.remember-restaurant,
.remember-login {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 2px solid var(--border-color);
    background: var(--surface-color);
    color: var(--dark-color);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;

    &:hover {
        border-color: var(--border-color);
        background: rgba(255, 107, 107, 0.06);
    }

    input {
        position: absolute;
        opacity: 0;
        pointer-events: none;

        &:checked + .remember-checkbox {
            border-color: var(--primary-color);
            background: var(--primary-color);
            box-shadow: 0 6px 12px rgba(255, 107, 107, 0.25);

            &::after {
                opacity: 1;
            }
        }

        &:focus-visible + .remember-checkbox {
            outline: 2px solid rgba(255, 107, 107, 0.45);
            outline-offset: 2px;
        }
    }

    .remember-checkbox {
        width: 20px;
        height: 20px;
        border-radius: 6px;
        border: 2px solid #cfcfcf;
        background: var(--surface-color);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;

        &::after {
            content: '';
            width: 9px;
            height: 5px;
            border-left: 2px solid #fff;
            border-bottom: 2px solid #fff;
            transform: rotate(-45deg);
            opacity: 0;
        }
    }

    .remember-text {
        color: var(--text-secondary);
    }

    &.is-disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }
}

.conditional-section {
    margin-top: 16px;

    &.is-hidden {
        display: none;
    }

    .pizza-location {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 6px;
        color: var(--text-secondary);
        font-size: 0.9rem;

        i {
            color: var(--primary-color);
        }
    }
}

.rating-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;

    @media (max-width: 768px) {
        gap: 8px;
    }

    .rating-range {
        width: min(420px, 100%);

        @media (max-width: 768px) {
            width: min(320px, 100%);
        }
    }

    .rating-text {
        font-size: 1.1rem;
        color: var(--dark-color);

        @media (max-width: 768px) {
            font-size: 1rem;
        }
    }
}

.rating-range input[type="range"] {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--surface-alt);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;

    @media (max-width: 768px) {
        height: 10px;
    }
}

.rating-range input[type="range"]::-webkit-slider-runnable-track {
    height: 12px;
    border-radius: 999px;
    background: var(--surface-alt);

    @media (max-width: 768px) {
        height: 10px;
    }
}

.rating-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: var(--surface-color) url('../images/pizza-round.svg') center / 70% no-repeat;
    box-shadow: var(--shadow);
    margin-top: -14px;
    cursor: pointer;

    @media (max-width: 768px) {
        width: 32px;
        height: 32px;
        margin-top: -11px;
    }
}

.rating-range input[type="range"]::-moz-range-track {
    height: 12px;
    border-radius: 999px;
    background: var(--surface-alt);

    @media (max-width: 768px) {
        height: 10px;
    }
}

.rating-range input[type="range"]::-moz-range-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: var(--surface-color) url('../images/pizza-round.svg') center / 70% no-repeat;
    box-shadow: var(--shadow);
    cursor: pointer;

    @media (max-width: 768px) {
        width: 32px;
        height: 32px;
    }
}

.rating-range input[type="range"]::-moz-range-progress {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 107, 107, 0.4);
}

.rating-range input[type="range"]:focus-visible {
    outline: 3px solid rgba(255, 107, 107, 0.35);
    outline-offset: 4px;
}

.star {
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-speed);

    &:hover,
    &.active {
        color: var(--primary-color);
    }
}

.toppings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    align-items: stretch;

    @media (max-width: 768px) {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }
}

.topping-option {
    position: relative;

    input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        pointer-events: none;

        &:checked + label,
        &.selected + label {
            border-color: var(--primary-color);
            background: rgba(255, 107, 107, 0.12);
            color: var(--dark-color);
            box-shadow: 0 8px 16px rgba(255, 107, 107, 0.2);
        }

        &:focus-visible + label {
            outline: 2px solid rgba(255, 107, 107, 0.45);
            outline-offset: 2px;
        }
    }

    label {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 52px;
        padding: 10px 12px;
        border: 2px solid var(--border-color);
        border-radius: 12px;
        background: var(--surface-color);
        text-align: center;
        font-weight: 600;
        line-height: 1.2;
        color: var(--dark-color);
        cursor: pointer;
        transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, color 0.2s;
        overflow: hidden;

        @media (max-width: 768px) {
            height: 46px;
            font-size: 0.9rem;
        }

        span {
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            box-orient: vertical;
            overflow: hidden;
        }
    }
}

.custom-topping {
    margin-top: 18px;
    padding: 16px;
    border: 2px dashed rgba(255, 107, 107, 0.25);
    border-radius: 12px;
    background: var(--surface-translucent);

    label {
        display: block;
        font-weight: 600;
        color: var(--dark-color);
        margin-bottom: 8px;
    }

    input {
        width: 100%;
        padding: 12px 14px;
        border: 2px solid var(--border-color);
        border-radius: 10px;
        font-size: 1rem;
        background: var(--surface-color);
        color: var(--dark-color);
        transition: border-color 0.2s, box-shadow 0.2s;

        &:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
        }
    }
}

.border-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 0 0;
    padding-top: 12px;
    border-top: 1px dashed var(--border-color);
    flex-wrap: wrap;

    @media (max-width: 768px) {
        align-items: flex-start;
        gap: 10px;
        padding-top: 10px;
    }
}

.border-toggle-row .profile-controls {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;

    @media (max-width: 768px) {
        margin-left: 0;
    }
}

.border-toggle-row .theme-label {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.border-toggle-row .theme-switch {
    position: relative;
    width: 48px;
    height: 24px;
}

.border-toggle-row .theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.border-toggle-row .theme-switch .theme-slider {
    position: absolute;
    inset: 0;
    background: var(--surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    transition: background 0.2s, border-color 0.2s;
}

.border-toggle-row .theme-switch .theme-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 2px;
    background: var(--surface-color);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background 0.2s;
}

.border-toggle-row .theme-switch input:checked + .theme-slider {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.border-toggle-row .theme-switch input:checked + .theme-slider::before {
    transform: translateX(22px);
}

.border-toggle-row .theme-switch input:focus-visible + .theme-slider {
    outline: 2px solid rgba(255, 107, 107, 0.4);
    outline-offset: 2px;
}

.pattern-toggle-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: min(640px, 100%);
    margin-left: auto;

    @media (max-width: 768px) {
        width: 100%;
        margin-left: 0;
    }
}

.pattern-toggle-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.pattern-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.pattern-toggle-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--surface-color);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
}

.pattern-toggle-option:hover .pattern-toggle-content {
    transform: translateY(-1px);
    border-color: rgba(255, 107, 107, 0.45);
}

.pattern-toggle-input:checked + .pattern-toggle-content {
    border-color: var(--primary-color);
    background: rgba(255, 107, 107, 0.08);
    box-shadow: 0 4px 10px rgba(255, 107, 107, 0.18);
}

.pattern-toggle-input:focus-visible + .pattern-toggle-content {
    outline: 2px solid rgba(255, 107, 107, 0.45);
    outline-offset: 2px;
}

.pattern-toggle-preview {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    object-fit: cover;
    flex: 0 0 auto;
}

.pattern-toggle-name {
    display: inline-flex;
    align-items: center;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.2;
}

.pattern-toggle-switch {
    margin-left: auto;
    position: relative;
    width: 48px;
    height: 24px;
    pointer-events: none;
}

.pattern-toggle-switch .theme-slider {
    position: absolute;
    inset: 0;
    background: var(--surface-alt);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    transition: background 0.2s, border-color 0.2s;
}

.pattern-toggle-switch .theme-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 2px;
    background: var(--surface-color);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background 0.2s;
}

.pattern-toggle-input:checked + .pattern-toggle-content .pattern-toggle-switch .theme-slider {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.pattern-toggle-input:checked + .pattern-toggle-content .pattern-toggle-switch .theme-slider::before {
    transform: translateX(22px);
}

.border-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 260px;

    @media (max-width: 768px) {
        min-width: 0;
    }
}

.border-toggle-title {
    font-weight: 600;
    color: var(--dark-color);
}

.border-toggle-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.notes-section {
    textarea {
        width: 100%;
        padding: 12px;
        border: 2px solid var(--border-color);
        border-radius: 8px;
        font-size: 1rem;
        resize: vertical;
        background: var(--surface-color);
        color: var(--dark-color);
    }
}

.form-actions {
    text-align: center;
    margin-top: 40px;
    display: flex;
    gap: 15px;
    justify-content: center;

    @media (max-width: 1280px) and (max-height: 720px) {
        margin-top: 20px;
    }

    @media (max-width: 960px) and (max-height: 540px) {
        margin-top: 16px;
    }

    @media (max-width: 768px) {
        margin-top: 24px;
    }
}

/* Statistiche dettagliate */
.detailed-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.year-stat {
    display: flex;
    flex-direction: column;
    gap: 16px;

    .year-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 14px;
        padding-bottom: 14px;
        border-bottom: 1px solid var(--border-color);

        @media (max-width: 768px) {
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
        }
    }

    .year-summary {
        margin: 6px 0 0;
        color: var(--text-secondary);
        line-height: 1.45;
        max-width: 65ch;
    }

    .year-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 32px;
        padding: 0 12px;
        border-radius: 999px;
        font-size: 0.8rem;
        font-weight: 700;
        background: var(--surface-alt);
        color: var(--dark-color);

        @media (max-width: 768px) {
            align-self: flex-start;
        }

        &.current-year {
            background: var(--primary-color);
            color: white;
        }
    }

    .stat-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;

        @media (max-width: 768px) {
            grid-template-columns: 1fr;
        }
    }

    .stat-item {
        padding: 14px;
        background: var(--surface-muted);
        border-radius: 12px;
        border: 1px solid rgba(224, 224, 224, 0.95);

        .stat-label {
            font-size: 0.8rem;
            font-weight: 700;
            margin-bottom: 6px;
            color: var(--text-secondary);
        }

        .stat-caption {
            margin-top: 4px;
            font-size: 0.84rem;
            line-height: 1.35;
            color: var(--text-secondary);
        }
    }

    .stat-rating-value {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .stat-rating-score {
        font-weight: 800;
        color: var(--dark-color);
    }

    .monthly-breakdown {
        margin-top: 4px;
        padding-top: 16px;
        border-top: 1px solid var(--border-color);
    }

    .monthly-breakdown-header {
        margin-bottom: 12px;

        h4 {
            margin: 0 0 4px 0;
            font-size: 1rem;
        }

        p {
            margin: 0;
            color: var(--text-secondary);
            line-height: 1.4;
        }
    }
}

.month-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
    }
}

.month-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.month-track {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 107, 107, 0.12);
    overflow: hidden;
}

.month-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--month-fill);
    min-width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff6b6b 0%, #ff9159 100%);
}

.month-row:not(.is-empty) .month-fill {
    min-width: 10px;
}

.month-row.is-empty .month-fill {
    width: 0;
    min-width: 0;
}

.month-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--dark-color);
}

.month-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal semplice */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--surface-color);
    z-index: 1000;
    overflow-y: auto;

    .modal-header {
        padding: 20px;
        background: var(--primary-color);
        color: white;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .modal-title {
        margin: 0;
    }

    .modal-close {
        background: none;
        border: none;
        color: white;
        font-size: 2rem;
        cursor: pointer;
    }

    .modal-body {
        padding: 20px;
    }
}

.confirm-modal .modal-body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.confirm-panel {
    width: min(520px, 92%);
    background: var(--surface-muted);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
}

.confirm-panel p {
    margin: 0 0 16px;
    color: var(--dark-color);
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* Modal a schermo intero */
.fullscreen-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;

    .modal-content {
        background: var(--surface-color);
        width: 95%;
        max-width: 1200px;
        height: 95%;
        max-height: 90vh;
        border-radius: var(--border-radius);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
        animation: slideUp 0.3s ease;
        overflow: hidden;

        @media (max-width: 768px) {
            width: 100%;
            height: 100%;
            max-height: 100vh;
            border-radius: 0;
        }

        .modal-header {
            padding: 20px 30px;
            background: linear-gradient(135deg, var(--primary-color) 0%, #ff8e8e 100%);
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.2);

            @media (max-width: 768px) {
                padding: 15px;
            }

            h2 {
                margin: 0;
                font-size: 1.8rem;
                display: flex;
                align-items: center;
                gap: 10px;

                @media (max-width: 768px) {
                    font-size: 1.4rem;
                }
            }
        }

        .close-modal {
            background: none;
            border: none;
            color: white;
            font-size: 2.5rem;
            cursor: pointer;
            padding: 0;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.2s;

            &:hover {
                transform: scale(1.1);
            }
        }

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

            @media (max-width: 768px) {
                padding: 15px;
            }
        }

        .add-pizza-form {
            max-width: 1000px;
            margin: 0 auto;
        }

        .pizza-type-selector {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 10px;
            max-height: 260px;
            overflow-y: auto;
            padding: 8px;

            @media (max-width: 768px) {
                grid-template-columns: 1fr;
            }
        }

        .toppings-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
            gap: 12px;
            max-height: 200px;
            overflow-y: auto;
            padding: 12px;
            border: 1px solid var(--border-color);
            border-radius: 8px;
        }

        .form-actions {
            @media (max-width: 768px) {
                flex-direction: column;
                
                button {
                    width: 100%;
                }
            }
        }

        /* Scrollbar personalizzata */
        &::-webkit-scrollbar {
            width: 8px;
        }

        &::-webkit-scrollbar-track {
            background: var(--surface-alt);
            border-radius: 4px;
        }

        &::-webkit-scrollbar-thumb {
            background: var(--primary-color);
            border-radius: 4px;
        }

        &::-webkit-scrollbar-thumb:hover {
            background: #ff5252;
        }
    }
}

.pizza-image-viewer-open {
    overflow: hidden;
}

.pizza-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: grid;
    place-items: center;

    &[hidden] {
        display: none;
    }
}

.pizza-image-viewer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
}

.pizza-image-viewer__panel {
    position: relative;
    z-index: 1;
    width: min(92vw, 980px);
    max-height: 92vh;
    background: var(--surface-color);
    border-radius: 14px;
    border: 2px solid var(--border-color);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
}

.pizza-image-viewer__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--dark-color);
    cursor: pointer;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.pizza-image-viewer__close:hover {
    background: var(--surface-muted);
    transform: translateY(-1px);
}

.pizza-image-viewer__content {
    padding: 28px 18px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 240px;

    img {
        max-width: 100%;
        max-height: 70vh;
        width: auto;
        height: auto;
        border-radius: 10px;
        object-fit: contain;
    }
}

.pizza-image-viewer__actions {
    display: flex;
    justify-content: center;
    padding: 0 18px 18px;
}

/* Notifiche */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1100;
    transform: translateX(150%);
    transition: transform 0.3s ease;

    &.show {
        transform: translateX(0);
    }

    &.success {
        border-color: var(--success-border);
        background: var(--success-bg);

        i {
            color: var(--success-color);
        }
    }

    &.error {
        border-color: var(--danger-border);
        background: var(--danger-bg);

        i {
            color: var(--danger-color);
        }
    }

    i {
        font-size: 1.2rem;
    }
}

/* Animazioni */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .sidebar-btn:hover,
    .sidebar-logout:hover,
    .friend-action-btn:hover,
    .friend-remove:hover,
    .pizza-image-viewer__close:hover,
    .account-topbar .back-btn:hover {
        transform: none !important;
    }
}
