/* ===========================================
   Demo-Menu - Admin Styles
   Clean, professional dashboard design
   =========================================== */

/* CSS Variables */
:root {
    --primary: #2d3436;
    --primary-light: #636e72;
    --accent: #0984e3;
    --accent-hover: #0770c2;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --background: #f5f6fa;
    --surface: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --text-muted: #b2bec3;
    --border: #dfe6e9;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
    --font: 'Inter', sans-serif;
    --sidebar-width: 260px;
}

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

body {
    font-family: var(--font);
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

/* ===========================================
   Login Page
   =========================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, #1e272e 100%);
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-error {
    color: var(--danger);
    font-size: 0.875rem;
    text-align: center;
    min-height: 1.25rem;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--accent);
}

/* ===========================================
   Admin Dashboard Layout
   =========================================== */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    background: var(--accent);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: none;
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

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

.nav-item.active {
    background: rgba(9, 132, 227, 0.1);
    color: var(--accent);
    border-right: 3px solid var(--accent);
}

.nav-icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    transition: var(--transition);
}

.sidebar-link:hover {
    color: var(--accent);
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
}

.admin-section {
    animation: fadeIn 0.3s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Filter Bar */
.filter-bar {
    margin-bottom: 1.5rem;
}

/* ===========================================
   Form Elements
   =========================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.form-group small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group textarea,
.form-group select,
.form-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface);
    transition: var(--transition);
    width: 100%;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Allergens Grid */
.allergens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.75rem;
    background: var(--background);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.allergen-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    border: 1px solid transparent;
}

.allergen-item:hover {
    border-color: var(--accent);
}

.allergen-item.selected {
    background: rgba(9, 132, 227, 0.1);
    border-color: var(--accent);
}

.allergen-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.allergen-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

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

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
}

.btn-icon {
    padding: 0.5rem;
    min-width: 36px;
    height: 36px;
}

/* ===========================================
   Data Table
   =========================================== */
.data-table-container {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

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

.data-table td {
    font-size: 0.95rem;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--background);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--border);
}

.table-image-placeholder {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.5rem;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.available {
    background: rgba(0, 184, 148, 0.1);
    color: var(--success);
}

.status-badge.unavailable {
    background: rgba(214, 48, 49, 0.1);
    color: var(--danger);
}

/* Allergen Badges in Table */
.allergen-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.allergen-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    background: rgba(253, 203, 110, 0.3);
    color: #856404;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.empty-table {
    padding: 3rem;
    text-align: center;
    color: var(--text-light);
}

/* ===========================================
   Drag & Drop Sortable
   =========================================== */
.th-drag {
    width: 50px;
}

.drag-handle {
    cursor: grab;
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.drag-handle:hover {
    color: var(--accent);
}

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

.data-table-sortable tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.data-table-sortable tbody tr.dragging {
    opacity: 0.5;
    background: var(--accent) !important;
}

.data-table-sortable tbody tr.drag-over {
    border-top: 3px solid var(--accent);
}

.data-table-sortable tbody tr.drag-over-bottom {
    border-bottom: 3px solid var(--accent);
}

/* Indicatore di salvataggio ordine */
.order-saving {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: fadeIn 0.3s ease;
}

.order-saving .mini-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===========================================
   Modal
   =========================================== */
.modal {
    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;
    padding: 1rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-lg {
    max-width: 650px;
}

.modal-sm {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
}

.modal-form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border);
}

/* Language Tabs */
.lang-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0.25rem;
}

.lang-tab {
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.lang-tab:hover {
    color: var(--text);
}

.lang-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.lang-panel {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
}

.lang-panel.active {
    display: flex;
}

/* Image Upload */
.image-upload-container {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.image-preview {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-sm);
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--background);
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview .placeholder {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem;
}

.image-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===========================================
   Toast Notification
   =========================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1001;
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

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

.toast.error {
    background: var(--danger);
}

/* ===========================================
   Loading Overlay
   =========================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

/* ===========================================
   QR Code Section
   =========================================== */
.qr-grid {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 0;
}

.qr-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    max-width: 450px;
}

.qr-card:hover {
    box-shadow: var(--shadow-lg);
}

.qr-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--background);
    text-align: center;
}

.qr-card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.qr-card-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
    word-break: break-all;
}

.qr-card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.qr-image-container {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
}

.qr-image-container img {
    display: block;
    width: 300px;
    height: 300px;
}

.qr-card-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.qr-card-actions .btn {
    flex: 1;
}

.qr-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.qr-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* ===========================================
   Mobile Menu Toggle
   =========================================== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    z-index: 1002;
    box-shadow: var(--shadow);
}

.mobile-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.sidebar-overlay.active {
    display: block;
}

/* ===========================================
   Gallery Admin Grid
   =========================================== */
.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.gallery-admin-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.gallery-admin-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-admin-item:hover img {
    transform: scale(1.05);
}

.gallery-admin-item-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition);
}

.gallery-admin-item:hover .gallery-admin-item-actions {
    opacity: 1;
}

.gallery-admin-item-actions .btn {
    background: rgba(255,255,255,0.9);
    color: var(--text);
}

.gallery-admin-item-actions .btn-danger {
    background: var(--danger);
    color: white;
}

/* ===========================================
   Reservations Stats
   =========================================== */
.reservations-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===========================================
   Reservation Details
   =========================================== */
.reservation-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.reservation-detail-grid .detail-item {
    padding: 0.75rem;
    background: var(--background);
    border-radius: var(--radius-sm);
}

.reservation-detail-grid .detail-item.full-width {
    grid-column: 1 / -1;
}

.reservation-detail-grid label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.reservation-detail-grid p {
    font-size: 0.95rem;
    color: var(--text);
    margin: 0;
}

.reservation-detail-grid a {
    color: var(--accent);
}

/* Status badges additions */
.status-badge.pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-badge.completed {
    background-color: #d4edda;
    color: #155724;
}

/* Filter bar improvements */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-bar .form-control,
.filter-bar .form-select {
    min-width: 150px;
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .admin-main {
        margin-left: 220px;
    }

    /* QR Code responsive */
    .qr-image-container img {
        width: 280px;
        height: 280px;
    }
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        width: 260px;
        top: 0;
        bottom: 0;
        height: 100vh;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        z-index: 1001;
        overflow-y: auto;
    }

    .sidebar.active {
        left: 0;
    }

    .admin-main {
        margin-left: 0;
        padding: 70px 1rem 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-header h1 {
        font-size: 1.25rem;
    }

    .section-header .btn {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Converti tabelle in card layout su mobile */
    .data-table-container {
        overflow-x: visible;
    }

    .data-table {
        min-width: auto;
        border: none;
        background: transparent;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: block;
    }

    .data-table tr {
        display: block;
        background: var(--surface);
        border-radius: var(--radius);
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: var(--shadow);
        border: 1px solid var(--border);
    }

    .data-table td {
        display: block;
        text-align: left;
        padding: 0.5rem 0;
        border: none;
    }

    .data-table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        display: block;
        margin-bottom: 0.25rem;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .data-table td:first-child:before {
        display: none;
    }

    .table-actions {
        justify-content: flex-start;
        margin-top: 0.5rem;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border);
    }

    .table-image,
    .table-image-placeholder {
        width: 80px;
        height: 80px;
        margin-bottom: 0.5rem;
    }

    .image-upload-container {
        flex-direction: column;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    /* QR Code section mobile */
    .qr-grid {
        padding: 1rem;
    }

    .qr-card {
        max-width: 100%;
    }

    .qr-image-container {
        padding: 1rem;
    }

    .qr-image-container img {
        width: 250px;
        height: 250px;
    }

    .filter-bar {
        margin-bottom: 1rem;
        flex-direction: column;
    }

    .filter-bar select,
    .filter-bar input {
        width: 100%;
    }

    .reservations-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .reservation-detail-grid {
        grid-template-columns: 1fr;
    }

    .gallery-admin-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

@media (max-width: 576px) {
    .admin-main {
        padding: 70px 0.75rem 1rem;
    }

    .section-header h1 {
        font-size: 1.15rem;
    }

    .btn {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }

    /* Card layout mobile più compatto */
    .data-table tr {
        padding: 0.75rem;
    }

    .data-table td {
        padding: 0.4rem 0;
    }

    .data-table td:before {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
    }

    .table-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .table-actions .btn {
        flex: 1;
        min-width: calc(50% - 0.25rem);
    }

    .modal-content {
        margin: 0.5rem;
        max-height: 95vh;
    }

    .modal-form {
        padding: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    /* QR Code section extra small mobile */
    .qr-grid {
        padding: 0.5rem;
    }

    .qr-card-body {
        padding: 1rem;
    }

    .qr-image-container {
        padding: 0.75rem;
    }

    .qr-image-container img {
        width: 200px;
        height: 200px;
    }

    .qr-card-header h3 {
        font-size: 1rem;
    }

    .qr-card-header p {
        font-size: 0.8rem;
    }

    .filter-bar {
        margin-bottom: 1rem;
    }

    .form-select {
        font-size: 0.9rem;
    }
}

@media (max-width: 380px) {
    .mobile-header {
        height: 55px;
        padding: 0 0.75rem;
    }

    .mobile-header h2 {
        font-size: 1rem;
    }

    .admin-main {
        padding: 65px 0.5rem 1rem;
    }

    .section-header {
        gap: 0.75rem;
    }

    .btn-sm {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .qr-card-header {
        padding: 1rem;
    }

    .qr-card-actions {
        flex-direction: column;
    }
}

/* ===========================================
   Mobile Optimizations
   =========================================== */

/* Safe area for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-content {
        margin-bottom: env(safe-area-inset-bottom);
    }
}

/* Touch-friendly admin improvements */
@media (max-width: 768px) {
    /* Minimum 44x44px tap targets */
    .btn,
    .nav-item,
    .mobile-toggle,
    .modal-close {
        min-height: 44px;
        min-width: 44px;
    }

    /* Prevent accidental text selection */
    .nav-item,
    .btn,
    .drag-handle {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }

    /* Better tap highlighting */
    .btn,
    .nav-item,
    a {
        -webkit-tap-highlight-color: rgba(9, 132, 227, 0.2);
    }

    /* Smooth scrolling for tables */
    .data-table-container {
        -webkit-overflow-scrolling: touch;
    }

    /* Prevent zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Active states for touch feedback */
    .btn:active {
        transform: scale(0.97);
    }

    .nav-item:active {
        transform: scale(0.98);
    }
}

/* ===========================
   Settings / Contacts / Theme forms
   =========================== */
.settings-form { max-width: 800px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.form-actions { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.form-control-color { width: 44px; height: 40px; padding: 2px 4px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; flex-shrink: 0; }
.color-picker-group { display: flex; align-items: center; gap: 0.5rem; }
.color-hex-input { width: 90px; font-family: monospace; font-size: 0.9rem; letter-spacing: 0.05em; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text); transition: border-color 0.2s; }

/* ===========================
   Hours grid
   =========================== */
.hours-grid { display: flex; flex-direction: column; gap: 0.75rem; max-width: 640px; }
.hour-row { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem; background: var(--bg-alt); border-radius: var(--radius); flex-wrap: wrap; }
.hour-day { min-width: 90px; font-weight: 600; }
.hour-times { display: flex; align-items: center; gap: 0.5rem; }
.hour-times.hidden { display: none; }
.hour-save-btn { margin-left: auto; }

/* ===========================
   Badge variants
   =========================== */
.badge-role { background: #6c757d; color: #fff; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; }
.badge-success { background: #28a745; color: #fff; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; }
.badge-danger  { background: #dc3545; color: #fff; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; }

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===========================
   Layout Section Admin
   =========================== */
.layout-section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary);
    flex-wrap: wrap;
}
.layout-section-inactive {
    opacity: 0.55;
    border-left-color: var(--border);
}
.layout-section-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}
.layout-section-order {
    width: 1.75rem;
    height: 1.75rem;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}
.layout-section-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}
.badge-secondary {
    background: var(--secondary);
    color: #fff;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-left: 0.35rem;
}
