@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/NotoSansArabic-400.ttf") format("truetype");
}
@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/NotoSansArabic-600.ttf") format("truetype");
}
@font-face {
  font-family: "Noto Sans Arabic";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/NotoSansArabic-700.ttf") format("truetype");
}

:root {
  --background: #f3f7ff;
  --foreground: #243652;
  --card: #fbfcff;
  --primary: #1d4ed8;
  --primary-ink: #f8fbff;
  --muted: #5c6d86;
  --line: #d5e2f5;
  --active: #1d4ed8;
  --sidebar: #0c2340;
  --radius: 0.85rem;
  --shadow: 0 18px 44px -28px rgba(29, 78, 216, 0.75);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--foreground);
  font-family: "Noto Sans Arabic", Tahoma, sans-serif;
  background-image:
    radial-gradient(900px 420px at 100% -8%, rgba(96, 165, 250, 0.28), transparent 60%),
    radial-gradient(720px 360px at 0% 0%, rgba(29, 78, 216, 0.16), transparent 55%),
    linear-gradient(180deg, #f3f7ff 0%, #eef3fb 100%);
  background-attachment: fixed;
  line-height: 1.55;
}
a { color: #1e3a8a; }
h1, h2, h3, p, button, input, select, textarea { font-family: inherit; }
h1 { font-size: clamp(1.55rem, 3vw, 2rem); font-weight: 700; line-height: 1.35; margin: 0 0 8px; }
h2 { margin: 0 0 8px; font-size: 1.15rem; }
.muted { color: var(--muted); }
.public-header, .office-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(243, 247, 255, 0.92);
  backdrop-filter: blur(10px);
}
.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.text-link { color: #1e3a8a; font-weight: 700; text-decoration: none; white-space: nowrap; }
.who { display: grid; min-width: 0; line-height: 1.3; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: min(52vw, 28rem); }
.brand-lockup { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.brand-lockup small, .eyebrow { display: block; color: var(--muted); font-size: 12px; }
.mark { width: 40px; height: 40px; flex: none; }
.main-narrow { width: min(440px, calc(100% - 32px)); margin: 32px auto 48px; }
.main-wide { width: min(1120px, calc(100% - 24px)); margin: 0 auto; padding: 16px 0 96px; }
.auth-panel, .card {
  background: color-mix(in srgb, white 86%, var(--card));
  border: 1px solid #d7e4fb;
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
  padding: 16px;
}
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
}
textarea { min-height: 120px; }
.button, button.button, .nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 0.7rem;
  border: 1px solid transparent;
  background: var(--primary);
  color: white;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}
.button.ghost, .nav a { background: white; color: var(--foreground); border-color: var(--line); }
.button.danger { background: #9f1239; }
.banner { border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.banner.ok { background: #ecfdf3; color: #166534; border: 1px solid #bbf7d0; }
.banner.bad { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.cards, .stats { display: grid; gap: 14px; }
.stats { grid-template-columns: 1fr 1fr; }
@media (min-width: 800px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(4, 1fr); }
}
.service-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 14px;
  border-radius: 1.5rem;
  border: 1px solid #dbe7fb;
  background: white;
  padding: 20px;
  box-shadow: 0 16px 40px -28px rgba(29, 78, 216, 0.55);
}
.service-card.active { border-color: #bfdbfe; }
.service-card .ghost-num {
  position: absolute;
  z-index: 0;
  top: 0.15rem;
  inset-inline-start: 0.35rem;
  margin: 0;
  font-size: 3.4rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(56, 189, 248, 0.28);
  pointer-events: none;
}
.service-head, .service-card > a, .service-card > span { position: relative; z-index: 1; }
.service-head { position: relative; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.service-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.service-title h2 { font-size: 1.25rem; }
.icon-tile {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 16px;
  background: #f1f5f9;
  color: #64748b;
}
.icon-tile.on { background: #1d4ed8; color: white; }
.icon-tile.small { width: 36px; height: 36px; border-radius: 12px; }
.icon-tile.small svg { width: 16px; height: 16px; }
.sheet-head { display: grid; gap: 8px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid rgba(125, 211, 252, 0.7); }
.urgent-panel {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  border: 1px solid #dbeafe;
  border-radius: 1.5rem;
  background: rgba(255,255,255,0.8);
  padding: 16px;
  box-shadow: var(--shadow);
}
.urgent-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.urgent-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.urgent-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 12px 4px;
  border-radius: 16px;
  border: 1px solid #dbeafe;
  background: linear-gradient(#fff, #eff6ff);
  color: #172554;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}
.urgent-live { font-size: 11px; font-weight: 600; }
.site-footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #dbeafe;
  background: rgba(255,255,255,0.5);
  padding: 20px 16px;
  color: var(--muted);
  font-size: 14px;
}
.public-shell { min-height: 100vh; display: flex; flex-direction: column; }
.q-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-inline-end: 8px;
  border-radius: 999px;
  background: #1d4ed8;
  color: white;
  font-size: 12px;
}
.question-card { border-color: #dbeafe; border-radius: 1.5rem; }
.dock {
  position: fixed;
  z-index: 35;
  inset-inline: 0;
  bottom: 58px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: rgba(12, 35, 64, 0.96);
  border-top: 1px solid rgba(125, 211, 252, 0.3);
}
.dock a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 2px;
  color: #eef4ff;
  text-decoration: none;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}
.dock-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: #bae6fd;
}
.dock-icon svg { width: 16px; height: 16px; }
.dock-note { font-size: 10px; font-weight: 500; color: #bae6fd; }
@media (min-width: 640px) {
  .dock {
    bottom: 12px;
    inset-inline: 12px;
    max-width: 48rem;
    margin-inline: auto;
    border: 1px solid rgba(125, 211, 252, 0.3);
    border-radius: 16px;
  }
}
.pill { border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; background: #e2e8f0; color: #334155; }
.pill.open, .pill.done { background: #dbeafe; color: #1e3a8a; }
.score {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: white;
  font-weight: 700;
}
.score input { width: 22px; height: 22px; min-height: 0; }
.score:has(input:checked) { border-color: var(--primary); background: #eff6ff; }
.scale { display: grid; gap: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.bar { height: 8px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); }
.shell { min-height: 100vh; }
@media (min-width: 1024px) {
  .shell.admin { display: grid; grid-template-columns: 17rem 1fr; }
}
.sidebar {
  display: none;
  background: linear-gradient(180deg, #16386a 0%, #0c2340 55%, #08182c 100%);
  color: #f8fbff;
  padding: 12px;
}
@media (min-width: 1024px) { .sidebar { display: flex; flex-direction: column; min-height: 100vh; } }
.sidebar a { color: inherit; text-decoration: none; }
.side-brand { display: flex; gap: 10px; align-items: center; margin: 8px; padding: 12px; border-radius: 16px; background: rgba(255,255,255,0.1); }
.side-brand span { min-width: 0; }
.side-brand strong { display: block; font-size: 0.92rem; line-height: 1.35; }
.side-brand small { display: block; opacity: 0.7; font-size: 12px; }
.side-section { margin: 14px 8px 4px; font-size: 11px; letter-spacing: 0.04em; opacity: 0.65; }
.side-link { display: block; border-radius: 10px; padding: 8px 12px; color: rgba(248,251,255,0.88); }
.side-link.active, .side-link:hover { background: rgba(255,255,255,0.15); color: white; }
.mobile-nav { background: #0c2340; color: #fff; }
.mobile-nav summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 700;
  list-style: none;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px 10px 12px;
  background: #0c2340;
}
.mobile-menu a {
  color: white;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.3;
  min-height: 42px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.mobile-menu a.active { background: rgba(255,255,255,0.22); }
@media (min-width: 1024px) { .mobile-nav { display: none; } }
.tabs { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 12px 0; }
@media (min-width: 720px) { .tabs { grid-template-columns: 1fr 1fr; } }
.tabs a { width: 100%; white-space: normal; text-align: center; text-decoration: none; border-radius: 14px; }
.part-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 800px) { .part-links { grid-template-columns: repeat(5, 1fr); } }
.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0;
  display: flex; justify-content: space-around;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(251, 252, 255, 0.96);
  border-top: 1px solid var(--line);
}
.bottom-nav a { color: var(--foreground); text-decoration: none; font-size: 13px; }
@media (min-width: 800px) { .bottom-nav { display: none; } }
.stat strong { display: block; font-size: 1.8rem; margin-top: 6px; }

.student-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #eef4ff;
  background:
    radial-gradient(circle at 8% 0%, rgba(96, 165, 250, 0.38), transparent 34%),
    radial-gradient(circle at 100% 12%, rgba(37, 99, 235, 0.42), transparent 30%),
    linear-gradient(165deg, #1e4b8a 0%, #0f2d52 55%, #08182c 100%);
}
.student-top, .student-bottom a, .student-links a { color: #eef4ff; text-decoration: none; }
.student-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(125, 211, 252, 0.3);
  background: rgba(12, 35, 64, 0.9);
}
.student-links { display: none; gap: 12px; align-items: center; }
@media (min-width: 640px) { .student-links { display: flex; } }
.button.ghost.light { color: #eef4ff; border-color: rgba(125, 211, 252, 0.5); background: transparent; }
.student-main { width: min(1024px, calc(100% - 24px)); margin: 0 auto; padding: 16px 0 96px; flex: 1; display: flex; }
.student-sheet {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 1.75rem;
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  color: #10233d;
  padding: 16px 16px 150px;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.45);
}
@media (min-width: 640px) { .student-sheet { padding: 24px; } }
.student-bottom {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: #08182c;
  border-top: 1px solid rgba(125, 211, 252, 0.3);
  text-align: center;
  font-weight: 700;
}
@media (min-width: 640px) { .student-bottom { display: none; } }
.hero-panel {
  text-align: center;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.7);
  padding: 24px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.round-live {
  display: inline-flex;
  margin-top: 10px;
  border-radius: 999px;
  background: #1e40af;
  color: white;
  padding: 4px 12px;
  font-size: 0.92rem;
}
.rate-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.rate-opt {
  position: relative;
  min-height: 96px;
  border-radius: 16px;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  padding: 8px 2px;
}
.rate-opt input { position: absolute; opacity: 0; }
.rate-num {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 1.15rem;
  font-weight: 700;
}
.rate-label {
  display: block;
  width: 100%;
  padding: 0 1px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}
.rate-opt.s1 { background: #dc2626; color: white; border-color: #b91c1c; }
.rate-opt.s2 { background: #ef4444; color: white; border-color: #dc2626; }
.rate-opt.s3 { background: #fde047; color: #713f12; border-color: #eab308; }
.rate-opt.s4 { background: #bbf7d0; color: #14532d; border-color: #4ade80; }
.rate-opt.s5 { background: #166534; color: white; border-color: #14532d; }
.rate-opt { overflow: hidden; }
.rate-opt:has(input:checked) { transform: translateY(-2px); outline: 2px solid #0f172a; outline-offset: 2px; }
