/* =====================================================================
   منصة «شواهد معلمي ابن رشد» — ملف التنسيق الموحّد
   ===================================================================== */

/* ---------- الخطوط (محلية — لا تحتاج اتصالاً خارجياً) ---------- */
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/plex-ar-400.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/plex-ar-500.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/plex-ar-600.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fonts/plex-ar-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/plex-lat-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/plex-lat-500.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/plex-lat-600.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fonts/plex-lat-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Noto Kufi Arabic"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fonts/kufi-ar-700.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Noto Kufi Arabic"; font-weight: 800; font-style: normal; font-display: swap;
  src: url("../fonts/kufi-ar-800.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

/* ---------- المتغيرات ---------- */
:root {
  --navy: #15384a;
  --navy-deep: #0d2734;
  --teal: #0c8577;
  --teal-deep: #076a5f;
  --teal-soft: #dff0ed;
  --paper: #f0f4f3;
  --card: #ffffff;
  --ink: #1a2930;
  --muted: #5b6c75;
  --line: #d3dcdc;
  --line-soft: #e5ebeb;
  --amber: #96600a;
  --amber-soft: #fbf1dc;
  --danger: #b3261e;
  --danger-soft: #fbe8e6;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(13, 39, 52, .06), 0 6px 18px -10px rgba(13, 39, 52, .22);
  --font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  --font-head: "Noto Kufi Arabic", "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif;
  --side-w: 248px;
}

/* ---------- الأساس ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.75;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.5; margin: 0; color: var(--navy); }
p { margin: 0; }
a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(12, 133, 119, .45); outline-offset: 2px; border-radius: 4px; }
.ic { width: 1.15em; height: 1.15em; flex: none; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--navy); color: #fff; font-weight: 600; font-size: .95rem; line-height: 1.4;
  text-decoration: none; transition: background-color .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn:hover { background: var(--navy-deep); text-decoration: none; }
.btn-teal { background: var(--teal); }
.btn-teal:hover { background: var(--teal-deep); }
.btn-line { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-line:hover { background: var(--paper); border-color: var(--navy); }
.btn-soft { background: var(--teal-soft); color: var(--teal-deep); }
.btn-soft:hover { background: #cfe8e3; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #8f1d17; }
.btn-danger-line { background: #fff; color: var(--danger); border-color: #e7b9b5; }
.btn-danger-line:hover { background: var(--danger-soft); }
.btn-sm { min-height: 38px; padding: 5px 12px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--navy);
}
.icon-btn:hover { background: var(--paper); border-color: var(--navy); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: var(--danger-soft); border-color: #e7b9b5; }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- النماذج ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: .92rem; color: var(--navy); }
.req { color: var(--danger); margin-inline-start: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 9px 12px; background: #fff; border: 1px solid #b9c6c7;
  border-radius: var(--radius-sm); line-height: 1.6; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(12, 133, 119, .18); }
.input[readonly] { background: var(--paper); color: var(--muted); }
.input.ltr-input { direction: ltr; text-align: right; }
.select { appearance: none; -webkit-appearance: none; padding-inline-end: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2315384a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center; }
.hint { font-size: .84rem; color: var(--muted); }
.count { align-self: flex-end; font-size: .78rem; color: var(--muted); direction: ltr; margin-top: -2px; }
.count.is-full { color: var(--danger); font-weight: 600; }
.field-warn, .field-error { display: flex; gap: 6px; align-items: center; font-size: .84rem; font-weight: 500; }
.field-warn { color: var(--amber); }
.field-error { color: var(--danger); }
.field-warn .ic, .field-error .ic { width: 1em; height: 1em; }
.has-error .input, .has-error .select, .has-error .textarea { border-color: var(--danger); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-inline-end: 48px; direction: ltr; text-align: right; }
.pw-toggle { position: absolute; inset-inline-end: 4px; top: 4px; width: 38px; height: 38px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: var(--radius-sm); }
.pw-toggle:hover { color: var(--navy); background: var(--paper); }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); }
.seg { display: inline-flex; border: 1px solid #b9c6c7; border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 16px; font-weight: 600; font-size: .92rem; color: var(--muted); }
.seg label + label span { border-inline-start: 1px solid #b9c6c7; }
.seg input:checked + span { background: var(--navy); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid rgba(12, 133, 119, .45); outline-offset: -3px; }

/* ---------- التنبيهات والشارات ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 16px; font-weight: 500; }
.alert .ic { margin-top: 4px; }
.alert-success { background: var(--teal-soft); border-color: #a9d6cf; color: #06554c; }
.alert-error { background: var(--danger-soft); border-color: #e7b9b5; color: #8f1d17; }
.alert-warn { background: var(--amber-soft); border-color: #ecd49c; color: #6f4705; }
.alert-info { background: #e6eef2; border-color: #bccdd6; color: var(--navy); }
.alert a { color: inherit; text-decoration: underline; font-weight: 700; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; line-height: 1.7; }
.badge .ic { width: .95em; height: .95em; stroke-width: 2.6; }
.badge-ok { background: var(--teal-soft); color: #06554c; }
.badge-no { background: #eceff0; color: #55646c; }
.badge-warn { background: var(--amber-soft); color: #6f4705; }
.badge-danger { background: var(--danger-soft); color: #8f1d17; }
.badge-navy { background: #e2eaee; color: var(--navy); }

/* ---------- شريط التقدم ---------- */
.bar { height: 10px; background: #dfe7e7; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--teal); border-radius: 999px; transition: width .4s ease; }
.bar.thin { height: 6px; }
.pct { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.pct .bar { flex: 1; }
.pct b { font-weight: 700; font-size: .9rem; min-width: 3ch; text-align: left; direction: ltr; }

/* =====================================================================
   الصفحات العامة
   ===================================================================== */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand img { width: 42px; height: 42px; object-fit: contain; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.brand-text strong { font-family: var(--font-head); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: var(--muted); font-size: .8rem; }
.site-foot { margin-top: 56px; border-top: 1px solid var(--line); padding: 22px 0 30px; color: var(--muted); font-size: .9rem; text-align: center; }

/* --- الصفحة الرئيسية P-01 --- */
.home-head { padding: 44px 0 26px; }
.home-title { font-size: clamp(2rem, 6.4vw, 3.6rem); font-weight: 800; line-height: 1.35; letter-spacing: 0; }
.home-rule { width: 96px; height: 5px; background: var(--teal); border-radius: 3px; margin-top: 12px; }
.home-sub { margin-top: 14px; color: var(--muted); max-width: 60ch; }
.home-tools { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 12px; margin-top: 26px; }
.search { position: relative; }
.search .ic { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-inline-start: 44px; min-height: 50px; }
.home-tools .select { min-height: 50px; }
.result-note { margin: 18px 0 14px; color: var(--muted); font-size: .92rem; }
.teachers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 20px; }
.t-card { display: block; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s ease, border-color .18s ease; }
.t-card:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--teal); }
.t-photo { aspect-ratio: 4 / 5; background: #dfe7e7; overflow: hidden; }
.t-photo img { width: 100%; height: 100%; object-fit: cover; }
.t-info { padding: 12px 14px 14px; border-top: 4px solid var(--teal); }
.t-name { font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--navy); line-height: 1.6; }
.t-subject { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.empty { text-align: center; padding: 56px 20px; background: var(--card); border: 1px dashed #b9c6c7; border-radius: var(--radius); color: var(--muted); }
.empty .ic { width: 40px; height: 40px; margin: 0 auto 10px; display: block; color: #9fb0b3; }
.empty strong { display: block; color: var(--navy); font-family: var(--font-head); font-size: 1.1rem; margin-bottom: 4px; }

/* --- صفحة المعلم العامة P-02 --- */
.letterhead { background: #fff; border-bottom: 1px solid var(--line); }
.letterhead-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 18px 0; }
.lh-lines { font-family: var(--font-head); font-weight: 700; color: var(--navy); font-size: .92rem; line-height: 1.9; }
.lh-logo img { width: 84px; height: 84px; object-fit: contain; }
.lh-school { text-align: left; font-family: var(--font-head); font-weight: 700; color: var(--navy); font-size: .92rem; line-height: 1.9; }
.lh-school small { display: block; color: var(--teal-deep); font-size: .86rem; }
.preview-note { background: var(--amber-soft); border-bottom: 1px solid #ecd49c; color: #6f4705; font-weight: 500; font-size: .92rem; padding: 10px 0; }
.preview-note .wrap { display: flex; gap: 8px; align-items: flex-start; }
.ident { background: var(--navy); color: #fff; }
.ident-in { display: grid; grid-template-columns: 168px minmax(0, 1fr) auto; gap: 26px; align-items: center; padding: 28px 0; }
.ident-photo { width: 168px; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; border: 4px solid #fff; background: #dfe7e7; }
.ident-photo img { width: 100%; height: 100%; object-fit: cover; }
.ident h1 { color: #fff; font-size: clamp(1.5rem, 4.2vw, 2.3rem); font-weight: 800; }
.ident-job { color: #bfe3dd; font-weight: 600; margin-top: 4px; font-size: 1.05rem; }
.ident-facts { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 16px; }
.ident-facts div { font-size: .95rem; }
.ident-facts span { display: block; color: #9fc0c9; font-size: .8rem; }
.ident .btn-back { background: transparent; border-color: rgba(255, 255, 255, .45); color: #fff; align-self: start; }
.ident .btn-back:hover { background: rgba(255, 255, 255, .12); }
.tabs { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 4px 12px -10px rgba(13, 39, 52, .5); }
.tabs-in { position: relative; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs-in::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 14px 14px 11px; color: var(--muted); font-weight: 600; font-size: .93rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--navy); text-decoration: none; }
.tabs a.is-active { color: var(--navy); border-bottom-color: var(--teal); }
.block { padding-top: 40px; }
.block-title { display: flex; align-items: baseline; gap: 12px; font-size: 1.35rem; padding-bottom: 10px; border-bottom: 2px solid var(--navy); margin-bottom: 18px; }
.block-title small { font-family: var(--font-body); font-weight: 500; font-size: .88rem; color: var(--muted); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 16px; }
.panel-title { font-size: 1.02rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.panel-title .ic { color: var(--teal); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 24px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: .84rem; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.facts .private dt::after { content: " (لا يظهر للزوار)"; color: var(--amber); font-size: .78rem; }
.license { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.license-img { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; padding: 0; background: #fff; cursor: zoom-in; width: 100%; }
.license-img img { width: 100%; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.trio .panel { margin: 0; border-top: 4px solid var(--teal); }
.trio h3 { font-size: 1.1rem; margin-bottom: 8px; }
.trio p { white-space: pre-line; }
.values-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.values-list li { background: var(--teal-soft); color: #06554c; font-weight: 600; padding: 3px 12px; border-radius: 999px; font-size: .92rem; }
.dots { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.dots li { position: relative; padding-inline-start: 22px; }
.dots li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .72em; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.goal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: goal; }
.goal-list li { counter-increment: goal; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.goal-list li::before { content: counter(goal); width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; }
.goal-list h3 { font-size: 1rem; }
.goal-list p { color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- الجداول ---------- */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .94rem; }
.tbl th { background: var(--teal); color: #fff; font-weight: 600; text-align: start; padding: 11px 12px; white-space: nowrap; font-size: .9rem; }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:nth-child(even) td { background: #f7f9f9; }
.tbl a.row-link { color: var(--navy); font-weight: 600; }
.tbl .num { text-align: center; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; background: #eef3f3; border-top: 2px solid var(--line); }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; background: #dfe7e7; border: 1px solid var(--line); }
.avatar.lg { width: 72px; height: 72px; }
.cell-user b { display: block; font-weight: 600; color: var(--navy); line-height: 1.5; }
.cell-user small { color: var(--muted); display: block; line-height: 1.4; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions form { display: contents; }
.actions.tight { flex-wrap: nowrap; gap: 4px; }
.actions.tight .icon-btn { width: 34px; height: 34px; }
.cell-user > div { min-width: 120px; }

/* ---------- أقسام الفقرات (فاصل الملف بلسان مرقّم) ---------- */
.sec { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 30px; }
.sec-tab {
  position: absolute; top: -19px; inset-inline-start: 18px; height: 20px; min-width: 62px; padding: 0 14px;
  background: var(--navy); color: #fff; font-weight: 700; font-size: .82rem; line-height: 20px; text-align: center;
  border-radius: 8px 8px 0 0;
}
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 16px 18px; }
.sec-title { font-size: 1.1rem; }
.sec-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.weight { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; height: 30px; padding: 0 10px; border: 2px solid var(--teal); border-radius: 999px; color: var(--teal-deep); font-weight: 700; font-size: .9rem; direction: ltr; }
.sec-count { color: var(--muted); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.sec-suggest { margin: 0 18px 4px; padding: 10px 12px; background: var(--paper); border-radius: var(--radius-sm); font-size: .88rem; color: var(--muted); }
.sec-suggest b { color: var(--navy); }
details.sec > summary { list-style: none; cursor: pointer; border-radius: var(--radius); }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary .chev { transition: transform .2s; color: var(--muted); }
details.sec[open] > summary .chev { transform: rotate(180deg); }
details.sec[open] > summary { border-bottom: 1px solid var(--line-soft); border-radius: var(--radius) var(--radius) 0 0; }
.sec-body { padding: 4px 18px 16px; }
.item { padding: 16px 0; border-top: 1px solid var(--line-soft); }
.sec-body > .item:first-child, .sec-suggest + .sec-body > .item:first-child { border-top: 0; }
.item-head { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px 12px; align-items: start; }
.item-num { width: 30px; height: 30px; border-radius: 50%; background: #e2eaee; color: var(--navy); font-weight: 700; font-size: .88rem; display: grid; place-items: center; }
.item.has-ev .item-num { background: var(--teal); color: #fff; }
.item-text { font-weight: 600; line-height: 1.8; overflow-wrap: anywhere; }
.item-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.counter { font-weight: 700; color: var(--navy); font-size: .9rem; direction: ltr; background: #e2eaee; border-radius: 999px; padding: 1px 10px; }
.item-kind { font-size: .84rem; color: var(--muted); white-space: nowrap; }
.item-kind b { color: var(--navy); }
.item-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding-inline-start: 42px; }
.limit-note { color: var(--amber); font-size: .88rem; font-weight: 600; }
.no-ev { margin-top: 10px; padding-inline-start: 42px; color: var(--muted); font-size: .9rem; }
.ev-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; padding-inline-start: 42px; }
.ev { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; display: flex; flex-direction: column; min-width: 0; }
.ev-media { display: block; width: 100%; aspect-ratio: 4 / 3; background: #0d2734; border: 0; padding: 0; overflow: hidden; }
button.ev-media { cursor: zoom-in; }
.ev-media img { width: 100%; height: 100%; object-fit: cover; }
.ev-media video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.ev-doc { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; aspect-ratio: 4 / 3; padding: 14px; background: var(--paper); color: var(--navy); font-weight: 600; align-content: center; }
.ev-doc:hover { background: #e6eded; text-decoration: none; }
.ev-ext { background: var(--navy); color: #fff; border-radius: 4px; padding: 6px 8px; font-size: .78rem; font-weight: 700; direction: ltr; letter-spacing: .02em; }
.ev-doc-name { overflow-wrap: anywhere; line-height: 1.6; font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ev figcaption { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: .84rem; border-top: 1px solid var(--line-soft); min-width: 0; }
.ev-type { display: inline-flex; align-items: center; gap: 4px; color: var(--teal-deep); font-weight: 700; flex: none; }
.ev-type .ic { width: 1em; height: 1em; }
.ev-title { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.ev-size { color: var(--muted); }
.ev-dl { color: var(--muted); display: inline-grid; place-items: center; width: 28px; height: 28px; margin-inline-start: auto; flex: none; }
.ev-del { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 38px; border: 0; border-top: 1px solid var(--line-soft); background: #fff; color: var(--danger); font-weight: 600; font-size: .86rem; }
.ev-del:hover { background: var(--danger-soft); }
.ev-del .ic { width: 1em; height: 1em; }
.ev form { margin: 0; }

/* جدول عناصر التقييم في صفحة المعلم العامة */
.tbl-eval td:first-child, .tbl-eval th:first-child { width: 48px; text-align: center; }
.tbl-eval a { color: var(--navy); font-weight: 600; }

/* =====================================================================
   تسجيل الدخول P-03
   ===================================================================== */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.login-side { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.login-side img { width: 76px; height: 76px; object-fit: contain; background: #fff; border-radius: 12px; padding: 8px; }
.login-side h1 { color: #fff; font-size: clamp(1.8rem, 3.6vw, 2.9rem); font-weight: 800; line-height: 1.45; }
.login-side .home-rule { background: #35b3a3; }
.login-side p { color: #bcd1d8; max-width: 44ch; margin-top: 16px; }
.login-side small { color: #9fc0c9; }
.login-main { display: grid; place-items: center; padding: 32px 20px; }
.login-box { width: min(400px, 100%); }
.login-box h2 { font-size: 1.5rem; margin-bottom: 4px; }
.login-box form { display: grid; gap: 16px; margin-top: 22px; }
.login-foot { margin-top: 18px; color: var(--muted); font-size: .88rem; text-align: center; }
.login-foot a { display: inline-block; margin-top: 10px; font-weight: 600; }

/* =====================================================================
   لوحات المعلم والإدارة
   ===================================================================== */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #fff; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: thin; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, .12); color: #fff; }
.side-brand:hover { text-decoration: none; }
.side-brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; flex: none; }
.side-brand strong { font-family: var(--font-head); font-size: .92rem; line-height: 1.5; display: block; }
.side-brand small { color: #9fc0c9; font-size: .78rem; display: block; }
.side-nav { padding: 12px 10px; display: grid; gap: 2px; }
.side-nav a, .side-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; background: none;
  color: #cfdde2; font-weight: 500; font-size: .95rem; border-radius: var(--radius-sm); text-align: start;
}
.side-nav a:hover, .side-nav button:hover { background: rgba(255, 255, 255, .09); color: #fff; text-decoration: none; }
.side-nav a.is-active { background: var(--teal); color: #fff; font-weight: 600; }
.side-nav .sep { height: 1px; background: rgba(255, 255, 255, .12); margin: 8px 6px; }
.side-nav form { margin: 0; }
.side-user { margin-top: auto; padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; align-items: center; gap: 10px; min-width: 0; }
.side-user .avatar { border-color: rgba(255, 255, 255, .4); }
.side-user b { display: block; font-weight: 600; font-size: .9rem; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { color: #9fc0c9; font-size: .78rem; }
.side-user div { min-width: 0; }
.main { min-width: 0; display: flex; flex-direction: column; }
.main-bar { display: none; }
.content { padding: 28px clamp(16px, 3vw, 36px) 48px; width: min(1340px, 100%); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 2px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 18px; }
.card-title { font-size: 1.08rem; margin-bottom: 4px; }
.card-sub { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head .card-title { margin: 0; }
.stack { display: grid; gap: 18px; }
.form-foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; border-inline-start: 5px solid var(--teal); }
.stat b { display: block; font-family: var(--font-head); font-size: 1.9rem; font-weight: 800; color: var(--navy); line-height: 1.3; direction: ltr; text-align: right; }
.stat span { color: var(--muted); font-size: .9rem; }
.welcome { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 22px; }
.welcome h1 { color: #fff; font-size: clamp(1.25rem, 3.2vw, 1.7rem); font-weight: 800; }
.welcome p { color: #bcd1d8; }
.welcome .avatar { width: 84px; height: 84px; border: 3px solid #fff; }
.welcome .btn { background: #fff; color: var(--navy); }
.welcome .btn:hover { background: var(--teal-soft); }
.progress-card .big { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.progress-card .big b { font-family: var(--font-head); font-size: 2.2rem; font-weight: 800; color: var(--navy); direction: ltr; line-height: 1.2; }
.parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.part { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
a.part:hover { border-color: var(--teal); text-decoration: none; }
.part span { color: var(--muted); font-size: .84rem; }
.part b { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.part.done b { color: var(--teal-deep); }
.part.todo b { color: var(--amber); }
.sec-rows { display: grid; }
.sec-row { display: grid; grid-template-columns: 34px minmax(0, 1.6fr) 62px minmax(120px, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.sec-row:first-child { border-top: 0; }
.sec-row .n { width: 34px; height: 34px; border-radius: 8px 8px 0 0; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.sec-row .ttl { font-weight: 600; color: var(--navy); }
.sec-row .prog small { display: block; color: var(--muted); font-size: .82rem; margin-bottom: 3px; }
.jump { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.jump a { flex: none; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 14px 5px 6px; font-size: .88rem; font-weight: 600; color: var(--navy); }
.jump a:hover { border-color: var(--teal); text-decoration: none; }
.jump a i { font-style: normal; background: #e2eaee; border-radius: 999px; padding: 0 8px; font-size: .8rem; direction: ltr; }
.jump a.done i { background: var(--teal); color: #fff; }
.sticky-top { position: sticky; top: 0; z-index: 20; background: var(--paper); padding: 10px 0 8px; margin-top: -10px; }
.sticky-top ~ .sec { scroll-margin-top: 70px; }
.toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 200px 170px; gap: 10px; margin-bottom: 14px; }
.photo-edit { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.photo-edit .frame { width: 132px; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: #dfe7e7; border: 1px solid var(--line); flex: none; }
.photo-edit .frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-edit .frame.wide { width: 220px; aspect-ratio: 16 / 10; }
.photo-edit .frame.wide img { object-fit: contain; background: #fff; }
.photo-edit .frame.logo { width: 110px; aspect-ratio: 1; }
.photo-edit .frame.logo img { object-fit: contain; background: #fff; padding: 8px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.q-rows { display: grid; gap: 12px; }
.q-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) 40px; gap: 10px; align-items: end; padding: 12px; background: var(--paper); border-radius: var(--radius-sm); }
.q-row .field > label { font-size: .82rem; }
.list-rows { display: grid; }
.list-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.list-row:first-child { border-top: 0; }
.list-row .n { color: var(--muted); font-weight: 700; text-align: center; }
.list-row h3 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.list-row p { color: var(--muted); font-size: .92rem; white-space: pre-line; overflow-wrap: anywhere; }
.creds { background: var(--teal-soft); border: 1px solid #a9d6cf; border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.creds h2 { font-size: 1.05rem; color: #06554c; }
.creds p { color: #06554c; font-size: .92rem; }
.creds dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 12px 0; }
.creds dt { color: #06554c; font-weight: 600; }
.creds dd { margin: 0; font-weight: 700; direction: ltr; text-align: right; font-family: Consolas, "Courier New", monospace; font-size: 1.05rem; overflow-wrap: anywhere; }
.weights-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.adm-sec-head { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.adm-sec-head .n { width: 40px; height: 34px; border-radius: 8px 8px 0 0; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; }
.adm-items { margin-top: 12px; border-top: 1px solid var(--line-soft); }
.adm-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.adm-item .n { color: var(--muted); font-weight: 700; text-align: center; font-size: .9rem; }
.adm-item p { overflow-wrap: anywhere; }
.ext-grid { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.type-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 190px; gap: 16px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.type-row:first-of-type { border-top: 0; }
.type-row > b { display: flex; align-items: center; gap: 8px; color: var(--navy); min-height: 40px; }
.mb-wrap { display: flex; align-items: center; gap: 8px; }
.mb-wrap .input { width: 96px; direction: ltr; text-align: center; }

/* ---------- النوافذ ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(13, 39, 52, .62); }
.modal.is-open { display: flex; }
.modal-box { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { font-size: 1.12rem; }
.modal-body { padding: 20px; display: grid; gap: 16px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-start; padding: 0 20px 20px; flex-wrap: wrap; }
.modal-x { border: 0; background: none; width: 38px; height: 38px; display: grid; place-items: center; color: var(--muted); border-radius: var(--radius-sm); }
.modal-x:hover { background: var(--paper); color: var(--navy); }
.modal-item { background: var(--paper); border-radius: var(--radius-sm); padding: 10px 12px; font-weight: 600; font-size: .94rem; }
.pick { border: 2px dashed #b9c6c7; border-radius: var(--radius-sm); padding: 16px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.pick.has-file { border-style: solid; border-color: var(--teal); background: #f4faf9; }
.pick-name { font-weight: 600; overflow-wrap: anywhere; }
.up-progress { display: grid; gap: 6px; }
.up-progress small { color: var(--muted); direction: ltr; text-align: right; }
.lightbox { position: fixed; inset: 0; z-index: 120; display: none; background: rgba(6, 18, 24, .93); padding: 16px; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 6px; background: #fff; }
.lightbox p { color: #fff; font-weight: 500; text-align: center; }
.lightbox-x { position: absolute; top: 14px; inset-inline-end: 14px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; display: grid; place-items: center; }
.lightbox-x:hover { background: rgba(255, 255, 255, .3); }
.toast { position: fixed; z-index: 150; bottom: 20px; inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 32px); background: var(--navy-deep); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 500; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.is-on { opacity: 1; transform: none; }
.toast.is-error { background: var(--danger); }

/* =====================================================================
   التجاوب مع الشاشات
   ===================================================================== */
@media (max-width: 1100px) {
  .teachers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-row .q-del { grid-column: 1 / -1; justify-self: end; }
  .sec-row { grid-template-columns: 34px minmax(0, 1fr) 62px auto; }
  .sec-row .prog { grid-column: 2 / -1; }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(288px, 86vw); height: 100%; z-index: 90; transform: translateX(100%); transition: transform .22s ease; }
  .side.is-open { transform: none; box-shadow: 0 0 0 100vmax rgba(13, 39, 52, .55); }
  .main-bar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 50; background: var(--navy); color: #fff; padding: 8px 14px; min-height: 56px; }
  .main-bar button { width: 42px; height: 42px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; border-radius: var(--radius-sm); display: grid; place-items: center; flex: none; }
  .main-bar strong { font-family: var(--font-head); font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .content { padding-top: 20px; }
  .sticky-top { position: static; margin-top: 0; padding: 0 0 4px; }
  .sticky-top ~ .sec { scroll-margin-top: 14px; }
  html { scroll-padding-top: 82px; }
  .login-page { grid-template-columns: 1fr; }
  .login-side { padding: 28px 22px; gap: 18px; }
  .login-side p, .login-side small { display: none; }
  .login-side img { width: 56px; height: 56px; }
  .ident-in { grid-template-columns: 120px minmax(0, 1fr); gap: 18px; }
  .ident-photo { width: 120px; }
  .ident .btn-back { grid-column: 1 / -1; justify-self: start; }
  .trio { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .search { grid-column: 1 / -1; }
  .type-row { grid-template-columns: 1fr; gap: 8px; }

  /* الجداول تتحول إلى بطاقات */
  .tbl.stack-sm thead { display: none; }
  .tbl.stack-sm, .tbl.stack-sm tbody, .tbl.stack-sm tr, .tbl.stack-sm td { display: block; width: 100%; }
  .tbl.stack-sm tr { padding: 12px 14px; border-top: 1px solid var(--line); }
  .tbl.stack-sm tbody tr:first-child { border-top: 0; }
  .tbl.stack-sm td { padding: 5px 0; border: 0; background: none !important; display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 10px; align-items: center; text-align: start; }
  .tbl.stack-sm td::before { content: attr(data-label); color: var(--muted); font-size: .84rem; font-weight: 600; }
  .tbl.stack-sm td.cell-main { grid-template-columns: 1fr; }
  .tbl.stack-sm td.cell-main::before { display: none; }
  .tbl.stack-sm .num { text-align: start; }
  .actions.tight { flex-wrap: wrap; gap: 6px; }
  .actions.tight .icon-btn { width: 40px; height: 40px; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .wrap { width: calc(100% - 28px); }
  .home-head { padding: 28px 0 18px; }
  .home-tools { grid-template-columns: 1fr; }
  .teachers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .t-info { padding: 10px 10px 12px; }
  .t-name { font-size: .93rem; }
  .brand-text small { display: none; }
  .brand { gap: 9px; }
  .brand img { width: 36px; height: 36px; }
  .brand-text strong { font-size: .9rem; }
  .topbar .btn { padding-inline: 12px; }
  .letterhead-in { grid-template-columns: 1fr auto; gap: 10px; padding: 12px 0; }
  .lh-lines, .lh-school { font-size: .78rem; line-height: 1.8; }
  .lh-logo img { width: 58px; height: 58px; }
  .lh-school { grid-column: 1 / -1; order: 3; text-align: start; border-top: 1px solid var(--line-soft); padding-top: 8px; }
  .ident-in { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 20px 0; }
  .ident-photo { width: 96px; border-width: 3px; }
  .ident-facts { gap: 8px 18px; margin-top: 10px; }
  .block { padding-top: 30px; }
  .block-title { font-size: 1.15rem; flex-wrap: wrap; gap: 4px 10px; }
  .panel, .card { padding: 16px; }
  .license { grid-template-columns: 1fr; }
  .license-img { max-width: 260px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .stats { gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 1.5rem; }
  .welcome { grid-template-columns: auto minmax(0, 1fr); padding: 16px; gap: 14px; }
  .welcome .avatar { width: 64px; height: 64px; }
  .welcome .btn { grid-column: 1 / -1; }
  .sec-head { grid-template-columns: 1fr; padding: 14px; }
  .sec-suggest { margin-inline: 14px; }
  .sec-body { padding: 4px 14px 14px; }
  .item-head { grid-template-columns: 30px minmax(0, 1fr); }
  .item-meta { grid-column: 1 / -1; justify-content: flex-start; padding-inline-start: 40px; }
  .ev-grid, .item-actions, .no-ev { padding-inline-start: 0; }
  .ev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sec-row { grid-template-columns: 34px minmax(0, 1fr) auto; row-gap: 8px; }
  .sec-row .prog { grid-column: 2 / -1; }
  .sec-row .go { grid-column: 2 / -1; justify-self: start; }
  .q-row { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .adm-sec-head { grid-template-columns: 40px minmax(0, 1fr); }
  .adm-sec-head .actions { grid-column: 1 / -1; }
  .adm-item { grid-template-columns: 24px minmax(0, 1fr); }
  .adm-item .actions { grid-column: 2; }
  .list-row { grid-template-columns: 24px minmax(0, 1fr); }
  .list-row .actions { grid-column: 2; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-box { width: 100%; border-radius: 16px 16px 0 0; max-height: 92vh; }
  .form-foot .btn { flex: 1; }
  .tbl-eval .hide-sm { display: none; }
}
@media (max-width: 380px) {
  .ev-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .tabs, .side, .main-bar, .btn, .ev-del, .site-foot, .preview-note { display: none !important; }
  body { background: #fff; }
  details.sec > .sec-body { display: block; }
}
