/* ==========================================================================
   INFERNO 2026 — ADMIN DASHBOARD STYLESHEET
   Protected Route / Admin Modal & Dashboard
   ========================================================================== */

.admin-view-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary);
  z-index: 5000;
  overflow-y: auto;
  display: none;
}

.admin-view-wrapper.open {
  display: block;
}

/* .modal-backdrop (components.css) is z-index: 2000, which sits behind
   .admin-view-wrapper's z-index: 5000 — as siblings under <body>, both
   fixed-position, the higher value wins regardless of DOM order. Without
   this, #editRegModal/#deleteConfirmModal render fully invisible (hidden
   behind the opaque wrapper) despite otherwise working correctly. */
#editRegModal, #deleteConfirmModal {
  z-index: 5100;
}

.admin-top-nav {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 100;
}

.admin-brand {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-badge {
  background: var(--text-primary);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.1em;
}

.admin-main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}

/* Form primitives — admin.html doesn't load registration.css, so these
   (used by the login form and the edit-registration modal) are defined
   here rather than pulling in that file's ~200 lines of wizard/stepper CSS
   that admin.html has no use for. */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 650px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.form-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-align: left;
}

.form-input {
  width: 100%;
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-secondary);
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: transparent;
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
}

textarea.form-input {
  resize: vertical;
  min-height: 5rem;
}

/* Auth Gate */
.admin-auth-gate {
  max-width: 440px;
  margin: 6rem auto;
  padding: 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.admin-auth-gate::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-fire), var(--accent-cyan));
}

.admin-auth-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1.5rem;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .input-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  opacity: 0.55;
  pointer-events: none;
}

.input-icon-wrap .form-input {
  padding-left: 2.75rem;
}

/* Metrics KPI Cards */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.metric-num {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--text-primary);
  line-height: 1;
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

@media (max-width: 1100px) {
  .admin-metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 700px) {
  .admin-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Toolbar & Filters */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-search-wrapper {
  flex-grow: 1;
  min-width: 260px;
  position: relative;
}

.admin-search-wrapper .search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  opacity: 0.5;
  pointer-events: none;
}

.admin-search-input {
  width: 100%;
  padding: 0.85rem 2.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background-color: #FFFFFF;
  font-size: 0.88rem;
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-search-input::placeholder {
  color: var(--text-secondary);
}

.admin-search-input:focus {
  border-color: transparent;
  box-shadow: 0 0 0 3px var(--accent-fire-light);
}

.search-clear-btn {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:hover {
  background: var(--text-primary);
  color: #FFFFFF;
}

.admin-filters-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-filter-select {
  padding: 0.65rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Table */
.admin-table-container {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow-x: hidden;
  box-shadow: var(--shadow-subtle);
  width: 100%;
}

.admin-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.admin-table th {
  background: var(--bg-secondary);
  padding: 1rem 0.9rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  overflow-wrap: break-word;
}

.admin-table td {
  padding: 1rem 0.9rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
  overflow-wrap: break-word;
  word-break: break-word;
}

.admin-table td .badge {
  white-space: nowrap;
}

.admin-table tr:hover td {
  background-color: var(--bg-secondary);
}

/* Below this width, columns get too cramped for a fixed table layout to
   stay readable — switch each row to a stacked card instead of letting the
   table force horizontal scroll. */
@media (max-width: 860px) {
  .admin-table thead {
    display: none;
  }

  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
    display: block;
    width: 100% !important;
  }

  .admin-table tr {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    padding: 0.5rem 0;
  }

  .admin-table td {
    border-bottom: none;
    padding: 0.5rem 1rem;
    text-align: right;
  }

  .admin-table td.col-checkbox {
    text-align: left;
  }

  .admin-table td[data-label]::before {
    content: attr(data-label);
    float: left;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
  }

  .admin-table td .admin-action-group {
    justify-content: flex-end;
  }
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-confirmed {
  background: #E8F5E9;
  color: #2E7D32;
}

.status-pending {
  background: #FFF8E1;
  color: #F57F17;
}

.status-rejected {
  background: #FFEBEE;
  color: #C62828;
}

.btn-status-toggle {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  background: #FFFFFF;
}

.btn-status-toggle:hover {
  border-color: var(--text-primary);
}

.admin-action-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-action-sm {
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-approve {
  background: #E8F5E9;
  color: #2E7D32;
  border-color: #C8E6C9;
}

.btn-approve:hover {
  background: #2E7D32;
  color: #FFFFFF;
}

.btn-reject {
  background: #FFF3E0;
  color: #E65100;
  border-color: #FFE0B2;
}

.btn-reject:hover {
  background: #E65100;
  color: #FFFFFF;
}

.btn-delete {
  background: #FFEBEE;
  color: #C62828;
  border-color: #FFCDD2;
}

.btn-delete:hover {
  background: #C62828;
  color: #FFFFFF;
}

/* Sortable table headers */
.admin-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.admin-table th.sortable:hover {
  color: var(--text-primary);
}

.sort-arrow {
  display: inline-block;
  margin-left: 0.25rem;
  opacity: 0.35;
  font-size: 0.65rem;
}

.admin-table th.sortable.sort-active .sort-arrow {
  opacity: 1;
  color: var(--accent-fire);
}

.admin-table .col-checkbox {
  width: 40px;
  text-align: center;
}

.admin-table tr.row-selected td {
  background-color: var(--accent-fire-light);
}

/* Bulk action bar */
.admin-bulk-bar {
  display: none;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--text-primary);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.5rem;
  margin-bottom: 1.25rem;
}

.admin-bulk-bar.active {
  display: flex;
}

.admin-bulk-bar .bulk-count {
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: auto;
}

.btn-bulk {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-bulk:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn-bulk.bulk-danger:hover {
  background: #C62828;
  border-color: #C62828;
}

.btn-edit {
  background: var(--accent-cyan-light);
  color: var(--accent-cyan);
  border-color: rgba(0, 132, 255, 0.25);
}

.btn-edit:hover {
  background: var(--accent-cyan);
  color: #FFFFFF;
}