:root {
  --navy: #0f1f3d;
  --navy-ink: #0a1628;
  --navy-2: #16294e;
  --gold: #b8863d;
  --gold-bg: #f7efdf;
  --gold-ink: #6b4a17;
  --red: #c33a2e;
  --red-bg: #fbeae8;
  --red-ink: #8f2a20;
  --ok: #1d7a4f;
  --ok-bg: #e8f5ee;
  --ok-ink: #155c3b;
  --warn: #b07d10;
  --bad: #c33a2e;
  --paper: #f5f6f8;
  --ink: #1b2130;
  --slate: #5b6478;
  --slate-2: #8891a3;
  --line: #e4e7ec;
  --line-2: #eef0f3;
  --shadow: 0 1px 2px rgba(15, 31, 61, 0.04), 0 6px 20px rgba(15, 31, 61, 0.06);
  --font: "Dubai", "Segoe UI", "Noto Kufi Arabic", Tahoma, Arial, sans-serif;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}
.num {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
::selection {
  background: var(--gold-bg);
  color: var(--gold-ink);
}

/* ---------- الترويسة ---------- */
header {
  background: var(--navy);
  color: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 3px solid var(--gold);
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand .seal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--navy-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.brand .seal::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid var(--gold);
}
.brand .seal svg {
  width: 18px;
  height: 18px;
  stroke: var(--gold);
  fill: none;
  stroke-width: 1.6;
}
.brand h1 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.brand small {
  display: block;
  font-size: 11px;
  color: #a9b7d4;
  font-weight: 400;
  margin-top: 2px;
}
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.badge-file {
  font-size: 12px;
  color: #cdd8ee;
  background: var(--navy-2);
  padding: 7px 14px;
  border: 1px solid #2a3f6b;
  border-radius: 8px;
  display: none;
  align-items: center;
  gap: 8px;
  max-width: 240px;
}
.badge-file span:not(.dot) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-file .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .badge-file .dot {
    animation: none;
  }
}

@media (max-width: 640px) {
  header {
    padding: 12px 16px;
  }
  .brand h1 {
    font-size: 15px;
  }
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ---------- منطقة الرفع ---------- */
.dropzone {
  background: #fff;
  border: 2px dashed #c3cad9;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover,
.dropzone.over {
  border-color: var(--gold);
  background: var(--gold-bg);
}
.dropzone svg {
  width: 42px;
  height: 42px;
  stroke: var(--navy);
  margin-bottom: 10px;
}
.dropzone h2 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--navy-ink);
}
.dropzone p {
  color: var(--slate);
  font-size: 12.5px;
  margin-bottom: 10px;
}
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
}
.uc-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}
.uc-hint {
  font-size: 11px;
  color: var(--slate);
  margin-top: 12px;
  line-height: 1.5;
}
@media (max-width: 640px) {
  .upload-grid {
    grid-template-columns: 1fr;
  }
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--navy);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 8px;
  transition: transform 0.15s, background 0.2s, box-shadow 0.15s;
}
.btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}
.btn:hover {
  background: var(--navy-ink);
  box-shadow: var(--shadow);
}
.btn.ghost {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--line);
}
.btn.ghost:hover {
  background: var(--surface, #fff);
  border-color: var(--navy-2);
  color: var(--navy-ink);
}
.btn.accent {
  background: var(--gold);
  color: #fff;
}
.btn.accent:hover {
  background: var(--gold-ink);
}
.hint {
  font-size: 11.5px;
  color: var(--slate);
  margin-top: 14px;
}
input[type="file"] {
  display: none;
}

/* ---------- شريط المؤشرات ---------- */
.kpis {
  display: grid;
  grid-template-columns: 1.25fr 1.25fr repeat(6, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.kpi {
  background: #fff;
  padding: 16px 16px 14px;
  border-top: 3px solid var(--navy);
}
.kpi .v {
  font-size: 22px;
  font-weight: 400;
  color: var(--navy-ink);
  line-height: 1.1;
  font-family: var(--font);
}
.kpi.primary .v {
  font-size: 32px;
  font-weight: 300;
}
.kpi .l {
  font-size: 11px;
  color: var(--slate);
  margin-top: 6px;
  letter-spacing: 0.02em;
}
.kpi.alert {
  background: var(--red-bg);
  border-top-color: var(--red);
}
.kpi.alert .v {
  color: var(--red-ink);
}
.kpi.alert .l {
  color: var(--red-ink);
  opacity: 0.8;
}
.kpi.gold {
  border-top-color: var(--gold);
  background: var(--gold-bg);
}
.kpi.gold .v {
  color: var(--gold-ink);
}
.kpi.gold .l {
  color: var(--gold-ink);
  opacity: 0.8;
}
.kpi.red {
  border-top-color: var(--red);
}
@media (max-width: 900px) {
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- التنقّل: مجموعات + ألسنة فرعية ---------- */
.nav-groups {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.nav-group {
  flex: 1;
  text-align: center;
  padding: 11px 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--slate);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.nav-group .ng-sub {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  margin-top: 2px;
  opacity: 0.7;
}
.nav-group.active {
  color: var(--navy-ink);
  border-color: var(--navy-2);
  box-shadow: var(--shadow);
}
.nav-group:hover:not(.active) {
  border-color: var(--slate-2);
}
.nav-group:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.tab {
  background: transparent;
  border: none;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
  padding: 8px 14px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.tab:hover {
  color: var(--navy-ink);
  background: var(--line-2);
}
.tab.active {
  color: var(--navy-ink);
  background: var(--gold-bg);
}
.tab:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.panels {
  padding-top: 0;
}
.panel {
  display: none;
}
.panel.active {
  display: block;
  animation: fadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .panel.active {
    animation: none;
  }
}

/* ---------- الشبكات والبطاقات ---------- */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--navy-ink);
  letter-spacing: 0.01em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card h3 .tag {
  font-size: 11px;
  color: var(--slate);
  font-weight: 400;
  letter-spacing: 0;
}

/* أشرطة بيانية */
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12.5px;
}
.bar-row .name {
  width: 64px;
  color: var(--ink);
  font-weight: 500;
  flex-shrink: 0;
}
.bar-row .track {
  flex: 1;
  background: var(--line-2);
  border-radius: 4px;
  height: 20px;
  position: relative;
  overflow: hidden;
}
.bar-row .fill {
  height: 100%;
  background: var(--navy);
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-row .fill.red {
  background: var(--red);
}
.bar-row .fill.gold {
  background: var(--gold);
}
@media (prefers-reduced-motion: reduce) {
  .bar-row .fill {
    transition: none;
  }
}
.bar-row .val {
  width: 34px;
  text-align: left;
  font-weight: 500;
  color: var(--navy-ink);
}

/* الجداول */
.tbl-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  background: #fff;
}
thead th {
  background: var(--navy);
  color: #eef2fb;
  padding: 10px 12px;
  text-align: right;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
  white-space: nowrap;
}
tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
tbody tr:nth-child(even) {
  background: #fbfbfc;
}
tbody tr:hover {
  background: var(--gold-bg);
}
td.na {
  color: var(--red);
  font-weight: 500;
}

/* التنبيهات */
.alert {
  border-inline-start: 3px solid var(--ok);
  background: #fff;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
  font-size: 13px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-inline-end: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.alert.bad {
  border-inline-start-color: var(--bad);
}
.alert.warn {
  border-inline-start-color: var(--warn);
}
.alert .t {
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--navy-ink);
}
.alert .d {
  color: var(--slate);
  font-size: 12px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  margin-inline-start: 6px;
}
.pill.ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
}
.pill.bad {
  background: var(--red-bg);
  color: var(--red-ink);
}
.pill.warn {
  background: var(--gold-bg);
  color: var(--gold-ink);
}

/* صفوف التعارض (بطاقات بشريط شدّة) */
.conflict-list {
  max-height: 560px;
  overflow: auto;
}
.conflict {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--red);
  border-radius: 10px;
  margin-bottom: 9px;
  background: #fff;
}
.conflict.note {
  border-inline-start-color: var(--gold);
}
.conflict .c-main {
  flex: 1;
  min-width: 0;
}
.conflict .c-who {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--navy-ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.conflict .c-detail {
  font-size: 12.5px;
  color: var(--slate);
  line-height: 1.6;
}
.conflict .c-detail b {
  color: var(--ink);
  font-weight: 500;
}
.conflict .c-when {
  font-size: 11.5px;
  color: var(--slate-2);
  white-space: nowrap;
  padding-top: 2px;
  flex-shrink: 0;
}

/* شريط الأدوات فوق الجداول */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.search {
  flex: 1;
  min-width: 220px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  background: var(--paper);
  color: var(--ink);
}
.search:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
}

footer {
  text-align: center;
  color: var(--slate);
  font-size: 11.5px;
  padding: 24px;
  border-top: 1px solid var(--line);
}
.hidden {
  display: none !important;
}

/* الجدول الأسبوعي — خلية = بطاقة: رمز وشعبة، ثم اسم المقرر، ثم القاعة والمحاضر */
.tt-scroll {
  overflow-x: auto;
}
.tt {
  border-collapse: collapse;
  width: 100%;
  min-width: 1180px;
  font-size: 11.5px;
  table-layout: fixed;
}
.tt th {
  background: var(--navy);
  color: #fff;
  padding: 8px 4px;
  font-weight: 500;
  border: 1px solid #24365e;
}
.tt th.pcol {
  width: 82px;
}
.tt td {
  border: 1px solid var(--line);
  padding: 4px;
  min-height: 44px;
  vertical-align: top;
  text-align: center;
}
.tt td.day {
  background: var(--paper);
  font-weight: 500;
  color: var(--navy-ink);
  width: 70px;
  vertical-align: middle;
  font-size: 12.5px;
}
.tt .cell {
  background: #eef3fb;
  border-radius: 6px;
  padding: 4px 5px 3px;
  margin: 2px 0;
  line-height: 1.45;
  text-align: right;
}
.tt .cell .hd {
  display: flex;
  justify-content: center;
  align-items: baseline;
}
.tt .cell b {
  color: var(--navy-ink);
  font-size: 11.5px;
  font-weight: 500;
}
.tt .cell .rm {
  color: var(--slate);
  font-size: 9.5px;
  display: block;
  text-align: center;
}
.pl-note {
  width: 100%;
  min-width: 130px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 11.5px;
  background: #fff;
  color: var(--ink);
}
.pl-note:focus {
  outline: 2px solid var(--gold);
  outline-offset: 0;
  border-color: var(--gold);
}
.tt .cell.prac {
  background: var(--gold-bg);
}
.tt .cell.online {
  background: var(--line-2);
  color: var(--slate);
}
/* تلوين حسب الشطر: طلاب أزرق / طالبات وردي — العملي أفتح من النظري */
.tt .cell.m-theo {
  background: #c3d6f5;
}
.tt .cell.m-prac {
  background: #e8f1fc;
}
.tt .cell.f-theo {
  background: #f4bfd6;
}
.tt .cell.f-prac {
  background: #fbe9f2;
}
.tt-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--slate);
}
.tt-legend .sw {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  margin-left: 5px;
  vertical-align: -2px;
  border: 1px solid var(--line);
}
.tt-legend .sw.m-theo {
  background: #c3d6f5;
}
.tt-legend .sw.m-prac {
  background: #e8f1fc;
}
.tt-legend .sw.f-theo {
  background: #f4bfd6;
}
.tt-legend .sw.f-prac {
  background: #fbe9f2;
}
.tt-legend .sw.online {
  background: var(--line-2);
}

/* المقارنة والخطط */
.cmp-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.diff-from {
  color: var(--red);
  text-decoration: line-through;
  font-size: 11.5px;
}
.diff-to {
  color: var(--ok);
  font-weight: 500;
  font-size: 12px;
}
.st-ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  white-space: nowrap;
}
.st-warn {
  background: var(--gold-bg);
  color: var(--gold-ink);
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  white-space: nowrap;
}
.st-bad {
  background: var(--red-bg);
  color: var(--red-ink);
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  white-space: nowrap;
}
.wl-load {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.wl-load-track {
  display: inline-block;
  width: 56px;
  height: 6px;
  background: var(--line-2);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  vertical-align: middle;
}
.wl-load-fill {
  display: block;
  height: 100%;
  background: var(--slate-2);
  border-radius: 3px;
}
.wl-load-fill.above {
  background: var(--navy);
}
.batch-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  background: #fff;
}
.batch-card h4 {
  margin: 0 0 10px;
  color: var(--navy-ink);
  font-size: 14.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.batch-card .rank {
  font-size: 11px;
  color: var(--slate);
  font-weight: 400;
  background: var(--line-2);
  padding: 2px 9px;
  border-radius: 20px;
}
.stat-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  align-items: center;
  font-size: 12.5px;
  color: var(--slate);
  margin-bottom: 6px;
}
.stat-line:last-child {
  margin-bottom: 0;
}
.stat-line b {
  color: var(--ink);
  font-weight: 500;
}
.cat-chip {
  background: var(--line-2);
  color: var(--slate);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
}
th.sortable {
  cursor: pointer;
  user-select: none;
}
th.sortable:hover {
  background: var(--navy-2);
}

/* الطباعة: الجدول الأسبوعي فقط */
@media print {
  body * {
    visibility: hidden;
  }
  #tab-timetable,
  #tab-timetable * {
    visibility: visible;
  }
  #tab-timetable {
    position: absolute;
    inset: 0;
    display: block !important;
  }
  #tab-timetable .toolbar {
    display: none;
  }
  .tt .cell {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* ── معالج الخطوات ── */
.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 640px;
  margin: 0 auto 18px;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
  white-space: nowrap;
}
.step .n {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 2px solid var(--line);
  color: var(--slate);
  font-size: 13px;
  transition: all 0.3s;
  flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) {
  .step .n {
    transition: none;
  }
}
.step.done {
  color: var(--navy-ink);
}
.step.done .n {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.step.done .n::after {
  content: "✓";
}
.step.done .n .num {
  display: none;
}
.step.active {
  color: var(--navy-ink);
}
.step.active .n {
  border-color: var(--gold);
  color: var(--gold-ink);
  box-shadow: 0 0 0 4px var(--gold-bg);
}
.step-conn {
  width: 56px;
  height: 2px;
  background: var(--line);
  margin: 0 10px;
  transition: background 0.3s;
}
.step-conn.done {
  background: var(--navy);
}
@media (max-width: 640px) {
  .stepper {
    flex-wrap: wrap;
    gap: 8px;
  }
  .step-conn {
    width: 28px;
    margin: 0 4px;
  }
  .step {
    font-size: 11.5px;
  }
  .step .n {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
}

/* ── بطاقة الترحيب ── */
.welcome-card {
  position: relative;
  max-width: 920px;
  margin: 0 auto 16px;
  background: var(--gold-bg);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 14px 44px 14px 16px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--navy-ink);
}
.welcome-card b {
  color: var(--navy-ink);
}
.wc-x {
  position: absolute;
  top: 8px;
  left: 10px;
  background: none;
  border: none;
  color: var(--slate);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
}
.wc-x svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
.wc-x:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--navy-ink);
}

/* ── تنبيهات Toast ── */
.toast-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(400px, 90vw);
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.7;
  box-shadow: 0 8px 24px rgba(11, 20, 38, 0.25);
  animation: toastIn 0.3s ease;
  cursor: pointer;
  border-inline-start: 4px solid var(--gold);
}
.toast.ok {
  background: #166534;
  border-inline-start-color: #4ade80;
}
.toast.warn {
  background: #92600a;
  border-inline-start-color: var(--gold);
}
.toast.bad {
  background: #991b1b;
  border-inline-start-color: #f87171;
}
.toast.out {
  animation: toastOut 0.25s ease forwards;
}
@keyframes toastIn {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes toastOut {
  to {
    transform: translateY(10px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.out {
    animation: none;
  }
}

/* ── مؤشر التحميل في مناطق الرفع ── */
.dropzone.loading {
  pointer-events: none;
}
.dropzone.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  border-radius: inherit;
  display: block;
}
.dropzone.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 4px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  z-index: 2;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dropzone.loading::before {
    animation: none;
  }
}

/* ── شارات الملفات المحسّنة ── */
.okb {
  background: var(--ok-bg) !important;
  border: 1px solid #9ed4ae !important;
  color: var(--ok-ink) !important;
}

/* ── ملاحظة الحالة الفارغة في التبويبات ── */
.empty-note {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gold-bg);
  border: 1px dashed var(--gold);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--gold-ink);
  margin-bottom: 12px;
}
.empty-note svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}

/* ── أقراص المقر في جدول التعارضات ── */
.cpill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 500;
}
.cpill.cm {
  background: var(--male-cell, #e8f1fc);
  color: #1e4f91;
  border: 1px solid #b6d2f2;
}
.cpill.cf {
  background: var(--female-cell, #fbe9f2);
  color: #a03d6e;
  border: 1px solid #f0b6d1;
}

/* ── إتاحة: تركيز لوحة المفاتيح ── */
.btn:focus-visible,
.tab:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .grid2,
  .grid3 {
    grid-template-columns: 1fr;
  }
  main {
    padding: 18px 12px 40px;
  }
  .nav-group .ng-sub {
    display: none;
  }
}
