/* =========================================================================
   DevOps Exam — design system
   ========================================================================= */

:root {
  --bg-0:        #0b0d12;
  --bg-1:        #11141b;
  --bg-2:        #171b24;
  --bg-3:        #1e232e;
  --border:      #242a37;
  --border-hi:   #2e3646;
  --text:        #e8ecf3;
  --text-dim:    #a7b0c0;
  --muted:       #7a8494;

  --brand:       #6366f1;          /* indigo-500 */
  --brand-hi:    #818cf8;          /* indigo-400 */
  --brand-lo:    #4f46e5;          /* indigo-600 */
  --brand-soft:  rgba(99,102,241,0.14);

  --ok:          #10b981;
  --ok-soft:     rgba(16,185,129,0.14);
  --warn:        #f59e0b;
  --warn-soft:   rgba(245,158,11,0.14);
  --err:         #ef4444;
  --err-soft:    rgba(239,68,68,0.14);

  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   16px;

  --shadow-sm:   0 1px 2px rgba(0,0,0,0.3);
  --shadow:      0 10px 30px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.2);
  --shadow-glow: 0 0 0 4px rgba(99,102,241,0.15);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(99,102,241,0.10), transparent 60%),
    radial-gradient(900px 500px at 100% 0%,   rgba(16,185,129,0.06), transparent 60%),
    var(--bg-0);
  color: var(--text);
  font: 15px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* --------------------- topbar --------------------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: rgba(17,20,27,0.8);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.topbar .brand .logo {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), #22d3ee);
  display: grid; place-items: center;
  color: white; font-weight: 800; font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.topbar .right { display: flex; gap: 12px; align-items: center; }

/* --------------------- containers --------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px;
}

.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.2px; }
h2 { margin: 18px 0 12px; font-size: 16px; letter-spacing: -0.1px; }
h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase;
     letter-spacing: 0.6px; color: var(--muted); font-weight: 600; }

.muted { color: var(--muted); }
.text-dim { color: var(--text-dim); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.err { color: var(--err); }

/* --------------------- inputs --------------------- */
label {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: 0.1px;
}

input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--shadow-glow);
  background: var(--bg-2);
}

textarea { min-height: 160px; resize: vertical; line-height: 1.6; }

.field { margin-bottom: 14px; }

/* --------------------- buttons --------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--brand);
  color: white;
  border: 1px solid transparent;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  min-height: 44px;
  transition: transform 80ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn:hover { background: var(--brand-lo); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn.secondary {
  background: var(--bg-3);
  border-color: var(--border-hi);
  color: var(--text);
}
.btn.secondary:hover { background: var(--bg-2); border-color: var(--brand); }

.btn.ghost {
  background: transparent;
  border-color: var(--border-hi);
  color: var(--text-dim);
}
.btn.ghost:hover { background: var(--bg-3); color: var(--text); }

.btn.danger  { background: var(--err); }
.btn.danger:hover  { background: #dc2626; }
.btn.ok-btn { background: var(--ok); }
.btn.ok-btn:hover { background: #0ea371; }

.btn.sm {
  padding: 8px 12px;
  font-size: 12.5px;
  border-radius: 6px;
  min-height: 36px;
}

.btn.block { width: 100%; }

/* --------------------- messages & toasts --------------------- */
.message {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid transparent;
}
.message.err { background: var(--err-soft);  color: #fecaca; border-color: rgba(239,68,68,0.35); }
.message.ok  { background: var(--ok-soft);   color: #a7f3d0; border-color: rgba(16,185,129,0.35); }
.message.warn{ background: var(--warn-soft); color: #fcd9a3; border-color: rgba(245,158,11,0.35); }

#toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 260px;
  max-width: 420px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: toast-in 180ms ease-out;
}
.toast.ok   { border-left-color: var(--ok);   }
.toast.err  { border-left-color: var(--err);  }
.toast.warn { border-left-color: var(--warn); }
.toast.leaving { animation: toast-out 180ms ease-in forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(8px); } }

/* --------------------- rows / grid --------------------- */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.col { flex: 1; min-width: 0; }
.col.grow-2 { flex: 2; }
@media (min-width: 640px) { .col { min-width: 240px; } }

/* --------------------- login layout --------------------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 920px;
  padding: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
}
@media (max-width: 820px) { .login-card { grid-template-columns: 1fr; } }

.login-hero {
  padding: 34px 30px;
  background:
    radial-gradient(500px 300px at 20% 30%, rgba(99,102,241,0.25), transparent 60%),
    radial-gradient(400px 300px at 100% 100%, rgba(34,211,238,0.18), transparent 60%),
    var(--bg-2);
  border-right: 1px solid var(--border);
  position: relative;
}
.login-hero h1 { font-size: 28px; letter-spacing: -0.4px; }
.login-hero p  { color: var(--text-dim); font-size: 14px; margin: 10px 0 0; }
.login-hero ul {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}
.login-hero li {
  font-size: 13.5px;
  color: var(--text-dim);
  display: flex;
  gap: 10px;
}
.login-hero li .dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-hi);
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

.login-form { padding: 30px; }

/* Role pill tabs */
.tabs {
  display: inline-flex;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 18px;
}
.tabs button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font: inherit;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
  min-height: 40px;
}
.tabs button.active {
  background: var(--brand);
  color: white;
  box-shadow: 0 1px 4px rgba(99,102,241,0.4);
}

/* Camera preview */
.camera-box {
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  color: var(--muted);
  position: relative;
}
.camera-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
.camera-box::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
  border-radius: inherit;
}
.cam-hint {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  margin-top: 10px;
}
.cam-hint .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted);
}
.cam-hint.ok  .dot { background: var(--ok);  box-shadow: 0 0 0 4px var(--ok-soft); }
.cam-hint.err .dot { background: var(--err); box-shadow: 0 0 0 4px var(--err-soft); }

/* --------------------- exam layout --------------------- */
.exam-layout {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 960px) { .exam-layout { grid-template-columns: 1fr; } }

.sidebar .camera-box video { transform: none; }
.sidebar { position: sticky; top: 80px; }

.progress {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #22d3ee);
  transition: width 320ms ease;
}
.progress-meta {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
  font-size: 12.5px; color: var(--muted);
  margin-bottom: 18px;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-hi);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

.question-number {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.3px;
  margin: 14px 0 4px;
}
.question-text {
  font-size: 17px;
  line-height: 1.65;
  margin-bottom: 18px;
  color: var(--text);
}

.char-count { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: right; }

/* fade transition between questions */
.fade-swap { animation: fade-in 220ms ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* --------------------- admin --------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.stat {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -0.4px; }
.stat.brand .value { color: var(--brand-hi); }
.stat.ok    .value { color: var(--ok); }
.stat.warn  .value { color: var(--warn); }
.stat.err   .value { color: var(--err); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: var(--bg-2);
  position: sticky;
  top: 0;
}
tr:hover td { background: rgba(255,255,255,0.03); }
tr:last-child td { border-bottom: none; }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--brand-lo), #22d3ee);
  margin-right: 10px;
  vertical-align: middle;
  flex-shrink: 0;
}
.user-cell { display: flex; align-items: center; }
.user-cell .who .name { font-weight: 600; }
.user-cell .who .handle { font-size: 12px; color: var(--muted); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-dim);
  border: 1px solid var(--border-hi);
  font-weight: 600;
  letter-spacing: 0.2px;
}
.tag::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}
.tag.done    { background: var(--ok-soft);  color: #a7f3d0; border-color: rgba(16,185,129,0.35); }
.tag.done::before    { background: var(--ok); }
.tag.inprog  { background: var(--warn-soft); color: #fcd9a3; border-color: rgba(245,158,11,0.35); }
.tag.inprog::before  { background: var(--warn); }
.tag.warn    { background: var(--warn-soft); color: #fcd9a3; border-color: rgba(245,158,11,0.35); }
.tag.warn::before    { background: var(--warn); }
.tag.blocked { background: var(--err-soft);  color: #fecaca; border-color: rgba(239,68,68,0.35); }
.tag.blocked::before { background: var(--err); }

.actions { white-space: nowrap; }
.actions .btn { margin: 0 2px 4px 0; }

/* Search + auto-refresh controls in the candidates header */
.search-input {
  width: 220px;
  background: var(--bg-1);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 13px;
}
.search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--shadow-glow);
}
.autor-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.autor-label input { accent-color: var(--brand); }

/* Proctor events timeline */
.events-list {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  max-height: 240px;
  overflow-y: auto;
}
.event-row {
  display: flex;
  gap: 8px;
  padding: 5px 2px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.event-row:last-child { border-bottom: none; }
.event-row .ev-time { color: var(--muted); font-family: "SFMono-Regular", Consolas, monospace; flex-shrink: 0; }
.event-row .ev-type {
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.event-row.critical .ev-type { background: var(--err-soft); color: #fecaca; }
.event-row.warn     .ev-type { background: var(--warn-soft); color: #fcd9a3; }
.event-row.info     .ev-type { background: var(--brand-soft); color: var(--brand-hi); }
.event-row .ev-detail { color: var(--text-dim); overflow-wrap: anywhere; }

.answer-block {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.answer-block .q { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.answer-block .a {
  white-space: pre-wrap;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  background: var(--bg-0);
  border-radius: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  color: var(--text);
}
.answer-block .a.empty { color: var(--muted); font-style: italic; font-family: inherit; }

.answer-block .ref-label {
  color: var(--ok);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin: 10px 0 6px;
  display: flex; align-items: center; gap: 6px;
}
.answer-block .ref {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.28);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: #d1fadf;
  line-height: 1.55;
  white-space: pre-wrap;
}
.answer-block .ref.empty { color: var(--muted); background: var(--bg-1); border-style: dashed; font-style: italic; }
.answer-block .ref-actions { margin-top: 6px; }

.bank-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.bank-stats .cell {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.bank-stats .cell .l { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.bank-stats .cell .v { font-size: 18px; font-weight: 700; }
.bank-stats .cell .sub { font-size: 12px; color: var(--text-dim); }
.bank-stats .cell.warn  { border-color: rgba(245,158,11,0.35); }
.bank-stats .cell.warn  .v { color: var(--warn); }
.bank-stats .cell.ai    { border-color: rgba(99,102,241,0.35); }
.bank-stats .cell.ai    .v { color: var(--brand-hi); }

.level-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.4px;
  vertical-align: middle; margin-left: 6px;
}
.level-tag.junior { background: rgba(16,185,129,0.14); color: #7ee2a1; border: 1px solid rgba(16,185,129,0.3); }
.level-tag.mid    { background: rgba(245,158,11,0.14); color: #fcd9a3; border: 1px solid rgba(245,158,11,0.3); }
.level-tag.senior { background: rgba(239,68,68,0.14);  color: #fecaca; border: 1px solid rgba(239,68,68,0.3); }
.level-tag.ai     { background: rgba(99,102,241,0.14); color: var(--brand-hi); border: 1px solid rgba(99,102,241,0.3); }

/* --------------------- recording dot --------------------- */
.rec-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--err);
  background: var(--err-soft);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(239,68,68,0.3);
}
.rec-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--err);
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* --------------------- modal --------------------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5,7,12,0.65);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  animation: fade-in 160ms ease-out;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: modal-in 200ms ease-out;
}
.modal .body { overflow-y: auto; }
.bank-list .answer-block { margin-bottom: 10px; }
.bank-list .hstack { align-items: flex-start; }
.bank-list .qt { line-height: 1.55; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal header h2 { margin: 0; font-size: 16px; }
.modal .close {
  background: transparent; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 20px; line-height: 1;
  padding: 8px 12px; border-radius: 6px;
  min-width: 44px; min-height: 44px;
  display: inline-grid; place-items: center;
}
.modal .close:hover { background: var(--bg-3); color: var(--text); }
.modal .body   { padding: 18px 22px; }
.modal .footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
  background: var(--bg-1);
}

/* --------------------- empty state --------------------- */
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border-hi);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.01);
}
.empty strong { color: var(--text-dim); }

/* --------------------- video --------------------- */
video.dark-video {
  width: 100%;
  background: #000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* --------------------- done / loading cards --------------------- */
#doneCard, #loadingCard {
  text-align: center;
  padding: 48px 32px;
}
#doneCard h1 { margin-bottom: 12px; }
#doneCard p { max-width: 520px; margin: 0 auto 8px; }
#doneCard .btn { margin-top: 18px; }

/* --------------------- small helpers --------------------- */
.hstack { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.vstack { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; font-size: 12.5px; }

/* --------------------- utilities --------------------- */
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 14px; }
.mt-4  { margin-top: 18px; }
.mb-0  { margin-bottom: 0; }
.mb-2  { margin-bottom: 8px; }
.mb-3  { margin-bottom: 14px; }
.mb-4  { margin-bottom: 18px; }
.small { font-size: 12.5px; }
.center-text { text-align: center; }
.logo-big {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #22d3ee);
  display: grid; place-items: center;
  color: white; font-weight: 800;
}
.brand-title { font-size: 14px; }
.retry-cam-spacing { margin-top: 8px; }
.text-left { text-align: left; }
.mx-auto   { margin-left: auto; margin-right: auto; }

/* Pre-exam warning / retry cards */
.warning-block {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  text-align: left;
}
.warning-block h1 { margin-bottom: 12px; }
.warning-block p  { color: var(--text-dim); line-height: 1.6; }

/* focus ring for accessibility */
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand-hi);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .fade-swap, .toast, .modal-backdrop, .modal {
    animation: none !important;
    transition: none !important;
  }
  .progress > span { transition: none !important; }
  .rec-pill .dot { animation: none !important; }
}

/* --------------------- timer --------------------- */
.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--warn);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.timer-badge::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warn);
  animation: pulse 1.4s infinite;
}
.timer-badge.urgent {
  color: var(--err);
  border-color: rgba(239,68,68,0.35);
  background: var(--err-soft);
}
.timer-badge.urgent::before { background: var(--err); }

/* --------------------- toolbar --------------------- */
.toolbar { flex-wrap: wrap; gap: 8px; }
.toolbar .search-input { flex-shrink: 1; min-width: 160px; }

#bankCard .hstack { flex-wrap: wrap; gap: 8px; }

/* --------------------- card hover --------------------- */
.card { transition: box-shadow 180ms ease, transform 180ms ease; }
.card:hover { box-shadow: 0 14px 36px rgba(0,0,0,0.4), 0 3px 8px rgba(0,0,0,0.25); }

/* --------------------- button transitions --------------------- */
.btn { transition: transform 80ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease; }

/* --------------------- bank list inside modal --------------------- */
.bank-list { max-height: 60vh; overflow-y: auto; padding-right: 4px; }

/* --------------------- detail card transition --------------------- */
#detailCard { animation: fade-in 220ms ease-out; }

/* scrollbar polish (webkit only) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 999px; border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }

/* --------------------- skeleton loading --------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --------------------- live proctoring --------------------- */
.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.live-tile {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: box-shadow 150ms ease, border-color 150ms ease;
}
.live-tile:hover { border-color: var(--border-hi); box-shadow: 0 4px 14px rgba(0,0,0,0.2); }
.live-tile.watching { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.live-tile .avatar { width: 36px; height: 36px; font-size: 13px; }
.live-tile .who { line-height: 1.25; }
.live-tile .name { font-weight: 600; font-size: 14px; }
.live-tile .handle { font-size: 12px; color: var(--muted); }

/* --------------------- mobile responsive --------------------- */
@media (max-width: 640px) {
  .container { padding: 16px; }
  .card { padding: 18px 16px; margin-bottom: 14px; }
  .topbar { padding: 12px 16px; }
  .topbar .brand { font-size: 14px; }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat .value { font-size: 22px; }

  .login-wrap { padding: 16px; }
  .login-form { padding: 20px; }
  .login-hero { padding: 24px 20px; }
  .login-hero h1 { font-size: 22px; }

  .tabs { display: flex; width: 100%; }
  .tabs button { flex: 1; text-align: center; padding: 10px 8px; font-size: 12px; }

  .exam-layout { gap: 14px; }
  .sidebar { position: static; }
  textarea { min-height: 120px; }

  #toasts { right: 10px; bottom: 10px; left: 10px; }
  .toast { min-width: 0; max-width: 100%; }

  .modal-backdrop { padding: 12px; }
  .modal { max-width: 100%; }
  .modal header { padding: 14px 16px; }
  .modal .body { padding: 14px 16px; }
  .modal .footer { padding: 12px 16px; flex-wrap: wrap; }

  .live-grid { grid-template-columns: 1fr; }

  #doneCard, #loadingCard { padding: 32px 20px; }
}

@media (max-width: 400px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .label { font-size: 10px; }
  .stat .value { font-size: 20px; }
}
