/* ===================================================================
   Dev Monitor — Supabase-inspired Dark Design System
   =================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  /* Backgrounds */
  --bg-page:        #171717;
  --bg-card:        #1c1c1c;
  --bg-btn-primary: #0f0f0f;

  /* Text */
  --text-primary:   #fafafa;
  --text-secondary: #b4b4b4;
  --text-muted:     #898989;

  /* Brand */
  --brand-green:        #3ecf8e;
  --brand-green-link:   #00c573;
  --brand-green-border: rgba(62, 207, 142, 0.3);

  /* Borders */
  --border-subtle:    #242424;
  --border-standard:  #2e2e2e;
  --border-prominent: #363636;

  /* Severity */
  --color-high:   #ef4444;
  --color-medium: #f59e0b;
  --color-low:    #6b7280;
  --color-purple: #8b5cf6;
  --color-blue:   #3b82f6;
  --color-green:  #22c55e;

  /* Interaction overlays */
  --nav-hover-bg:        rgba(255,255,255,0.05);
  --nav-active-bg:       rgba(255,255,255,0.08);
  --modal-close-hover-bg: rgba(255,255,255,0.06);
  --modal-overlay-bg:    rgba(0,0,0,0.7);
  --select2-shadow:      0 8px 24px rgba(0,0,0,0.4);

  /* Inline form tint */
  --inline-form-bg: rgba(62,207,142,0.04);

  /* Typography */
  --font-sans: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Source Code Pro', 'Courier New', monospace;

  /* Spacing */
  --page-padding: 10px;
  --nav-height: 56px;
}

/* ===================================================================
   Light theme
   =================================================================== */
[data-theme="light"] {
  --bg-page:        #f4f4f5;
  --bg-card:        #ffffff;
  --bg-btn-primary: #111111;

  --text-primary:   #111111;
  --text-secondary: #444444;
  --text-muted:     #888888;

  --border-subtle:    #d8d8d8;
  --border-standard:  #c8c8c8;
  --border-prominent: #aaaaaa;

  --nav-hover-bg:         rgba(0,0,0,0.04);
  --nav-active-bg:        rgba(0,0,0,0.07);
  --modal-close-hover-bg: rgba(0,0,0,0.06);
  --modal-overlay-bg:     rgba(0,0,0,0.45);
  --select2-shadow:       0 8px 24px rgba(0,0,0,0.12);

  --inline-form-bg: rgba(62,207,142,0.06);
}

/* Light theme — component colour overrides */
[data-theme="light"] .banner--info    { background: rgba(59,130,246,0.07);  color: #4b83d4; }
[data-theme="light"] .banner--success { background: rgba(34,197,94,0.07);   color: #2a9e5e; }
[data-theme="light"] .banner--warning { background: rgba(245,158,11,0.07);  color: #c48a1a; }
[data-theme="light"] .banner--error   { background: rgba(239,68,68,0.07);   color: #d95555; }
[data-theme="light"] .alert--error    { color: #d95555; }
[data-theme="light"] .alert--success  { color: #2a9e5e; }
[data-theme="light"] .badge--gray     { color: #7c8490; }
[data-theme="light"] .badge--blue     { color: #4b83d4; }
[data-theme="light"] .badge--purple   { color: #9270d6; }
[data-theme="light"] .inline-form__error { color: #d95555; }
[data-theme="light"] .select2-dropdown { box-shadow: var(--select2-shadow); }

/* Primary button: keep text white since bg is always dark (#111) */
[data-theme="light"] .btn--primary { background: var(--brand-green); color: #0a0a0a; border-color: var(--brand-green); }
/* Table rows: give a faint tint so they're distinguishable from the white card */
[data-theme="light"] .table tbody tr { background: #fafafa; }
[data-theme="light"] .table tbody tr:hover { background: #f0faf5; }
[data-theme="light"] .table th { background: #ffffff; }
/* Form inputs: slightly stronger border so they're visible on light bg */
[data-theme="light"] .form-input,
[data-theme="light"] .form-select { border-color: #cccccc; background: #ffffff; }
/* Filter dropdowns same treatment */
[data-theme="light"] .filter-bar .form-select { border-color: #cccccc; }

html { font-size: 14px; overflow-x: hidden; }

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Modern scrollbars ---- */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: var(--border-prominent); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover  { background: var(--text-muted); }
::-webkit-scrollbar-corner       { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: var(--border-prominent) transparent; }

a { color: var(--brand-green-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===================================================================
   Navigation
   =================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-standard);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
}

.nav__brand { display: flex; align-items: center; }
.nav__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: color 0.15s;
}
.nav__logo:hover { color: var(--brand-green); text-decoration: none; }
.nav__logo-icon { color: var(--brand-green); font-size: 16px; }
.nav__logo-img  { height: 24px; width: auto; display: block; }
.nav__logo-text { font-weight: 500; font-size: 15px; letter-spacing: -0.01em; display: flex; flex-direction: column; line-height: 1.2; }
.nav__logo-sub  { font-size: 10px; color: var(--text-muted); font-weight: 400; letter-spacing: 0; }

.nav__links {
  display: flex;
  list-style: none;
  gap: 4px;
  flex: 1;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: color 0.15s, background 0.15s;
}
.nav__link:hover { color: var(--text-primary); background: var(--nav-hover-bg); text-decoration: none; }
.nav__link--active { color: var(--text-primary); background: var(--nav-active-bg); }

.nav__icon { width: 16px; height: 16px; flex-shrink: 0; }

.nav__user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.nav__username { color: var(--text-muted); font-size: 13px; }

.nav__theme-toggle {
  background: none;
  border: 1px solid var(--border-standard);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px 7px;
  display: flex;
  align-items: center;
  transition: color 0.15s, border-color 0.15s;
}
.nav__theme-toggle:hover { color: var(--text-primary); border-color: var(--border-prominent); }

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}
.nav__hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
}

/* ===================================================================
   Main content
   =================================================================== */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px var(--page-padding);
}

/* ===================================================================
   Page header
   =================================================================== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.page-header__right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.page-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.check-rules   { font-size: 12px; color: var(--text-muted); margin: 0 0 16px; }

.last-checked { color: var(--text-muted); font-size: 13px; }

/* ===================================================================
   Buttons
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:hover { opacity: 0.85; text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--primary {
  background: var(--bg-btn-primary);
  color: var(--text-primary);
  border-color: var(--text-primary);
}
.btn--secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-standard);
  opacity: 0.9;
}
.btn--danger {
  background: transparent;
  color: var(--color-high);
  border-color: var(--color-high);
}
.btn--full { width: 100%; justify-content: center; }
.btn--sm { padding: 5px 14px; font-size: 12px; }
.btn--xs { padding: 3px 10px; font-size: 11px; }

/* ===================================================================
   Stat cards
   =================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-standard);
  border-radius: 8px;
  padding: 16px 14px;
}
.stat-card--link {
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: border-color 0.15s, background 0.15s;
}
.stat-card--link:hover {
  border-color: var(--brand-green-border);
  background: rgba(62, 207, 142, 0.04);
  text-decoration: none;
}
.stat-card--danger { border-color: rgba(239, 68, 68, 0.25); }
.stat-card--purple { border-color: rgba(139, 92, 246, 0.25); }
.stat-card--amber  { border-color: rgba(245, 158, 11, 0.25); }
.stat-card--gray   { border-color: rgba(113, 113, 122, 0.25); }

.stat-card__value {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-card--danger .stat-card__value { color: var(--color-high); }
.stat-card--purple .stat-card__value { color: var(--color-purple); }
.stat-card--amber  .stat-card__value { color: #f59e0b; }
.stat-card--gray   .stat-card__value { color: var(--text-muted); }

.stat-card__label { font-size: 12px; color: var(--text-muted); }

/* KPI info icon + tooltip */
.stat-card { position: relative; }
.kpi-info {
  position: absolute; top: 8px; right: 8px;
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid var(--border-standard);
  color: var(--text-muted); font-size: 10px; font-weight: 600; font-style: normal;
  display: flex; align-items: center; justify-content: center;
  cursor: default; line-height: 1; z-index: 1;
}
.kpi-info:hover { border-color: var(--text-muted); color: var(--text-secondary); }
.kpi-tooltip {
  display: none; position: absolute; z-index: 200;
  top: calc(100% + 8px); right: 0;
  width: 230px; padding: 10px 12px;
  background: var(--bg-card); border: 1px solid var(--border-prominent);
  border-radius: 8px; font-size: 12px; color: var(--text-secondary);
  line-height: 1.55; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  pointer-events: none; font-weight: 400; text-decoration: none;
}
.kpi-tooltip strong { color: var(--text-primary); display: block; margin-bottom: 4px; font-size: 12px; }
.kpi-tooltip .kpi-threshold { margin-top: 6px; color: var(--text-muted); font-size: 11px; }
.kpi-info:hover + .kpi-tooltip { display: block; }
[data-theme="light"] .kpi-tooltip { box-shadow: 0 8px 24px rgba(0,0,0,0.12); }

/* ===================================================================
   Section
   =================================================================== */
.section {
  background: var(--bg-card);
  border: 1px solid var(--border-standard);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
}
.section__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.section__title   { font-size: 14px; font-weight: 500; }
.section__subtitle { font-size: 12px; color: var(--text-muted); margin-left: 8px; }
.section--warning  { border-color: rgba(245, 158, 11, 0.3); }

/* ===================================================================
   Tables
   =================================================================== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table--employees { min-width: 900px; }
.table thead tr { border-bottom: 1px solid var(--border-subtle); }
.table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-card);
  white-space: nowrap;
}
.table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-card); }
.table tbody tr { background: var(--bg-page); transition: background 0.1s; }
.table tbody tr:hover { background: var(--bg-card); }

.td--name { font-weight: 500; }
.td--muted { color: var(--text-muted); }
.td--mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); max-width: 360px; }
.td--detail { white-space: normal; word-break: break-word; }
.td--actions    { white-space: nowrap; width: 1%; }
.td--actions .btn + .btn { margin-left: 4px; }
.td--nowrap     { white-space: nowrap; }
.td--center     { text-align: center; }
.td--branch     { white-space: normal; word-break: break-all; }
.td--commit-msg { white-space: normal; word-break: break-word; min-width: 180px; }

.table--active-projects { table-layout: fixed; width: 100%; }
.table--active-projects th:nth-child(1) { width: 20%; }  /* Branch */
.table--active-projects th:nth-child(2) { width: 10%; }  /* Last Activity */
.table--active-projects th:nth-child(3) { width: 8%;  }  /* Commits (30d) */
.table--active-projects th:nth-child(4) { width: 35%; }  /* Last Commit */
.table--active-projects th:nth-child(5) { width: 14%; }  /* Merge Request */

/* ===================================================================
   Badge pills
   =================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge--red    { background: rgba(239,68,68,0.15);   color: #ef4444; }
.row--direct-push td { background: rgba(239,68,68,0.04); }
.badge--amber  { background: rgba(245,158,11,0.15);  color: #f59e0b; }
.badge--gray   { background: rgba(107,114,128,0.15); color: #9ca3af; }
.badge--purple { background: rgba(139,92,246,0.15);  color: #a78bfa; }
.badge--green  { background: rgba(34,197,94,0.15);   color: #22c55e; }
.badge--blue   { background: rgba(59,130,246,0.15);  color: #60a5fa; }

/* ===================================================================
   Banners / Alerts
   =================================================================== */
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 24px;
  border: 1px solid;
}
.banner--info {
  background: rgba(59,130,246,0.08);
  border-color: rgba(59,130,246,0.25);
  color: #93c5fd;
}
.banner--success {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.25);
  color: #86efac;
}
.banner--warning {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.25);
  color: #fcd34d;
}
.banner--error {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.25);
  color: #fca5a5;
}

.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert--error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
}
.alert--success {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
  color: #86efac;
}

/* ===================================================================
   Empty state
   =================================================================== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.empty-state__icon { font-size: 32px; margin-bottom: 12px; color: var(--brand-green); }
.empty-state__text { font-size: 15px; color: var(--text-secondary); }
.empty-state__sub  { font-size: 13px; margin-top: 6px; }

/* ===================================================================
   Login
   =================================================================== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-page);
}
.login-container { width: 100%; max-width: 400px; padding: 24px; }
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-standard);
  border-radius: 8px;
  padding: 40px 36px;
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-logo {
  width: 48px;
  height: 48px;
  background: rgba(62,207,142,0.1);
  border: 1px solid var(--brand-green-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.login-logo__icon { color: var(--brand-green); font-size: 22px; }
.login-logo--img {
  width: auto;
  height: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}
.login-logo__img { height: 56px; width: auto; display: block; margin: 0 auto; }
.login-title { font-size: 20px; font-weight: 500; margin-bottom: 6px; }
.login-subtitle { color: var(--text-muted); font-size: 13px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-footer { text-align: center; margin-top: 16px; }
.login-forgot-link { color: var(--text-muted); font-size: 13px; text-decoration: none; transition: color 0.15s; }
.login-forgot-link:hover { color: var(--brand-green); }
.otp-input { font-size: 20px; letter-spacing: 8px; text-align: center; font-weight: 500; }

/* ===================================================================
   Forms
   =================================================================== */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.form-label--sm { font-size: 11px; }

.form-input, .form-select {
  background: var(--bg-page);
  border: 1px solid var(--border-standard);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus { border-color: var(--brand-green); }
.form-input::placeholder { color: var(--text-muted); }
.form-input--sm, .form-select--sm { padding: 0 10px; font-size: 12px; height: 32px; line-height: 32px; }

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23898989' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.form-check input { accent-color: var(--brand-green); width: 14px; height: 14px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.form-group--checks {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding-top: 20px;
}

/* ===================================================================
   Filter bar
   =================================================================== */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; width: 180px; flex-shrink: 0; }

/* ===================================================================
   Inline forms (add / edit employees)
   =================================================================== */
.inline-form, .inline-edit {
  background: var(--inline-form-bg);
  border: 1px solid var(--brand-green-border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}
.inline-form__title { font-size: 14px; font-weight: 500; margin-bottom: 14px; }
.inline-form__actions { display: flex; gap: 8px; margin-top: 12px; }
.inline-form__error {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 6px;
  color: #fca5a5;
  font-size: 12px;
}

/* Employee rows — absolute ::before avoids border-collapse artifacts on multi-line rows */
.emp-row--unmapped td:first-child {
  position: relative;
}
.emp-row--unmapped td:first-child::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--color-medium);
  pointer-events: none;
}

.gitlab-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(62,207,142,0.08);
  border: 1px solid var(--brand-green-border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--brand-green);
}

/* ===================================================================
   History date sections
   =================================================================== */
.date-section {
  background: var(--bg-card);
  border: 1px solid var(--border-standard);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
/* Inside a section container, date-sections are flat accordion rows */
.section .date-section {
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  margin-bottom: 0;
}
.section .date-section:last-child { border-bottom: none; }
.date-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}
.date-section__header::-webkit-details-marker { display: none; }
.date-section__date { flex: 1; }
details[open] .date-section__header { border-bottom: 1px solid var(--border-subtle); }

/* ===================================================================
   Spinner
   =================================================================== */
.spinner {
  width: 14px;
  height: 14px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ===================================================================
   Error pages
   =================================================================== */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}
.error-page__code { font-size: 80px; font-weight: 500; color: var(--text-muted); letter-spacing: -0.05em; }
.error-page__msg  { font-size: 18px; color: var(--text-secondary); margin-top: 8px; }

/* ===================================================================
   Employee Profile
   =================================================================== */
.profile-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.15s;
}
.profile-back:hover { color: var(--text-primary); }

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-standard);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.profile-card__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--brand-green);
  color: #000;
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-card__info      { flex: 1; min-width: 0; }
.profile-card__name      { font-size: 18px; font-weight: 500; margin-bottom: 4px; }
.profile-card__meta      { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; margin-bottom: 8px; }
.profile-card__badges    { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-dot             { color: var(--text-muted); }
.profile-card__activity  { text-align: right; flex-shrink: 0; }
.profile-card__activity-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.profile-card__activity-value { font-size: 20px; font-weight: 500; color: var(--brand-green); margin-top: 2px; }

.profile-last-active { font-size: 12px; color: var(--text-muted); margin-left: auto; }

.profile-violation-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-subtle);
}
.profile-violation-chip         { display: flex; align-items: center; gap: 6px; }
.profile-violation-chip__count  { font-size: 13px; font-weight: 500; color: var(--text-primary); }

.link       { color: var(--brand-green); text-decoration: none; }
.link:hover { text-decoration: underline; }
.link--badge { text-decoration: none; }
.link--badge:hover { opacity: 0.85; }

/* ===================================================================
   Modal
   =================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 24px;
}
.modal-overlay[hidden] { display: none !important; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-prominent);
  border-radius: 10px;
  width: 100%;
  max-width: 860px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.modal__title  { font-size: 15px; font-weight: 500; }
.modal__close  { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
.modal__close:hover { color: var(--text-primary); background: var(--modal-close-hover-bg); }
.modal__summary {
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.modal .table-wrap { overflow-y: auto; flex: 1; }
.modal__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* ===================================================================
   Select2 — dark theme overrides
   =================================================================== */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single {
  background: var(--bg-page) !important;
  border: 1px solid var(--border-standard) !important;
  border-radius: 6px;
  height: 32px !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text-primary) !important;
  font-size: 12px !important;
  font-family: var(--font-sans) !important;
  line-height: 30px !important;
  padding-left: 10px !important;
  padding-right: 28px !important;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--text-muted) !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 30px !important;
  right: 6px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--text-muted) transparent transparent transparent;
}
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent var(--text-muted) transparent;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open  .select2-selection--single {
  border-color: var(--brand-green) !important;
  outline: none;
  box-shadow: none;
}
.select2-dropdown,
.select2-dropdown--below,
.select2-dropdown--above,
.select2-results,
.select2-results__options {
  background: var(--bg-card) !important;
  border-color: var(--border-prominent) !important;
}
.select2-dropdown {
  border: 1px solid var(--border-prominent) !important;
  border-radius: 6px;
  box-shadow: var(--select2-shadow);
  font-size: 13px;
}
.select2-container--default .select2-results__option {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  padding: 7px 12px;
}
.select2-container--default .select2-results__option--highlighted,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: rgba(62,207,142,0.12) !important;
  color: var(--text-primary) !important;
}
.select2-container--default .select2-results__option[aria-selected=true] {
  background: rgba(62,207,142,0.15) !important;
  color: var(--brand-green) !important;
}
.select2-search--dropdown { padding: 6px; }
.select2-search--dropdown .select2-search__field {
  background: var(--bg-page);
  border: 1px solid var(--border-prominent);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  padding: 4px 8px;
}
.select2-search--dropdown .select2-search__field:focus { outline: none; border-color: var(--brand-green); }
