/* ============================================
   COLABORADORES POR PARTIDO
   ============================================ */

.colab-partido-view {
  display: block;
}

.colab-partido-card {
  padding: 0;
  overflow: hidden;
}

/* Header sticky con buscador, contadores y meta */
.colab-partido-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(160deg, rgba(26, 41, 66, 0.98) 0%, rgba(13, 24, 40, 0.98) 100%);
  border-bottom: 1px solid var(--border-soft);
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "search counters"
    "meta meta";
  gap: 0.75rem 1rem;
  align-items: center;
}

.colab-partido-search {
  grid-area: search;
}

.colab-partido-search input {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  border: 2px solid var(--border-soft);
  background: rgba(10, 22, 40, 0.6);
  color: var(--text-main);
  font-size: 0.95rem;
}

.colab-partido-search input:focus {
  outline: none;
  border-color: var(--talleres-red-light);
  box-shadow: 0 0 0 3px rgba(139, 21, 56, 0.25);
}

.colab-partido-counters {
  grid-area: counters;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.colab-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 22, 40, 0.55);
  border: 2px solid var(--border-soft);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  min-width: 96px;
}

.colab-counter-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.colab-counter-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  margin-top: 0.15rem;
  color: var(--text-main);
}

.colab-counter-value.is-success {
  color: var(--success);
}

.colab-counter-value.is-warning {
  color: var(--danger);
}

.colab-partido-meta {
  grid-area: meta;
}

/* Tabla */
.colab-partido-table-wrap {
  overflow-x: auto;
  padding: 0 0.25rem 1rem 0.25rem;
}

.colab-partido-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}

.colab-partido-table thead th {
  position: sticky;
  top: 0;
  background: rgba(10, 22, 40, 0.85);
  text-align: left;
  padding: 0.65rem 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-soft);
}

.colab-partido-table tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(42, 58, 82, 0.5);
  vertical-align: middle;
}

.colab-partido-table tbody tr:hover {
  background: rgba(139, 21, 56, 0.08);
}

.colab-col-toggle {
  text-align: center;
  width: 80px;
}

.colab-col-estado {
  text-align: center;
  width: 130px;
}

.colab-col-nota {
  text-align: center;
  width: 90px;
}

.colab-partido-table tbody td.colab-cell-toggle,
.colab-partido-table tbody td.colab-cell-estado,
.colab-partido-table tbody td.colab-cell-nota {
  text-align: center;
}

/* Selector de estado de asistencia (Presente / Ausente / Baja) */
.colab-estado-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  display: inline-block;
  min-width: 110px;
  padding: 4px 26px 4px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 10px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.colab-estado-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.colab-estado-select option {
  color: #0f172a;
  background: #ffffff;
}

/* Toggle tipo switch */
.colab-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 56px;
  height: 30px;
  min-height: 30px;
  border-radius: 999px;
  border: 2px solid var(--border-soft);
  background: rgba(10, 22, 40, 0.7);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.colab-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.15s ease, background 0.15s ease;
}

.colab-switch.is-on {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--success);
}

.colab-switch.is-on::after {
  transform: translateX(26px);
  background: var(--success);
}

.colab-switch:disabled,
.colab-switch[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Aumentar zona clickeable en mobile */
.colab-switch-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 44px;
  padding: 7px 0;
  cursor: pointer;
}

/* Boton de nota */
.colab-btn-nota {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: rgba(10, 22, 40, 0.6);
  color: var(--text-main);
  cursor: pointer;
  font-size: 1rem;
}

.colab-btn-nota.has-nota {
  border-color: var(--talleres-red-light);
  background: rgba(139, 21, 56, 0.18);
}

.colab-btn-nota:hover {
  border-color: var(--talleres-red-light);
}

.colab-btn-nota:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Banner cierre cerrado */
.colab-cierre-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 10px;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.5);
  color: #fca5a5;
  font-weight: 600;
}

/* Modal nota */
#colabNotaModal textarea {
  width: 100%;
  min-height: 110px;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 2px solid var(--border-soft);
  background: rgba(10, 22, 40, 0.6);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

#colabNotaModal textarea:focus {
  outline: none;
  border-color: var(--talleres-red-light);
}

/* Responsive */
@media (max-width: 720px) {
  .colab-partido-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "search"
      "counters"
      "meta";
  }
  .colab-partido-counters {
    justify-content: stretch;
  }
  .colab-counter {
    flex: 1 1 auto;
    min-width: 0;
  }
  .colab-counter-value {
    font-size: 1.5rem;
  }
  .colab-partido-table thead {
    display: none;
  }
  .colab-partido-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem 0.75rem;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border-soft);
  }
  .colab-partido-table tbody td {
    padding: 0.25rem 0;
    border: none;
  }
  .colab-partido-table tbody td[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.35rem;
  }
}
