* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, sans-serif;
    background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 45%, #fff7ed 100%);
    color: #1f2937;
    min-height: 100vh;
}

.container {
    max-width: 920px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

body[data-page="admin"] .container {
    max-width: 95%;
}

.hero {
    text-align: center;
    margin-bottom: 28px;
}

.hero-compact {
    margin-bottom: 20px;
}

.hero h1 {
    margin: 12px 0 0;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    letter-spacing: -0.02em;
}

.hero p {
    margin: 10px auto 0;
    max-width: 560px;
    color: #4b5563;
    line-height: 1.5;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-admin {
    background: #fce7f3;
    color: #be185d;
}

.card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
    padding: 28px;
    margin-bottom: 22px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.auth-card {
    border-top: 4px solid #2563eb;
}

.register-card {
    border-top-color: #059669;
}

h2 {
    margin: 0 0 20px;
    font-size: 1.35rem;
}

.form {
    display: grid;
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
}

.field-full {
    grid-column: 1 / -1;
}

label {
    margin-bottom: 8px;
    color: #4b5563;
    font-size: 0.92rem;
    font-weight: 500;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fafbff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

input:focus,
select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

button {
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    background: #2563eb;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-danger {
    background: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
}

.actions {
    margin-top: 4px;
}

.actions-split {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.actions-split button {
    flex: 1;
    min-width: 140px;
}

.hint {
    margin: 20px 0 0;
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
}

.hint a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.hint a:hover {
    text-decoration: underline;
}

.error-box,
.success-box {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.error-box {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.success-box {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.hidden {
    display: none !important;
}

.summary-card {
    background: #f8fafc;
    border-radius: 14px;
    padding: 4px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 12px;
}

.summary-name {
    font-weight: 600;
}

.summary-order {
    color: #4b5563;
    text-align: right;
}

.stats-card .stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat {
    text-align: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 14px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #2563eb;
    line-height: 1;
}

.stat-label {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #6b7280;
}

.admin-list {
    display: grid;
    gap: 18px;
}

.admin-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    background: #fafbfc;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.order-badge {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.order-badge.ordered {
    background: #d1fae5;
    color: #047857;
}

.order-badge.pending {
    background: #fef3c7;
    color: #b45309;
}

.admin-form {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 16px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-actions button {
    flex: 1;
    min-width: 140px;
}

.muted {
    color: #6b7280;
    text-align: center;
}

.hero-with-logo {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
}

.hero-with-logo .badge,
.hero-with-logo h1,
.hero-with-logo p {
    text-align: left;
}

.site-logo {
    border-radius: 14px;
    flex-shrink: 0;
    object-fit: contain;
}

.site-logo-lg {
    width: 80px;
    height: 80px;
}

.section-hint {
    color: #6b7280;
    margin: -8px 0 16px;
    font-size: 0.95rem;
}

.food-grid {
    margin-bottom: 8px;
}

.food-category {
    margin-bottom: 20px;
}

.food-category-title {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.food-category-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.food-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.food-card:hover {
    border-color: var(--food-color, #2563eb);
    transform: translateY(-2px);
}

.food-card.selected {
    border-color: var(--food-color, #2563eb);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--food-color, #2563eb) 25%, transparent);
    background: color-mix(in srgb, var(--food-color, #2563eb) 8%, white);
}

.food-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.food-card-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.qty-minus, .qty-plus {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: white;
    color: #4b5563;
    font-size: 1.2rem;
    line-height: 1;
    border: 1px solid #d1d5db;
    cursor: pointer;
}

.qty-minus:hover, .qty-plus:hover {
    background: #e5e7eb;
}

.qty-value {
    min-width: 20px;
    text-align: center;
    font-weight: 600;
}

.food-card-price {
    font-weight: 600;
    color: #4b5563;
    margin-left: auto;
    padding-left: 10px;
}

.food-card-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--food-color, #6b7280);
}

.food-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

.food-color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(0, 0, 0, 0.08);
}

.order-badge.ordered {
    background: color-mix(in srgb, var(--dish-color, #22c55e) 18%, white);
    color: #1f2937;
    border: 1px solid color-mix(in srgb, var(--dish-color, #22c55e) 40%, transparent);
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: #e5e7eb;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
}

.tab-btn.active {
    background: #2563eb;
    color: white;
}

.tab-panel.hidden {
    display: none;
}

.menu-add-form {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr 1fr;
    padding: 16px;
    background: #f8fafc;
    border-radius: 14px;
    margin-bottom: 20px;
}

.menu-add-form .actions {
    grid-column: 1 / -1;
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-input-row input[type="color"] {
    width: 56px;
    height: 40px;
    padding: 4px;
    cursor: pointer;
}

.color-preview {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
}

.menu-admin-list {
    display: grid;
    gap: 10px;
}

.menu-admin-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.menu-admin-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-admin-info .muted {
    text-align: left;
    font-size: 0.85rem;
}

.menu-color-edit {
    width: 44px;
    height: 36px;
    padding: 2px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
}

.btn-sm {
    padding: 10px 14px;
    font-size: 0.9rem;
    min-width: auto;
    flex: 0 0 auto;
}

textarea {
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fafbff;
    font: inherit;
    resize: vertical;
    width: 100%;
    min-height: 80px;
}

textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap input {
    flex: 1;
    padding-right: 48px;
}

.btn-toggle-pw {
    position: absolute;
    right: 8px;
    padding: 8px 10px;
    background: transparent;
    color: #6b7280;
    font-size: 1rem;
    border-radius: 8px;
    min-width: auto;
}

.btn-toggle-pw:hover {
    background: #f3f4f6;
    transform: none;
}

.site-footer {
    text-align: center;
    margin-top: 32px;
    color: #9ca3af;
    font-size: 0.9rem;
}

.info-card {
    border-top: 4px solid #059669;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.info-item-full {
    grid-column: 1 / -1;
}

.info-label {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.info-value {
    font-weight: 600;
    font-size: 1.05rem;
}

.event-info {
    color: #4b5563;
    line-height: 1.6;
    margin: 0;
}

.steps {
    margin: 0 0 24px;
    padding-left: 1.25rem;
    line-height: 1.8;
    color: #4b5563;
}

.actions-home {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-link {
    display: inline-block;
    padding: 14px 24px;
    border-radius: 12px;
    background: #2563eb;
    color: white !important;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    flex: 1;
    min-width: 140px;
}

.btn-link:hover {
    background: #1d4ed8;
}

.btn-link-outline {
    background: white;
    color: #2563eb !important;
    border: 2px solid #2563eb;
}

.btn-link-outline:hover {
    background: #eff6ff;
}

.deadline-banner {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    padding: 14px 20px;
}

.deadline-banner p {
    margin: 0;
    color: #92400e;
    font-weight: 500;
}

.toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
    flex: 1;
    min-width: 180px;
}

.actions-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.actions-wrap button {
    flex: 1;
    min-width: 100px;
}

.summary-meta {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 400;
    margin-top: 4px;
}

.summary-right {
    text-align: right;
}

.summary-notes {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 4px;
    font-style: italic;
}

@media (max-width: 640px) {
    .stats-card .stats {
        grid-template-columns: 1fr;
    }

    .admin-form {
        grid-template-columns: 1fr;
    }

    .summary-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .summary-order {
        text-align: left;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .summary-right {
        text-align: left;
    }

    .hero-with-logo {
        flex-direction: column;
        text-align: center;
    }

    .hero-with-logo .badge,
    .hero-with-logo h1,
    .hero-with-logo p {
        text-align: center;
    }

    .menu-add-form {
        grid-template-columns: 1fr;
    }

    .menu-admin-item {
        flex-wrap: wrap;
    }
}

/* Nuove Funzionalità Admin ed Evento */
.admin-back-banner {
    background: #0f172a;
    color: #f8fafc;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid #059669;
}

.btn-admin-back {
    background: #059669;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn-admin-back:hover {
    background: #047857;
    transform: scale(1.02);
}

.kitchen-summary-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 22px;
    margin: 20px 0 24px;
    border: 1px solid #e2e8f0;
}

.kitchen-summary-card h3 {
    margin: 0 0 16px;
    font-size: 1.15rem;
    color: #1e293b;
    font-weight: 700;
}

.kitchen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.kitchen-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.kitchen-stat-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--dish-color, #6b7280);
    flex-shrink: 0;
}

.kitchen-stat-qty {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dish-color, #1e293b);
}

.kitchen-stat-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kitchen-stat-category {
    font-size: 0.75rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 6px;
}

@media (max-width: 640px) {
    .admin-back-banner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .kitchen-grid {
        grid-template-columns: 1fr;
    }
}

/* Stili per le righe dell'elenco utenti e partecipanti nel pannello admin */
.admin-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-bottom: 8px;
}

.admin-row:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.row-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.row-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Stili per la tabella delle prenotazioni ed il riepilogo porzioni */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    margin-top: 20px;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    color: #334155;
}

.orders-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.orders-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table-row-clickable {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.table-row-clickable:hover {
    background-color: #f8fafc;
}

/* Riepilogo Cucina con porzioni suddivise */
.kitchen-stat-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.85rem;
    color: #475569;
    padding-left: 24px;
    border-left: 2px solid #cbd5e1;
    margin-top: 6px;
    width: 100%;
}

.kitchen-stat-groups span {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

/* Dashboard Styles */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

.stat-card {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.1);
}

.stat-card .stat-label {
    font-size: 0.95rem;
    color: #1e40af;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .stat-value {
    font-size: 3rem;
    font-weight: 800;
    color: #1d4ed8;
    text-shadow: 0 2px 4px rgba(29, 78, 216, 0.15);
    line-height: 1;
}

.dashboard-dishes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.dash-dish-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 6px solid var(--dish-color, #3b82f6);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.dash-dish-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
    border-color: var(--dish-color, #3b82f6);
}

.dash-dish-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--dish-color, #3b82f6) 8%, transparent) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.dash-dish-card:hover::before {
    opacity: 1;
}

.dash-dish-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dash-dish-category {
    font-size: 0.75rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dash-dish-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--dish-color, #3b82f6);
    box-shadow: 0 0 6px var(--dish-color, #3b82f6);
}

.dash-dish-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    margin-top: 4px;
}

.dash-dish-stats {
    display: flex;
    gap: 16px;
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
}

.dash-dish-stat-item {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.dash-dish-qty {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dish-color, #1e293b);
    line-height: 1;
}

.dash-dish-people {
    font-size: 1.5rem;
    font-weight: 700;
    color: #475569;
    line-height: 1;
}

.dash-dish-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 4px;
    font-weight: 500;
}

.tab-btn.btn-danger {
    background: #4b5563;
    color: white;
}

.tab-btn.btn-danger:hover {
    background: #1f2937;
    color: white;
}

/* Colonne Sticky per il Tabellone Prenotazioni */
.orders-table th:nth-child(1),
.orders-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 10;
    min-width: 90px;
    max-width: 90px;
    width: 90px;
    background-color: #f8fafc !important; /* Header background */
}
.orders-table td:nth-child(1) {
    background-color: #ffffff !important;
    z-index: 5;
}

.orders-table th:nth-child(2),
.orders-table td:nth-child(2) {
    position: sticky;
    left: 90px;
    z-index: 10;
    min-width: 185px;
    max-width: 185px;
    width: 185px;
    background-color: #f8fafc !important; /* Header background */
    border-right: 2px solid #cbd5e1; /* Divisorio visivo */
}
.orders-table td:nth-child(2) {
    background-color: #ffffff !important;
    z-index: 5;
    border-right: 2px solid #e2e8f0;
}

/* Background degli elementi sticky all'hover sulla riga */
.table-row-clickable:hover td:nth-child(1),
.table-row-clickable:hover td:nth-child(2) {
    background-color: #f8fafc !important;
}

/* Compattazione colonne piatti */
.orders-table th.dish-col,
.orders-table td.dish-col {
    min-width: 50px;
    max-width: 60px;
    width: 55px;
    text-align: center;
}
.orders-table th.dish-col {
    font-size: 0.95rem;
    font-weight: 700;
}
.orders-table td.dish-col {
    font-size: 0.9rem;
}

.sortable-header {
    transition: background-color 0.2s, color 0.2s;
}
.sortable-header:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
}

#register-name,
#register-surname,
#login-name,
#login-surname,
#forgot-name,
#forgot-surname,
.edit-name,
.edit-surname {
    text-transform: uppercase;
}

/* Custom styles for dashboard payment stat cards */
.stat-card.card-bank {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-color: #e9d5ff;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.05);
}
.stat-card.card-bank:hover {
    box-shadow: 0 6px 16px rgba(168, 85, 247, 0.1);
}
.stat-card.card-bank .stat-label {
    color: #6b21a8;
}
.stat-card.card-bank .stat-value {
    color: #7e22ce;
    text-shadow: 0 2px 4px rgba(126, 34, 206, 0.15);
}

.stat-card.card-cash {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.05);
}
.stat-card.card-cash:hover {
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.1);
}
.stat-card.card-cash .stat-label {
    color: #166534;
}
.stat-card.card-cash .stat-value {
    color: #15803d;
    text-shadow: 0 2px 4px rgba(21, 128, 61, 0.15);
}

.stat-card.card-card {
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
    border-color: #a5f3fc;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.05);
}
.stat-card.card-card:hover {
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.1);
}
.stat-card.card-card .stat-label {
    color: #075985;
}
.stat-card.card-card .stat-value {
    color: #0369a1;
    text-shadow: 0 2px 4px rgba(3, 105, 161, 0.15);
}

/* Sizing overrides for smaller payment sub-cards */
.stat-card.card-sub {
    padding: 12px 16px;
    border-radius: 12px;
}
.stat-card.card-sub .stat-label {
    font-size: 0.75rem;
    margin-bottom: 4px;
}
.stat-card.card-sub .stat-value {
    font-size: 1.85rem;
    font-weight: 700;
}

/* Stili specifici per la Home Page con tab di Accesso e Registrazione */
body[data-page="home"] {
    --primary-color: #d97706; /* Ambra */
    --primary-hover: #b45309; /* Ambra scuro */
    --bg-color: #fcf8f2;
    --card-bg: #ffffff;
    --text-main: #2d3748;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
    
    font-family: 'Inter', sans-serif;
    background: linear-gradient(160deg, #fef3c7 0%, #fcf8f2 45%, #fffbeb 100%) !important;
    color: var(--text-main);
    overflow-x: hidden;
}

body[data-page="home"] .background-decor {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.08) 0%, rgba(255,255,255,0) 70%);
    top: -200px;
    left: -200px;
    z-index: -1;
    border-radius: 50%;
}

body[data-page="home"] .background-decor.decor-2 {
    top: auto;
    bottom: -200px;
    right: -200px;
    left: auto;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.06) 0%, rgba(255,255,255,0) 70%);
}

body[data-page="home"] .page-header {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    align-items: end;
    margin-bottom: 2rem;
    animation: fadeInDown 0.6s ease-out;
}



body[data-page="home"] .logo-img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: contain;
    background-color: white;
    box-shadow: var(--shadow-md);
}

body[data-page="home"] .header-titles h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

body[data-page="home"] .banner-container {
    width: 100%;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

body[data-page="home"] .main-content-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

body[data-page="home"] .info-card {
    border-top: 4px solid var(--primary-color) !important;
}

body[data-page="home"] .info-content {
    color: var(--text-main);
    font-size: 0.95rem;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

body[data-page="home"] #istruzioni-content {
    background-color: #f0fdf4; /* Verde tenue */
    border-left-color: #16a34a;
}

body[data-page="home"] .steps-list {
    margin-left: 1.2rem;
    color: var(--text-main);
}

body[data-page="home"] .steps-list li {
    margin-bottom: 0.5rem;
}

/* Tabs */
body[data-page="home"] .tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

body[data-page="home"] .tab-btn {
    flex: 1;
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--border-color);
    background: transparent;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

body[data-page="home"] .tab-btn:hover {
    border-color: #cbd5e0;
    color: var(--text-main);
}

body[data-page="home"] .tab-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 14px 0 rgba(217, 119, 6, 0.39) !important;
}

/* Forms */
body[data-page="home"] .forms-container {
    position: relative;
    overflow: hidden;
}

body[data-page="home"] .form-view {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

body[data-page="home"] .form-view.active {
    display: block;
}

body[data-page="home"] .form-row {
    display: flex;
    gap: 1rem;
}

body[data-page="home"] .form-row .input-group {
    flex: 1;
}

body[data-page="home"] .input-group {
    margin-bottom: 1.2rem;
}

body[data-page="home"] .input-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

body[data-page="home"] .input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: #fdfdfd;
}

body[data-page="home"] #reg-nome, body[data-page="home"] #reg-cognome, body[data-page="home"] #log-nome, body[data-page="home"] #log-cognome {
    text-transform: uppercase;
}

body[data-page="home"] .input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
    background-color: white;
}

body[data-page="home"] .primary-btn {
    width: 100%;
    padding: 0.9rem;
    background-color: var(--primary-color) !important;
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
}

body[data-page="home"] .primary-btn:hover {
    background-color: var(--primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.25);
}

body[data-page="home"] .primary-btn:active {
    transform: translateY(0);
}

body[data-page="home"] .secondary-btn {
    width: 100%;
    padding: 0.9rem;
    background-color: #6b7280 !important;
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
}

body[data-page="home"] .secondary-btn:hover {
    background-color: #4b5563 !important;
}

body[data-page="home"] .form-message {
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

body[data-page="home"] .form-message.error { color: #e53e3e !important; }
body[data-page="home"] .form-message.success { color: #38a169 !important; }

/* Autocomplete style */
body[data-page="home"] .autocomplete-container { position: relative; }
body[data-page="home"] .autocomplete-items {
    position: absolute; border: 1px solid #e2e8f0; border-top: none;
    z-index: 99; top: 100%; left: 0; right: 0; background-color: #fff;
    border-radius: 0 0 8px 8px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-height: 200px; overflow-y: auto;
}
body[data-page="home"] .autocomplete-item {
    padding: 10px; cursor: pointer; border-bottom: 1px solid #e2e8f0;
    display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem;
}
body[data-page="home"] .autocomplete-item:hover { background-color: #edf2f7; }
body[data-page="home"] .autocomplete-delete {
    color: #e53e3e; font-weight: bold; cursor: pointer; padding: 0 5px; font-size: 1.2rem;
}
body[data-page="home"] .autocomplete-delete:hover { color: #c53030; }

/* Reset password modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    body[data-page="home"] .form-row {
        flex-direction: column;
        gap: 0;
    }
    body[data-page="home"] .tabs {
        flex-direction: column;
    }
}

/* Media query per allineamento affiancato su schermi grandi */
@media (min-width: 900px) {
    body[data-page="home"] .container {
        max-width: 1400px !important;
        width: 100% !important;
    }
    body[data-page="home"] .page-header {
        grid-template-columns: 1fr 1fr !important;
        display: grid !important;
    }
    body[data-page="home"] .main-content-grid {
        grid-template-columns: 1fr 1fr !important;
        display: grid !important;
    }
}

/* Media query per allineamento orizzontale del link comunità pastorale su PC */
@media (min-width: 768px) {
    body[data-page="home"] .desktop-separator {
        display: inline !important;
    }
    body[data-page="home"] p.subtitle {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
    }
}

/* Event selector styling in food page */
#event-selector {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231e3a8a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 40px !important;
    border: 2px solid #3b82f6 !important;
    background-color: #f0f7ff !important;
    color: #1e3a8a !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

#event-selector:hover {
    border-color: #2563eb !important;
    background-color: #e0f2fe !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

#event-selector:focus {
    border-color: #1d4ed8 !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
}

/* Custom Payment Modal Styles */
.payment-option-card:hover {
    border-color: #94a3b8 !important;
    background-color: #f1f5f9 !important;
}

.payment-option-card.selected {
    border-color: #3b82f6 !important;
    background-color: #eff6ff !important;
}

.payment-option-card.selected span {
    color: #1e3a8a !important;
}

.payment-option-card.selected span:first-child {
    background-color: #dbeafe !important;
}

#btn-select-payment:hover {
    border-color: #94a3b8 !important;
    background-color: #f8fafc !important;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Overrides per la tabella iscritti pranzi e cene */
#admin-users-table-body .admin-row {
    display: table-row !important;
    cursor: pointer;
    background-color: white;
}
#admin-users-table-body .admin-row:hover {
    background-color: #f8fafc !important;
    transform: none !important;
    box-shadow: none !important;
}
#admin-users-table-body .admin-row.active {
    background-color: #eff6ff !important;
}
#admin-users-table-body td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0;
}