/* الأساس المشترك للتصاميم الجديدة (يُحمَّل بعد style.css، ولا يُحمَّل مع «الحالي»).
   المقاييس: لمس 48px، خانات 16px، نص لا يقل عن 12.5px، وتباين 4.5 فأكثر. */

body.ui {
  /* ألوان التصميم الكلاسيكي الهادئة (اختيار المدرسة 2026-11-23) */
  --teal-900: #164e4a; --teal-800: #1d5f5a; --teal-700: #23716b; --teal-600: #2b8a82; --teal-500: #3aa198; --teal-100: #e3f2f0; --teal-50: #f2f9f8;
  --bg: #f4f6f6; --card: #fff; --ink: #1f2d2c; --muted: #5f6f6d; --line: #e2e8e7; --edge: #8a9b99;
  --danger: #93271f; --warn: #704100; --ok: #15573a; --wa: #136c3b;
  --pri: var(--teal-700); --on: #fff; --soft: var(--teal-100); --soft-ink: var(--teal-900); --dark: #1d5f5a; --accent: #f2b84b; --on-accent: #2b1d00;
  --radius: 14px; --r: 10px; --shadow: none;
  --f: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  font-family: var(--f); font-size: 16px; line-height: 1.65; color: var(--ink); background: var(--bg);
}
.ui .report, .ui .cc-cert { font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif; }
.ui :focus-visible { outline: 3px solid var(--teal-500); outline-offset: 2px; }
.ui .small, .ui td.small, .ui small { font-size: 14px; }
.ui h1, .ui h2, .ui h3, .ui h4 { color: var(--ink); }
.ui .warn { color: var(--warn); }
.ui .ok, .ui .ok-text { color: var(--ok); }
.ui .gr { flex: 1; min-width: 0; }
.ui-ic { flex: none; }
[dir="ltr"] .ui-ic.ic-go { transform: scaleX(-1); }
.ui-skip { position: fixed; z-index: 120; inset-inline-start: 8px; top: -80px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; }
.ui-skip:focus { top: 8px; }
.ui main:focus { outline: 0; }

/* ---------- الأزرار ---------- */
.ui .btn, .ui .btn.sm {
  min-height: 48px; min-width: 48px; padding: 8px 18px; border-radius: var(--r); font-size: 15px; line-height: 1.4; font-weight: 700;
  background: var(--pri); color: var(--on); gap: 8px;
}
.ui .btn:hover { filter: brightness(.94); background: var(--pri); text-decoration: none; }
.ui .btn.ghost, .ui .btn.ghost:hover { background: var(--card); color: var(--soft-ink); border: 1.5px solid var(--edge); }
.ui .btn.soft, .ui .btn.soft:hover { background: var(--soft); color: var(--soft-ink); border: 0; }
.ui .btn.danger, .ui .btn.danger:hover { background: #fff; color: var(--danger); border: 1.5px solid #cf958f; }
.ui .btn.wa, .ui .btn.wa:hover { background: var(--wa); color: #fff; }
.ui .btn:disabled { opacity: .5; filter: none; }
.ui .tab-btn, .ui .as-all, .ui .bh-degs button, .ui .bh-kinds button, .ui .stat-chip { min-height: 48px; min-width: 48px; font-size: 15px; }
.ui .cc-link, .ui .chip button { min-height: 48px; min-width: 48px; color: var(--soft-ink); }
.ui .chip { min-height: 48px; font-size: 15px; }
.ui .chip button { color: var(--danger); }

/* ---------- الخانات ---------- */
.ui input, .ui select, .ui textarea { font-size: 16px; border: 1.5px solid var(--edge); border-radius: var(--r); color: var(--ink); }
.ui input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .ui select { min-height: 48px; }
.ui textarea { min-height: 88px; padding: 10px 12px; }
.ui input::placeholder, .ui textarea::placeholder { color: #56696a; opacity: 1; }
.ui input:focus, .ui select:focus, .ui textarea:focus { outline: 3px solid var(--teal-500); outline-offset: 1px; border-color: var(--teal-700); }
.ui input[type=file] { padding: 9px; max-width: 100%; }
.ui input[type=file]::file-selector-button { font: inherit; border: 0; border-radius: 8px; padding: 4px 12px; background: var(--soft); color: var(--soft-ink); }
.ui input[type=checkbox], .ui input[type=radio] { width: 22px; height: 22px; accent-color: var(--teal-700); flex: none; }
.ui label:has(> input[type=checkbox]), .ui label:has(> input[type=radio]), .ui .check { min-height: 48px; min-width: 48px; }
.ui label.check { align-items: center; }
.ui .form label { font-size: 15px; }
.ui .wa-mode-pick select, .ui .wq-mode select, .ui .bulk-bar input[type=datetime-local], .ui .hon-act input[name=reason] { font-size: 16px; padding: 8px 12px; }
.ui .wa-test input { width: 200px; max-width: 100%; }
.ui .pw-wrap input { padding-inline-end: 54px; }
.ui .pw-eye { width: 48px; height: 48px; inset-inline-end: 0; color: var(--muted); display: grid; place-items: center; }
.ui .hon-act input[name=reason] { width: 220px; }
.ui summary { cursor: pointer; min-height: 48px; padding-block: 11px; }
.ui .link-box, .ui .pf-link input { min-width: 0; }

/* ---------- الهيكل ---------- */
.ui .shell { min-height: 100vh; }
.ui .side { background: var(--card); color: var(--ink); border-inline-end: 1px solid var(--line); box-shadow: none; padding: 18px 12px; gap: 12px; width: 264px; }
.ui .brand { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ui-brand { display: flex; flex-direction: column; padding: 4px 10px; min-width: 0; }
.ui-brand b { font-size: 20px; line-height: 1.4; }
.ui-brand span { font-size: 14px; color: var(--muted); }
.ui-x { display: none; width: 48px; height: 48px; flex: none; border: 0; background: none; color: inherit; cursor: pointer; }
.ui .side nav.ui-nav { border: 0; padding: 0; gap: 4px; }
.ui .side .ui-nav a, .ui .side .ui-l, .ui .side .ui-me a {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 8px 12px; width: 100%;
  border: 0; border-radius: var(--r); background: none; color: var(--ink); font: inherit; font-size: 15.5px; font-weight: 500; opacity: 1; cursor: pointer; text-align: start;
}
.ui .side .ui-nav a:hover, .ui .side .ui-me a:hover { background: var(--teal-50); text-decoration: none; }
.ui .side .ui-nav a.on { background: var(--soft); color: var(--soft-ink); font-weight: 700; }
.ui .side .ui-l.ui-rail-more { display: none; }
.ui-admin > summary { font-size: 14px; color: var(--muted); padding: 13px 12px 5px; list-style-position: inside; }
.ui-admin-list, .ui-me-list { display: flex; flex-direction: column; gap: 2px; }
.ui .side .ui-admin-list a { justify-content: space-between; }
.ui .side .ui-me { display: block; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.ui .side .ui-me > summary { display: flex; align-items: center; gap: 10px; padding: 8px 12px; list-style: none; }
.ui .side .ui-me summary::-webkit-details-marker { display: none; }
.ui .side .ui-me summary > span { display: flex; flex-direction: column; width: auto; min-width: 0; font-size: 15px; opacity: 1; }
.ui .side .ui-me summary small { font-size: 13px; color: var(--muted); padding: 0; background: none; }
.ui .side .ui-me-list { width: auto; }
.ui .side .side-lang { margin: 4px 8px 0; }
.ui .side .side-lang a { width: auto; justify-content: center; min-width: 48px; border: 1px solid var(--line); color: var(--ink); }
.ui .side .side-lang a.on { background: var(--ink); color: #fff; }
.ui-n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; margin-inline-start: 6px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 700; }
.ui-backdrop { display: none; }
.ui-open .ui-backdrop { display: block; position: fixed; inset: 0; z-index: 79; background: rgba(12, 28, 32, .5); }
.ui-open { overflow: hidden; }
.ui-open .ui-x { display: grid; place-items: center; }

.ui .main { padding: 20px 30px 56px; }
.ui-bar { display: none; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; margin-bottom: 4px; }
.ui-bar b { font-size: 15px; color: var(--muted); font-weight: 600; }
.ui-burger { width: 48px; height: 48px; flex: none; border: 0; border-radius: var(--r); background: var(--soft); color: var(--soft-ink); cursor: pointer; }
.ui .head { align-items: center; margin-bottom: 14px; gap: 10px 16px; }
.ui .head .ui-title { flex: 1 1 280px; min-width: 0; }
.ui .head h1 { font-size: 28px; line-height: 1.4; margin: 0; font-weight: 700; }
.ui .head p { font-size: 15px; max-width: 80ch; margin: 2px 0 0; }
.ui .head-tools { flex-direction: row; align-items: center; width: auto; gap: 8px; }
.ui .week-pick { width: auto; min-width: 0; }
.ui .week-pick select { max-width: 280px; font-weight: 600; }
.ui .help-link { margin: 0; width: 48px; height: 48px; flex: none; padding: 0; display: grid; place-items: center; border-radius: 50%; font-size: 19px; background: var(--card); border: 1.5px solid var(--line); color: var(--soft-ink); }

.ui-sub { display: flex; gap: 2px; overflow-x: auto; margin-bottom: 18px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.ui-sub::-webkit-scrollbar { display: none; }
.ui-sub a { flex: none; display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; color: var(--muted); font-size: 15px; border-bottom: 3px solid transparent; }
.ui-sub a.on { color: var(--soft-ink); border-color: var(--teal-700); font-weight: 700; }
.ui-sub a:focus-visible { outline-offset: -3px; }

.ui-bottom { display: none; }
.ui-bottom a, .ui-bottom button {
  flex: 1; min-width: 0; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; background: none; color: var(--ink); font: inherit; font-size: 13px; line-height: 1.3; cursor: pointer; text-align: center;
}
.ui-bottom a:hover { text-decoration: none; }
.ui-bottom a.on { color: var(--teal-700); font-weight: 700; }
.ui-bottom span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- البطاقات والحالات ---------- */
.ui .card { box-shadow: none; border-color: var(--line); padding: 18px 20px; }
.ui .card h3 { font-size: 18px; color: var(--ink); }
.ui .flash { font-size: 15px; }
.ui .stat { box-shadow: none; }
.ui .stat b { color: var(--soft-ink); font-size: 27px; }
.ui .stat span, .ui .vs-stats .stat span, .ui .act-stat span { font-size: 14px; }
.ui .stats { gap: 12px; }
.ui .badge, .ui .tag, .ui .grade, .ui .mini, .ui .lvl, .ui .bh-tag, .ui .bh-comp-tag, .ui .cycle .who { font-size: 13px; }
.ui .badge { background: #e6ecea; color: #33494a; }
.ui .badge, .ui .mini, .ui .tag { padding: 3px 11px; border-radius: 99px; }
.ui .st-waiting, .ui .ln-expired, .ui .mini { background: #fcebc7; color: #633c00; }
.ui .st-progress { background: #dceaf7; color: #174a75; }
.ui .st-opinions { background: #e5e1f8; color: #42348a; }
.ui .st-ready, .ui .ln-active, .ui .mini.done, .ui .st-on { background: #ddf3e4; color: #14532d; }
.ui .st-sent, .ui .ln-completed { background: #d8ecf0; color: #11484f; }
.ui .st-noteachers, .ui .ln-revoked, .ui .st-off { background: #f8dfdc; color: #7c211a; }
.ui .stat-chip.st-ready, .ui .stat-chip.ln-active, .ui .stat-chip { border-radius: 99px; }
.ui .tag { color: #174a75; }
.ui .username-hint { font-size: 13px; color: #633c00; }
.ui .d-block, .ui .pick small, .ui .pick .rot, .ui .ws-chip small, .ui .cc-tm-gapline, .ui .rc-cell small, .ui .dbar-row b, .ui .nav-sep { font-size: 13px; }
.ui .hon-reason { color: #4a2f94; }
.ui .cc-stars-s, .ui .act-stars { color: #8a5a00; }
.ui .cc-stars-s span, .ui .act-stars .muted { color: #6b7775; }
.ui .wa-st { font-size: 13px; } .ui .wa-st-read { color: #174a75; } .ui .wa-st-del { color: var(--ok); } .ui .wa-st-fail { color: var(--danger); }
.ui .quick-btn, .ui .pick, .ui .faq summary, .ui .gp { min-height: 48px; }

.ui .tabs, .ui .week-tabs, .ui .bh-sorts, .ui .sig-tabs, .ui .pf-chips { gap: 8px; }
.ui .tabs a, .ui .tabs.inline a, .ui .week-tabs a, .ui .bh-sorts a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 48px; padding: 6px 16px; font-size: 15px; border: 1.5px solid var(--line);
}
.ui .tabs a.on, .ui .week-tabs a.on, .ui .tab-btn.on, .ui .bh-sorts a.on { background: var(--dark); border-color: var(--dark); color: #fff; }
.ui .bh-sorts a.on.neg { background: var(--danger); border-color: var(--danger); }
.ui .guide-toc a, .ui .lang-switch a, .ui .pf-tabs a, .ui .pager a, .ui td a:not(.btn):only-child, .ui .card > a.small, .ui .forgot a {
  display: inline-flex; align-items: center; min-height: 48px; min-width: 48px; font-size: 15px;
}
.ui .pub-lang a, .ui .head-lang a { justify-content: center; padding: 4px 14px; color: var(--ink); }
.ui .pub-lang a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ui .side-list a { min-height: 56px; align-items: center; }
.ui .list a { display: inline-block; min-height: 44px; min-width: 48px; padding-block: 10px; }

/* اختيارات على شكل أزرار */
.ui .choice span, .ui .ws-chip span, .ui .vs-lv span, .ui .pf-chip span, .ui .bh-lv span, .ui .bh-st span, .ui .as-sec span, .ui .bh-item span {
  min-height: 48px; min-width: 48px; display: inline-flex; align-items: center; justify-content: center; text-align: center; font-size: 15px; border: 1.5px solid var(--edge);
}
.ui .bh-lv span, .ui .bh-st span { display: flex; }
.ui .as-sec span { height: 48px; }
.ui .as-all { padding-inline: 12px; }
.ui .sec-chk { font-size: 15px !important; border-color: var(--edge); }
.ui .choice.g4 input:checked + span { background: #17633f; border-color: #17633f; }
.ui .choice.g2 input:checked + span { background: #704f00; border-color: #704f00; }
.ui .choice.g3 input:checked + span { background: #1d4f8a; border-color: #1d4f8a; }
.ui .choice.g1 input:checked + span { background: #93271f; border-color: #93271f; }
.ui .choices legend, .ui .note-field { font-size: 14px; }
.ui input:focus-visible + span { outline: 3px solid var(--teal-500); outline-offset: 2px; }
.ui .bh-irow { min-height: 56px; }
.ui .sticky-save { background: var(--bg); z-index: 8; }
.ui .eval-student.ui-folded > :not(h3):not(.ui-fold) { display: none; }
.ui .eval-student > .ui-fold { margin-bottom: 8px; }

/* ---------- القوائم والجداول ---------- */
.ui th { background: transparent; color: var(--muted); font-size: 14px; }
.ui td { font-size: 15px; }
.ui table.compact th, .ui table.compact td { font-size: 14px; padding: 9px 8px; }
.ui th.chk, .ui td.chk { width: 56px; padding: 0; }
.ui .ui-hit { width: 48px; height: 48px; min-width: 48px; display: inline-grid; place-items: center; cursor: pointer; }
.ui .stat-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.ui .stat-filters > * { flex: none; }

.ui .filter-bar { background: none; border: 0; padding: 0; gap: 8px; }
.ui .filter-bar input[type=search] { flex: 1 1 180px; min-width: 0; max-width: none; }
.ui .filter-bar .ui-ftoggle { flex: none; }
.ui .filter-bar:not(.ui-fopen) select { display: none; }
.ui .filter-bar select { max-width: none; flex: 1 1 190px; order: 5; }
.ui .filter-bar .f-count { font-size: 14px; margin-inline-start: auto; }

.ui .bulk-bar {
  position: sticky; top: 0; z-index: 25; background: var(--card); color: var(--ink);
  border: 1.5px solid var(--edge); border-radius: var(--radius); padding: 10px 12px; gap: 8px;
}
.ui .bulk-bar.ui-idle { display: none; }
.ui .bulk-bar [data-sel-count] { color: var(--ink); font-size: 15px; }
.ui-more > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; min-width: 48px; padding: 8px 14px; border: 1.5px solid var(--edge); border-radius: var(--r); background: var(--card); color: var(--soft-ink); font-size: 15px; font-weight: 700; white-space: nowrap; }
.ui-more > summary::-webkit-details-marker { display: none; }
.ui-more[open] { flex-basis: 100%; }
.ui-more-in { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 8px; }
.ui-more-in > .btn.danger, .ui-more-in > form:has(.btn.danger) { margin-inline-start: auto; }
.ui td.actions { white-space: normal; }
.ui td.actions > .ui-more { display: inline-block; }
.ui td.actions > .ui-more[open] { display: block; }

.ui [data-item].ui-cut { display: none; }
.ui-showmore { display: flex; margin: 14px auto 4px; }
.ui tr.ui-group th { background: none; border: 0; color: var(--ink); font-size: 17px; padding: 22px 4px 8px; }
.ui-group-n { color: var(--muted); font-weight: 500; }
.ui .ui-exp { display: none; }

/* صف مختصر في الجوال: الاسم والحالة، والتفاصيل عند اللمس */
@media screen and (max-width: 640px) {
  .ui table.rtable tr { box-shadow: none; border-radius: var(--radius); padding: 6px 12px; }
  .ui table.rtable td::before { font-size: 13px; }
  .ui table.ui-compact > tbody > tr[data-item] { position: relative; padding: 6px 12px; min-height: 64px; }
  .ui table.ui-compact > tbody > tr[data-item] > td { border: 0; padding: 4px 0; }
  .ui table.ui-compact > tbody > tr[data-item]:not(.ui-row-open) > td:not(.ui-c-title):not(.ui-c-state):not(.chk) { display: none; }
  .ui table.ui-compact > tbody > tr[data-item] > td.chk { position: absolute; top: 7px; inset-inline-start: 4px; width: 48px; padding: 0; }
  .ui table.ui-compact.ui-has-chk > tbody > tr[data-item] > td:not(.chk) { padding-inline-start: 46px; }
  .ui table.ui-compact > tbody > tr[data-item] > td.ui-c-title { padding-inline-end: 52px; min-height: 48px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
  .ui table.ui-compact > tbody > tr[data-item] > td.ui-c-title::before,
  .ui table.ui-compact > tbody > tr[data-item]:not(.ui-row-open) > td.ui-c-state::before { display: none; }
  .ui table.ui-compact .ui-exp {
    display: grid; place-items: center; position: absolute; top: 7px; inset-inline-end: 2px; width: 48px; height: 48px; min-width: 48px;
    border: 0; background: none; color: var(--soft-ink); font: inherit; font-size: 22px; cursor: pointer;
  }
  .ui .ui-row-open .ui-exp { transform: rotate(180deg); }
}

/* جدول أعرض من الجوال ولا يتحول بطاقات */
.ui .table-wrap { max-width: 100%; }
.ui.ui-editing .main > .card:has(#students-table), .ui.ui-editing .main > .card:has(#users-table), .ui.ui-editing .main > .card:has(#import) { display: none; }

/* أقسام الصفحات الطويلة */
.ui-index { display: flex; gap: 8px; overflow-x: auto; position: sticky; top: 0; z-index: 12; background: var(--bg); padding-block: 8px; margin-bottom: 8px; scrollbar-width: none; }
.ui-index button, .ui-index a {
  flex: none; min-height: 48px; min-width: 48px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line); border-radius: 99px; background: var(--card); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer;
}
.ui-index .on { background: var(--dark); border-color: var(--dark); color: #fff; }
.ui .ui-sec-off { display: none !important; }

/* ---------- الرئيسية ---------- */
.ui-two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 18px; }
.ui-two > :only-child { grid-column: 1 / -1; }
.ui-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ui .ui-panel > h2 { font-size: 18px; margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ui-row { display: flex; align-items: center; gap: 13px; min-height: 72px; padding: 11px 18px; border-bottom: 1px solid var(--line); color: var(--ink); }
.ui-row:last-child { border-bottom: 0; }
.ui-row:hover { text-decoration: none; }
a.ui-row:hover { background: var(--teal-50); }
.ui-row .gr { display: flex; flex-direction: column; }
.ui-row b { line-height: 1.5; }
.ui-row small { color: var(--muted); line-height: 1.5; }
.ui-mark { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: var(--r); background: var(--soft); color: var(--soft-ink); }
.ui-meter { height: 7px; border-radius: 9px; background: #e2eae8; overflow: hidden; margin-top: 7px; }
.ui-meter i { display: block; height: 100%; background: var(--bar, var(--teal-700)); }
.ui-none { padding: 22px 18px; margin: 0; color: var(--muted); }

.ui-steps { list-style: none; margin: 0; padding: 0; display: flex; }
.ui-steps li { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ui-steps li:not(:last-child)::after { content: ''; position: absolute; top: 21px; inset-inline-start: 50%; width: 100%; height: 3px; background: #4a6873; }
.ui-steps .dot { position: relative; z-index: 1; width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #31505d; color: #fff; }
.ui-steps .done .dot { background: #8ed3a8; color: #0e3b21; }
.ui-steps .now .dot { background: var(--accent); color: var(--on-accent); }
.ui-steps .txt { display: flex; flex-direction: column; line-height: 1.4; max-width: 100%; }
.ui-steps .txt b { font-size: 14px; }
.ui-steps .txt small { font-size: 13px; color: #c6d6db; unicode-bidi: isolate; }

.ui-next { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--accent); color: var(--on-accent); border-radius: var(--radius); padding: 14px 18px; }
.ui-next .gr { flex: 1 1 180px; display: flex; flex-direction: column; line-height: 1.5; }
.ui-next .gr span { font-size: 14px; }
.ui-next .gr b { font-size: 20px; }
.ui .ui-next .btn, .ui .ui-next .btn:hover { background: var(--dark); color: #fff; }
.ui-next.is-done { background: #ddf3e4; color: #14532d; }

/* ---------- الدخول والصفحات العامة ---------- */
.ui .auth-box { border: 1px solid var(--line); box-shadow: none; padding: 28px; margin: 7vh auto; }
.ui .auth-box h1 { color: var(--ink); font-size: 24px; }
.ui .auth-box > p.muted { font-size: 16px; font-weight: 600; }
.ui .public-head h1, .ui .public-head p { color: #fff; opacity: 1; }
.ui .forgot summary { color: var(--soft-ink); font-size: 15px; }
.ui.cc-page { background: var(--bg); }
.ui .cc-card { box-shadow: none; border: 1px solid var(--line); }
.ui .cc-trophy { display: none; }
.ui .cc-head { margin: 2px 0 10px; }
.ui .cc-head h1 { color: var(--ink); }
.ui .cc-nid { font-size: 22px; }
.ui .cc-periods { display: grid; grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)); gap: 5px; }
.ui .cc-p { width: auto; height: 48px; border: 1.5px solid var(--edge); border-radius: 10px; }
.ui .cc-p.on { border-color: var(--dark); }
.ui .cc-p.off { opacity: .45; }
.ui .cc-tabs a { min-height: 48px; display: flex; align-items: center; justify-content: center; }
.ui .cc-tile small { font-size: 13px; color: var(--warn); }
.ui .cc-tile.done small { color: var(--ok); }
.ui .cc-tile.other small { color: var(--muted); }
.ui .cc-crit-val { font-size: 13px; }
.ui .cc-guide-t td { font-size: 14px; }

/* هوية التقرير تبقى، ويتحسّن التباين على الشاشة فقط */
@media screen {
  .ui .rp-info dt { color: #3f5553; font-size: 13px; }
  .ui .rp-intro { color: #3f5553; }
  .ui .rp-closing { color: #2f5c38; }
  .ui .rp-foot-bar span { color: #102d37; text-shadow: none; font-weight: 700; font-size: 14px; }
  .ui .rp-table td, .ui .rp-table th { font-size: 13px; }
  .ui .rp-titleband span, .ui .rp-school { font-size: 14px; }
  .ui .an-kpi em, .ui .rc-kpi span, .ui .rc-kpi small, .ui .an-legend { color: #3f5553; font-size: 13px; }
  .ui .an-trend .axis, .ui .rc-chart .rc-axis { fill: #3f5553; font-size: 12px; }
  .ui .rp-titleband h1, .ui .rp-table th, .ui .an-table th { color: #fff; }
  .ui .an-table td, .ui .obs p { font-size: 14px; }
}

/* ---------- لوحة مدير المنصة ---------- */
.ui.pf-page .pf-wrap { max-width: 1240px; padding: 12px 16px 48px; }
.ui .pf-top { background: var(--dark); border-radius: var(--radius); padding: 14px 16px; }
.ui .pf-top h1 { color: #fff; }
.ui .pf-top small { opacity: 1; color: #d7e3e7; }
.ui .pf-tabs { min-width: 0; max-width: 100%; }
.ui .pf-tabs a { color: #fff; padding: 4px 14px; }
.ui .pf-tabs a.on { background: #fff; color: var(--dark); font-weight: 700; }
.ui .pf-mini { color: var(--muted); font-size: 13px; }
.ui .pf-feat, .ui .pf-plan { min-height: 48px; }
.ui.pf-page .table-wrap:not(:has(table.rtable)) { overflow-x: auto; }

/* ---------- المقاسات: 1100 و700 و480 ---------- */
@media (max-width: 1099px) {
  .ui-two { grid-template-columns: minmax(0, 1fr); }
  .ui .main { padding: 16px 18px 56px; }
  .ui .head h1 { font-size: 25px; }
}
@media (max-width: 699px) {
  .ui .main { padding: 6px 14px 40px; }
  .ui.ui-has-bottom .main { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .ui .head { flex-wrap: wrap; align-items: center; }
  .ui .head .ui-title { flex: 1 1 100%; }
  .ui .head h1 { font-size: 22px; padding: 0; }
  .ui .head p { display: none; }
  .ui .head-tools { width: 100%; }
  .ui .week-pick { flex: 1; }
  .ui .week-pick select { width: 100%; max-width: none; }
  .ui .card { padding: 14px; }
  .ui .stats, .ui .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ui .stat { padding: 12px; }
  .ui .stat b { font-size: 23px; }
  .ui .ui-next .btn { width: 100%; }
  .ui-row { padding: 10px 12px; gap: 10px; }
  .ui-todo .ui-row .ui-mark { display: none; }
  .ui .pf-tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; }
  .ui .pf-tabs a { flex: none; }
  .ui .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ui .tabs > * { flex: none; }
  .ui .bulk-bar .wa-mode-pick { width: 100%; }
  .ui .auth-box { margin: 5vh 16px; padding: 22px 18px; }
  .ui .pf-link input { flex-basis: 100%; }
}
@media (max-width: 480px) {
  .ui .head { row-gap: 6px; }
  .ui-steps .dot { width: 40px; height: 40px; }
  .ui-steps li:not(:last-child)::after { top: 19px; }
  .ui-steps .txt b { font-size: 12.5px; }
  .ui .bh-levels { grid-template-columns: 1fr 1fr; }
  .ui .cc-tm-days { grid-template-columns: 1fr 1fr; }
  .ui .side-list { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ui *, .ui *::before, .ui *::after { transition: none !important; animation-duration: .01ms !important; }
}

/* ملفات التصميم media="screen"، فالورق يبقى على style.css وحده. وهذا احتياط */
@media print {
  body.ui { font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif; font-size: 11pt; background: #fff; }
  .ui .side, .ui-bar, .ui-sub, .ui-bottom, .ui-backdrop, .ui-skip, .ui-preview, .ui-showmore, .ui-index, .ui-ftoggle, .ui-exp { display: none !important; }
  .ui [data-item].ui-cut:not([hidden]) { display: table-row !important; }
  .ui .ui-sec-off { display: block !important; }
  .ui .shell { display: block !important; }
  .ui .main { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  body.ui:not(:has(.report)):not(:has(.cc-cert)) .main { padding: 10mm !important; }
}

/* ---------- تصحيحات الفحص على 320 وما فوق ---------- */
.ui input, .ui select, .ui textarea, .ui fieldset { max-width: 100%; }
.ui fieldset, .ui .form > *, .ui .grid2 > *, .ui .row > *, .ui label { min-width: 0; }
.ui .form label > input:not([type=checkbox]):not([type=radio]), .ui .form label > select { width: 100%; }
.ui .form.grid2, .ui .grid2.form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ui .as-block-head select { min-width: 0; }
.ui .cc-tm-days { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ui .cc-tm-days input, .ui .cc-tm-grid input { width: 100%; }
.ui .cc-tv-code { width: 100%; max-width: 320px; font-size: 34px; }
.ui .ui-c-title > a { display: inline-flex; align-items: center; min-height: 48px; }
.ui .cc-theme a.small { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; min-width: 48px; }
.ui .tip-card > span { background: #3f6b47; }
.ui .rubric th { background: transparent; }
@media screen {
  /* th الشفاف للجداول العادية لا يمس جداول التقرير */
  .ui .rp-table th, .ui .an-table th { background: #173643; color: #fff; }
  .ui .an-report { --q3: #1f67c2; }
}
@media (max-width: 1099px) {
  .ui .cc-tm-days { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 699px) {
  .ui .form.grid2, .ui .grid2.form { grid-template-columns: minmax(0, 1fr); }
  .ui .row > .link-box { flex: 1 1 100%; }
  .ui .cc-card { padding: 14px 12px; }
  .ui .cc-periods { grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 3px; }
  .ui .card-head > form.row > input { flex: 1 1 100%; }
}
@media (max-width: 480px) {
  .ui .cc-tm-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ui .card-head > * { min-width: 0; max-width: 100%; }
@media screen {
  .ui .rp-table th .muted, .ui .an-table th .muted { color: #d7e3e7; }
  .ui .obs-info i { background: #1f67c2; }
}
.ui .as-block-head { flex-wrap: wrap; }
.ui .as-block-head select { flex: 1 1 150px; width: 100%; }
@media (max-width: 1099px) { .ui .as-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 380px) { .ui .as-row, .ui .as-block { padding: 8px; } .ui .as-stage-name { width: 100%; } }

/* ---------- المراجعة البصرية ---------- */
@media (min-width: 1100px) {
  .ui td.actions { white-space: nowrap; }
  .ui td.actions > .ui-more { margin-inline-start: 6px; }
}
@media screen and (min-width: 641px) {
  .ui table:not(.ui-fit) > tbody > tr > td.actions { display: table-cell; vertical-align: middle; }
  .ui table:not(.ui-fit) > tbody > tr > td.actions > :not([hidden]):not(.ui-more[open]) { margin: 3px; }
  .ui table:not(.ui-fit) > tbody > tr > td.actions > form:not([hidden]) { display: inline-block; }
}
@media screen and (min-width: 641px) {
  .ui table.ui-fit, .ui table.ui-fit > tbody { display: block; width: 100%; }
  .ui table.ui-fit > thead { display: block; }
  .ui table.ui-fit > thead th:not(.chk) { display: none; }
  .ui table.ui-fit > thead th.chk { display: inline-block; width: 52px; border: 0; }
  .ui table.ui-fit > tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
  .ui table.ui-fit > tbody > tr { display: block; position: relative; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); min-width: 0; }
  .ui table.ui-fit > tbody > tr[hidden], .ui table.ui-fit > tbody > tr.ui-cut { display: none; }
  .ui table.ui-fit > tbody > tr > td { display: block; width: auto; border: 0; padding: 3px 0; background: none; white-space: normal; overflow-wrap: anywhere; text-align: start; }
  .ui table.ui-fit > tbody > tr > td[data-label]:not([data-label=""])::before { content: attr(data-label) ' '; display: inline-block; min-width: 96px; margin-inline-end: 6px; color: var(--muted); font-size: 13px; }
  .ui table.ui-fit > tbody > tr > td:first-child:not(.chk), .ui table.ui-fit > tbody > tr > td.ui-c-title { font-size: 17px; }
  .ui table.ui-fit > tbody > tr > td:first-child:not(.chk)::before, .ui table.ui-fit > tbody > tr > td.ui-c-title::before, .ui table.ui-fit > tbody > tr > td.actions::before { display: none; }
  .ui table.ui-fit > tbody > tr > td.chk { position: absolute; top: 8px; inset-inline-end: 8px; width: 48px; }
  .ui table.ui-fit.ui-has-chk > tbody > tr > td.ui-c-title { padding-inline-end: 52px; }
  .ui table.ui-fit > tbody > tr > td.actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
  .ui table.ui-fit input:not([type=checkbox]):not([type=radio]), .ui table.ui-fit select { width: 100%; }
}
.ui .ui-stepnav { background: var(--bg); padding: 8px; border-radius: 22px; }
.ui .ui-stepnav .btn:disabled { opacity: 1; background: #d5dfe3; color: #33464e; cursor: not-allowed; }
.ui.public:has(> .auth-box), .ui.pf-page:has(> .auth-box) { background: linear-gradient(var(--dark) 0 250px, var(--bg) 250px); background-repeat: no-repeat; background-color: var(--bg); min-height: 100vh; }
@media (max-width: 699px) {
  .ui .head:not(:has(.week-pick)) .ui-title { flex: 1 1 0; }
  .ui .head:not(:has(.week-pick)) .head-tools { width: auto; }
  .ui .pf-stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .ui-bottom a, .ui-bottom button { font-size: 12.5px; }
  .ui-bottom span { white-space: normal; }
}
@media (max-width: 699px) {
  .ui .row > input.grow { flex: 1 1 100%; }
}

/* شاشة تأكيد واتساب */
@media screen { .ui .vf-box .btn { display: flex; align-items: center; justify-content: center; } }

/* شؤون المعلمين: تباين مستوى «متميز» */
@media screen { .ui .vs-lv.l4 input:checked + span { background: #17703f; border-color: #17703f; } }

/* ---------- مراجعة التصميم 2026-11-23 ---------- */
/* لا صف أزرار يُقص بلا وسيلة للوصول إليه:
   من 700 فأكثر تنزل الأزرار لسطر جديد، وفي الجوال صف واحد بشريط تمرير ظاهر يُسحب (بلا أسطر كثيرة تملأ الشاشة) */
@media (min-width: 700px) {
  .ui .tabs, .ui .pf-tabs, .ui .stat-filters, .ui-index, .ui-sub { flex-wrap: wrap; overflow-x: visible; }
  .ui .tabs > *, .ui .pf-tabs a, .ui .stat-filters > *, .ui-index button, .ui-index a, .ui-sub a { flex: 0 1 auto; max-width: 100%; white-space: normal; text-align: center; }
  .ui-sub { row-gap: 0; }
  .ui-index { position: static; }
}
@media (max-width: 699px) {
  .ui .tabs, .ui .pf-tabs, .ui .stat-filters, .ui-index, .ui-sub {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 8px;
    scrollbar-width: thin; scrollbar-color: var(--edge) transparent;
  }
  .ui .tabs::-webkit-scrollbar, .ui .pf-tabs::-webkit-scrollbar, .ui .stat-filters::-webkit-scrollbar, .ui-index::-webkit-scrollbar, .ui-sub::-webkit-scrollbar { display: block; height: 6px; }
  .ui .tabs::-webkit-scrollbar-thumb, .ui .pf-tabs::-webkit-scrollbar-thumb, .ui .stat-filters::-webkit-scrollbar-thumb, .ui-index::-webkit-scrollbar-thumb, .ui-sub::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 99px; }
  .ui .tabs > *, .ui .pf-tabs a, .ui .stat-filters > *, .ui-index button, .ui-index a, .ui-sub a { flex: none; white-space: nowrap; }
  .ui .tabs a, .ui .tabs.inline a, .ui-index button, .ui-index a { padding-inline: 12px; font-size: 14px; }
}


/* حقل الشعار لا يوسّع الصفحة في الجوال */
.ui .logo-row > * { min-width: 0; flex: 1 1 220px; }
.ui .logo-row > .logo-preview { flex: none; }
.ui input[type=file] { width: 100%; }

/* شريط «حفظ وإرسال» فوق الشريط السفلي لا تحته */
@media (max-width: 699px) {
  .ui-blend .sticky-save, .ui-calm .sticky-save { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}
.ui-plaza .sticky-save { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }

/* تقييم الأداء: خانات التقدير بمقاس اللمس */
.ui .pf-lv span { min-width: 48px; min-height: 48px; }

/* حلقة التركيز واضحة على الخلفيات الداكنة والصفراء */
.ui-path .side :focus-visible, .ui-path .ui-bar :focus-visible, .ui-path .ui-burger:focus-visible { outline-color: var(--accent); }
.ui .ui-next :focus-visible { outline-color: var(--dark); }

/* اسم الشريط السفلي في سطرين بدل قصّه */
.ui-bottom span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* نقطة الفصل «•» تشبه الصفر العربي في بعض الخطوط: تؤخذ من خط النظام */
@font-face { font-family: 'UiBullet'; src: local('Segoe UI'), local('Helvetica Neue'), local('Helvetica'), local('Arial'), local('Roboto'); unicode-range: U+2022; }
body.ui, body.ui-blend, body.ui-calm, body.ui-path, body.ui-plaza { font-family: 'UiBullet', var(--f); }

/* الشريط السفلي في الساحة بخط أضيق في الجوال الصغير */
@media (max-width: 360px) { .ui-plaza .ui-bottom a, .ui-plaza .ui-bottom button { padding-inline: 2px; font-size: 12.5px; } .ui-plaza .ui-bottom span { hyphens: auto; overflow-wrap: anywhere; } }

/* لغة صفحة الدخول فوق الترويسة الداكنة: المختارة بيضاء والأخرى شفافة */
.ui.public:has(> .auth-box) .pub-lang a, .ui.pf-page:has(> .auth-box) .pub-lang a { background: transparent; border-color: rgba(255,255,255,.7); color: #fff; }
.ui.public:has(> .auth-box) .pub-lang a.on, .ui.pf-page:has(> .auth-box) .pub-lang a.on { background: #fff; border-color: #fff; color: var(--dark); }

/* آراء الموجه والوكيل في الجوال */
@media (max-width: 480px) { .ui .op-mine li { flex-direction: column; align-items: stretch; } }
.op-also-list small { white-space: nowrap; }

/* ==================== مراجعة التصميم 2026-11-28 ==================== */
/* الفلاتر ظاهرة مباشرة من 700px، وزر «تصفية» للجوال فقط */
@media (min-width: 700px) {
  .ui .filter-bar .ui-ftoggle { display: none; }
  .ui .filter-bar:not(.ui-fopen) select { display: block; }
}
/* خطوات الأسبوع: نقاط وخط ظاهران على الخلفية الداكنة */
.ui-steps li:not(:last-child)::after { background: rgba(255, 255, 255, .55); }
.ui-steps .dot { background: var(--teal-100); color: var(--teal-900); }
/* الزر المعطّل بلون اللوحة */
.ui .ui-stepnav .btn:disabled { background: #e3e9e8; color: #3f4f4d; }
/* النجوم الفارغة 3:1 */
body.ui .cc-stars label { color: #8a9b99; }
/* رأس أقصر في الجوال: زر المساعدة بحجمه لا صفاً كاملاً */
@media (max-width: 699px) {
  .ui .help-link { display: inline-flex; width: auto; align-self: flex-start; }
}
/* سهم الصف يدور بانتقال */
.ui tr .ui-rowtoggle, .ui .ui-row-toggle { transition: transform var(--dur, .18s) var(--ease, ease); }
