.admin-table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th,
.admin-table td {
  padding: 8px 5px;
  border-bottom: 1px solid #303030;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  background: #141414;
  font-size: 10px;
  font-weight: normal;
  letter-spacing: .1em;
  white-space: nowrap;
}

.admin-table tbody tr:hover > td { background: #1b1616; }
.admin-table .account-cell { color: var(--cream); font-family: ui-monospace, Consolas, monospace; }
.admin-table .control { width: 96px; padding: 5px 6px; font-size: 11px; }
.admin-table .actions-cell { min-width: 128px; }

.identity-list,
.row-actions,
.game-actions,
.segment-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.identity-chip { cursor: default; }
.identity-empty { color: #666; font-size: 11px; font-style: italic; }

.identity-editor-cell { padding: 12px 14px 16px !important; background: #111 !important; }
.identity-editor { border-color: #3d0002; background: #151010; box-shadow: none; }
.identity-editor .form-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }

.flag-toggle {
  display: inline-flex;
  min-width: 72px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #444;
  border-radius: 12px;
  background: var(--control-dim);
  color: var(--muted);
  padding: 4px 9px;
  font-size: 10px;
  letter-spacing: .08em;
  cursor: pointer;
}

.flag-toggle::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #555;
  content: "";
}

.flag-toggle.active { border-color: var(--amber); color: var(--amber); background: #211a08; }
.flag-toggle.active::before { background: var(--amber); box-shadow: 0 0 6px rgba(232,163,61,.65); }
.flag-toggle.banned.active { border-color: var(--heading); color: #ffd9d9; background: #2a0002; }
.flag-toggle.banned.active::before { background: var(--heading); }
.flag-toggle:disabled { opacity: .55; cursor: not-allowed; }

.status-badge { cursor: default; }
.status-badge.in-game { border-color: #1a6b32; background: #122c14; color: #c9e8c9; cursor: pointer; }
.status-badge.in-game:hover { border-color: var(--green); }

.btn.danger { border-color: #b52d32; background: #5a0004; color: #fff; }
.btn.compact { padding: 4px 9px; font-size: 10px; }

.message-banner { margin-bottom: 2px; }
.message-banner.error { border-color: #ff4d4d; background: #2a0002; color: #ffd9d9; }

.game-row { gap: 9px; }
.game-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.game-matchup { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.game-side { border: 1px solid #303030; border-radius: 4px; background: var(--row); padding: 8px 10px; }
.game-side strong { display: block; color: var(--cream); font-weight: normal; }
.game-side span { color: var(--muted); font-size: 11px; }

.segment-group .chip { border-radius: 4px; }
.rail-form { display: flex; flex-direction: column; gap: 9px; }
.rail-form .btn { align-self: flex-start; }

.team-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.team-search-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 310px;
  overflow-y: auto;
}

.team-result {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  border: 1px solid #343434;
  border-radius: 4px;
  background: var(--row);
  color: var(--text);
  padding: 9px 11px;
  text-align: left;
  cursor: pointer;
}

.team-result:hover,
.team-result.active { border-color: var(--carmine); background: #2a0002; }
.team-result-name { overflow: hidden; color: var(--cream); text-overflow: ellipsis; white-space: nowrap; }
.team-result-meta,
.team-player-detail { display: block; color: var(--muted); font-size: 10px; line-height: 1.4; }
.team-player-name { display: block; color: var(--cream); }

.team-editor-head { border-color: #8a3a3d; }
.team-metrics,
.team-resource-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.team-metrics > div,
.team-resource {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  border: 1px solid #303030;
  border-radius: 4px;
  background: var(--row);
  padding: 9px 10px;
}

.team-metrics span,
.team-resource > span { color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.team-metrics strong,
.team-resource strong { overflow-wrap: anywhere; color: var(--cream); font-weight: normal; }
.team-resource .row-actions { margin-top: auto; }
.team-df-field { max-width: 150px; }
.team-player-table { min-width: 960px; }
.journeyman-grid { display: flex; flex-wrap: wrap; gap: 12px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.78);
}

.admin-modal {
  width: min(720px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 10px 34px rgba(0,0,0,.8);
  padding: 18px;
}

.modal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-head .section-title { flex: 1; }

.reports-layout {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
  gap: 12px;
  align-items: start;
}

.report-list {
  display: flex;
  max-height: calc(100vh - 190px);
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
}

.report-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px solid #343434;
  border-radius: 4px;
  background: var(--row);
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.report-row:hover,
.report-row.active { border-color: var(--carmine); background: #2a0002; }
.report-row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.report-row-head strong { color: var(--cream); font-weight: normal; }
.report-row-meta { color: var(--muted); font-size: 10px; line-height: 1.4; }
.report-status { cursor: default; }
.report-status.new { border-color: var(--heading); color: #ffd4d4; }
.report-status.triaged,
.report-status.in-progress { border-color: var(--amber); color: var(--amber); }
.report-status.resolved,
.report-status.closed { border-color: var(--green); color: #c9e8c9; }
.report-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.report-facts > div { display: flex; min-width: 0; flex-direction: column; gap: 4px; border: 1px solid #303030; border-radius: 4px; background: var(--row); padding: 8px; }
.report-facts span { color: var(--muted); font-size: 10px; }
.report-facts strong { overflow-wrap: anywhere; color: var(--cream); font-weight: normal; }
.report-description { margin: 10px 0; border-left: 3px solid var(--carmine); background: #161111; padding: 10px 12px; white-space: pre-wrap; }
.report-triage-grid { margin-top: 12px; grid-template-columns: 1fr; }
.report-wide { grid-column: 1 / -1; }
.report-wide textarea { width: 100%; resize: vertical; }
.report-screenshot { margin: 10px 0; padding: 8px; border: 1px solid #303030; border-radius: 4px; background: #101010; }
.report-screenshot img { display: block; width: auto; max-width: 100%; max-height: 360px; margin: 0 auto; object-fit: contain; }

@media (max-width: 760px) {
  .identity-editor .form-grid,
  .game-matchup,
  .team-search-results,
  .team-metrics,
  .team-resource-grid { grid-template-columns: 1fr; }
  .team-search-bar { grid-template-columns: 1fr; }
  .reports-layout,
  .report-facts { grid-template-columns: 1fr; }
}
