*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --gold: #C9A84C;
    --gold-light: #E8D5A3;
    --gold-dark: #9A7A2E;
    --anthracite: #2C2C2C;
    --ivory: #FAF8F3;
    --ivory-dark: #F0EDE4;
    --white: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #6B6B6B;
    --border: #E0D9C8;
    --shadow: 0 2px 20px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 40px rgba(0,0,0,0.14);
    --radius: 12px;
    --radius-sm: 6px;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: var(--ivory) !important;
    font-family: 'Georgia', serif;
    color: var(--text-primary);
    min-height: 100vh;
}

#app, [b-app], .page, main, article {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.content {
    padding: 0 !important;
    margin: 0 !important;
}

.top-row {
    display: none !important;
}

a, .btn-link {
    color: var(--gold-dark);
}

/* ── Layout ─────────────────────────────────────── */
.app-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    gap: 0;
}

.left-panel {
    background: var(--ivory);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
}

.right-panel {
    background: #e8e6e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
}

/* ── User bar ────────────────────────────────────── */
.user-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(201,168,76,0.2);
    margin-bottom: 0.25rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--anthracite);
    font-size: 14px;
    font-weight: 700;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-email {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    font-family: 'Segoe UI', sans-serif;
}

/* Bottone tondo icona — usato per gear e simili */
.icon-btn-round {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(201,168,76,0.3);
    border-radius: 50%;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.18s;
    flex-shrink: 0;
}

    .icon-btn-round:hover {
        border-color: var(--gold);
        color: var(--gold);
        background: rgba(201,168,76,0.1);
    }

/* Variante per sfondo chiaro (preview controls) */
.preview-controls .icon-btn-round {
    border-color: var(--border);
    color: var(--text-secondary);
}

    .preview-controls .icon-btn-round:hover {
        border-color: var(--gold-dark);
        color: var(--gold-dark);
        background: rgba(154,122,46,0.08);
    }

.logout-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid rgba(201,168,76,0.3);
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    font-family: 'Segoe UI', sans-serif;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

    .logout-btn:hover {
        border-color: var(--gold);
        color: var(--gold);
        background: rgba(201,168,76,0.08);
    }

/* ── Header ─────────────────────────────────────── */
.menu-header {
    background: var(--anthracite) !important;
    padding: 1.5rem 1.75rem;
    display: flex !important;
    flex-direction: column;
    gap: 1.25rem;
}

.menu-header-top {
    display: flex !important;
    align-items: center;
    gap: 1.25rem;
}

.logo-area {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border: 2px dashed var(--gold);
    border-radius: var(--radius-sm);
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: default;
    overflow: hidden;
    position: relative;
    transition: border-color 0.2s;
}

    .logo-area:hover {
        border-color: var(--gold-light);
    }

    .logo-area img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.logo-placeholder {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--gold);
    font-size: 11px;
    font-family: 'Segoe UI', sans-serif;
    text-align: center;
}

.logo-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-sm);
}

.logo-overlay-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.logo-remove-btn {
    background: rgba(220,38,38,0.85);
    color: #fff;
}

    .logo-remove-btn:hover {
        background: #dc2626;
    }

.logo-change-btn {
    background: rgba(255,255,255,0.2);
    color: #fff;
    cursor: pointer;
}

    .logo-change-btn:hover {
        background: rgba(255,255,255,0.35);
    }

.hotel-info {
    flex: 1;
}

.hotel-name-input {
    font-family: 'Georgia', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white) !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(201,168,76,0.3) !important;
    width: 100%;
    padding: 4px 0;
    outline: none;
    box-shadow: none !important;
}

    .hotel-name-input::placeholder {
        color: rgba(255,255,255,0.3) !important;
    }

    .hotel-name-input:focus {
        border-bottom-color: var(--gold) !important;
    }

.menu-header-fields {
    display: flex !important;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.field-group {
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 130px;
}

.field-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    font-family: 'Segoe UI', sans-serif;
}

.field-input {
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    color: var(--white) !important;
    background: rgba(255,255,255,0.07) !important;
    border: 1px solid rgba(201,168,76,0.25) !important;
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    outline: none;
    box-shadow: none !important;
}

    .field-input:focus {
        border-color: var(--gold) !important;
    }

.btn-gold {
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 10px 22px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-gold-outline {
    background: transparent !important;
    border: 1px solid var(--gold) !important;
    color: var(--gold) !important;
}

    .btn-gold-outline:hover {
        background: rgba(201,168,76,0.1) !important;
    }

.btn-gold-fill {
    background: var(--gold) !important;
    color: var(--anthracite) !important;
    border: none !important;
}

    .btn-gold-fill:hover {
        background: var(--gold-light) !important;
    }

/* ── Categorie ───────────────────────────────────── */
.categories-wrapper {
    padding: 1.25rem 1.75rem 2rem;
    flex: 1;
}

.categories-list {
    display: flex !important;
    flex-direction: column;
    gap: 0.75rem;
}

.category-card {
    background: var(--white) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

    .category-card:hover {
        box-shadow: var(--shadow-hover);
    }

    .category-card.drag-over {
        border-color: var(--gold) !important;
    }

.category-header {
    display: flex !important;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.1rem;
    background: var(--ivory-dark) !important;
    cursor: pointer;
    user-select: none;
}

.drag-handle {
    color: var(--text-secondary);
    cursor: grab;
    font-size: 18px;
    opacity: 0.4;
    font-family: monospace;
}

.category-name {
    font-family: 'Georgia', serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary) !important;
    white-space: nowrap;
}

.category-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.category-stats {
    font-size: 10px;
    font-family: 'Segoe UI', sans-serif;
    color: var(--gold-dark);
    font-weight: 600;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.cat-stat-sep {
    color: var(--border);
    font-weight: 400;
}

.category-name-input {
    font-family: 'Georgia', serif;
    font-size: 1.05rem;
    font-weight: 600;
    flex: 1;
    border: none !important;
    border-bottom: 2px solid var(--gold) !important;
    background: transparent !important;
    outline: none !important;
    padding: 2px 4px;
    box-shadow: none !important;
}

.category-actions {
    display: flex !important;
    gap: 4px;
}

.icon-btn {
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    color: var(--text-secondary);
    transition: all 0.15s;
    box-shadow: none !important;
}

    .icon-btn:hover {
        background: var(--ivory) !important;
        color: var(--text-primary) !important;
    }

    .icon-btn.danger:hover {
        background: #fef2f2 !important;
        color: #dc2626 !important;
    }

/* Icone più grandi per i prodotti */
.icon-btn-lg {
    font-size: 20px !important;
    padding: 6px 10px !important;
}

.chevron {
    font-size: 13px;
    color: var(--text-secondary);
    transition: transform 0.2s;
    display: inline-block;
}

    .chevron.open {
        transform: rotate(180deg);
    }

/* ── Prodotti ────────────────────────────────────── */
.products-list {
    padding: 0.75rem 1rem 1.1rem;
    display: flex !important;
    flex-direction: column;
    gap: 0.6rem;
}

.product-row {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border) !important;
    background: var(--ivory) !important;
    transition: all 0.15s;
}

    .product-row:hover {
        border-color: var(--gold-light) !important;
    }

    .product-row.drag-over {
        border-color: var(--gold) !important;
        background: #fefae8 !important;
    }

/* Immagine prodotto grande */
.product-img-wrap {
    flex-shrink: 0;
    cursor: pointer;
}

.product-thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border);
    display: block;
}

.product-thumb-placeholder {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: var(--ivory-dark) !important;
    border: 1px dashed var(--border) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Testo prodotto — nome + descrizione */
.product-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary) !important;
    font-family: 'Segoe UI', sans-serif;
    cursor: pointer;
}

.product-desc {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'Segoe UI', sans-serif;
    font-style: italic;
    line-height: 1.3;
}

.product-name-input {
    font-size: 15px;
    font-weight: 600;
    border: none !important;
    border-bottom: 1px solid var(--gold) !important;
    background: transparent !important;
    outline: none !important;
    padding: 2px 4px;
    font-family: 'Segoe UI', sans-serif;
    box-shadow: none !important;
    width: 100%;
}

.product-desc-input {
    font-size: 12px;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm);
    background: var(--white) !important;
    outline: none !important;
    padding: 4px 8px;
    font-family: 'Segoe UI', sans-serif;
    font-style: italic;
    resize: none;
    color: var(--text-secondary);
    width: 100%;
    box-shadow: none !important;
}

    .product-desc-input:focus {
        border-color: var(--gold) !important;
    }

/* Checkbox pranzo/cena più grandi */
.meal-checks {
    display: flex !important;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
}

.meal-check {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-family: 'Segoe UI', sans-serif;
}

    .meal-check input[type=checkbox] {
        width: 22px;
        height: 22px;
        accent-color: var(--gold-dark);
        cursor: pointer;
    }

.product-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.add-product-btn {
    margin-top: 0.4rem;
    width: 100%;
    padding: 9px;
    background: transparent !important;
    border: 1px dashed var(--border) !important;
    border-radius: var(--radius-sm);
    font-family: 'Segoe UI', sans-serif;
    font-size: 16px;
    color: var(--text-secondary) !important;
    cursor: pointer;
    transition: all 0.15s;
}

    .add-product-btn:hover {
        border-color: var(--gold) !important;
        color: var(--gold-dark) !important;
    }

.add-category-btn {
    width: 100%;
    padding: 14px;
    background: transparent !important;
    border: 2px dashed var(--border) !important;
    border-radius: var(--radius);
    font-family: 'Georgia', serif;
    font-size: 15px;
    color: var(--text-secondary) !important;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.2s;
}

    .add-category-btn:hover {
        border-color: var(--gold) !important;
        color: var(--gold-dark) !important;
    }

.divider {
    height: 1px;
    background: var(--border);
    margin: 0 1rem;
}

/* ── Preview destra ──────────────────────────────── */
.right-panel-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-family: 'Segoe UI', sans-serif;
}

.preview-sticky {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.preview-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 210mm;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

/* ── Mode toggle ─────────────────────────────────── */
.mode-toggle {
    display: flex;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--gold-dark);
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.mode-btn {
    padding: 8px 14px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: none;
    background: #F5F0E8;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
}

    .mode-btn + .mode-btn {
        border-left: 2px solid var(--gold-dark);
    }

    .mode-btn:hover:not(.active) {
        background: #EDE6D6;
        color: var(--gold-dark);
    }

    .mode-btn.active {
        background: var(--anthracite);
        color: var(--gold);
        font-weight: 700;
        letter-spacing: 0.06em;
    }

/* ── Zoom controls ───────────────────────────────── */
.zoom-controls {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--white);
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.zoom-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 18px;
    font-weight: 400;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
    font-family: 'Segoe UI', sans-serif;
    user-select: none;
}

    .zoom-btn:hover {
        background: var(--ivory-dark);
        color: var(--anthracite);
    }

.zoom-label {
    font-size: 11px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 38px;
    text-align: center;
    border-left: 1.5px solid var(--border);
    border-right: 1.5px solid var(--border);
    line-height: 30px;
    letter-spacing: 0.03em;
}

/* ── Settings panels (overlay + pannello) ────────── */
.panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(2px);
    z-index: 900;
}

.settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 901;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 12px 60px rgba(0,0,0,0.22);
    width: 360px;
    max-width: calc(100vw - 2rem);
    overflow: hidden;
    font-family: 'Segoe UI', sans-serif;
}

.settings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--anthracite);
    border-bottom: 2px solid var(--gold-dark);
}

.settings-panel-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
}

.settings-close-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.15s;
}

    .settings-close-btn:hover {
        color: var(--gold);
        background: rgba(255,255,255,0.08);
    }

.settings-panel-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    max-height: 70vh;
    overflow-y: auto;
}

.settings-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-dark);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.settings-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.settings-row-check {
    justify-content: space-between;
}

.settings-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--gold-dark);
    cursor: pointer;
    flex-shrink: 0;
}

.settings-label {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
    min-width: 0;
}

.settings-num-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.settings-num-input {
    width: 64px;
    padding: 5px 8px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--white);
    text-align: right;
    transition: border-color 0.15s;
    -moz-appearance: textfield;
}

    .settings-num-input::-webkit-outer-spin-button,
    .settings-num-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .settings-num-input:focus {
        outline: none;
        border-color: var(--gold-dark);
    }

    .settings-num-input.input-error {
        border-color: #D94040;
        background: #FFF5F5;
    }

.settings-px {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    font-family: 'Segoe UI', sans-serif;
}

.settings-error {
    font-size: 11px;
    color: #D94040;
    font-family: 'Segoe UI', sans-serif;
    margin-top: -4px;
    padding-left: 2px;
}

.settings-select {
    flex: 1;
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.15s;
}

    .settings-select:focus {
        outline: none;
        border-color: var(--gold-dark);
    }

.font-preview-sample {
    font-size: 13px;
    color: var(--text-primary);
    padding: 8px 10px;
    background: var(--ivory-dark);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-top: -2px;
    font-style: italic;
    opacity: 0.85;
}

.settings-reset-btn {
    margin-top: 0.25rem;
    padding: 8px 14px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: 'Segoe UI', sans-serif;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    align-self: flex-start;
}

    .settings-reset-btn:hover {
        border-color: var(--gold-dark);
        color: var(--gold-dark);
        background: rgba(154,122,46,0.06);
    }

/* ── Palette colori ──────────────────────────────── */
.color-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.color-label {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
}

.color-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.color-swatch {
    width: 36px;
    height: 28px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
    background: transparent;
}

.color-hex {
    font-size: 11px;
    font-family: monospace;
    color: var(--text-secondary);
    min-width: 60px;
}

/* ── Foglio A4 con zoom wrapper ──────────────────── */
.a4-wrapper {
    transform-origin: top center;
    flex-shrink: 0;
    /* L'altezza visiva si adatta allo scale */
    margin-bottom: calc((297mm * var(--scale, 0.9)) - 297mm);
}

/* ── Foglio A4 ───────────────────────────────────── */
.a4-sheet {
    width: 210mm;
    height: 297mm;
    background: var(--pb, #FDFAF4);
    box-shadow: 0 4px 32px rgba(0,0,0,0.22);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

    .a4-sheet .print-area {
        position: absolute;
        inset: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: var(--pb, #FDFAF4);
    }

    .a4-sheet .menu-block {
        width: 100%;
        padding: 10mm 14mm;
        background: var(--pb, #FDFAF4);
        flex-shrink: 0;
    }

/* ── Modalità single: scorre su più pagine ───────── */
.a4-sheet.a4-multipage {
    height: auto;
    min-height: 297mm;
    overflow: visible;
}

    .a4-sheet.a4-multipage .print-area {
        position: static;
        height: auto;
        overflow: visible;
    }

    /* Riga di confine pagina: dietro il contenuto, non lo taglia */
    .a4-sheet.a4-multipage::before {
        content: '';
        position: absolute;
        inset: 0;
        pointer-events: none;
        z-index: 0;
        background-image: repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(297mm - 1px),
            rgba(0, 0, 0, 0.1) calc(297mm - 1px),
            rgba(0, 0, 0, 0.1) 297mm
        );
        background-size: 100% 297mm;
        background-repeat: repeat-y;
    }

    /* Il contenuto va sopra la riga */
    .a4-sheet.a4-multipage .print-area > * {
        position: relative;
        z-index: 1;
    }

.print-spacer {
    flex-shrink: 0;
    background: var(--pb, #FDFAF4);
}

.print-separator {
    width: 100%;
    height: 1px;
    background: #CCCCCC;
    flex-shrink: 0;
}

/* ── Elementi print ──────────────────────────────── */
.print-gold-thick {
    height: 0;
    border-top: 2.5px solid var(--pa, #B8972A);
    display: block;
}

.print-gold-thin {
    height: 0;
    border-top: 1px solid var(--pa, #D4B96A);
    display: block;
    opacity: 0.6;
}

.print-gap {
    height: 6px;
    display: block;
}

.print-gap-sm {
    height: 3px;
    display: block;
}

.print-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

.print-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
}

.print-hotel-name {
    flex: 1;
    font-size: 16px;
    font-weight: bold;
    color: var(--ptm, #1A1A1A);
}

.print-header-center {
    flex: 2;
    text-align: center;
}

.print-date {
    font-size: 13px;
    font-weight: 700;
    color: var(--ptm, #1A1A1A);
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.print-header-right {
    flex: 1;
    text-align: right;
}

.print-table {
    font-size: 11px;
    font-weight: 700;
    color: var(--ptm, #1A1A1A);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.print-meal-section {
    margin-top: 6px;
}

.print-meal-section-dinner {
    margin-top: 10px;
    border-top: 0.5px solid var(--pts, #7A7469);
    opacity: 0.4;
    padding-top: 6px;
}

.print-meal-section-dinner {
    opacity: 1;
    border-top: 0.5px solid rgba(0,0,0,0.12);
}

.print-meal-title {
    font-size: 10px;
    font-weight: bold;
    color: var(--pmt, #B8972A);
    letter-spacing: 0.15em;
    margin-bottom: 3px;
}

.print-meal-line {
    height: 0;
    border-top: 0.5px solid rgba(0,0,0,0.1);
    display: block;
    margin-bottom: 4px;
}

.print-cat-name {
    font-size: 11px;
    font-weight: bold;
    color: var(--ptm, #1A1A1A);
    margin-top: 6px;
    margin-bottom: 3px;
}

.print-cat-line {
    height: 0;
    border-top: 0.3px solid rgba(0,0,0,0.1);
    display: block;
    margin-bottom: 3px;
}

/* Griglia prodotti 4 colonne */
.print-product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 3px 5px;
    margin-bottom: 2px;
}

.print-product-card {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    padding: 2px 0;
}

.print-product-img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.print-product-img-placeholder {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.print-product-info {
    flex: 1;
    min-width: 0;
}

.print-product-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--ptm, #1A1A1A);
    line-height: 1.3;
}

.print-product-desc {
    font-size: 8.5px;
    color: var(--pts, #7A7469);
    font-style: italic;
    line-height: 1.3;
    margin-top: 2px;
}

.print-checkbox {
    width: 12px;
    height: 12px;
    border: 1.5px solid var(--pa, #B8972A);
    border-radius: 2px;
    background: var(--pb, #FDFAF4);
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Toast ───────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--anthracite);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border-left: 3px solid var(--gold);
    z-index: 1000;
    animation: fadeInUp 0.3s ease;
    font-family: 'Segoe UI', sans-serif;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Login ───────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--anthracite);
}

.login-card {
    background: var(--ivory);
    border-radius: var(--radius);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: var(--anthracite);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.login-title {
    font-family: 'Georgia', serif;
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--anthracite);
    margin: 0;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
}

.login-error {
    width: 100%;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: 'Segoe UI', sans-serif;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-family: 'Segoe UI', sans-serif;
}

.login-input {
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    outline: none;
    transition: border-color 0.2s;
}

    .login-input:focus {
        border-color: var(--gold);
    }

.login-btn {
    width: 100%;
    padding: 13px;
    background: var(--gold);
    color: var(--anthracite);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

    .login-btn:hover {
        background: var(--gold-light);
    }

    .login-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1100px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .right-panel {
        position: static;
        height: auto;
        padding: 1.5rem 1rem;
    }

    .a4-sheet {
        width: 100%;
        max-width: 210mm;
    }
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Si è verificato un errore.";
    }

/* ── Footer ──────────────────────────────────────── */
.app-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 1rem 1.75rem;
    border-top: 1px solid rgba(201,168,76,0.15);
    margin-top: auto;
}

.footer-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.7;
}

.footer-text {
    font-size: 11px;
    font-family: 'Segoe UI', sans-serif;
    color: rgba(255,255,255,0.35);
    letter-spacing: 0.05em;
}

/* ── Login page ──────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--anthracite);
    padding: 1rem;
}

.login-card {
    background: var(--ivory);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.login-logo-wrap {
    margin-bottom: 0.75rem;
}

.login-app-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.login-title {
    font-family: 'Georgia', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--anthracite);
    margin: 0 0 4px;
}

.login-subtitle {
    font-size: 13px;
    font-family: 'Segoe UI', sans-serif;
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.login-label {
    font-size: 12px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-input {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--white);
    transition: border-color 0.15s;
    outline: none;
}

    .login-input:focus {
        border-color: var(--gold-dark);
    }

.login-error {
    font-size: 12px;
    font-family: 'Segoe UI', sans-serif;
    color: #D94040;
    background: #FFF5F5;
    border: 1px solid #F5C2C2;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.login-btn {
    margin-top: 0.5rem;
    width: 100%;
    padding: 12px;
    background: var(--anthracite);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--gold);
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

    .login-btn:hover:not(:disabled) {
        background: #3a3a3a;
    }

    .login-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.login-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(201,168,76,0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.login-footer-brand {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    opacity: 1;
}

.login-brand-logo {
    width: 240px;
    height: auto;
    object-fit: contain;
}

.login-footer-brand span {
    font-size: 12px;
    font-family: 'Georgia', serif;
    font-style: italic;
    color: var(--text-secondary);
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-pw {
    width: 100%;
    padding-right: 2.75rem;
}

.login-pw-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

    .login-pw-toggle:hover {
        color: var(--text-primary);
    }

.login-brand-link {
    text-decoration: none;
    transition: opacity 0.18s;
}

    .login-brand-link:hover {
        opacity: 0.7;
    }

/* ── Users page ──────────────────────────────────── */
.users-page-wrap {
    min-height: 100vh;
    background: var(--ivory, #FAF8F3);
    font-family: 'Segoe UI', sans-serif;
}

.users-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    font-family: 'Segoe UI', sans-serif;
}

.users-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 13px;
    font-family: 'Segoe UI', sans-serif;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-back:hover {
        border-color: var(--gold-dark);
        color: var(--gold-dark);
    }

.users-title {
    font-family: 'Georgia', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.users-card {
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.users-card-title {
    font-family: 'Georgia', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.users-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.users-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.users-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.users-input, .users-select {
    padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
    color: var(--text-primary);
    background: var(--white);
    outline: none;
    transition: border-color 0.15s;
}

    .users-input:focus, .users-select:focus {
        border-color: var(--gold-dark);
    }

.users-error {
    font-size: 12px;
    color: #D94040;
    background: #FFF5F5;
    border: 1px solid #F5C2C2;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.users-success {
    font-size: 12px;
    color: #2D8A4E;
    background: #F0FFF5;
    border: 1px solid #B2DFC4;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.btn-create {
    align-self: flex-start;
    padding: 10px 20px;
    background: var(--anthracite);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--gold);
    font-size: 13px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-create:hover:not(:disabled) {
        background: #3a3a3a;
    }

    .btn-create:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.users-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.users-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--ivory-dark);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.users-row-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.users-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--anthracite);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.users-email {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.users-role-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 2px;
}

.role-admin {
    background: var(--anthracite);
    color: var(--gold);
}

.role-user {
    background: var(--ivory);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.users-you {
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
}

.btn-delete {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-delete:hover {
        border-color: #D94040;
        color: #D94040;
        background: #FFF5F5;
    }

.users-loading, .users-empty {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    padding: 1rem;
}

/* ── Site footer (pagine normali) ────────────────── */
.site-footer {
    width: 100%;
    padding: 1.25rem 2rem 1.5rem;
    font-family: 'Segoe UI', sans-serif;
    background: #000;
    color: rgba(255,255,255,0.75);
}

.site-footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
}

.site-footer-brand {
    display: flex;
    align-items: center;
}

.site-footer-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
    display: block;
}

.site-footer-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-footer-link {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

    .site-footer-link:hover {
        color: #fff;
    }

.site-footer-sep {
    color: rgba(255,255,255,0.25);
    font-size: 12px;
}

.site-footer-divider {
    height: 1px;
    background: rgba(255,255,255,0.12);
    width: 100%;
}

.site-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    font-size: 12px;
}

.site-footer-copy {
    color: rgba(255,255,255,0.55);
    font-weight: 500;
}

.site-footer-powered {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.18s, opacity 0.18s;
}

    .site-footer-powered:hover {
        color: #fff;
        opacity: 1;
    }

    .site-footer-powered:hover .site-footer-powered-name {
        color: #fff;
    }

.site-footer-powered-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.site-footer-powered-name {
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.01em;
}

@media (max-width: 640px) {
    .site-footer-top,
    .site-footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Wrapper per pagine con footer globale */
.page-with-footer {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

    .page-with-footer > .app-layout {
        flex: 1;
        min-height: auto;
    }

    .page-with-footer > .up-page {
        flex: 1;
    }

    .page-with-footer > .site-footer {
        flex-shrink: 0;
    }
