/* Ajustes propios de la versión Node. base.css trae el estilo heredado del
   HTML original; aquí solo van retoques y cosas nuevas. */

.modal.open { display: flex; }
#photoModal.open { display: flex; }

header form button { padding: 8px 10px; }

.studentPhoto {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid var(--b);
  vertical-align: middle;
}

.rowLoading { opacity: .5; }

/* ===== CALENDARIO ===== */
#calendar {
  max-width: 100%;
  overflow-x: hidden;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin-top: 8px;
  width: 100%;
}

.calendar-headers {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 8px;
  font-weight: bold;
  text-align: center;
  font-size: 0.75em;
  width: 100%;
}

.calendar-header {
  padding: 2px;
  text-align: center;
}

.calendar-cell {
  aspect-ratio: 1;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: white;
  font-size: 0.7em;
  position: relative;
  transition: all 0.2s;
  width: 100%;
}

.calendar-cell:hover:not(.empty) {
  background: #f5f5f5;
  border-color: #999;
  z-index: 1;
}

.calendar-cell.empty {
  background: transparent;
  cursor: default;
  border: none;
  visibility: hidden;
}

.calendar-cell.has-data {
  font-weight: bold;
}

.calendar-cell.session-ord {
  background: #d4edda;
  border-color: #28a745;
}

.calendar-cell.session-rec {
  background: #fff3cd;
  border-color: #ffc107;
}

.calendar-cell.session-extra {
  background: #f8d7da;
  border-color: #dc3545;
}

.calendar-cell.today {
  border: 2px solid #007bff;
  background: #e7f3ff;
  font-weight: bold;
}

.calendar-cell .day-number {
  font-weight: bold;
  font-size: 0.9em;
  line-height: 1;
}

.calendar-cell .indicator {
  font-size: 0.6em;
  color: #dc3545;
  line-height: 1;
}

.calendar-cell .indicator-incident {
  font-size: 0.65em;
  color: #ff6b6b;
  line-height: 1;
}

/* ===== CONTADORES BLOQUE C ===== */
.counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.counter {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}

.counter b {
  display: block;
  font-size: 1.8em;
  color: #007bff;
  margin-bottom: 4px;
}

.counter span {
  display: block;
  font-size: 0.85em;
  color: #666;
  font-weight: normal;
}

/* ===== INCIDENCIAS ===== */
#incidents {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notice {
  padding: 10px;
  border-radius: 4px;
  border-left: 4px solid #17a2b8;
}

.notice.p-bad {
  background: #f8d7da;
  border-left-color: #dc3545;
}

.notice.p-info {
  background: #d1ecf1;
  border-left-color: #17a2b8;
}

.notice.p-ok {
  background: #d4edda;
  border-left-color: #28a745;
}

/* ===== TABLA ESTADÍSTICAS ===== */
table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  background: #f0f0f0;
  padding: 8px;
  text-align: left;
  font-weight: bold;
  border: 1px solid #ddd;
  font-size: 0.9em;
}

table td {
  padding: 8px;
  border: 1px solid #ddd;
  font-size: 0.9em;
}

table tr:hover {
  background: #f9f9f9;
}

/* ===== MODAL ===== */
#modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#modal.open {
  display: flex;
}

#modal .card {
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

/* ===== CAMERA MODAL ===== */
#cameraModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#cameraModal.open {
  display: flex;
}

#cameraModal .card {
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

#cameraVideo {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #000;
  margin-bottom: 10px;
}

/* ===== BÚSQUEDA ===== */
#search {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* ===== FILTROS =====*/
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tabs button {
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.tabs button:hover {
  background: #f5f5f5;
}

.tabs button.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

@media print {
  header, aside, .tabs, .actions, form { display: none !important; }
  .grid { grid-template-columns: 1fr; }
}
