:root {
    --deskcheck-primary: #5c2d3a;
    --deskcheck-primary-hover: #4a2430;
    --deskcheck-accent: #8b4513;
    --deskcheck-bg: #faf8f6;
}

html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--deskcheck-bg);
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

a, .btn-link {
    color: var(--deskcheck-primary);
}

.btn-primary {
    color: #fff;
    background-color: var(--deskcheck-primary);
    border-color: var(--deskcheck-primary-hover);
}

.btn-primary:hover {
    background-color: var(--deskcheck-primary-hover);
    border-color: var(--deskcheck-primary-hover);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--deskcheck-primary);
}

.page-heading {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.content {
    padding-top: 1.1rem;
    max-width: 100%;
    min-width: 0;
}
.location-mask,
.location-content {
    max-width: 100%;
    min-width: 0;
}

/* Vista Overview - sale e tavoli occupati */
.location-overview-view {
    padding: 0.5rem 0;
}
.overview-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--deskcheck-primary);
    margin-bottom: 0.25rem;
}
.overview-subtitle {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 1rem;
}
.overview-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.overview-summary-card {
    background: #fff;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border: 1px solid rgba(92, 45, 58, 0.08);
}
.overview-summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--deskcheck-primary);
}
.overview-summary-label {
    font-size: 0.8rem;
    color: #666;
}
.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.overview-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid rgba(92, 45, 58, 0.12);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.overview-card:hover {
    border-color: var(--deskcheck-primary);
    box-shadow: 0 4px 12px rgba(92, 45, 58, 0.15);
    transform: translateY(-2px);
}
.overview-card:focus-visible {
    outline: 2px solid var(--deskcheck-primary);
    outline-offset: 2px;
}
.overview-card-full {
    border-left: 4px solid #28a745;
}
.overview-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.overview-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}
.overview-card-arrow {
    font-size: 1.25rem;
    color: #999;
}
.overview-card-stats {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}
.overview-card-occupied {
    font-weight: 700;
    color: var(--deskcheck-primary);
}
.overview-card-sep {
    color: #999;
    margin: 0 0.15rem;
}
.overview-card-total {
    font-weight: 600;
    color: #555;
}
.overview-card-label {
    font-size: 0.85rem;
    color: #666;
    margin-left: 0.35rem;
}
.overview-card-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}
.overview-card-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--deskcheck-primary), var(--deskcheck-accent));
    border-radius: 3px;
    transition: width 0.3s ease;
}
@media (max-width: 576px) {
    .content.px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Si è verificato un errore."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}


/* personalizzato */

.dx-icon, .dx-editor-icon, .dxbl-image {
    width: 16px;
    height: 16px;
}
.priority-info {
    background-color: var(--bs-info)
}

.priority-warning {
    background-color: var(--bs-orange)
}

.status-icon {
    width: 0.5rem;
    height: 0.5rem;
}

.priority-danger {
    background-color: var(--bs-red)
}

.status-icon-new {
    background-color: var(--bs-cyan);
}

.status-icon-rejected {
    background-color: var(--bs-red);
}

.status-icon-postponed {
    background-color: var(--bs-gray-600);
}

.status-icon-fixed {
    background-color: var(--bs-green);
}

.bug-icon {
    width: 16px;
    height: 17px;
    background-image: url("images/icons/bug.svg");
}

.dxbl-grid {
    height: 522px;
}

/* Base responsive: contenitore pagina */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.page main {
    flex: 1;
    min-width: 0;
}

/* ===== Top row (barra superiore) ===== */
.top-row {
    background-color: var(--deskcheck-primary);
    color: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    justify-content: flex-start;
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
}
.top-row.px-4 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
@media (min-width: 641px) {
    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }
    .top-row.px-4 {
        padding-left: 2rem;
        padding-right: 1.5rem;
    }
}
@media (max-width: 768px) {
    .facility-select-touch {
        min-width: 120px;
        max-width: 180px;
    }
    .date-picker-toprow {
        width: 125px;
    }
    .date-nav-btn {
        min-width: 32px;
        min-height: 32px;
    }
}

@media (max-width: 576px) {
    .top-row, .top-row.px-4 {
        padding: 0.4rem 0.5rem !important;
        min-height: auto;
    }
    .facility-selector-toprow {
        gap: 0.4rem 0.5rem !important;
    }
    .facility-select-touch {
        min-width: 0;
        flex: 1 1 120px;
        max-width: 100%;
        min-height: 34px;
        font-size: 0.85rem;
    }
    .topbar-date-group {
        flex: 1 1 auto;
        min-width: 0;
    }
    .date-picker-toprow {
        width: 110px;
        min-width: 100px;
        min-height: 34px;
        font-size: 0.85rem;
    }
    .date-nav-btn {
        min-width: 30px;
        min-height: 30px;
    }
    .drawer-trigger {
        min-height: 34px;
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
    }
    .drawer-trigger-text { display: none; }
    .topbar-overview-text { display: none; }
    .drawer-trigger-badge {
        max-width: 70px;
    }
    .topbar-view-buttons {
        flex-wrap: wrap;
        gap: 0.2rem;
    }
    .topbar-view-buttons .btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* ===== Facility selector top-row ===== */
.facility-selector-toprow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    width: 100%;
    color: #fff;
}
.refresh-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}
.refresh-indicator-green {
    background-color: #28a745;
}
.facility-select-touch {
    min-height: 36px;
    min-width: 160px;
    max-width: 220px;
    font-size: 0.9rem;
    padding: 0.35rem 2rem 0.35rem 0.5rem;
    background-color: #fff;
    color: #333;
}

.topbar-date-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.date-picker-toprow {
    min-height: 36px;
    width: 140px;
    font-size: 0.9rem;
    background-color: #fff;
    color: #333;
}

.date-nav-btn {
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255,255,255,0.9) !important;
    color: var(--deskcheck-primary) !important;
    border: 1px solid rgba(255,255,255,0.5);
}
.date-nav-btn:hover {
    background-color: #fff !important;
    color: var(--deskcheck-primary-hover) !important;
}

/* Selettore vista in top-row (sfondo scuro) - ben visibile */
.view-mode-toprow {
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255,255,255,0.4);
}
.view-mode-buttons .btn {
    min-height: 38px;
    padding: 0.35rem 0.6rem;
    font-weight: 500;
}

.facility-selector-toprow .btn-group-sm .btn-light {
    background-color: rgba(255,255,255,0.95) !important;
    color: var(--deskcheck-primary) !important;
    border-color: rgba(255,255,255,0.5);
}
.facility-selector-toprow .btn-group-sm .btn-light:hover {
    background-color: #fff !important;
}
.facility-selector-toprow .btn-group-sm .btn-outline-light {
    background-color: transparent !important;
    color: rgba(255,255,255,0.9) !important;
    border-color: rgba(255,255,255,0.5);
}
.facility-selector-toprow .btn-group-sm .btn-outline-light:hover {
    background-color: rgba(255,255,255,0.2) !important;
    color: #fff !important;
}

/* Drawer Sala e Vista (pulsanti separati) */
.drawer-trigger {
    min-height: 38px;
    padding: 0.35rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
}
.drawer-trigger-active {
    background-color: rgba(255,255,255,0.3) !important;
}
.drawer-trigger-text { white-space: nowrap; }
.drawer-trigger-badge {
    font-size: 0.8rem;
    opacity: 0.9;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1040;
    animation: drawer-fade-in 0.2s ease;
}
.drawer-panel {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 85vh;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    border-radius: 0 0 12px 12px;
    animation: drawer-slide-down 0.25s ease;
}
@keyframes drawer-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes drawer-slide-down {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(92, 45, 58, 0.12);
    background: var(--deskcheck-primary);
    color: #fff;
}
.drawer-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}
.drawer-close {
    color: #fff;
    background: transparent;
    border: none;
    padding: 0.35rem;
    border-radius: 6px;
}
.drawer-close:hover {
    background: rgba(255,255,255,0.2);
}

.drawer-body {
    flex: 0 1 auto;
    overflow-y: auto;
    padding: 1.25rem;
}
.drawer-section {
    margin-bottom: 1.5rem;
}
.drawer-section:last-child {
    margin-bottom: 0;
}
.drawer-section-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--deskcheck-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}
.drawer-location-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.drawer-location-buttons .location-btn {
    flex: 1 1 0;
    min-width: 100px;
}
/* Pulsanti vista in top bar */
.topbar-view-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.topbar-view-buttons .btn {
    min-height: 38px;
    padding: 0.35rem 0.6rem;
    font-weight: 500;
}
.topbar-overview-btn {
    margin-right: 0.25rem;
    border-right: 1px solid rgba(0,0,0,0.1);
    padding-right: 0.5rem;
}
.facility-selector-toprow .btn-light-active {
    background-color: rgba(255,255,255,0.95) !important;
    color: var(--deskcheck-primary) !important;
}
.drawer-empty,
.drawer-loading {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

/* ===== Location submenu (usato nel drawer) ===== */
.location-submenu {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(92, 45, 58, 0.08);
    border: 1px solid rgba(92, 45, 58, 0.12);
}

.location-submenu-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--deskcheck-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.location-submenu-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.location-btn {
    min-height: 44px;
    padding: 0.5rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--deskcheck-primary);
    background: rgba(92, 45, 58, 0.06);
    border: 1.5px solid rgba(92, 45, 58, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.location-btn:hover {
    background: rgba(92, 45, 58, 0.12);
    border-color: rgba(92, 45, 58, 0.35);
}

.location-btn-active {
    background: var(--deskcheck-primary);
    color: #fff !important;
    border-color: var(--deskcheck-primary);
}

.location-btn-active:hover {
    background: var(--deskcheck-primary-hover);
    border-color: var(--deskcheck-primary-hover);
}

.location-btn:focus-visible {
    outline: 2px solid var(--deskcheck-primary);
    outline-offset: 2px;
}

@media (max-width: 576px) {
    .location-submenu {
        padding: 0.875rem 1rem;
    }
    .location-submenu-buttons {
        width: 100%;
    }
    .location-btn {
        flex: 1;
        min-width: 100px;
    }
}

.location-submenu-empty {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

/* Selettore vista (sotto le sale, sopra i tavoli) */
.view-mode-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(92, 45, 58, 0.08);
    border: 1px solid rgba(92, 45, 58, 0.12);
}

.view-mode-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--deskcheck-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.view-mode-buttons-content .btn {
    min-height: 44px;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* ===== Restaurant floor & tables ===== */
.restaurant-view {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}
.restaurant-view .date-picker-touch {
    min-height: 48px;
    font-size: 1.1rem;
}

/* Vista Split: tavoli 3/4, dettaglio 1/4 */
.view-split {
    display: flex;
    gap: 1rem;
    min-height: 400px;
}

.view-split-left {
    flex: 0 0 75%;
    min-width: 0;
}

.view-split-right {
    flex: 0 0 calc(25% - 1rem);
    min-width: 200px;
}

.restaurant-floor-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.restaurant-table-compact {
    cursor: pointer;
    gap: 0.4rem;
    padding: 0.6rem;
}
.restaurant-table-compact.table-selected {
    box-shadow: 0 0 0 3px var(--deskcheck-primary);
}

.restaurant-table-compact.table-has-services {
    border-color: #28a745;
    border-width: 3px;
    box-shadow: 0 0 0 1px rgba(40, 167, 69, 0.3);
}
.restaurant-table-compact.table-has-services.table-selected {
    box-shadow: 0 0 0 3px var(--deskcheck-primary);
}

.restaurant-table-compact.table-has-note-cucina {
    border-left: 4px solid #ffc107;
}
.restaurant-table-compact .table-note-cucina-indicator {
    position: absolute;
    bottom: 4px;
    right: 6px;
    font-size: 0.9rem;
    color: #b8860b;
}

/* Vista split: tavoli grandi, leggibili, nomi lunghi gestiti */
.restaurant-floor-compact {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
}

.restaurant-floor-compact .table-size-uniform {
    width: 150px;
    height: 150px;
    min-width: 150px;
    min-height: 150px;
}

.restaurant-table-compact .table-label,
.restaurant-table-compact .table-label-split {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.restaurant-table-compact .table-pax-badge,
.restaurant-table-compact .table-pax-split {
    font-size: 0.75rem;
    color: #666;
    line-height: 1;
}

.restaurant-table-compact .table-occupied-pax {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--deskcheck-primary);
    line-height: 1;
}

.restaurant-table-compact .table-count,
.restaurant-table-compact .table-count-split {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--deskcheck-primary);
    line-height: 1;
}

.restaurant-table-compact .table-free-split {
    font-size: 1.1rem;
    color: #999;
    line-height: 1;
}

/* Dettaglio popup su mobile (vista Split) */
.detail-popup-backdrop {
    display: none;
}
@media (max-width: 768px) {
    .detail-popup-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1040;
        animation: drawer-fade-in 0.2s ease;
    }
    .view-split-right:not(.detail-popup-open) {
        display: none !important;
    }
    .view-split-right.detail-popup-open {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        max-height: 75vh;
        z-index: 1050;
        margin: 0;
        flex: none;
        min-width: 0;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
        animation: drawer-slide-up 0.25s ease;
        background: #fff;
        overflow-y: auto;
    }
    .view-split-right.detail-popup-open::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        background: #ccc;
        border-radius: 2px;
        margin: 0.5rem auto;
    }
    .detail-popup-close {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        width: 36px;
        height: 36px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(92, 45, 58, 0.1);
        border: none;
        border-radius: 50%;
        color: var(--deskcheck-primary);
        font-size: 1.25rem;
        cursor: pointer;
    }
    .detail-popup-close:hover {
        background: rgba(92, 45, 58, 0.2);
    }
}

/* Pannello dettaglio a destra */
.detail-panel {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid rgba(92, 45, 58, 0.12);
    height: 100%;
    overflow-y: auto;
    position: relative;
}

.detail-panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--deskcheck-primary);
    margin-bottom: 0.25rem;
}

.detail-panel-subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.detail-panel-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-booking {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

.detail-booking-time {
    font-weight: 600;
    font-size: 1rem;
    margin: 0.25rem 0;
}

.detail-booking-service {
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.detail-booking-pax {
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.detail-booking-note-cucina {
    font-size: 0.85rem;
    margin-top: 0.35rem;
    padding: 0.35rem 0.5rem;
    background: rgba(255, 193, 7, 0.2);
    border-radius: 6px;
    border-left: 3px solid #ffc107;
}

.detail-booking-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
    min-width: 0;
}

.detail-booking .badge-other-tables {
    font-size: 0.7rem;
    font-weight: 500;
    display: block;
    max-width: 100%;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
}

.detail-panel-empty {
    color: #999;
    font-style: italic;
}

.detail-panel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    text-align: center;
}
.detail-panel-placeholder .bi { font-size: 2.5rem; margin-bottom: 0.5rem; }

/* Vista Lista: elenco tavoli con prenotazioni */
.view-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-table-row {
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(92, 45, 58, 0.15);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
}

.list-table-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(92, 45, 58, 0.05);
    border-bottom: 1px solid rgba(92, 45, 58, 0.1);
    flex-wrap: wrap;
}

.list-table-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--deskcheck-primary);
}

.list-table-pax {
    font-size: 0.9rem;
    color: #666;
}

.list-table-count {
    font-size: 0.85rem;
    color: #28a745;
    font-weight: 600;
    margin-left: auto;
}

.list-table-bookings {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
}

.list-booking {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

.list-booking-time {
    font-weight: 600;
    min-width: 100px;
}

.list-booking-service {
    flex: 1;
    min-width: 120px;
}

.list-booking-pax {
    font-size: 0.85rem;
    color: #666;
}

/* List/Summary: layout principale prenotazione */
.list-booking-main,
.summary-booking-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    width: 100%;
}

/* Toggle note cucina (accordion) */
.note-cucina-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.9rem;
    color: #b8860b;
    background: transparent;
    border: 1px solid rgba(184, 134, 11, 0.4);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.note-cucina-toggle:hover {
    color: #8b6914;
    background: rgba(255, 193, 7, 0.15);
}
.note-cucina-toggle.expanded {
    background: rgba(255, 193, 7, 0.2);
}

.list-booking-note-cucina,
.summary-booking-note-cucina {
    color: inherit;
}

/* Sezione espandibile note cucina */
.note-cucina-collapse {
    width: 100%;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(184, 134, 11, 0.3);
}
.note-cucina-collapse-body {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 6px;
    border-left: 3px solid #b8860b;
    white-space: pre-wrap;
    word-break: break-word;
}

.list-table-empty {
    padding: 0.75rem 1rem;
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

.list-booking-prev-ref {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

.list-table-row-free .list-table-header {
    border-color: rgba(108, 117, 125, 0.3);
}

.list-table-free-badge {
    font-size: 0.85rem;
    color: #28a745;
    font-weight: 600;
}

/* Vista Riepilogo */
.view-summary {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.summary-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid rgba(92, 45, 58, 0.1);
}

.summary-card-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--deskcheck-primary);
}

.summary-card-label {
    font-size: 0.9rem;
    color: #666;
}

.summary-card-occupied .summary-card-value { color: #28a745; }
.summary-card-free .summary-card-value { color: #6c757d; }
.summary-card-bookings .summary-card-value { color: #0d6efd; }

.summary-timeline {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid rgba(92, 45, 58, 0.1);
}

.summary-timeline-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--deskcheck-primary);
    margin-bottom: 1rem;
}

.summary-booking-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-booking-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

.summary-booking-time {
    font-weight: 600;
    min-width: 110px;
}

.summary-booking-table {
    font-weight: 500;
    color: var(--deskcheck-primary);
}

.summary-booking-service {
    flex: 1;
    min-width: 120px;
}

.summary-booking-pax {
    font-size: 0.85rem;
    color: #666;
}

.summary-booking-note-cucina {
    font-size: 0.8rem;
    color: #b8860b;
}

.restaurant-floor {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

.restaurant-table-wrapper {
    min-width: 0;
}

.restaurant-table {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid var(--deskcheck-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.15s ease;
}

.restaurant-table:active {
    transform: scale(0.98);
}

/* Forme tavoli */
.table-shape-round {
    border-radius: 50%;
}
.table-shape-square {
    border-radius: 10px;
}
.table-shape-rect {
    border-radius: 12px;
}

/* Dimensioni in base a pax */
.table-size-2 { width: 90px; height: 90px; min-width: 90px; min-height: 90px; }
.table-size-4 { width: 110px; height: 110px; min-width: 110px; min-height: 110px; }
.table-size-6 { width: 130px; height: 100px; min-width: 130px; min-height: 100px; }
.table-size-8 { width: 150px; height: 110px; min-width: 150px; min-height: 110px; }
.table-size-large { width: 170px; height: 120px; min-width: 170px; min-height: 120px; }

.table-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--deskcheck-primary);
    margin-bottom: 2px;
}

.table-pax-badge {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 4px;
}

.table-empty {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}

.table-bookings {
    width: 100%;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 100%;
    overflow-y: auto;
}

.table-booking {
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    text-align: center;
}

/* Sfondo occupazione: check-out=grigio, check-in=verde, da fare=azzurro */
.occ-checkout {
    background-color: #e9ecef;
    color: #495057;
}
.occ-checkin {
    background-color: #d4edda;
    color: #155724;
}
.occ-pending {
    background-color: #cce5ff;
    color: #004085;
}

/* Badge confermata/non confermata */
.badge-confirmed {
    background-color: #d4edda !important;
    color: #155724 !important;
}
.badge-unconfirmed {
    background-color: #fff3cd !important;
    color: #856404 !important;
}

.booking-badge {
    font-size: 0.75rem;
    display: inline-block;
    margin-bottom: 2px;
}

.booking-time {
    font-weight: 600;
    font-size: 0.85rem;
}

.booking-service, .booking-pax {
    font-size: 0.75rem;
    margin-top: 2px;
}

/* Tablet e mobile: vista split impilata */
@media (max-width: 992px) {
    .view-split {
        flex-direction: column;
        min-height: auto;
        gap: 1rem;
    }
    .view-split-left, .view-split-right {
        flex: 1 1 auto;
        min-width: 100%;
        max-width: 100%;
    }
    .view-split-right {
        min-width: 0;
    }
}

/* Touch: tavoli più grandi su mobile */
@media (max-width: 768px) {
    .view-split {
        flex-direction: column;
        gap: 0.75rem;
    }
    .restaurant-floor {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    .restaurant-floor-compact {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    .restaurant-floor-compact .table-size-uniform {
        width: 120px;
        height: 120px;
        min-width: 120px;
        min-height: 120px;
    }
    .table-size-2 { width: 100px; height: 100px; min-width: 100px; min-height: 100px; }
    .table-size-4 { width: 120px; height: 120px; min-width: 120px; min-height: 120px; }
    .table-size-6 { width: 140px; height: 110px; min-width: 140px; min-height: 110px; }
    .table-size-8 { width: 160px; height: 120px; min-width: 160px; min-height: 120px; }
    .table-size-large { width: 180px; height: 130px; min-width: 180px; min-height: 130px; }
    .detail-panel {
        padding: 1rem;
    }
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .summary-card {
        padding: 1rem;
    }
    .summary-card-value {
        font-size: 1.5rem;
    }
}

/* Overview responsive */
@media (max-width: 768px) {
    .overview-cards {
        grid-template-columns: 1fr;
    }
    .overview-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 576px) {
    .overview-title {
        font-size: 1.2rem;
    }
    .overview-card {
        padding: 1rem;
    }
    .overview-summary-card {
        padding: 0.75rem;
    }
    .overview-summary-value {
        font-size: 1.25rem;
    }
}

/* Mobile: layout compatto */
@media (max-width: 576px) {
    .page-heading {
        font-size: 1.25rem;
    }
    .restaurant-floor-compact {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    .restaurant-floor-compact .table-size-uniform {
        width: 100px;
        height: 100px;
        min-width: 100px;
        min-height: 100px;
    }
    .restaurant-table-compact {
        padding: 0.5rem;
    }
    .restaurant-table-compact .table-label-split {
        font-size: 0.9rem;
    }
    .restaurant-table-compact .table-pax-split,
    .restaurant-table-compact .table-occupied-pax {
        font-size: 0.7rem;
    }
    .detail-panel {
        padding: 0.875rem;
    }
    .detail-booking {
        padding: 0.75rem;
    }
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .summary-card {
        padding: 0.875rem;
    }
    .summary-card-value {
        font-size: 1.35rem;
    }
    .summary-card-label {
        font-size: 0.8rem;
    }
    .list-table-header,
    .list-table-bookings {
        padding: 0.5rem 0.75rem;
    }
    .list-booking-main,
    .summary-booking-main {
        gap: 0.35rem 0.75rem;
    }
    .list-booking-time,
    .summary-booking-time {
        min-width: 90px;
    }
    .drawer-panel {
        top: auto;
        bottom: 0;
        max-height: 70vh;
        border-radius: 12px 12px 0 0;
        animation: drawer-slide-up 0.25s ease;
    }
    .auth-form .form-control-lg {
        font-size: 1rem;
    }
}

@keyframes drawer-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}