:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #242633;
  --muted: #6f7585;
  --line: #dfe3ea;
  --accent: #c93a31;
  --accent-dark: #a92f28;
  --ok: #16794c;
  --warn: #a15c05;
  --bad: #b42318;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.shell { width: min(980px, calc(100% - 32px)); margin: 36px auto; }
.hero { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 24px 0 34px; border-bottom: 1px solid var(--line); text-align: center; }
.mark { font-size: 54px; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1.05; letter-spacing: 0; }
.hero p { margin: 12px 0 0; color: var(--muted); font-size: clamp(22px, 3vw, 34px); font-weight: 700; }
.panel { margin-top: 32px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 24px; box-shadow: 0 6px 20px rgba(15, 23, 42, .04); }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 8px; font-weight: 700; color: #303446; }
input, select, button, textarea { font: inherit; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #f1f3f6; padding: 13px 14px; color: var(--ink); }
textarea { min-height: 90px; direction: ltr; }
button { border: 0; border-radius: 8px; padding: 13px 16px; background: var(--accent); color: white; font-weight: 800; cursor: pointer; }
button:hover { background: var(--accent-dark); }
button.secondary { background: #2f3a4f; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
button:disabled { opacity: .55; cursor: not-allowed; }
.notice { padding: 15px 16px; border-radius: 8px; background: #fde8e7; color: var(--bad); border: 1px solid #fac5c1; }
.success { padding: 15px 16px; border-radius: 8px; background: #e8f6ef; color: var(--ok); border: 1px solid #bce6d1; }
.flash-message { margin-top: 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #fff; }
.question { display: grid; gap: 14px; direction: ltr; text-align: left; }
.options { display: grid; gap: 10px; }
.option { display: flex; flex-direction: row; justify-content: flex-start; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; cursor: pointer; direction: ltr; text-align: left; }
.option input { width: auto; margin-top: 5px; }
.exam-disabled .option { opacity: .72; cursor: not-allowed; }
.submit-status { width: 100%; text-align: center; }
.timer { font-size: 24px; font-weight: 900; color: var(--accent); }
table { width: 100%; border-collapse: collapse; direction: ltr; text-align: left; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f3f5f8; }
.status { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #eef2ff; font-weight: 700; }
.status.Started { background: #e8f6ef; color: var(--ok); }
.status.Locked { background: #fff3cd; color: var(--warn); }
.status.Finished { background: #edf2f7; color: #344054; }
@media (max-width: 720px) { .grid.two { grid-template-columns: 1fr; } .panel { padding: 16px; } table { font-size: 13px; } }

.bank-field { display: grid; gap: 10px; }
.field-title { font-weight: 800; color: #303446; }
.mini-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-actions button { padding: 8px 12px; font-size: 14px; }
.bank-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.bank-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; cursor: pointer; font-weight: 700; direction: ltr; text-align: left; }
.bank-item:has(input:checked) { border-color: #86d3a6; background: #ecfdf3; color: #166534; }
.bank-item input { width: auto; accent-color: #16a34a; }


.exam-topbar { justify-content: flex-end; }
.submit-row { display: flex; justify-content: center; padding-top: 18px; }
.submit-row button { min-width: 220px; }

.edit-form { margin: 12px 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.inline-check { display: flex; align-items: center; gap: 10px; }
.inline-check input { width: auto; }
.form-actions { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }


.locked-wrap { display: grid; place-items: center; min-height: 320px; padding: 24px; }
.locked-card { width: min(560px, 100%); padding: 30px 26px; border: 1px solid #fac5c1; border-radius: 8px; background: #fff7f7; color: var(--bad); text-align: center; box-shadow: 0 12px 30px rgba(180, 35, 24, .08); }
.locked-icon { width: 54px; height: 54px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-size: 34px; font-weight: 900; }
.locked-card h2 { margin: 0 0 12px; font-size: 30px; line-height: 1.2; }
.locked-card p { margin: 0 auto 10px; max-width: 460px; font-size: 18px; line-height: 1.7; }
.locked-card .locked-help { color: #7a2a25; font-weight: 700; }
.monitor-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-card { border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; padding: 12px 14px; display: grid; gap: 6px; }
.stat-card span { color: var(--muted); font-weight: 800; font-size: 13px; }
.stat-card strong { font-size: 26px; color: var(--ink); }
.monitor-tools { align-items: stretch; margin-bottom: 14px; }
.monitor-filters, .monitor-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.monitor-filters input { min-width: 240px; }
.locked-field { opacity: .75; }
.instructions-card { max-width: 720px; margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 26px; box-shadow: 0 8px 24px rgba(15, 23, 42, .05); }
.instructions-card h2 { margin: 0 0 14px; font-size: 28px; }
.instructions-card ul { margin: 16px 0; padding-inline-start: 24px; line-height: 1.8; font-weight: 700; }
.student-summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 8px; background: #f1f3f6; }
.student-summary span { color: var(--muted); font-weight: 800; }


.staff-panel, .staff-tabs { direction: ltr; text-align: left; }
.staff-tabs { justify-content: flex-start; }
.staff-panel label { text-align: left; }
.staff-panel input, .staff-panel select, .staff-panel textarea { direction: ltr; text-align: left; }
.staff-panel .toolbar, .staff-panel .monitor-tools { direction: ltr; }
.staff-panel .mini-actions, .staff-panel .monitor-filters, .staff-panel .monitor-actions, .staff-panel .form-actions { justify-content: flex-start; }
.staff-panel .stat-card { text-align: left; }
.staff-panel .bank-field, .staff-panel .field-title { text-align: left; }
.table-scroll { overflow-x: auto; }
.monitor-table { min-width: 1180px; table-layout: auto; }
.monitor-table th, .monitor-table td { white-space: nowrap; }
.monitor-table th:nth-child(3), .monitor-table td:nth-child(3) { min-width: 280px; }
.monitor-table th:nth-child(6), .monitor-table td:nth-child(6), .monitor-table th:nth-child(7), .monitor-table td:nth-child(7) { min-width: 230px; }
.monitor-table .student-name-cell { direction: rtl; text-align: right; unicode-bidi: plaintext; }
.doctors-table { min-width: 760px; table-layout: fixed; }
.doctors-table th:nth-child(1), .doctors-table td:nth-child(1) { width: 28%; }
.doctors-table th:nth-child(2), .doctors-table td:nth-child(2) { width: 16%; }
.doctors-table th:nth-child(3), .doctors-table td:nth-child(3) { width: 16%; }
.doctors-table th:nth-child(4), .doctors-table td:nth-child(4) { width: 40%; }
.table-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.table-actions button { min-width: 86px; }
.staff-tabs .staff-tab { background: #2f3a4f; color: #fff; }
.staff-tabs .staff-tab.active { background: var(--accent); color: #fff; }
.doctors-table th, .doctors-table td { vertical-align: middle; }
.doctors-table .table-actions { justify-content: flex-start; }
.session-switch { display: flex; align-items: center; gap: 12px; width: fit-content; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; cursor: pointer; }
.session-switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 54px; height: 30px; border-radius: 999px; background: #cbd5e1; padding: 3px; transition: background .18s ease; flex: 0 0 auto; }
.switch-thumb { display: block; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .22); transition: transform .18s ease; }
.session-switch input:checked + .switch-track { background: var(--accent); }
.session-switch input:checked + .switch-track .switch-thumb { transform: translateX(24px); }
.switch-copy { display: grid; gap: 2px; }
.switch-copy strong { color: var(--ink); }
.switch-copy small { color: var(--muted); font-weight: 700; }

