/*
 * Estilos propios de la zona «channels». Los componentes comunes están en app.css:
 * aquí sólo lo que no reutiliza ninguna otra pantalla.
 */

/* ---- Cabecera: «Añadir bot» abre la elección de tipo ---- */

.channels-add > summary {
  cursor: pointer;
}

.channels-add .menu {
  min-width: 220px;
}

/* ---- Matriz agente × canal ---- */

.channels-matrix {
  min-width: 720px;
}

.channels-matrix__agent {
  width: 28%;
}

.channels-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  max-width: 100%;
  color: inherit;
}

.channels-cell:hover .tag {
  box-shadow: 0 0 0 1px currentColor;
}

.channels-cell--none {
  color: var(--border-strong);
  font-weight: 700;
  padding: 3px 10px;
}

.channels-cell--none:hover {
  color: var(--brand-primary);
}

.channels-cell .tag {
  padding: 3px 10px;
}

.channels-cell__pending {
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
}

/* ---- Bots ---- */

.channels-bots {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.channels-bot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.channels-bot__name {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
}

.channels-bot__name a {
  color: var(--text-primary);
}

.channels-bot__name a:hover {
  color: var(--brand-primary);
}

.channels-bot__handle {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.channels-bot__error {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

.channels-bot__facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: 13.5px;
}

.channels-bot__facts dt {
  font-weight: 700;
  color: var(--text-muted);
}

.channels-bot__facts dd {
  margin: 0;
  min-width: 0;
}

.channels-bot__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}

.channels-bot__actions form {
  margin: 0;
}

.channels-kinds {
  justify-content: center;
}

/* ---- Ajustes ---- */

.channels-settings {
  max-width: 720px;
}

.channels-settings form {
  margin: 0;
  padding: 24px;
  gap: 16px;
}

.channels-settings__now {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ---- Alta de un bot: el tipo y los pasos ---- */

.bot-kinds {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.bot-kind {
  padding: 12px;
  border: 1.5px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.bot-kind:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.bot-kind[aria-current="page"] {
  border-color: var(--brand-primary);
  background: var(--neutral-25);
  color: var(--brand-primary);
}

.bot-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.bot-step {
  display: flex;
  gap: 14px;
}

.bot-step__n {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--brand-primary-bg);
  color: var(--brand-primary);
  font-size: 12.5px;
  font-weight: 700;
}

.bot-step__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 3px;
}

.bot-step__title {
  font-size: 14.5px;
  font-weight: 700;
}

.bot-step__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.bot-step__body .field + .field {
  margin-top: 4px;
}

/* ---- Ficha de un bot ---- */

.bot-stat {
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
}

.bot-copy {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.bot-copy__value {
  user-select: all;
  white-space: normal;
  overflow-wrap: anywhere;
}

.bot-copy .field__label:not(:first-child) {
  margin-top: 8px;
}

.bot-form-grid {
  margin: 18px 0;
}

.bot-howto > summary,
.bot-rooms__help > summary {
  align-items: center;
}

.bot-howto[open] > summary {
  border-bottom: 1px solid var(--divider);
  padding-bottom: 16px;
}

.bot-howto > .card__body {
  padding-top: 20px;
}

/* ---- Salas de Discord ---- */

.bot-rooms__help > summary {
  flex-wrap: nowrap;
}

.bot-rooms__help .card__action {
  white-space: nowrap;
  color: var(--brand-primary);
}

.bot-rooms__rules {
  margin: 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.card > .bot-rooms__help + .table-wrap {
  border-top: 1px solid var(--divider);
  border-radius: 0;
}

.bot-rooms__error {
  color: var(--danger);
  max-width: 46ch;
}

.bot-rooms__new {
  padding: 16px 20px;
}

.bot-rooms__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.bot-rooms__fields .field {
  flex: 1 1 14rem;
}

.bot-rooms__fields .field + .field {
  margin-top: 0;
}

.bot-rooms__actions {
  flex-wrap: nowrap;
}

.bot-rooms__actions form {
  margin: 0;
}

/* Las etiquetas .sr-only de las cabeceras se posicionan contra el recuadro con scroll:
   sin esto se salen de él y ensanchan la página en el móvil. */
.channels-wrap {
  position: relative;
}
