/* ── Overrides / extensiones sobre Bootstrap 5 ──────────────── */

:root {
  --bs-primary: #1d4ed8;
  --bs-primary-rgb: 29, 78, 216;
}

/* Navbar */
.navbar-brand { font-weight: 700; letter-spacing: -.01em; }

/* Tabla de calificaciones */
.grade-input {
  width: 75px;
  text-align: center;
  font-size: .875rem;
  padding: .3rem .4rem;
  border-radius: .375rem;
  border: 1.5px solid #dee2e6;
  transition: border-color .15s;
  display: block;
  margin: 0 auto;
}

.grade-input:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29,78,216,.15);
}

.grade-input.filled {
  border-color: #198754;
  background: #f0fdf4;
}

/* Medallones de ranking */
.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8rem;
}
.rank-1 { background: #fbbf24; color: #78350f; }
.rank-2 { background: #94a3b8; color: #fff; }
.rank-3 { background: #b45309; color: #fff; }
.rank-n { background: #e2e8f0; color: #64748b; }

/* Colores de puntaje */
.score-high { color: #16a34a; font-weight: 700; }
.score-mid  { color: #d97706; font-weight: 700; }
.score-low  { color: #dc2626; font-weight: 700; }

/* Galería de fotos */
.foto-thumb {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: .5rem;
  overflow: hidden;
  border: 2px solid #dee2e6;
  flex-shrink: 0;
}

.foto-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.foto-thumb .foto-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(220,38,38,.85);
  color: #fff;
  border: none;
  font-size: .65rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Suma de criterios */
.sum-ok    { background: #d1fae5; color: #065f46; }
.sum-warn  { background: #fef3c7; color: #92400e; }
.sum-error { background: #fee2e2; color: #991b1b; }

/* Acordeón de grupos en index */
.grupo-toggle { cursor: pointer; }
.grupo-toggle:hover { background: #f8f9fa; }

/* Barra flotante de guardado */
.save-bar {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: .75rem;
  padding: .85rem 1.5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  display: flex;
  align-items: center;
  gap: 1rem;
  white-space: nowrap;
}

/* Login card */
.login-wrap {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #f1f5f9;
}

/* Foto grande en resultados */
.result-foto {
  width: 48px;
  height: 48px;
  border-radius: .375rem;
  object-fit: cover;
  border: 1px solid #dee2e6;
  cursor: pointer;
}

@media (max-width: 576px) {
  .save-bar { width: calc(100% - 2rem); flex-wrap: wrap; justify-content: center; }
  .grade-input { width: 62px; }
}

@media print {
  .navbar, .save-bar, .btn, .export-bar { display: none !important; }
  body { background: #fff !important; }
}
