/* ============================================
   GRUPPO ORSO - Dashboard Admin
   ============================================ */

/* CSS Variables */
:root {
    --color-bg: #F8F9FA;
    --color-surface: #FFFFFF;
    --color-surface-hover: #F5F5F5;
    --color-bg-secondary: #F0F0F0;
    --color-text: #1A1A2E;
    --color-text-secondary: #6C757D;
    --color-text-muted: #ADB5BD;
    --color-border: #DEE2E6;
    --color-border-light: #E9ECEF;
    
    --color-primary: #2C3E50;
    --color-primary-light: #34495E;
    --color-primary-bg: #EBF0F5;
    --color-success: #27AE60;
    --color-success-bg: #E8F8F0;
    --color-warning: #F39C12;
    --color-warning-bg: #FEF9E7;
    --color-error: #E74C3C;
    --color-error-bg: #FDEDEC;
    --color-danger: #E74C3C;
    --color-danger-bg: #FDEDEC;
    --color-info: #3498DB;
    --color-info-bg: #EBF5FB;
    
    --color-status-pending: #F39C12;
    --color-status-confirmed: #27AE60;
    --color-status-arrived: #3498DB;
    --color-status-completed: #95A5A6;
    --color-status-noshow: #E74C3C;
    --color-status-cancelled: #BDC3C7;
    --color-status-rejected: #C0392B;
    
    --color-table-free: #27AE60;
    --color-table-booked: #F39C12;
    --color-table-occupied: #E74C3C;
    --color-table-disabled: #BDC3C7;
    
    --sidebar-width: 260px;
    --header-height: 64px;
    
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 50px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    overflow: hidden;
}

/* ============================================
   SAFARI 13 FALLBACK - Flexbox Gap
   Safari < 14.1 non supporta gap in flexbox.
   Questi fallback usano margin per compatibilità.
   ============================================ */

/* Fallback per elementi con gap in flex-direction: row */
.btn > *:not(:last-child),
.nav-item > *:not(:last-child),
.user-info > *:not(:last-child),
.reservation-actions > *:not(:last-child),
.view-header-actions > *:not(:last-child),
.filters-bar > *:not(:last-child),
.date-navigator > *:not(:last-child),
.modal-footer > *:not(:last-child),
.radio-group > *:not(:last-child),
.checkbox-group > *:not(:last-child) {
    margin-right: 8px;
}

/* Fallback per elementi con gap in flex-direction: column */
.login-form > *:not(:last-child),
.form-group > *:not(:last-child),
.sidebar-nav > *:not(:last-child),
.settings-nav > *:not(:last-child) {
    margin-bottom: 8px;
}

/* Reset margin quando gap è supportato (browser moderni) */
@supports (gap: 1px) {
    .btn > *:not(:last-child),
    .nav-item > *:not(:last-child),
    .user-info > *:not(:last-child),
    .reservation-actions > *:not(:last-child),
    .view-header-actions > *:not(:last-child),
    .filters-bar > *:not(:last-child),
    .date-navigator > *:not(:last-child),
    .modal-footer > *:not(:last-child),
    .radio-group > *:not(:last-child),
    .checkbox-group > *:not(:last-child),
    .login-form > *:not(:last-child),
    .form-group > *:not(:last-child),
    .sidebar-nav > *:not(:last-child),
    .settings-nav > *:not(:last-child) {
        margin-right: 0;
        margin-bottom: 0;
    }
}

/* ============================================
   Login Section
   ============================================ */
.login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

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

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-input, .form-select, .form-textarea {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.login-error {
    padding: var(--space-sm) var(--space-md);
    background: var(--color-error-bg);
    color: var(--color-error);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg);
    border-color: var(--color-text-muted);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-login {
    margin-top: var(--space-sm);
    padding: 12px;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--color-text-muted);
    font-size: 13px;
}

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

.login-divider span {
    padding: 0 12px;
}

.btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: white;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-google:hover {
    background: var(--color-bg);
    border-color: var(--color-text-muted);
}

/* Mobile header - hidden by default */
.mobile-header {
    display: none !important;
}

/* Role badges */
.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: var(--color-primary-bg);
    color: var(--color-primary);
}

.role-responsabile {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.role-operatore {
    background: var(--color-border-light);
    color: var(--color-text-muted);
}

.btn-loader.hidden { display: none; }

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Dashboard Layout
   ============================================ */
.dashboard-section {
    display: flex;
    height: 100vh;
}

.dashboard-section.hidden {
    display: none;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.venue-selector {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    display: none; /* Nascosto - usiamo il dropdown custom */
}

/* ============================================
   VENUE DROPDOWN CUSTOM
   ============================================ */
.venue-dropdown {
    position: relative;
    width: 100%;
}

.venue-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.venue-dropdown-toggle:hover {
    border-color: var(--color-primary);
    background: var(--color-surface-hover);
}

.venue-dropdown.open .venue-dropdown-toggle {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.venue-dropdown-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.venue-dropdown-arrow {
    transition: transform var(--transition-fast);
    color: var(--color-text-muted);
}

.venue-dropdown.open .venue-dropdown-arrow {
    transform: rotate(180deg);
}

.venue-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.venue-dropdown.open .venue-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.venue-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
    color: var(--color-text);
}

.venue-dropdown-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.venue-dropdown-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.venue-dropdown-item:hover {
    background: var(--color-surface-hover);
}

.venue-dropdown-item.active {
    background: var(--color-primary-bg);
}

.venue-dropdown-item .venue-name {
    flex: 1;
    font-size: 14px;
}

/* Checkmark nascosto di default, visibile solo quando attivo */
.venue-dropdown-item .venue-check {
    opacity: 0;
    color: var(--color-primary);
    transition: opacity var(--transition-fast);
}

.venue-dropdown-item.active .venue-check {
    opacity: 1;
}

/* Color dots per ogni locale */
.venue-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--color-text-muted);
}

.venue-color-dot.blanco {
    background: #3498DB;
}

.venue-color-dot.calapso {
    background: #E74C3C;
}

.venue-color-dot.duomo {
    background: #27AE60;
}

.venue-color-dot.teglia {
    background: #F39C12;
}

.venue-color-dot.orsolab {
    background: #9B59B6;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 12px;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background: var(--color-border-light);
    color: var(--color-text);
}

.nav-item.active {
    background: var(--color-primary);
    color: white;
}

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--color-text-muted);
}

.logout-btn {
    padding: 8px;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.logout-btn:hover {
    background: var(--color-error-bg);
    color: var(--color-error);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.view {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.view.active {
    display: flex;
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
    flex-shrink: 0;
}

.view-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.view-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.date-navigator {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.date-nav-btn, .today-btn {
    padding: 6px 10px;
    background: var(--color-border-light);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.date-nav-btn:hover, .today-btn:hover {
    background: var(--color-border);
}

.date-picker-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
}

.view-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.stats-bar {
    display: flex;
    gap: var(--space-lg);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.stat-label {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* Sezioni Tabs (Ristorante / Cocktail Bar) */
.sezioni-tabs-container {
    display: flex;
    gap: 6px;
    padding: 8px var(--space-lg);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
    overflow-x: auto;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
}

.sezioni-tabs-container::-webkit-scrollbar { display: none; }

.sezione-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sezione-tab:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light, #e3f2fd);
}

.sezione-tab.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* View Tabs */
.view-tabs {
    display: flex;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
}

.view-tab {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.view-tab:hover {
    background: var(--color-border-light);
}

.view-tab.active {
    background: var(--color-primary);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
}

.filters-bar.search-only {
    padding: var(--space-sm) var(--space-lg);
    background: var(--color-bg);
}

.filters-bar.search-only .search-group {
    margin-left: 0;
    max-width: 400px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

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

.filter-select {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

.search-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-left: auto;
    padding: 6px 12px;
    background: var(--color-border-light);
    border-radius: var(--radius-md);
}

.search-group svg {
    color: var(--color-text-muted);
}

.search-input {
    border: none;
    background: none;
    font-size: 13px;
    width: 200px;
}

.search-input:focus {
    outline: none;
}

/* Reservations List */
.reservations-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md) var(--space-lg);
}

.reservation-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    transition: all var(--transition-fast);
}

.reservation-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.reservation-time {
    font-size: 1.125rem;
    font-weight: 600;
    min-width: 55px;
    flex-shrink: 0;
}

.reservation-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.reservation-status.richiesta { background: var(--color-status-pending); }
.reservation-status.confermata { background: var(--color-status-confirmed); }
.reservation-status.arrivato { background: var(--color-status-arrived); }
.reservation-status.completata { background: var(--color-status-completed); }
.reservation-status.noshow { background: var(--color-status-noshow); }
.reservation-status.cancellata { background: var(--color-status-cancelled); }
.reservation-status.rifiutata { background: var(--color-status-rejected); }

.reservation-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reservation-main-line {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.reservation-name {
    font-weight: 600;
    font-size: 14px;
}

.reservation-people-inline {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.reservation-people-inline svg {
    opacity: 0.7;
}

.reservation-notes-inline {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.reservation-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0;
}

.reservation-details {
    font-size: 12px;
    color: var(--color-text-secondary);
    display: flex;
    gap: var(--space-md);
}

.reservation-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.reservation-people {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: 500;
}

.reservation-table {
    padding: 4px 8px;
    background: var(--color-border-light);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.reservation-notes {
    display: flex;
    gap: var(--space-xs);
}

.note-badge {
    padding: 2px 6px;
    font-size: 10px;
    border-radius: var(--radius-sm);
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.note-badge.allergy {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.reservation-actions {
    display: flex;
    gap: var(--space-xs);
}

.action-btn {
    padding: 6px;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--color-border-light);
    color: var(--color-text);
}

.action-btn.confirm:hover {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.action-btn.cancel:hover {
    background: var(--color-error-bg);
    color: var(--color-error);
}

/* Status Dropdown Menu */
.status-dropdown {
    position: relative;
}

.status-btn {
    background: var(--color-surface) !important;
    border: 1px solid var(--color-border) !important;
}

.status-btn:hover {
    background: var(--color-bg) !important;
    border-color: var(--color-text-muted) !important;
}

.status-btn .status-dot {
    width: 28px;
    height: 28px;
}

.status-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 9999;
    overflow: hidden;
    margin-top: 8px;
}

.status-menu.open {
    display: block;
    animation: slideDown 0.15s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    font-size: 13px;
    color: var(--color-text);
    cursor: pointer;
    transition: background var(--transition-fast);
    text-align: left;
}

.status-option:hover {
    background: var(--color-bg);
}

.status-option.active {
    background: var(--color-primary-bg);
    font-weight: 600;
}

/* ============================================
   FLOATING STATUS MENU (Menu cambio stato flottante)
   ============================================ */
.floating-status-menu {
    position: fixed;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 10000;
    overflow: hidden;
    animation: slideDown 0.15s ease;
}

.floating-status-menu .status-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: var(--color-surface);
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    transition: background var(--transition-fast);
    text-align: left;
}

.floating-status-menu .status-option:hover {
    background: var(--color-surface-hover);
}

.floating-status-menu .status-option.active {
    background: var(--color-primary-bg);
    font-weight: 600;
}

.status-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #ccc;
    display: inline-block;
}

.status-dot.richiesta { background: #F39C12 !important; }
.status-dot.confermata { background: #27AE60 !important; }
.status-dot.arrivato { background: #3498DB !important; }
.status-dot.completata { background: #95A5A6 !important; }
.status-dot.noshow { background: #E74C3C !important; }
.status-dot.cancellata { background: #BDC3C7 !important; }
.status-dot.rifiutata { background: #C0392B !important; }

/* Conferma automatica: pallino verde con spunta interna */
.status-dot.confermata.auto {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.25);
}
.status-dot.confermata.auto::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}
.status-btn .status-dot.confermata.auto::after {
    font-size: 16px;
}

/* Prenotazioni future da confermare - Pulse animation */
.stat-pill.future-pending {
    position: relative;
}

.pending-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #E74C3C;
    border-radius: 50%;
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    color: var(--color-text-muted);
}

.empty-state svg {
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

/* ============================================
   Floorplan Tab
   ============================================ */
.floorplan-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.floorplan-sidebar {
    width: 280px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border-light);
    padding: var(--space-md);
    overflow-y: auto;
}

.floorplan-sidebar h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.unassigned-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.unassigned-card {
    padding: var(--space-sm) var(--space-md);
    background: var(--color-border-light);
    border-radius: var(--radius-md);
    cursor: grab;
    transition: all var(--transition-fast);
}

.unassigned-card:hover {
    background: var(--color-primary);
    color: white;
}

.unassigned-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.unassigned-name {
    font-weight: 500;
    font-size: 13px;
}

.unassigned-details {
    font-size: 11px;
    opacity: 0.8;
}

.floorplan-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.floorplan-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
}

.time-slider-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.time-slider {
    width: 200px;
    cursor: pointer;
}

.fascia-selector {
    display: flex;
    gap: 8px;
}

.fascia-btn {
    padding: 8px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.fascia-btn.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
}

.floorplan-legend {
    display: flex;
    gap: var(--space-lg);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 12px;
    color: var(--color-text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.free { background: var(--color-table-free); }
.legend-color.booked { background: var(--color-table-booked); }
.legend-color.occupied { background: var(--color-table-occupied); }

.floorplan-canvas {
    flex: 1;
    overflow: auto;
    padding: var(--space-lg);
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 19px,
        var(--color-border-light) 19px,
        var(--color-border-light) 20px
    ),
    repeating-linear-gradient(
        90deg,
        transparent,
        transparent 19px,
        var(--color-border-light) 19px,
        var(--color-border-light) 20px
    );
}

/* Table Elements */
.table-element {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.table-element:hover {
    filter: brightness(1.1);
}

.table-element.free { fill: var(--color-table-free); }
.table-element.booked { fill: var(--color-table-booked); }
.table-element.occupied { fill: var(--color-table-occupied); }
.table-element.disabled { fill: var(--color-table-disabled); }

.table-element.drop-target {
    stroke: var(--color-primary);
    stroke-width: 3;
    stroke-dasharray: 5;
}

.table-element.multi {
    cursor: pointer;
}

.table-element.multi:hover {
    filter: brightness(1.05);
}

/* Animazione per tavoli occupati */
@keyframes pulse-occupied {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.table-element.occupied rect {
    animation: pulse-occupied 2s ease-in-out infinite;
}

/* ============================================
   Timeline Tab
   ============================================ */
.timeline-container {
    flex: 1;
    overflow: auto;
    padding: var(--space-lg);
}

.timeline-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1px;
    background: var(--color-border-light);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.timeline-header {
    display: contents;
}

.timeline-corner {
    background: var(--color-surface);
    padding: var(--space-sm);
}

.timeline-hours {
    display: flex;
    background: var(--color-surface);
}

.timeline-hour {
    flex: 1;
    padding: var(--space-sm);
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-secondary);
    min-width: 60px;
}

.timeline-row {
    display: contents;
}

.timeline-table-label {
    background: var(--color-surface);
    padding: var(--space-sm);
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.timeline-table-slots {
    display: flex;
    background: var(--color-surface);
    position: relative;
    min-height: 50px;
}

.timeline-slot {
    flex: 1;
    border-left: 1px solid var(--color-border-light);
    min-width: 60px;
}

.timeline-booking {
    position: absolute;
    top: 4px;
    bottom: 4px;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    color: white;
    font-size: 11px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ============================================
   Settings View
   ============================================ */
.settings-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.settings-nav {
    width: 200px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border-light);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.settings-nav-item {
    padding: 10px 12px;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    transition: all var(--transition-fast);
}

.settings-nav-item:hover {
    background: var(--color-border-light);
}

.settings-nav-item.active {
    background: var(--color-primary);
    color: white;
}

.settings-content {
    flex: 1;
    padding: var(--space-xl);
    overflow-y: auto;
}

.settings-section {
    max-width: 600px;
}

.settings-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
}

.settings-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

/* ============================================
   Editor View
   ============================================ */
.editor-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
}

.tool-group {
    display: flex;
    gap: var(--space-xs);
}

.tool-btn {
    padding: 8px;
    background: var(--color-border-light);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.tool-btn.active {
    background: var(--color-primary);
    color: white;
}

.tool-btn.danger:hover {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.editor-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-canvas {
    flex: 1;
    overflow: hidden;
    background: #fafafa;
    position: relative;
}

.editor-properties {
    width: 250px;
    flex-shrink: 0;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border-light);
    padding: var(--space-md);
    overflow-y: auto;
}

.editor-properties h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-md);
}

.properties-empty {
    color: var(--color-text-muted);
    font-size: 13px;
    text-align: center;
    padding: var(--space-lg);
}

/* ============================================
   Modals
   ============================================ */
.modal-overlay {
    position: fixed;
    /* Fallback per Safari < 14.1 */
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    /* Modern browsers */
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: var(--space-lg);
}

.modal-overlay.hidden {
    display: none;
}

.modal-container {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--color-border-light);
}

.modal-body {
    padding: var(--space-lg);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border-light);
}

/* Radio & Checkbox Groups */
.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 13px;
}

.radio-label input, .checkbox-label input {
    cursor: pointer;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    z-index: 10001;
}

.toast {
    padding: var(--space-md) var(--space-lg);
    background: var(--color-text);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.toast.success { background: var(--color-success); }
.toast.error { background: var(--color-error); }
.toast.warning { background: var(--color-warning); }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   Utilities
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .sidebar,
    .view-header,
    .view-tabs,
    .filters-bar,
    .modal-overlay {
        display: none !important;
    }
    
    .main-content {
        width: 100%;
    }
    
    .reservation-card {
        break-inside: avoid;
    }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-brand,
    .venue-selector,
    .nav-item span,
    .user-details {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .sidebar-footer {
        flex-direction: column;
    }
    
    .stats-bar {
        display: none;
    }
}

@media (max-width: 768px) {
    /* CRITICAL: Allow scrolling on mobile - Single scroll container on body */
    html {
        height: 100%;
        overflow: hidden; /* html non scrolla, lascia fare al body */
    }

    body {
        height: 100%;
        overflow-y: auto !important;
        overflow-x: hidden;
        overscroll-behavior-y: contain;
        /* Rimosso -webkit-overflow-scrolling: touch (deprecato su Android, causa freeze) */
    }

    #app {
        min-height: 100%;
        overflow: visible;
        position: relative;
    }

    /* Layout principale - tutto visible, scroll solo su body */
    .dashboard-section {
        flex-direction: column;
        height: auto;
        min-height: 100%;
        overflow: visible;
    }

    .main-content {
        flex: none;
        overflow: visible;
        padding-bottom: 20px;
    }

    .view {
        height: auto;
        overflow: visible;
    }

    .view.active {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
        background: var(--color-surface);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar.open ~ .sidebar-overlay {
        display: block;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        /* Fallback per Safari < 14.1 */
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        /* Modern browsers */
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-brand,
    .venue-selector,
    .nav-item span,
    .user-details {
        display: block;
    }
    
    .nav-item {
        justify-content: flex-start;
        padding: var(--space-md) var(--space-lg);
    }
    
    /* Mobile header */
    .mobile-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: var(--space-md) var(--space-lg);
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border-light);
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .mobile-menu-btn {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--color-border-light);
        border: none;
        border-radius: var(--radius-md);
        font-size: 24px;
        cursor: pointer;
    }
    
    .mobile-title {
        font-size: 16px;
        font-weight: 600;
    }
    
    /* View content scrollable */
    .view-content {
        overflow: visible;
        height: auto;
    }
    
    .reservations-container {
        overflow: visible;
        height: auto;
    }
    
    /* View header */
    .view-header {
        flex-direction: column;
        gap: var(--space-md);
        align-items: stretch;
    }
    
    .view-header-left,
    .view-header-right {
        justify-content: space-between;
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    /* Ricerca cliente: su mobile va a tutta larghezza, riga propria */
    .header-search-slot {
        width: 100%;
        order: 10;
    }
    .header-search-slot .grid-search-box {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    /* Post-it nelle tab: non si schiaccia mentre le tab scrollano */
    .postit-tab-btn {
        flex-shrink: 0;
        margin-left: 8px;
        padding: 8px 12px;
    }

    .date-nav {
        width: 100%;
        justify-content: space-between;
    }
    
    .date-nav .current-date {
        font-size: 14px;
    }
    
    /* Tabs */
    .view-tabs {
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }
    
    .view-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Prenotazioni cards */
    .reservations-list {
        gap: var(--space-sm);
        flex: none;
        overflow: visible;
        padding: var(--space-md);
        touch-action: pan-y; /* Permette solo scroll verticale */
    }

    /* Android: niente scroll container separato sulla view, tutto delega al body */
    .view.active {
        overflow: visible !important;
    }

    .reservation-card {
        flex-wrap: wrap;
        gap: var(--space-sm);
        padding: var(--space-md);
        touch-action: pan-y; /* Allineato col parent per evitare conflitti */
    }
    
    .reservation-time {
        font-size: 1rem;
        font-weight: 700;
        min-width: 50px;
    }
    
    .reservation-info {
        flex: 1;
        min-width: 150px;
    }
    
    .reservation-main-line {
        flex-wrap: wrap;
    }
    
    .reservation-name {
        font-size: 14px;
        font-weight: 600;
    }
    
    .reservation-right {
        width: 100%;
        justify-content: space-between;
        padding-top: var(--space-sm);
        border-top: 1px solid var(--color-border-light);
    }
    
    .reservation-notes-inline {
        flex-wrap: wrap;
    }
    
    .reservation-actions {
        display: flex;
        gap: var(--space-sm);
    }
    
    .action-btn {
        padding: 10px;
        background: var(--color-bg);
        border-radius: var(--radius-md);
    }
    
    .action-btn svg {
        width: 20px;
        height: 20px;
    }
    
    /* Status menu mobile - bottom sheet */
    .status-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        margin-bottom: 0;
        max-height: 50vh;
        z-index: 10001;
    }
    
    .status-option {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    /* Floorplan */
    .floorplan-container {
        flex-direction: column;
    }
    
    .floorplan-sidebar {
        display: none;
    }
    
    .floorplan-toolbar {
        flex-wrap: wrap;
        padding: var(--space-sm);
        gap: var(--space-sm);
    }
    
    .floorplan-canvas {
        min-height: 300px;
        padding: var(--space-sm);
    }
    
    .floorplan-toggles {
        top: 4px;
        right: 4px;
    }
    
    /* Editor */
    .editor-container {
        flex-direction: column;
    }
    
    .editor-sidebar {
        width: 100%;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .editor-toolbar {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .tool-btn {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    /* Settings */
    .settings-container {
        flex-direction: column;
    }
    
    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: var(--space-sm);
        gap: var(--space-xs);
        border-right: none;
        border-bottom: 1px solid var(--color-border-light);
    }
    
    .settings-nav-item {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .settings-content {
        padding: var(--space-md);
    }
    
    .settings-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .settings-row-actions {
        width: 100%;
        display: flex;
        gap: var(--space-xs);
    }
    
    .settings-row-actions .btn {
        flex: 1;
    }
    
    /* Modal */
    .modal-overlay {
        padding: var(--space-sm);
        align-items: flex-end;
    }
    
    .modal-container {
        max-height: 90vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }
    
    /* Filtri */
    .filters-bar {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-sm) var(--space-md);
    }
    
    .filter-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-group label {
        min-width: 50px;
    }
    
    .filter-select {
        flex: 1;
    }
    
    .search-group {
        width: 100%;
        margin-left: 0;
    }
    
    .search-input {
        width: 100%;
        flex: 1;
    }
    
    .filters-bar .form-input,
    .filters-bar select {
        width: auto;
        flex: 1;
    }
    
    /* Slot orari */
    .slot-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .slot-btn {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    /* Sala tabs */
    .sala-selector {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    
    .sala-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Login */
    .login-container {
        padding: var(--space-lg);
        margin: var(--space-md);
    }
    
    /* Table element on touch — pan-y permette lo scroll verticale nativo,
       il touch polyfill gestisce il drag-and-drop solo su movimento orizzontale */
    .table-element {
        touch-action: pan-y;
    }
    
    /* Stats Pills Bar Mobile */
    .stats-pills-bar {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
        position: relative;
    }
    
    .stats-pills {
        width: 100%;
        justify-content: center;
    }
    
    .stat-pill {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .filter-dropdowns {
        width: 100%;
        flex-wrap: wrap;
        gap: 12px;
        margin-left: 0;
        justify-content: space-between;
    }
    
    .filter-dropdown {
        flex: 1;
        min-width: 120px;
    }
    
    .dropdown-select {
        font-size: 13px;
    }
    
    .refresh-btn {
        position: absolute;
        top: 12px;
        right: 16px;
        width: 36px;
        height: 36px;
    }
    
    .filters-bar.search-only {
        padding: 8px 16px;
    }
    
    .filters-bar.search-only .search-group {
        max-width: 100%;
        width: 100%;
    }
    
    /* Clienti */
    .clienti-grid {
        grid-template-columns: 1fr;
    }
    
    /* Stats cards */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }
    
    .stat-card {
        padding: var(--space-md);
    }
    
    .stat-value {
        font-size: 24px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .slot-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .reservation-card-actions .btn {
        font-size: 11px;
        padding: 6px;
    }
    
    .tab-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* ============================================
   Editor Properties Panel
   ============================================ */
.property-group {
    margin-bottom: var(--space-md);
}

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

.property-group .form-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

.property-group .form-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

#editor-canvas {
    min-height: 500px;
    width: 100%;
    height: 100%;
}

.editor-table {
    transition: all 0.15s ease;
}

.editor-table:hover {
    filter: brightness(1.1);
}

/* ============================================
   Settings Rows
   ============================================ */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border-light);
}

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

.settings-row-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.settings-row-info strong {
    min-width: 100px;
}

.settings-row-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-danger {
    background: var(--color-error);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c82333;
}

.order-btn {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.order-btn:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.order-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================
   Drag & Drop Tables
   ============================================ */
.sortable-row {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    user-select: none;
}

.sortable-row:hover {
    background: var(--color-border-light);
}

.sortable-row:active {
    cursor: grabbing !important;
}

.sortable-row.drag-over {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 0 0 2px var(--color-primary);
}

.sortable-row.drag-over * {
    color: white !important;
}

.sortable-row.dragging {
    opacity: 0.5;
    background: var(--color-warning-bg);
}

.drag-handle {
    cursor: grab;
    display: inline-block;
    width: 24px;
    text-align: center;
    transition: transform 0.2s ease;
}

.drag-handle:hover {
    transform: scale(1.2);
    color: var(--color-primary) !important;
}

.sortable-row:active .drag-handle {
    cursor: grabbing;
}

.zone-badge {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Smooth placeholder animation */
@keyframes placeholder-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.sortable-placeholder {
    background: var(--color-primary);
    opacity: 0.2;
    animation: placeholder-pulse 1s infinite;
}

/* ============================================
   V2 - BADGE TAVOLI COLORATI
   ============================================ */

.table-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-badge-confirmed {
    background: linear-gradient(135deg, #34C759 0%, #007AFF 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(52, 199, 89, 0.3);
}

.table-badge-pending {
    background: linear-gradient(135deg, #FF9500 0%, #FFCC00 100%);
    color: #333;
    box-shadow: 0 2px 6px rgba(255, 149, 0, 0.3);
    animation: pulse-warning 2s infinite;
}

.table-badge-unassigned {
    background: linear-gradient(135deg, #FF6B35 0%, #FF3B30 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.3);
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================
   V2 - STATISTICHE PER TURNO
   ============================================ */

/* ============================================
   STATS PILLS BAR - Design Minimale
   ============================================ */
.stats-pills-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
}

.stats-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

/* Pulsante Post-it accanto alle tab vista (Timeline), ben visibile */
.postit-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 8px 14px;
    border: 1px solid #f1c40f;
    border-radius: var(--radius-md, 8px);
    background: #fff8e1;
    color: #a17c00;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.postit-tab-btn:hover {
    background: #fff3c4;
    box-shadow: 0 2px 6px rgba(241, 196, 15, 0.35);
}
.postit-tab-btn svg {
    color: #d4a000;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 7px 11px;
    background: var(--color-surface);
    border: 2px solid;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.stat-pill.confirmed {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.stat-pill.pending {
    border-color: var(--color-warning);
    color: var(--color-warning);
}

.stat-pill.rejected {
    border-color: var(--color-status-rejected);
    color: var(--color-status-rejected);
}

.stat-pill.cancelled {
    border-color: var(--color-text-muted);
    color: var(--color-text-muted);
}

.stat-pill.active {
    color: white;
}

.stat-pill.confirmed.active {
    background: var(--color-primary);
}

.stat-pill.pending.active {
    background: var(--color-warning);
}

.stat-pill.rejected.active {
    background: var(--color-status-rejected);
}

.stat-pill.cancelled.active {
    background: var(--color-text-muted);
}

.stat-pill:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.pill-label {
    font-weight: 700;
}

.pill-divider {
    opacity: 0.5;
    margin: 0 2px;
}

.pill-value {
    font-weight: 600;
}

.pill-covers {
    font-weight: 500;
    font-size: 12px;
    opacity: 0.85;
    margin-left: 4px;
}

.filter-dropdowns {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.filter-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-secondary);
}

.filter-dropdown svg {
    flex-shrink: 0;
}

.dropdown-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    padding-right: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236C757D' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
}

.dropdown-select:focus {
    outline: none;
}

.refresh-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: none;
    border-radius: 50%;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.refresh-btn:active svg {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

/* ============================================
   V2 - CLIENTI
   ============================================ */

.clienti-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.clienti-search-box input {
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    width: 300px;
}

.clienti-table-wrapper {
    overflow-x: auto;
    padding: var(--space-lg);
}

.clienti-table {
    width: 100%;
    border-collapse: collapse;
}

.clienti-table th,
.clienti-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.clienti-table th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    background: var(--color-bg);
}

.clienti-table tr:hover {
    background: var(--color-border-light);
}

.cliente-nome {
    font-weight: 600;
}

.cliente-phone {
    color: var(--color-primary);
    text-decoration: none;
}

.visite-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: var(--color-primary);
    color: white;
    border-radius: 14px;
    font-weight: 600;
    font-size: 13px;
}

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

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: transform 0.2s;
}

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

.btn-cliente-prenota {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-cliente-prenota:hover {
    transform: scale(1.1);
}

/* ============================================
   V2 - FORM WARNINGS
   ============================================ */

.form-warning {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 13px;
}

.form-warning.closure,
.form-warning.soldout {
    background: #FFF3CD;
    border: 1px solid #FFCC00;
    color: #856404;
}

.form-warning.overbooking {
    background: #F8D7DA;
    border: 1px solid #F5C6CB;
    color: #721C24;
}

/* ============================================
   V2 - SLOT ORARI GRID
   ============================================ */

.slot-btn {
    min-width: 60px;
    padding: 8px 10px;
    border: 2px solid;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.slot-btn.enabled {
    background: var(--color-success-bg);
    border-color: var(--color-success);
    color: var(--color-success);
}

.slot-btn.enabled:hover {
    background: var(--color-success);
    color: white;
}

.slot-btn.disabled {
    background: var(--color-danger-bg);
    border-color: var(--color-danger);
    color: var(--color-danger);
    text-decoration: line-through;
}

.slot-btn.disabled:hover {
    background: var(--color-danger);
    color: white;
    text-decoration: none;
}

.slot-grid-container {
    background: var(--color-surface);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

/* ============================================
   V2 - FLOORPLAN TOGGLE CONTROLS
   ============================================ */

.floorplan-toggles {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 100;
    display: flex;
    gap: 4px;
    background: var(--color-surface);
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    pointer-events: auto;
}

/* Ensure canvas elements are clickable */
.floorplan-canvas svg {
    pointer-events: auto;
}

.floorplan-canvas .table-element {
    pointer-events: auto;
    cursor: pointer;
}

.toggle-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: var(--color-border);
    color: var(--color-text);
}

.toggle-btn.active {
    background: var(--color-primary);
    color: white;
}

/* ============================================
   FLOORPLAN MOBILE ENHANCEMENTS
   Zoom controls, touch gestures support
   ============================================ */

/* Container per trasformazioni touch */
.floorplan-canvas {
    overflow: hidden;
    touch-action: none; /* Disabilita gesture browser default */
}

.floorplan-canvas svg {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* Controlli Zoom */
.zoom-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.zoom-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s;
}

.zoom-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
}

/* Indicatore zoom corrente */
.zoom-indicator {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.zoom-indicator.visible {
    opacity: 1;
}

/* Indicatore swipe sale (bordi) */
.swipe-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 50;
}

.swipe-hint.left {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.1), transparent);
}

.swipe-hint.right {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.1), transparent);
}

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

/* Mostra hint quando ci sono multiple sale */
.floorplan-canvas.multi-sala .swipe-hint {
    opacity: 0.5;
}

.floorplan-canvas.multi-sala:hover .swipe-hint {
    opacity: 0;
}

/* Stili mobile specifici */
@media (max-width: 768px) {
    .zoom-controls {
        bottom: 12px;
        right: 12px;
    }
    
    .zoom-btn {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }
    
    /* Nascondi legenda su mobile per più spazio */
    .floorplan-legend {
        display: none;
    }
    
    /* Fascia selector più compatto */
    .fascia-selector {
        gap: 4px;
    }
    
    .fascia-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Sidebar più stretta su tablet */
    .floorplan-sidebar {
        width: 220px;
    }
}

@media (max-width: 480px) {
    /* Su telefono, nascondi sidebar di default */
    .floorplan-sidebar {
        position: absolute;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 200;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
        transition: left 0.3s ease;
    }
    
    .floorplan-sidebar.mobile-open {
        left: 0;
    }
    
    .floorplan-main {
        width: 100%;
    }
    
    /* Bottone per aprire sidebar su mobile */
    .mobile-sidebar-toggle {
        position: absolute;
        top: 12px;
        left: 12px;
        z-index: 150;
        width: 44px;
        height: 44px;
        border: none;
        border-radius: 12px;
        background: var(--color-surface);
        color: var(--color-text);
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    
    /* Badge prenotazioni da assegnare */
    .mobile-sidebar-toggle .badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background: var(--color-error);
        color: white;
        font-size: 10px;
        font-weight: 700;
        padding: 2px 6px;
        border-radius: 10px;
        min-width: 18px;
        text-align: center;
    }
    
    /* Zoom controls più grandi su telefono */
    .zoom-btn {
        width: 52px;
        height: 52px;
    }
}

/* Animazione tavolo quando viene toccato */
.table-element.touched {
    animation: tablePulse 0.3s ease;
}

@keyframes tablePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* Feedback visivo durante drag */
.floorplan-canvas.dragging {
    cursor: grabbing;
}

.floorplan-canvas.dragging svg {
    cursor: grabbing;
}

/* ============================================
   MULTI-SELECT TOOLBAR - Editor Piantina
   ============================================ */

.multi-select-toolbar {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(135deg, #3D8BC9 0%, #2E7BC9 100%);
    color: white;
    border-radius: 0 0 12px 12px;
    margin: -16px -16px 16px -16px;
    box-shadow: 0 4px 12px rgba(61, 139, 201, 0.3);
    animation: slideDown 0.2s ease;
}

.multi-select-bulk {
    width: 100%;
}

.multi-select-bulk .form-input {
    background: rgba(255,255,255,0.9);
    color: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 6px;
    height: auto;
}

.multi-select-bulk .form-input:focus {
    background: #fff;
    border-color: rgba(255,255,255,0.8);
    outline: none;
}

.multi-select-bulk label {
    color: rgba(255,255,255,0.85) !important;
}

.multi-select-bulk .btn-primary {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
}

.multi-select-bulk .btn-primary:hover {
    background: rgba(255,255,255,0.35);
}

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

.multi-select-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.multi-select-count {
    font-weight: 600;
    font-size: 14px;
}

.multi-select-actions {
    display: flex;
    gap: 8px;
}

.multi-select-toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.multi-select-toolbar .btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.multi-select-toolbar .btn-danger {
    background: rgba(231, 76, 60, 0.8);
    border-color: rgba(231, 76, 60, 0.5);
}

.multi-select-toolbar .btn-danger:hover {
    background: rgba(231, 76, 60, 1);
}

.multi-select-toolbar .btn svg {
    flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .multi-select-toolbar {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    
    .multi-select-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .multi-select-toolbar .btn {
        padding: 8px 10px;
    }
    
    .multi-select-toolbar .btn span {
        display: none;
    }
}

/* Hidden states */
.floorplan-container.sidebar-hidden .floorplan-sidebar {
    display: none;
}

.floorplan-container.sidebar-hidden .floorplan-main {
    flex: 1;
}

.floorplan-container.toolbar-hidden .floorplan-toolbar {
    display: none;
}

.floorplan-container.toolbar-hidden .floorplan-canvas {
    height: calc(100% - 0px);
}

/* Fullscreen mode */
.floorplan-container.fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--color-bg);
    border-radius: 0;
}

.floorplan-container.fullscreen .floorplan-canvas {
    height: calc(100vh - 60px);
}

.floorplan-container.fullscreen.toolbar-hidden .floorplan-canvas {
    height: 100vh;
}

.floorplan-container.fullscreen .floorplan-toggles {
    top: 16px;
    right: 16px;
}

/* ============================================
   V2 - SALE (ROOMS) TABS
   ============================================ */

.sala-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.sala-btn {
    padding: 6px 14px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.sala-btn.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
}

.sala-btn .sala-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
}

.sala-btn.active .sala-count {
    background: rgba(255,255,255,0.3);
}

.floorplan-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.floorplan-toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* ============================================
   V2 - RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .sala-selector {
        justify-content: center;
    }
}

/* ============================================
   Sold Out / Chiusura Badge
   ============================================ */
.soldout-badge {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: 12px;
}
.soldout-badge.hidden { display: none; }
.soldout-badge-soldout,
.soldout-badge-closure {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    animation: soldout-pulse 2s ease-in-out infinite;
}
.soldout-badge-soldout {
    background: linear-gradient(135deg, #e53935, #c62828);
    box-shadow: 0 2px 12px rgba(229, 57, 53, 0.4);
}
.soldout-badge-closure {
    background: linear-gradient(135deg, #f57c00, #e65100);
    box-shadow: 0 2px 12px rgba(245, 124, 0, 0.4);
}
@keyframes soldout-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ============================================
   Current Venue Badge
   ============================================ */
.current-venue-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    color: white;
    background: var(--color-primary);
    margin-left: var(--space-lg);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
    transition: all var(--transition-fast);
}

.current-venue-badge[data-venue="blanco"] {
    background: linear-gradient(135deg, #0077B6 0%, #0096C7 100%);
    box-shadow: 0 2px 8px rgba(0, 119, 182, 0.3);
}

.current-venue-badge[data-venue="calapso"] {
    background: linear-gradient(135deg, #8B5A2B 0%, #A0693A 100%);
    box-shadow: 0 2px 8px rgba(139, 90, 43, 0.3);
}

.current-venue-badge[data-venue="duomo"] {
    background: linear-gradient(135deg, #6B8E6B 0%, #7FA37F 100%);
    box-shadow: 0 2px 8px rgba(107, 142, 107, 0.3);
}

#current-venue-name {
    letter-spacing: 0.02em;
}

/* ============================================
   Walk-in Modal Styles
   ============================================ */
.people-selector-inline {
    display: flex;
    align-items: center;
    gap: 16px;
}

.people-btn-sm {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--color-border);
    color: var(--color-text);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.people-btn-sm:hover {
    background: var(--color-primary);
    color: white;
}

.people-count-sm {
    font-size: 24px;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

.btn-walkin {
    background: linear-gradient(135deg, #7CB47C 0%, #5A9A5A 100%);
    border: none;
}

.btn-walkin:hover {
    background: linear-gradient(135deg, #6AA36A 0%, #4A8A4A 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #D63527 0%, #A93226 100%);
}

/* ============================================
   Editor Toolbar - Tool Groups
   ============================================ */
.editor-toolbar .tool-group {
    display: flex;
    gap: 4px;
    padding: 0 8px;
    border-right: 1px solid var(--color-border);
}

.editor-toolbar .tool-group:last-child {
    border-right: none;
}

.tool-btn {
    font-size: 16px;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Sfondi colorati per locale
   ============================================ */
.main-content,
.sidebar,
.view-header,
.dashboard-section {
    transition: background-color 0.3s ease;
}

/* Blanco - Bianco */
.dashboard-section[data-venue="blanco"] {
    background-color: #f0f7fc;
}

.dashboard-section[data-venue="blanco"] .sidebar {
    background-color: #e3f2fd;
}

.dashboard-section[data-venue="blanco"] .main-content {
    background-color: #ffffff;
}

.dashboard-section[data-venue="blanco"] .view-header {
    background-color: #ffffff;
}

/* Calapso - Marroncino */
.dashboard-section[data-venue="calapso"] {
    background-color: #FAF6F1;
}

.dashboard-section[data-venue="calapso"] .sidebar {
    background-color: #F0E6D9;
}

.dashboard-section[data-venue="calapso"] .main-content {
    background-color: #FAF6F1;
}

.dashboard-section[data-venue="calapso"] .view-header {
    background-color: #FAF6F1;
}

/* Duomo - Verdino */
.dashboard-section[data-venue="duomo"] {
    background-color: #F5F9F5;
}

.dashboard-section[data-venue="duomo"] .sidebar {
    background-color: #E8F0E8;
}

.dashboard-section[data-venue="duomo"] .main-content {
    background-color: #F5F9F5;
}

.dashboard-section[data-venue="duomo"] .view-header {
    background-color: #F5F9F5;
}

/* ============================================
   CLIENTI MODULE STYLES
   ============================================ */

/* Stats Bar */
.clienti-stats-bar {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--color-surface);
    border-radius: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.clienti-stats-bar .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.clienti-stats-bar .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.clienti-stats-bar .stat-label {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Toolbar */
.clienti-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.clienti-toolbar .toolbar-left,
.clienti-toolbar .toolbar-right {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Table */
.clienti-table-wrapper {
    background: white;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.clienti-table {
    width: 100%;
    border-collapse: collapse;
}

.clienti-table thead {
    background: var(--color-surface);
}

.clienti-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-secondary);
    border-bottom: 2px solid var(--color-border);
}

.clienti-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.clienti-table th.sortable:hover {
    background: var(--color-border);
}

.clienti-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}

.clienti-table tbody tr:hover {
    background: var(--color-surface);
}

.clienti-table .center {
    text-align: center;
}

.clienti-table .empty-state {
    text-align: center;
    padding: 40px;
    color: var(--color-text-muted);
}

/* Cliente Row */
.cliente-nome {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cliente-nome .has-note,
.cliente-nome .has-birthday {
    font-size: 12px;
    opacity: 0.7;
}

.phone-link,
.email-link {
    color: var(--color-primary);
    text-decoration: none;
}

.phone-link:hover,
.email-link:hover {
    text-decoration: underline;
}

/* Tags */
.tags-cell {
    max-width: 200px;
}

.tag-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: white;
    margin: 2px;
    white-space: nowrap;
}

.tags-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--color-surface);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.tag-checkbox:has(input:checked) {
    background: var(--tag-color);
    color: white;
}

.tag-checkbox input {
    display: none;
}

/* Stats */
.prenotazioni-count {
    font-weight: 600;
    color: var(--color-primary);
}

.noshow-count {
    font-size: 11px;
    color: var(--color-danger);
    margin-left: 4px;
}

/* Actions */
.actions-cell {
    white-space: nowrap;
}

.btn-icon {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--color-surface);
}

.btn-icon.danger:hover {
    background: #fee;
}

/* Cliente Form */
.cliente-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .cliente-form .form-row {
        grid-template-columns: 1fr;
    }
}

/* Storico */
.cliente-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.stat-box {
    flex: 1;
    text-align: center;
    padding: 16px;
    background: var(--color-surface);
    border-radius: 12px;
}

.stat-box.warning {
    background: #fff3e0;
}

.stat-box .stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-box.warning .stat-number {
    color: var(--color-warning);
}

.cliente-info-box {
    padding: 12px 16px;
    background: var(--color-surface);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.cliente-info-box.warning {
    background: #fff3e0;
    border-left: 4px solid var(--color-warning);
}

.storico-list {
    max-height: 300px;
    overflow-y: auto;
}

.storico-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--color-border);
    gap: 16px;
}

.storico-item.success {
    background: #e8f5e9;
}

.storico-item.danger {
    background: #ffebee;
}

.storico-item.muted {
    opacity: 0.6;
}

.storico-data {
    min-width: 100px;
}

.storico-data strong {
    display: block;
}

.storico-data span {
    font-size: 12px;
    color: var(--color-text-muted);
}

.storico-details {
    flex: 1;
    display: flex;
    gap: 16px;
    font-size: 14px;
}

.stato-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    background: var(--color-surface);
}

.stato-badge.success {
    background: #c8e6c9;
    color: #2e7d32;
}

.stato-badge.danger {
    background: #ffcdd2;
    color: #c62828;
}

/* Import */
.import-instructions {
    padding: 16px;
    background: var(--color-surface);
    border-radius: 8px;
    margin-bottom: 16px;
}

.import-instructions code {
    display: block;
    padding: 8px;
    background: #263238;
    color: #80cbc4;
    border-radius: 4px;
    font-size: 12px;
    margin-top: 8px;
    overflow-x: auto;
}

.import-preview {
    margin-top: 16px;
    padding: 16px;
    background: var(--color-surface);
    border-radius: 8px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 13px;
}

.preview-table th,
.preview-table td {
    padding: 8px;
    border: 1px solid var(--color-border);
    text-align: left;
}

.preview-table th {
    background: white;
}

/* Mass Mail */
.massmail-info {
    padding: 12px 16px;
    background: #e3f2fd;
    border-radius: 8px;
    margin-bottom: 16px;
}

.massmail-recipients {
    padding: 8px 12px;
    background: var(--color-surface);
    border-radius: 6px;
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 16px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
}

/* ============================================
   NEWSLETTER SETTINGS
   ============================================ */

.newsletter-provider-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.provider-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.provider-option:hover {
    border-color: var(--color-primary);
    background: var(--color-surface);
}

.provider-option.selected,
.provider-option:has(input:checked) {
    border-color: var(--color-primary);
    background: rgba(74, 144, 226, 0.05);
}

.provider-option input[type="radio"] {
    margin-top: 4px;
}

.provider-info {
    flex: 1;
}

.provider-info strong {
    font-size: 15px;
}

.provider-info p {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.provider-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 8px;
    font-weight: 500;
}

.provider-tag.recommended {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

.status-badge.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.warning {
    background: #fff3e0;
    color: #e65100;
}

.newsletter-stats {
    display: flex;
    gap: 24px;
    margin-top: 12px;
}

.newsletter-stats .stat-item {
    text-align: center;
}

.newsletter-stats .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
}

.newsletter-stats .stat-label {
    font-size: 12px;
    color: var(--color-text-muted);
}

.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-actions .btn {
    flex: 1;
    min-width: 150px;
}

@media (max-width: 600px) {
    .newsletter-stats {
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .newsletter-stats .stat-item {
        flex: 1;
        min-width: 80px;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-actions .btn {
        width: 100%;
    }
}

/* ============================================
   CLIENTI SEARCH BOX
   ============================================ */

.clienti-header {
    margin-left: auto;
}

.clienti-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.clienti-search-box .search-icon {
    position: absolute;
    left: 14px;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.clienti-search-box input#clienti-search {
    width: 320px;
    padding: 12px 16px 12px 44px;
    font-size: 15px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    background: white;
    transition: all 0.2s;
}

.clienti-search-box input#clienti-search:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.clienti-search-box input#clienti-search::placeholder {
    color: var(--color-text-muted);
}

@media (max-width: 768px) {
    .clienti-search-box input#clienti-search {
        width: 100%;
        min-width: 200px;
    }
    
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .clienti-header {
        width: 100%;
        margin-left: 0;
    }
}

/* ============================================
   CLIENT AUTOCOMPLETE FEEDBACK
   ============================================ */

.client-found-feedback {
    margin-top: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 8px;
    font-size: 13px;
    color: #2e7d32;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.client-found-feedback strong {
    color: #1b5e20;
}

.client-found-feedback .visits {
    color: #558b2f;
    font-size: 12px;
}

.client-found-feedback .tags {
    font-size: 11px;
    background: rgba(255,255,255,0.6);
    padding: 2px 8px;
    border-radius: 10px;
}

.client-found-feedback .warning {
    color: #e65100;
    background: #fff3e0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

/* Fix scroll clienti */
.clienti-list {
    padding: 16px;
    padding-bottom: 100px;
}

/* ============================================
   LOAD MORE / PAGINATION
   ============================================ */

.load-more-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    margin-top: 16px;
}

.btn-load-more {
    padding: 12px 32px;
    font-size: 15px;
}

.load-more-info {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ============================================
   GLOBAL SEARCH INDICATOR
   ============================================ */

.global-search-indicator {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #1565c0;
    font-size: 14px;
}

.global-search-indicator strong {
    color: #0d47a1;
}

.btn-clear-search {
    background: white;
    border: 1px solid #90caf9;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #1565c0;
    transition: all 0.2s;
}

.btn-clear-search:hover {
    background: #e3f2fd;
    border-color: #1565c0;
}

/* ============================================
   COLLAPSIBLE SIDEBAR
   ============================================ */

.collapse-sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    margin-top: auto;
    background: transparent;
    border: none;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.collapse-sidebar-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.collapse-sidebar-btn svg {
    transition: transform 0.3s ease;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
}

.sidebar.collapsed .sidebar-brand-text {
    display: none;
}

.sidebar.collapsed .sidebar-logo {
    width: 28px;
    height: 28px;
}

.sidebar.collapsed .venue-selector {
    width: 100%;
    padding: 8px 4px;
    font-size: 0;
    text-align: center;
}

.sidebar.collapsed .venue-selector::after {
    content: '🏠';
    font-size: 16px;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 14px 12px;
}

.sidebar.collapsed .user-details {
    display: none;
}

.sidebar.collapsed .user-info {
    justify-content: center;
}

.sidebar.collapsed .sidebar-footer {
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.sidebar.collapsed .logout-btn {
    margin-left: 0;
}

.sidebar.collapsed .collapse-sidebar-btn svg {
    transform: rotate(180deg);
}

/* Main content adjustment when sidebar is collapsed */
.dashboard-section.sidebar-collapsed .main-content {
    margin-left: 70px;
}

/* Tooltip for collapsed sidebar items */
.sidebar.collapsed .nav-item {
    position: relative;
}

.sidebar.collapsed .nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    margin-left: 8px;
}

.sidebar.collapsed .nav-item:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Responsive - don't collapse on mobile */
@media (max-width: 768px) {
    .collapse-sidebar-btn {
        display: none;
    }
}

/* ============================================
   NOTE NELLE CARD PRENOTAZIONI E DA ASSEGNARE
   ============================================ */

/* Note text nella lista principale */
.note-badge.note-text {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--color-surface-hover);
    color: var(--color-text-secondary);
}

/* Note nella lista Da Assegnare */
.unassigned-note {
    font-size: 11px;
    color: var(--color-text-secondary);
    margin-top: 4px;
    padding: 4px 6px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unassigned-note.allergy {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

/* ============================================
   GRID VIEW - Vista Griglia Tavoli
   ============================================ */

.grid-view-container {
    display: flex;
    /* flex: 1 + min-height: 0 fa sì che il container prenda esattamente lo spazio
       rimanente dentro .tab-content, senza trabordare dal .view e creare scroll
       annidati che intrappolano la rotella/trackpad. */
    flex: 1;
    min-height: 0;
    gap: 0;
    position: relative;
}

.grid-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Permette al flex child di rispettare l'altezza del container per lo scroll */
}

.grid-sidebar-header {
    padding: 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--color-border);
}

.grid-unassigned-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 8px 60px 8px;
    min-height: 0; /* Necessario per attivare lo scroll in flex column layout */
}

.grid-unassigned-card {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all 0.2s ease;
}

.grid-unassigned-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.grid-unassigned-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.grid-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.grid-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.grid-legend {
    display: flex;
    gap: 16px;
}

.grid-tables-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--color-background);
}

.grid-section {
    margin-bottom: 24px;
}

.grid-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.grid-tables {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.grid-table {
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    padding: 12px;
    min-height: 80px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.grid-table:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.grid-table.drag-over {
    border-color: var(--color-primary);
    background: rgba(52, 152, 219, 0.1);
    transform: scale(1.02);
}

.grid-table.free {
    background: linear-gradient(135deg, #7CB47C 0%, #5A9A5A 100%);
    border-color: #5A9A5A;
    color: white;
}

.grid-table.booked {
    background: linear-gradient(135deg, #F5A623 0%, #E09600 100%);
    border-color: #E09600;
    color: white;
}

.grid-table.occupied {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    border-color: #C0392B;
    color: white;
}

.grid-table-label {
    font-size: 16px;
    font-weight: 700;
}

.grid-table-seats {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.grid-table-client {
    font-size: 11px;
    font-weight: 500;
    margin-top: 6px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-table-time {
    font-size: 10px;
    opacity: 0.85;
}

/* Responsive */
@media (max-width: 768px) {
    .grid-view-container {
        flex-direction: column;
        height: auto;
    }

    /* FIX SCROLL: rimuovi scroll container annidati su mobile.
       Su desktop grid-main e grid-tables-container creano il loro scroll interno,
       ma su mobile il body è l'unico scroll container — i container interni
       intrappolano gli eventi touch e bloccano lo scorrimento. */
    .grid-main {
        overflow: visible;
    }

    .grid-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .grid-tables-container {
        padding: 12px;
        overflow: visible;
    }

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

    /* In fullscreen (position: fixed) serve scroll interno anche su mobile */
    .grid-view-container.fullscreen .grid-main {
        overflow: hidden;
    }
    .grid-view-container.fullscreen .grid-tables-container {
        overflow-y: auto;
    }
}

/* ============================================
   GRID VIEW - Tabella Stile Stampa
   ============================================ */

.grid-print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
    border: 3px solid #000;
}

.grid-print-table th {
    background: #f8f9fa;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    border: 2px solid #000;
    white-space: nowrap;
}

.grid-print-table td {
    padding: 8px;
    border: 2px solid #000;
    vertical-align: middle;
}

.grid-print-table .col-table {
    width: 80px;
    text-align: center;
}

.grid-print-table .col-seats {
    width: 50px;
    text-align: center;
}

.grid-print-table .col-table-cell {
    background: #f8f9fa;
    text-align: center;
    font-size: 14px;
}

.grid-print-table .col-seats-cell {
    text-align: center;
    color: var(--color-text-secondary);
}

/* Turno headers */
.grid-print-table .turno1-header {
    background: linear-gradient(135deg, #ffc107 0%, #ffca2c 100%);
    color: #000;
    text-align: center;
    font-weight: 700;
}

.grid-print-table .turno2-header {
    background: linear-gradient(135deg, #6f42c1 0%, #8b5cf6 100%);
    color: white;
    text-align: center;
    font-weight: 700;
}

.grid-print-table .turno1-sub {
    background: #fff8e1;
    font-size: 11px;
    text-align: center;
}

.grid-print-table .turno2-sub {
    background: #ede7f6;
    font-size: 11px;
    text-align: center;
}

.grid-print-table .turno-sep,
.grid-print-table .turno-sep-cell {
    width: 4px !important;
    min-width: 4px;
    max-width: 4px;
    padding: 0 !important;
    background: #333;
    border: none;
}

/* Celle turno */
.grid-print-table .turno1-cell {
    background: #fffbeb;
}

.grid-print-table .turno2-cell {
    background: #f5f3ff;
}

.grid-print-table .turno1-cell.empty,
.grid-print-table .turno2-cell.empty {
    background: #fafafa;
    color: #ccc;
}

/* Stati prenotazione */
.grid-print-table .arrived {
    background: #dcfce7 !important;
    font-weight: 500;
}

.grid-print-table .pending {
    background: #fef3c7 !important;
}

/* Celle cliccabili con prenotazione */
.grid-print-table [data-res] {
    cursor: pointer;
    transition: background 0.15s;
}

.grid-print-table [data-res]:hover {
    filter: brightness(0.95);
}

.grid-print-table .client-cell {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.grid-print-table .note-cell {
    max-width: 120px;
    font-size: 11px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === COLLISIONE PRENOTAZIONI STESSO TAVOLO === */
.grid-print-table tr.grid-collision {
    background: rgba(239, 68, 68, 0.08) !important;
}
.grid-print-table td.grid-collision-cell,
.grid-print-table td.grid-collision-cell.arrived,
.grid-print-table td.grid-collision-cell.pending {
    background: rgba(239, 68, 68, 0.18) !important;
    border-top: 2px solid #ef4444 !important;
    border-bottom: 2px solid #ef4444 !important;
}
.grid-print-table .grid-collision-cell:first-of-type {
    border-left: 2px solid #ef4444 !important;
}
.grid-print-table .grid-collision-cell:last-of-type {
    border-right: 2px solid #ef4444 !important;
}
.collision-icon {
    font-size: 14px;
    margin-right: 4px;
    animation: collision-pulse 1.5s ease-in-out infinite;
}
@keyframes collision-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.collision-extra-row {
    display: block;
    margin-top: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 4px;
    border-left: 3px solid #ef4444;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.collision-extra-row:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* Riga con drag over */
.grid-print-table tr.drag-over {
    background: rgba(52, 152, 219, 0.15) !important;
}

.grid-print-table tr.drag-over td {
    background: rgba(52, 152, 219, 0.15) !important;
}

/* Riga vuota */
.grid-print-table tr.empty {
    opacity: 0.7;
}

.grid-print-table tr.empty:hover {
    opacity: 1;
    background: #f0f9ff;
}

/* Card da assegnare per griglia */
.grid-unassigned-card {
    background: white;
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all 0.2s ease;
}

.grid-unassigned-card:hover {
    border-left-color: var(--color-primary-hover);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateX(2px);
}

.grid-unassigned-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    cursor: grabbing;
}

/* Responsive */
@media (max-width: 1200px) {
    .grid-print-table {
        font-size: 11px;
    }
    
    .grid-print-table th,
    .grid-print-table td {
        padding: 6px 4px;
    }
    
    .grid-print-table .client-cell {
        max-width: 100px;
    }
    
    .grid-print-table .note-cell {
        display: none;
    }
}

/* ============================================
   STAMPA GRIGLIA - BORDI MOLTO MARCATI
   ============================================ */
@media print {
    /* Forza stampa colori e bordi */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    
    .grid-print-table {
        border: 4px solid #000 !important;
        border-style: solid !important;
        border-color: #000 !important;
        border-collapse: collapse !important;
    }
    
    .grid-print-table th,
    .grid-print-table td {
        border-width: 3px !important;
        border-style: solid !important;
        border-color: #000 !important;
        color: #000 !important;
    }
    
    .grid-print-table th {
        background: #e0e0e0 !important;
        background-color: #e0e0e0 !important;
        font-weight: 700 !important;
        color: #000 !important;
    }
    
    .grid-print-table .col-table-cell {
        background: #f0f0f0 !important;
        background-color: #f0f0f0 !important;
        font-weight: 600 !important;
        color: #000 !important;
    }
    
    .grid-print-table .turno1-header {
        background: #ffc107 !important;
        background-color: #ffc107 !important;
        color: #000 !important;
        border-width: 3px !important;
        border-style: solid !important;
        border-color: #000 !important;
    }
    
    .grid-print-table .turno2-header {
        background: #6f42c1 !important;
        background-color: #6f42c1 !important;
        color: #fff !important;
        border-width: 3px !important;
        border-style: solid !important;
        border-color: #000 !important;
    }
    
    .grid-print-table .turno1-sub,
    .grid-print-table .turno2-sub {
        border-width: 3px !important;
        border-style: solid !important;
        border-color: #000 !important;
        color: #000 !important;
    }
    
    .grid-print-table .turno-sep,
    .grid-print-table .turno-sep-cell {
        background: #000 !important;
        background-color: #000 !important;
        width: 6px !important;
    }
    
    .grid-print-table .turno1-cell,
    .grid-print-table .turno2-cell {
        border-width: 3px !important;
        border-style: solid !important;
        border-color: #000 !important;
        color: #000 !important;
    }
    
    .grid-print-table .client-cell {
        font-weight: 700 !important;
        color: #000 !important;
    }
    
    .grid-print-table .note-cell {
        color: #000 !important;
    }
    
    .grid-print-table .arrived {
        background: #c8e6c9 !important;
        background-color: #c8e6c9 !important;
        color: #000 !important;
    }
    
    .grid-print-table .pending {
        background: #fff9c4 !important;
        background-color: #fff9c4 !important;
        color: #000 !important;
    }
    
    .grid-print-table tr {
        border-bottom-width: 3px !important;
        border-bottom-style: solid !important;
        border-bottom-color: #000 !important;
    }
    
    /* Nascondi elementi non necessari in stampa */
    .grid-toggles,
    .grid-sidebar,
    .walkin-plus,
    .drop-zone {
        display: none !important;
    }
}

/* ============================================
   DRAG & DROP CELLE GRIGLIA
   ============================================ */

.draggable-res {
    cursor: grab;
    transition: all 0.2s ease;
}

.draggable-res:hover {
    background: rgba(0,0,0,0.05) !important;
}

.draggable-res.dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.grid-print-table tr.source-row {
    opacity: 0.6;
}

.grid-print-table tr.drag-over {
    background: rgba(52, 152, 219, 0.15) !important;
    outline: 2px dashed var(--color-primary);
    outline-offset: -2px;
}

.grid-print-table tr.drag-over td {
    background: transparent !important;
}

/* Badge Walk-in nella griglia */
.walkin-badge {
    display: inline-block;
    background: #27ae60;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: middle;
}

/* Checkbox arrivo nella griglia */
.arrival-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #e0e0e0;
    color: #999;
    vertical-align: middle;
}

.arrival-check:hover {
    background: #27ae60;
    color: white;
    transform: scale(1.1);
}

.arrival-check.arrived {
    background: #27ae60;
    color: white;
    font-weight: bold;
}

.arrival-check.arrived:hover {
    background: #c0392b;
}

/* Evidenzia righe arrivate */
.grid-print-table tr .turno1-cell.arrived,
.grid-print-table tr .turno2-cell.arrived {
    background: rgba(39, 174, 96, 0.15) !important;
}

/* Bottone rimuovi assegnazione */
.unassign-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #e74c3c;
    color: white;
    margin-left: 6px;
    vertical-align: middle;
    opacity: 0.7;
}

.unassign-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Controlli ordinamento griglia */
.grid-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.grid-sort-controls {
    display: flex;
    gap: 4px;
}

.grid-sort-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.grid-sort-btn:hover {
    background: var(--color-surface-hover);
}

.grid-sort-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* Celle vuote cliccabili per walk-in */
.grid-print-table .drop-zone {
    cursor: pointer;
    transition: all 0.2s ease;
}

.grid-print-table tr:hover .drop-zone {
    background: rgba(39, 174, 96, 0.08) !important;
}

/* Testo "+ Walk-in" nascosto di default, visibile al hover */
.walkin-plus {
    color: #27ae60;
    font-size: 11px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s;
}

.grid-print-table tr:hover .walkin-plus {
    opacity: 1;
}

/* Bottone elimina walk-in */
.delete-walkin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.6;
}

.delete-walkin-btn:hover {
    opacity: 1;
    transform: scale(1.2);
    background: rgba(231, 76, 60, 0.2);
}

/* ============================================
   BOTTONI PICCOLI E OUTLINE
   ============================================ */

.btn-small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-outline {
    background: white;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

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

/* Varianti colorate per azioni specifiche */
.btn-small.btn-success {
    background: #27ae60;
    border-color: #27ae60;
    color: white;
}

.btn-small.btn-success:hover {
    background: #219a52;
}

.btn-small.btn-danger {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.btn-small.btn-danger:hover {
    background: #c0392b;
}

/* ============================================
   SLOT CONFIGURATION - DAY BUTTONS
   ============================================ */

.day-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 50px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

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

.day-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.day-btn span:first-child {
    font-weight: 600;
    font-size: 13px;
}

.day-btn span:last-child {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 2px;
}

/* Days container */
.days-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* ============================================
   GRID VIEW - FULLSCREEN & TOGGLE CONTROLS
   ============================================ */

.grid-toggles {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 100;
    display: flex;
    gap: 4px;
    background: var(--color-surface);
    padding: 4px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Sidebar nascosta */
.grid-view-container.sidebar-hidden .grid-sidebar {
    display: none;
}

/* Fullscreen mode */
/* Stats bar sempre visibile in fullscreen */
.fullscreen-search-bar {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 1001;
}

.fullscreen-search-bar .grid-search-box {
    flex: 1;
    max-width: 400px;
}

.grid-view-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: var(--color-bg);
    height: 100vh !important;
    padding: 80px 16px 16px 16px;
}

.grid-view-container.fullscreen .grid-main {
    height: calc(100vh - 96px);
}

.grid-view-container.fullscreen .grid-tables-container {
    height: calc(100vh - 120px);
}

.grid-view-container.fullscreen .grid-sidebar {
    height: calc(100vh - 96px);
}

/* Bottone attivo */
.grid-toggles .toggle-btn.active {
    background: var(--color-primary);
    color: white;
}

/* ============================================
   GRID TABLE MENU (popup scelta walk-in/prenotazione)
   ============================================ */

.grid-table-menu {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
    min-width: 200px;
    animation: menuFadeIn 0.15s ease;
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-menu-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.grid-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: background 0.15s;
}

.grid-menu-item:hover {
    background: var(--color-surface-hover);
}

.grid-menu-item span:first-child {
    font-size: 18px;
}

.grid-menu-item:last-child {
    border-top: 1px solid var(--color-border-light);
}

/* ============================================
   RESERVATION CARD - Layout migliorato
   ============================================ */

.reservation-right .table-badge {
    font-size: 11px;
    padding: 3px 8px;
}

.reservation-right .table-badge-unassigned {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.reservation-right .table-badge-confirmed {
    background: var(--color-success-bg);
    color: var(--color-success);
}

/* ============================================
   DIALOG SPOSTA/AGGIUNGI TAVOLO
   ============================================ */

.move-add-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.15s ease;
}

.move-add-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    min-width: 300px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.move-add-content h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
}

.move-add-content p {
    margin: 0 0 20px 0;
    color: var(--color-text-secondary);
}

.move-add-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.move-add-buttons .btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    font-size: 15px;
}

.move-add-buttons .btn small {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 4px;
    font-weight: normal;
}

.move-add-cancel {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 8px 16px;
}

.move-add-cancel:hover {
    color: var(--color-text);
}

/* ============================================
   MENU PRENOTAZIONE GRIGLIA
   ============================================ */

.grid-res-menu {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
    min-width: 180px;
    animation: menuFadeIn 0.15s ease;
}

.grid-res-menu .grid-menu-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.grid-res-menu .grid-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: background 0.15s;
}

.grid-res-menu .grid-menu-item:hover {
    background: var(--color-surface-hover);
}

.grid-res-menu .grid-menu-item[data-action="unassign"]:hover {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

/* ============================================
   TESTO NERO SU SFONDO BIANCO - FIX GLOBALE
   ============================================ */

/* Form inputs - testo sempre scuro */
.form-input,
.form-select,
.form-textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    color: var(--color-text) !important;
}

/* Contenitori con sfondo bianco - testo scuro */
.modal-content,
.modal-body,
.settings-card,
.settings-content,
.clienti-toolbar,
.clienti-table-wrapper,
.clienti-stats-bar .stat-item,
.grid-print-table,
.grid-unassigned-card,
.grid-table-menu,
.grid-res-menu,
.move-add-content {
    color: var(--color-text);
}

/* Label nei form sempre visibili */
.form-label,
.modal-content .form-label,
.modal-body .form-label {
    color: var(--color-text-secondary) !important;
}

/* Tabelle con sfondo bianco */
.clienti-table td,
.grid-print-table td {
    color: var(--color-text);
}

/* Menu e popup con sfondo bianco */
.grid-menu-item,
.grid-table-menu .grid-menu-item,
.grid-res-menu .grid-menu-item {
    color: var(--color-text);
}

/* Header menu */
.grid-menu-header,
.grid-table-menu .grid-menu-header,
.grid-res-menu .grid-menu-header {
    color: var(--color-text);
}

/* Dialog content */
.move-add-content h3,
.move-add-content p {
    color: var(--color-text);
}

/* Placeholder più chiaro ma visibile */
.form-input::placeholder,
.form-textarea::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted) !important;
    opacity: 1;
}

/* ============================================
   SEARCH HIGHLIGHT - Griglia Prenotazioni
   ============================================ */

.search-highlight {
    background: rgba(255, 243, 205, 0.5) !important;
    box-shadow: inset 0 0 0 2px #f59e0b;
    border-radius: 4px;
}

[data-theme="dark"] .search-highlight {
    background: rgba(251, 191, 36, 0.2) !important;
    box-shadow: inset 0 0 0 2px #f59e0b;
}

/* Stile per la riga trovata */
tr:has(.search-highlight) {
    outline: 2px solid #f59e0b;
    outline-offset: -1px;
}

/* ============================================
   CONTEGGI TURNO - Griglia Prenotazioni
   ============================================ */

.turno-count {
    display: inline-block;
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

[data-theme="dark"] .turno-count {
    background: rgba(0, 0, 0, 0.2);
}

.col-total {
    vertical-align: middle;
}

/* ============================================
   GRID SEARCH BOX - Barra di ricerca griglia
   ============================================ */

.grid-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    min-width: 200px;
    flex: 1;
    max-width: 300px;
}

/* Barra ricerca spostata nell'header, accanto al nome del locale */
.header-search-slot {
    display: flex;
    align-items: center;
}
.header-search-slot .grid-search-box {
    flex: 0 1 auto;
    min-width: 180px;
    max-width: 260px;
    padding: 7px 14px;
}

.grid-search-box svg {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.grid-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--color-text);
    width: 100%;
}

.grid-search-input::placeholder {
    color: var(--color-text-muted);
}

.grid-search-clear {
    background: var(--color-text-muted);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.grid-search-clear:hover {
    background: var(--color-text-secondary);
}
}

/* ============================================
   CASSA IN CLOUD - Stato Tavoli nella Griglia
   Ora ordinazione + Conto pagato
   ============================================ */

/* Badge ora ordinazione (🍽️ + ora) */
.cassa-ora-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-radius: 4px;
    white-space: nowrap;
    vertical-align: middle;
}

/* Badge conto pagato/in attesa */
.cassa-conto-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    vertical-align: middle;
}

.cassa-conto-badge.paid {
    font-size: 12px;
    animation: pulse-cassa 2s infinite;
}

.cassa-conto-badge.waiting {
    font-size: 11px;
    opacity: 0.7;
}

/* Animazione pulsante per conto pagato */
@keyframes pulse-cassa {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.6; 
        transform: scale(1.1);
    }
}

/* Dark mode */
[data-theme="dark"] .cassa-ora-badge {
    background: rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

/* Riga tavolo con conto pagato - evidenziazione leggera */
.grid-print-table tr.has-reservation:has(.cassa-conto-badge.paid) {
    background: rgba(34, 197, 94, 0.05);
}

[data-theme="dark"] .grid-print-table tr.has-reservation:has(.cassa-conto-badge.paid) {
    background: rgba(34, 197, 94, 0.1);
}

/* ============================================
   SPIAGGIA - Gestione Ombrelloni
   ============================================ */

.spiaggia-container {
    padding: 0;
    position: relative;
    z-index: 1;
}

/* Quando la spiaggia è attiva, il suo wrapper non deve sovrastare gli altri elementi */
#spiaggia-container {
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 1;
}

/* Date navigator */
.spiaggia-date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 16px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
}

.spiaggia-date-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    cursor: pointer;
    color: var(--color-text);
    transition: background 0.15s;
}

.spiaggia-date-btn:hover {
    background: var(--color-surface-alt);
}

.spiaggia-date-current {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 18px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    gap: 4px;
    transition: background 0.15s;
    min-width: 140px;
}

.spiaggia-date-current:hover {
    background: var(--color-surface-alt);
}

/* Toolbar */
.spiaggia-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border-light);
    flex-wrap: wrap;
    gap: 8px;
}

.spiaggia-views {
    display: flex;
    gap: 4px;
}

.spiaggia-view-btn {
    padding: 8px 16px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--color-text-muted);
}

.spiaggia-view-btn:hover {
    border-color: #0288d1;
    color: #0288d1;
}

.spiaggia-view-btn.active {
    background: #0288d1;
    border-color: #0288d1;
    color: white;
}

.spiaggia-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Stats */
.spiaggia-stats {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-surface);
    overflow-x: auto;
}

.spiaggia-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--color-bg);
    border-radius: 10px;
    border-left: 3px solid #1565c0;
    min-width: fit-content;
}

.spiaggia-stat-icon {
    font-size: 16px;
}

.spiaggia-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-text);
}

.spiaggia-stat-label {
    font-size: 11px;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* Legenda */
.spiaggia-legenda {
    display: flex;
    gap: 16px;
    padding: 8px 16px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
    font-size: 12px;
    flex-wrap: wrap;
}

.spiaggia-legenda-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text-muted);
}

.spiaggia-legenda-item span {
    font-size: 16px;
}

/* Piantina */
.spiaggia-piantina {
    padding: 20px;
}

.spiaggia-mare {
    text-align: center;
    padding: 14px;
    background: linear-gradient(180deg, #0288d1 0%, #4fc3f7 100%);
    color: white;
    font-weight: 700;
    font-size: 16px;
    border-radius: 12px 12px 0 0;
    letter-spacing: 4px;
}

.spiaggia-spiaggia-label {
    text-align: center;
    padding: 14px;
    background: linear-gradient(180deg, #ffe082 0%, #ffb74d 100%);
    color: #5d4037;
    font-weight: 700;
    font-size: 14px;
    border-radius: 0 0 12px 12px;
    letter-spacing: 4px;
}

.spiaggia-fila {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--color-border-light);
}

.spiaggia-fila-label {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #5d4037;
    color: white;
    font-weight: 800;
    font-size: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 12px;
}

.spiaggia-fila-ombrelloni {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.spiaggia-ombrellone {
    width: 80px;
    padding: 8px 4px;
    border-radius: 10px;
    border: 2px solid;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.spiaggia-ombrellone:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 2;
}

.spiaggia-omb-icon {
    font-size: 22px;
}
.spiaggia-omb-icon-libero {
    font-size: 32px;
}

.spiaggia-omb-num {
    font-size: 11px;
    font-weight: 800;
    color: var(--color-text);
    margin-top: 2px;
}

.spiaggia-omb-label {
    font-size: 9px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

.spiaggia-omb-check {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #2e7d32;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Badge presenza arrivato/liberato */
.spiaggia-omb-presenza {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    z-index: 2;
}
.spiaggia-omb-presenza.arrivato {
    background: #e53935;
}
.spiaggia-omb-presenza.liberato {
    background: #2e7d32;
}

/* Collision spiaggia */
.spiaggia-omb-collision {
    border-width: 3px !important;
    border-color: #ef4444 !important;
    animation: spiaggia-collision-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}
@keyframes spiaggia-collision-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.6); }
}
.spiaggia-omb-collision-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    z-index: 3;
    line-height: 1.2;
    white-space: nowrap;
}
.spiaggia-card-collision {
    border-left-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.04) !important;
}

/* Griglia */
.spiaggia-griglia {
    padding: 16px;
}

.spiaggia-griglia-sezione {
    margin-bottom: 20px;
}

.spiaggia-griglia-fila-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--color-border);
}

.spiaggia-griglia-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.spiaggia-griglia-card {
    padding: 12px;
    background: var(--color-surface);
    border-radius: 10px;
    border: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: all 0.2s;
}

.spiaggia-griglia-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.spiaggia-griglia-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.spiaggia-griglia-card-body {
    font-size: 12px;
}

/* Lista */
.spiaggia-lista {
    padding: 16px;
}

.spiaggia-lista-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.spiaggia-lista-table th {
    text-align: left;
    padding: 10px;
    border-bottom: 2px solid var(--color-border);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.spiaggia-lista-table td {
    padding: 10px;
    border-bottom: 1px solid var(--color-border-light);
}

.spiaggia-lista-table tr:hover {
    background: var(--color-bg);
}

/* Non assegnati - lista prenotazioni da assegnare */
.spiaggia-non-assegnati {
    margin-top: 24px;
    background: var(--color-surface);
    border: 2px dashed var(--color-border);
    border-radius: 12px;
    padding: 16px;
}

.spiaggia-non-assegnati-title {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.spiaggia-non-assegnati-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.spiaggia-non-assegnati-card {
    background: #fff;
    border: 1px solid var(--color-border-light);
    border-left: 4px solid var(--color-warning);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: grab;
    transition: all 0.15s ease;
    min-width: 200px;
    max-width: 280px;
    flex: 1 1 200px;
}

.spiaggia-non-assegnati-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.spiaggia-non-assegnati-card:active {
    cursor: grabbing;
}

.spiaggia-na-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.spiaggia-na-row:last-child {
    margin-bottom: 0;
}

/* Mobile */
@media (max-width: 768px) {
    #spiaggia-container {
        overflow-x: hidden;
        overflow-y: visible;
        position: relative;
        z-index: 1;
        max-width: 100vw;
    }

    .spiaggia-container {
        max-width: 100%;
        overflow-x: auto;
    }

    .spiaggia-date-nav {
        position: sticky;
        top: 0;
        z-index: 11;
    }

    .spiaggia-toolbar {
        flex-direction: column;
        align-items: stretch;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .spiaggia-views {
        justify-content: center;
    }

    .spiaggia-actions {
        justify-content: center;
    }

    .spiaggia-stats {
        gap: 8px;
    }

    .spiaggia-stat {
        padding: 6px 10px;
    }

    .spiaggia-stat-value {
        font-size: 16px;
    }

    .spiaggia-piantina {
        overflow-x: auto;
        padding: 12px;
    }

    .spiaggia-ombrellone {
        width: 65px;
        padding: 6px 2px;
    }

    .spiaggia-omb-icon {
        font-size: 18px;
    }

    .spiaggia-griglia-cards {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .spiaggia-lista-table {
        font-size: 12px;
    }

    .spiaggia-non-assegnati-list {
        flex-direction: column;
    }

    .spiaggia-non-assegnati-card {
        max-width: 100%;
    }
}

/* ============================================
   DA RICHIAMARE
   ============================================ */

.richiamare-list {
    padding: var(--space-md);
}

/* Badge sidebar */
.nav-item .richiamare-badge {
    background: #E74C3C;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Filtri */
.richiamare-filters {
    margin-bottom: var(--space-lg);
}

.richiamare-filter-tabs {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.richiamare-tab {
    padding: 6px 14px;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background: var(--color-surface);
    color: var(--color-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.richiamare-tab:hover {
    border-color: var(--color-primary);
    color: var(--color-text);
}

.richiamare-tab.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.richiamare-count {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.7;
}

.richiamare-tab.active .richiamare-count {
    opacity: 1;
}

.richiamare-actions-bar {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.richiamare-search-box {
    flex: 1;
    position: relative;
    max-width: 400px;
}

.richiamare-search-box svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

.richiamare-search-box input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--color-border);
    border-radius: var(--space-sm);
    font-size: 13px;
    background: var(--color-surface);
}

.richiamare-search-box input:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Card lista */
.richiamare-cards {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.richiamare-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: 10px;
    padding: var(--space-md);
    transition: all 0.2s;
    border-left: 4px solid var(--color-error);
}

.richiamare-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.richiamare-card.completato {
    opacity: 0.6;
    border-left-color: var(--color-success);
}

.richiamare-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.richiamare-card-info {
    flex: 1;
}

.richiamare-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 2px 0;
}

.richiamare-card-phone {
    font-size: 13px;
    color: var(--color-info);
    text-decoration: none;
}

.richiamare-card-phone:hover {
    text-decoration: underline;
}

.richiamare-card-badges {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

.richiamare-stato-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.richiamare-fonte-badge {
    font-size: 16px;
    cursor: default;
}

.richiamare-card-body {
    margin-bottom: var(--space-sm);
}

.richiamare-card-detail {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 2px;
}

.richiamare-card-note {
    margin-top: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-bg);
    border-radius: 6px;
    color: var(--color-text);
}

.richiamare-card-note-interna {
    margin-top: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: #FFF8E1;
    border-radius: 6px;
    color: #795548;
    font-size: 12px;
}

.richiamare-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--color-border-light);
    padding-top: var(--space-sm);
}

.richiamare-card-date {
    font-size: 12px;
    color: var(--color-text-muted);
}

.richiamare-card-actions {
    display: flex;
    gap: var(--space-xs);
}

.richiamare-card-actions .btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--color-error);
    color: var(--color-error);
    cursor: pointer;
}

.btn-danger-outline:hover {
    background: var(--color-error-bg);
}

/* Empty state */
.richiamare-empty {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    color: var(--color-text-muted);
}

.richiamare-empty p {
    margin: var(--space-md) 0;
    font-size: 14px;
}

/* Modal */
.richiamare-modal {
    max-width: 560px;
    width: 90%;
}

.richiamare-modal .form-row {
    display: flex;
    gap: var(--space-md);
}

.richiamare-modal .form-row .form-group {
    flex: 1;
}

.richiamare-modal .form-group {
    margin-bottom: var(--space-md);
}

.richiamare-modal .form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.richiamare-modal .form-group input,
.richiamare-modal .form-group select,
.richiamare-modal .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-body);
    background: var(--color-surface);
}

.richiamare-modal .form-group input:focus,
.richiamare-modal .form-group select:focus,
.richiamare-modal .form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .richiamare-filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: var(--space-xs);
    }

    .richiamare-tab {
        flex-shrink: 0;
        font-size: 12px;
        padding: 5px 10px;
    }

    .richiamare-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .richiamare-search-box {
        max-width: 100%;
    }

    .richiamare-card-header {
        flex-direction: column;
        gap: var(--space-xs);
    }

    .richiamare-card-badges {
        align-self: flex-start;
    }

    .richiamare-card-footer {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: flex-start;
    }

    .richiamare-card-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .richiamare-modal .form-row {
        flex-direction: column;
        gap: 0;
    }
}
