body {
  background: #f4f5f7;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekday {
  text-align: center;
  font-weight: 600;
  color: #666;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.calendar-cell {
  background: #fff;
  border-radius: 8px;
  padding: 6px;
  min-height: 96px;
  border: 1px solid #e3e3e3;
  font-size: 0.8rem;
}

.calendar-cell.other-month {
  opacity: 0.4;
}

.calendar-cell.is-today {
  border: 2px solid #0d6efd;
}

.calendar-cell.is-holiday {
  background: #fff3cd;
}

.calendar-cell a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.calendar-date {
  font-weight: 700;
  font-size: 0.9rem;
}

.calendar-driver {
  margin-top: 4px;
  font-weight: 600;
  font-size: 0.85rem;
}

.calendar-person-row {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-icons-row {
  display: none;
  font-size: 1rem;
  line-height: 1;
}

.driver-initial {
  display: none;
}

/* Móvil: el mes completo en columnas de 7 no da sitio para nombres.
   En vez de encoger el texto hasta ser ilegible, se muestran solo los
   iconos de estado (la leyenda de abajo explica qué significa cada uno)
   y la inicial de quien pone el coche; para el detalle día a día está
   la vista Semana. Objetivo: celdas compactas y de proporción razonable,
   no barras altas y estrechas. */
@media (max-width: 576px) {
  .calendar-grid {
    gap: 3px;
  }
  .calendar-cell {
    min-height: 0;
    padding: 3px 1px;
    font-size: 0.7rem;
    line-height: 1.1;
  }
  .calendar-weekday {
    font-size: 0.65rem;
  }
  .calendar-date {
    font-size: 0.85rem;
    line-height: 1;
  }
  .calendar-person-row {
    display: none;
  }
  .calendar-icons-row {
    display: block;
    text-align: center;
    margin-top: 1px;
  }
  .calendar-driver {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 1px;
    white-space: nowrap;
  }
  .driver-full {
    display: none;
  }
  .driver-initial {
    display: inline;
  }
}

.balance-gauge {
  font-size: 2rem;
  font-weight: 700;
}

/* Tablas -> lista de tarjetas en móvil (sin JS): cada <td> necesita un
   atributo data-label="Nombre de columna" para que aparezca como etiqueta. */
@media (max-width: 768px) {
  .table-stack thead {
    display: none;
  }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td {
    display: block;
    width: 100%;
  }
  .table-stack tr {
    margin-bottom: 0.9rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    background: #fff;
  }
  .table-stack td {
    border: none;
    padding: 0.35rem 0;
    text-align: left !important;
    max-width: none !important;
  }
  .table-stack td:not(:last-child) {
    border-bottom: 1px solid #f1f1f1;
  }
  .table-stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 0.15rem;
  }
  .table-stack td:empty,
  .table-stack td[data-label]:has(> :only-child:empty) {
    display: none;
  }
}
