:root {
  --bg: #f7f8f5;
  --bg-2: #fafaf8;
  --panel: #ffffff;
  --line: #e4e8e3;
  --text: #1a1a1a;
  --muted: #6b7280;
  --accent: #1e7a3d;
  --accent-2: #2e8b4e;
  --accent-dark: #166534;
  --mint: #e8f5e9;
  --mint-2: #d1ead4;
  --danger: #c62828;
  --danger-bg: #fde8e8;
  --warn: #b45309;
  --ok: #1e7a3d;
  --shadow: 0 1px 3px rgba(16, 24, 16, 0.06), 0 1px 2px rgba(16, 24, 16, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 24, 16, 0.08);
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sidebar-w: 240px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --page-gutter: clamp(16px, 2.4vw, 28px);
  --page-top: 24px;
  --page-bottom: 40px;
  --section-gap: 20px;
  --page-max: 800px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: 1.65rem; margin: 0 0 8px; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
::selection { background: rgba(30, 122, 61, 0.18); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #c5cdc6; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }

/* —— Admin shell —— */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px 12px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
}
.sidebar-toggle { display: none; }
.sidebar-backdrop {
  display: none;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 18px;
  text-decoration: none;
  color: var(--text);
}
.sidebar-brand:hover { text-decoration: none; color: var(--text); }
.sidebar-brand .brand-logo { height: 32px; max-width: 210px; }
.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.nav-item:hover { background: var(--mint); text-decoration: none; color: var(--accent-dark); }
.nav-item.is-active,
.nav-item.is-active:hover {
  background: var(--accent);
  color: #fff;
}
.nav-item svg { flex-shrink: 0; }
.nav-item.is-active svg { stroke: #fff; }
.sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-logout .nav-item {
  width: 100%;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: var(--text);
}
.sidebar-logout .nav-item:hover {
  background: var(--danger-bg);
  color: var(--danger);
  text-decoration: none;
}
.app-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 12px var(--page-gutter);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
.top-search {
  flex: 1;
  max-width: 520px;
  position: relative;
}
.top-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.top-search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 8px;
  padding: 9px 12px 9px 38px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
}
.top-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: #fff; }
.nav-back {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
}
.nav-back:hover { color: var(--accent); text-decoration: none; }
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: 0;
}
.page-head-main { min-width: 0; flex: 1; }
.page-head h1 { margin: 0 0 6px; }
.page-head-actions { flex-shrink: 0; align-items: center; }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand-logo {
  display: block;
  height: 36px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
}
.brand-logo-sm { height: 28px; max-width: 200px; }
.brand-text {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}
.top-nav { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  display: grid; place-items: center; cursor: pointer; padding: 0;
  position: relative;
}
.icon-btn:hover { background: var(--mint); }
.notice-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e53935;
  border: 1.5px solid #fff;
}
.account-menu, .notice-menu { position: relative; }
.account-panel, .notice-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 260px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-md);
  padding: 8px; z-index: 40;
}
.notice-panel { width: 320px; }
.account-name {
  margin: 0; padding: 8px 10px 10px; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.account-panel a,
.account-panel button,
.notice-item {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 9px 10px; border-radius: 6px; font: inherit; font-size: 14px;
  color: var(--text); text-decoration: none; cursor: pointer;
}
.account-panel a:hover,
.account-panel button:hover,
.notice-item:hover { background: var(--bg); text-decoration: none; }
.account-panel form { margin: 0; }
.notice-item strong { display: block; font-size: 13px; }
.notice-item span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.notice-empty { padding: 12px 10px; font-size: 13px; color: var(--muted); }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: var(--mint);
  border-radius: 10px;
  padding: 4px 10px 4px 4px;
  color: var(--text);
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.user-chip-text { text-align: left; line-height: 1.2; }
.user-chip-text strong { display: block; font-size: 13px; }
.user-chip-text span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--accent);
  display: grid; place-items: center; font-size: 11px; color: #fff;
  font-weight: 700;
}
.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--page-top) var(--page-gutter) var(--page-bottom);
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}
.wrap-wide { max-width: none; }
.app-content .wrap {
  flex: 1;
  max-width: none;
  padding-top: var(--page-top);
}
.wrap > script { display: none; }

.hero { display: grid; gap: var(--space-3); }
.hero h1 { font-size: 2rem; margin: 0; font-weight: 700; }
.hero-logo { height: 52px; width: auto; margin: 0; display: block; }
.hero p { color: var(--muted); max-width: 560px; line-height: 1.6; margin: 0; }

.grid { display: grid; gap: var(--section-gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--section-gap);
  align-items: start;
}
@media (max-width: 980px) { .detail-layout { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin: 0 0 14px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2, .card-head h3 { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600;
  cursor: pointer; font-size: 14px; text-decoration: none;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a31f1f; color: #fff; }
.btn-lg { padding: 12px 18px; font-size: 15px; width: 100%; }
.btn-sm { padding: 5px 9px; font-size: 12px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.action-bar {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2px;
}
.action-bar form { margin: 0; display: inline-flex; }
.action-bar .link-action {
  padding: 6px 10px;
  border-radius: 6px;
}
.action-bar .link-action:hover { background: var(--mint); }
.action-bar .link-action-danger:hover { background: var(--danger-bg); }
.status-cell,
.mail-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.mail-cell form { margin: 0; }
.mail-resend {
  font-size: 12px;
  line-height: 1.2;
  padding: 0;
}
.integrity-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.table-candidates .integrity-cell .kiosk-notice {
  margin: 0;
  line-height: 1;
}
.table-candidates .stepper-dots { margin-top: 0; }
.icon-action {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.icon-action:hover { background: var(--mint); color: var(--accent-dark); text-decoration: none; }
.icon-action-danger { color: var(--danger); }
.icon-action-danger:hover { background: var(--danger-bg); color: #8e1b1b; }
.icon-action.is-copied { background: var(--mint); }

.link-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.link-action:hover { color: var(--accent-dark); text-decoration: none; }
.link-action svg { flex-shrink: 0; }
.link-action-danger { color: var(--danger); }
.link-action-danger:hover { color: #8e1b1b; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--text); font-weight: 700; }
.field input, .field textarea, .field select {
  width: 100%;
  background: #fff; border: 1px solid #d5dbd6; color: var(--text);
  border-radius: 8px; padding: 10px 12px; font: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.field textarea { min-height: 120px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

.invite-row-head,
.invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) 40px;
  gap: 8px;
  align-items: center;
}
.invite-row-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  padding: 0 2px;
}
.invite-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.invite-row input {
  width: 100%;
  background: #fff;
  border: 1px solid #d5dbd6;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}
.invite-row input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.invite-row-remove:disabled { opacity: 0.25; cursor: not-allowed; }
.invite-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.invite-paste {
  margin: 0 0 16px;
  border: 1px dashed #c5d0c6;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--bg-2);
}
.invite-paste summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}
.invite-paste summary:hover { color: var(--accent-dark); }
@media (max-width: 720px) {
  .invite-row-head { display: none; }
  .invite-row { grid-template-columns: 1fr auto; }
  .invite-row input[name="candidate_name"] { grid-column: 1; }
  .invite-row input[name="candidate_email"] { grid-column: 1; }
  .invite-row-remove { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}
.field-input {
  display: block;
  width: 100%;
  position: relative;
}
.field-input input {
  width: 100%;
  padding-right: 44px;
}
.field-input .toggle-pw {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  display: grid;
  place-items: center;
}
.field-input .toggle-pw:hover { color: var(--text); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card .row-actions { margin-top: var(--space-3); }
.card-center { text-align: center; }

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px 24px;
}
.kv-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.kv-value {
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
  font-size: 14px;
}

.banner-mint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--mint);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.banner-mint p { margin: 0; color: var(--text); font-size: 14px; }
.banner-mint .kiosk-notice { margin: 4px 0 0; }

.fieldset-dashed {
  border: 1.5px dashed #c5d0c6;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-2);
}
.fieldset-dashed .field { margin: 0; flex: 1; min-width: 140px; }
.segmented {
  display: inline-flex;
  background: var(--mint);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.segmented span {
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}
.segmented span.is-active {
  background: var(--accent);
  color: #fff;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.setting-row:last-of-type { border-bottom: 0; }
.setting-row strong { display: block; font-size: 14px; }
.setting-row .kiosk-notice { margin: 2px 0 0; }
.setting-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

.form-sections { display: grid; gap: var(--section-gap); }
.form-sections > .card { margin: 0; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th {
  background: var(--mint);
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}
.table tbody tr:hover { background: var(--bg-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table-card { overflow: hidden; padding: 0; }
.table-card > h3,
.table-card .card-head { padding: 18px 20px 12px; }
.table-scroll { overflow: auto; }
.table-scroll-both {
  max-height: min(52vh, 520px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.table-scroll-both::-webkit-scrollbar { width: 0; height: 0; display: none; }
.scroll-invisible {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroll-invisible::-webkit-scrollbar { width: 0; height: 0; display: none; }

.table-exams { table-layout: fixed; min-width: 720px; width: 100%; }
.table-exams .col-title { width: 46%; }
.table-exams .col-duration { width: 14%; }
.table-exams .col-opens { width: 24%; }
.table-exams .col-exam-actions { width: 16%; }
.table-exams td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-exams td.col-exam-actions { overflow: visible; }

.table-candidates { table-layout: auto; width: 100%; min-width: 0; }
.table-candidates .col-name { width: 22%; }
.table-candidates .col-email { width: 28%; }
.table-candidates .col-status { width: 14%; }
.table-candidates .col-score { width: 8%; }
.table-candidates .col-viol,
.table-candidates .col-mail,
.table-candidates .col-actions {
  width: 1%;
}
.table-candidates th,
.table-candidates td {
  padding: 12px 14px;
  vertical-align: top;
  text-align: left;
}
.table-candidates th.col-viol,
.table-candidates td.col-viol,
.table-candidates th.col-mail,
.table-candidates td.col-mail,
.table-candidates th.col-actions,
.table-candidates td.col-actions {
  padding-left: 16px;
  padding-right: 16px;
}
.table-candidates td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-candidates td.col-status,
.table-candidates td.col-viol,
.table-candidates td.col-mail,
.table-candidates td.col-actions {
  overflow: visible;
  white-space: nowrap;
}
.link-clip {
  display: block;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
}

.badge, .pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-pending, .pill-pending { background: #eef0ee; color: #4b5563; }
.badge-checking, .badge-in_progress, .pill-active, .pill-progress {
  background: var(--mint); color: var(--accent-dark);
}
.badge-submitted, .pill-ok { background: var(--mint); color: var(--accent-dark); }
.badge-terminated, .badge-expired, .pill-danger { background: var(--danger-bg); color: var(--danger); }
.badge-integrity-clear { background: var(--mint); color: var(--accent-dark); }
.badge-integrity-review { background: #fff4e0; color: #9a6700; }
.badge-integrity-high { background: var(--danger-bg); color: var(--danger); }
.pill-new { background: var(--mint); color: var(--accent-dark); font-size: 10px; letter-spacing: 0.04em; }

.alert {
  border-radius: 8px; padding: 12px 14px; margin: 0; font-size: 14px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.alert-error { background: var(--danger-bg); border-color: #f3c0c0; color: #8e1b1b; }
.alert-warn { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.alert-ok { background: var(--mint); border-color: var(--mint-2); color: var(--accent-dark); }

.steps { list-style: none; padding: 0; margin: 0 0 20px; }
.steps li {
  display: flex; gap: 12px; align-items: flex-start; padding: 8px 0;
  color: var(--muted); font-size: 14px;
}
.step-n {
  width: 24px; height: 24px; border-radius: 50%; background: var(--mint);
  border: 1px solid var(--accent-2);
  display: grid; place-items: center;
  color: var(--accent); font-size: 12px; font-weight: 700; flex-shrink: 0;
}

.stepper { list-style: none; margin: 0; padding: 0; }
.stepper-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 18px;
}
.stepper-item:last-child { padding-bottom: 0; }
.stepper-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.stepper-item.is-cleared:not(:last-child)::before { background: var(--accent-2); }
.stepper-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d1d5db;
  border: 3px solid #e5e7eb;
  margin-top: 2px;
}
.stepper-item.is-cleared .stepper-dot {
  background: var(--accent);
  border-color: var(--mint-2);
}
.stepper-item strong { display: block; font-size: 14px; }
.stepper-item span { font-size: 12px; color: var(--muted); font-weight: 600; }
.stepper-item.is-cleared strong,
.stepper-item.is-cleared span { color: var(--accent-dark); }
.stepper-dots { display: flex; gap: 5px; align-items: center; margin-top: 6px; }
.stepper-dot-sm {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
}
.stepper-dot-sm.is-cleared { background: var(--accent); }

.check-layout { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--section-gap); }
@media (max-width: 860px) { .check-layout { grid-template-columns: 1fr; } }
.preview-box {
  position: relative; background: #111; border-radius: 8px; overflow: hidden;
  aspect-ratio: 4/3; border: 1px solid var(--line);
}
.preview-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.face-frame {
  position: absolute; inset: 12% 18%; border: 1px dashed rgba(255,255,255,0.45);
  border-radius: 50% 50% 40% 40%; pointer-events: none;
}
.mic-meter { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.mic-meter > span { display: block; height: 100%; width: 0; background: var(--accent); }
.check-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.check-item .kv-label { margin: 0; }
.check-status { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #d1d5db; flex-shrink: 0; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--danger); }

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin: 0;
}
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  border: 0;
  background: var(--mint);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.filter-chip.is-active,
.filter-chip:has(input:checked) { background: var(--accent); color: #fff; }
.category-chips .filter-chip { position: relative; }
.category-chips input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.exam-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--section-gap);
  margin: 0;
}
.exam-row[hidden] { display: none !important; }
.exam-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 18px 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.exam-card:hover {
  border-color: var(--mint-2);
  box-shadow: var(--shadow-md);
}
.exam-card-ribbon {
  position: absolute;
  top: 0;
  left: 16px;
  width: 12px;
  height: 18px;
  background: var(--accent);
}
.exam-card-ribbon::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  border-left: 6px solid var(--accent);
  border-right: 6px solid var(--accent);
  border-bottom: 7px solid transparent;
}
.exam-card .pill-new {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.exam-card-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
  padding-right: 48px;
}
.exam-card-body:hover { text-decoration: none; color: var(--text); }
.exam-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--mint);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.exam-card-copy { min-width: 0; }
.exam-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.3;
}
.exam-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.exam-card-delete {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0 0;
}

.verify-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--section-gap);
  align-items: start;
  margin: 0;
}
@media (max-width: 760px) { .verify-layout { grid-template-columns: 1fr; } }
.countdown-block { text-align: left; }
.countdown-block .kv-label { margin-bottom: 6px; }
.countdown-xl {
  font-size: clamp(2.8rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text);
}

.auth-page {
  min-height: 100vh;
  background: var(--bg);
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(360px, 1fr);
}
.auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px 44px 56px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 12%, rgba(232, 245, 233, 0.22), transparent 42%),
    radial-gradient(circle at 88% 78%, rgba(255, 255, 255, 0.1), transparent 36%),
    linear-gradient(165deg, #14532d 0%, #1e7a3d 52%, #0f3d22 100%);
}
.auth-aside-mark {
  position: absolute;
  width: 320px;
  height: 320px;
  border: 48px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  top: -90px;
  right: -80px;
  pointer-events: none;
}
.auth-aside-copy {
  position: relative;
  max-width: 420px;
}
.auth-eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}
.auth-aside-copy h2 {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 2.4vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: #fff;
}
.auth-aside-copy p {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}
.auth-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.auth-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.auth-points li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b7e4c0;
  flex-shrink: 0;
}
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background:
    radial-gradient(circle at 90% 8%, rgba(232, 245, 233, 0.9), transparent 28%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 36px 32px 32px;
}
.auth-card-logo {
  height: 40px;
  max-width: 220px;
  width: auto;
  margin: 0 auto 22px;
  display: block;
}
.auth-card h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  text-align: center;
}
.auth-lead {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.auth-card .alert { margin-bottom: 18px; }
.auth-card .field {
  margin-bottom: 18px;
  gap: 8px;
}
.auth-card .field label { font-size: 14px; }
.auth-card .field input {
  height: 46px;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 8px;
}
.auth-card .field-input input { padding-right: 44px; }
.auth-card .btn-lg {
  height: 46px;
  margin-top: 4px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
}
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside {
    padding: 28px 24px 32px;
    min-height: auto;
  }
  .auth-aside-copy h2 { font-size: 1.45rem; }
  .auth-aside-copy p { margin-bottom: 16px; }
  .auth-points { display: none; }
  .auth-panel { padding: 28px 16px 40px; align-items: flex-start; }
  .auth-card { padding: 28px 22px; }
}

.exam-shell { display: grid; grid-template-rows: auto 1fr; height: 100vh; overflow: hidden; background: var(--bg); }
.exam-shell, .exam-content, .exam-main {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.exam-shell::-webkit-scrollbar,
.exam-content::-webkit-scrollbar,
.exam-main::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.exam-bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: 10px var(--page-gutter); background: #fff; border-bottom: 1px solid var(--line);
  font-size: 14px; flex-shrink: 0; position: relative;
}
.exam-bar .brand { margin-right: 8px; }
.exam-bar .exam-help { margin-left: auto; }
.exam-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}
.exam-help:hover { color: var(--accent-dark); text-decoration: none; }
.exam-help svg { flex-shrink: 0; }
.timer {
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px;
  background: var(--bg); border: 1px solid var(--line); padding: 4px 12px; border-radius: 8px;
}
.timer.warn { color: var(--warn); }
.timer.danger { color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

.exam-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  min-height: 0;
  overflow: hidden;
  height: 100%;
}
.exam-content {
  padding: var(--space-4) var(--page-gutter);
  overflow: auto;
  background: var(--bg);
  min-height: 0;
  height: 100%;
}
.exam-content:has(.odoo-frame) {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pip {
  background: #fff;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
  flex-shrink: 0;
}
.pip video {
  width: 100%;
  height: 88px;
  object-fit: cover;
  transform: scaleX(-1);
  background: #111;
  flex-shrink: 0;
}
.pip-meta {
  padding: 6px 8px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.3;
  flex-shrink: 0;
}
.odoo-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  border: 0;
  background: var(--panel);
  display: block;
}
.warn-popup {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483000;
  width: min(380px, calc(100vw - 36px));
  background: var(--panel);
  border: 1px solid #f3c0c0;
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
  display: block;
  pointer-events: none;
}
.warn-popup[hidden] { display: none !important; }
.warn-popup.error {
  border-color: #f3c0c0;
  border-left-color: var(--danger);
  background: var(--danger-bg);
  animation: shake 0.35s ease;
}
.warn-popup.error strong { color: var(--danger); }
.warn-popup.error p { color: #8e1b1b; font-weight: 600; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.warn-popup strong {
  display: block;
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.warn-popup p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c62828; margin-right: 6px; animation: pulse 1.2s infinite; }

.q-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-bottom: 14px; }
.q-card h3 { margin: 0 0 12px; font-size: 16px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }

.banner {
  display: none; position: sticky; top: 0; z-index: 5; padding: 10px 14px;
  background: var(--danger-bg); color: #8e1b1b; font-weight: 600; text-align: center;
  border-bottom: 1px solid #f3c0c0;
}
.banner.show { display: block; }

.modal-back {
  display: none; position: fixed; inset: 0; background: rgba(26, 32, 26, 0.45);
  z-index: 50; place-items: center;
}
.modal-back.open { display: grid; }
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 24px; width: min(420px, calc(100% - 32px)); box-shadow: var(--shadow-md);
}
.modal h2 { margin: 0 0 8px; }
.modal p { color: var(--muted); line-height: 1.5; }

.kiosk-notice { font-size: 13px; color: var(--muted); margin-top: 8px; }
.link-box {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px; word-break: break-all; font-size: 13px;
}

body.lockdown,
html.lockdown {
  user-select: none;
  -webkit-user-select: none;
}
body.lockdown img, body.lockdown video { -webkit-user-drag: none; }

.lock-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(247, 248, 245, 0.94);
  z-index: 80;
  place-items: center;
  padding: 24px;
}
.lock-overlay.open { display: grid; }

.evidence-timeline { list-style: none; padding: 0; margin: 0; }
.evidence-timeline li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.evidence-timeline time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}
.evidence-timeline strong { display: block; font-size: 14px; }
.evidence-timeline p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.evidence-timeline li.is-alert strong { color: var(--danger); }
.evidence-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.evidence-thumbs a {
  display: grid;
  gap: 4px;
  width: 120px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
}
.evidence-thumbs img {
  width: 120px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111;
}

.replay-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.replay-item {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.replay-item.is-alert { border-left: 4px solid var(--danger); }
.replay-meta time { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.replay-meta p { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.replay-media { display: flex; gap: 12px; flex-wrap: wrap; }
.replay-media figure { margin: 0; }
.replay-media img {
  max-width: 360px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111;
}
.replay-media figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
@media (max-width: 800px) {
  .replay-item { grid-template-columns: 1fr; }
}

.filter-bar-split { justify-content: space-between; align-items: center; }

.board-card-stats {
  display: flex;
  gap: 12px;
  padding: 0 18px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
}
.stat-card:hover { border-color: var(--mint-2); }
.stat-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 122, 61, 0.12);
  background: linear-gradient(#fff, var(--mint));
}
.stat-card strong {
  display: block;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  margin-top: 4px;
}
.stat-card .kiosk-notice { margin: 2px 0 0; }
.stat-field {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.stat-field input {
  width: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: #fff;
}
.stat-card.is-active .stat-field input { border-color: var(--mint-2); }

.shortlist { margin: 0; }
.shortlist h2 { font-size: 15px; margin: 0 0 12px; }
.shortlist-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.shortlist-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  display: grid;
  justify-items: start;
  gap: 8px;
  box-shadow: var(--shadow);
  position: relative;
}
.shortlist-card:hover { border-color: var(--mint-2); box-shadow: var(--shadow-md); text-decoration: none; color: var(--text); }
.shortlist-1 { border-color: var(--mint-2); background: linear-gradient(#fff, var(--mint)); }
.shortlist-card h3 { margin: 0; font-size: 16px; }
.shortlist-score { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }
.shortlist-score small { font-size: 13px; color: var(--muted); font-weight: 600; }
.shortlist-card .rank-badge { position: absolute; top: 14px; right: 14px; }

.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.rank-1 { background: #f5b700; }
.rank-2 { background: #b0b0b0; }
.rank-3 { background: #c97c3d; }
.table-leaderboard { width: 100%; }
.table-leaderboard .col-rank { width: 76px; }
.table-leaderboard .col-lb-score { width: 140px; }
.table-leaderboard .col-actions { width: 140px; }
.table-leaderboard .kiosk-notice { margin: 2px 0 0; }
.table tbody tr.is-flagged { background: #f6f6f4; }
.table-card[hidden] { display: none !important; }
.score-cell { display: grid; gap: 6px; min-width: 110px; }
.score-bar {
  display: block;
  height: 4px;
  background: var(--mint);
  border-radius: 99px;
  overflow: hidden;
}
.score-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}
.rank-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.hire-list { display: grid; gap: 8px; }
.hire-row {
  display: grid;
  grid-template-columns: 40px 42px minmax(160px, 1.3fr) 140px minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.hire-row:hover { background: var(--bg-2); }
.hire-row[hidden] { display: none !important; }
.hire-who { min-width: 0; }
.hire-who a { color: var(--text); }
.hire-who a:hover { color: var(--accent-dark); }
.hire-who strong { display: block; }
.hire-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}
.hire-actions { display: flex; gap: 8px; justify-content: flex-end; }
.hire-row-flagged { background: #f7f7f5; }
.flagged-board { margin: 0; }
.flagged-board[hidden] { display: none !important; }
.flagged-board h2 { font-size: 15px; margin: 0 0 4px; }
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.empty-state p { margin: 0 0 6px; font-weight: 600; }

@media (max-width: 980px) {
  :root { --sidebar-w: 200px; }
  .sidebar-brand .brand-logo { max-width: 160px; }
  .stat-row, .shortlist-grid { grid-template-columns: 1fr 1fr; }
  .hire-row {
    grid-template-columns: 36px 40px 1fr;
  }
  .hire-row .score-cell,
  .hire-row .hire-meta,
  .hire-row .hire-actions { grid-column: 1 / -1; }
}

code { font-size: 0.92em; background: var(--bg); padding: 1px 5px; border-radius: 4px; }

@media (max-width: 720px) {
  .stat-row, .shortlist-grid { grid-template-columns: 1fr; }
  .top-search { display: none; }
  .user-chip-text { display: none; }
}
