/* IAM Utility Portal — supplemental styles */

body {
  background-color: #f8f9fa;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

/* ── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
  border-bottom: 3px solid #0d6efd;
}

/* ── Sticky action bar ───────────────────────────────────────────────── */
.action-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #dee2e6;
  /* Compensate for container padding */
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  padding: 8px 1.5rem 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.07);
}

/* Each horizontal strip inside the action bar */
.ab-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
}

/* A cluster of related controls within a row */
.ab-group {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

/* ── Table ───────────────────────────────────────────────────────────── */

/* Constrain the table wrapper to a portion of the viewport height so it
   becomes its own vertical scroll container. This is the only reliable way
   to get position:sticky on thead to work alongside Bootstrap's
   table-responsive (which sets overflow-x:auto and breaks page-level sticky). */
#apps-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 260px); /* 260px ≈ 3-row action-bar (~120px) + nav + margins */
}

#apps-table {
  font-size: 13px;
}

/* Freeze the entire header row at the top of the scroll container */
#apps-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

#apps-table thead th {
  white-space: nowrap;
  vertical-align: middle;
  background-color: #212529; /* Bootstrap table-dark bg — prevents row bleed-through */
  color: #fff;
}

/* Sortable column headers */
#apps-table thead th.th-sortable {
  cursor: pointer;
  user-select: none;
}
#apps-table thead th.th-sortable:hover {
  background-color: #2c3e50;
}
#apps-table thead th.th-sorted {
  background-color: #1a2d40;
}
.sort-indicator {
  font-size: 0.75em;
  vertical-align: middle;
}

#apps-table td {
  vertical-align: middle;
  word-break: break-word;
}

/* Report ID column — kept in DOM for backend use, hidden from users */
.col-report-id {
  display: none;
}

/* Backup Owners column can be long — allow wrapping at comma boundaries */
#apps-table td:nth-child(5) {
  max-width: 220px;
  overflow-wrap: break-word;
}

/* ── Justification input ─────────────────────────────────────────────── */
.justification-input {
  min-width: 200px;
  max-width: 400px;
}

/* ── Badges & row count ─────────────────────────────────────────────── */
#row-count {
  font-size: 0.8rem;
}

/* ── Alert area ──────────────────────────────────────────────────────── */
#alert-area .alert {
  max-width: 800px;
}

/* ── Loading / sign-in panels ────────────────────────────────────────── */
#loading-panel,
#signin-panel {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
