/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Big+Shoulders+Display:wght@700;800;900&display=swap');

:root {
  /* 10FOLD CI — dark theme */
  --accent:        #BFFF00;
  --accent-hover:  #d4ff33;
  --accent-dim:    rgba(191,255,0,0.10);
  --accent-border: rgba(191,255,0,0.30);
  --tertiary:      #1a2600;

  /* Sidebar */
  --sidebar-bg:    #111111;
  --sidebar-border:#1e1e1e;
  --sidebar-item-hover: #1e1e1e;
  --sidebar-item-active-bg: #222222;

  /* Main content area */
  --bg:            #0a0a0a;
  --bg-white:      #111111;
  --bg-subtle:     #131313;

  /* Cards & surfaces */
  --card-bg:       #141414;
  --card-border:   #222222;
  --card-shadow:   none;
  --card-shadow-md:0 2px 8px rgba(0,0,0,0.5);

  /* Header */
  --header-bg:     #111111;
  --header-border: #1e1e1e;

  /* Text */
  --text:          #e8e8e8;
  --text-secondary:#aaaaaa;
  --text-muted:    #666666;
  --text-light:    #444444;

  /* Status colors — dark variants */
  --status-pending-bg:   #2a1e00;
  --status-pending-text: #ffc53d;
  --status-generated-bg: #1a2600;
  --status-generated-text:#BFFF00;
  --status-sent-bg:      #0d2640;
  --status-sent-text:    #94c4ff;
  --status-failed-bg:    #2a0a0a;
  --status-failed-text:  #ff7875;

  /* Utility */
  --red:    #ff7875;
  --green:  #BFFF00;
  --amber:  #ffc53d;
  --blue:   #94c4ff;

  /* Layout */
  --sidebar-w:  240px;
  --header-h:   0px;
  --radius:     10px;
  --radius-sm:  8px;
  --radius-xs:  6px;
  --radius-full:9999px;

  /* Fonts */
  --font-body:    'Outfit', system-ui, sans-serif;
  --font-display: 'Big Shoulders Display', 'Outfit', sans-serif;
  --font-mono:    'JetBrains Mono', 'IBM Plex Mono', monospace;
}

html, body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
code {
  background: #F3F4F6;
  color: #374151;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-family: var(--font-mono);
}

/* ── Top header — sits right of sidebar, white bg, no shadow ──────────────── */
.top-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: 48px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 200;
  gap: 16px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.top-bar-logo-mark {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.top-bar-logo-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.top-bar-page-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.top-bar-divider {
  width: 1px;
  height: 16px;
  background: var(--card-border);
}

.top-bar-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.top-bar-center {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.top-bar-clock {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.top-bar-version {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

/* ── Layout — sidebar full height from top, matching certifier.io ─────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.main-content {
  margin-left: var(--sidebar-w);
  margin-top: 48px;
  min-height: calc(100vh - 48px);
  padding: 24px 28px;
  background: var(--bg);
}

/* Sidebar brand area */
.sidebar-brand {
  padding: 16px 16px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 8px;
}

.sidebar-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-org {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
}

.sidebar-org:hover { background: var(--sidebar-item-hover); }

.sidebar-org-avatar {
  width: 24px;
  height: 24px;
  background: var(--card-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
  text-transform: uppercase;
}

.sidebar-org-info {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow: hidden;
}

.sidebar-org-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* ── Sidebar nav — matching certifier.io exactly ───────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Section label inside sidebar nav */
.nav-section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  padding: 12px 8px 6px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0px 8px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  transition: background 0.12s, color 0.12s;
  cursor: pointer;
  white-space: nowrap;
  line-height: 24px;
}

.nav-item svg { flex-shrink: 0; }

.nav-item:hover {
  background: var(--sidebar-item-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--sidebar-item-active-bg);
  color: var(--accent);
  font-weight: 500;
}

.nav-item.active svg { stroke: var(--accent); }

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  opacity: 0.7;
}

.sidebar-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--card-border);
}

.sidebar-version {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Pages ─────────────────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.1px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 400;
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

/* ── Stat cards — certifier.io style: icon left, number + label ──────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s;
}

.stat-card:hover { border-color: #D9D9D9; }

/* Icon row — visible now, matching certifier.io */
.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.stat-icon svg { width: 18px; height: 18px; }

.stat-icon-blue   { background: #EFF6FF; color: #3B82F6; }
.stat-icon-blue   svg { stroke: #3B82F6; }
.stat-icon-green  { background: #ECFDF5; color: #10B981; }
.stat-icon-green  svg { stroke: #10B981; }
.stat-icon-amber  { background: #FFFBEB; color: #F59E0B; }
.stat-icon-amber  svg { stroke: #F59E0B; }
.stat-icon-lime   { background: rgba(191,255,0,0.12); color: #8DB300; }
.stat-icon-lime   svg { stroke: #7AAD00; }

.stat-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── General cards — certifier.io: 12px radius, 1px #F0F0F0 border, no shadow */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-actions { display: flex; gap: 8px; }

/* ── Two-col layout ────────────────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--accent);
  color: #000000;
  font-weight: 600;
  box-shadow: none;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: var(--sidebar-item-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

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

.btn-danger {
  background: rgba(255,120,117,0.12);
  color: var(--red);
  border: none;
}

.btn-danger:hover { background: rgba(255,120,117,0.2); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Tables — certifier.io exact values ────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 16px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  white-space: nowrap;
  border-bottom: 1px solid var(--card-border);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table th:first-child { padding-left: 16px; }

.data-table td {
  padding: 14px 8px;
  border-bottom: 1px solid var(--card-border);
  color: var(--text);
  vertical-align: middle;
  background: var(--card-bg);
}

.data-table td:first-child { padding-left: 16px; }

/* Link-style name column */
.data-table td.td-name {
  color: var(--accent);
  font-weight: 500;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--sidebar-item-hover); }
.empty-row { text-align: center; color: var(--text-muted); padding: 32px !important; }

/* ── Status badges ────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-pending  { background: var(--status-pending-bg);   color: var(--status-pending-text); }
.badge-generated{ background: var(--status-generated-bg); color: var(--status-generated-text); }
.badge-sent     { background: var(--status-sent-bg);      color: var(--status-sent-text); }
.badge-failed   { background: var(--status-failed-bg);    color: var(--status-failed-text); }

/* ── Filters ───────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-select, .filter-input {
  background: var(--bg-white);
  border: 1px solid #D9D9D9;
  border-radius: var(--radius-xs);
  color: var(--text);
  padding: 4px 11px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  height: 32px;
  font-family: var(--font-body);
}

.filter-select:focus, .filter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.2);
}

.filter-input { min-width: 200px; }

/* ── Form controls ─────────────────────────────────────────────────────────── */
.form-control {
  width: 100%;
  background: var(--bg-white);
  border: 1px solid #D9D9D9;
  border-radius: var(--radius-xs);
  color: var(--text);
  padding: 7px 11px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: var(--font-body);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22,119,255,0.2);
}

.form-control::placeholder { color: var(--text-light); }
select.form-control option { background: var(--bg-white); color: var(--text); }

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.mb-12 { margin-bottom: 12px; }
.req { color: var(--red); }

/* Primary field — used on courseName so it cannot be missed */
.form-group-primary {
  margin-bottom: 20px;
  padding: 12px 14px 14px;
  border-left: 3px solid #BFFF00;
  background: rgba(191,255,0,0.06);
  border-radius: var(--radius-xs);
}
.form-label-strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0a0a0a;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.form-control-accent {
  border: 1.5px solid #BFFF00;
  font-weight: 600;
  font-size: 15px;
}
.form-control-accent:focus {
  border-color: #BFFF00;
  box-shadow: 0 0 0 3px rgba(191,255,0,0.25);
}
.form-hint-strong {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 6px;
}

.form-body { padding: 4px 0; }
.form-row-two {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

/* ── Groups grid ───────────────────────────────────────────────────────────── */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.group-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--card-shadow);
}

.group-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim), var(--card-shadow);
}

.group-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.group-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.group-card-course {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.group-card-meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.group-card-meta strong { color: var(--text); }

.group-actions { display: flex; gap: 6px; }

/* Group detail */
.group-detail.hidden { display: none; }
.group-detail .card { margin-top: 0; }

/* Dashboard group mini list */
.group-mini-list { display: flex; flex-direction: column; gap: 4px; }

.group-mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border-bottom: 1px solid var(--card-border);
  transition: background 0.12s;
}

.group-mini-item:hover { background: var(--sidebar-item-hover); }

.group-mini-name { font-weight: 500; color: var(--text); }
.group-mini-count { font-size: 11px; color: var(--text-muted); }

/* ── Issue flow ────────────────────────────────────────────────────────────── */
.issue-flow { max-width: 600px; }

.issue-step {
  display: flex;
  gap: 18px;
  margin-bottom: 20px;
}

.issue-step:last-child { margin-bottom: 0; }

.step-num {
  width: 28px;
  height: 28px;
  background: var(--accent-dim);
  color: #444;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.step-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

.issue-preview-box {
  background: #FAFBFC;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
}

.issue-preview-box p { margin-bottom: 6px; color: var(--text-muted); }
.issue-preview-box strong { color: var(--text); }

.issue-progress .progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.issue-progress h3 { font-size: 14px; color: var(--text); }

.progress-bar-wrap {
  background: #E5E7EB;
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

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

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #E5E7EB;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Analytics ─────────────────────────────────────────────────────────────── */
.group-stats-list { display: flex; flex-direction: column; gap: 8px; }

.group-stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-stat-name {
  font-size: 13px;
  color: var(--text);
  min-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-stat-bar-wrap {
  flex: 1;
  background: #E5E7EB;
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}

.group-stat-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.group-stat-count {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 28px;
  text-align: right;
}

/* ── Settings ──────────────────────────────────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.settings-footer {
  display: flex;
  align-items: center;
  gap: 16px;
}

.save-confirm {
  font-size: 13px;
  color: var(--green);
  font-weight: 500;
}

/* ── Modals ────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-backdrop.hidden { display: none; }

.modal {
  background: var(--bg-white);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08);
  animation: modal-in 0.15s ease;
}

.modal-wide { max-width: 560px; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  padding: 0;
  transition: color 0.15s;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
}

.modal-close:hover {
  color: var(--text);
  background: var(--bg);
}

.modal-body { padding: 20px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* Import tabs */
.import-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 16px;
}

.import-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.import-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.import-panel { display: block; }
.import-panel.hidden { display: none; }

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-white);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--accent);
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  z-index: 400;
  transition: opacity 0.3s;
}

.toast.hidden { display: none; }
.toast.toast-error { border-left-color: var(--red); }
.toast.toast-success { border-left-color: var(--green); }

/* ── Inline action links ───────────────────────────────────────────────────── */
.action-link {
  background: none;
  border: none;
  color: #1677FF;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-xs);
  transition: background 0.12s, color 0.12s;
}

.action-link:hover { color: #0958d9; background: rgba(22,119,255,0.06); }
.action-link.danger { color: var(--red); }
.action-link.danger:hover { background: #FEE2E2; }

/* ── Hidden utility ────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Bulk Ops ──────────────────────────────────────────────────────────────── */
.bulk-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 4px;
}

.bulk-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.bulk-tab:hover { background: var(--bg-white); color: var(--text); }
.bulk-tab.active { background: var(--accent); color: #000; font-weight: 600; }

.bulk-panel { display: block; }
.bulk-panel.hidden { display: none; }

.bulk-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.bulk-preview-table-wrap {
  max-height: 300px;
  overflow-y: auto;
}

.bulk-preview-stats {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.bulk-stat-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  letter-spacing: 0.2px;
}

.chip-blue   { background: #E6F4FF; color: #1677FF; }
.chip-green  { background: #D1FAE5; color: #065F46; }
.chip-orange { background: #FEF3C7; color: #92400E; }
.chip-red    { background: #FEE2E2; color: #991B1B; }

.row-duplicate td { opacity: 0.4; }

.bulk-log {
  max-height: 180px;
  overflow-y: auto;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: #FAFBFC;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-secondary);
}

.bulk-log-entry { padding: 2px 0; }
.log-ok  { color: #065F46; }
.log-err { color: var(--red); }

.bulk-status-box { margin-bottom: 14px; }

.bulk-warning {
  background: var(--status-pending-bg);
  border: 1px solid #FDE68A;
  color: var(--status-pending-text);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.bulk-info-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bulk-li-summary {
  padding: 0 18px;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .top-bar-center { display: none; }
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; padding: 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Bulk delete: action bar + checkboxes (v2.3) ──────────────────────────── */
.bulk-action-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--accent-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.bulk-action-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.bulk-action-count strong { color: var(--accent); }
.bulk-action-buttons { display: flex; gap: 8px; }

.bulk-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid #444;
  border-radius: 3px;
  background: #1a1a1a;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  flex-shrink: 0;
}
.bulk-checkbox:hover { border-color: var(--accent); }
.bulk-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.bulk-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #0a0a0a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.col-check { width: 36px; padding-right: 0 !important; }
tr.row-selected { background: rgba(191,255,0,0.04) !important; }
tr.row-selected td { border-color: rgba(191,255,0,0.15); }

.btn-danger {
  background: rgba(255, 120, 117, 0.12);
  color: var(--red);
  border: 1px solid rgba(255, 120, 117, 0.4);
}
.btn-danger:hover {
  background: rgba(255, 120, 117, 0.2);
  border-color: var(--red);
}

/* Group card checkbox in top-left corner */
.group-card { position: relative; }
.group-card-check {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}
.group-card.selected {
  border-color: var(--accent);
  background: rgba(191,255,0,0.04);
}

/* ── Preview Gate modal (v2.3) ────────────────────────────────────────────── */
.preview-gate-modal {
  max-width: 1200px;
  width: 95vw;
  height: 90vh;
  display: flex;
  flex-direction: column;
}
.preview-gate-modal .modal-body {
  flex: 1;
  overflow: auto;
}
.preview-gate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--card-border);
  background: var(--bg-subtle);
  position: sticky;
  top: 0;
  z-index: 5;
}
.preview-gate-stats {
  font-size: 13px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.preview-gate-stats strong { color: var(--accent); font-size: 15px; }
.preview-gate-actions { display: flex; gap: 8px; }
.preview-gate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
}
.preview-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.1s;
}
.preview-card.approved {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}
.preview-card.rejected {
  opacity: 0.5;
  border-color: rgba(255, 120, 117, 0.4);
}
.preview-card-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #050505;
  overflow: hidden;
  border-bottom: 1px solid var(--card-border);
}
.preview-card-thumb iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 720px;
  border: 0;
  transform: scale(0.219);
  transform-origin: top left;
  pointer-events: none;
}
.preview-card-meta {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.preview-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-card-email {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-card-course {
  font-size: 11px;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.preview-card-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--card-border);
  background: var(--bg-subtle);
}
.preview-card-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.preview-card.approved .preview-card-status { color: var(--accent); }
.preview-card.rejected .preview-card-status { color: var(--red); }
.preview-card-toggle {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.preview-card-toggle:hover { border-color: var(--accent); color: var(--accent); }
.preview-card.approved .preview-card-toggle { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }
.preview-card.rejected .preview-card-toggle { color: var(--red); border-color: var(--red); }

/* ── Cert Preview Modal (per-row Preview button + nav) ──────────────────── */
.cert-preview-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
}
.cert-preview-backdrop.hidden { display: none; }

.cert-preview-topbar {
  position: absolute;
  top: 16px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 14px;
  z-index: 2;
}
.cert-preview-topbar .name { font-weight: 600; color: #fff; }
.cert-preview-topbar .counter { opacity: 0.6; margin-left: 12px; font-size: 12px; }
.cert-preview-topbar .close-x {
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  color: #fff;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s;
}
.cert-preview-topbar .close-x:hover { background: rgba(255,255,255,0.1); }

.cert-preview-iframe {
  width: 1122px;
  height: 794px;
  border: none;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transition: opacity 200ms ease;
  transform-origin: center center;
}
.cert-preview-iframe.fading { opacity: 0; }

.cert-preview-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.15s;
  user-select: none;
  z-index: 2;
}
.cert-preview-arrow:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.cert-preview-arrow.prev { left: 24px; }
.cert-preview-arrow.next { right: 24px; }

.cert-preview-thumbs {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  max-width: 80vw;
  overflow-x: auto;
  padding: 8px;
  z-index: 2;
}
.cert-preview-thumbs .thumb {
  width: 96px;
  height: 60px;
  border-radius: 4px;
  background: #1a1a1a;
  border: 2px solid transparent;
  cursor: pointer;
  color: #888;
  font-size: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  text-align: center;
  line-height: 1.2;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.15s;
}
.cert-preview-thumbs .thumb:hover { color: #fff; border-color: rgba(191,255,0,0.4); }
.cert-preview-thumbs .thumb.active { border-color: var(--accent); color: #fff; background: #2a2a1a; }
.cert-preview-thumbs .thumb .num { font-size: 9px; opacity: 0.7; margin-top: 2px; }

/* Clickable rows in Group detail (row click opens cert preview modal) - 2026-04-29 */
.clickable-row { cursor: pointer; transition: background 0.12s; }
.clickable-row:hover { background: rgba(191,255,0,0.06); }
.clickable-row.row-selected { background: rgba(191,255,0,0.10); }

/* Pending thumbnails in cert preview modal - 2026-04-29 */
.cert-preview-thumbs .thumb.pending {
  border-style: dashed;
  border-color: rgba(191,255,0,0.35);
  background: #181811;
}
.cert-preview-thumbs .thumb.pending.active {
  border-style: solid;
  border-color: var(--accent);
  background: #2a2a1a;
}

