:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef4f7;
  --text: #17202a;
  --muted: #667085;
  --border: #d9e0e7;
  --accent: #27548a;
  --accent-2: #0f766e;
  --warn: #a15c07;
  --danger: #b42318;
  --ok: #1f7a4d;
  --shadow: 0 10px 28px rgba(24, 39, 75, .08);
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.login-layout {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
}

.login-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  max-width: 440px;
  padding: 28px;
  width: min(440px, 100%);
}

.login-panel h1,
.page-title h1 {
  font-size: 24px;
  line-height: 1.2;
  margin: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0;
  text-transform: uppercase;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.layout.sidebar-collapsed {
  grid-template-columns: 74px minmax(0, 1fr);
}

.sidebar {
  background: #1f2933;
  color: #eef4f7;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
}

.brand {
  align-items: start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 0 4px 10px 8px;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span {
  color: #aebdcc;
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.nav-toggle {
  background: #324454;
  border-radius: 6px;
  color: #fff;
  flex: 0 0 30px;
  font-weight: 700;
  height: 30px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav button {
  align-items: center;
  background: transparent;
  border-radius: 6px;
  color: #dbe5ec;
  display: flex;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
  text-align: left;
}

.nav-short {
  display: none;
  font-weight: 800;
  min-width: 28px;
  text-align: center;
}

.nav button.active,
.nav button:hover {
  background: #324454;
  color: #ffffff;
}

.sidebar-collapsed .brand div,
.sidebar-collapsed .sidebar-footer,
.sidebar-collapsed .nav-label {
  display: none;
}

.sidebar-collapsed .brand {
  justify-content: center;
  padding-left: 0;
}

.sidebar-collapsed .nav button {
  justify-content: center;
  padding: 9px 6px;
}

.sidebar-collapsed .nav-short {
  display: inline;
}

.sidebar-footer {
  color: #aebdcc;
  font-size: 12px;
  margin-top: auto;
  padding: 8px;
}

.content {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 24px;
}

.user-chip {
  align-items: center;
  display: flex;
  gap: 10px;
}

.avatar {
  align-items: center;
  background: var(--accent);
  border-radius: 50%;
  color: #fff;
  display: inline-grid;
  height: 34px;
  place-items: center;
  width: 34px;
}

.workspace {
  display: grid;
  gap: 18px;
  padding: 22px 24px 40px;
}

.page-head {
  align-items: end;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-height: 70px;
  padding: 12px;
}

.metric span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.metric strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  margin-top: 6px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, .03);
  overflow: hidden;
}

.panel-head {
  align-items: center;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 14px 16px;
}

.panel-head h2 {
  font-size: 16px;
  margin: 0;
}

.table-wrap {
  overflow: auto;
}

.wide-table table {
  min-width: 1680px;
}

table {
  border-collapse: collapse;
  font-size: 13px;
  min-width: 900px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f0f3f6;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.table-sort {
  align-items: center;
  background: transparent;
  color: inherit;
  display: inline-flex;
  gap: 5px;
  font-size: inherit;
  font-weight: inherit;
  justify-content: flex-start;
  min-height: 24px;
  padding: 0;
  text-align: left;
  width: 100%;
}

.table-sort span {
  color: var(--accent);
  font-size: 10px;
  min-width: 10px;
}

.table-sort.active {
  color: var(--accent);
}

tr:hover td {
  background: #f8fbfd;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row.selected td {
  background: #e8f2fb;
}

.thumb {
  background: #e7edf2;
  border-radius: 4px;
  height: 42px;
  object-fit: cover;
  width: 42px;
}

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.badge.Registered { background: #e6f0ff; color: #194185; }
.badge.Verified { background: #dcfae6; color: #067647; }
.badge.InInterview { background: #fef0c7; color: #93370d; }
.badge.Completed { background: #e0f2f1; color: #0f766e; }
.badge.Departed { background: #ebe9fe; color: #5925dc; }
.badge.NoShow { background: #fee4e2; color: #b42318; }
.badge.Upcoming { background: #eef2f6; color: #475467; }

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 6px;
}

label {
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  color: var(--text);
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.btn {
  align-items: center;
  background: var(--accent);
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-weight: 700;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
}

.btn.secondary {
  background: #e8eef4;
  color: #243547;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: #243547;
}

.btn.warn {
  background: var(--warn);
}

.btn.danger {
  background: var(--danger);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

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

.drawer {
  background: #f8fbfd;
  border-left: 4px solid var(--accent);
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.evaluation-form {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.assessment-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
}

legend {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  padding: 0 6px;
}

.score-cell {
  max-width: 92px;
}

.score-detail-table th,
.score-detail-table td {
  white-space: nowrap;
}

.score-value,
.score-total {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.score-total {
  color: var(--accent);
}

.gd-live {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  min-height: 560px;
}

.gd-roster,
.gd-entry {
  align-self: start;
}

.gd-candidate-list {
  display: grid;
  gap: 8px;
  max-height: none;
  overflow: visible;
  padding: 10px;
}

.gd-candidate {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  display: grid;
  gap: 2px;
  justify-items: start;
  min-height: 62px;
  padding: 10px 12px;
  text-align: left;
}

.gd-candidate.active {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.gd-token {
  color: var(--accent);
  font-family: Consolas, "SF Mono", monospace;
  font-size: 48px;
  line-height: 1.1;
}

.gd-name {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.gd-total {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.gd-total.done {
  color: var(--ok);
}

.inline-head {
  border-bottom: 0;
  padding: 0;
}

.gd-score-total {
  align-items: baseline;
  background: #eef4f7;
  border-radius: 6px;
  display: flex;
  gap: 5px;
  padding: 10px 12px;
}

.gd-score-total strong {
  font-size: 28px;
}

.gd-live-actions {
  align-items: center;
}

.gd-save-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-right: auto;
}

.gd-save-status.saving {
  color: var(--accent);
}

.gd-save-status.saved {
  color: var(--ok);
}

.gd-save-status.error {
  color: var(--danger);
}

.gd-score-board {
  display: grid;
  gap: 12px;
}

.gd-score-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.gd-score-row > div:first-child {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.gd-score-row span {
  color: var(--muted);
  font-weight: 700;
}

.score-buttons {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(11, minmax(34px, 1fr));
}

.score-buttons button {
  background: #f5f7fa;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #243547;
  font-weight: 700;
  min-height: 38px;
}

.score-buttons button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.mono {
  font-family: Consolas, "SF Mono", monospace;
}

.qr-token {
  background: #111827;
  border-radius: 6px;
  color: #f9fafb;
  font-size: 12px;
  overflow-wrap: anywhere;
  padding: 12px;
}

.toast {
  background: #111827;
  border-radius: 6px;
  bottom: 20px;
  box-shadow: var(--shadow);
  color: #fff;
  max-width: min(460px, calc(100vw - 32px));
  padding: 12px 14px;
  position: fixed;
  right: 20px;
  z-index: 20;
}

.empty {
  color: var(--muted);
  padding: 18px;
}

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

  .layout.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .summary-strip,
  .assessment-grid,
  .gd-live,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .score-buttons {
    grid-template-columns: repeat(6, minmax(34px, 1fr));
  }

  .page-head,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }
}
