/* ─── Design tokens ───────────────────────────────────────────────────────── */
:root {
  /* Spacing scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  28px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Backgrounds — neutral, no purple tint */
  --bg-base:      #F4F5F7;
  --bg-surface:   #FFFFFF;
  --bg-sidebar:   #FFFFFF;
  --bg-hover:     #F0F1F3;

  /* Topbar — dark */
  --topbar-bg:      #111318;
  --topbar-border:  #1E2128;
  --topbar-text:    #E8E9EC;
  --topbar-muted:   #8B8FA8;

  /* Text */
  --text-primary: #0D0E12;
  --text-muted:   #6B7280;
  --text-faint:   #9CA3AF;

  /* Borders */
  --border:        #E4E6EA;
  --border-strong: #CDD0D8;

  /* Accent — electric violet (used sparingly) */
  --accent:         #5B3FE8;
  --accent-hover:   #4A31CC;
  --accent-subtle:  #F0EDFF;
  --accent-mid:     #9B7CF8;
  --accent-on-dark: #C4B5FD;

  /* Semantic colours */
  --success:    #059669;
  --success-bg: #D1FAE5;
  --warning:    #D97706;
  --warning-bg: #FEF3C7;
  --danger:     #DC2626;
  --danger-bg:  #FEE2E2;
  --info:       #2563EB;
  --info-bg:    #DBEAFE;

  /* Layout */
  --sidebar-w:   232px;
  --topbar-h:    52px;
  --content-max: 980px;
  --radius:      6px;
  --radius-sm:   4px;
  --radius-lg:   10px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.09), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12), 0 3px 8px rgba(0,0,0,0.06);
}

/* ─── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-base);
  height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
}

/* Brand */
.sidebar__brand {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar__logo-link {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.03em;
}

/* Nav */
.sidebar__nav {
  flex: 1;
  padding: var(--space-3) 0 var(--space-2);
  list-style: none;
}

.sidebar__section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: var(--space-4) var(--space-5) var(--space-2);
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-5);
  height: 36px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 0;
  transition: color 0.1s, background 0.1s;
  position: relative;
}
.sidebar__link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  text-decoration: none;
}
.sidebar__link--active {
  color: var(--text-primary);
  background: var(--bg-hover);
  font-weight: 600;
}
.sidebar__link--active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.sidebar__icon {
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.sidebar__link:hover .sidebar__icon,
.sidebar__link--active .sidebar__icon { opacity: 1; }

/* Footer — compact user hint */
.sidebar__footer {
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Notification bell */
.sidebar__notif-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: color 0.15s, background 0.15s;
}
.sidebar__notif-btn:hover { color: var(--text-primary); background: var(--bg-hover); }
.sidebar__notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 15px; height: 15px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* Account block */
.sidebar__account {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2);
  cursor: pointer;
  border-radius: var(--radius);
  position: relative;
  flex: 1;
  min-width: 0;
  transition: background 0.15s;
}
.sidebar__account:hover { background: var(--bg-hover); }
.sidebar__avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-mid) 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar__avatar--sm {
  width: 24px; height: 24px;
  font-size: 10px;
}
.sidebar__account-info {
  min-width: 0; flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar__account-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__account-email {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__account-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
}
.sidebar__account--open .sidebar__account-menu { display: block; }
.sidebar__menu-item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
  font-family: inherit;
}
.sidebar__menu-item:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.sidebar__menu-item--danger { color: var(--danger); }
.sidebar__menu-item--danger:hover { background: var(--danger-bg); color: var(--danger); }

/* ─── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  z-index: 100;
}
.topbar__left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.topbar__home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--topbar-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.topbar__home:hover {
  background: rgba(255,255,255,0.08);
  color: var(--topbar-text);
}
.topbar__breadcrumb-sep {
  color: #3a3d4a;
  font-size: 0.875rem;
  line-height: 1;
  user-select: none;
}
.topbar__breadcrumb {
  font-size: 0.8125rem;
  color: var(--topbar-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Balance chip */
.topbar__balance {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--topbar-text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.topbar__balance:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
}
.topbar__balance-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22C55E;
  flex-shrink: 0;
}

/* Topbar icon buttons (notifications, etc.) */
.topbar__icon-btn {
  background: none;
  border: none;
  color: var(--topbar-muted);
  cursor: pointer;
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.topbar__icon-btn:hover {
  color: var(--topbar-text);
  background: rgba(255,255,255,0.08);
}
.topbar__badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 15px; height: 15px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
}

/* Topbar user chip */
.topbar__user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 5px 10px 5px 6px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
  border: 1px solid transparent;
  user-select: none;
}
.topbar__user:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.1);
}
.topbar__avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-mid) 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topbar__user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--topbar-text);
  white-space: nowrap;
}
.topbar__chevron {
  color: var(--topbar-muted);
  transition: transform 0.15s;
}
.topbar__user--open .topbar__chevron { transform: rotate(180deg); }

/* User dropdown */
.topbar__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
}
.topbar__user--open .topbar__dropdown { display: block; }
.topbar__dropdown-email {
  padding: 8px 10px 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__dropdown-item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
  font-family: inherit;
}
.topbar__dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
}
.topbar__dropdown-item--danger { color: var(--danger); }
.topbar__dropdown-item--danger:hover { background: var(--danger-bg); color: var(--danger); }

/* ─── Content area ────────────────────────────────────────────────────────── */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: calc(var(--topbar-h) + var(--space-8)) var(--space-10) var(--space-10);
  max-width: calc(var(--sidebar-w) + var(--content-max));
  min-height: 100vh;
}

/* ─── Page header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.page-title {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0 0 2px;
}
.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}
.page-actions { display: flex; gap: var(--space-2); align-items: center; flex-shrink: 0; }

/* ─── Section heading ─────────────────────────────────────────────────────── */
.section-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.section-heading-row .section-heading {
  margin-bottom: 0;
  flex: 1;
}

/* ─── Stats row ───────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.stat-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}
.stat-item:hover { box-shadow: var(--shadow-md); }
.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 4px 0 2px;
}
.stat-action {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 500;
}
.stat-action:hover { text-decoration: underline; }

/* ─── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 14px 10px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  height: 46px;
  transition: background 0.1s;
}
tbody tr:hover { background: var(--bg-hover); }
tbody td {
  padding: 0 14px;
  vertical-align: middle;
}
tbody td:first-child { font-weight: 500; }
.td-mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 12.5px; }
.td-num { font-variant-numeric: tabular-nums; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  border: 1px solid transparent;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 1px 3px rgba(108,71,255,0.3);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 3px 10px rgba(108,71,255,0.35);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-bg); }

.btn-sm { padding: 5px 11px; font-size: 0.8125rem; }
.btn--full { width: 100%; justify-content: center; }

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-5); }
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.form-label-muted { color: var(--text-muted); }

.form-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,71,255,0.15);
}
.form-input::placeholder { color: var(--text-faint); }
.form-input.error { border-color: var(--danger); }
.form-input.error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }

.form-textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,71,255,0.15);
}

.form-hint  { font-size: 0.75rem; color: var(--text-muted); margin-top: var(--space-1); }
.form-error { font-size: 0.75rem; color: var(--danger);     margin-top: var(--space-1); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }

/* ─── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  }
.badge-neutral { background: #F3F4F6; color: var(--text-muted); }
.badge-accent  { background: var(--accent-subtle); color: var(--accent); }

/* ─── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: var(--space-6);
  border: 1px solid transparent;
}
.alert-success { border-color: #6EE7B7; background: var(--success-bg); color: #065F46; }
.alert-warning { border-color: #FCD34D; background: var(--warning-bg); color: #92400E; }
.alert-danger  { border-color: #FCA5A5; background: var(--danger-bg);  color: #991B1B; }
.alert-info    { border-color: #93C5FD; background: var(--info-bg);    color: #1E40AF; }
.alert strong  { font-weight: 600; }

/* ─── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px var(--space-6);
}
.empty-state__icon {
  width: 48px; height: 48px;
  margin: 0 auto var(--space-4);
  background: var(--accent-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.empty-state__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}
.empty-state__text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

/* ─── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}
.card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-agent-form {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1.2fr 1fr auto;
  gap: var(--space-4);
  align-items: end;
}
.admin-agent-form .form-group {
  margin-bottom: 0;
}
.admin-agent-form__submit {
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .admin-agent-form {
    grid-template-columns: 1fr 1fr;
  }
}

/* ─── Notification panel ──────────────────────────────────────────────────── */
.notif-panel {
  position: fixed;
  top: 0; right: 0;
  width: 360px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  z-index: 500;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.notif-panel[hidden] { display: none; }
.notif-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-panel__title { font-size: 0.9375rem; font-weight: 600; margin: 0; }
.notif-panel__close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.notif-panel__close:hover { color: var(--text-primary); background: var(--accent-subtle); }
.notif-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
}
.notif-panel__empty {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-6);
}

.notif-item {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border-left: 3px solid var(--border);
  background: var(--bg-base);
  margin-bottom: var(--space-3);
}
.notif-item--success { border-left-color: var(--success); }
.notif-item--warning { border-left-color: var(--warning); }
.notif-item--error   { border-left-color: var(--danger);  }
.notif-item--info    { border-left-color: var(--accent);  }
.notif-item--unread  { background: var(--accent-subtle); }
.notif-item__title   { font-size: 0.875rem; font-weight: 600; margin: 0 0 2px; }
.notif-item__body    { font-size: 0.8125rem; color: var(--text-muted); margin: 0 0 4px; }
.notif-item__link    { font-size: 0.75rem; color: var(--accent); }
.notif-item__link:hover { text-decoration: underline; }

.notif-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.2);
  z-index: 499;
}
.notif-backdrop[hidden] { display: none; }

/* ─── Auth pages ──────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: var(--space-6);
}
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: var(--space-6);
}
.auth-box {
  width: 100%;
  max-width: 420px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-header {
  margin-bottom: var(--space-8);
}
.auth-brand {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.03em;
}
.auth-logo {
  font-size: 1.125rem;
  font-weight: 800;
  margin-bottom: var(--space-8);
  color: var(--accent);
  letter-spacing: -0.03em;
}
.auth-heading { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: var(--space-1); }
.auth-subheading { color: var(--text-muted); font-size: 0.875rem; margin-bottom: var(--space-7); }
.auth-footer { margin-top: var(--space-6); font-size: 0.8125rem; color: var(--text-muted); text-align: center; }
.auth-divider { border: none; border-top: 1px solid var(--border); margin: var(--space-6) 0; }
.auth-link--btn {
  background: none; border: none; padding: 0;
  font-size: inherit; font-family: inherit;
  cursor: pointer; color: var(--accent); text-decoration: none;
}
.auth-link--btn:hover { text-decoration: underline; }

/* Code input */
.code-input {
  letter-spacing: 0.35em;
  font-size: 1.5rem;
  font-family: "SFMono-Regular", Consolas, monospace;
  text-align: center;
  height: 52px;
}

/* ─── Toast ───────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 360px;
  pointer-events: none;
}

.toast {
  pointer-events: all;
  background: #111827;
  color: #F9FAFB;
  border: 1px solid #1F2937;
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-4);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  transform: translateX(110%);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(.22,1,.36,1), opacity 0.22s ease;
  position: relative;
}
.toast.visible  { transform: translateX(0); opacity: 1; }
.toast.hiding   { transform: translateX(110%); opacity: 0; transition: transform 0.15s ease-in, opacity 0.15s ease-in; }

.toast__accent { width: 3px; border-radius: 2px; align-self: stretch; flex-shrink: 0; background: #374151; }
.toast--success .toast__accent { background: var(--success); }
.toast--warning .toast__accent { background: var(--warning); }
.toast--error   .toast__accent { background: var(--danger);  }
.toast--info    .toast__accent { background: var(--accent-mid); }

.toast__body  { flex: 1; min-width: 0; }
.toast__title { font-weight: 600; font-size: 0.875rem; margin-bottom: 2px; }
.toast__description { font-size: 0.8125rem; color: #9CA3AF; line-height: 1.4; }
.toast__action {
  display: inline-block; margin-top: var(--space-2);
  font-size: 0.8125rem; font-weight: 500;
  color: var(--accent-on-dark); text-decoration: underline; cursor: pointer;
}
.toast__close {
  flex-shrink: 0; background: none; border: none; color: #6B7280;
  cursor: pointer; font-size: 16px; line-height: 1; padding: 0; margin-top: -1px;
  transition: color 0.1s;
}
.toast__close:hover { color: #D1D5DB; }

/* ─── Confidence score ────────────────────────────────────────────────────── */
.confidence { font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.8125rem; font-weight: 700; }
.confidence-high { color: var(--success); }
.confidence-mid  { color: var(--warning); }
.confidence-low  { color: var(--danger);  }

/* ─── Utilities ───────────────────────────────────────────────────────────── */
.mt-0  { margin-top: 0;                  }
.mt-1  { margin-top: var(--space-2);     }
.mt-2  { margin-top: var(--space-4);     }
.mt-3  { margin-top: var(--space-6);     }
.mt-4  { margin-top: var(--space-8);     }
.mb-0  { margin-bottom: 0;               }
.mb-1  { margin-bottom: var(--space-2);  }
.mb-2  { margin-bottom: var(--space-4);  }
.mb-3  { margin-bottom: var(--space-6);  }
.flex         { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; gap: var(--space-2); }
.text-muted   { color: var(--text-muted);  }
.text-danger  { color: var(--danger);      }
.text-success { color: var(--success);     }
.text-accent  { color: var(--accent);      }
.text-mono    { font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.8125rem; }
.text-right   { text-align: right;  }
.text-center  { text-align: center; }
.w-full       { width: 100%; }

/* ─── Group filter tabs (leads / mailer pages) ────────────────────────────── */
.group-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.group-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
  white-space: nowrap;
  user-select: none;
}
.group-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-color: var(--border-strong);
}
.group-tab--active {
  color: #fff;
  background: var(--text-primary);
  border-color: var(--text-primary);
  font-weight: 600;
}
.group-tab__count {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.65;
}
.group-tab--active .group-tab__count { opacity: 0.75; }

/* ─── Bulk action bar ─────────────────────────────────────────────────────── */
.bulk-bar {
  display: none;
  position: sticky;
  top: 8px;
  z-index: 20;
  background: var(--text-primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  align-items: center;
  gap: var(--space-3);
  font-size: 0.875rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.bulk-bar--visible { display: flex; }
.bulk-bar__count { font-weight: 700; font-size: 0.9375rem; }
.bulk-bar__spacer { flex: 1; }
.bulk-bar__clear {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  padding: 5px 13px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.12s;
}
.bulk-bar__clear:hover { background: rgba(255,255,255,0.2); }
.bulk-bar__action {
  background: #fff;
  color: var(--text-primary);
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8125rem;
  transition: background 0.12s;
}
.bulk-bar__action:hover { background: #e8e9ec; }

/* ─── Filter bar ──────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--space-4);
}
.filter-bar select,
.filter-bar input {
  height: 34px;
  font-size: 0.8125rem;
}
.filter-bar select { width: auto; }
.filter-bar__search { width: 210px; }
