:root {
  --bg: #ffffff;
  --panel: #f4f5f7;
  --border: #e1e4ea;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #2f6fed;
  --row-alt: #f7f8fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", -apple-system, sans-serif;
}

header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 2;
}

header h1 {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
}

#team-name {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9rem;
}

.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.controls select,
.controls button {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.controls button {
  cursor: pointer;
}

.controls button:hover {
  border-color: var(--accent);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

#status {
  color: var(--muted);
  font-size: 0.75rem;
}

main {
  padding: 0 1.5rem 2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.88rem;
}

thead th {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 58px;
  background: var(--bg);
}

tbody tr {
  border-bottom: 1px solid var(--border);
}

tbody tr.group-first {
  border-top: 1px solid var(--border);
}

tbody td {
  padding: 0.55rem 0.9rem;
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: var(--row-alt);
}

td.group-cell {
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.roles-cell {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

td.rule-cell {
  color: var(--muted);
  font-size: 0.82rem;
}

td.account-cell {
  color: var(--text);
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-right: 0.25rem;
  white-space: nowrap;
}

.badge.mfa {
  background: rgba(232, 161, 60, 0.18);
  color: #8a5a12;
}

.badge.gateway {
  background: rgba(47, 111, 237, 0.12);
  color: #1c4fc2;
}

.badge.none {
  color: var(--muted);
}

.empty-note {
  color: var(--muted);
  font-style: italic;
}

tr.row-dimmed {
  opacity: 0.35;
}

tr.row-hidden {
  display: none;
}
