/* admin_codes_table.css */

#section-admin-codes .team-table {
  min-width: 900px;
  font-size: .82rem;
}

#section-admin-codes .team-table thead th {
  font-size: .80rem;
  line-height: 1.3;
  white-space: normal;
  padding: 10px 10px;
}

#section-admin-codes .team-table tbody td {
  font-size: .82rem;
  white-space: normal;
  word-break: break-word;
  padding: 10px 10px;
  vertical-align: middle;
}

#section-admin-codes .team-table .ac-cell-nowrap {
  white-space: nowrap;
  text-align: center;
}

#section-admin-codes .team-table .ac-cell-date {
  white-space: nowrap;
  text-align: center;
  color: #6b7280;
  font-size: .80rem;
}

#section-admin-codes .team-table .ac-cell-email {
  word-break: break-all;
  font-size: .82rem;
}

/* Бейдж статуса */
.ac-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: .79rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.ac-badge--pending   { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.ac-badge--generated { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.ac-badge--sent      { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.ac-badge--blocked   { background: #fff0f0; color: #8b1e1e; border-color: #fecaca; }

/* Кнопка блокировки */
.ac-btn-block {
  color: #dc2626;
  border: 1.5px solid #fecaca;
  border-radius: 8px;
  padding: 4px 8px;
  background: #fff;
  cursor: pointer;
  font-size: .85rem;
  transition: background .12s;
}
.ac-btn-block:hover:not(:disabled) { background: #fff0f0; }
.ac-btn-block:disabled { opacity: .4; cursor: not-allowed; }

/* Toast */
.ac-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ac-toast {
  border-radius: 12px;
  padding: 12px 18px;
  font-size: .92rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
  min-width: 260px;
  border: 1px solid transparent;
}
.ac-toast--success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.ac-toast--danger  { background: #fff0f0; color: #8b1e1e; border-color: #fecaca; }
.ac-toast--warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }

/* Модалка для просмотра файла — широкая */
#modal-ac-file .security-modal-box {
  max-width: 820px;
}

/* Отключаем fixed layout из team_table.css для нашей таблицы */
#section-admin-codes .team-table {
  table-layout: auto !important;
  min-width: 860px;
}

/* Колонки с кнопками — минимальная ширина чтобы не обрезались */
#section-admin-codes .team-table thead th:nth-child(5),
#section-admin-codes .team-table thead th:nth-child(7),
#section-admin-codes .team-table thead th:nth-child(8),
#section-admin-codes .team-table thead th:nth-child(10) {
  min-width: 72px;
  width: auto;
}

/* Колонка "Отправить код" — чуть шире */
#section-admin-codes .team-table thead th:nth-child(8) {
  min-width: 90px;
}

/* Колонка "Статус" */
#section-admin-codes .team-table thead th:nth-child(9) {
  min-width: 95px;
}

/* На широких экранах убираем горизонт. скролл */
@media (min-width: 1100px) {
  #section-admin-codes .team-table-wrap {
    overflow-x: auto;
  }
  #section-admin-codes .team-table {
    width: 100% !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Hero-карточка на мобильных */
  #section-admin-codes .overview-card--hero {
    flex-direction: column;
    gap: 12px;
  }
  
  #section-admin-codes .overview-card--hero > div:last-child {
    margin-left: 0 !important;
    padding-left: 0 !important;
    width: 100%;
  }

  /* Панель поиска и фильтров */
  #section-admin-codes .team-control-row {
    flex-direction: column;
    gap: 10px;
  }

  #section-admin-codes .team-control-actions {
    width: 100%;
    justify-content: space-between;
  }

  #section-admin-codes #ac-filter-status {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Таблица: горизонтальный скролл */
  #section-admin-codes .team-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #section-admin-codes .team-table {
    min-width: 860px;
    font-size: .78rem;
  }

  #section-admin-codes .team-table thead th {
    font-size: .75rem;
    padding: 8px 6px;
  }

  #section-admin-codes .team-table tbody td {
    font-size: .78rem;
    padding: 8px 6px;
  }

  /* Кнопки компактнее */
  #section-admin-codes .btn-sm {
    padding: 3px 6px;
    font-size: .8rem;
  }

  /* Модалки на весь экран */
  #modal-ac-file .security-modal-box,
  #modal-ac-block .security-modal-box {
    max-width: calc(100vw - 20px);
    margin: 10px;
  }
}

@media (max-width: 576px) {
  /* На очень маленьких экранах ещё компактнее */
  #section-admin-codes .team-table {
    font-size: .72rem;
  }

  #section-admin-codes .team-table thead th {
    font-size: .70rem;
    padding: 6px 4px;
  }

  #section-admin-codes .team-table tbody td {
    font-size: .72rem;
    padding: 6px 4px;
  }

  #section-admin-codes .overview-title {
    font-size: 1.3rem;
  }

  #section-admin-codes .overview-subtitle {
    font-size: .85rem;
  }
}
