/* =================================
   NUOVO DESIGN DASHBOARD MODERNA
   ================================= */

:root {
  /* Color System */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-500: #22c55e;
  --success-600: #16a34a;
  
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  
  --error-50: #fef2f2;
  --error-100: #fee2e2;
  --error-200: #fecaca;
  --error-300: #fca5a5;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --error-700: #b91c1c;
  
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Additional palette */
  --blue-500: #3b82f6; /* Tailwind blue-500 */
  --red-500: #ef4444;  /* Tailwind red-500 */
  --green-500: #22c55e; /* Tailwind green-500 */
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --gray-25: #fcfcfd;

  /* Radius extras */
  --radius-full: 9999px;
  --radius-xl: 20px;
  
  /* Spacing System */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  
  /* Typography */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  
  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

/* =================================
   LAYOUT SYSTEM
   ================================= */

.dashboard-container {
  width: 100%;
  margin: 0 auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =================================
   HEADER
   ================================= */

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding: var(--space-4) 0;
  border-bottom: 2px solid var(--primary-500);
}

.dashboard-title {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* iCarry Logo Styles */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--space-2);
}

.dashboard-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  transition: transform 0.2s ease;
}

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

.dashboard-title h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--gray-900);
}

.dashboard-title .badge {
  background: var(--primary-500);
  color: white;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

/* 🎯 Cluster Selector Styles */
.cluster-selector {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cluster-label {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
}

.cluster-dropdown {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: white;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-900);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.cluster-dropdown:hover {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.cluster-dropdown:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.cluster-dropdown:disabled {
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
  opacity: 0.7;
}

.cluster-selector.switching {
  background: var(--warning-50);
  border-color: var(--warning-300);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
  animation: clusterSwitchPulse 1.5s ease-in-out infinite;
}

@keyframes clusterSwitchPulse {
  0%, 100% { 
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
  }
  50% { 
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.2);
  }
}

.cluster-status {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--gray-600);
  transition: all 0.3s ease;
}

.cluster-status i {
  color: var(--success-500);
  animation: pulse 2s infinite;
  transition: color 0.3s ease;
}

.cluster-status.switching i {
  color: var(--warning-500);
  animation: clusterStatusPulse 1s ease-in-out infinite;
}

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

@keyframes clusterStatusPulse {
  0%, 100% { 
    opacity: 1;
    transform: scale(1);
  }
  50% { 
    opacity: 0.6;
    transform: scale(1.2);
  }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* 🕐 COUNTDOWN TIMER STYLES */
.countdown-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  min-width: 200px;
}

.countdown-timer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--gray-600);
}

.countdown-timer i {
  color: var(--primary-500);
  animation: tick 1s linear infinite;
}

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

.countdown-text {
  font-weight: 500;
}

.countdown-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--primary-600);
  font-size: var(--text-sm);
  min-width: 45px;
  text-align: center;
}

.countdown-progress {
  width: 100%;
  height: 3px;
  background: var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
  border-radius: var(--radius-sm);
  transition: width 1s linear;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.refresh-btn {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.refresh-btn:hover {
  background: var(--gray-200);
  border-color: var(--gray-400);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--gray-600);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-500);
  animation: pulse 2s infinite;
}

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

/* =================================
   STATS GRID
   ================================= */

.stats-section {
  margin-bottom: var(--space-2);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
}

.stat-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  position: relative;
  transition: all 0.2s;
}

.stat-card:hover {
  border-color: var(--primary-300);
  transform: translateY(-1px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.available::before {
  background: var(--success-500);
}

.stat-card.active::before {
  background: var(--primary-500);
}

.stat-card.total::before {
  background: var(--warning-500);
}

.stat-card.late::before {
  background: var(--error-500);
}

.stat-card.performance::before {
  background: var(--gray-500);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-1);
}

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

.stat-icon {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 8px;
}

.stat-card.available .stat-icon {
  background: var(--success-100);
  color: var(--success-600);
}

.stat-card.active .stat-icon {
  background: var(--primary-100);
  color: var(--primary-600);
}

.stat-card.total .stat-icon {
  background: var(--warning-100);
  color: var(--warning-600);
}

.stat-card.late .stat-icon {
  background: var(--error-100);
  color: var(--error-600);
}

.stat-card.performance .stat-icon {
  background: var(--gray-100);
  color: var(--gray-600);
}

.stat-number {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0;
}

.stat-trend {
  font-size: 10px;
  color: var(--gray-500);
  line-height: 1.2;
}

/* 🕐 Stile per card ritardo quando ci sono consegne in ritardo */
.stat-card.late.has-late {
  border-color: var(--error-300);
  background: linear-gradient(135deg, #fff 0%, rgba(239, 68, 68, 0.03) 100%);
  animation: pulse-late 2s ease-in-out infinite;
}

.stat-card.late.has-late .stat-number {
  color: var(--error-600);
  font-weight: 700;
}

.stat-card.late.has-late .stat-icon {
  background: var(--error-200);
  color: var(--error-700);
  animation: pulse-icon-late 1.5s ease-in-out infinite;
}

@keyframes pulse-late {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.3);
  }
}

@keyframes pulse-icon-late {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

/* =================================
   MAIN CONTENT GRID
   ================================= */

.split-screen-container {
  display: flex;
  gap: var(--space-4);
  flex: 1; /* Take remaining height below header + stats */
  min-height: 0; /* Allow children to shrink and scroll */
  margin-bottom: 0;
}

.split-panel {
  flex: 1;
  min-height: 0; /* Enable proper flexbox scrolling */
  display: flex;
  flex-direction: column;
  min-width: 0; /* Prevents flex items from overflowing */
}

.left-panel {
  flex: 0 0 50%;
}

.right-panel {
  flex: 0 0 50%;
}

.full-height {
  height: 100%;
  display: flex;
  flex-direction: column;
  flex: 1; /* stretch within split-panel */
  min-height: 0; /* allow inner scroll areas */
}

.full-height .card-body {
  flex: 1;
  min-height: 0; /* allow internal scroll areas */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.content-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.card-controls {
  display: flex;
  gap: var(--space-2);
}

.icon-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: var(--text-sm);
  color: var(--gray-600);
}

.icon-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

/* Active state for toggleable icon buttons */
.icon-btn.active {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
}

.card-body {
  /* Allow flexible layouts to control size without overrides */
  max-height: none;
  overflow: visible;
}

/* =================================
   TABLES
   ================================= */

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

/* Compact table mode to fit all columns without horizontal scroll */
.data-table.compact {
  table-layout: fixed;
}

.data-table.compact th,
.data-table.compact td {
  padding: var(--space-2) var(--space-3);
  /* Keep text readable: slightly reduced but not tiny */
  font-size: 0.9rem;
}

.data-table.compact th,
.data-table.compact td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Allow richer content in the last column */
.data-table.compact th:nth-child(5),
.data-table.compact td:nth-child(5) {
  white-space: normal;
  overflow: visible;
}

/* Avoid horizontal overflow inside the assigned stores column when compact */
.data-table.compact td:nth-child(5) .store-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.data-table.compact td:nth-child(5) .store-name {
  flex: 1 1 auto;
  min-width: 0;
}

.data-table.compact td:nth-child(5) .delivery-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  row-gap: 4px;
}

.data-table.compact td:nth-child(5) .delivery-badge {
  padding: 2px 6px;
  font-size: 0.75rem;
}

.data-table.compact td:nth-child(5) .store-details {
  gap: 2px;
}

.data-table.compact td:nth-child(5) .store-address,
.data-table.compact td:nth-child(5) .address-text {
  white-space: normal !important;
  max-width: none !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.data-table.compact td:nth-child(5) .time-slot-info {
  flex-wrap: wrap;
}

.data-table.compact td:nth-child(5) .assignment-item {
  padding: var(--space-2);
}

/* Reduce oversized numeric counters in compact mode */
.data-table.compact .numeric-value.delivery-count {
  font-size: 1.1em;
}

/* Wide-left layout to mimic ~67% zoom without shrinking fonts */
.split-screen-container.wide-left .left-panel {
  flex: 2 1 66.666%;
}

.split-screen-container.wide-left .right-panel {
  flex: 1 1 33.333%;
  min-width: 420px; /* keep map usable */
}

/* Smooth layout transition */
.split-screen-container .split-panel {
  transition: flex-basis 160ms ease, flex-grow 160ms ease;
}

.data-table th {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  border-bottom: 1px solid var(--gray-100);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--gray-800);
  vertical-align: top;
}

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

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

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: capitalize;
}

.status-badge.online {
  background: var(--success-100);
  color: var(--success-700);
}

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

.status-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  margin-right: var(--space-2);
}

/* =================================
   LAST ACCESS STYLES
   ================================= */
.last-access {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all 0.2s ease;
}

.last-access.recent-access {
  background: var(--success-50);
  color: var(--success-700);
  border: 1px solid var(--success-200);
}

.last-access.recent-access i {
  color: var(--success-500);
}

.last-access.old-access {
  background: var(--gray-50);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

.last-access.old-access i {
  color: var(--gray-400);
}

.access-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  letter-spacing: -0.025em;
}

/* Responsive per Last Access */
@media (max-width: 768px) {
  .last-access {
    flex-direction: column;
    text-align: center;
    padding: var(--space-1) var(--space-2);
  }
  
  .access-time {
    margin-top: var(--space-1);
    font-size: 0.65rem;
  }
}

/* Modern Search Styles */
.modern-search-container {
    margin-bottom: var(--space-2);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.search-icon {
    padding: 0 var(--space-4);
    color: var(--gray-400);
    font-size: var(--text-sm);
    transition: color 0.3s ease;
}

.search-input-wrapper:focus-within .search-icon {
    color: var(--primary-500);
}

.modern-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: var(--space-3) var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-900);
    background: transparent;
}

.modern-search-input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.search-clear-btn {
    padding: var(--space-2);
    margin-right: var(--space-2);
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius-md);
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
    transform: scale(0.8);
}

.search-clear-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.search-clear-btn.visible {
    opacity: 1;
    transform: scale(1);
}

.search-results-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: var(--primary-50);
    color: var(--primary-700);
    border: 1px solid var(--primary-200);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    margin-top: var(--space-2);
}

/* Table Container Specific Styles for Split Layout */
#bellhops-table-container {
    flex: 1;
    /* Allow vertical scrolling, avoid horizontal scrollbar (auto-fit logic will ensure width fits) */
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Inherit flex height from card-body */
}

/* Map Container Styles for Split Layout */
#delivery-map {
    flex: 1 !important;
    height: auto !important;
    min-height: 0; /* Fill remaining space within card-body */
}

/* =================================
   SORTABLE TABLE STYLES
   ================================= */
.sortable-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: all 0.2s ease;
}

.sortable-table th.sortable:hover {
  background: var(--gray-50);
  color: var(--primary-600);
}

.sortable-table th.sortable.sort-active {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
}

.sort-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: var(--space-2);
  opacity: 0.6;
  transition: all 0.2s ease;
}

.sortable:hover .sort-indicator {
  opacity: 1;
}

.sortable.sort-active .sort-indicator {
  opacity: 1;
}

.sort-indicator i {
  font-size: var(--text-xs);
  transition: color 0.2s ease;
}

/* Stati di sorting */
.sortable .sort-indicator i.fa-sort {
  color: var(--gray-400);
}

.sortable .sort-indicator i.fa-sort-up {
  color: var(--primary-500);
}

.sortable .sort-indicator i.fa-sort-down {
  color: var(--primary-500);
}

/* Responsive per sorting */
@media (max-width: 768px) {
  .sort-indicator {
    margin-left: var(--space-1);
  }
  
  .sort-indicator i {
    font-size: 0.65rem;
  }
}

/* Numeric values */
.numeric-value {
  display: inline-block;
  min-width: 40px;
  text-align: center;
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: 500;
}

.numeric-value.positive {
  color: var(--success-600);
  background: var(--success-50);
}

.numeric-value.zero {
  color: var(--gray-500);
  background: var(--gray-50);
}

.numeric-value.available-deliveries {
  color: #1e40af !important; /* Blu intenso */
  background: #dbeafe !important; /* Blu chiaro */
  font-weight: bold;
}

.numeric-value.active-deliveries {
  color: #dc2626 !important; /* Rosso intenso */
  background: #fef2f2 !important; /* Rosso chiaro */
  font-weight: bold;
}

.numeric-value.delivery-count {
  font-size: 2em;
  font-weight: 700;
}

/* Store info cells */
.store-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.store-name {
  font-weight: 600;
  color: var(--gray-900);
}

.store-address {
  font-size: var(--text-xs);
  color: var(--gray-500);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-slots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.time-slot {
  background: var(--primary-100);
  color: var(--primary-700);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
}

/* Assignments info */
.assignment-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.assignment-item {
  background: var(--gray-50);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-500);
}

/* =================================
   STORE ASSIGNMENT ENHANCED STYLES
   ================================= */

.assignment-item {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.assignment-item:hover {
  border-color: var(--primary-300);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.store-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2);
}

.store-name {
  display: flex;
  align-items: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-900);
  flex: 1;
}

.delivery-badges {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

.delivery-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  min-width: 24px;
  justify-content: center;
}

.delivery-badge i {
  font-size: 8px;
}

.delivery-badge.active-badge {
  background: var(--warning-100);
  color: var(--warning-700);
  border: 1px solid var(--warning-200);
}

.delivery-badge.inactive-badge {
  background: var(--gray-100);
  color: var(--gray-500);
  border: 1px solid var(--gray-200);
}

.delivery-badge.available-badge {
  background: var(--success-100);
  color: var(--success-700);
  border: 1px solid var(--success-200);
}

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

.time-slot-info {
  display: flex;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--gray-600);
}

.time-slot {
  font-weight: 500;
  color: var(--primary-600);
}

.store-address {
  display: flex;
  align-items: center;
  font-size: var(--text-xs);
  color: var(--gray-600);
  cursor: help;
  margin-top: var(--space-1);
  padding: var(--space-1);
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--primary-200);
}

.address-text {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--gray-700);
}

.assignment-details {
  font-size: var(--text-xs);
  color: var(--gray-600);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =================================
   LOADING STATES
   ================================= */

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  color: var(--gray-500);
  font-size: var(--text-sm);
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top: 2px solid var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: var(--space-2);
}

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

/* =================================
   RESPONSIVE
   ================================= */

@media (max-width: 768px) {
  .dashboard-container {
    padding: var(--space-2);
  }
  
  .main-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }
  
  .stat-card {
    padding: var(--space-3);
  }
  
  .dashboard-header {
    flex-direction: column;
    gap: var(--space-3);
    align-items: stretch;
  }
  
  .header-controls {
    justify-content: center;
  }
}

/* =================================
   STILI ELEGANTI STORE ASSEGNATI
   ================================= */

.stores-elegant-container {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.stores-elegant-container:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stores-elegant-container.expanded {
  border-color: var(--primary-300);
}

.stores-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  cursor: pointer;
  transition: all 0.2s ease;
}

.stores-header:hover {
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

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

.badge-primary {
  background: var(--primary-500);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-secondary {
  background: var(--blue-500);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge-danger {
  background: var(--red-500);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.badge-success {
  background: var(--blue-500);
  color: white;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

/* 🎯 Badge consegne completate (evidente vicino al nome fattorino) */
.completed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.completed-badge.has-completed {
  background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
  animation: pulse-completed 2s ease-in-out infinite;
}

.completed-badge.no-completed {
  background: var(--gray-200);
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.completed-badge i {
  font-size: 0.9rem;
}

.completed-badge.has-completed i {
  animation: checkmark-pulse 1.5s ease-in-out infinite;
}

.completed-badge strong {
  font-weight: 700;
  font-size: 1em;
}

@keyframes pulse-completed {
  0%, 100% {
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.5);
    transform: scale(1.05);
  }
}

@keyframes checkmark-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

.toggle-arrow {
  color: var(--gray-500);
  transition: transform 0.3s ease;
  font-size: var(--text-sm);
}

.time-section.expanded .toggle-arrow {
  transform: rotate(180deg);
}

.stores-elegant-container.expanded .toggle-arrow {
  transform: rotate(180deg);
}

.stores-content {
  background: white;
  border-top: 1px solid var(--gray-200);
}

.time-section {
  border-bottom: 1px solid var(--gray-100);
}

.time-section:last-child {
  border-bottom: none;
}

.time-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--primary-100);
  cursor: pointer;
}

.stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-3);
  padding: var(--space-3);
}

.store-tile {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.store-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.store-tile:hover::before {
  opacity: 1;
}

.store-tile:hover {
  background: white;
  border-color: var(--primary-200);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.store-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2);
}

.store-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
  line-height: 1.2;
}

.store-badges {
  display: flex;
  gap: 4px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.mini-badge.muted {
  background: var(--gray-200);
  color: var(--gray-600);
}

.mini-badge.danger {
  background: var(--red-500);
  color: white;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.mini-badge.success {
  background: var(--blue-500);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.store-location {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--gray-600);
  font-size: var(--text-xs);
  line-height: 1.3;
}

.store-location i {
  color: var(--gray-400);
  font-size: 10px;
  flex-shrink: 0;
}

/* Warning indicator for late deliveries */
.late-indicator {
  color: var(--red-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  font-size: 12px;
}

.time-header .late-indicator {
  margin-left: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .stores-grid {
    grid-template-columns: 1fr;
  }
  
  .summary-badges {
    flex-wrap: wrap;
    gap: var(--space-1);
  }
}

/* =================================
   SHIPPING TIMETABLE STYLES
   ================================= */

.shipping-timetable-section {
  margin-top: var(--space-6);
  width: 100%;
}

/* Ensure the shipping timetable card can constrain its body and scroll internally */
.shipping-timetable-section .content-card {
  display: flex;
  flex-direction: column;
}

.shipping-timetable-section .card-body {
  display: flex;
  flex-direction: column;
  max-height: 70vh; /* Constrain height relative to viewport */
  min-height: 0;    /* Allow child to shrink and scroll */
  overflow: hidden; /* Hide overflow here; inner container will scroll */
}

/* Main timetable container scrolls internally (both axes if needed) */
.shipping-timetable-section #shipping-timetable-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto; /* horizontal scroll for wide tables */
  overscroll-behavior: contain; /* prevent scroll chaining to page */
  -webkit-overflow-scrolling: touch; /* smooth iOS scroll */
}

/* Inside the scrollable container, avoid inner scroll areas to prevent nested scrollbars */
.shipping-timetable-section #shipping-timetable-container .shipping-stores-list {
  max-height: none;
  overflow: visible;
}

/* Fine-tune heights on smaller screens */
@media (max-width: 1024px) {
  .shipping-timetable-section .card-body { max-height: 60vh; }
}

@media (max-width: 768px) {
  .shipping-timetable-section .card-body { max-height: 50vh; }
}

/* Compact stores list layout */
.shipping-stores-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 70vh;
  overflow-y: auto;
  padding: var(--space-4);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.shipping-store-item {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all 0.2s ease;
}

.shipping-store-item:hover {
  border-color: var(--primary-300);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.store-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  cursor: pointer;
  background: white;
  transition: background 0.2s ease;
}

.store-header:hover {
  background: var(--gray-50);
}

.store-info h4 {
  margin: 0 0 var(--space-1) 0;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--gray-900);
}

.store-info p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--gray-600);
}

.store-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.store-status {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

.store-status.loaded {
  background: var(--success-100);
  color: var(--success-700);
}

.store-status.not-loaded {
  background: var(--gray-100);
  color: var(--gray-600);
}

.store-status.loading {
  background: var(--primary-100);
  color: var(--primary-700);
}

.store-status.error {
  background: var(--red-100);
  color: var(--red-700);
}

.expand-icon {
  color: var(--gray-400);
  transition: transform 0.2s ease;
}

.store-timetable-content {
  border-top: 1px solid var(--gray-200);
  background: var(--gray-25);
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
}

.store-timetable-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  table-layout: fixed;
  min-width: 800px;
}

.store-timetable-table th {
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.store-timetable-table th:nth-child(1) { width: 12%; } /* Giorno */
.store-timetable-table th:nth-child(2) { width: 18%; } /* Fascia Oraria */
.store-timetable-table th:nth-child(3) { width: 12%; } /* Slot Totali */
.store-timetable-table th:nth-child(4) { width: 15%; } /* Online */
.store-timetable-table th:nth-child(5) { width: 15%; } /* Offline */
.store-timetable-table th:nth-child(6) { width: 12%; } /* Liberi */
.store-timetable-table th:nth-child(7) { width: 16%; } /* Azioni */

.store-timetable-table td {
  border-bottom: 1px solid var(--gray-100);
  padding: var(--space-2) var(--space-3);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-timetable-table tbody tr:hover {
  background: var(--gray-50);
}

.store-timetable-table .slot-input {
  width: 50px;
  padding: 2px 4px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: var(--text-xs);
  margin-bottom: 2px;
}

.store-timetable-table .slot-free {
  font-size: 10px;
  color: var(--gray-500);
  display: block;
  line-height: 1.2;
}

.store-timetable-table .online-slots,
.store-timetable-table .offline-slots {
  text-align: center;
}

.store-timetable-table .time-range {
  font-weight: 500;
  color: var(--primary-600);
}

.store-timetable-table .slot-count {
  font-weight: 600;
}

.store-timetable-table .slot-count.total {
  color: var(--gray-700);
}

.store-timetable-table .slot-count.free {
  color: var(--success-600);
}

.loading-placeholder,
.error-placeholder {
  padding: var(--space-6);
  text-align: center;
  color: var(--gray-500);
  font-style: italic;
}

.error-placeholder {
  color: var(--red-600);
}

/* Search container for shipping */
.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-container input {
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-3);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  width: 250px;
  transition: border-color 0.2s ease;
}

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

.search-icon {
  position: absolute;
  right: var(--space-3);
  color: var(--gray-400);
  pointer-events: none;
}

/* Refresh button for individual stores */
.refresh-store {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  color: var(--primary-600);
  padding: var(--space-1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.refresh-store:hover {
  background: var(--primary-100);
  border-color: var(--primary-300);
  transform: scale(1.05);
}

.refresh-store:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.store-info {
  cursor: pointer;
  flex: 1;
}

.full-width {
  width: 100%;
}

.shipping-timetable-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.shipping-timetable-header h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-900);
  margin: 0;
}

.shipping-controls {
  display: flex;
  gap: var(--space-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

.btn-success:hover {
  background: var(--success-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.shipping-timetable-table-wrapper {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.shipping-timetable-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.shipping-timetable-table th {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shipping-timetable-table td {
  border-bottom: 1px solid var(--gray-100);
  padding: var(--space-3) var(--space-4);
  vertical-align: middle;
}

.shipping-timetable-table tbody tr:hover {
  background: var(--gray-50);
}

.shipping-timetable-table tbody tr.slot-changed {
  background: var(--warning-50);
  border-left: 3px solid var(--warning-500);
}

.store-name {
  font-weight: 600;
  color: var(--gray-900);
}

.day-name {
  color: var(--gray-700);
  font-weight: 500;
}

.time-range {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--primary-100);
  color: var(--primary-700);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
}

.slot-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--text-sm);
}

.slot-count.total {
  background: var(--gray-100);
  color: var(--gray-700);
}

.slot-count.free {
  background: var(--success-100);
  color: var(--success-700);
}

.slot-input {
  width: 60px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
  transition: all 0.2s ease;
}

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

.slot-input.online {
  border-color: var(--primary-300);
}

.slot-input.offline {
  border-color: var(--gray-400);
}

.slot-free {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-top: var(--space-1);
}

.online-slots .slot-free {
  color: var(--primary-600);
}

.offline-slots .slot-free {
  color: var(--gray-600);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0 2px;
}

.save-slot {
  background: var(--success-100);
  color: var(--success-600);
}

.save-slot:hover {
  background: var(--success-200);
  transform: scale(1.1);
}

.reset-slot {
  background: var(--gray-100);
  color: var(--gray-600);
}

.reset-slot:hover {
  background: var(--gray-200);
  transform: scale(1.1);
}

.shipping-timetable-summary {
  padding: var(--space-4);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
}

.summary-stats {
  display: flex;
  gap: var(--space-6);
  align-items: center;
}

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

.stat-label {
  font-size: var(--text-sm);
  color: var(--gray-600);
  font-weight: 500;
}

.stat-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-900);
  padding: var(--space-1) var(--space-2);
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  min-width: 32px;
  text-align: center;
}

.stat-value.pending {
  background: var(--warning-100);
  color: var(--warning-700);
  border-color: var(--warning-300);
}

/* Notification styles */
.shipping-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  z-index: 9999;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.shipping-notification.show {
  transform: translateX(0);
}

.shipping-notification.success {
  background: var(--success-100);
  color: var(--success-700);
  border: 1px solid var(--success-300);
}

.shipping-notification.error {
  background: var(--red-500);
  color: white;
}

.shipping-notification.info {
  background: var(--primary-100);
  color: var(--primary-700);
  border: 1px solid var(--primary-300);
}

/* Responsive shipping timetable */
@media (max-width: 1200px) {
  .shipping-timetable-table {
    font-size: var(--text-xs);
  }
  
  .shipping-timetable-table th,
  .shipping-timetable-table td {
    padding: var(--space-2) var(--space-3);
  }
}

@media (max-width: 768px) {
  .shipping-timetable-header {
    flex-direction: column;
    gap: var(--space-3);
    align-items: stretch;
  }
  
  .shipping-controls {
    justify-content: center;
  }
  
  .shipping-timetable-table-wrapper {
    overflow-x: auto;
  }
  
  .shipping-timetable-table {
    min-width: 800px;
  }
  
  .summary-stats {
    flex-direction: column;
    gap: var(--space-3);
    align-items: stretch;
  }
}

@media (max-width: 1024px) {
  .split-screen-container {
    flex-direction: column;
    height: auto;
  }
  
  .left-panel,
  .right-panel {
    flex: 1 1 auto;
  }
  
  .full-height {
    height: auto;
    min-height: 500px;
  }
  
  .main-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* =================================
   EFFETTI CELEBRATIVI - FUOCHI D'ARTIFICIO
   ================================= */

.fireworks-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.firework {
  position: absolute;
  pointer-events: none;
}

.firework-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: firework-explosion 2s ease-out forwards;
  box-shadow: 0 0 6px currentColor;
}

@keyframes firework-explosion {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(0);
    opacity: 0;
  }
}

/* Messaggio di congratulazioni */
.congratulations-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  animation: congratsAppear 0.5s ease-out;
}

.congrats-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 3px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  min-width: 300px;
}

.congrats-icon {
  font-size: 4rem;
  margin-bottom: var(--space-3);
  animation: bounce 1s ease-in-out infinite;
}

.congrats-content h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin: 0 0 var(--space-2) 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.congrats-content p {
  font-size: var(--text-lg);
  margin: 0 0 var(--space-2) 0;
  opacity: 0.9;
}

.congrats-subtext {
  font-size: var(--text-sm);
  opacity: 0.7;
  font-style: italic;
}

@keyframes congratsAppear {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Effetti aggiuntivi per i fuochi d'artificio */
.firework-particle:nth-child(1) { animation-delay: 0s; }
.firework-particle:nth-child(2) { animation-delay: 0.1s; }
.firework-particle:nth-child(3) { animation-delay: 0.2s; }
.firework-particle:nth-child(4) { animation-delay: 0.1s; }
.firework-particle:nth-child(5) { animation-delay: 0s; }
.firework-particle:nth-child(6) { animation-delay: 0.15s; }
.firework-particle:nth-child(7) { animation-delay: 0.05s; }
.firework-particle:nth-child(8) { animation-delay: 0.2s; }
.firework-particle:nth-child(9) { animation-delay: 0.1s; }
.firework-particle:nth-child(10) { animation-delay: 0s; }
.firework-particle:nth-child(11) { animation-delay: 0.15s; }
.firework-particle:nth-child(12) { animation-delay: 0.05s; }

@media (max-width: 480px) {
  .congrats-content {
    padding: var(--space-4);
    min-width: 250px;
  }
  
  .congrats-icon {
    font-size: 3rem;
  }
  
  .congrats-content h2 {
    font-size: var(--text-xl);
  }
  
  .data-table {
    font-size: var(--text-xs);
  }
  
  .data-table th,
  .data-table td {
    padding: var(--space-2);
  }
}

/* =================================
   UTILITIES
   ================================= */

.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ================================= 
   ASSIGNED STORES ELEGANT STYLING
   ================================= */

/* Container compatto per summary store nella colonna */
.stores-summary-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}

.expand-stores-btn {
  background: var(--primary-500);
  color: white;
  border: none;
  border-radius: 0.375rem;
  padding: 0.375rem 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.expand-stores-btn:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.expand-stores-btn.expanded {
  background: var(--primary-600);
}

.expand-stores-btn i {
  transition: transform 0.2s ease;
}

.expand-stores-btn.expanded i {
  transform: rotate(180deg);
}

/* Righe di espansione dettagli store */
.bellhop-details-row {
  background-color: var(--gray-25) !important;
}

.bellhop-details-row:hover {
  background-color: var(--gray-25) !important;
}

.bellhop-details-cell {
  padding: 1rem !important;
  border-bottom: 2px solid var(--gray-300) !important;
}

/* Stili per i dettagli store full-width */
.stores-details-full {
  background: white;
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid var(--gray-200);
}

.stores-elegant-container {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stores-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
  border-bottom: 1px solid var(--gray-200);
  cursor: pointer;
  transition: all 0.2s ease;
}

.stores-header:hover {
  background: linear-gradient(135deg, var(--gray-100), var(--gray-150));
}

.summary-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.badge-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--primary-500);
  color: white;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
}

.badge-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--gray-500);
  color: white;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
}

.badge-success {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--blue-500);
  color: white;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
}

.badge-danger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--red-500);
  color: white;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.toggle-arrow {
  color: var(--gray-500);
  transition: transform 0.3s ease;
}

.stores-header.expanded .toggle-arrow {
  transform: rotate(180deg);
}

.stores-content {
  padding: var(--space-3);
  background: white;
}

.stores-details-full .time-section {
  margin-bottom: 1.5rem;
}

.stores-details-full .time-section:last-child {
  margin-bottom: 0;
}

.stores-details-full .time-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary-500);
  font-size: 0.9rem;
}

.stores-details-full .time-header i {
  color: var(--primary-500);
}

.stores-details-full .stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-left: 1.5rem;
}

.stores-details-full .store-tile {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stores-details-full .store-tile:hover {
  border-color: var(--primary-300);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.stores-details-full .store-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.stores-details-full .store-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
  line-height: 1.4;
}

.stores-details-full .store-badges {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

.stores-details-full .store-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--gray-600);
  margin-top: 0.5rem;
  line-height: 1.3;
}

.stores-details-full .store-location i {
  color: var(--gray-400);
  flex-shrink: 0;
}

/* Legacy styles for backward compatibility */
.time-section {
  margin-bottom: var(--space-4);
}

.time-section:last-child {
  margin-bottom: 0;
}

.time-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary-500);
  cursor: pointer;
}

.time-header i {
  color: var(--primary-500);
}

.stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
  margin-left: var(--space-4);
}

.store-tile {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  transition: all 0.2s ease;
}

.store-tile:hover {
  border-color: var(--primary-300);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.store-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-2);
}

.store-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
  line-height: 1.3;
}

.store-badges {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

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

.store-location i {
  color: var(--gray-400);
  flex-shrink: 0;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-1);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.mini-badge.success {
  background: var(--blue-500);
  color: white;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.mini-badge.danger {
  background: var(--red-500);
  color: white;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.store-location {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--gray-600);
  line-height: 1.4;
}

.store-location i {
  color: var(--gray-400);
  flex-shrink: 0;
}

/* =================================
   COLLAPSIBLE STORE COLUMN
   ================================= */

.store-column-wrapper {
  width: 100%;
}

.store-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.store-summary:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.store-count {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--gray-700);
  font-weight: 500;
}

.store-count i {
  color: var(--primary-500);
}

.expand-indicator {
  color: var(--gray-500);
  transition: transform 0.2s ease;
}

.store-column-wrapper.expanded .expand-indicator {
  transform: rotate(180deg);
}

.store-details-full {
  margin-top: var(--space-2);
  padding: var(--space-3);
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* 🎨 FOOTER STYLES */
.dashboard-footer {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: white;
  padding: 2rem 1rem;
  margin-top: 3rem;
  border-top: 4px solid #3b82f6;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-section {
  margin-bottom: 1rem;
}

.footer-section.credits p {
  font-size: 0.875rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0;
}

.footer-section.copyright p {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 1rem 0;
}

.footer-section.slogan {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.slogan-text {
  font-size: 1.25rem;
  font-weight: 700;
  font-style: italic;
  color: #f1f5f9;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  margin: 0;
  letter-spacing: 0.5px;
}

.github-link {
  color: #60a5fa !important;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.github-link:hover {
  color: #93c5fd !important;
  transform: translateY(-1px);
}

.github-link i {
  font-size: 1rem;
}

/* Responsive footer */
@media (max-width: 768px) {
  .dashboard-footer {
    padding: 1.5rem 0.75rem;
  }
  
  .footer-section.credits p {
    font-size: 0.75rem;
    line-height: 1.5;
  }
  
  .slogan-text {
    font-size: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* =================================
   🎆 EFFETTI CELEBRATIVI - FUOCHI D'ARTIFICIO
   ================================= */

/* Overlay container per fuochi d'artificio */
.fireworks-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

/* Singolo fuoco d'artificio */
.firework {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  animation: firework-launch 0.5s ease-out forwards;
}

/* Animazione lancio del fuoco d'artificio */
@keyframes firework-launch {
  0% {
    transform: translateY(100vh) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1.2);
    opacity: 0.8;
  }
}

/* Particelle del fuoco d'artificio */
.firework-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: particle-explode 2s ease-out forwards;
  box-shadow: 0 0 6px currentColor;
}

/* Animazione esplosione particelle */
@keyframes particle-explode {
  0% {
    transform: translate(0, 0) scale(0);
    opacity: 1;
  }
  50% {
    transform: translate(var(--dx), var(--dy)) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(calc(var(--dx) * 1.5), calc(var(--dy) * 1.5)) scale(0);
    opacity: 0;
  }
}

/* Popup congratulazioni */
.congratulations-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  z-index: 10000;
  animation: congratulations-appear 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  max-width: 400px;
  width: 90%;
}

/* Animazione apparizione popup */
@keyframes congratulations-appear {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-180deg);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Contenuto congratulazioni */
.congrats-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Icona congratulazioni */
.congrats-icon {
  font-size: 4rem;
  animation: congrats-bounce 1s ease-in-out infinite alternate;
}

/* Animazione rimbalzo icona */
@keyframes congrats-bounce {
  0% {
    transform: scale(1) rotate(0deg);
  }
  100% {
    transform: scale(1.1) rotate(5deg);
  }
}

/* Titolo congratulazioni */
.congrats-content h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: bold;
  background: linear-gradient(45deg, #FFD700, #FFA500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: title-glow 2s ease-in-out infinite alternate;
}

/* Animazione bagliore titolo */
@keyframes title-glow {
  0% {
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
  }
  100% {
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
  }
}

/* Testo congratulazioni */
.congrats-content p {
  margin: 0;
  font-size: 1.2rem;
  opacity: 0.9;
}

/* ======================
   Slot Checker Styles
   ====================== */
/* Container state */
.slot-checker-results {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.slot-checker-results.empty-state {
  color: #6b7280;
  font-style: italic;
  text-align: center;
}

/* Summary */
.sc-summary {
  margin-bottom: 10px;
  font-weight: 600;
}

/* Placeholders */
.loading-placeholder,
.error-placeholder,
.success-placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
}
.loading-placeholder { background: #eef2ff; color: #3730a3; }
.error-placeholder { background: #fee2e2; color: #991b1b; }
.success-placeholder { background: #dcfce7; color: #065f46; }

/* Table wrapper */
.sc-table-wrap {
  max-height: 50vh;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

/* Results table */
.slot-checker-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 0.92rem;
}
.slot-checker-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px;
  text-align: left;
}
.slot-checker-table tbody td {
  border-top: 1px solid #f3f4f6;
  padding: 8px 10px;
  vertical-align: top;
}
.slot-checker-table tbody tr:nth-child(even) td {
  background: #fcfcfd;
}

/* Diff highlight */
.sc-diff {
  background: #fff7d6;
  box-shadow: inset 0 0 0 1px #fde68a;
  position: relative;
}
.sc-diff i { color: #b45309; margin-left: 4px; }
.sc-diff::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #f59e0b;
  opacity: 0.8;
}

/* Badges */
.sc-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.sc-badge-diff { background: #fef3c7; color: #92400e; }
.sc-badge-base { background: #e0f2fe; color: #075985; }
.sc-badge-current { background: #fae8ff; color: #6b21a8; }

/* Column sizing + sticky first columns for better scanning */
.slot-checker-table th:nth-child(1),
.slot-checker-table td:nth-child(1) {
  min-width: 220px;
  max-width: 280px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: linear-gradient(90deg, #f9fafb 0%, #ffffff 24%);
  box-shadow: inset -1px 0 0 #e5e7eb;
  font-weight: 600;
}
.slot-checker-table th:nth-child(2),
.slot-checker-table td:nth-child(2) {
  min-width: 110px;
  position: sticky;
  left: 220px; /* width of col 1 */
  z-index: 1;
  background: #ffffff;
  box-shadow: inset -1px 0 0 #e5e7eb;
}
.slot-checker-table th:nth-child(3),
.slot-checker-table td:nth-child(3) {
  min-width: 140px;
  position: sticky;
  left: 330px; /* col1 + col2 */
  z-index: 1;
  background: #ffffff;
  box-shadow: inset -1px 0 0 #e5e7eb;
}

/* Numeric columns centered */
.slot-checker-table th:nth-child(n+4):nth-child(-n+11),
.slot-checker-table td:nth-child(n+4):nth-child(-n+11) {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Buttons inside results */
.slot-checker-results .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  background: #ffffff;
  color: #374151;
}
.slot-checker-results .btn-sm { padding: 5px 9px; font-size: 0.8rem; }
.slot-checker-results .btn:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.slot-checker-results .btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.slot-checker-results .btn-warning { background: linear-gradient(180deg, #fde68a, #fbbf24); color: #7c2d12; border-color: #f59e0b; }
.slot-checker-results .btn-warning:hover { filter: brightness(0.98); }
.slot-checker-results .btn-secondary { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }
#align-all-btn { border-radius: 999px; padding: 8px 12px; }

/* Responsive: hide some columns on smaller screens to reduce horizontal scroll */
@media (max-width: 1100px) {
  /* Hide Total baseline/current */
  .slot-checker-table th:nth-child(4), .slot-checker-table td:nth-child(4),
  .slot-checker-table th:nth-child(5), .slot-checker-table td:nth-child(5) { display: none; }
}
@media (max-width: 900px) {
  /* Also hide Free baseline/current */
  .slot-checker-table th:nth-child(10), .slot-checker-table td:nth-child(10),
  .slot-checker-table th:nth-child(11), .slot-checker-table td:nth-child(11) { display: none; }
  .slot-checker-table th, .slot-checker-table td { padding: 6px 8px; font-size: 0.85rem; }
  .slot-checker-table th:nth-child(1), .slot-checker-table td:nth-child(1) { min-width: 200px; }
  .slot-checker-table th:nth-child(2), .slot-checker-table td:nth-child(2) { left: 200px; }
  .slot-checker-table th:nth-child(3), .slot-checker-table td:nth-child(3) { left: 310px; }
}
@media (max-width: 700px) {
  /* Reduce sticky footprint a bit */
  .slot-checker-table th:nth-child(1), .slot-checker-table td:nth-child(1) { min-width: 180px; max-width: 220px; }
  .slot-checker-table th:nth-child(2), .slot-checker-table td:nth-child(2) { left: 180px; }
  .slot-checker-table th:nth-child(3), .slot-checker-table td:nth-child(3) { left: 290px; }
}

/* Sottotesto congratulazioni */
.congrats-subtext {
  font-size: 0.9rem;
  opacity: 0.7;
  font-style: italic;
}

/* ===== BELLHOP ASSIGNMENT STYLES ===== */
.bellhop-assignment-section {
  margin-top: 20px;
}

.bellhop-assignment-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bellhop-assignment-table th,
.bellhop-assignment-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.bellhop-assignment-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.bellhop-assignment-table tbody tr:hover {
  background: #f8fafc;
}

.bellhop-assignment-table .store-name {
  font-weight: 600;
  color: #1f2937;
}

.bellhop-assignment-table .slot-date {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.875rem;
}

.bellhop-assignment-table .slot-time {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.875rem;
  color: #6b7280;
}

.bellhop-assignment-table .slot-uuid {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.75rem;
  color: #9ca3af;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bellhop-assignment-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.current-assignment {
  flex: 1;
  font-size: 0.875rem;
  color: #374151;
}

.bellhop-assignment-cell .btn {
  flex-shrink: 0;
}

/* Modal styles for bellhop assignment */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
}

.modal-close {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.modal-close:hover {
  color: #374151;
  background: #f3f4f6;
}

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

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 20px 24px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #374151;
  font-size: 0.875rem;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bellhop-selection {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.15s ease;
  margin-bottom: 4px;
}

.checkbox-item:hover {
  background: #f3f4f6;
}

.checkbox-item input[type="checkbox"] {
  margin: 0;
  margin-right: 8px;
}

.checkbox-item:last-child {
  margin-bottom: 0;
}

/* Button styles for bellhop assignment actions */
.bellhop-assignment-table .btn-outline {
  background: transparent;
  border: 1px solid #d1d5db;
  color: #6b7280;
}

.bellhop-assignment-table .btn-outline:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #374151;
}

/* ===== END BELLHOP ASSIGNMENT STYLES ===== */

/* Sottotesto congratulazioni */
.congrats-subtext {
  font-size: 0.9rem;
  opacity: 0.7;
  font-style: italic;
}

/* =================================
   MAP LEGEND STYLES
   ================================= */

.map-legend {
  display: flex;
  gap: 0.5rem;
  margin-right: 0.25rem;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(8px);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-800);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.legend-item:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--gray-300);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.legend-item.available {
  color: var(--gray-800);
}

.legend-item.available i {
  color: #10b981 !important; /* Verde per disponibili (corrisponde ai marker) */
  font-size: 0.65rem;
  filter: drop-shadow(0 1px 2px rgba(16, 185, 129, 0.3));
  animation: pulse-legend 2s ease-in-out infinite;
}

.legend-item.active {
  color: var(--gray-800);
}

.legend-item.active i {
  color: #ef4444 !important; /* Rosso per in corso (corrisponde ai marker) */
  font-size: 0.65rem;
  filter: drop-shadow(0 1px 2px rgba(239, 68, 68, 0.3));
  animation: pulse-legend 2s ease-in-out infinite;
}

@keyframes pulse-legend {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}
