@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --navy: #171844;
  --navy-2: #252b67;
  --blue: #245ca7;
  --blue-2: #3475bf;
  --blue-soft: #eaf0f9;
  --ink: #1c2040;
  --muted: #747b91;
  --line: #e4e8f0;
  --surface: #fff;
  --canvas: #f5f6fa;
  --amber: #b88537;
  --amber-soft: #fbf3e6;
  --green: #287963;
  --green-soft: #e8f3ef;
  --red: #b84d58;
  --red-soft: #f9ecee;
  --shadow: 0 20px 55px rgba(27, 34, 77, .08);
  font-family: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(52, 117, 191, .45); outline-offset: 3px; }

/* Login */
.auth-screen { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; padding: 24px clamp(18px, 5vw, 72px) 20px; background: radial-gradient(circle at 82% 14%, rgba(36, 92, 167, .13), transparent 27%), radial-gradient(circle at 9% 87%, rgba(19, 127, 121, .08), transparent 24%), linear-gradient(140deg, #f7f8fb 0%, #f2f4f9 56%, #eaf0f8 100%); }
.auth-screen::before { content: ""; position: absolute; width: 420px; height: 420px; inset-inline-start: -230px; top: 23%; border: 1px solid rgba(36,92,167,.08); border-radius: 45% 55% 61% 39%; transform: rotate(28deg); pointer-events: none; }
.auth-screen::after { content: ""; position: absolute; width: 270px; height: 270px; inset-inline-end: -165px; bottom: 4%; border: 1px solid rgba(19,127,121,.1); border-radius: 50%; box-shadow: 0 0 0 24px rgba(19,127,121,.025), 0 0 0 48px rgba(19,127,121,.02); pointer-events: none; }
.auth-brand, .survey-header { display: flex; align-items: center; gap: 13px; width: min(1100px, 100%); margin: 0 auto; }
.auth-brand, .auth-main, .auth-footer { position: relative; z-index: 1; }
.auth-brand img, .survey-header img { width: 70px; height: 70px; object-fit: contain; border-radius: 16px; background: #fff; }
.auth-brand div, .survey-header div { display: grid; gap: 3px; }
.auth-brand strong, .survey-header strong { color: var(--navy); font-size: 16px; }
.auth-brand span, .survey-header span { color: var(--muted); font-size: 12px; }
.auth-main { width: min(1020px, 100%); margin: auto; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, .7fr); align-items: stretch; gap: clamp(28px, 7vw, 94px); padding: 55px 0; }
.auth-card { align-self: center; padding: clamp(30px, 5vw, 56px); border: 1px solid rgba(255,255,255,.85); border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: 0 24px 70px rgba(28,37,82,.12), 0 2px 8px rgba(28,37,82,.04); backdrop-filter: blur(14px); animation: authCardIn .55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes authCardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px 15px 15px 4px; color: #fff; background: var(--blue); font-size: 21px; font-weight: 700; box-shadow: 0 9px 18px rgba(36,92,167,.22); }
.eyebrow { margin: 19px 0 9px; color: var(--blue); font-size: 12px; font-weight: 700; }
.auth-card h1 { margin: 0; color: var(--navy); font-size: clamp(31px, 4.3vw, 47px); line-height: 1.4; }
.auth-card h1 span { color: var(--blue); }
.auth-description { max-width: 450px; margin: 14px 0 24px; color: var(--muted); font-size: 14px; line-height: 2; }
.button { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; gap: 11px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; font-size: 13px; font-weight: 600; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--blue); box-shadow: 0 8px 19px rgba(36,92,167,.17); }
.button-primary:hover { background: #1e4f91; }
.button-secondary { color: var(--navy); border-color: var(--line); background: #fff; }
.button-secondary:hover { border-color: #bbcbe2; background: #f9fbfe; }
.button-quiet { color: var(--blue); background: var(--blue-soft); }
.button-danger { color: var(--red); border-color: #f2d5d9; background: var(--red-soft); }
.button-small { min-height: 34px; padding: 0 12px; border-radius: 9px; font-size: 11px; }
.button-wide { width: 100%; min-height: 50px; }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.auth-footnote { margin: 13px 0 0; color: #8b90a1; font-size: 11px; text-align: center; }
.auth-form { display: grid; gap: 15px; margin-top: 23px; }
.auth-form .field { gap: 8px; }
.auth-form .field label { color: #454d68; font-size: 12px; }
.auth-form .field input { min-height: 49px; padding: 11px 13px; border-color: #d9dfeb; border-radius: 11px; font-size: 13px; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.auth-form .field input:focus { border-color: #668dbd; background: #fff; box-shadow: 0 0 0 4px rgba(36,92,167,.1); }
.auth-form .button { margin-top: 3px; }
.bootstrap-button { margin-top: 10px; }
.cancel-password-change { margin-top: 10px; }
.temporary-password-name { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.temporary-password-name b { color: var(--navy); }
.auth-side-note { align-self: center; padding: 18px 0; color: var(--navy); }
.side-kicker { color: var(--blue); font-size: 12px; font-weight: 700; }
.auth-side-note h2 { max-width: 290px; margin: 19px 0 9px; font-size: 27px; line-height: 1.55; }
.auth-side-note p { max-width: 310px; margin: 0; color: var(--muted); font-size: 13px; line-height: 2; }
.side-stat { display: flex; align-items: center; gap: 15px; margin-top: 36px; padding-top: 17px; border-top: 1px solid #dce2ed; color: var(--muted); font-size: 12px; line-height: 1.8; }
.side-stat > span:first-child { color: var(--blue); font: 700 28px/1 Arial, sans-serif; }
.side-stat b { color: var(--navy); }
.notice { margin: 0 0 18px; padding: 12px 14px; border-radius: 10px; color: var(--navy); background: var(--blue-soft); font-size: 12px; line-height: 1.8; }
.notice.warning { color: #815a20; background: var(--amber-soft); }
.notice.error { color: #993744; background: var(--red-soft); }
.auth-footer { width: min(1100px,100%); margin: 0 auto; display: flex; justify-content: space-between; gap: 12px; color: #8a90a2; font-size: 10px; }

/* Dashboard */
.dashboard { min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0,1fr); direction: rtl; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding: 20px 13px 12px; color: #f7f8ff; background: radial-gradient(ellipse at 100% 0%,#293c72 0%,transparent 52%),linear-gradient(170deg,#1d234e,#101633); border-inline-end: 1px solid rgba(174,198,239,.13); z-index: 20; }
.sidebar-brand { display: flex; align-items: center; flex-shrink: 0; gap: 12px; min-height: 68px; padding: 0 7px 15px; }
.sidebar-brand img { width: 50px; height: 50px; object-fit: contain; border-radius: 14px; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.sidebar-brand span { display: grid; gap: 4px; }
.sidebar-brand b { font-size: 14px; font-weight: 600; }
.sidebar-brand small { color: #c0cde7; font-size: 10px; }
.sidebar-nav-toolbar { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; min-height: 42px; padding: 0 7px 7px; border-top: 1px solid rgba(176,201,244,.15); color: #b4c4df; font-size: 10px; }
.sidebar-scroll-actions { display: flex; gap: 5px; }
.sidebar-scroll-actions button { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #56668c; border-radius: 9px; color: #dce8ff; background: rgba(94,123,177,.18); transition: background .18s, border-color .18s; }
.sidebar-scroll-actions button:not(:disabled):hover { color: #fff; border-color: #9abaea; background: #3b5381; }
.sidebar-scroll-actions button:disabled { opacity: .3; cursor: default; }
.sidebar svg { fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-scroll-actions svg { width: 18px; height: 18px; }
.sidebar-scroll { flex: 1 1 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 0 3px 6px; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #7696c6 #202e50; overscroll-behavior-y: contain; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.sidebar-scroll::-webkit-scrollbar { width: 8px; }
.sidebar-scroll::-webkit-scrollbar-track { background: #202e50; border-radius: 8px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: #7696c6; border: 2px solid #202e50; border-radius: 8px; }
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background: #aac6ee; }
.main-nav { display: grid; gap: 16px; padding-block: 4px 8px; }
.nav-group { --nav-accent: #93bdf5; display: grid; gap: 5px; }
.nav-group-assessment { --nav-accent: #99d6c5; }
.nav-group-reports { --nav-accent: #d1c3ff; }
.nav-group-title { display: flex; align-items: center; gap: 8px; margin: 0 8px 4px; color: #b3c0da; font-size: 10px; font-weight: 500; }
.nav-group-title::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--nav-accent); }
.nav-item { position: relative; width: 100%; min-height: 46px; display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid transparent; border-radius: 12px; color: #d3def0; background: transparent; text-align: right; font-size: 12px; transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; }
.nav-item:hover { color: #fff; border-color: rgba(159,189,230,.2); background: rgba(127,162,218,.12); transform: translateX(-2px); }
.nav-item.active { color: #fff; border-color: rgba(156,193,249,.32); background: linear-gradient(100deg,#294a7f,#335284); box-shadow: inset -3px 0 var(--nav-accent),0 5px 16px rgba(0,0,0,.12); font-weight: 600; }
.nav-item:focus-visible,.sidebar button:focus-visible,.sidebar a:focus-visible,.sidebar-scroll:focus-visible { outline: 2px solid #b6d6ff; outline-offset: 2px; }
.nav-icon { width: 30px; height: 30px; display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 9px; color: var(--nav-accent); background: rgba(157,188,233,.08); }
.nav-icon svg { width: 18px; height: 18px; }
.nav-item.active .nav-icon { background: rgba(201,223,255,.15); }
.nav-label { flex: 1; min-width: 0; }
.nav-chevron { width: 14px; height: 14px; flex-shrink: 0; color: #aec9ef; opacity: 0; transition: opacity .18s; }
.nav-item.active .nav-chevron,.nav-item:hover .nav-chevron,.nav-item:focus-visible .nav-chevron { opacity: 1; }
.sidebar-bottom { flex-shrink: 0; margin-top: 10px; padding: 10px 6px 0; border-top: 1px solid rgba(176,201,244,.16); }
.user-card { min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 3px 5px 11px; }
.user-avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #8caad6; border-radius: 12px; color: #eef6ff; background: linear-gradient(135deg,#436a9e,#2a416c); font-size: 15px; font-weight: 700; }
.user-meta { min-width: 0; display: grid; gap: 3px; }
.user-meta b { max-width: 155px; overflow: hidden; color: #fff; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.user-meta small { color: #b6c7e1; font-size: 10px; }
.logout-button { width: 100%; min-height: 37px; display: flex; align-items: center; gap: 10px; padding: 0 8px; border: 0; border-radius: 8px; color: #bbc0d8; background: transparent; text-align: right; font-size: 11px; }
.logout-button:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-close,.sidebar-backdrop { display: none; }
.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; min-height: 67px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 clamp(18px, 4vw, 50px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); z-index: 10; }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: #989daf; font-size: 11px; }
.breadcrumbs i { color: #c5cad5; font-style: normal; }
.breadcrumbs b { color: var(--navy); font-size: 12px; font-weight: 600; }
.topbar-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #5c9d7e; box-shadow: 0 0 0 3px #e7f2ec; }
.menu-button { display: none; width: 38px; height: 38px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.menu-button span { width: 16px; height: 2px; border-radius: 2px; background: var(--navy); }
.page-container { width: min(1400px, 100%); margin: 0 auto; padding: 31px clamp(18px, 4vw, 50px) 60px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 25px; }
.page-heading h1 { margin: 0 0 5px; color: var(--navy); font-size: clamp(23px, 2.6vw, 31px); line-height: 1.55; }
.page-heading p { max-width: 650px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.9; }
.page-heading-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kpi-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.kpi-card { min-height: 128px; padding: 18px 19px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.kpi-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.kpi-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 14px; }
.kpi-value { margin-top: 17px; color: var(--navy); font-size: 29px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-caption { margin-top: 7px; color: #969bad; font-size: 10px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.panel + .panel { margin-top: 14px; }
.panel-head { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; color: var(--navy); font-size: 14px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.panel-body { padding: 18px; }
.panel-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(260px,.8fr); gap: 14px; }
.quick-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.quick-action { min-height: 95px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: right; }
.quick-action:hover { border-color: #bdcce1; background: #fbfcff; }
.quick-action b { display: block; margin-bottom: 6px; color: var(--navy); font-size: 12px; }
.quick-action span { color: var(--muted); font-size: 10px; line-height: 1.8; }

/* Forms and reports */
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.field { min-width: 0; display: grid; gap: 6px; }
.field label, .field-label { color: #5d647a; font-size: 11px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #dfe4ed; border-radius: 9px; color: var(--ink); background: #fff; font-size: 12px; outline: none; }
.field textarea { min-height: 88px; resize: vertical; line-height: 1.8; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #7fa2d0; box-shadow: 0 0 0 3px rgba(36,92,167,.1); }
.field input::placeholder, .field textarea::placeholder { color: #b0b5c3; }
.field-hint { color: #9096a8; font-size: 10px; line-height: 1.7; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 12px 13px; border-bottom: 1px solid #edf0f5; text-align: right; font-size: 11px; }
th { color: #858ba0; background: #fafbfc; font-weight: 600; }
td { color: #434963; }
tr:last-child td { border-bottom: 0; }
.table-primary { color: var(--navy); font-weight: 600; }
.table-secondary { display: block; margin-top: 3px; color: #969bad; font-size: 10px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.member-template-list { gap: 8px; }
.member-template-option { width: 100%; justify-content: flex-start; text-align: right; }
.member-template-option > span { min-width: 0; display: grid; gap: 3px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 99px; color: #59617c; background: #f0f2f6; font-size: 9px; }
.pill.blue { color: #245ca7; background: #eaf0f9; }
.pill.green { color: #246c56; background: #e8f3ef; }
.pill.amber { color: #8b642b; background: #fbf3e6; }
.pill.red { color: #a54450; background: #f9ecee; }
.empty-state { padding: 33px 16px; color: #8a90a1; text-align: center; font-size: 12px; line-height: 1.9; }
.empty-state b { display: block; margin-bottom: 5px; color: var(--navy); font-size: 13px; }
.divider { height: 1px; margin: 16px 0; background: var(--line); }
.question-stack { display: grid; gap: 10px; }
.question-card { display: grid; grid-template-columns: minmax(0,1fr) 165px 42px; gap: 8px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fcfdff; }
.question-card .field:first-child { grid-column: auto; }
.question-indicator-field { grid-column: 1 / -1; }
.icon-button { width: 38px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: #8d93a6; background: #fff; }
.icon-button:hover { color: var(--red); border-color: #e9c5cb; }
.answer-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.answer-option { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: #555d75; background: #fff; font-size: 11px; cursor: pointer; }
.answer-option input { accent-color: var(--blue); }
.chart-panel { min-height: 220px; overflow: hidden; }
.chart-scroll { overflow-x: auto; padding: 12px 15px 18px; }
.chart-svg { display: block; width: 100%; min-width: 430px; height: 220px; overflow: visible; }
.chart-label { fill: #777e93; font: 11px 'IBM Plex Sans Arabic', Tahoma, sans-serif; }
.chart-value { fill: #343954; font: 600 11px 'IBM Plex Sans Arabic', Tahoma, sans-serif; }
.chart-axis { stroke: #e8ebf2; stroke-width: 1; }
.chart-bar { fill: #5d84bd; rx: 6; }
.chart-bar.secondary { fill: #a5b9d6; }
.chart-dot { fill: #245ca7; stroke: #fff; stroke-width: 3; }
.chart-line { fill: none; stroke: #245ca7; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.assessment-hierarchy { width:min(100%,1120px); display:grid; grid-template-columns:repeat(auto-fit,minmax(430px,1fr)); align-items:start; gap:13px; margin-inline:auto; }
.hierarchy-domain { --hierarchy-accent:#1761b5; --hierarchy-soft:#e8f2ff; --hierarchy-line:#b8d4f6; position:relative; overflow:hidden; border:1px solid var(--hierarchy-line); border-radius:16px; background:#fff; box-shadow:0 9px 22px rgba(27,34,77,.055); }
.hierarchy-domain::before { position:absolute; inset:0 auto 0 0; width:6px; background:linear-gradient(180deg,var(--hierarchy-accent),var(--hierarchy-soft)); content:""; }
.hierarchy-domain[data-tone="1"] { --hierarchy-accent:#008b7d; --hierarchy-soft:#e2f8f3; --hierarchy-line:#aee7dc; }
.hierarchy-domain[data-tone="2"] { --hierarchy-accent:#7650b8; --hierarchy-soft:#f0eaff; --hierarchy-line:#d4c3f4; }
.hierarchy-domain[data-tone="3"] { --hierarchy-accent:#bc671d; --hierarchy-soft:#fff1df; --hierarchy-line:#f2d0a7; }
.hierarchy-domain-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:14px 16px 12px 21px; background:linear-gradient(128deg,var(--hierarchy-soft),#fff 74%); }
.hierarchy-domain-head h2, .hierarchy-heading h3, .hierarchy-heading h4, .hierarchy-standard-summary h3 { margin:2px 0 4px; color:var(--navy); line-height:1.65; }
.hierarchy-domain-head h2 { color:var(--hierarchy-accent); font-size:16px; }
.hierarchy-heading h3, .hierarchy-standard-summary h3 { font-size:14px; }
.hierarchy-heading h4 { font-size:12px; }
.hierarchy-domain-head p, .hierarchy-heading p { max-width:700px; margin:0; color:var(--muted); font-size:10px; line-height:1.8; }
.hierarchy-domain-head .eyebrow, .hierarchy-heading .eyebrow, .hierarchy-standard-summary .eyebrow { margin:0; font-size:9px; }
.hierarchy-domain-head .row-actions, .hierarchy-heading .row-actions { flex-wrap:wrap; justify-content:flex-start; }
.hierarchy-counts { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.hierarchy-count { display:inline-flex; align-items:baseline; gap:4px; padding:5px 8px; border:1px solid var(--hierarchy-line); border-radius:999px; color:var(--hierarchy-accent); background:rgba(255,255,255,.78); font-size:10px; line-height:1.2; }
.hierarchy-count b { font-size:13px; font-variant-numeric:tabular-nums; }
.hierarchy-domain-details { margin:0 11px 11px; border:1px solid var(--hierarchy-line); border-radius:12px; background:#fff; }
.hierarchy-domain-details > summary, .hierarchy-standard > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; list-style:none; cursor:pointer; }
.hierarchy-domain-details > summary::-webkit-details-marker, .hierarchy-standard > summary::-webkit-details-marker { display:none; }
.hierarchy-domain-details > summary { min-height:49px; padding:10px 12px; color:var(--hierarchy-accent); background:var(--hierarchy-soft); }
.hierarchy-domain-details > summary b { display:block; color:var(--navy); font-size:12px; }
.hierarchy-domain-details > summary small { display:block; margin-top:3px; color:#687089; font-size:10px; line-height:1.6; }
.hierarchy-toggle-label { display:inline-flex; align-items:center; gap:6px; flex:none; color:var(--hierarchy-accent); font-size:10px; font-weight:700; white-space:nowrap; }
.hierarchy-toggle-label::before { display:inline-grid; width:18px; height:18px; place-items:center; border:1px solid currentColor; border-radius:50%; content:"+"; }
.hierarchy-domain-details[open] > summary .hierarchy-toggle-label::before, .hierarchy-standard[open] > summary .hierarchy-toggle-label::before { content:"−"; }
.hierarchy-domain-content { padding:0 12px 12px; }
.hierarchy-standard { margin-top:10px; overflow:hidden; border:1px solid #e1e7f1; border-radius:12px; background:#fbfcff; }
.hierarchy-standard-summary { min-height:59px; padding:10px 11px; }
.hierarchy-standard-summary:hover { background:#f4f7fc; }
.hierarchy-summary-copy { min-width:0; }
.hierarchy-summary-copy h3 { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hierarchy-summary-description { display:block; overflow:hidden; max-width:680px; color:#697189; font-size:10px; line-height:1.65; text-overflow:ellipsis; white-space:nowrap; }
.hierarchy-summary-meta { display:flex; align-items:center; gap:8px; }
.hierarchy-standard-content { padding:13px; border-top:1px solid #e5eaf2; }
.hierarchy-node-actions { padding-bottom:11px; border-bottom:1px dashed #dce4ee; }
.hierarchy-indicators { display:grid; gap:9px; margin-top:11px; }
.hierarchy-indicator { padding:13px; border:1px solid #e5e9f0; border-radius:11px; background:#fff; }
.hierarchy-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.hierarchy-domain-details > summary:focus-visible, .hierarchy-standard > summary:focus-visible { outline:3px solid rgba(36,92,167,.38); outline-offset:-3px; }
.indicator-levels { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; margin-top: 12px; }
.indicator-level { min-width: 0; padding: 10px; border: 1px solid #e7ebf2; border-radius: 9px; background: #fbfcfe; }
.indicator-level b { display: block; margin-bottom: 5px; color: var(--blue); font-size: 10px; }
.indicator-level span { display: block; color: #626980; font-size: 10px; line-height: 1.75; white-space: normal; }
.question-indicator-field .field-hint { margin-top: 4px; }
.indicator-preview-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; margin-top: 7px; }
.indicator-preview-grid > div { padding: 7px; border-radius: 8px; background: #f5f7fb; }
.indicator-preview-grid b, .indicator-preview-grid span { display: block; font-size: 9px; line-height: 1.7; }
.indicator-preview-grid b { color: var(--blue); }
.indicator-preview-grid span { color: #70768a; white-space: normal; }
.indicator-path { margin: 5px 0 10px; color: var(--blue); font-size: 10px; line-height: 1.8; }
.scale-answer-list { display: grid; gap: 7px; }
.scale-answer-option { display: grid; grid-template-columns: 20px 44px minmax(0,1fr); align-items: start; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.scale-answer-option:has(input:checked) { border-color: #8ca9d1; background: #f7f9fd; box-shadow: inset -3px 0 var(--blue); }
.scale-answer-option input { margin-top: 4px; accent-color: var(--blue); }
.scale-score { color: var(--navy); font-size: 13px; font-weight: 700; }
.scale-interpretation { color: #5e657a; font-size: 11px; line-height: 1.8; }
.report-interpretations { min-width: 250px; white-space: normal; }
.report-interpretations summary { color: var(--blue); cursor: pointer; font-size: 10px; font-weight: 600; }
.report-interpretations ul { display: grid; gap: 8px; margin: 9px 0 0; padding: 0 18px 0 0; }
.report-interpretations li { color: #50566d; font-size: 10px; line-height: 1.8; }
.report-interpretations li b { color: var(--navy); }
.interpretation-track { height: 5px; margin: 4px 0; overflow: hidden; border-radius: 9px; background: #edf0f5; }
.interpretation-track span { display: block; height: 100%; border-radius: inherit; background: #668bbd; }

/* Modal and feedback */
.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(18,20,57,.48); z-index: 60; }
.modal { width: min(720px,100%); max-height: min(90vh,880px); overflow: auto; border-radius: 18px; background: #fff; box-shadow: 0 28px 80px rgba(12,15,48,.26); }
.modal-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); z-index: 1; }
.modal-head h2 { margin: 0; color: var(--navy); font-size: 15px; }
.modal-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: #767d92; background: #fff; font-size: 18px; }
.modal-body { padding: 18px 20px 21px; }
.toast-region { position: fixed; left: 20px; bottom: 18px; display: grid; gap: 8px; z-index: 90; }
.toast { max-width: min(400px,calc(100vw - 40px)); padding: 12px 16px; border: 1px solid #dce3ef; border-radius: 11px; color: var(--navy); background: #fff; box-shadow: var(--shadow); font-size: 12px; line-height: 1.7; animation: toast-in .22s ease-out; }
.toast.error { color: #963d49; border-color: #efd3d7; background: #fffafa; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Public survey */
.survey-screen { min-height: 100vh; padding: 20px; background: linear-gradient(145deg,#f7f8fb,#eef2f8); }
.survey-header { width: min(800px,100%); padding-bottom: 15px; border-bottom: 1px solid #e1e6ef; }
.survey-header img { width: 54px; height: 54px; }
.survey-content { width: min(760px,100%); margin: 30px auto 20px; padding: clamp(20px,4vw,36px); border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.survey-footer { width: min(760px,100%); margin: 0 auto; color: #8d93a5; text-align: center; font-size: 10px; }
.survey-intro h1 { margin: 0 0 7px; color: var(--navy); font-size: 24px; }
.survey-intro p { color: var(--muted); font-size: 12px; line-height: 1.9; }
.anonymous-note { margin: 16px 0 22px; padding: 12px 14px; border-radius: 10px; color: #73521e; background: var(--amber-soft); font-size: 11px; line-height: 1.9; }
.public-question { padding: 16px 0; border-top: 1px solid var(--line); }
.public-question h3 { margin: 0 0 8px; color: var(--navy); font-size: 13px; line-height: 1.8; }

@media (max-width: 1040px) {
  .dashboard { grid-template-columns: 225px minmax(0,1fr); }
  .sidebar { padding-inline: 11px; }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .dashboard { display: block; }
  .sidebar { position: fixed; top: 0; right: 0; width: min(300px,88vw); transform: translateX(105%); visibility: hidden; transition: transform .22s ease,visibility .22s; box-shadow: -18px 0 45px rgba(12,15,48,.18); }
  .sidebar.is-open { transform: translateX(0); visibility: visible; }
  .sidebar-brand { padding-inline-end: 26px; }
  .sidebar-close { position: absolute; top: 13px; left: 9px; width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(181,202,238,.3); border-radius: 9px; color: #dbe9ff; background: rgba(147,177,225,.13); }
  .sidebar-close svg { width: 16px; height: 16px; }
  .sidebar-backdrop { position: fixed; inset: 0; display: block; z-index: 19; border: 0; background: rgba(13,20,45,.48); backdrop-filter: blur(3px); }
  .workspace { min-height: 100vh; }
  .menu-button { display: flex; }
  .topbar { justify-content: flex-start; }
  .topbar-note { margin-inline-start: auto; }
  .auth-main { grid-template-columns: 1fr; gap: 14px; width: min(610px,100%); }
  .auth-side-note { display: none; }
}
@media (max-width: 620px) {
  .auth-screen { padding: 17px 15px; }
  .auth-brand img { width: 58px; height: 58px; }
  .auth-main { padding: 28px 0; }
  .auth-card { padding: 27px 22px; border-radius: 19px; }
  .auth-screen::before { width: 260px; height: 260px; inset-inline-start: -190px; top: 38%; }
  .auth-screen::after { width: 190px; height: 190px; inset-inline-end: -140px; }
  .auth-footer { flex-direction: column; text-align: center; }
  .page-container { padding: 23px 14px 42px; }
  .topbar { min-height: 60px; padding: 0 13px; }
  .breadcrumbs { font-size: 10px; }
  .topbar-note { display: none; }
  .page-heading { flex-direction: column; gap: 14px; margin-bottom: 19px; }
  .page-heading-actions { width: 100%; }
  .kpi-grid { grid-template-columns: 1fr; gap: 9px; }
  .kpi-card { min-height: 100px; }
  .kpi-value { margin-top: 12px; }
  .quick-actions { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .question-card { grid-template-columns: minmax(0,1fr) 42px; }
  .question-card .field:first-child { grid-column: 1 / -1; }
  .question-card .field:nth-child(2) { grid-column: 1 / -1; }
  .question-card .remove-question { grid-column: 2; }
  .question-indicator-field { grid-column: 1 / -1; }
  .question-card .answer-option { grid-column: 1 / -1; }
  .assessment-hierarchy { grid-template-columns:1fr; }
  .hierarchy-domain-head, .hierarchy-heading { flex-direction: column; }
  .hierarchy-domain-head .row-actions, .hierarchy-heading .row-actions { width: 100%; }
  .hierarchy-domain-head { padding:16px 17px 14px 21px; }
  .hierarchy-domain-details > summary, .hierarchy-standard > summary { align-items:flex-start; }
  .hierarchy-summary-meta { width:100%; justify-content:space-between; }
  .hierarchy-summary-description { white-space:normal; }
  .indicator-levels, .indicator-preview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .panel-head { align-items: flex-start; padding: 12px 14px; }
  .panel-body { padding: 14px; }
  .modal-backdrop { padding: 10px; }
  .modal-body { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-height: 480px) {
  .sidebar { padding-block: 10px 6px; }
  .sidebar-brand { min-height: 49px; padding-bottom: 7px; }
  .sidebar-brand img { width: 36px; height: 36px; }
  .sidebar-bottom { margin-top: 6px; padding-top: 5px; }
  .sidebar .user-card { min-height: 38px; padding-bottom: 5px; }
  .sidebar .logout-button { min-height: 32px; }
}
@media print { .sidebar-backdrop { display: none !important; } }

/* المجمعات والتقويم الذاتي */
.complex-branch { margin-block:16px; overflow:hidden; }
.complex-branch > summary { list-style:none; display:flex; align-items:center; gap:16px; padding:24px; cursor:pointer; background:linear-gradient(120deg,#f5f7fc,#fff); }
.complex-branch > summary::-webkit-details-marker { display:none; }
.complex-branch summary b { display:block; font-size:20px; color:#171844; }
.complex-branch summary small { display:block; margin-top:6px; color:#627088; }
.complex-icon { display:grid; place-items:center; width:48px; height:48px; border-radius:14px; background:#e8edfa; color:#325fa1; font-size:26px; }
.complex-expand { margin-inline-start:auto; font-size:12px; color:#325fa1; }
.complex-actions { margin-bottom:18px; }
.school-tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:16px; }
.school-tile { padding:22px; border:1px solid; border-radius:16px; }
.school-tile h3 { margin-block:16px 8px; font-size:20px; }
.school-tile p { font-size:13px; min-height:18px; }
.school-tile-top { display:flex; gap:8px; }
.school-boys { background:linear-gradient(145deg,#eef6ff,#dceafe); border-color:#b5d2f6; color:#164b91; }
.school-boys .pill { color:#164b91; background:#c9dfff; }
.school-girls { background:linear-gradient(145deg,#fff2f8,#fbddec); border-color:#f2b9d7; color:#8b2c62; }
.school-girls .pill { color:#8b2c62; background:#f7c8e0; }
.assignment-options { display:grid; gap:8px; max-height:280px; overflow-y:auto; padding:10px; border:1px solid #e0e5ee; border-radius:12px; }
.final-report-title { border-inline-start:4px solid #325fa1; padding:18px 24px; margin-block:20px; }
.final-report-title h2 { font-size:30px; margin-block:8px; }
.final-report .panel { margin-block:20px; }
.final-report td,.final-report th { white-space:normal; min-width:85px; }
.final-report .report-domain th,.final-report .report-domain td { background:#dfe9f7; font-weight:700; }
.final-report .report-standard th,.final-report .report-standard td { background:#f0f4fa; }
.final-report .report-standard th { padding-inline-start:30px; }
.final-report .report-indicator { padding-inline-start:45px; }
.question-result { padding:16px; margin-block:10px; border:1px solid #e3e8f0; border-radius:12px; }
.question-result summary { cursor:pointer; display:flex; flex-wrap:wrap; justify-content:space-between; gap:12px; }
.question-result summary span { color:#67748b; font-size:13px; }
.teacher-visits { margin-block:24px; }
.visit-result { border:1px solid #e3e8f0; border-radius:12px; overflow:hidden; margin-block:12px; }
@media (max-width:640px) {
  .complex-branch > summary { gap:10px; padding:18px; }
  .complex-expand { font-size:10px; }
  .school-tiles { grid-template-columns:1fr; }
}
@media print {
  body.printing-final { background:white; font-size:10pt; }
  body.printing-final .sidebar,body.printing-final .topbar,body.printing-final .page-heading,body.printing-final .final-controls,body.printing-final .no-print,body.printing-final #toast-region,body.printing-final #modal-root { display:none !important; }
  body.printing-final .dashboard,body.printing-final .workspace { display:block; margin:0; padding:0; }
  body.printing-final .page-container { padding:0; max-width:none; }
  body.printing-final .panel,body.printing-final .question-result { box-shadow:none; border-color:#ddd; }
  body.printing-final .table-wrap { overflow:visible; }
  body.printing-final table { width:100%; min-width:0; font-size:8pt; }
  body.printing-final tr { break-inside:avoid; }
  body.printing-final th,body.printing-final td { min-width:0; padding:7px; }
  body.printing-final .panel-head { break-after:avoid; }
  body.printing-final thead { display:table-header-group; }
  @page { size:A4 landscape; margin:12mm; }
}

.domain-chart { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:18px; margin-block:16px 28px; }
.domain-chart-item { padding:16px; border:1px solid #e3e8f0; border-radius:12px; }
.domain-chart-item h3 { font-size:14px; margin-top:0; }
.domain-bar-row { display:flex; gap:10px; align-items:center; margin-top:12px; font-size:11px; }
.domain-bar-row > span:first-child { min-width:38px; }
.domain-bar-row b { min-width:50px; direction:ltr; }
.domain-bar-track { flex:1; min-width:80px; height:12px; overflow:hidden; border-radius:8px; background:#edf1f6; }
.domain-bar-fill { display:block; height:100%; border-radius:8px; background:#325fa1; }
.domain-bar-fill.self { background:#438670; }
@media print { .domain-chart-item { break-inside:avoid; } .domain-bar-fill { print-color-adjust:exact; } }


/* Active roles, delegated sessions, imports, and extended reports */
.role-switch-label { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 600; }
.role-switch-label select { min-height: 30px; max-width: 175px; padding: 3px 25px 3px 8px; border: 1px solid #d5dfed; border-radius: 8px; color: var(--navy); background: #f7faff; font-size: 10px; }
.impersonation-banner { min-height: 45px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px clamp(18px,4vw,50px); color: #6e4e1c; background: linear-gradient(90deg,#fff4dd,#fffaf1); border-bottom: 1px solid #eed8ad; font-size: 11px; line-height: 1.65; }
.impersonation-banner b { color: #533510; }
.template-summary-controls { margin-bottom: 14px; border-color: #dbe5f4; background: linear-gradient(135deg,#fff,#f8fbff); }
.template-summary-controls .toolbar { align-items: end; }
.evaluation-result { display: grid; gap: 10px; }
.evaluation-result h3 { margin: 0; color: var(--navy); font-size: 15px; line-height: 1.9; }
.role-options { grid-template-columns: repeat(auto-fit,minmax(175px,1fr)); max-height: 190px; }
.import-preview-summary { display: flex; align-items: center; gap: 10px; margin: 15px 0 10px; color: var(--muted); font-size: 11px; }
.import-preview-table { max-height: 360px; margin-top: 12px; }
.import-preview-table td { white-space: normal; vertical-align: top; }
.report-v3-controls { margin-bottom: 14px; }
.report-v3-controls .field { min-width: min(190px,100%); }
.report-export-actions { justify-content: flex-start; }
.survey-campaign-result { min-width: 260px; margin: 6px 0; padding: 9px; border: 1px solid #e7ebf2; border-radius: 9px; background: #fcfdff; white-space: normal; }
.survey-campaign-result summary { display: flex; justify-content: space-between; gap: 8px; color: var(--navy); font-size: 10px; cursor: pointer; }
.survey-campaign-result summary span { color: var(--muted); }
.survey-question-summary { display: grid; gap: 5px; margin-top: 9px; }
.survey-question-summary > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid #eef1f5; color: #59617a; font-size: 10px; }
.survey-question-summary b { max-width: 70%; }
.complex-results { display: grid; gap: 13px; }
.complex-results-head { margin: 0; }
.complex-ranking-card { overflow: hidden; border: 1px solid #dce4ef; border-radius: 16px; background: #fff; box-shadow: 0 10px 25px rgba(27,34,77,.04); }
.complex-ranking-card > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; background: linear-gradient(115deg,#f7faff,#fff); border-bottom: 1px solid #e8edf4; }
.complex-ranking-card .eyebrow { display: block; margin: 0 0 4px; }
.complex-ranking-card h2 { margin: 0; color: var(--navy); font-size: 18px; }
.complex-percentage { min-width: 94px; padding: 9px 12px; border-radius: 12px; color: #245ca7; background: #eaf1fb; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.complex-school-ranking { display: grid; grid-template-columns: repeat(auto-fit,minmax(205px,1fr)); gap: 10px; padding: 15px; }
.complex-school-score { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 58px; padding: 11px 13px; border: 1px solid; border-radius: 12px; font-size: 11px; }
.complex-school-score span { color: inherit; }
.complex-school-score b { direction: ltr; font-size: 12px; }
.complex-school-score.boys { color: #164b91; border-color: #b5d2f6; background: linear-gradient(135deg,#f2f8ff,#ddecff); }
.complex-school-score.girls { color: #8b2c62; border-color: #f2b9d7; background: linear-gradient(135deg,#fff5fa,#fce1ee); }
@media (max-width: 620px) {
  .impersonation-banner { align-items: flex-start; flex-direction: column; padding: 10px 14px; }
  .role-switch-label { max-width: 150px; }
  .role-switch-label select { max-width: 100px; }
  .complex-ranking-card > header { align-items: flex-start; flex-direction: column; }
  .complex-percentage { min-width: 0; }
}


/* Portal v4: evidence-aware evaluation, contact workflows, and campaign cards */
.evaluation-question-card {
  margin-block: 16px;
  padding: clamp(17px, 2.5vw, 25px);
  border: 1px solid #d9e3f1;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff 0%, #f8fbff 100%);
  box-shadow: 0 8px 24px rgba(35, 57, 104, .045);
}
.evaluation-question-card h3 { max-width: 900px; margin-bottom: 13px; color: var(--navy); font-size: clamp(16px, 1.8vw, 20px); line-height: 1.9; }
.evaluation-question-card .indicator-path { margin-bottom: 13px; font-size: 11px; }
.evaluation-question-card .scale-answer-list { gap: 9px; }
.evaluation-question-card .scale-answer-option { grid-template-columns: 20px 38px 26px minmax(0, 1fr); min-height: 58px; padding: 12px 14px; border-color: #dbe3ef; }
.evaluation-question-card .scale-answer-option:hover { border-color: #9db5d5; background: #f8fbff; }
.evaluation-question-card .scale-score { align-self: center; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #eef2f7; font-size: 14px; }
.scale-thumb { width: 22px; height: 22px; align-self: center; fill: #aab2c0; transition: fill .16s ease, transform .16s ease; }
.scale-neutral-mark { align-self: center; color: #9ea7b6; font-size: 23px; font-weight: 700; line-height: 1; text-align: center; }
.evaluation-question-card .scale-answer-option:has(input:checked) { border-color: #819fc6; background: #f4f8fe; box-shadow: inset -3px 0 var(--blue); }
.evaluation-question-card .scale-answer-option[data-score="1"]:has(input:checked),
.evaluation-question-card .scale-answer-option[data-score="2"]:has(input:checked),
.evaluation-question-card .scale-answer-option[data-score="5"]:has(input:checked) { border-color: #df9ba4; background: #fff8f8; box-shadow: inset -3px 0 var(--red); }
.evaluation-question-card .scale-answer-option[data-score="1"]:has(input:checked) .scale-thumb,
.evaluation-question-card .scale-answer-option[data-score="2"]:has(input:checked) .scale-thumb,
.evaluation-question-card .scale-answer-option[data-score="5"]:has(input:checked) .scale-thumb { fill: #b84d58; transform: scale(1.08); }
.evaluation-question-card .scale-answer-option[data-score="1"]:has(input:checked) .scale-score,
.evaluation-question-card .scale-answer-option[data-score="2"]:has(input:checked) .scale-score,
.evaluation-question-card .scale-answer-option[data-score="5"]:has(input:checked) .scale-score { color: #a33f4b; background: #fae7e9; }
.evaluation-question-card .scale-answer-option[data-score="3"]:has(input:checked) .scale-neutral-mark,
.evaluation-question-card .scale-answer-option[data-score="4"]:has(input:checked) .scale-neutral-mark { color: #667085; }
.evaluation-justification { margin-top: 14px; padding-top: 13px; border-top: 1px dashed #dce3ed; }
.evaluation-justification label { display: flex; flex-wrap: wrap; gap: 7px; align-items: baseline; }
.evaluation-justification textarea { min-height: 94px; }
.school-identity { margin-top: -2px; color: inherit; font-weight: 600; opacity: .86; }
.complex-count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 74px; padding: 6px 10px; border: 1px solid #cbdaf0; border-radius: 99px; color: #285b9f; background: #edf4ff; font-size: 10px; font-weight: 700; white-space: nowrap; }
.complex-branch > summary .complex-count-badge { margin-inline-start: auto; }
.member-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: -7px 0 14px; }
.member-tab { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; color: #64708a; background: #fff; font-size: 11px; font-weight: 600; }
.member-tab.active, .member-tab:hover { border-color: #bad0ed; color: var(--blue); background: #f2f7fd; }
.school-survey-grid { display: grid; gap: 15px; }
.school-survey-card { overflow: hidden; border: 1px solid #dce5f0; border-radius: 16px; background: #fff; box-shadow: 0 10px 25px rgba(27, 34, 77, .04); }
.school-survey-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #e9eef4; background: linear-gradient(120deg, #f8fbff, #fff); }
.school-survey-card > header .eyebrow { margin: 0 0 3px; }
.school-survey-card > header h3 { margin: 0; color: var(--navy); font-size: 15px; line-height: 1.7; }
.school-survey-boys { border-inline-start: 4px solid #5b8fc9; }
.school-survey-girls { border-inline-start: 4px solid #d47aa8; }
.campaign-link-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px; }
.campaign-link-card { display: grid; align-content: start; gap: 7px; min-height: 145px; padding: 13px; border: 1px solid; border-radius: 12px; }
.campaign-link-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--navy); font-size: 11px; font-weight: 700; }
.campaign-link-card > b { color: var(--navy); font-size: 12px; line-height: 1.7; }
.campaign-link-card > small { color: #69748a; font-size: 10px; }
.campaign-link-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.campaign-link-actions .button { min-height: 31px; padding-inline: 8px; font-size: 10px; }
.campaign-teacher { border-color: #b9d4f2; background: #f2f8ff; }
.campaign-student { border-color: #c9dcbc; background: #f5faef; }
.campaign-parent { border-color: #e8c7aa; background: #fff8ed; }
.campaign-link-card.is-empty { opacity: .78; }
.sms-disabled-notice { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.sms-recipient-list { display: grid; gap: 7px; max-height: 260px; overflow: auto; padding: 9px; border: 1px solid #e0e6ef; border-radius: 10px; background: #fbfcfe; }
.sms-recipient { justify-content: flex-start; text-align: right; }
.sms-recipient > span { display: grid; gap: 2px; }
.sms-recipient small { color: var(--muted); font-size: 10px; }
.sms-draft-history { display: grid; gap: 6px; margin-top: 14px; padding: 11px; border-radius: 10px; color: #5d667b; background: #f6f8fb; font-size: 11px; }
.sms-draft-history span { padding-top: 5px; border-top: 1px solid #e5e9ef; }
.sms-message-preview { margin: 12px 0; padding: 11px 13px; border: 1px dashed #cbd8e8; border-radius: 10px; color: #59657c; background: #f8fbfe; font-size: 11px; line-height: 1.9; }
.sms-message-preview b { color: var(--navy); }
.sms-message-preview p { min-height: 22px; margin: 5px 0 0; overflow-wrap: anywhere; direction: rtl; white-space: pre-wrap; }
@media (max-width: 760px) {
  .campaign-link-grid { grid-template-columns: 1fr; }
  .school-survey-card > header { align-items: flex-start; flex-direction: column; }
  .complex-branch > summary .complex-count-badge { margin-inline-start: 0; }
}
@media (max-width: 620px) {
  .evaluation-question-card { padding: 15px; }
  .evaluation-question-card .scale-answer-option { grid-template-columns: 18px 32px 22px minmax(0, 1fr); gap: 7px; padding: 10px; }
  .evaluation-question-card .scale-score { width: 26px; height: 26px; font-size: 12px; }
  .evaluation-question-card .scale-interpretation { font-size: 10px; }
}
@media print {
  .final-report .report-domain th, .final-report .report-domain td { background: #dfe9f7 !important; }
  .final-report .report-standard th, .final-report .report-standard td { background: #f0f4fa !important; }
  .school-survey-card, .campaign-link-card, .evaluation-question-card { break-inside: avoid; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* Independent complex subtitle and scoped gender counts. */
.complex-heading { flex: 1 1 230px; min-width: 0; }
.complex-name-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.complex-subtitle { display: inline-flex; align-items: center; max-width: 100%; padding: 6px 13px; border: 1px solid #d4c9ed; border-radius: 10px; background: linear-gradient(120deg,#f5efff,#eeeafa); color: #5d398d; font-size: 13px; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; box-shadow: 0 3px 9px #513e7410; }
.complex-branch > summary { flex-wrap: wrap; }
.complex-branch > summary:focus-visible { outline: 3px solid #547aba; outline-offset: -3px; }
.complex-name-line > b, .complex-name-line > h2 { overflow-wrap: anywhere; }
.complex-school-counts { display: flex; flex: 0 1 auto; align-items: stretch; flex-wrap: wrap; gap: 8px; }
.complex-count-total, .complex-count-gender { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 105px; padding: 9px 12px; border: 1px solid; border-radius: 13px; font-size: 11px; line-height: 1.65; text-align: center; transition: transform .18s ease, box-shadow .18s ease; }
.complex-count-total { color: #444776; background: #f0f1fb; border-color: #dcdff0; }
.complex-count-gender.boys { color: #1c548d; background: linear-gradient(135deg,#eef6ff,#dbeaff); border-color: #bad5f2; }
.complex-count-gender.girls { color: #913f6c; background: linear-gradient(135deg,#fff0f8,#fbe0ee); border-color: #ecc0d8; }
.complex-school-counts strong { font-size: 23px; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
.complex-count-unclassified { align-self: center; padding: 6px 10px; border-radius: 9px; color: #786029; background: #fff7e2; font-size: 11px; }
.complex-branch > summary:hover .complex-count-gender { transform: translateY(-2px); box-shadow: 0 4px 10px #1d37610b; }
@media (max-width: 760px) {
  .complex-heading { flex-basis: calc(100% - 70px); }
  .complex-school-counts { flex: 1 1 100%; }
  .complex-count-total, .complex-count-gender { flex: 1 1 85px; min-width: 0; padding: 8px; }
  .complex-name-line { gap: 7px; }
  .complex-subtitle { font-size: 12px; }
  .complex-expand { margin-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .complex-count-total, .complex-count-gender { transition: none; }
  .complex-branch > summary:hover .complex-count-gender { transform: none; }
}

/* شاشة الدخول المختصرة: الشعار والحقول فقط */
.auth-minimal {
  min-height: 100svh;
  justify-content: center;
  padding: 30px 18px;
  background: radial-gradient(ellipse at 50% 0%, #dde8f9 0%, transparent 58%), linear-gradient(155deg, #f7f9fd, #edf2fa);
}
.auth-minimal::before, .auth-minimal::after { display: none; }
.auth-minimal .auth-main { display: block; width: min(470px, 100%); padding: 0; margin: auto; }
.auth-minimal .auth-card { padding: clamp(28px, 5vw, 42px); border: 1px solid #e2e8f3; border-radius: 28px; box-shadow: 0 25px 80px #18244814; background: #fff; backdrop-filter: none; }
.auth-company-logo { display: block; width: 120px; height: 120px; object-fit: contain; margin: 0 auto 22px; border-radius: 20px; }
.auth-minimal .auth-card h1 { font-size: clamp(20px, 2.5vw, 24px); font-weight: 600; line-height: 1.85; text-align: center; margin: 0 0 26px; color: #171844; }
.auth-minimal .auth-description { margin: 0 0 20px; font-size: 13px; text-align: center; }
.auth-minimal .auth-form { margin-top: 0; gap: 20px; }
.auth-minimal .auth-form label { font-size: 13px; line-height: 1.8; }
.auth-minimal .auth-form input { min-height: 52px; border-radius: 12px; font-size: 16px; background: #fbfcff; }
.auth-minimal .button-primary { min-height: 52px; font-size: 15px; background: linear-gradient(115deg, #245ca7, #303b7e); box-shadow: 0 10px 22px #245ca721; }
.auth-minimal .button-primary:hover { background: #245ca7; }
.company-intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; pointer-events: none; background: #f4f7fd; animation: introReveal 1.15s ease both; }
.company-intro img { width: min(140px, 32vw); height: min(140px, 32vw); object-fit: contain; border-radius: 24px; box-shadow: 0 15px 55px #245ca71a; animation: companyLogoIn 1.05s cubic-bezier(.16,.75,.24,1) both; will-change: transform, opacity; }
@keyframes companyLogoIn {
  0% { transform: perspective(700px) translateZ(400px) scale(2.2); opacity: 0; }
  25% { opacity: 1; }
  72% { transform: perspective(700px) translateZ(0) scale(1); opacity: 1; }
  100% { transform: scale(.96); opacity: 0; }
}
@keyframes introReveal {
  0%, 62% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}
@media (max-width: 480px) {
  .auth-minimal { padding: 22px 15px; }
  .auth-minimal .auth-card { border-radius: 22px; padding: 28px 23px; }
  .auth-company-logo { width: 105px; height: 105px; margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .company-intro { display: none; }
  .auth-minimal .auth-card { animation: none; }
}

/* Versioned template and personal evaluation editors. */
.question-card .question-edit-actions { display: flex; gap: 4px; align-items: center; }
.question-card .question-edit-actions .remove-question { position: static; }
.evaluation-edit-meta { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.evaluation-edit-meta > div { flex: 1 1 210px; display: grid; gap: 5px; background: #f4f7fb; border: 1px solid #e0e6ef; border-radius: 12px; padding: 12px 15px; }
.evaluation-edit-meta span { color: var(--muted); font-size: 12px; }
.evaluation-edit-meta b { font-size: 14px; line-height: 1.8; }
.evaluation-edit-score { padding: 14px 18px; display: flex; gap: 15px; flex-wrap: wrap; align-items: center; border: 1px solid #ced9eb; background: #eff5ff; border-radius: 14px; }
.evaluation-edit-score b { color: var(--blue); font-size: 27px; direction: ltr; font-variant-numeric: tabular-nums; }
.evaluation-edit-score .field-hint { flex-basis: 100%; }
.evaluation-edit-history { margin-top: 14px; padding: 12px 16px; border: 1px solid #e2e8f0; border-radius: 12px; }
.evaluation-edit-history summary { cursor: pointer; font-weight: 700; }
.evaluation-edit-history li { margin-block: 8px; color: var(--muted); font-size: 13px; }
@media (max-width: 600px) { .question-card .question-edit-actions { justify-content: flex-end; grid-column: 1 / -1; } .evaluation-edit-meta > div { flex-basis: 100%; } }
