:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    
    --color-free: #10b981;    /* Verde */
    --color-occupied: #ef4444; /* Rosso */
    --color-prep: #f59e0b;     /* Giallo */
    --color-reserved: #3b82f6; /* Blu */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Tablet Layout Header */
.tablet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.tablet-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, #e0e7ff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.filter-group {
    display: flex;
    gap: 10px;
}

.filter-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-light);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

/* Smart Assign Form */
.smart-assign-bar {
    background: var(--bg-card);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.smart-assign-bar input {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 1rem;
}

.smart-assign-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Grid Tavoli */
.tavoli-container {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

.tavoli-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* Table Card */
.tavolo-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.tavolo-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.tavolo-nome {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    z-index: 2;
}

.tavolo-posti {
    font-size: 0.9rem;
    color: var(--text-muted);
    z-index: 2;
}

.tavolo-zona {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 15px;
    opacity: 0.7;
    z-index: 2;
}

/* Indicatori Stato */
.tavolo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: background-color 0.3s ease;
}

.tavolo-card.libero::before {
    background-color: var(--color-free);
}
.tavolo-card.occupato::before {
    background-color: var(--color-occupied);
}
.tavolo-card.preparazione::before {
    background-color: var(--color-prep);
}
.tavolo-card.prenotato::before {
    background-color: var(--color-reserved);
}

/* Colore di sfondo leggero per stato */
.tavolo-card.libero {
    background: linear-gradient(145deg, rgba(30,41,59,1) 0%, rgba(16,185,129,0.05) 100%);
    border-color: rgba(16, 185, 129, 0.2);
}
.tavolo-card.occupato {
    background: linear-gradient(145deg, rgba(30,41,59,1) 0%, rgba(239,68,68,0.05) 100%);
    border-color: rgba(239, 68, 68, 0.2);
}
.tavolo-card.preparazione {
    background: linear-gradient(145deg, rgba(30,41,59,1) 0%, rgba(245,158,11,0.05) 100%);
    border-color: rgba(245, 158, 11, 0.2);
}
.tavolo-card.prenotato {
    background: linear-gradient(145deg, rgba(30,41,59,1) 0%, rgba(59,130,246,0.05) 100%);
    border-color: rgba(59, 130, 246, 0.2);
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
}

.toast {
    background: var(--bg-card);
    border-left: 4px solid var(--primary);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease forwards;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

/* Loader */
.loader {
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top: 3px solid var(--primary);
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modern Dashboard Styling */
.dashboard-container {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 10px;
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.glass-panel {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.glass-panel h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.modern-table th, .modern-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modern-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

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

.modern-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modern-form input, .modern-form textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.modern-form input:focus, .modern-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.modern-form button {
    width: 100%;
    margin-top: 10px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}
.status-badge.libero { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.status-badge.occupato, .status-badge.assegnata { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.status-badge.preparazione, .status-badge.attesa { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }