/* LS N.C.C. Lunghini Servizi - Design System */

/* === CSS CUSTOM PROPERTIES (Design Tokens) === */
:root {
  /* Colori Principali */
  --color-navy: #14223b;
  --color-navy-2: #22345a;
  --color-gray-50: #F9FAFB;
  --color-gray-100: #F3F4F6;
  --color-gray-300: #D1D5DB;
  --color-gray-600: #6B7280;
  --color-gray-700: #374151;
  --color-gray-900: #111827;
  --color-accent: #0EA5E9;
  --color-success: #10B981;
  --color-danger: #EF4444;
  --color-warning: #F59E0B;
  --color-white: #FFFFFF;
  
  /* Spaziature (8px scale) */
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem;  /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem;    /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem;  /* 24px */
  --space-8: 2rem;    /* 32px */
  --space-12: 3rem;   /* 48px */
  
  /* Border radius */
  --radius-sm: 0.5rem;   /* 8px */
  --radius-md: 0.75rem;  /* 12px */
  --radius-lg: 1rem;     /* 16px */
  --radius-xl: 1.5rem;   /* 24px */
  
  /* Ombre */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 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);
  
  /* Typography */
  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
}

/* === ANIMAZIONI === */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

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

.slide-up {
  animation: slideUp 0.4s ease-out;
}

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

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--color-gray-100) 25%, var(--color-gray-50) 50%, var(--color-gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === COMPONENTI BUTTON === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  outline: none;
  text-decoration: none;
  font-family: inherit;
}

.btn:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

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

.btn-primary {
  background-color: var(--color-navy);
  color: var(--color-white);
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-lg);
  font-weight: 600;
  box-shadow: var(--shadow-md);
  width: 100%;
}

.btn-primary:hover {
  background-color: var(--color-navy-2);
}

.btn-secondary {
  background-color: var(--color-gray-100);
  color: var(--color-navy);
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-base);
  font-weight: 500;
}

.btn-secondary:hover {
  background-color: var(--color-gray-300);
}

.btn-success {
  background-color: var(--color-success);
  color: var(--color-white);
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-lg);
  font-weight: 600;
  width: 100%;
}

.btn-success:hover {
  background-color: #059669;
}

.btn-danger {
  background-color: var(--color-danger);
  color: var(--color-white);
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-lg);
  font-weight: 600;
  width: 100%;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
  width: auto;
}

.btn-icon {
  width: auto;
  padding: var(--space-3);
  border-radius: 50%;
}

/* === COMPONENTI INPUT === */
.input-field, .select-field {
  width: 100%;
  padding: var(--space-4);
  font-size: var(--font-size-lg);
  border: 2px solid var(--color-gray-300);
  border-radius: var(--radius-lg);
  background-color: var(--color-white);
  transition: all 0.2s ease;
  outline: none;
  font-family: inherit;
}

.input-field:focus, .select-field:focus {
  border-color: var(--color-navy);
  box-shadow: 0 0 0 3px rgba(20, 34, 59, 0.1);
}

.input-field::placeholder {
  color: var(--color-gray-600);
}

/* === COMPONENTI CARD === */
.card {
  background-color: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  border: 1px solid var(--color-gray-100);
}

.card-header {
  border-bottom: 1px solid var(--color-gray-100);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
}

.card-compact {
  padding: var(--space-4);
}

/* === COMPONENTI BADGE === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: 9999px;
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success {
  background-color: #dcfce7;
  color: #166534;
}

.badge-danger {
  background-color: #fecaca;
  color: #991b1b;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-info {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-gray {
  background-color: var(--color-gray-100);
  color: var(--color-gray-700);
}

/* === APP SHELL === */
.app-shell {
  min-height: 100vh;
  background-color: var(--color-gray-50);
  padding-bottom: 5rem; /* Footer space */
}

.app-header {
  background-color: var(--color-navy);
  color: var(--color-white);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.app-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-4);
}

@media (min-width: 768px) {
  .app-content {
    padding: var(--space-6);
  }
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-white);
  border-top: 1px solid var(--color-gray-100);
  box-shadow: var(--shadow-lg);
  z-index: 50;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  text-decoration: none;
  transition: all 0.2s ease;
  flex: 1;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--color-navy);
}

.bottom-nav-item i {
  font-size: 1.25rem;
  margin-bottom: var(--space-1);
}



/* === MESSAGGI COMPONENTI === */
.message-bubble {
  max-width: 80%;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  line-height: 1.5;
  word-wrap: break-word;
}

.message-bubble-sent {
  background-color: var(--color-navy);
  color: var(--color-white);
  margin-left: auto;
  border-bottom-right-radius: var(--space-2);
}

.message-bubble-received {
  background-color: var(--color-gray-100);
  color: var(--color-gray-900);
  margin-right: auto;
  border-bottom-left-radius: var(--space-2);
}

.message-meta {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.message-thread {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  max-height: 400px;
  overflow-y: auto;
}

.message-composer {
  position: sticky;
  bottom: 0;
  background-color: var(--color-white);
  border-top: 1px solid var(--color-gray-100);
  padding: var(--space-4);
  display: flex;
  gap: var(--space-2);
  align-items: flex-end;
}

.message-composer input {
  flex: 1;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  resize: none;
  outline: none;
}

.message-composer input:focus {
  border-color: var(--color-navy);
  box-shadow: 0 0 0 2px rgba(20, 34, 59, 0.1);
}

/* === DASHBOARD STATISTICS CARDS === */
.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-100);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-number {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-gray-900);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Responsive stats grid */
@media (max-width: 768px) {
  .stat-card {
    padding: var(--space-3);
  }
  
  .stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
  
  .stat-number {
    font-size: var(--font-size-xl);
  }
  
  .stat-label {
    font-size: var(--font-size-xs);
  }
}

/* Avatar iniziali */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  color: var(--color-white);
  background-color: var(--color-navy-2);
  flex-shrink: 0;
}

.avatar-xs {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.65rem;
}

.avatar-sm {
  width: 2rem;
  height: 2rem;
  font-size: var(--font-size-xs);
}

.avatar-md {
  width: 2.5rem;
  height: 2.5rem;
  font-size: var(--font-size-sm);
}

/* Conversation list */
.conversation-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-gray-100);
  cursor: pointer;
  transition: all 0.2s ease;
}

.conversation-item:hover {
  background-color: var(--color-gray-50);
}

.conversation-item.active {
  background-color: var(--color-navy);
  color: var(--color-white);
}

.conversation-info {
  flex: 1;
  min-width: 0;
}

.conversation-name {
  font-weight: 600;
  font-size: var(--font-size-base);
  margin-bottom: var(--space-1);
}

.conversation-preview {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-time {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  white-space: nowrap;
}

/* === STATI E INDICATORI === */
.unread-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-danger);
  color: var(--color-white);
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: 50%;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 var(--space-1);
}

.loading {
  opacity: 0.5;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Empty states */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--color-gray-600);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.empty-state p {
  font-size: var(--font-size-sm);
  max-width: 24rem;
  margin: 0 auto;
}

/* === RESPONSIVE HELPERS === */
.mobile-padding {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 768px) {
  .mobile-padding {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

/* === STATI TIMBRATURE === */
.status-in {
  background-color: var(--color-success);
  color: var(--color-white);
}

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

/* === CALENDARIO STATI GIORNI === */
.calendar-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.calendar-day:hover {
  transform: scale(1.05);
  border-color: var(--color-navy);
}

/* Verde: giorno completo (IN + OUT) */
.status-complete {
  background-color: var(--color-success);
  color: var(--color-white);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.status-complete:hover {
  background-color: #059669;
}

/* Giallo: giorno parziale (solo IN o solo OUT) */
.status-partial {
  background-color: var(--color-warning);
  color: var(--color-white);
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.status-partial:hover {
  background-color: #d97706;
}

/* Rosso: anomalia rilevata */
.status-anomaly {
  background-color: var(--color-danger);
  color: var(--color-white);
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
  animation: pulse-anomaly 2s infinite;
}

.status-anomaly:hover {
  background-color: #dc2626;
}

@keyframes pulse-anomaly {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Grigio: nessun dato */
.status-empty {
  background-color: var(--color-gray-300);
  color: var(--color-gray-600);
}

.status-empty:hover {
  background-color: var(--color-gray-400);
  color: var(--color-gray-700);
}

/* Giorno corrente */
.calendar-day.today {
  border: 2px solid var(--color-navy);
  font-weight: 700;
}

/* Giorno di altro mese */
.calendar-day.other-month {
  opacity: 0.4;
  cursor: default;
}

.calendar-day.other-month:hover {
  transform: none;
  border-color: transparent;
}

/* Indicatori per il calendario */
.day-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.8);
}

/* === HEADER CALENDARIO CON TOTALI === */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
  color: var(--color-white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-bottom: var(--space-4);
}

.calendar-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin: 0;
}

.calendar-stats {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  font-size: var(--font-size-sm);
}

.calendar-stat {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.calendar-stat i {
  font-size: var(--font-size-base);
}

.calendar-stat-number {
  font-weight: 700;
  font-size: var(--font-size-base);
}

.export-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--color-white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

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

/* === POPUP DETTAGLI GIORNO === */
.day-details-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.day-details-overlay.show {
  opacity: 1;
  visibility: visible;
}

.day-details-popup {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

.day-details-overlay.show .day-details-popup {
  transform: scale(1) translateY(0);
}

.day-details-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-gray-200);
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
  color: var(--color-white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-details-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin: 0;
}

.close-popup {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: var(--color-white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg);
  transition: all 0.2s ease;
}

.close-popup:hover {
  background: rgba(255, 255, 255, 0.3);
}

.day-details-content {
  padding: var(--space-6);
}

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

.timbratura-item {
  display: flex;
  align-items: center;
  padding: var(--space-4);
  background: var(--color-gray-50);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-navy);
  transition: all 0.2s ease;
}

.timbratura-item:hover {
  background: var(--color-gray-100);
  transform: translateX(4px);
}

.timbratura-time {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-navy);
  min-width: 60px;
}

.timbratura-info {
  flex: 1;
  margin-left: var(--space-4);
}

.timbratura-service {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: var(--space-1);
}

.timbratura-route {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
}

.timbratura-direction {
  background: var(--color-success);
  color: var(--color-white);
  padding: var(--space-1) var(--space-3);
  border-radius: 9999px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.timbratura-direction.out {
  background: var(--color-danger);
}

.day-summary {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-gray-200);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.summary-item {
  text-align: center;
  padding: var(--space-3);
  background: var(--color-gray-50);
  border-radius: var(--radius-md);
}

.summary-label {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-bottom: var(--space-1);
}

.summary-value {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-navy);
}

.no-timbrature {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--color-gray-600);
}

.no-timbrature i {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.3;
}

.no-timbrature h4 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.no-timbrature p {
  font-size: var(--font-size-sm);
}

/* Mobile responsive per popup */
@media (max-width: 768px) {
  .day-details-overlay {
    padding: var(--space-2);
  }
  
  .day-details-popup {
    max-height: 90vh;
  }
  
  .day-details-header,
  .day-details-content {
    padding: var(--space-4);
  }
  
  .calendar-header {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }
  
  .calendar-stats {
    flex-wrap: wrap;
    gap: var(--space-4);
  }
}

/* === GESTIONE PROFILI AVANZATA === */
.badge-admin {
  background-color: #e0e7ff;
  color: #3730a3;
  font-weight: 600;
}

.badge-autista {
  background-color: #dbeafe;
  color: #1e40af;
  font-weight: 600;
}

.status-in-servizio {
  color: var(--color-success);
  font-weight: 600;
}

.status-disponibile {
  color: var(--color-gray-600);
}

/* User details modal sections */
.section {
  margin-bottom: var(--space-6);
}

.section-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-accent) 100%);
  border-radius: 2px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.info-item label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.info-item span {
  font-size: var(--font-size-base);
  color: var(--color-gray-900);
}

/* Current status card */
.current-status {
  margin-bottom: var(--space-4);
}

.status-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 2px solid;
  background-color: var(--color-white);
}

.status-card.status-in {
  border-color: var(--color-success);
  background-color: #f0fdf4;
}

.status-card.status-out {
  border-color: var(--color-danger);
  background-color: #fef2f2;
}

.status-card.status-empty {
  border-color: var(--color-gray-300);
  background-color: var(--color-gray-50);
}

.status-card i {
  font-size: var(--font-size-xl);
  color: inherit;
}

.status-info {
  flex: 1;
}

.status-action {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.status-time {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  margin-bottom: var(--space-1);
}

.status-service, .status-route {
  font-size: var(--font-size-sm);
  color: var(--color-gray-700);
}

/* Statistics grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-4);
}

.stat-item {
  text-align: center;
  padding: var(--space-4);
  background: var(--color-gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gray-200);
}

.stat-number {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Movements list */
.movements-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 300px;
  overflow-y: auto;
}

.movement-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-gray-50);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-gray-300);
  transition: all 0.2s ease;
}

.movement-item:hover {
  background: var(--color-gray-100);
  transform: translateX(2px);
}

.movement-direction {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 40px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-white);
  gap: var(--space-1);
}

.direction-in {
  background: var(--color-success);
  border-left-color: var(--color-success);
}

.direction-out {
  background: var(--color-danger);
  border-left-color: var(--color-danger);
}

.movement-info {
  flex: 1;
  min-width: 0;
}

.movement-time {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: var(--space-1);
}

.movement-service, .movement-route {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
}

.empty-movements {
  text-align: center;
  padding: var(--space-8);
  color: var(--color-gray-500);
  font-style: italic;
}

/* Admin actions */
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.admin-actions .btn {
  width: auto;
  flex: 1;
  min-width: 140px;
}

/* === UTILITY CLASSES === */
.text-navy {
  color: var(--color-navy);
}

.bg-navy {
  background-color: var(--color-navy);
}

.bg-navy-2 {
  background-color: var(--color-navy-2);
}

.border-navy {
  border-color: var(--color-navy);
}

.text-accent {
  color: var(--color-accent);
}

/* === TABS COMPONENT === */
.tab-group {
  display: flex;
  background-color: var(--color-gray-100);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  margin-bottom: var(--space-6);
}

.tab-button {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  color: var(--color-gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-button.active {
  background-color: var(--color-white);
  color: var(--color-navy);
  box-shadow: var(--shadow-sm);
}

/* === ALERT COMPONENTS === */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  border-left: 4px solid;
}

.alert-success {
  background-color: #dcfce7;
  border-color: var(--color-success);
  color: #166534;
}

.alert-error {
  background-color: #fecaca;
  border-color: var(--color-danger);
  color: #991b1b;
}

.alert-warning {
  background-color: #fef3c7;
  border-color: var(--color-warning);
  color: #92400e;
}

.alert-info {
  background-color: #dbeafe;
  border-color: var(--color-accent);
  color: #1e40af;
}

/* === FOCUS STATES === */
button:focus-visible, 
input:focus-visible, 
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* === HERO CARD COMPONENT === */
.hero-card {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
  border-radius: 1.25rem; /* 20px */
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 
    0 10px 10px -5px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  padding: var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-6);
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.hero-card-content {
  position: relative;
  z-index: 1;
}

.hero-logo {
  width: 180px;
  height: 180px;
  margin: 0 auto var(--space-4);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  /* Garantisce visibilità ottimale del logo LS N.C.C. su qualsiasi sfondo */
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.8) 70%, transparent 100%);
  border-radius: 50%;
  padding: 8px;
  transition: transform 0.2s ease;
}

.hero-logo:hover {
  transform: scale(1.05);
}

@media (min-width: 768px) {
  .hero-card {
    padding: var(--space-8);
  }
  
  .hero-logo {
    width: 240px;
    height: 240px;
  }
}

@media (min-width: 1024px) {
  .hero-logo {
    width: 280px;
    height: 280px;
  }
}

.hero-title {
  color: var(--color-white);
  font-size: var(--font-size-2xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 1.75rem; /* 28px */
  }
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--font-size-base);
  font-weight: 400;
  margin-bottom: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: var(--font-size-lg);
  }
}

/* Hero Card Compact (per header) */
.hero-card.compact {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-4);
  text-align: left;
}

.hero-card.compact .hero-card-content {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.hero-card.compact .hero-logo {
  width: 48px;
  height: 48px;
  margin: 0;
  flex-shrink: 0;
  padding: 4px;
}

.hero-card.compact .hero-text {
  flex: 1;
}

.hero-card.compact .hero-title {
  font-size: var(--font-size-lg);
  margin: 0 0 2px 0;
  text-align: left;
}

.hero-card.compact .hero-subtitle {
  font-size: var(--font-size-sm);
  margin: 0;
  opacity: 0.8;
  text-align: left;
}

.hero-card-compact {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.hero-card-compact .hero-logo {
  width: 48px;
  height: 48px;
  margin: 0;
  flex-shrink: 0;
  padding: 4px;
}

.hero-card-compact .hero-title {
  font-size: var(--font-size-lg);
  margin: 0;
  text-align: left;
}

.hero-card-compact .hero-subtitle {
  font-size: var(--font-size-sm);
  margin: 0;
  opacity: 0.8;
  text-align: left;
}

/* === PRINT STYLES === */
@media print {
  .no-print {
    display: none !important;
  }
  
  .app-shell {
    background-color: white !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #000 !important;
  }
  
  .hero-card, .hero-card-compact {
    background: white !important;
    border: 2px solid var(--color-navy) !important;
    box-shadow: none !important;
  }
  
  .hero-title, .hero-subtitle {
    color: var(--color-navy) !important;
    text-shadow: none !important;
  }
}

/* === NUOVO SISTEMA COMUNICAZIONE LS N.C.C. === */

/* Floating Announcement Button */
.announcement-fab {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--color-accent) 0%, #0284c7 100%);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
  border: none;
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.announcement-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
}

.announcement-fab i {
  color: white;
  font-size: 20px;
}

/* Announcement Widget Popup */
.announcement-widget {
  position: fixed;
  bottom: 170px;
  right: 20px;
  width: 320px;
  max-width: calc(100vw - 40px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--color-gray-100);
  z-index: 99;
  transform: scale(0) translateY(20px);
  transform-origin: bottom right;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.announcement-widget.show {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.announcement-widget-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-gray-100);
  background: linear-gradient(135deg, var(--color-accent) 0%, #0284c7 100%);
  color: white;
  border-radius: 16px 16px 0 0;
}

.announcement-widget-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.announcement-widget-body {
  padding: 20px;
}

.announcement-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.announcement-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.announcement-textarea:focus {
  border-color: var(--color-accent);
}

.announcement-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.important-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-gray-700);
}

.important-checkbox input[type="checkbox"] {
  margin: 0;
}

.announcement-send-btn {
  padding: 8px 16px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.announcement-send-btn:hover {
  background: #0284c7;
}

.announcement-send-btn:disabled {
  background: var(--color-gray-300);
  cursor: not-allowed;
}

/* Recent Announcements in Widget */
.recent-announcements {
  margin-top: 16px;
  border-top: 1px solid var(--color-gray-100);
  padding-top: 16px;
}

.recent-announcements-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-gray-700);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.announcement-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-gray-50);
}

.announcement-item:last-child {
  border-bottom: none;
}

.announcement-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.announcement-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-navy);
}

.announcement-time {
  font-size: 11px;
  color: var(--color-gray-500);
}

.announcement-text {
  font-size: 13px;
  color: var(--color-gray-700);
  line-height: 1.4;
}

.announcement-important {
  background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
  border-left: 4px solid var(--color-warning);
  padding: 8px;
  border-radius: 6px;
  margin: 4px 0;
}

/* Modern Chat System */
.chat-system {
  display: flex;
  height: calc(100vh - 140px);
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.chat-sidebar {
  width: 280px;
  background: var(--color-gray-50);
  border-right: 1px solid var(--color-gray-200);
  display: flex;
  flex-direction: column;
}

.chat-sidebar-header {
  padding: 20px;
  background: white;
  border-bottom: 1px solid var(--color-gray-200);
}

.chat-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-gray-300);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-search:focus {
  border-color: var(--color-navy);
}

.conversations-list {
  flex: 1;
  overflow-y: auto;
}

.conversation-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--color-gray-100);
}

.conversation-item:hover {
  background: white;
}

.conversation-item.active {
  background: var(--color-navy);
  color: white;
}

.conversation-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-navy-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 13px;
  margin-right: 10px;
  flex-shrink: 0;
}

.conversation-item.active .conversation-avatar {
  background: rgba(255, 255, 255, 0.2);
}

.conversation-details {
  flex: 1;
  min-width: 0;
}

.conversation-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.conversation-preview {
  font-size: 13px;
  color: var(--color-gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-item.active .conversation-preview {
  color: rgba(255, 255, 255, 0.8);
}

.conversation-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.conversation-time {
  font-size: 12px;
  color: var(--color-gray-500);
}

.conversation-item.active .conversation-time {
  color: rgba(255, 255, 255, 0.8);
}

.conversation-unread {
  background: var(--color-accent);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}

/* Chat Main Area */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 20px 24px;
  background: white;
  border-bottom: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-participant-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-navy-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.chat-participant-info {
  flex: 1;
}

.chat-participant-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 2px;
}

.chat-participant-role {
  font-size: 13px;
  color: var(--color-gray-600);
}

.chat-messages {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  background: #fafbfc;
}

.message-group {
  margin-bottom: 20px;
}

.message-date-separator {
  text-align: center;
  margin: 20px 0;
  position: relative;
}

.message-date-separator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-gray-200);
}

.message-date-text {
  background: #fafbfc;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--color-gray-500);
  position: relative;
}

.message {
  display: flex;
  margin-bottom: 6px;
}

.message.sent {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
}

.message.received .message-bubble {
  background: white;
  color: var(--color-gray-900);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message.sent .message-bubble {
  background: var(--color-navy);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-time {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
  text-align: right;
}

.message.received .message-time {
  text-align: left;
}

/* Chat Composer */
.chat-composer {
  padding: 20px 24px;
  background: white;
  border-top: 1px solid var(--color-gray-200);
}

.composer-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.composer-input {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 10px 16px;
  border: 1px solid var(--color-gray-300);
  border-radius: 20px;
  font-size: 14px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.composer-input:focus {
  border-color: var(--color-navy);
}

.composer-send {
  width: 40px;
  height: 40px;
  background: var(--color-navy);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.composer-send:hover {
  background: var(--color-navy-2);
  transform: scale(1.05);
}

.composer-send i {
  font-size: 14px;
}

/* === MESSAGGI SISTEMA COMPLETO === */

/* Lista utenti per messaggi */
.user-item, .message-user-item {
  display: flex;
  align-items: center;
  padding: var(--space-4);
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: var(--space-3);
  border: 1px solid var(--color-gray-100);
}

.user-item:hover, .message-user-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-navy);
}

.user-avatar {
  margin-right: var(--space-3);
  flex-shrink: 0;
}

.user-avatar .avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--color-navy-2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: var(--space-1);
}

.user-role {
  font-size: var(--font-size-xs);
  color: var(--color-gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.user-preview {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  flex-shrink: 0;
}

.unread-badge {
  background: var(--color-danger);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xs);
  font-weight: 600;
  min-width: 20px;
}

/* Badge importante per messaggi */
.message-important-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--color-warning);
  color: white;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
  animation: pulse-important 2s infinite;
}

@keyframes pulse-important {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

.message-important-badge i {
  font-size: 10px;
}

.composer-send:hover {
  background: var(--color-navy-2);
}

.composer-send:disabled {
  background: var(--color-gray-300);
  cursor: not-allowed;
}

/* Empty Chat State */
.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--color-gray-600);
}

.chat-empty i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.chat-empty h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.chat-empty p {
  font-size: 14px;
  text-align: center;
  max-width: 300px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chat-system {
    height: calc(100vh - 120px);
  }
  
  .chat-sidebar {
    width: 100%;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .chat-sidebar.show {
    transform: translateX(0);
  }
  
  .announcement-widget {
    width: calc(100vw - 40px);
    right: 20px;
  }
  
  .announcement-fab {
    right: 20px;
    bottom: 80px;
  }
}

/* Online Status Indicators */
.online-status {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
  position: absolute;
  bottom: 2px;
  right: 2px;
  border: 2px solid white;
}

/* === NUOVO SISTEMA LISTA + DETTAGLIO (LS N.C.C.) === */

/* Contenitore principale messaggi */
.messages-container {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: var(--space-6);
}

/* Barra di ricerca utenti */
.search-bar {
  padding: var(--space-4) var(--space-6);
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
}

.search-input-container {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-600);
  font-size: var(--font-size-base);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) 2.5rem;
  border: 2px solid var(--color-gray-300);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  background: var(--color-white);
  transition: all 0.2s ease;
  outline: none;
}

.search-input:focus {
  border-color: var(--color-navy);
  box-shadow: 0 0 0 3px rgba(20, 34, 59, 0.1);
}

/* Lista utenti */
.users-list {
  min-height: 300px;
}

.user-item {
  display: flex;
  align-items: center;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-gray-100);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--color-white);
}

.user-item:hover {
  background: var(--color-gray-50);
}

.user-item:last-child {
  border-bottom: none;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-navy);
  color: var(--color-white);
  font-weight: 600;
  font-size: var(--font-size-base);
  margin-right: var(--space-4);
  flex-shrink: 0;
  position: relative;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 600;
  font-size: var(--font-size-lg);
  color: var(--color-gray-900);
  margin-bottom: var(--space-1);
}

.user-role {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  text-transform: capitalize;
}

.user-role.amministratore {
  color: var(--color-accent);
  font-weight: 500;
}

.user-role.autista {
  color: var(--color-success);
  font-weight: 500;
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.last-message-time {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
  white-space: nowrap;
}

/* Badge messaggi non letti per lista utenti */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-danger);
  color: var(--color-white);
  font-size: var(--font-size-xs);
  font-weight: 700;
  border-radius: 12px;
  min-width: 24px;
  height: 20px;
  padding: 0 var(--space-2);
  text-align: center;
}

.unread-badge.large {
  font-size: var(--font-size-sm);
  min-width: 28px;
  height: 24px;
  border-radius: 14px;
}

/* Stati di caricamento e vuoti */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-4);
  color: var(--color-gray-600);
}

.loading-state i {
  font-size: 2rem;
  margin-bottom: var(--space-4);
}

.users-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-4);
  color: var(--color-gray-600);
  text-align: center;
}

.users-empty-state i {
  font-size: 3rem;
  margin-bottom: var(--space-6);
  opacity: 0.5;
}

.users-empty-state h3 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--color-gray-700);
}

.users-empty-state p {
  font-size: var(--font-size-base);
  max-width: 300px;
  line-height: 1.5;
}

/* === SCHERMATA CONVERSAZIONE === */

/* Header conversazione */
.conversation-header {
  display: flex;
  align-items: center;
  padding: var(--space-5) var(--space-6);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-sm);
}

.back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--color-gray-100);
  border-radius: 50%;
  color: var(--color-gray-700);
  cursor: pointer;
  margin-right: var(--space-4);
  transition: all 0.2s ease;
  font-size: var(--font-size-base);
}

.back-button:hover {
  background: var(--color-gray-200);
  transform: scale(1.05);
}

.conversation-info {
  display: flex;
  align-items: center;
  flex: 1;
}

.conversation-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: var(--font-size-lg);
  margin-right: var(--space-4);
  box-shadow: var(--shadow-md);
}

.conversation-details {
  flex: 1;
}

.conversation-name {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 2px;
}

.conversation-role {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  font-weight: 500;
}

/* Area messaggi moderna */
.conversation-content {
  height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, #f8fafc 0%, #f1f5f9 100%);
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6) var(--space-4);
  scroll-behavior: smooth;
}

/* Gruppamento messaggi per data */
.message-date-group {
  margin-bottom: var(--space-8);
}

.date-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-6) 0;
}

.date-text {
  background: white;
  color: var(--color-gray-600);
  padding: var(--space-2) var(--space-4);
  border-radius: 20px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-200);
}

/* Bubble messaggi moderne */
.message-bubble {
  max-width: 75%;
  margin-bottom: var(--space-4);
  position: relative;
}

.message-content {
  padding: var(--space-4) var(--space-5);
  border-radius: 20px;
  font-size: var(--font-size-base);
  line-height: 1.5;
  word-wrap: break-word;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.message-sent .message-content {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
  color: white;
  margin-left: 25%;
  border-bottom-right-radius: 8px;
}

.message-received .message-content {
  background: white;
  color: var(--color-gray-900);
  margin-right: 25%;
  border-bottom-left-radius: 8px;
  border: 1px solid var(--color-gray-200);
}

.message-time {
  font-size: var(--font-size-xs);
  margin-top: var(--space-2);
  text-align: right;
  opacity: 0.8;
}

.message-sent .message-time {
  color: rgba(255, 255, 255, 0.8);
}

.message-received .message-time {
  color: var(--color-gray-500);
}

/* Input area moderna */
.message-input-area {
  background: white;
  border-top: 1px solid var(--color-gray-200);
  padding: var(--space-4) var(--space-6);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.message-form {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
}

.message-input-container {
  flex: 1;
  position: relative;
}

.message-input {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  padding: var(--space-3) var(--space-5);
  border: 2px solid var(--color-gray-300);
  border-radius: 22px;
  resize: none;
  outline: none;
  font-size: var(--font-size-base);
  line-height: 1.4;
  transition: all 0.2s ease;
  background: var(--color-gray-50);
}

.message-input:focus {
  border-color: var(--color-navy);
  background: white;
  box-shadow: 0 0 0 3px rgba(20, 34, 59, 0.1);
}

.send-button {
  width: 44px;
  height: 44px;
  border: none;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-base);
  box-shadow: var(--shadow-md);
}

.send-button:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.send-button:active {
  transform: scale(0.95);
}

/* Link nei messaggi */
.message-link {
  color: inherit;
  text-decoration: underline;
  opacity: 0.9;
}

.message-sent .message-link {
  color: rgba(255, 255, 255, 0.9);
}

.message-received .message-link {
  color: var(--color-navy);
}

/* Stato vuoto conversazione */
.empty-conversation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-gray-600);
  text-align: center;
  padding: var(--space-12);
}

.empty-conversation i {
  font-size: 4rem;
  margin-bottom: var(--space-6);
  opacity: 0.3;
  color: var(--color-navy);
}

.empty-conversation h3 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--color-gray-700);
}

.empty-conversation p {
  font-size: var(--font-size-base);
  max-width: 280px;
  line-height: 1.5;
}

/* Loading messaggi */
.loading-messages {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-gray-600);
  gap: var(--space-4);
}

.loading-messages i {
  font-size: 2rem;
  color: var(--color-navy);
}

/* Animazioni moderne */
.message-bubble {
  animation: slideInMessage 0.3s ease-out;
}

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

/* Responsive migliorato */
@media (max-width: 768px) {
  .conversation-header {
    padding: var(--space-4) var(--space-4);
  }
  
  .conversation-content {
    height: calc(100vh - 140px);
  }
  
  .messages-area {
    padding: var(--space-4) var(--space-3);
  }
  
  .message-content {
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-sm);
  }
  
  .message-input-area {
    padding: var(--space-3) var(--space-4);
  }
  
  .message-input {
    min-height: 40px;
    padding: var(--space-2) var(--space-4);
  }
  
  .send-button {
    width: 40px;
    height: 40px;
  }
}

.back-button:hover {
  background: var(--color-gray-200);
  color: var(--color-navy);
}

/* === TOAST NOTIFICATIONS ANIMATIONS === */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* === USER DETAILS MODAL === */
.user-details-modal .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.user-details-content {
  position: relative;
  background: white;
  border-radius: 16px;
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

.user-details-header {
  text-align: center;
  padding: 32px 24px 20px;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
  color: white;
  border-radius: 16px 16px 0 0;
  position: relative;
}

.close-modal-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.close-modal-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.user-details-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.avatar-initials-large {
  font-size: 32px;
  font-weight: 700;
  color: white;
}

.user-details-name {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-details-body {
  padding: 24px;
}

.detail-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-gray-100);
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-icon {
  width: 20px;
  text-align: center;
  margin-right: 16px;
  color: var(--color-gray-600);
  flex-shrink: 0;
}

.detail-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-content label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-gray-500);
}

.detail-content span {
  font-size: 16px;
  color: var(--color-gray-900);
  font-weight: 500;
}

.text-mono {
  font-family: 'Courier New', monospace;
  font-size: 14px !important;
  background: var(--color-gray-100);
  padding: 4px 8px;
  border-radius: 4px;
}

.user-details-footer {
  padding: 20px 24px;
  text-align: center;
  border-top: 1px solid var(--color-gray-100);
}

/* Avatar clickable style */
.clickable-profile {
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.clickable-profile:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.clickable-profile::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.clickable-profile:hover::after {
  opacity: 0.7;
}

/* === DASHBOARD CARDS OTTIMIZZATE === */

.dashboard-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

/* Card principale In Servizio */
.dashboard-main-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-gray-200);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dashboard-main-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-card-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--color-gray-800);
}

.dashboard-card-content {
  text-align: center;
}

.big-number {
  font-size: 32px;
  font-weight: bold;
  color: var(--color-navy);
  margin-bottom: 8px;
}

.card-description {
  font-size: 14px;
  color: var(--color-gray-600);
}

/* Card doppia Ore + Anomalie */
.dashboard-dual-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-gray-200);
  display: flex;
  align-items: center;
}

.dual-card-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dual-card-divider {
  width: 1px;
  height: 40px;
  background: var(--color-gray-200);
  margin: 0 16px;
}

.dual-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--color-gray-50);
}

.dual-content {
  flex: 1;
}

.dual-number {
  font-size: 20px;
  font-weight: bold;
  color: var(--color-navy);
  margin-bottom: 2px;
}

.dual-label {
  font-size: 12px;
  color: var(--color-gray-600);
}

/* Cards azioni */
.dashboard-action-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-gray-200);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dashboard-action-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.dashboard-action-card .dashboard-card-header {
  margin-bottom: 12px;
}

.dashboard-action-card .dashboard-card-header h3 {
  font-size: 15px;
}

.action-description {
  font-size: 13px;
  color: var(--color-gray-600);
  margin-bottom: 12px;
}

.action-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
}

/* Responsive per tablet/desktop */
@media (min-width: 768px) {
  .dashboard-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  
  .dashboard-main-card {
    grid-column: 1 / -1;
  }
}

.conversation-user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-navy);
  color: var(--color-white);
  font-weight: 600;
  font-size: var(--font-size-base);
  margin-right: var(--space-4);
  flex-shrink: 0;
}

.conversation-user-info {
  flex: 1;
}

.conversation-user-name {
  font-weight: 600;
  font-size: var(--font-size-lg);
  color: var(--color-gray-900);
  margin-bottom: var(--space-1);
}

.conversation-user-role {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  text-transform: capitalize;
}

/* Area messaggi conversazione */
.conversation-messages {
  flex: 1;
  padding: var(--space-6);
  overflow-y: auto;
  background: #f8fafc;
  max-height: calc(100vh - 300px);
}

.conversation-messages-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Messaggi individuali */
.conversation-message {
  display: flex;
  max-width: 85%;
}

.conversation-message.sent {
  align-self: flex-end;
  justify-content: flex-end;
}

.conversation-message.received {
  align-self: flex-start;
  justify-content: flex-start;
}

.conversation-message-bubble {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  line-height: 1.5;
  word-wrap: break-word;
  position: relative;
}

.conversation-message.sent .conversation-message-bubble {
  background: var(--color-navy);
  color: var(--color-white);
  border-bottom-right-radius: var(--space-2);
}

.conversation-message.received .conversation-message-bubble {
  background: var(--color-white);
  color: var(--color-gray-900);
  border-bottom-left-radius: var(--space-2);
  box-shadow: var(--shadow-sm);
}

.conversation-message-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
  font-size: var(--font-size-xs);
}

.conversation-message.sent .conversation-message-meta {
  justify-content: flex-end;
  color: rgba(255, 255, 255, 0.8);
}

.conversation-message.received .conversation-message-meta {
  justify-content: flex-start;
  color: var(--color-gray-600);
}

/* Composer per nuovi messaggi */
.conversation-composer {
  padding: var(--space-5) var(--space-6);
  background: var(--color-white);
  border-top: 1px solid var(--color-gray-200);
}

.composer-container {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
}

.composer-input-container {
  flex: 1;
  position: relative;
}

.composer-textarea {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--color-gray-300);
  border-radius: 22px;
  font-size: var(--font-size-base);
  resize: none;
  outline: none;
  font-family: inherit;
  line-height: 1.4;
  transition: border-color 0.2s ease;
}

.composer-textarea:focus {
  border-color: var(--color-navy);
  box-shadow: 0 0 0 3px rgba(20, 34, 59, 0.1);
}

.composer-send-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--color-navy);
  border: none;
  border-radius: 50%;
  color: var(--color-white);
  cursor: pointer;
  font-size: var(--font-size-base);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.composer-send-button:hover {
  background: var(--color-navy-2);
  transform: scale(1.05);
}

.composer-send-button:disabled {
  background: var(--color-gray-300);
  cursor: not-allowed;
  transform: none;
}

.composer-send-button:disabled:hover {
  background: var(--color-gray-300);
  transform: none;
}

/* Stato vuoto conversazione */
.conversation-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-4);
  color: var(--color-gray-600);
  text-align: center;
}

.conversation-empty i {
  font-size: 3rem;
  margin-bottom: var(--space-6);
  opacity: 0.5;
}

.conversation-empty h3 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--color-gray-700);
}

.conversation-empty p {
  font-size: var(--font-size-base);
  max-width: 300px;
  line-height: 1.5;
}

/* Responsive per dispositivi mobili */
@media (max-width: 768px) {
  .search-bar {
    padding: var(--space-3) var(--space-4);
  }
  
  .user-item {
    padding: var(--space-4) var(--space-4);
  }
  
  .user-avatar {
    width: 44px;
    height: 44px;
    margin-right: var(--space-3);
  }
  
  .conversation-header {
    padding: var(--space-4) var(--space-4);
  }
  
  .conversation-messages {
    padding: var(--space-4);
    max-height: calc(100vh - 280px);
  }
  
  .conversation-composer {
    padding: var(--space-4) var(--space-4);
  }
  
  .conversation-message {
    max-width: 90%;
  }
}

/* Animazioni specifiche per il sistema messaggi */
.user-item {
  animation: slideInUp 0.3s ease-out forwards;
}

.user-item:nth-child(1) { animation-delay: 0.05s; }
.user-item:nth-child(2) { animation-delay: 0.1s; }
.user-item:nth-child(3) { animation-delay: 0.15s; }
.user-item:nth-child(4) { animation-delay: 0.2s; }
.user-item:nth-child(5) { animation-delay: 0.25s; }

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

.conversation-message {
  animation: fadeInMessage 0.3s ease-out;
}

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

/* Filtro ricerca attivo */
.search-active .user-item {
  display: none;
}

.search-active .user-item.match {
  display: flex;
}

/* ==============================================
   FASE 2A - CALENDARIO MENSILE STYLES
============================================== */

.calendar-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-navy);
  margin: 0;
}

.calendar-nav-btn {
  background: var(--color-accent);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-nav-btn:hover {
  background: var(--color-accent-dark);
  transform: scale(1.05);
}

.calendar-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 20px;
  padding: 12px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-gray-700);
}

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

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: white;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-day-header {
  text-align: center;
  font-weight: 600;
  font-size: 11px;
  color: var(--color-gray-600);
  padding: 8px 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  height: 20px;
}

.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  min-height: 36px;
  height: 36px;
  position: relative;
}

.calendar-day:not(.empty):hover {
  background: var(--color-gray-50);
  border-color: var(--color-accent);
  transform: scale(1.02);
}

.calendar-day.empty {
  cursor: default;
  opacity: 0;
}

.day-number {
  font-weight: 500;
  color: var(--color-gray-800);
  font-size: 13px;
  margin: 0;
  line-height: 1;
}

.day-status {
  position: absolute;
  bottom: 2px;
  right: 2px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.status-indicator.loading {
  background: var(--color-gray-300);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-indicator.bg-green-500 {
  background: #10b981;
}

.status-indicator.bg-yellow-500 {
  background: #f59e0b;
}

.status-indicator.bg-red-500 {
  background: #ef4444;
}

.status-indicator.bg-gray-300 {
  background: #d1d5db;
}

/* Dettagli giorno */
.day-details {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.day-details:not(.hidden) {
  transform: translateX(0);
}

.details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: var(--color-navy);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.details-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.details-content {
  padding: 20px;
}

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

.details-section h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-navy);
  display: flex;
  align-items: center;
}

.details-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--color-gray-50);
  border-radius: 8px;
  border-left: 4px solid var(--color-gray-300);
}

.detail-item.anomaly {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.detail-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.detail-content {
  flex: 1;
}

.detail-title {
  font-weight: 600;
  color: var(--color-gray-800);
  font-size: 14px;
  margin-bottom: 2px;
}

.detail-time {
  font-size: 13px;
  color: var(--color-gray-600);
  margin-bottom: 4px;
}

.detail-note {
  font-size: 12px;
  color: var(--color-gray-500);
  font-style: italic;
}

.detail-description {
  font-size: 13px;
  color: var(--color-gray-600);
  margin-bottom: 4px;
}

.detail-status {
  font-size: 12px;
  font-weight: 500;
}

.detail-status.resolved {
  color: #10b981;
}

.detail-status.pending {
  color: #f59e0b;
}

/* Responsive mobile */
@media (max-width: 768px) {
  .calendar-header {
    padding: 12px;
  }
  
  .calendar-title {
    font-size: 18px;
  }
  
  .calendar-nav-btn {
    width: 36px;
    height: 36px;
  }
  
  .calendar-legend {
    gap: 12px;
    padding: 8px;
  }
  
  .legend-item {
    font-size: 12px;
  }
  
  .calendar-grid {
    padding: 12px;
    gap: 1px;
  }
  
  .calendar-day {
    min-height: 32px;
    height: 32px;
    padding: 4px 1px;
  }
  
  .day-number {
    font-size: 11px;
  }
  
  .status-indicator {
    width: 6px;
    height: 6px;
  }
  
  .day-details {
    width: 100%;
    left: 0;
    transform: translateY(100%);
  }
  
  .day-details:not(.hidden) {
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ==============================================
   FASE 2B - GESTIONE PROFILI STYLES
============================================== */

.profiles-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.profiles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profiles-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-navy);
  margin: 0;
  display: flex;
  align-items: center;
}

/* Filtri e ricerca */
.profiles-filters {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-container {
  position: relative;
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  background: white;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
  pointer-events: none;
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--color-gray-100);
  border: 1px solid var(--color-gray-200);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  color: var(--color-gray-700);
}

.filter-btn:hover {
  background: var(--color-gray-200);
}

.filter-btn.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

.count {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
}

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

/* Lista utenti */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.user-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-gray-200);
  transition: all 0.2s ease;
}

.user-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.user-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.user-actions {
  display: flex;
  gap: 4px;
}

.action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: var(--color-gray-100);
  color: var(--color-gray-600);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  background: var(--color-gray-200);
}

.action-btn.edit-user:hover {
  background: #dbeafe;
  color: #2563eb;
}

.action-btn.delete-user:hover {
  background: #fee2e2;
  color: #dc2626;
}

.user-card-content {
  text-align: left;
}

.user-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-navy);
  margin: 0 0 4px 0;
}

.user-email {
  color: var(--color-gray-600);
  margin: 0 0 12px 0;
  font-size: 14px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.user-role, .user-status {
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.user-role {
  color: var(--color-gray-700);
}

.user-status {
  font-size: 12px;
}

.status-active {
  color: #059669;
}

.status-inactive {
  color: #dc2626;
}

.user-notes {
  background: var(--color-gray-50);
  padding: 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--color-gray-600);
  margin-bottom: 8px;
  font-style: italic;
}

.user-dates {
  border-top: 1px solid var(--color-gray-200);
  padding-top: 8px;
}

/* Modal utente */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--color-navy);
  color: white;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: var(--color-navy);
  margin-bottom: 4px;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 2px solid var(--color-gray-200);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.password-input-container {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--color-gray-500);
  cursor: pointer;
  padding: 4px;
}

.form-help {
  font-size: 12px;
  color: var(--color-gray-500);
  margin-top: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px;
  background: var(--color-gray-50);
  border-top: 1px solid var(--color-gray-200);
}

/* Stati loading/error/empty */
.loading-state,
.error-state,
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-gray-600);
}

.loading-state i,
.error-state i,
.empty-state i {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}

.error-state i {
  color: #ef4444;
}

/* Responsive */
@media (max-width: 768px) {
  .profiles-header {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    text-align: center;
  }
  
  .profiles-title {
    justify-content: center;
    font-size: 24px;
  }
  
  .filter-buttons {
    justify-content: center;
  }
  
  .users-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    margin: 10px;
    max-height: 95vh;
  }
  
  .modal-footer {
    flex-direction: column-reverse;
  }
}

/* ==============================================
   FASE 2B - GESTIONE PROFILI STYLES
============================================== */

.profiles-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 80px 16px; /* Bottom padding for nav */
}

.profiles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profiles-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-navy);
  margin: 0;
  display: flex;
  align-items: center;
}

.profiles-filters {
  margin-bottom: 20px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-container {
  position: relative;
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  border: 1px solid var(--color-gray-300);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-500);
  font-size: 14px;
}

.filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border: 1px solid var(--color-gray-300);
  background: white;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-gray-700);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}

.filter-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.filter-btn.active {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.filter-btn .count {
  background: rgba(0, 0, 0, 0.1);
  color: inherit;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 12px;
  margin-left: 6px;
}

.filter-btn.active .count {
  background: rgba(255, 255, 255, 0.2);
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--color-gray-200);
  transition: all 0.2s ease;
}

.user-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-initials {
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-main {
  margin-bottom: 6px;
}

.user-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-gray-800);
  margin: 0 0 2px 0;
}

.user-email {
  font-size: 14px;
  color: var(--color-gray-600);
  margin: 0;
}

.user-details {
  display: flex;
  gap: 20px;
  font-size: 13px;
}

.user-role,
.user-status {
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.action-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

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

.edit-btn:hover {
  background: var(--color-accent-dark);
}

.delete-btn {
  background: #ef4444;
  color: white;
}

.delete-btn:hover {
  background: #dc2626;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.pagination-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-gray-300);
  background: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

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

.page-info {
  font-size: 14px;
  color: var(--color-gray-600);
  font-weight: 500;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: var(--color-navy);
  color: white;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: var(--color-gray-700);
  margin-bottom: 6px;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-gray-300);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

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

.password-input-container {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-gray-500);
  cursor: pointer;
  padding: 4px;
}

.form-help {
  font-size: 12px;
  color: var(--color-gray-500);
  margin-top: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px;
  background: var(--color-gray-50);
  border-radius: 0 0 12px 12px;
}

/* Stati vuoti ed errore */
.loading-state,
.empty-state,
.error-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-gray-500);
}

.loading-state i,
.empty-state i,
.error-state i {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.error-state i {
  color: #ef4444;
}

.error-state p {
  color: var(--color-gray-700);
  margin-bottom: 16px;
}

/* Responsive mobile */
@media (max-width: 768px) {
  .profiles-header {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .profiles-title {
    font-size: 20px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .user-card {
    padding: 12px;
    gap: 12px;
  }
  
  .user-avatar {
    width: 40px;
    height: 40px;
  }
  
  .avatar-initials {
    font-size: 14px;
  }
  
  .user-details {
    flex-direction: column;
    gap: 4px;
  }
  
  .filter-buttons {
    justify-content: center;
  }
  
  .modal-content {
    width: 95%;
  }
}

/* ==============================================
   FASE 2C - PANNELLO IMPOSTAZIONI ADMIN STYLES
============================================== */

.settings-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-navy);
  margin: 0;
  display: flex;
  align-items: center;
}

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

/* Tabs navigazione */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: white;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

.settings-tab {
  background: transparent;
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-gray-700);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.settings-tab:hover {
  background: var(--color-gray-100);
}

.settings-tab.active {
  background: var(--color-accent);
  color: white;
}

/* Contenuto tabs */
.settings-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.settings-tab-content {
  display: none;
  padding: 24px;
}

.settings-tab-content.active {
  display: block;
}

.settings-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-gray-200);
}

.settings-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.settings-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-navy);
  margin: 0 0 16px 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: var(--color-navy);
  margin-bottom: 6px;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--color-gray-200);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Toggle switches */
.settings-toggles {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-toggle {
  display: flex;
  align-items: center;
}

.setting-toggle label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
  color: var(--color-gray-700);
}

.setting-toggle input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 24px;
  background: var(--color-gray-300);
  border-radius: 12px;
  margin-right: 12px;
  transition: background 0.2s ease;
}

.toggle-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.setting-toggle input[type="checkbox"]:checked + .toggle-switch {
  background: var(--color-accent);
}

.setting-toggle input[type="checkbox"]:checked + .toggle-switch::before {
  transform: translateX(24px);
}

/* Action buttons groups */
.admin-actions,
.backup-actions,
.maintenance-actions,
.debug-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* System info */
.system-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  background: var(--color-gray-50);
  padding: 16px;
  border-radius: 8px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.info-label {
  font-weight: 500;
  color: var(--color-gray-600);
}

.info-value {
  font-weight: 600;
  color: var(--color-navy);
}

/* Storage statistics */
.storage-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  background: var(--color-gray-50);
  padding: 16px;
  border-radius: 8px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-gray-700);
}

.stat-item i {
  font-size: 18px;
}

.stat-item strong {
  color: var(--color-navy);
}

/* Responsive design */
@media (max-width: 768px) {
  .settings-header {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    text-align: center;
  }
  
  .settings-title {
    justify-content: center;
    font-size: 24px;
  }
  
  .settings-actions {
    justify-content: center;
  }
  
  .settings-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  .system-info {
    grid-template-columns: 1fr;
  }
  
  .storage-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .admin-actions,
  .backup-actions,
  .maintenance-actions,
  .debug-actions {
    flex-direction: column;
  }
  
  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .storage-stats {
    grid-template-columns: 1fr;
  }
  
  .settings-tab {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .settings-tab-content {
    padding: 16px;
  }
}

/* ==============================================
   FASE 2C - PANNELLO IMPOSTAZIONI STYLES
============================================== */

.settings-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px 80px 16px; /* Bottom padding for nav */
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-navy);
  margin: 0;
  display: flex;
  align-items: center;
}

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

.settings-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
}

.section-header i {
  font-size: 20px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-navy);
  margin: 0;
}

.section-content {
  padding: 20px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-gray-100);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-info {
  flex: 1;
  margin-right: 20px;
}

.setting-info label {
  font-weight: 600;
  color: var(--color-gray-800) !important;
  font-size: 15px;
  display: block;
  margin-bottom: 4px;
}

/* Forza colore del testo nelle impostazioni per risolvere problemi di visibilità */
.settings-section label,
.setting-toggle label,
.settings-toggles label {
  color: var(--color-gray-800) !important;
}

.settings-section .setting-toggle span {
  color: var(--color-gray-800) !important;
}

.setting-description {
  font-size: 13px;
  color: var(--color-gray-600) !important;
  margin: 0;
  line-height: 1.4;
}

.setting-input {
  width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--color-gray-300);
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.setting-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.setting-input.setting-changed {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.setting-toggle {
  position: relative;
  width: 50px;
  height: 26px;
}

.setting-toggle input[type="checkbox"] {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-label {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-gray-400);
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-label:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-label {
  background-color: var(--color-accent);
}

input:checked + .toggle-label:before {
  transform: translateX(24px);
}

.system-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-gray-50);
  padding: 16px;
  border-radius: 8px;
  width: 280px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.info-label {
  color: var(--color-gray-600);
  font-weight: 500;
}

.info-value {
  color: var(--color-gray-800);
  font-weight: 600;
}

.btn-warning {
  background: #f59e0b;
  color: white;
  border: 1px solid #f59e0b;
}

.btn-warning:hover {
  background: #d97706;
  border-color: #d97706;
}

.btn-danger {
  background: #ef4444;
  color: white;
  border: 1px solid #ef4444;
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-outline.btn-warning {
  background: transparent;
  color: #f59e0b;
  border: 1px solid #f59e0b;
}

.btn-outline.btn-warning:hover {
  background: #f59e0b;
  color: white;
}

.btn-outline.btn-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
}

.btn-outline.btn-danger:hover {
  background: #ef4444;
  color: white;
}

/* Responsive mobile */
@media (max-width: 768px) {
  .settings-header {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .settings-title {
    font-size: 20px;
  }
  
  .setting-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .setting-info {
    margin-right: 0;
    width: 100%;
  }
  
  .setting-input {
    width: 100%;
  }
  
  .system-info {
    width: 100%;
  }
  
  .section-header {
    padding: 16px;
  }
  
  .section-content {
    padding: 16px;
  }
}

/* Test update persistenza sessioni - Tue Sep 30 22:03:30 UTC 2025 */
