/* ==========================================================================
   Enterprise · Participantes por licencia
   Archivo:
   public/themes/modern-white/assets/css/pages/enterprise_seats.css

   Vista:
   src/Themes/modern-white/views/pages/enterprise_seats.php

   Alcance:
   - Hero contextual
   - Resumen de licencia y capacidad
   - KPIs de participantes
   - Formulario de invitación
   - Buscador
   - Cards de participantes
   - Invitaciones pendientes
   - Supervisores
   - Paginación
   ========================================================================== */


/* ==========================================================================
   Contenedor general
   ========================================================================== */

.cp-ent-wrap{
  width: min(1180px, 100%);
  margin-inline: auto;
}

.cp-ent-wrap > *{
  min-width: 0;
}


/* ==========================================================================
   Hero
   ========================================================================== */

.cp-ent-seats-hero{
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
}

.cp-ent-seats-hero::after{
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: min(50%, 460px);
  height: 2px;
  border-radius: 999px;
  background: var(--border);
}

.cp-ent-seats-hero > div{
  min-width: 0;
  flex: 1 1 560px;
}

.cp-ent-seats-hero .cp-ent-page-title{
  margin: 4px 0 8px;
}

.cp-ent-seats-hero p{
  max-width: 74ch;
  margin: 0;
}

.cp-ent-seats-hero p + p{
  margin-top: 8px;
}

.cp-ent-seats-hero > .btn{
  flex: 0 0 auto;
}


/* ==========================================================================
   Alertas
   ========================================================================== */

.cp-ent-seats-alert{
  margin-bottom: var(--space-4);
}


/* ==========================================================================
   Paneles principales
   ========================================================================== */

.cp-ent-seats-panel{
  margin-top: var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.cp-ent-seats-panel__head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.cp-ent-seats-panel__head > div{
  min-width: 0;
}

.cp-ent-seats-panel__head h2,
.cp-ent-seats-panel__head h3{
  margin: 3px 0 0;
}

.cp-ent-seats-panel__head p.cp-muted{
  max-width: 68ch;
  margin: 7px 0 0;
}

.cp-ent-seats-panel__head > .badge-status{
  flex: 0 0 auto;
}


/* ==========================================================================
   Resumen de licencia
   ========================================================================== */

.cp-ent-seats-license-summary{
  margin-top: var(--space-4);
  padding: var(--space-4);
}

.cp-ent-seats-license-summary__head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.cp-ent-seats-license-summary__head > div{
  min-width: 0;
}

.cp-ent-seats-license-summary__head h2{
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.cp-ent-seats-license-summary__grid{
  display: grid;
  grid-template-columns:
    minmax(0, 1.4fr)
    minmax(240px, .6fr);
  gap: var(--space-4);
  align-items: center;
  margin-top: var(--space-4);
}

.cp-ent-seats-license-summary__capacity{
  min-width: 0;
}

.cp-ent-seats-license-summary__capacity .cp-seats__head{
  margin-bottom: 8px;
}

.cp-ent-seats-license-summary__capacity .cp-muted{
  margin: 8px 0 0;
  font-size: var(--text-sm);
}

.cp-ent-seats-license-summary__dates{
  display: grid;
  gap: 10px;
  margin: 0;
}

.cp-ent-seats-license-summary__dates > div{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.cp-ent-seats-license-summary__dates dt{
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 700;
}

.cp-ent-seats-license-summary__dates dd{
  margin: 0;
  font-weight: 800;
  text-align: right;
}


/* ==========================================================================
   Barra de ocupación y progreso
   ========================================================================== */

.cp-seats__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.cp-seats__head strong{
  color: var(--text);
}

.cp-seats__bar{
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.cp-seats__fill{
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--primary);
  transition: width .25s ease;
}


/* ==========================================================================
   Resumen KPI
   ========================================================================== */

.cp-ent-participant-summary{
  display: grid;
  grid-template-columns:
    repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.cp-ent-participant-summary__item{
  min-width: 0;
  padding: var(--space-3);
}

.cp-ent-participant-summary__item.is-attention{
  border-color: var(--tone-warning-border);
  background:
    linear-gradient(
      180deg,
      var(--tone-warning-bg),
      var(--surface)
    );
}

.cp-ent-participant-summary__item span,
.cp-ent-participant-summary__item small{
  display: block;
}

.cp-ent-participant-summary__item span{
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cp-ent-participant-summary__item strong{
  display: block;
  margin: 8px 0 5px;
  font-size: clamp(1.6rem, 3vw, 2rem);
  line-height: 1;
}

.cp-ent-participant-summary__item small{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}


/* ==========================================================================
   Formulario de invitación
   ========================================================================== */

.cp-ent-seats-invite{
  margin-top: var(--space-5);
  padding: var(--space-4);
}

.cp-ent-seats-invite__grid{
  display: grid;
  grid-template-columns:
    minmax(180px, 1fr)
    minmax(220px, 1.2fr)
    auto;
  gap: var(--space-3);
  align-items: end;
}

.cp-ent-seats-invite__submit{
  display: flex;
  align-items: flex-end;
}

.cp-ent-seats-invite__submit .btn{
  min-height: 42px;
  white-space: nowrap;
}

.cp-ent-seats-invite__full{
  margin: var(--space-2) 0 0;
  padding: 10px 12px;
  border: 1px solid var(--tone-warning-border);
  border-radius: var(--radius-sm);
  background: var(--tone-warning-bg);
  color: var(--tone-warning-text);
  font-size: var(--text-sm);
}


/* ==========================================================================
   Buscador
   ========================================================================== */

.cp-ent-participant-search{
  display: grid;
  grid-template-columns:
    minmax(220px, 1fr)
    auto
    auto;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.cp-ent-participant-search .input{
  min-width: 0;
}

.cp-ent-participant-search .btn{
  white-space: nowrap;
}


/* ==========================================================================
   Grid de participantes
   ========================================================================== */

.cp-ent-participant-grid{
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.cp-ent-participant-card{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    border-color .16s ease;
}

.cp-ent-participant-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cp-ent-participant-card.needs-attention{
  border-color: var(--tone-warning-border);
  background:
    linear-gradient(
      180deg,
      var(--tone-warning-bg),
      var(--surface) 46%
    );
}

.cp-ent-participant-card.is-completed{
  border-color: var(--tone-success-border);
}

.cp-ent-participant-card__head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.cp-ent-participant-card__head > div{
  min-width: 0;
}

.cp-ent-participant-card__head h3{
  margin: 0;
  font-size: var(--text-lg);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.cp-ent-participant-card__head h3 a{
  color: inherit;
  text-decoration: none;
}

.cp-ent-participant-card__head h3 a:hover{
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cp-ent-participant-card__head p{
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-size: var(--text-sm);
}

.cp-ent-participant-card__head > .badge-status{
  flex: 0 0 auto;
}

.cp-ent-participant-card__progress{
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.cp-ent-participant-card__progress .cp-seats__head{
  margin-bottom: 8px;
}

.cp-ent-participant-card__meta{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.cp-ent-participant-card__meta > span:not(.badge-status){
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cp-ent-participant-card__actions{
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: var(--space-1);
}

.cp-ent-participant-card__actions .btn{
  flex: 1 1 130px;
  justify-content: center;
}


/* ==========================================================================
   Invitaciones pendientes
   ========================================================================== */

.cp-ent-pending-grid{
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.cp-ent-pending-card{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border-color: var(--tone-warning-border);
  background:
    linear-gradient(
      180deg,
      var(--tone-warning-bg),
      var(--surface) 48%
    );
}

.cp-ent-pending-card__head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.cp-ent-pending-card__head > div{
  min-width: 0;
}

.cp-ent-pending-card__head h3{
  margin: 0 0 8px;
  font-size: var(--text-base, 1rem);
  overflow-wrap: anywhere;
}

.cp-ent-pending-card__head h3 a{
  color: inherit;
  text-decoration: none;
}

.cp-ent-pending-card__head h3 a:hover{
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cp-ent-pending-card__meta{
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.cp-ent-pending-card__actions{
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: auto;
}

.cp-ent-pending-card__actions .btn{
  flex: 1 1 140px;
  justify-content: center;
}


/* ==========================================================================
   Supervisores
   ========================================================================== */

.cp-ent-seats-supervisors{
  margin-top: var(--space-5);
  padding: var(--space-4);
}

.cp-ent-supervisor-grid{
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.cp-ent-supervisor-card{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface-2);
}

.cp-ent-supervisor-card > header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.cp-ent-supervisor-card h3{
  min-width: 0;
  margin: 0;
  font-size: var(--text-base, 1rem);
  overflow-wrap: anywhere;
}

.cp-ent-supervisor-card h3 a{
  color: inherit;
  text-decoration: none;
}

.cp-ent-supervisor-card h3 a:hover{
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cp-ent-supervisor-card__meta{
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.cp-ent-supervisor-card footer{
  margin-top: auto;
}

.cp-ent-supervisor-card footer .btn{
  width: 100%;
  justify-content: center;
}


/* ==========================================================================
   Estado vacío
   ========================================================================== */

.cp-ent-empty{
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: var(--space-4);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  text-align: center;
}

.cp-ent-empty p{
  max-width: 54ch;
  margin: 0;
}


/* ==========================================================================
   Paginación
   ========================================================================== */

.cp-ent-participant-pagination{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.cp-ent-participant-pagination__actions{
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}


/* ==========================================================================
   Compatibilidad temporal
   ========================================================================== */

/*
 * Se conservan estas clases porque pueden seguir apareciendo en
 * versiones anteriores de la vista o en fragmentos relacionados.
 */

.cp-ent-seats-license{
  margin-bottom: var(--space-4);
}

.cp-ent-seats-license__head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.cp-ent-seats-license__title{
  margin: 4px 0 0;
  font-size: var(--text-lg);
  font-weight: 700;
}

.cp-ent-seats-license__quota{
  min-width: 200px;
}

.cp-ent-seats-license__avail{
  margin: 6px 0 0;
  font-size: var(--text-sm);
}

.cp-ent-seats-layout{
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}


/* ==========================================================================
   Responsive · escritorio mediano
   ========================================================================== */

@media (max-width: 1100px){

  .cp-ent-participant-summary{
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

  .cp-ent-participant-grid{
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .cp-ent-supervisor-grid{
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}


/* ==========================================================================
   Responsive · tablet
   ========================================================================== */

@media (max-width: 860px){

  .cp-ent-seats-license-summary__grid{
    grid-template-columns: 1fr;
  }

  .cp-ent-seats-license-summary__dates{
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .cp-ent-seats-invite__grid{
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .cp-ent-seats-invite__submit{
    align-items: stretch;
  }

  .cp-ent-seats-invite__submit .btn{
    width: 100%;
  }

  .cp-ent-pending-grid{
    grid-template-columns: 1fr;
  }

  .cp-ent-seats-layout{
    grid-template-columns: 1fr;
  }

}


/* ==========================================================================
   Responsive · móvil grande
   ========================================================================== */

@media (max-width: 680px){

  .cp-ent-seats-hero{
    flex-direction: column;
    align-items: stretch;
  }

  .cp-ent-seats-hero::after{
    width: 100%;
  }

  .cp-ent-seats-hero > .btn{
    width: 100%;
    justify-content: center;
  }

  .cp-ent-seats-license-summary__head,
  .cp-ent-seats-panel__head{
    flex-direction: column;
    align-items: stretch;
  }

  .cp-ent-seats-panel__head > .badge-status{
    align-self: flex-start;
  }

  .cp-ent-participant-summary{
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .cp-ent-seats-invite__grid{
    grid-template-columns: 1fr;
  }

  .cp-ent-participant-search{
    grid-template-columns: 1fr;
  }

  .cp-ent-participant-search .btn{
    width: 100%;
    justify-content: center;
  }

  .cp-ent-participant-grid,
  .cp-ent-supervisor-grid{
    grid-template-columns: 1fr;
  }

  .cp-ent-participant-pagination{
    align-items: stretch;
    flex-direction: column;
  }

  .cp-ent-participant-pagination__actions{
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .cp-ent-participant-pagination__actions .btn{
    width: 100%;
    justify-content: center;
  }

}


/* ==========================================================================
   Responsive · móvil pequeño
   ========================================================================== */

@media (max-width: 440px){

  .cp-ent-seats-panel,
  .cp-ent-seats-invite,
  .cp-ent-seats-license-summary,
  .cp-ent-seats-supervisors{
    padding: var(--space-3);
  }

  .cp-ent-participant-summary{
    grid-template-columns: 1fr;
  }

  .cp-ent-seats-license-summary__dates{
    grid-template-columns: 1fr;
  }

  .cp-ent-seats-license-summary__dates > div{
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .cp-ent-seats-license-summary__dates dd{
    text-align: left;
  }

  .cp-ent-participant-card__head,
  .cp-ent-pending-card__head,
  .cp-ent-supervisor-card > header{
    flex-direction: column;
    align-items: flex-start;
  }

  .cp-ent-participant-card__actions,
  .cp-ent-pending-card__actions{
    flex-direction: column;
  }

  .cp-ent-participant-card__actions .btn,
  .cp-ent-pending-card__actions .btn{
    width: 100%;
    flex-basis: auto;
  }

  .cp-ent-participant-pagination__actions{
    grid-template-columns: 1fr;
  }

}


/* ==========================================================================
   Accesibilidad y preferencias de movimiento
   ========================================================================== */

@media (prefers-reduced-motion: reduce){

  .cp-ent-participant-card,
  .cp-seats__fill{
    transition: none;
  }

  .cp-ent-participant-card:hover{
    transform: none;
  }

}

.cp-ent-seats-invite__submit .btn:disabled{
  cursor: not-allowed;
  opacity: .58;
}

.cp-seats__bar--unlimited{
  position: relative;
  overflow: hidden;
}

.cp-seats__bar--unlimited .cp-seats__fill{
  width: 100%;
  opacity: .28;
}