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

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #ede9fe;
  --success: #059669;
  --success-light: #d1fae5;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

html { font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-800);
  background: linear-gradient(135deg, #f0f4ff 0%, #f5f0ff 100%);
  min-height: 100vh;
  line-height: 1.5;
}

/* === Layout === */
.page-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.container { max-width: 680px; margin: 0 auto; padding: 0 20px; width: 100%; }
.main { flex: 1; padding: 32px 0; }

/* === Header === */
.header {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky; top: 0; z-index: 100;
}
.header-content {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.1rem; color: var(--primary);
}
.logo svg { stroke: var(--primary); }

/* === Steps Indicator === */
.steps-indicator {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-bottom: 32px;
}
.step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 60px;
}
.step-circle {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
  background: var(--gray-200); color: var(--gray-500);
  transition: all 0.3s;
}
.step span {
  font-size: 11px; font-weight: 500; color: var(--gray-400);
  transition: all 0.3s;
}
.step.active .step-circle { background: var(--primary); color: white; }
.step.active span { color: var(--primary); }
.step.done .step-circle { background: var(--success); color: white; }
.step.done span { color: var(--success); }
.step-line { flex: 1; height: 2px; background: var(--gray-200); margin-bottom: 22px; }

/* === Card === */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.card-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.card-header h2 { font-size: 1.4rem; font-weight: 700; color: var(--gray-900); }
.card-header p { color: var(--gray-500); margin-top: 4px; font-size: 0.9rem; }
.card-body { padding: 28px 32px; }

/* === Back Button === */
.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--primary); font-size: 0.85rem; font-weight: 500;
  padding: 0; margin-bottom: 12px;
  transition: opacity 0.2s;
}
.btn-back:hover { opacity: 0.7; }
.btn-icon {
  background: none; border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.2s;
}
.btn-icon:hover { background: var(--gray-50); }

/* === Calendar === */
.calendar-wrapper { user-select: none; }
.calendar-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.calendar-nav h3 { font-size: 1.1rem; font-weight: 600; }
.calendar-days-header {
  display: grid; grid-template-columns: repeat(7, 1fr);
  text-align: center; margin-bottom: 8px;
}
.calendar-days-header span {
  font-size: 12px; font-weight: 600; color: var(--gray-400);
  text-transform: uppercase; padding: 4px 0;
}
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.calendar-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  cursor: pointer; border: 2px solid transparent;
  transition: all 0.15s;
}
.calendar-day:hover:not(.disabled):not(.other-month) {
  background: var(--primary-light); color: var(--primary);
  border-color: var(--primary-light);
}
.calendar-day.today {
  background: var(--gray-100); font-weight: 700;
}
.calendar-day.selected {
  background: var(--primary); color: white !important;
  border-color: var(--primary);
}
.calendar-day.disabled {
  color: var(--gray-300); cursor: not-allowed;
}
.calendar-day.other-month { color: var(--gray-200); cursor: default; }
.calendar-day.has-availability { position: relative; }
.calendar-day.has-availability::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--primary);
}
.calendar-day.selected::after { background: white; }

/* === Time Slots === */
.slots-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px;
}
.slot-btn {
  padding: 12px 8px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: white; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--gray-700);
  text-align: center; transition: all 0.15s;
}
.slot-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.slot-btn.selected { background: var(--primary); color: white; border-color: var(--primary); }
.slot-duration { font-size: 11px; font-weight: 400; color: var(--gray-400); display: block; margin-top: 2px; }
.slot-btn.selected .slot-duration { color: rgba(255,255,255,0.8); }

/* === Form === */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 14px; font-weight: 500; color: var(--gray-700);
  margin-bottom: 6px;
}
.required { color: var(--danger); }
.form-group input, .form-group textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none; background: white; color: var(--gray-800);
}
.form-group input:focus, .form-group textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.field-error { font-size: 12px; color: var(--danger); margin-top: 4px; display: block; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.2s; font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-outline { background: white; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* === Alerts === */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 16px;
}
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid #fca5a5; }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #6ee7b7; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fcd34d; }

/* === Loading & Empty States === */
.loading-state, .empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 48px 0;
  color: var(--gray-400);
}
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--gray-200); border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
.btn-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: white;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Success / Confirmation === */
.text-center { text-align: center; }
.success-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--success-light); margin-bottom: 20px;
}
.success-icon svg { stroke: var(--success); }
.success-subtitle { color: var(--gray-500); margin-bottom: 28px; }

.confirmation-card {
  background: var(--gray-50); border-radius: var(--radius);
  padding: 20px; margin: 0 auto 20px;
  max-width: 400px; text-align: left;
}
.confirmation-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--gray-200);
}
.confirmation-row:last-child { border-bottom: none; }
.confirmation-row svg { stroke: var(--primary); flex-shrink: 0; }
.conf-label { font-size: 12px; color: var(--gray-500); display: block; }
.conf-value { font-weight: 600; font-size: 15px; color: var(--gray-900); }
.confirmation-note { color: var(--gray-400); font-size: 13px; margin-bottom: 24px; }

/* === Footer === */
.footer {
  background: var(--white); border-top: 1px solid var(--gray-200);
  padding: 16px 0; text-align: center;
  color: var(--gray-400); font-size: 13px;
}

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

/* === Admin Specific === */
.sidebar {
  width: 260px; background: var(--gray-900); min-height: 100vh;
  padding: 20px 0; display: flex; flex-direction: column;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px 20px;
  color: white; font-weight: 700; font-size: 1rem;
  border-bottom: 1px solid var(--gray-700); margin-bottom: 8px;
}
.sidebar-logo svg { stroke: #818cf8; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 24px; color: var(--gray-400);
  cursor: pointer; font-size: 14px; font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.nav-item:hover { color: white; background: rgba(255,255,255,0.05); }
.nav-item.active { color: #818cf8; border-left-color: #818cf8; background: rgba(129,140,248,0.1); }
.nav-item svg { flex-shrink: 0; }

.admin-layout { display: flex; min-height: 100vh; }
.admin-content { flex: 1; background: var(--gray-50); overflow-y: auto; }
.admin-header {
  background: white; padding: 20px 32px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.admin-header h1 { font-size: 1.3rem; font-weight: 700; }
.admin-body { padding: 32px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: white; border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  border-top: 3px solid transparent;
}
.stat-card--blue  { border-top-color: var(--primary); }
.stat-card--green { border-top-color: var(--success); }
.stat-card--purple{ border-top-color: #8b5cf6; }
.stat-card--orange{ border-top-color: var(--warning); }

.stat-card-icon {
  width: 36px; height: 36px; border-radius: 8px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
}
.stat-card--blue   .stat-card-icon { background: var(--primary-light); color: var(--primary); }
.stat-card--green  .stat-card-icon { background: var(--success-light);  color: var(--success); }
.stat-card--purple .stat-card-icon { background: #ede9fe; color: #7c3aed; }
.stat-card--orange .stat-card-icon { background: var(--warning-light); color: #d97706; }

.stat-label { font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--gray-900); line-height: 1; }
.stat-sub { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* Greeting card (dashboard home) */
.dashboard-greeting {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  padding: 24px 32px;
  display: flex; align-items: center; justify-content: space-between;
  color: white;
}
.greeting-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.greeting-date  { font-size: 13px; opacity: 0.8; }
.greeting-page-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.18); color: white; text-decoration: none;
  padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  white-space: nowrap; transition: background 0.15s; cursor: pointer; border: none;
  flex-shrink: 0;
}
.greeting-page-btn:hover { background: rgba(255,255,255,0.28); }

.table-card { background: white; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--gray-200);
}
.table-header h3 { font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.05em; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-warning { background: var(--warning-light); color: var(--warning); }

.filter-bar {
  display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.filter-bar input, .filter-bar select {
  padding: 8px 12px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 14px;
  font-family: inherit; outline: none;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); }
.filter-bar select:has(option[value=""]:checked) { color: var(--gray-400); }
.filter-bar select option { color: var(--gray-800); }
.filter-date-wrap {
  display: flex; align-items: center;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  background: white; overflow: hidden;
}
.filter-date-wrap:focus-within { border-color: var(--primary); }
.filter-date-label {
  padding: 8px 6px 8px 12px; font-size: 14px;
  color: var(--gray-400); white-space: nowrap; user-select: none;
}
.filter-date-wrap input[type="date"] {
  border: none !important; border-radius: 0 !important;
  padding: 8px 10px 8px 0;
}

.section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; color: var(--gray-900); }

.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--gray-100);
  gap: 24px;
}
.setting-row:last-child { border-bottom: none; }
.setting-label { font-weight: 500; font-size: 14px; }
.setting-desc { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.setting-control { flex-shrink: 0; }
.setting-control input, .setting-control select {
  padding: 8px 12px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  outline: none; min-width: 180px;
}
.setting-control input:focus, .setting-control select:focus { border-color: var(--primary); }

.toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--gray-300); border-radius: 999px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  height: 18px; width: 18px; border-radius: 50%;
  left: 4px; bottom: 4px; background: white;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

.calendar-status {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--gray-50); margin-bottom: 16px;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; }
.status-dot.connected { background: var(--success); }
.status-dot.disconnected { background: var(--gray-400); }

/* Slot config */
.day-slots { margin-bottom: 20px; }
.day-label { font-weight: 600; font-size: 14px; margin-bottom: 8px; color: var(--gray-700); }
.slot-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.slot-row input[type="time"] {
  padding: 8px 10px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); font-family: inherit; font-size: 14px;
  outline: none;
}
.slot-row input[type="time"]:focus { border-color: var(--primary); }
.slot-row input[type="number"] {
  width: 80px; padding: 8px 10px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; outline: none;
}
.add-slot-btn {
  background: none; border: 1px dashed var(--gray-300);
  border-radius: var(--radius-sm); padding: 8px 14px;
  color: var(--gray-500); cursor: pointer; font-size: 13px;
  font-family: inherit; transition: all 0.2s;
}
.add-slot-btn:hover { border-color: var(--primary); color: var(--primary); }
.remove-slot-btn {
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); padding: 4px; border-radius: 4px;
  transition: color 0.15s;
}
.remove-slot-btn:hover { color: var(--danger); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal {
  background: white; border-radius: var(--radius-lg);
  max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-weight: 700; font-size: 1.1rem; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); padding: 4px; border-radius: 4px;
  display: flex; align-items: center;
}
.modal-close:hover { color: var(--gray-700); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 24px; border-top: 1px solid var(--gray-200);
}

/* Login */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f0f4ff 0%, #f5f0ff 100%);
}
.login-card {
  background: white; border-radius: var(--radius-lg); padding: 40px;
  width: 100%; max-width: 400px; box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--primary); font-weight: 700; font-size: 1.2rem;
  margin-bottom: 8px;
}
.login-title { text-align: center; font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.login-subtitle { text-align: center; color: var(--gray-500); margin-bottom: 28px; font-size: 14px; }

/* Blocked dates */
.blocked-dates-list { display: flex; flex-wrap: wrap; gap: 8px; }
.blocked-date-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--danger-light); color: var(--danger);
  padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 500;
}
.blocked-date-chip button {
  background: none; border: none; cursor: pointer;
  color: var(--danger); display: flex; align-items: center; padding: 0;
}

/* Etichette nav */
.nav-label-short { display: none; }
.nav-label-full  { display: inline; }

/* Mobile topbar — nascosto su desktop */
.mobile-topbar { display: none; }

/* Mobile account dropdown */
.mobile-account-wrap { position: relative; }
.mobile-account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 2000;
  overflow: hidden;
  border: 1px solid var(--gray-100);
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  font-size: 14px; font-weight: 500; color: var(--gray-700);
  cursor: pointer;
  transition: background 0.12s;
}
.dropdown-item:hover { background: var(--gray-50); }
.dropdown-item-danger { color: var(--danger); }
.dropdown-item-danger:hover { background: var(--danger-light); }
.dropdown-divider { height: 1px; background: var(--gray-100); margin: 4px 0; }

/* FAB Voce */
.fab-voice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(79,70,229,0.45);
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.fab-voice:hover { background: var(--primary-dark); box-shadow: 0 6px 24px rgba(79,70,229,0.55); transform: scale(1.08); }
.fab-voice:active { transform: scale(0.93); }

/* Responsive tabelle */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* === Card table (appuntamenti) ===
   Su mobile ogni riga diventa una card con:
   Riga 1: [Nome cliente] [Pulsanti]
   Riga 2: [Data] [Ora] [Badge stato]
*/
@media (max-width: 768px) {
  .appt-table { display: block; width: 100%; }
  .appt-table thead { display: none; }
  .appt-table tbody { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
  .appt-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 6px;
    background: white;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    border: 1px solid var(--gray-100);
  }
  .appt-table td { border: none; padding: 0; }

  /* Riga 1 sinistra: nome cliente */
  .appt-table td.col-name {
    order: 1;
    flex: 1 0 calc(100% - 90px);
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Riga 1 destra: pulsanti */
  .appt-table td.col-actions {
    order: 2;
    flex: 0 0 80px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
  }
  /* Riga 2: data */
  .appt-table td.col-date {
    order: 3;
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
    margin-right: 8px;
  }
  /* Riga 2: ora */
  .appt-table td.col-time {
    order: 4;
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--gray-500);
    margin-right: 8px;
  }
  /* Riga 2: badge stato */
  .appt-table td.col-status {
    order: 5;
    flex: 1;
  }
  /* Celle full-width (loading / empty state) */
  .appt-table td.col-full {
    flex: 0 0 100%;
    text-align: center;
  }
  /* Rimuovi bordo/shadow dalla card-wrapper quando contiene appt-table */
  .appt-table-card {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }
  /* Filtri: stack verticale su mobile */
  .appt-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .appt-filters input,
  .appt-filters select {
    width: 100%;
  }
}

/* Touch targets */
.btn { min-height: 44px; }

/* Responsive 600px (pagina booking pubblica) */
@media (max-width: 600px) {
  .card-header, .card-body { padding: 20px; }
  .steps-indicator { gap: 0; }
  .step { min-width: 48px; }
  .step span { font-size: 10px; }
  .calendar-day { font-size: 13px; }
  .slots-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-body { padding: 16px; }
  table { font-size: 12px; }
  th, td { padding: 10px 8px; }
}

/* Mobile app layout — bottom navigation (768px) */
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }

  /* Topbar mobile */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--gray-900);
    color: #fff;
    padding: 0 16px;
    z-index: 101;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .mobile-topbar-logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 600; font-size: 15px; color: #fff;
  }
  .mobile-topbar-actions { display: flex; align-items: center; gap: 4px; }
  .mobile-topbar-btn {
    width: 40px; height: 40px; border-radius: 8px;
    background: none; border: none; color: var(--gray-300);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.12s;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-topbar-btn:hover { background: rgba(255,255,255,0.08); }

  /* Sidebar → bottom nav */
  .sidebar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100%;
    height: 60px;
    min-height: unset;
    flex-direction: row;
    padding: 0;
    z-index: 100;
    overflow: hidden;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .sidebar-logo,
  .sidebar-footer { display: none; }
  .sidebar nav {
    display: flex; flex-direction: row;
    width: 100%; height: 100%;
  }

  /* Mostra solo .nav-bottom nel bottom nav */
  .nav-desktop-only { display: none !important; }
  .nav-item.nav-bottom {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    padding: 4px 2px;
    height: 60px;
    border-left: none;
    border-top: 3px solid transparent;
    font-size: 10px;
    border-radius: 0;
  }
  .nav-item.nav-bottom.active {
    border-left: none;
    border-top: 3px solid var(--primary-light);
    background: rgba(255,255,255,0.06);
  }
  .nav-item.nav-bottom svg { width: 22px; height: 22px; flex-shrink: 0; }

  .nav-label-short { display: block; }
  .nav-label-full  { display: none; }

  /* Contenuto: padding per topbar + bottom nav */
  .admin-content { padding-top: 56px; padding-bottom: 68px; }

  /* FAB sopra bottom nav */
  .fab-voice { bottom: 72px; right: 16px; width: 54px; height: 54px; }

  /* Greeting card mobile */
  .dashboard-greeting { padding: 20px 16px; }
  .greeting-title { font-size: 1.1rem; }
  .greeting-page-btn { padding: 6px 12px; font-size: 12px; }

  /* Stat cards mobile: 2 colonne */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
  .stat-card { padding: 14px; }
  .stat-card-icon { width: 30px; height: 30px; margin-bottom: 8px; }
  .stat-value { font-size: 1.6rem; }

  /* admin-body mobile */
  .admin-body { padding: 16px; }

  /* admin-header compatto mobile */
  .admin-header { padding: 12px 16px; }
  .admin-header h1 { font-size: 1.1rem; }
}
