:root {
  --bm-wine: #7b1734;
  --bm-wine-900: #4b0b20;
  --bm-wine-800: #5e1028;
  --bm-wine-700: #68132d;
  --bm-wine-100: #f8edf1;
  --bm-gold: #b99746;
  --bm-gold-700: #8f702c;
  --bm-gold-100: #f7f1e2;
  --ink: #211c1e;
  --muted: #746d70;
  --muted-2: #9b9497;
  --line: #e7e1e3;
  --soft: #f6f4f4;
  --white: #ffffff;
  --green: #227451;
  --green-soft: #e9f5ef;
  --red: #b83e4d;
  --red-soft: #fbecef;
  --shadow-sm: 0 2px 10px rgba(63, 22, 36, .05);
  --shadow-md: 0 16px 45px rgba(63, 22, 36, .09);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100%; overflow-x: hidden; background: #f6f4f4; color: var(--ink); font: 15px/1.5 Inter, "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Brand */
.brand-lockup { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-emblem { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: var(--bm-gold); color: var(--bm-wine-900); display: grid; place-items: center; box-shadow: inset 0 0 0 2px rgba(255,255,255,.38); font-family: Georgia, serif; font-size: 18px; font-weight: 700; }
.brand-logo-image { width: 146px; height: 68px; object-fit: cover; object-position: center; }
.brand-text { line-height: 1.05; min-width: 0; }
.brand-ar { display: block; color: var(--bm-wine); font-family: Tahoma, Arial, sans-serif; font-size: 15px; font-weight: 700; }
.brand-en { display: block; color: var(--ink); font-size: 10px; font-weight: 700; letter-spacing: 1.7px; margin-top: 4px; }
.brand-divider { width: 1px; height: 30px; background: var(--line); margin: 0 2px; }
.team-title { line-height: 1.12; }
.team-title strong { display: block; font-size: 13px; color: var(--bm-wine); }
.team-title span { color: var(--muted); font-size: 10px; }

/* Shared */
.topbar { height: 76px; padding: 0 clamp(16px, 4vw, 52px); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.link-button { padding: 9px 12px; border-radius: 9px; background: transparent; color: var(--bm-wine); font-size: 12px; font-weight: 700; white-space: nowrap; }
.link-button:hover { background: var(--bm-wine-100); }
.button { min-height: 46px; padding: 0 18px; border-radius: 11px; background: var(--bm-wine); color: white; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: .05px; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.button:hover { background: var(--bm-wine-800); box-shadow: 0 8px 20px rgba(123,23,52,.18); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.button.secondary { color: var(--bm-wine); background: white; border: 1px solid #d9cfd2; }
.button.secondary:hover { background: var(--bm-wine-100); box-shadow: none; }
.button.gold { background: var(--bm-gold); color: #2d230c; }
.button.gold:hover { background: #a98635; }
.button.danger { color: var(--red); background: var(--red-soft); }
.button.full { width: 100%; }
.button.small { min-height: 36px; padding: 0 12px; border-radius: 9px; font-size: 11px; }
.icon-button { width: 38px; height: 38px; border-radius: 10px; background: var(--soft); color: var(--bm-wine); display: grid; place-items: center; font-size: 15px; font-weight: 700; }
.icon-button:hover { background: var(--bm-wine-100); }
.card { background: white; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.eyebrow { color: var(--bm-gold-700); font-size: 10px; font-weight: 700; letter-spacing: 1.25px; text-transform: uppercase; }
.muted { color: var(--muted); }
.helper { color: var(--muted); font-size: 11px; }
.field-group { margin-bottom: 17px; }
.field-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 7px; color: #3c3437; font-size: 12px; font-weight: 700; }
.field, .select, .textarea { width: 100%; border: 1px solid #ddd6d8; border-radius: 11px; background: white; color: var(--ink); outline: 0; transition: border .15s, box-shadow .15s; }
.field, .select { height: 48px; padding: 0 13px; }
.textarea { min-height: 100px; padding: 12px 13px; resize: vertical; }
.field::placeholder, .textarea::placeholder { color: #aca5a8; }
.field:focus, .select:focus, .textarea:focus { border-color: var(--bm-wine); box-shadow: 0 0 0 3px rgba(123,23,52,.09); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 99px; font-size: 9px; font-weight: 700; letter-spacing: .65px; text-transform: uppercase; white-space: nowrap; }
.pill.active { background: var(--green-soft); color: var(--green); }
.pill.draft { background: #efedeb; color: #746c68; }
.pill.closed { background: var(--red-soft); color: var(--red); }
.pill.gold { background: var(--bm-gold-100); color: var(--bm-gold-700); }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state-icon { width: 50px; height: 50px; margin: 0 auto 13px; border-radius: 50%; background: var(--bm-wine-100); color: var(--bm-wine); display: grid; place-items: center; font-size: 20px; }

/* Employee welcome */
.welcome-page { min-height: 100vh; background: radial-gradient(circle at 80% 8%, rgba(185,151,70,.16), transparent 24%), linear-gradient(140deg, #fbf9f9 0%, #f4f0f1 100%); }
.welcome-shell { width: min(1120px, calc(100% - 32px)); min-height: calc(100vh - 76px); margin: auto; display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: clamp(40px, 8vw, 110px); padding: 54px 0 70px; }
.welcome-copy { max-width: 590px; }
.secure-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; color: var(--bm-wine); background: white; border: 1px solid #e7dfe1; border-radius: 99px; box-shadow: var(--shadow-sm); font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.secure-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.welcome-copy h1 { max-width: 610px; margin: 24px 0 18px; color: var(--bm-wine-900); font-size: clamp(37px, 5.2vw, 66px); line-height: 1.02; letter-spacing: -2.2px; }
.welcome-copy h1 span { color: var(--bm-gold); }
.welcome-copy > p { max-width: 560px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.exam-facts { display: flex; gap: 30px; margin-top: 32px; padding-top: 25px; border-top: 1px solid #dfd8da; }
.fact b { display: block; color: var(--bm-wine); font-size: 18px; }
.fact span { color: var(--muted); font-size: 10px; letter-spacing: .55px; text-transform: uppercase; }
.entry-card { position: relative; overflow: hidden; padding: 30px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.entry-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: linear-gradient(90deg, var(--bm-wine), var(--bm-gold)); }
.entry-logo { width: 190px; height: 90px; margin: -8px 0 14px; object-fit: cover; object-position: center; }
.entry-card h2 { margin: 5px 0 5px; color: var(--bm-wine); font-size: 22px; }
.entry-card > p { margin: 0 0 24px; color: var(--muted); font-size: 12px; }
.privacy-note { display: flex; align-items: flex-start; gap: 8px; margin: 14px 1px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

/* Exam */
.exam-page { min-height: 100vh; background: #f5f2f3; }
.exam-topbar { min-height: 78px; padding: 12px clamp(15px, 4vw, 40px); background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; position: sticky; top: 0; z-index: 15; }
.exam-topbar > div:first-child { min-width: 0; }
.exam-identity { min-width: 0; }
.exam-identity b { display: block; color: var(--bm-wine); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-identity span { color: var(--muted); font-size: 10px; }
.timer-box { min-width: 132px; height: 50px; padding: 0 13px; border: 1px solid #ded6d8; border-radius: 11px; background: white; display: flex; align-items: center; gap: 10px; }
.timer-symbol { color: var(--bm-gold-700); font-size: 18px; }
.timer-copy span { display: block; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
.timer-copy strong { display: block; color: var(--bm-wine); font-size: 16px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.timer-box.low { background: var(--red-soft); border-color: #edbac2; animation: timerPulse 1.4s infinite; }
@keyframes timerPulse { 50% { box-shadow: 0 0 0 5px rgba(184,62,77,.08); } }
.exam-container { width: min(820px, calc(100% - 30px)); margin: auto; padding: 30px 0 55px; }
.progress-line { height: 5px; margin-bottom: 22px; border-radius: 99px; overflow: hidden; background: #e2dcde; }
.progress-line span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--bm-wine), var(--bm-gold)); transition: width .25s ease; }
.question-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 12px; }
.question-counter { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.question-counter strong { color: var(--bm-wine); }
.answer-state { color: var(--green); font-size: 10px; font-weight: 700; }
.question-card { padding: clamp(22px, 4vw, 38px); border-radius: 20px; box-shadow: 0 18px 48px rgba(65,27,39,.07); }
.question-type { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 7px; background: var(--bm-gold-100); color: var(--bm-gold-700); font-size: 9px; font-weight: 700; letter-spacing: .65px; text-transform: uppercase; }
.question-text { margin: 18px 0 25px; color: #2b2225; font-size: clamp(21px, 3.3vw, 29px); line-height: 1.35; letter-spacing: -.45px; }
.scenario-box { margin: -4px 0 22px; padding: 15px 16px; border-left: 3px solid var(--bm-gold); border-radius: 0 9px 9px 0; background: #faf7ef; color: #5d4d2a; font-size: 12px; }
.answers { display: grid; gap: 10px; }
.answer-option { width: 100%; min-height: 58px; padding: 11px 15px; background: white; color: var(--ink); border: 1px solid #e1dbdd; border-radius: 12px; display: flex; align-items: center; gap: 12px; text-align: left; transition: border .15s, background .15s, transform .15s; }
.answer-option:hover { border-color: #c9aeb7; background: #fffafb; transform: translateY(-1px); }
.answer-key { width: 30px; height: 30px; flex: 0 0 30px; border: 1px solid #d5ced0; border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-size: 11px; font-weight: 700; }
.answers.multi .answer-key { border-radius: 8px; }
.answer-option.selected { border-color: var(--bm-wine); background: var(--bm-wine-100); box-shadow: inset 3px 0 var(--bm-wine); }
.answer-option.selected .answer-key { border-color: var(--bm-wine); background: var(--bm-wine); color: white; }
.exam-navigation { display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; margin-top: 23px; }
.question-map { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 21px; }
.question-map button { width: 30px; height: 30px; border-radius: 8px; background: #e8e3e4; color: var(--muted); font-size: 10px; font-weight: 700; }
.question-map button.answered { background: var(--bm-gold-100); color: var(--bm-gold-700); }
.question-map button.current { background: var(--bm-wine); color: white; }

/* Submission */
.success-page { min-height: 100vh; background: radial-gradient(circle at 50% 10%, rgba(185,151,70,.15), transparent 28%), #f7f4f5; }
.success-wrap { width: min(540px, calc(100% - 30px)); margin: 0 auto; padding: 82px 0; text-align: center; }
.success-card { padding: 43px 34px; border-radius: 22px; box-shadow: var(--shadow-md); }
.success-icon { width: 72px; height: 72px; margin: 0 auto 21px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 28px; box-shadow: 0 0 0 8px #f5faf7; }
.success-card h1 { margin: 0 0 12px; color: var(--bm-wine); font-size: 28px; line-height: 1.2; }
.success-card p { color: var(--muted); }
.success-reference { margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 10px; letter-spacing: .5px; }

/* Admin */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 245px 1fr; }
.sidebar { min-height: 100vh; padding: 24px 17px; background: linear-gradient(180deg, var(--bm-wine-900), #3e081a); color: white; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar .brand-ar, .sidebar .brand-en, .sidebar .team-title strong, .sidebar .team-title span { color: white; }
.sidebar .brand-divider { background: rgba(255,255,255,.18); }
.sidebar .brand-emblem { box-shadow: none; }
.sidebar .brand-logo-image, .login-brand-panel .brand-logo-image { width: 146px; height: 70px; padding: 0 5px; border-radius: 9px; background: white; }
.admin-label { margin: 28px 10px 9px; color: rgba(255,255,255,.45); font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.side-nav { display: grid; gap: 5px; }
.side-nav button { position: relative; width: 100%; min-height: 43px; padding: 0 12px; border-radius: 10px; background: transparent; color: rgba(255,255,255,.69); display: flex; align-items: center; gap: 10px; text-align: left; font-size: 12px; font-weight: 600; transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
.side-nav button:hover { color: white; background: rgba(255,255,255,.08); }
.side-nav button.active { color: white; background: linear-gradient(90deg,rgba(255,255,255,.18),rgba(255,255,255,.09)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12),0 8px 22px rgba(0,0,0,.16); font-weight: 750; }
.side-nav button.active::before { content:""; position:absolute; inset-inline-start:0; top:50%; width:4px; height:24px; border-radius:0 4px 4px 0; background:var(--bm-gold); box-shadow:0 0 12px rgba(217,180,76,.5); transform:translateY(-50%); }
.side-nav button.active .side-icon { color:var(--bm-gold); }
.side-icon { width: 22px; text-align: center; font-size: 15px; }
.sidebar-footer { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.12); }
.admin-profile { display: flex; align-items: center; gap: 10px; }
.admin-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--bm-gold); color: var(--bm-wine-900); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.admin-profile b { display: block; font-size: 11px; }
.admin-profile span { color: rgba(255,255,255,.55); font-size: 9px; }
.admin-main { min-width: 0; }
.admin-topbar { height: 76px; padding: 0 30px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 12; }
.admin-breadcrumb { color: var(--muted); font-size: 11px; }
.admin-breadcrumb strong { color: var(--ink); }
.language-select { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--bm-wine); outline: 0; font-size: 10px; font-weight: 700; }
.login-language { display: flex; justify-content: flex-end; margin-bottom: 20px; }
.live-status { min-height: 30px; padding: 0 10px; border-radius: 99px; background: var(--green-soft); color: var(--green); display: inline-flex; align-items: center; gap: 7px; font-size: 9px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase; }
.live-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(34,116,81,.1); }
.live-status.offline { background: var(--red-soft); color: var(--red); }
.admin-content { padding: 29px 30px 55px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 25px; }
.page-heading h1 { margin: 0; color: var(--bm-wine-900); font-size: 27px; letter-spacing: -.6px; }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 24px; }
.stat-card { padding: 18px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--bm-wine-100); color: var(--bm-wine); display: grid; place-items: center; }
.stat-card strong { display: block; margin-top: 13px; color: var(--bm-wine-900); font-size: 23px; }
.stat-card span { color: var(--muted); font-size: 10px; }
.section-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 27px 0 12px; }
.section-row h2 { margin: 0; color: var(--bm-wine-900); font-size: 16px; }
.exam-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.admin-exam-card { padding: 18px; overflow: hidden; }
.exam-card-top { display: flex; justify-content: space-between; align-items: center; }
.exam-card-icon { width: 39px; height: 39px; border-radius: 11px; background: var(--bm-wine-100); color: var(--bm-wine); display: grid; place-items: center; font-size: 17px; }
.admin-exam-card h3 { margin: 17px 0 6px; color: #32282b; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-exam-card > p { min-height: 35px; margin: 0; color: var(--muted); font-size: 10px; }
.exam-card-facts { display: flex; gap: 15px; margin: 15px 0; padding: 13px 0; border-top: 1px solid #f0ecad; border-bottom: 1px solid #f0eced; }
.exam-card-facts b { display: block; color: var(--bm-wine); font-size: 12px; }
.exam-card-facts span { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.card-actions { display: flex; gap: 7px; }
.card-actions .button { flex: 1; padding-left: 9px; padding-right: 9px; }
.toolbar { display: flex; align-items: center; gap: 9px; }
.search-field { width: min(280px, 100%); position: relative; }
.search-field .field { height: 40px; padding-left: 34px; margin: 0; }
.search-icon { position: absolute; left: 12px; top: 10px; color: var(--muted); font-size: 13px; }
.data-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { height: 42px; padding: 0 15px; background: #faf8f8; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; font-size: 9px; font-weight: 700; letter-spacing: .65px; text-transform: uppercase; }
.data-table td { padding: 14px 15px; border-bottom: 1px solid #f0eced; color: #453c3f; font-size: 11px; }
.admin-shell[dir="rtl"] .data-table th, .admin-shell[dir="rtl"] .data-table td { text-align: right; }
.admin-shell[dir="rtl"] .search-field .field { padding-left: 13px; padding-right: 34px; }
.admin-shell[dir="rtl"] .search-icon { left: auto; right: 12px; }
.admin-shell[dir="rtl"] .sidebar { text-align: right; }
.admin-shell[dir="rtl"] .side-nav button { text-align: right; }
.data-table tr:last-child td { border-bottom: 0; }
.employee-cell { display: flex; align-items: center; gap: 10px; }
.employee-initial { width: 31px; height: 31px; flex: 0 0 31px; border-radius: 50%; background: var(--bm-wine-100); color: var(--bm-wine); display: grid; place-items: center; font-weight: 700; }
.employee-cell b { display: block; font-size: 11px; }
.employee-cell small { color: var(--muted); font-size: 9px; }
.score-value { color: var(--bm-wine); font-size: 13px; font-weight: 700; }
.percentage-bar { width: 80px; height: 5px; border-radius: 99px; background: #ece7e8; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 7px; }
.percentage-bar i { display: block; height: 100%; background: var(--bm-gold); }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: white; }
.login-brand-panel { padding: 52px; background: linear-gradient(145deg, rgba(76,10,31,.96), rgba(123,23,52,.96)), radial-gradient(circle at top right, var(--bm-gold), transparent 50%); color: white; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-brand-panel::after { content: ""; position: absolute; width: 420px; height: 420px; right: -180px; bottom: -180px; border: 1px solid rgba(185,151,70,.25); border-radius: 50%; box-shadow: 0 0 0 45px rgba(185,151,70,.06), 0 0 0 90px rgba(185,151,70,.04); }
.login-brand-panel .brand-ar, .login-brand-panel .brand-en, .login-brand-panel .team-title strong, .login-brand-panel .team-title span { color: white; }
.login-brand-panel .brand-divider { background: rgba(255,255,255,.22); }
.login-message { max-width: 500px; position: relative; z-index: 2; }
.login-message h1 { margin: 0 0 17px; font-size: clamp(35px, 4vw, 58px); line-height: 1.05; letter-spacing: -1.5px; }
.login-message p { color: rgba(255,255,255,.67); font-size: 14px; line-height: 1.7; }
.login-caption { color: rgba(255,255,255,.45); font-size: 10px; position: relative; z-index: 2; }
.login-form-panel { padding: 40px; display: grid; place-items: center; }
.login-card { width: min(410px, 100%); }
.login-card h2 { margin: 0 0 7px; color: var(--bm-wine-900); font-size: 26px; }
.login-card > p { margin: 0 0 27px; color: var(--muted); font-size: 12px; }
.password-hint { margin-top: 13px; padding: 10px; border-radius: 9px; background: var(--bm-gold-100); color: #6d5621; text-align: center; font-size: 10px; }

/* Builder */
.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.builder-card { padding: 21px; }
.builder-card + .builder-card { margin-top: 14px; }
.builder-title { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.builder-number { width: 28px; height: 28px; border-radius: 8px; background: var(--bm-wine); color: white; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.builder-title h3 { margin: 0; color: var(--bm-wine-900); font-size: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.question-list { display: grid; gap: 9px; }
.builder-question { border: 1px solid var(--line); border-radius: 12px; background: white; overflow: hidden; }
.builder-question-summary { min-height: 62px; padding: 11px 13px; display: flex; align-items: center; gap: 10px; }
.drag-handle { color: #b3abad; cursor: grab; font-size: 13px; }
.question-order { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 7px; background: var(--bm-wine-100); color: var(--bm-wine); display: grid; place-items: center; font-size: 9px; font-weight: 700; }
.builder-question-text { min-width: 0; flex: 1; }
.builder-question-text b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.builder-question-text span { color: var(--muted); font-size: 9px; }
.question-actions { display: flex; gap: 4px; }
.publish-card { padding: 20px; position: sticky; top: 94px; }
.publish-card h3 { margin: 0 0 5px; color: var(--bm-wine-900); font-size: 15px; }
.publish-card > p { margin: 0 0 17px; color: var(--muted); font-size: 10px; }
.summary-list { display: grid; gap: 11px; margin: 17px 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.summary-item { display: flex; justify-content: space-between; gap: 15px; font-size: 10px; }
.summary-item span { color: var(--muted); }
.summary-item b { color: var(--ink); }
.publish-card .button + .button { margin-top: 8px; }
.option-editor { display: grid; gap: 8px; margin-top: 8px; }
.option-edit-row { display: grid; grid-template-columns: 32px 1fr 36px; gap: 7px; align-items: center; }
.correct-toggle { width: 32px; height: 32px; border-radius: 8px; border: 1px solid #d8d1d3; background: white; color: var(--muted); display: grid; place-items: center; font-size: 11px; }
.correct-toggle.selected { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.option-edit-row .field { height: 40px; }

/* Dialog + toast */
.overlay { position: fixed; inset: 0; padding: 18px; background: rgba(32,13,20,.52); display: grid; place-items: center; z-index: 100; backdrop-filter: blur(4px); animation: fadeIn .16s ease; }
.dialog { width: min(590px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; padding: 23px; border-radius: 19px; background: white; box-shadow: 0 24px 80px rgba(32,13,20,.24); animation: dialogUp .2s ease; }
.dialog-header { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.dialog-header h2 { margin: 0; color: var(--bm-wine-900); font-size: 19px; }
.dialog-header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 21px; padding-top: 16px; border-top: 1px solid var(--line); }
.dialog-actions a { text-decoration: none; }
.report-preview { max-height: 56vh; overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: var(--soft); }
.report-preview img { width: 100%; height: auto; }
.toast { min-width: 240px; padding: 12px 15px; border-radius: 11px; background: #2b2225; color: white; box-shadow: 0 14px 40px rgba(0,0,0,.2); font-size: 11px; font-weight: 600; position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; text-align: center; animation: toastUp .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes dialogUp { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes toastUp { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 1050px) {
  .exam-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .builder-layout { grid-template-columns: 1fr; }
  .publish-card { position: static; }
}

@media (max-width: 800px) {
  .welcome-shell { grid-template-columns: 1fr; gap: 34px; padding-top: 36px; }
  .welcome-copy { text-align: center; margin: auto; }
  .welcome-copy > p { margin: auto; }
  .exam-facts { justify-content: center; }
  .entry-card { width: min(500px, 100%); margin: auto; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; height: auto; padding: 12px 15px; position: sticky; z-index: 20; flex-direction: row; align-items: center; }
  .sidebar .brand-divider, .sidebar .team-title, .sidebar .admin-label, .sidebar-footer { display: none; }
  .sidebar .brand-lockup { margin-right: auto; }
  .sidebar .brand-emblem { width: 36px; height: 36px; flex-basis: 36px; font-size: 14px; }
  .side-nav { display: flex; }
  .side-nav button { width: 38px; min-height: 38px; padding: 0; justify-content: center; }
  .side-nav button span:last-child { display: none; }
  .admin-topbar { top: 60px; height: 63px; padding: 0 17px; }
  .admin-content { padding: 22px 17px 45px; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand-panel { min-height: 260px; padding: 30px; }
  .login-message h1 { font-size: 36px; margin-top: 36px; }
  .login-message p, .login-caption { display: none; }
  .login-form-panel { padding: 45px 25px; }
}

@media (max-width: 600px) {
  .topbar { height: 66px; padding: 0 14px; }
  .brand-emblem { width: 38px; height: 38px; flex-basis: 38px; }
  .brand-logo-image { width: 112px; height: 53px; }
  .brand-ar { font-size: 13px; }
  .brand-en { font-size: 8px; }
  .brand-divider, .team-title { display: none; }
  .welcome-shell { min-height: calc(100vh - 66px); width: calc(100% - 26px); padding: 30px 0 42px; }
  .welcome-copy h1 { margin-top: 19px; font-size: 39px; letter-spacing: -1.4px; }
  .welcome-copy > p { font-size: 13px; }
  .exam-facts { gap: 20px; margin-top: 24px; }
  .entry-card { padding: 22px 18px; border-radius: 18px; }
  .exam-topbar { min-height: 68px; }
  .exam-topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .exam-topbar > div:first-child { gap: 8px !important; flex: 1; }
  .exam-topbar .brand-lockup { flex: 0 0 76px; }
  .exam-topbar .brand-logo-image { width: 76px; height: 37px; }
  .exam-topbar .brand-lockup .team-title, .exam-topbar .brand-lockup .brand-divider, .exam-topbar .brand-text { display: none; }
  .timer-box { min-width: 120px; height: 45px; }
  .exam-container { padding-top: 18px; }
  .question-card { padding: 21px 17px; }
  .question-text { font-size: 21px; margin: 15px 0 20px; }
  .answer-option { min-height: 56px; padding: 10px 12px; }
  .exam-navigation { position: sticky; bottom: 10px; z-index: 5; padding: 8px; margin-left: -8px; margin-right: -8px; background: rgba(245,242,243,.92); border-radius: 15px; backdrop-filter: blur(10px); }
  .page-heading { align-items: center; }
  .page-heading h1 { font-size: 22px; }
  .page-heading p { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 14px; }
  .exam-grid { grid-template-columns: 1fr; }
  .section-row { align-items: flex-start; flex-direction: column; }
  .toolbar { width: 100%; }
  .search-field { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .dialog { border-radius: 18px 18px 0 0; }
  .overlay { place-items: end center; padding: 0; }
  .success-wrap { padding-top: 45px; }
  .success-card { padding: 36px 22px; }
}
