* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont;
  }
  
  body {
    background: #f5f7fa;
    padding: 30px;
  }
  
  .container {
    background: white;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
  }
  
  h2 {
    margin-bottom: 16px;
  }
  
  .controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
  }
  
  .mode label {
    margin-right: 10px;
    font-size: 14px;
  }
  
  select, input, button {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
  }
  
  button {
    background: #2563eb;
    color: white;
    border: none;
    cursor: pointer;
  }
  
  button:hover {
    background: #1d4ed8;
  }
  
  .table-wrapper {
    overflow-x: auto;
  }
  
  table {
    border-collapse: collapse;
    width: 100%;
    min-width: 600px;
  }
  
  th, td {
    border: 1px solid #e5e7eb;
    padding: 6px;
    text-align: center;
    font-size: 13px;
  }
  
  th {
    background: #f3f4f6;
    font-weight: 600;
  }
  
  td.email {
    text-align: left;
    font-weight: 500;
    background: #fafafa;
  }
  
  td.absent {
    background: #fee2e2;
    color: #991b1b;
    font-weight: bold;
  }
  
/* Spinner piccolo inline */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: #2563eb; /* colore principale */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle; /* allinea con il pulsante */
  }
  
  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  /* Evidenzia weekend */
th.weekend, td.weekend {
    background: #f0f4f8;
  }
  
  /* Colonna email sempre visibile */
  td.email, th.email {
    position: sticky;
    left: 0;
    background: #fafafa;
    z-index: 2; /* sopra le altre celle */
  }
  
  /* Righe alternate più leggibili */
  tbody tr:nth-child(even) {
    background: #f9fafb;
  }
  
  /* Migliora leggibilità celle assenze */
  td.absent {
    font-size: clamp(9px, 1.2vw, 12px);
    color: #b91c1c;
    font-weight: bold;
    position: relative;
  }

  .absent:hover::after {
    content: attr(title);
    position: absolute;
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    margin-left: 5px;
    font-size: 12px;
    z-index: 9999;
  }

  .day-header {
    text-align: center;
    font-size: 12px;
    line-height: 1.2;
  }
  
  .day-header .weekday {
    font-weight: bold;
    font-size: 11px;
  }
  
  .day-header .date {
    font-size: 12px;
  }
  
  /* Weekend */
  .weekend {
    background-color: #fff3f3;
  }
  
  thead .weekend {
    background-color: #ffd6d6;
  }


  h2 {
    transition: all 0.4s ease;
    cursor: pointer;
  }
  
  .epic-title {
    animation: epicReveal 1.2s ease forwards;
    letter-spacing: 3px;
    text-transform: uppercase;
  }
  
  @keyframes epicReveal {
    0% {
      transform: scale(0.6) rotate(-2deg);
      opacity: 0;
      text-shadow: none;
    }
    40% {
      transform: scale(1.1) rotate(1deg);
      opacity: 1;
      text-shadow: 0 0 10px rgba(255, 200, 0, 0.6);
    }
    70% {
      transform: scale(0.95) rotate(0deg);
      text-shadow: 0 0 18px rgba(255, 180, 0, 0.8);
    }
    100% {
      transform: scale(1);
      text-shadow:
        0 0 8px rgba(255, 170, 0, 0.9),
        0 0 20px rgba(255, 140, 0, 0.7),
        2px 2px 6px rgba(0,0,0,0.6);
    }
  }