:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #162033;
  --muted: #687386;
  --line: #e6eaf2;
  --primary: #2457d6;
  --primary-dark: #1844ad;
  --green: #15803d;
  --red: #b91c1c;
  --orange: #c2410c;
  --blue: #1d4ed8;
  --shadow: 0 18px 55px rgba(22, 32, 51, .08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Segoe UI, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 280px; background: #0f172a; color: white; padding: 24px; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; }
.brand.center { justify-content: center; color: var(--text); }
.brand-logo { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: white; color: white; font-weight: 900; overflow: hidden; box-shadow: 0 8px 20px rgba(0,0,0,.16); }
.brand-logo-img { width: 100%; height: 100%; object-fit: contain; padding: 4px; background: white; }
.brand-fallback { display: none; place-items: center; width: 100%; height: 100%; background: linear-gradient(135deg, #3b82f6, #1e40af); color: white; }
.sidebar nav { display: grid; gap: 8px; margin-top: 36px; }
.sidebar nav a { text-decoration: none; color: #dbeafe; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.04); }
.sidebar nav a:hover { background: rgba(255,255,255,.12); }
.userbox { margin-top: auto; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); }
.linkbtn { background: transparent; border: 0; color: #bfdbfe; padding: 10px 0; cursor: pointer; }
.main { flex: 1; margin-left: 280px; padding: 32px; max-width: 100%; }
.main-login { margin-left: 0; display: grid; place-items: center; }
.login-wrap { width: 100%; max-width: 440px; padding: 20px; }
.login-card, .card, .hero-card, .ticket-card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.login-card { padding: 34px; }
.card, .hero-card, .ticket-card { padding: 24px; margin-bottom: 22px; }
h1, h2, h3 { margin: 0 0 14px; line-height: 1.18; }
p { line-height: 1.55; }
.muted { color: var(--muted); font-size: 14px; }
.form { display: grid; gap: 16px; }
.form.compact { max-width: 680px; }
label { display: grid; gap: 8px; font-weight: 700; }
input, textarea { width: 100%; border: 1px solid #d6dce8; border-radius: 14px; padding: 12px 14px; font: inherit; background: white; }
textarea { resize: vertical; }
button, .button { border: 0; background: var(--primary); color: white; padding: 12px 18px; border-radius: 14px; font-weight: 800; cursor: pointer; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
button:hover, .button:hover { background: var(--primary-dark); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary, .button.secondary { background: #e8eefc; color: #1741a2; }
button.good, .button.good { background: var(--green); }
button.danger, .button.danger { background: var(--red); }
button.small { padding: 8px 10px; border-radius: 10px; font-size: 13px; }
button.wide { width: 100%; }
.big-btn { font-size: 20px; padding: 18px 32px; border-radius: 18px; }
.center-card, .center { text-align: center; }
.hero-card { background: linear-gradient(135deg, #ffffff, #edf4ff); }
.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: white; border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.stat span { display: block; font-size: 34px; font-weight: 900; color: var(--primary); }
.stat p { margin: 6px 0 0; color: var(--muted); }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; }
.flash { margin-bottom: 18px; padding: 14px 16px; border-radius: 14px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.flash.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.success-box, .warning-box, .info-box { padding: 16px; border-radius: 16px; line-height: 1.5; }
.success-box { background: #ecfdf5; border: 1px solid #bbf7d0; color: #14532d; }
.warning-box { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.info-box { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 16px; }
.ticket-head h1 { font-size: 52px; color: var(--primary); margin: 0; }
.questions-list { margin: 0; padding-left: 24px; display: grid; gap: 14px; font-size: 18px; line-height: 1.45; }
.questions-cell .questions-list { font-size: 13px; gap: 8px; max-width: 540px; }
.qnum { color: var(--primary); font-weight: 900; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #334155; font-size: 13px; background: #f8fafc; position: sticky; top: 0; }
code { background: #f1f5f9; padding: 3px 6px; border-radius: 8px; }
.badge { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 999px; color: white; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge.green { background: var(--green); }
.badge.red { background: var(--red); }
.badge.orange { background: var(--orange); }
.badge.blue { background: var(--blue); }
.badge.gray { background: #64748b; }
.actions-col { display: grid; gap: 8px; min-width: 185px; }
.retake-form { display: grid; gap: 6px; }
.retake-form input { padding: 8px; border-radius: 10px; font-size: 13px; }
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.wide-table table { min-width: 1200px; }
@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; min-height: auto; }
  .app-shell { display: block; }
  .main { margin-left: 0; padding: 18px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}
.lang-switch { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.lang-switch a { text-decoration: none; border: 1px solid var(--line); background: white; color: var(--text); padding: 7px 10px; border-radius: 999px; font-weight: 800; }
.lang-switch a.active { background: var(--primary); border-color: var(--primary); color: white; }
.stats-grid { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.actions-col { min-width: 220px; }
.call-panel { border-left: 6px solid #f97316; }
.active-call { background: linear-gradient(135deg, #fff7ed, #ffffff); }
.call-status { display: grid; gap: 6px; }
.call-action { border: 1px solid #fed7aa; background: #fff7ed; padding: 8px; border-radius: 12px; }
.call-banner { margin-bottom: 22px; padding: 24px; border-radius: 24px; border: 2px solid #fb923c; background: linear-gradient(135deg, #ffedd5, #fff7ed); color: #7c2d12; box-shadow: var(--shadow); text-align: center; }
.call-banner h2 { font-size: 28px; margin-bottom: 8px; }
.call-banner p { margin: 0; font-weight: 700; }
.hidden { display: none !important; }

/* V5: large visible notification for called student */
.call-banner .call-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 22px; margin-top: 12px; font-weight: 800; }
.call-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(15, 23, 42, .72); display: grid; place-items: center; padding: 24px; }
.call-modal { width: min(680px, 100%); background: #fff7ed; border: 3px solid #fb923c; border-radius: 30px; box-shadow: 0 30px 90px rgba(0,0,0,.35); padding: 34px; text-align: center; color: #7c2d12; }
.call-modal h1 { font-size: 38px; margin: 10px 0 12px; }
.call-modal p { font-size: 18px; font-weight: 800; }
.call-modal-meta { display: grid; gap: 8px; margin: 18px 0; padding: 14px; background: white; border: 1px solid #fed7aa; border-radius: 18px; font-size: 18px; }
.call-pulse { width: 72px; height: 72px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: #f97316; color: white; font-size: 44px; font-weight: 900; animation: callPulse 1.1s infinite; }
@keyframes callPulse { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(249,115,22,.55); } 70% { transform: scale(1.06); box-shadow: 0 0 0 22px rgba(249,115,22,0); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(249,115,22,0); } }
@media (max-width: 640px) { .call-modal { padding: 24px; } .call-modal h1 { font-size: 28px; } .call-modal p, .call-modal-meta { font-size: 16px; } }

/* V6: exam call/join link */
.call-join-row { justify-content: center; margin-top: 16px; }
.call-modal .button { margin: 8px auto 12px; font-size: 18px; padding: 14px 22px; }
