/*
  الهوية البصرية المشتركة لملف الإنجاز
  Academic clarity: strong contrast, generous rhythm, and consistent components.
*/
:root {
  --ink: #34463a;
  --deep: #34463a;
  --teal: #78927b;
  --gold: #a9b6a6;
  --paper: #f7faf7;
  --mist: #e7efe6;
  --line: #dce6dd;
  --muted: #68736b;
  --white: #ffffff;
  --success: #6f8c74;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 8px 24px rgba(52, 70, 58, .07);
  --shadow-md: 0 18px 48px rgba(52, 70, 58, .11);
  --shadow-lg: 0 30px 80px rgba(52, 70, 58, .18);
}

html { scroll-padding-top: 92px; }
body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--teal), transparent 91%) 0, transparent 30rem),
    linear-gradient(180deg, #ffffff 0, var(--paper) 34rem);
  font-family: "Segoe UI", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.85;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { color: #fff; background: var(--teal); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--gold), transparent 20%); outline-offset: 3px; }
a, button, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, .button, .back, .nav-links a { transition: transform .2s ease, box-shadow .2s ease, color .2s ease, background .2s ease, border-color .2s ease; }
button:hover, .button:hover { transform: translateY(-2px); }

.ui-icon {
  flex: 0 0 auto;
  width: 1.15em;
  height: 1.15em;
  display: inline-grid;
  place-items: center;
  vertical-align: -.16em;
}
.ui-icon svg { display: block; width: 100%; height: 100%; }
.nav-links a, .button, .back, .print-btn, .primary, .secondary, .mini, .brand[data-icon] { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.nav-links .ui-icon { color: var(--teal); font-size: .98rem; }
.button .ui-icon, .primary .ui-icon, .secondary .ui-icon { font-size: 1.05rem; }

.container, .wrap { width: min(1160px, calc(100% - 48px)); }

/* Header */
.topbar, .top {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  padding: 0;
  color: var(--ink);
  border-bottom: 1px solid color-mix(in srgb, var(--teal), white 82%);
  background: rgba(255, 255, 255, .91);
  box-shadow: 0 8px 30px rgba(16, 27, 56, .06);
  backdrop-filter: blur(18px) saturate(150%);
}
.nav { min-height: 78px; }
.brand { color: var(--deep); font-size: 1rem; font-weight: 900; letter-spacing: -.01em; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px 14px 6px 14px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--teal), white 12%), var(--deep));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--teal), transparent 72%);
}
.brand-mark svg { width: 22px; height: 22px; }
.nav-links { gap: 5px; color: var(--muted); font-size: .92rem; font-weight: 750; }
.nav-links a { padding: 9px 13px; border-radius: 11px; }
.nav-links a:hover { color: var(--teal); background: var(--mist); }
.nav-links .admin-nav-link { color: var(--teal); background: var(--mist); }
.nav-links .admin-nav-link:hover { color: #fff; background: var(--teal); }
.back, .print-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  color: var(--teal);
  border: 1px solid color-mix(in srgb, var(--teal), white 72%);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(25, 50, 105, .06);
  font-weight: 800;
}
.back:hover, .print-btn:hover { color: #fff; background: var(--teal); border-color: var(--teal); }

/* Hero areas */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 20%, color-mix(in srgb, var(--teal), transparent 34%) 0, transparent 28rem),
    linear-gradient(125deg, color-mix(in srgb, var(--deep), black 18%) 0%, var(--deep) 54%, color-mix(in srgb, var(--deep), var(--teal) 38%) 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .14;
  background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(90deg, transparent, #000 38%, #000);
}
.hero::after { opacity: .82; }
.hero-grid { gap: clamp(34px, 6vw, 78px); }
.hero h1 {
  max-width: 760px;
  margin: 14px 0 20px;
  font-size: clamp(2.7rem, 6.5vw, 5.35rem);
  line-height: 1.13;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.hero h1 span { color: color-mix(in srgb, var(--gold), white 10%); }
.hero-copy, .hero p { color: #dde7fb; font-size: 1.08rem; line-height: 1.95; }
.eyebrow { gap: 10px; font-size: .8rem; font-weight: 900; letter-spacing: .02em; }
.eyebrow::before { width: 34px; height: 3px; border-radius: 99px; background: var(--gold); }
.hero-actions { gap: 12px; margin-top: 32px; }

/* Balanced page introductions across the public site */
.topbar + main > .hero { padding: 58px 0 82px; }
.topbar + main > .hero h1 { font-size: clamp(2.35rem, 5vw, 4.25rem); }

/* Compact working header for the administration page */
.top + main > .hero { padding: 30px 0 48px; }
.top + main > .hero h1 { max-width: none; margin: 5px 0 8px; font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1.2; letter-spacing: -.025em; }
.top + main > .hero p { max-width: 760px; font-size: 1rem; line-height: 1.75; }
.top + main .profile-card, .top + main .auth { margin-top: -24px; }
.button, .primary, .secondary {
  min-height: 48px;
  border-radius: 13px;
  font-weight: 900;
}
.button-primary, .primary {
  color: #281b02;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold), white 18%), var(--gold));
  box-shadow: 0 12px 24px rgba(117, 76, 0, .22);
}
.button-primary:hover, .primary:hover { box-shadow: 0 16px 30px rgba(117, 76, 0, .28); }
.button-secondary, .secondary {
  color: #fff;
  border: 1px solid rgba(255,255,255,.38);
  background: rgba(255,255,255,.09);
  box-shadow: inset 0 1px rgba(255,255,255,.08);
}
.identity-card {
  padding: 36px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 30px 30px 10px 30px;
  background: linear-gradient(145deg, rgba(255,255,255,.17), rgba(255,255,255,.065));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}
.identity-card::before { inset: 12px; border-radius: 22px 22px 7px 22px; }
.profile-icon { width: 68px; height: 68px; border-radius: 22px 22px 7px 22px; background: rgba(3,13,40,.42); }
.identity-card h2 { font-size: 1.7rem; }
.identity-visual {
  position: relative;
  margin: -22px -22px 28px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 22px 22px 8px 22px;
  box-shadow: 0 18px 38px rgba(2, 10, 31, .26);
}
.identity-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(5,16,44,.42));
  pointer-events: none;
}
.identity-visual img { display: block; width: 100%; height: 220px; object-fit: cover; object-position: 38% center; }

/* Section rhythm and headings */
.section { padding: 96px 0; }
.section-title, .section-heading, .section-head {
  position: relative;
  max-width: 760px;
  padding-inline-start: 20px;
  border-inline-start: 4px solid var(--gold);
}
.section-title h2, .section-heading h2, .section-head h2 { color: var(--deep); letter-spacing: -.025em; text-wrap: balance; }
.lead, .section-heading p, .section-head p { color: var(--muted); font-size: 1rem; }

/* Summary cards */
.stats { margin-top: -42px; }
.stats-grid, .summary-grid {
  gap: 12px;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.stat, .summary-item {
  min-height: 112px;
  display: grid;
  align-content: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: 18px 18px 7px 18px;
  background: rgba(255,255,255,.97);
  box-shadow: var(--shadow-sm);
}
.stat:nth-child(2), .summary-item:nth-child(2) { border-top-color: #7c4fd6; }
.stat:nth-child(3), .summary-item:nth-child(3) { border-top-color: var(--success); }
.stat:nth-child(4), .summary-item:nth-child(4) { border-top-color: var(--gold); }
.stat strong, .summary-item strong { color: var(--teal); font-size: 1.8rem; }
.stat span, .summary-item span { color: var(--muted); font-size: .9rem; }
.stat > .ui-icon, .summary-item > .ui-icon {
  position: absolute;
  inset-inline-end: 18px;
  inset-block-start: 18px;
  width: 38px;
  height: 38px;
  padding: 9px;
  color: var(--teal);
  border-radius: 12px 12px 5px 12px;
  background: var(--mist);
}
.stat, .summary-item { position: relative; padding-inline-end: 68px; text-align: start; }

/* Reusable surfaces */
.value, .achievement, .evidence-item, .uploaded-card, .timeline-card,
.chapter, .profile-detail, details, .framework-card, .criterion, .quick-list,
.card, .record, .color-field, .theme-grid > .field {
  border-color: var(--line);
  background: rgba(255,255,255,.98);
  box-shadow: var(--shadow-sm);
}
.value, .evidence-item, .profile-detail, details, .framework-card, .record { border-radius: var(--radius-md) var(--radius-md) 7px var(--radius-md); }
.achievement, .uploaded-card, .timeline-card, .criterion, .card { border-radius: 22px 22px 8px 22px; }
.achievement, .value, .evidence-item, .framework-card, .criterion, .record { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.achievement:hover, .value:hover, .evidence-item:hover, .framework-card:hover, .criterion:hover, .record:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--teal), white 60%);
  box-shadow: var(--shadow-md);
}
.value-icon, .index, .file-icon { color: var(--teal); background: var(--mist); }
.value-icon > .ui-icon { width: 19px; height: 19px; }
.achievement > .ui-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 17px;
  padding: 11px;
  color: var(--teal);
  border: 1px solid color-mix(in srgb, var(--teal), white 75%);
  border-radius: 15px 15px 5px 15px;
  background: var(--mist);
}
.achievement-wrap, .performance, .criteria-area { background: linear-gradient(180deg, color-mix(in srgb, var(--mist), white 30%), #f9fbff); }
.note, .tip, .notice { color: var(--muted); border-inline-start-color: var(--gold); background: #fff9e9; box-shadow: inset 0 0 0 1px #f6e5ba; }

.evidence-feature, .policy-card, .contact-box, .action {
  border-radius: 28px 28px 9px 28px;
  background: linear-gradient(135deg, var(--deep), color-mix(in srgb, var(--deep), var(--teal) 48%));
  box-shadow: var(--shadow-md);
}
.contact-box, .action { padding: 44px; }
.contact-details { color: color-mix(in srgb, var(--gold), white 18%); }

/* Contents page */
.performance-grid { align-items: start; }
.performance-grid > details { align-self: start; }
.contents-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(30px, 6vw, 72px);
  align-items: center;
}
.contents-visual {
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 27px 27px 9px 27px;
  background: rgba(255,255,255,.1);
  box-shadow: var(--shadow-lg);
  transform: rotate(-1.2deg);
}
.contents-visual img { display: block; width: 100%; aspect-ratio: 1.5; object-fit: cover; border-radius: 20px 20px 6px 20px; }
.chapter { padding: 34px; border-radius: 28px 28px 9px 28px; }
.chapter-count, .weight { color: #664500; background: #fff0c8; border: 1px solid #f4d47e; }
.general-card { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(135deg, var(--mist), #fff); }
.folder { border-radius: 17px 17px 6px 17px; background: linear-gradient(145deg, color-mix(in srgb, var(--teal), white 10%), var(--deep)); box-shadow: 0 10px 20px color-mix(in srgb, var(--teal), transparent 76%); }
details { overflow: clip; }
details:hover, details[open] { border-color: color-mix(in srgb, var(--teal), white 56%); box-shadow: var(--shadow-md); }
summary { min-height: 80px; padding: 18px 20px; }
.index { border-radius: 13px 13px 5px 13px; font-weight: 900; }
.chevron { font-size: 1.15rem; }
.detail-content { font-size: .92rem; }
.evidence-file { border-color: var(--line); border-radius: 15px; background: #f8faff; }
.evidence-file-body a { color: var(--teal); text-underline-offset: 3px; }
.evidence-open {
  min-height: 38px;
  margin-top: 9px;
  padding: 7px 12px;
  color: #fff;
  border: 0;
  border-radius: 10px;
  background: var(--teal);
  box-shadow: 0 7px 16px rgba(80,105,84,.15);
  font: inherit;
  font-size: .82rem;
  font-weight: 900;
  cursor: pointer;
}
.evidence-open:hover { background: var(--deep); }
.viewer-open { overflow: hidden; }
.evidence-viewer {
  width: min(1040px, calc(100% - 36px));
  height: min(88dvh, 850px);
  max-width: none;
  max-height: none;
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 24px 24px 8px 24px;
  background: #fff;
  box-shadow: 0 35px 100px rgba(34,49,38,.3);
}
.evidence-viewer::backdrop { background: rgba(28,39,31,.62); backdrop-filter: blur(5px); }
.viewer-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
.viewer-header, .viewer-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; background: #fff; }
.viewer-header { border-bottom: 1px solid var(--line); }
.viewer-header h2 { margin: 2px 0 0; color: var(--deep); font-size: 1.25rem; }
.viewer-label { color: var(--teal); font-size: .78rem; font-weight: 900; }
.viewer-close {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  color: var(--deep);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.viewer-close:hover { color: #fff; border-color: var(--deep); background: var(--deep); }
.viewer-stage { min-height: 0; display: grid; place-items: center; overflow: auto; padding: 18px; background: #eef3ee; }
.viewer-stage img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; box-shadow: 0 12px 32px rgba(52,70,58,.14); }
.viewer-stage iframe { width: 100%; height: 100%; min-height: 460px; border: 0; border-radius: 10px; background: #fff; }
.viewer-footer { border-top: 1px solid var(--line); }
.viewer-footer p { margin: 0; color: var(--muted); font-size: .88rem; }
.viewer-external { flex: 0 0 auto; color: var(--teal); font-size: .86rem; font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.pdf-mark { color: #805500; background: #fff0c8; }

/* Guide */
.framework { gap: 16px; }
.framework-card { padding: 25px; }
.step, .criterion-number { color: #fff; background: linear-gradient(145deg, var(--teal), var(--deep)); box-shadow: 0 8px 18px color-mix(in srgb, var(--teal), transparent 76%); }
.criterion { overflow: hidden; }
.criterion-main { padding: 22px; }
.criterion .evidence { background: color-mix(in srgb, var(--mist), white 42%); }
.reference { color: var(--teal); font-weight: 800; text-underline-offset: 4px; }
.quick-item { border-bottom-color: var(--line); }
.quick-item::before { content: "✓"; display: inline-grid; place-items: center; width: 24px; height: 24px; margin-inline-end: 9px; color: #fff; border-radius: 8px 8px 3px 8px; background: var(--success); font-weight: 900; }
.privacy { border-color: color-mix(in srgb, var(--gold), white 50%); background: #fff9e9; }

/* Admin workspace */
body:has(.top + main) .hero { padding: 58px 0 106px; }
.profile-card, .auth { margin-top: -58px; }
.design-panel { margin-bottom: 34px; }
.card { padding: 28px; }
.card h2 { color: var(--deep); font-size: 1.35rem; }
.field label, .color-field { color: var(--deep); font-weight: 800; }
.field input, .field select, .field textarea {
  min-height: 47px;
  padding: 11px 13px;
  color: var(--ink);
  border: 1px solid #cbd7ec;
  border-radius: 12px;
  background: #fbfcff;
}
.field textarea { min-height: 112px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid color-mix(in srgb, var(--teal), transparent 87%); border-color: var(--teal); background: #fff; }
.upload { border: 1px dashed color-mix(in srgb, var(--teal), white 45%); border-radius: 15px; background: var(--mist); }
.metric { border: 1px solid var(--line); border-radius: 18px 18px 7px 18px; background: linear-gradient(135deg, var(--mist), #fff); }
.mini { color: var(--teal); border-color: color-mix(in srgb, var(--teal), white 60%); }
.mini:hover { color: #fff; background: var(--teal); }
.delete:hover { color: #fff; background: #b23b52; }
.toast { border-radius: 14px; background: var(--deep); box-shadow: var(--shadow-md); }

/* الهوية المختارة: أبيض + أخضر هادئ + خط سيجوي واضح */
.topbar, .top {
  color: var(--ink);
  border-bottom-color: var(--line);
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 26px rgba(52,70,58,.055);
}
.hero {
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 80% 15%, rgba(120,146,123,.16), transparent 25rem),
    linear-gradient(125deg, #ffffff 0%, #f7faf7 58%, #edf3ed 100%);
}
.hero::before {
  opacity: .18;
  background-image: linear-gradient(rgba(120,146,123,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(120,146,123,.2) 1px, transparent 1px);
}
.hero::after { background: rgba(120,146,123,.13); }
.hero .eyebrow { color: var(--teal) !important; }
.hero h1, .hero h1 span, .hero h2 { color: var(--deep); }
.hero-copy, .hero p { color: var(--muted); }
.button-primary, .primary {
  color: #fff;
  background: linear-gradient(135deg, #879f8a, #657d69);
  box-shadow: 0 11px 24px rgba(80,105,84,.2);
}
.button-primary:hover, .primary:hover { box-shadow: 0 15px 30px rgba(80,105,84,.26); }
.button-secondary, .secondary {
  color: var(--deep);
  border-color: #cbd9cc;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 18px rgba(52,70,58,.07);
}
.identity-card {
  color: var(--ink);
  border-color: #d4e0d5;
  background: rgba(255,255,255,.94);
  box-shadow: 0 25px 60px rgba(52,70,58,.15);
}
.identity-card::before { border-color: rgba(120,146,123,.18); }
.identity-card p { color: var(--muted); }
.profile-icon { color: var(--deep); background: var(--mist); }
.identity-list li::before { color: var(--teal); }
.identity-visual { border-color: #d7e2d8; box-shadow: 0 16px 34px rgba(52,70,58,.14); }
.identity-visual::after { background: linear-gradient(180deg, transparent 70%, rgba(52,70,58,.17)); }
.stat:nth-child(1), .summary-item:nth-child(1) { border-top-color: #78927b; }
.stat:nth-child(2), .summary-item:nth-child(2) { border-top-color: #91a593; }
.stat:nth-child(3), .summary-item:nth-child(3) { border-top-color: #657d69; }
.stat:nth-child(4), .summary-item:nth-child(4) { border-top-color: #a9b6a6; }
.achievement-wrap, .performance, .criteria-area { background: linear-gradient(180deg, #f0f5f0, #fbfdfb); }
.number, .timeline-card time { color: #5c735f; }
.section-title, .section-heading, .section-head { border-inline-start-color: var(--teal); }
.note, .tip, .notice { border-inline-start-color: var(--teal); background: #f4f8f3; box-shadow: inset 0 0 0 1px #dce6dd; }
.evidence-feature, .policy-card, .contact-box, .action {
  background: linear-gradient(135deg, #34463a, #667e69);
  box-shadow: 0 18px 42px rgba(52,70,58,.17);
}
.contact-details { color: #edf5ed; }
.contents-visual { border-color: #d3dfd4; background: rgba(255,255,255,.86); box-shadow: 0 22px 55px rgba(52,70,58,.14); }
.contents-visual { width:min(100%, 360px); justify-self:end; padding:6px; }
.contents-visual img { aspect-ratio:2 / 1; object-position:center; }
.chapter-count, .weight { color: #465d49; background: #edf4ec; border-color: #cedbce; }
.pdf-mark { color: #465d49; background: #e7efe6; }
.privacy { border-color: #cedbce; background: #f4f8f3; }
.field input, .field select, .field textarea { border-color: #cbd8cc; background: #fcfefc; }
.field input:focus, .field select:focus, .field textarea:focus { outline-color: rgba(120,146,123,.18); border-color: var(--teal); }

footer { padding-block: 30px 38px; color: var(--muted); border-top: 1px solid color-mix(in srgb, var(--line), transparent 20%); }

@media (max-width: 820px) {
  .container, .wrap { width: min(100% - 30px, 1160px); }
  .nav { min-height: 70px; }
  .brand-mark { width: 38px; height: 38px; }
  .hero { padding-top: 68px; }
  .hero h1 { font-size: clamp(2.45rem, 12vw, 4rem); }
  .section { padding: 72px 0; }
  .stats { margin-top: -28px; }
  .stat, .summary-item { min-height: 100px; }
  .contact-box, .action { padding: 30px; }
  .chapter, .card { padding: 24px; }
  .contents-hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .contents-visual { width: min(100%, 360px); justify-self:center; transform: none; }
  body:has(.top + main) .hero { padding: 28px 0 46px; }
  .profile-card, .auth { margin-top: -38px; }
  .topbar + main > .hero { padding: 48px 0 70px; }
  .topbar + main > .hero h1 { font-size: clamp(2.25rem, 9vw, 3.5rem); }
}

@media (max-width: 560px) {
  body { line-height: 1.78; }
  .container, .wrap { width: min(100% - 24px, 1160px); }
  .topbar .nav { flex-wrap: wrap; gap: 8px 12px; padding-block: 9px; }
  .topbar .nav-links { order: 3; width: 100%; gap: 5px; padding: 5px; overflow: visible; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
  .topbar .nav-links a { flex: 1; padding: 8px 7px; text-align: center; }
  .topbar .nav-links .ui-icon { display: none; }
  .print-btn { padding-inline: 10px; font-size: .8rem; }
  .hero { padding-top: 54px; }
  .topbar + main > .hero { padding: 40px 0 62px; }
  .topbar + main > .hero h1 { font-size: clamp(2.1rem, 11vw, 3rem); }
  .hero-copy, .hero p { font-size: 1rem; }
  .hero-actions { display: grid; }
  .button { width: 100%; }
  .identity-card { padding: 26px; }
  .identity-visual { margin: -14px -14px 24px; }
  .stats-grid, .summary-grid { grid-template-columns: 1fr 1fr; }
  .stat, .summary-item { min-height: 94px; padding: 17px 13px; }
  .stat, .summary-item { padding-inline-end: 52px; }
  .stat > .ui-icon, .summary-item > .ui-icon { inset-inline-end: 12px; inset-block-start: 16px; width: 32px; height: 32px; padding: 7px; }
  .summary-grid .summary-item:last-child:nth-child(3) { grid-column: 1 / -1; }
  .section-title, .section-heading, .section-head { padding-inline-start: 14px; }
  .section { padding: 58px 0; }
  .chapter, .card { padding: 20px; border-radius: 20px 20px 7px 20px; }
  summary { min-height: 72px; padding: 15px; }
  .detail-content, .uploaded-evidence { margin-inline: 15px; }
  .contact-box, .action { padding: 25px; border-radius: 22px 22px 7px 22px; }
  .evidence-viewer { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .viewer-header, .viewer-footer { align-items: flex-start; padding: 14px; }
  .viewer-footer { flex-direction: column; gap: 8px; }
  .viewer-stage { padding: 10px; }
  .viewer-stage iframe { min-height: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  body { color: #111; background: #fff !important; font-size: 11pt; }
  .hero { color: #fff; background: var(--deep) !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .section { padding: 32px 0; }
  .stat, .summary-item, .value, .achievement, .evidence-item, .timeline-card, .chapter, .profile-detail, details { box-shadow: none; break-inside: avoid; }
}

/* إطار موحّد للصفحات العامة: شريط هادئ، مقياس واحد، وتنقل واضح. */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
.container, .wrap { margin-inline: auto; }

.topbar .nav,
.top .nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}
.topbar .brand,
.top .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  white-space: nowrap;
  text-decoration: none;
}
.topbar .nav-links {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}
.topbar .nav-links a {
  color: var(--muted);
  gap: 6px;
  padding: 8px 9px;
  font-size: .84rem;
  white-space: nowrap;
  text-decoration: none;
}
.topbar .print-btn { flex: 0 0 auto; white-space: nowrap; }
.topbar .nav-links .admin-nav-link { color: var(--teal); background: var(--mist); }
.topbar .nav-links a[aria-current="page"] {
  color: #fff;
  background: var(--teal);
  box-shadow: 0 7px 16px rgba(82, 111, 87, .18);
}
.topbar .nav-links a[aria-current="page"] .ui-icon { color: #fff; }
.mobile-nav { display: none; overflow: visible; }

/* يظل الشريط مكتملًا في الشاشات المتوسطة بدل أن تتراكب الروابط مع زر الطباعة. */
@media (min-width: 1081px) and (max-width: 1260px) {
  .topbar .nav { gap: 9px; }
  .topbar .nav-links { gap: 2px; }
  .topbar .nav-links .ui-icon { display: none; }
  .topbar .nav-links a { padding: 8px 7px; font-size: .8rem; }
  .topbar .print-btn { min-height: 38px; padding-inline: 10px; font-size: .8rem; }
}

/* عند هذه النقطة لا تتسع روابط الموقع مع اسم الملف وزر الطباعة؛ ننتقل إلى القائمة المنسدلة قبل أي تداخل. */
@media (max-width: 1440px) {
  .topbar .nav { min-height: 70px; }
  .topbar .nav-links { display: none; }
  .mobile-nav {
    position: relative;
    z-index: 80;
    display: block;
    overflow: visible;
  }
  .mobile-nav summary {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 12px;
    list-style: none;
    color: var(--teal);
    border: 1px solid #cedbce;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(52,70,58,.06);
    cursor: pointer;
    font-size: .88rem;
    font-weight: 900;
  }
  .mobile-nav summary::-webkit-details-marker { display: none; }
  .mobile-nav[open] summary { color: #fff; border-color: var(--teal); background: var(--teal); }
  .mobile-nav[open] summary .ui-icon { color: #fff; }
  .mobile-nav-links {
    position: absolute;
    /* زر القائمة يقع يسار الشريط في العربية؛ افتح اللوحة إلى داخل الشاشة. */
    inset-inline-end: 0;
    inset-block-start: calc(100% + 8px);
    display: grid;
    min-width: 225px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(52,70,58,.16);
    z-index: 81;
  }
  .mobile-nav-links a,
  .mobile-nav-links button {
    min-height: 45px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 13px;
    color: var(--ink);
    border-bottom: 1px solid #edf2ed;
    border-inline: 0;
    border-top: 0;
    text-decoration: none;
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-size: .9rem;
    font-weight: 800;
  }
  .mobile-nav-links a:last-child,
  .mobile-nav-links button:last-child { border-bottom: 0; }
  .mobile-nav-links a .ui-icon { color: var(--teal); }
  .mobile-nav-links button .ui-icon { color: var(--teal); }
  .mobile-nav-links a[aria-current="page"] { color: #fff; background: var(--teal); }
  .mobile-nav-links a[aria-current="page"] .ui-icon { color: #fff; }
  .mobile-nav-links .admin-nav-link { color: var(--teal); background: var(--mist); }
  .mobile-nav-links .admin-nav-link .ui-icon { color: var(--teal); }
}

/* في عرض الجوال لا تتسع القائمة كلها عموديًا؛ اجعلها قابلة للتمرير من داخلها. */
@media (orientation: landscape) and (max-height: 620px) and (max-width: 1440px) {
  .mobile-nav-links {
    max-block-size: calc(100vh - 88px);
    max-block-size: calc(100dvh - 88px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: thin;
  }
}

@media (max-width: 720px) {
  .topbar .print-btn { display: none; }
}

/* عدادات دليل الطلاب تبقى عالية التباين مهما تغير تصميم الألوان من لوحة التحكم. */
.roster-stat strong {
  color: #203a29 !important;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  opacity: 1 !important;
  visibility: visible !important;
}
.roster-stat span:last-child,
.folder-meta span:last-child,
.table-head span,
.summary-note {
  color: #4b6251 !important;
  opacity: 1 !important;
}

@media (max-width: 560px) {
  .topbar .nav { gap: 8px; }
  .topbar .brand { font-size: .92rem; }
  .topbar .brand-mark { width: 36px; height: 36px; }
  .mobile-nav-links { min-width: min(250px, calc(100vw - 28px)); }
}

/* تثبيت التطبيق والتنبيهات الخاصة بالعمل دون إنترنت. */
#install-offline-app {
  min-height: 32px;
  padding: 5px 8px;
  color: inherit;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: .73rem;
  font-weight: 700;
  opacity: .52;
  cursor: pointer;
  transition: opacity .18s ease, color .18s ease, background .18s ease;
}
#install-offline-app:hover, #install-offline-app:focus-visible { color: #fff; background: rgba(255,255,255,.15); opacity: 1; outline: none; }
.offline-install-footer { display:flex; justify-content:center; width:100%; margin-top:10px; }
#offline-app-status {
  position: fixed;
  inset-inline: 16px;
  inset-block-end: 16px;
  z-index: 260;
  max-width: min(400px, calc(100% - 32px));
  padding: 12px 15px;
  color: #fff;
  border-radius: 13px;
  background: #334d39;
  box-shadow: 0 14px 34px rgba(31, 61, 38, .25);
  font-size: .83rem;
  font-weight: 750;
  line-height: 1.65;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}
#offline-app-status.is-visible { opacity: 1; transform: none; }
#offline-install-guide {
  width: min(430px, calc(100% - 32px));
  padding: 24px;
  color: #294034;
  border: 1px solid #cfddcf;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 65px rgba(29, 53, 36, .3);
  font: inherit;
  text-align: right;
}
#offline-install-guide::backdrop { background: rgba(25, 43, 31, .46); backdrop-filter: blur(3px); }
#offline-install-guide h2 { margin: 0 0 10px; font-size: 1.18rem; }
#offline-install-guide p { margin: 0; color: #5e7162; font-size: .94rem; font-weight: 650; line-height: 1.85; }
#offline-install-guide button {
  min-height: 42px;
  margin-top: 18px;
  padding: 8px 19px;
  color: #fff;
  border: 0;
  border-radius: 11px;
  background: #45684c;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
@media (max-width: 560px) {
  #offline-app-status { inset-inline: 12px; inset-block-end: 12px; max-width: none; }
}
