
:root {
  --navy:        #0E1A2E;
  --navy-deep:   #0A1322;
  --yellow:      #F5C518;
  --text-primary:   #E8EDF5;
  --text-secondary: #B6C3DD;
  --text-muted:     #8895AE;
  --border:        rgba(255,255,255,.07);
  --border-bright: rgba(255,255,255,.14);
  --card-bg:       #172B4A;
  --red:           #F87171;
  --red-bg:        rgba(220,60,60,.12);
  --green-bright:  #34D399;
  --amber:         #FCD34D;
  --yellow-soft:   #B8860B;
  --field-bg:      rgba(0,0,0,.25);
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Light-theme overrides */
[data-theme="light"] {
  --navy:           #F5F7FA;
  --navy-deep:      #EEF1F6;
  --card-bg:        #FFFFFF;
  --text-primary:   #0A1628;
  --text-secondary: #475569;
  --text-muted:     #64748B;
  --border:         rgba(10,22,40,.10);
  --border-bright:  rgba(10,22,40,.18);
  --red:            #B71C1C;
  --red-bg:         rgba(183,28,28,.10);
  --green-bright:   #1F7A34;
  --amber:          #B45309;
  /* Fields were a hard-coded rgba(0,0,0,.25): on the light theme (the default
     since 2026-10-07) that rendered every input a heavy grey. */
  --field-bg:       #FFFFFF;
}
[data-theme="light"] .nav { background: rgba(255,255,255,.85); }
[data-theme="light"] .brand .name b,
[data-theme="light"] .brand-fallback .q { color: var(--gold); }
[data-theme="light"] .nav-back:hover { background: rgba(10,22,40,.05); }
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--navy);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(14,26,46,.6);
  backdrop-filter: blur(12px);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-primary); text-decoration: none;
}
.brand img { height: 30px; }
.brand .name { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.brand .name b { color: var(--gold); font-weight: 700; }
.brand-fallback { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15.5px; }
.brand-fallback .tri { width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 16px solid var(--gold); }
.brand-fallback .q { color: var(--gold); }
.nav-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 14px; border-radius: 6px;
}
.nav-back:hover { color: var(--text-primary); background: rgba(255,255,255,.04); }

/* Theme toggle (shared widget) */
.nav-right { display: flex; align-items: center; gap: 14px; }
.theme-toggle {
  display: inline-flex; gap: 2px;
  padding: 2px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 6px;
}
[data-theme="light"] .theme-toggle { background: rgba(10,22,40,.04); }
.theme-toggle button {
  background: transparent; border: none;
  padding: 4px 9px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  font-family: inherit;
}
.theme-toggle button:hover { color: var(--text-primary); }
/* Active state comes from trust-slate.css (blue wash). */

main { flex: 1; max-width: 1080px; margin: 0 auto; padding: 32px 28px 64px; width: 100%; }

.page-head { margin-bottom: 24px; }
.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--yellow);
  letter-spacing: .14em; text-transform: uppercase;
  margin-bottom: 8px;
}
.page-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -.015em; }
.page-head p { font-size: 14px; color: var(--text-secondary); margin-top: 6px; line-height: 1.55; }

.toast {
  display: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.toast.show { display: block; }
.toast.ok    { background: rgba(52,211,153,.10); border: 1px solid rgba(52,211,153,.30); color: var(--green-bright); }
.toast.error { background: var(--red-bg); border: 1px solid rgba(220,60,60,.30); color: var(--red); }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: 22px;
}
.card h2 {
  font-size: 16px; font-weight: 600;
  margin-bottom: 4px;
}
.card h2 .count {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text-muted);
  margin-left: 8px;
  font-weight: 400;
}
.card .lead { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; line-height: 1.55; }

/* Invite form — horizontal on wide, stacked on narrow */
.invite-form {
  display: grid;
  grid-template-columns: 1fr 180px auto;
  gap: 12px;
  align-items: end;
  margin-top: 6px;
}
@media (max-width: 720px) {
  .invite-form { grid-template-columns: 1fr; }
}
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  padding: 10px 13px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
}
.field input:focus, .field select:focus { outline: 2px solid var(--yellow); outline-offset: -1px; }

.btn {
  padding: 10px 18px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, opacity .15s;
}
/* The one gold action on this screen (v3 gold discipline). */
.btn-primary { background: var(--gold-fill); color: var(--cta-on); border: none; }
.btn-primary:hover:not(:disabled) { background: var(--gold); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border-bright);
}
.btn-ghost:hover { color: var(--text-primary); border-color: rgba(255,255,255,.25); }
.btn-danger {
  background: transparent; color: var(--red);
  border: 1px solid rgba(220,60,60,.40);
}
.btn-danger:hover { background: var(--red-bg); }
.btn-row { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.btn-sm { padding: 5px 11px; font-size: 12px; }

/* Table */
.table-wrap { overflow-x: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}
th {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 500;
}
tr:last-child td { border-bottom: none; }
.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
  letter-spacing: .04em;
}
.pill-yellow { background: var(--blue-wash); border: 1px solid var(--blue-bd); color: var(--blue); }
.pill-blue   { background: var(--blue-wash); border: 1px solid var(--blue-bd); color: var(--blue); }
.pill-grey   { background: var(--unk-wash); border: 1px solid var(--unk-bd); color: var(--unk); }
.pill-green  { background: var(--ok-wash); border: 1px solid var(--ok-bd); color: var(--ok); }
.pill-red    { background: var(--crit-wash); border: 1px solid var(--crit-bd); color: var(--crit); }
.pill-amber  { background: var(--warn-wash); border: 1px solid var(--warn-bd); color: var(--warn); }

.self-marker {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--blue-wash);
  border: 1px solid var(--blue-bd);
  color: var(--blue);
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.email { font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); }
.muted { color: var(--text-muted); }

#loading { text-align: center; padding: 60px 0; color: var(--text-muted); font-size: 14px; }
.empty { text-align: center; padding: 30px 0; color: var(--text-muted); font-size: 13px; }

/* GDPR erase modal — mirrors admin.html Danger zone. */
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  align-items: center; justify-content: center;
  z-index: 50;
}
.overlay.open { display: flex; }
.modal {
  background: var(--card-bg);
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  padding: 22px 24px 20px;
  width: min(560px, 92vw);
  max-height: 90vh; overflow: auto;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}
.modal h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.modal .sub { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; font-family: var(--font-mono); }
.danger-zone {
  background: var(--red-bg);
  border: 1px solid rgba(220,60,60,.30);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12.5px; color: var(--text-secondary);
  line-height: 1.55;
}
.danger-zone strong { color: var(--red); }
.danger-zone code { font-family: var(--font-mono); font-size: 11.5px; }
.radio-row { display: flex; flex-direction: column; gap: 10px; }
.radio-row > label { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; }
.radio-row strong { display: block; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.radio-row .hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.5; }
/* The caption style above (.field label: mono, uppercase, 11px) also matched the
   option labels inside the erase dialog's .field, so both modes rendered as
   upper-case monospace paragraphs. Option labels are prose. */
.field .radio-row > label {
  font-family: var(--font-sans); font-size: 13px; letter-spacing: normal;
  text-transform: none; color: var(--text-secondary); margin-bottom: 0;
}
.field .radio-row input[type="radio"] {
  width: auto; flex: none; margin: 3px 0 0; padding: 0;
  background: none; border: 0;   /* .field input sized it like a text field */
}
.modal .field input[type="text"] {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  padding: 10px 13px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
}
.modal .field input[type="text"]:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.modal .field code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--blue-wash);
  border: 1px solid var(--blue-bd);
  color: var(--blue);
  padding: 1px 6px; border-radius: 3px;
}
.status-msg {
  display: block;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  min-height: 1.4em;
}
.status-msg.ok  { color: var(--green-bright); }
.status-msg.err { color: var(--red); }
.modal-foot {
  display: flex; justify-content: flex-end;
  gap: 10px; margin-top: 18px;
}
.btn-quiet {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border-bright);
  padding: 9px 16px; border-radius: 6px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.btn-quiet:hover { color: var(--text-primary); border-color: rgba(255,255,255,.25); }
.modal .btn-danger {
  padding: 9px 16px; border-radius: 6px;
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.modal .btn-danger:disabled { opacity: .5; cursor: not-allowed; }

/* Per-row Reactivate (link-styled) + Export icon */
.btn-link {
  background: transparent; border: none; padding: 5px 7px;
  font-family: var(--font-sans); font-size: 12.5px;
  color: var(--text-secondary); cursor: pointer;
}
.btn-link:hover { color: var(--text-primary); text-decoration: underline; }
.btn-link.danger { color: var(--red); }

/* Inline-style migration (toward dropping style-src 'unsafe-inline'). Toggled
   elements use the native `hidden` attribute; the rest use these classes. */
.lg-rbac { margin-top: 14px; font-size: 12.5px; color: var(--text-secondary, #8A97B1); }
.lg-rbac-sum { cursor: pointer; user-select: none; }
.lg-rbac-list { margin: 8px 0 0; padding-left: 18px; line-height: 1.6; }
.lg-mt14 { margin-top: 14px; }
.lg-mt10 { margin-top: 10px; }
