/* نظام قياس جاهزية المراكز — لوحة الإدارة والعمليات
   بلغة النموذج الأولي المعتمد: ورق فاتح، رأس كحلي، ولون العلامة البرتقالي.
   بلا خطوط أو مكتبات خارجية — تعمل على شبكة الجهة دون إنترنت. */

:root {
  --ink: #0b1b33;
  --ink-2: #44506a;
  --ink-3: #8491a8;
  --paper: #eef1f6;
  --card: #ffffff;
  --line: #dfe4ec;
  --brand: #ea6c0a;
  --brand-dark: #d25f06;
  --brand-soft: #fff8f2;
  --fit: #0f7a4d;
  --fit-soft: #e7f4ee;
  --unfit: #b3261e;
  --unfit-soft: #fbeceb;
  --warn: #b8760b;
  --warn-soft: #fdf4e3;
  --info: #2b6d96;
  --info-soft: #e8f1f8;
  --r1: 6px;
  --r2: 10px;
  --r3: 14px;
  --r4: 20px;
  --el1: 0 1px 2px rgba(11, 27, 51, .05);
  --el2: 0 1px 3px rgba(11, 27, 51, .07), 0 6px 16px rgba(11, 27, 51, .06);
  --el3: 0 2px 6px rgba(11, 27, 51, .09), 0 16px 40px rgba(11, 27, 51, .1);
  --ease: cubic-bezier(.22, .9, .3, 1);
  --font: "Segoe UI", system-ui, "Noto Naskh Arabic", Tahoma, sans-serif;
  --mono: Consolas, "Cascadia Mono", "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  direction: rtl;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.01em; line-height: 1.35; }
h3 { font-size: .98rem; display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }

.muted { color: var(--ink-3); }
.sm { font-size: .78rem; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.num { font-variant-numeric: tabular-nums; }
.big { font-size: 1.4rem; }
[hidden] { display: none !important; }
*:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px 60px; }

/* ── الرأس الكحلي ────────────────────────────────────── */

.stage {
  position: relative;
  margin: 0 -20px 0;
  padding: 26px 20px 24px;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, #1b2b47 0%, #0e1a2e 55%, #0a1424 100%);
  overflow: hidden;
}
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 64px);
  transform: perspective(560px) rotateX(62deg) translateY(28%) scale(2.1);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, #000 0%, transparent 72%);
}
.stage::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -180px;
  width: 620px;
  height: 620px;
  transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(circle, rgba(234, 108, 10, .16) 0%, transparent 62%);
}
.stage-in { position: relative; z-index: 1; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

.emblem {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 20px;
  background: linear-gradient(145deg, #f4f6fa 0%, #cdd5e2 46%, #9fabbf 72%, #e8ecf3 100%);
  box-shadow: 0 18px 36px rgba(0, 0, 0, .5), inset 0 2px 3px rgba(255, 255, 255, .95), inset 0 -4px 8px rgba(11, 27, 51, .3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.emblem span {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: linear-gradient(160deg, #ffffff 0%, #eef2f7 60%, #dde4ed 100%);
  box-shadow: inset 0 2px 5px rgba(11, 27, 51, .18);
  display: flex;
  align-items: center;
  justify-content: center;
}
.emblem img { width: 64px; height: auto; filter: drop-shadow(0 3px 5px rgba(11, 27, 51, .3)); }

.title { flex: 1; min-width: 240px; }
.title h1 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  color: #fff;
  text-shadow: 0 1px 0 #b9c3d4, 0 2px 0 #97a3b8, 0 3px 0 #7d8a9f, 0 4px 1px rgba(0, 0, 0, .28), 0 7px 14px rgba(0, 0, 0, .42);
}
.title .rule {
  width: 76px;
  height: 4px;
  border-radius: 2px;
  margin: 10px 0 9px;
  background: linear-gradient(90deg, var(--brand), #f7a14a);
  box-shadow: 0 2px 7px rgba(234, 108, 10, .6);
}
.title p { font-size: .84rem; color: #a9bbd4; max-width: 70ch; }
.title p b { color: #f1f5fa; }

.stamp {
  margin-right: auto;
  text-align: left;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 13px;
  padding: 11px 15px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}
.stamp b { font-size: 1rem; }
.stamp span { font-size: .72rem; color: #8ea4c2; }
.stamp-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.stamp-actions a, .stamp-actions button {
  background: none;
  border: 0;
  font: inherit;
  font-size: .74rem;
  color: #f7a14a;
  cursor: pointer;
  padding: 0;
}
.stamp-actions form { display: inline; }

/* ── التبويبات ───────────────────────────────────────── */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 0 0 22px;
  border-bottom: 2px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  padding: 11px 13px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--ink-3);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .15s;
}
.tab:hover { color: var(--ink-2); text-decoration: none; }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }

.page-head { margin: 0 0 18px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.page-head h2 { font-size: 1.2rem; }
.page-head p { font-size: .8rem; color: var(--ink-2); }

.sec { margin: 28px 0 13px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sec h2 { font-size: 1.06rem; }
.sec p { font-size: .76rem; color: var(--ink-2); }

/* ── البطاقات والشبكات ───────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: 18px 20px;
  box-shadow: var(--el1);
}
.card.flush { padding: 0; overflow: auto; }
.card.narrow { max-width: 580px; }
.card.empty { text-align: center; color: var(--ink-3); padding: 36px 18px; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 24px; align-items: start; }
.sticky { position: sticky; top: 16px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.row-gap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.center-row { display: flex; justify-content: center; margin-top: 12px; }

/* ── شريط الحكم ──────────────────────────────────────── */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  overflow: hidden;
  margin-bottom: 24px;
}
.kpi { background: var(--card); padding: 15px 17px; }
.kpi-value { display: block; font-size: 1.75rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-label { display: block; font-size: .74rem; color: var(--ink-2); margin-top: 5px; }
.kpi-value.ok { color: var(--fit); }
.kpi-value.bad { color: var(--unfit); }
.kpi-value.warn { color: var(--warn); }
.kpi-value.small { font-size: 1.05rem; }

/* ── جدار العدّادات ──────────────────────────────────── */

.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(282px, 1fr)); gap: 24px; }

.g {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r3);
  padding: 24px 16px 16px;
  text-align: center;
  color: inherit;
  display: block;
  box-shadow: var(--el1);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.g:hover, .g:focus-visible { border-color: var(--brand); box-shadow: var(--el2); transform: translateY(-2px); text-decoration: none; }
.g.unfit { border-color: #efd3d0; }
.g.closed { opacity: .56; }

.gbox { position: relative; width: 100%; max-width: 272px; margin: 0 auto; }
.gbox svg { width: 100%; height: auto; display: block; overflow: visible; }
.gfill { transition: stroke-dashoffset 1.2s var(--ease); }
.gval { position: absolute; left: 0; right: 0; bottom: 10%; text-align: center; pointer-events: none; }
.gval b {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.gval .warn-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border-radius: 6px;
  background: var(--unfit);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
}
.gname { margin-top: 12px; }
.gname b { display: block; font-size: .98rem; font-weight: 800; }
.gname span { display: block; font-size: .66rem; color: var(--ink-3); margin-top: 2px; }
.gstats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
  font-size: .72rem;
  color: var(--ink-2);
}
.gstats div { background: var(--paper); border-radius: var(--r1); padding: 6px 4px; }
.gstats b { display: block; font-size: .95rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.gnote { font-size: .68rem; color: var(--ink-3); margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }

/* ── المحاور ─────────────────────────────────────────── */

.axes { display: flex; flex-direction: column; gap: 10px; }
.axis-row { display: grid; grid-template-columns: 9.5rem 1fr 3.4rem; gap: 10px; align-items: center; font-size: .84rem; }
.axis-bar { height: 9px; background: var(--paper); border-radius: 99px; overflow: hidden; }
.axis-fill { height: 100%; width: 0; background: var(--fit); border-radius: 99px; transition: width .45s var(--ease); }
.axis-fill.low { background: var(--unfit); }
.axis-row .val { text-align: left; font-weight: 800; font-variant-numeric: tabular-nums; }
.weight { font-size: .7rem; color: var(--ink-3); font-weight: 700; background: var(--paper); padding: 1px 9px; border-radius: 99px; margin-right: auto; }

/* ── أثر الاستدعاء ───────────────────────────────────── */

.impact { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin: 6px 0 14px; }
.impact-side { background: var(--paper); border-radius: var(--r2); padding: 13px 9px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.impact-side .k { font-size: .7rem; color: var(--ink-3); }
.impact-side strong { font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; }
.impact-arrow { font-size: 1.2rem; color: var(--brand); font-weight: 800; }

/* ── الشارات ─────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: var(--paper);
  color: var(--ink-3);
  white-space: nowrap;
}
.badge.ok { background: var(--fit-soft); color: var(--fit); }
.badge.bad { background: var(--unfit-soft); color: var(--unfit); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }

/* ── الجداول ─────────────────────────────────────────── */

.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th {
  background: var(--ink);
  color: #fff;
  padding: 10px 12px;
  text-align: right;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--brand-soft); }

/* ── النماذج ─────────────────────────────────────────── */

.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; border: 0; }
.field.wide { grid-column: 1 / -1; }
.field > span:first-child { font-size: .8rem; font-weight: 700; color: var(--ink-2); }

input, select, textarea {
  font: inherit;
  font-size: .9rem;
  padding: 9px 12px;
  border-radius: var(--r2);
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  width: 100%;
  transition: border-color .18s, box-shadow .18s;
}
input:hover, select:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(234, 108, 10, .13); }
.toolbar select, .pick select { width: auto; min-width: 230px; }
.err { color: var(--unfit); font-size: .76rem; }
.input-validation-error { border-color: var(--unfit); }
.validation-summary-valid { display: none; }
.validation-summary-errors ul { margin: 0; padding-inline-start: 18px; }

.radio {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--r2);
  cursor: pointer;
  margin-top: 6px;
}
.radio:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio input { width: auto; margin-top: 6px; accent-color: var(--brand); }

.checks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 5px;
  background: var(--paper);
}
.check { display: flex; gap: 9px; align-items: center; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: .86rem; background: var(--card); }
.check:hover { box-shadow: inset 0 0 0 1px var(--brand); }
.check:has(input:checked) { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.check input { width: auto; accent-color: var(--brand); }
.check small { color: var(--ink-3); }
.list-head { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 700; margin-bottom: 6px; color: var(--ink-2); }
.list-head .muted { font-weight: 400; }

/* أنواع الحوادث والمراكز كأزرار اختيار، بلغة النموذج */
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.types button {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r2);
  padding: 12px 8px;
  cursor: pointer;
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink);
  transition: .14s;
}
.types button small { display: block; font-weight: 400; color: var(--ink-3); font-size: .68rem; }
.types button:hover { border-color: var(--brand); }
.types button.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }

.stn-list { display: grid; gap: 8px; }
.stn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r2);
  padding: 11px 14px;
  cursor: pointer;
  font: inherit;
  text-align: right;
  width: 100%;
  color: var(--ink);
  transition: .14s;
}
.stn:hover { border-color: var(--brand); }
.stn.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.stn.blocked { opacity: .55; }
.stn .pct { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 60px; }
.stn .nm { flex: 1; min-width: 0; }
.stn .nm b { display: block; font-size: .84rem; }
.stn .nm span { display: block; font-size: .68rem; color: var(--ink-3); }
.stn .av { font-size: .68rem; color: var(--ink-2); white-space: nowrap; text-align: left; }

/* ── الأزرار ─────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--r2);
  border: 1px solid var(--line);
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink-2);
  background: var(--card);
  text-decoration: none;
  transition: background .18s, border-color .18s;
}
.btn:hover { text-decoration: none; border-color: var(--ink-3); }
.btn:active { transform: scale(.98); }
.btn:disabled { background: #c8ced8; border-color: #c8ced8; color: #fff; box-shadow: none; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 7px rgba(234, 108, 10, .3); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { background: var(--unfit); border-color: var(--unfit); color: #fff; }
.btn.ghost { background: var(--card); }
.btn.sm { padding: 6px 12px; font-size: .78rem; }
.btn.block { width: 100%; }

.link-sm { background: none; border: 0; padding: 0; font: inherit; font-size: .76rem; color: var(--brand); cursor: pointer; }
.danger-text { color: var(--unfit); }

.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--r2); overflow: hidden; background: var(--card); }
.seg-btn { background: transparent; border: 0; color: var(--ink-3); padding: 6px 14px; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.seg form + form .seg-btn { border-inline-start: 1.5px solid var(--line); }
.seg-btn:hover { color: var(--ink); background: var(--paper); }
.seg-btn.on.ok { background: var(--fit-soft); color: var(--fit); }
.seg-btn.on.bad { background: var(--unfit-soft); color: var(--unfit); }

/* ── التنبيهات ───────────────────────────────────────── */

.flash { padding: 11px 15px; border-radius: var(--r2); margin-bottom: 16px; font-size: .86rem; font-weight: 600; }
.flash.ok { background: var(--fit-soft); color: var(--fit); }
.flash.bad { background: var(--unfit-soft); color: var(--unfit); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.card .flash:last-child { margin-bottom: 0; }
.import-errors { margin: 8px 0 0; padding-inline-start: 18px; font-weight: 500; line-height: 1.8; }
input[type="file"] { padding: 7px 10px; cursor: pointer; }

.creds { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 16px 0; align-items: center; }
.creds dt { color: var(--ink-2); font-size: .84rem; font-weight: 700; }
.creds dd { background: var(--paper); border: 1.5px dashed var(--ink-3); border-radius: var(--r2); padding: 8px 13px; }

/* ── صفحة الدخول ─────────────────────────────────────── */

.auth-body { min-height: 100vh; background: var(--paper); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; }

/* الجانب التعريفي: كحلي بلون رأس اللوحة، ومؤشر بحدّ الجاهزية كما في البطاقات */
.auth-side {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 44px 52px;
  color: #fff;
  background:
    radial-gradient(ellipse 80% 55% at 85% 0%, rgba(234, 108, 10, .18), transparent 60%),
    radial-gradient(ellipse 70% 60% at 0% 100%, rgba(43, 109, 150, .28), transparent 60%),
    linear-gradient(160deg, #13284a 0%, #0b1b33 55%, #081427 100%);
}
.auth-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  pointer-events: none;
}
.auth-side > * { position: relative; }

.auth-mark { display: flex; align-items: center; gap: 14px; }
.auth-mark img, .auth-mobile-mark img { width: 52px; height: 52px; object-fit: contain; padding: 6px; background: #fff; border-radius: var(--r3); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.auth-mark strong { display: block; font-size: 1.02rem; font-weight: 800; }
.auth-mark span { display: block; font-size: .72rem; letter-spacing: .08em; color: #8fa3c2; direction: ltr; text-align: right; }

.auth-hero { max-width: 440px; }
.auth-dial { width: 210px; height: auto; margin-bottom: 26px; overflow: visible; }
.auth-dial path { fill: none; stroke-width: 14; stroke-linecap: round; }
.dial-track { stroke: rgba(255, 255, 255, .08); }
.dial-low { stroke: rgba(255, 255, 255, .16); }
.dial-high { stroke: var(--brand); }
.dial-mark { stroke: #fff; stroke-width: 2.5; stroke-linecap: round; opacity: .8; }
.dial-needle { stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.dial-hub { fill: #fff; }
.auth-hero h1 { font-size: 2.05rem; line-height: 1.35; font-weight: 800; letter-spacing: -.015em; margin-bottom: 14px; }
.auth-hero p { color: #b4c3da; font-size: .95rem; line-height: 1.9; }

.auth-facts { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255, 255, 255, .1); border-radius: var(--r3); overflow: hidden; }
.auth-facts li { background: rgba(8, 20, 39, .55); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.auth-facts b { font-size: 1.15rem; font-weight: 800; color: #fff; }
.auth-facts span { font-size: .74rem; color: #8fa3c2; }

/* جانب النموذج */
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 40px 24px; }
.auth-mobile-mark { display: none; }
.auth-panel {
  width: 100%;
  max-width: 410px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r4);
  box-shadow: var(--el3);
  padding: 36px 34px 32px;
  border-top: 4px solid var(--brand);
}
.auth-head { margin-bottom: 22px; }
.auth-head h2 { font-size: 1.4rem; margin-bottom: 4px; }
.auth-head p, .auth-panel > .muted { color: var(--ink-2); font-size: .86rem; }
.auth-panel h2 { margin-bottom: 6px; }
.auth-panel .form { gap: 16px; }
.auth-panel .btn.block { margin-top: 6px; }

.field > label { font-size: .8rem; font-weight: 700; color: var(--ink-2); }

.input-icon { position: relative; }
.input-icon > svg {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; fill: none; stroke: var(--ink-3); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; pointer-events: none; transition: stroke .18s;
}
.input-icon input { padding: 12px 42px; font-size: .95rem; background: #fbfcfe; }
.input-icon input:focus { background: var(--card); }
.input-icon:focus-within > svg { stroke: var(--brand); }
.reveal {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: var(--r1); background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-3);
}
.reveal:hover { background: var(--paper); color: var(--ink); }
.reveal:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.reveal svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.reveal[aria-pressed="true"] { color: var(--brand); }

.caps-warn { color: var(--warn); font-size: .76rem; font-weight: 600; }
.auth-submit { padding: 13px; font-size: 1rem; font-weight: 700; }

.auth-foot { display: flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: .76rem; text-align: center; }
.auth-foot svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; flex: none; }

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { justify-content: flex-start; padding: 0 16px 32px; gap: 22px; }
  .auth-mobile-mark {
    display: flex; align-items: center; gap: 12px; align-self: stretch;
    margin: 0 -16px; padding: 22px 20px; color: #fff;
    background: linear-gradient(160deg, #13284a, #0b1b33);
  }
  .auth-mobile-mark img { width: 42px; height: 42px; padding: 5px; border-radius: var(--r2); }
  .auth-mobile-mark strong { font-size: 1rem; }
  .auth-panel { padding: 28px 22px 24px; }
}

/* ── الشاشات الضيقة ─────────────────────────────────── */

@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: 1fr; }
  .sticky { position: static; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 12px 48px; }
  .stage { margin: 0 -12px; }
  .stamp { margin-right: 0; }
  .split { grid-template-columns: 1fr; }
  .wall { grid-template-columns: 1fr; }
  .axis-row { grid-template-columns: 7.5rem 1fr 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gfill, .axis-fill { transition: none; }
}

/* ── اختيار طريقة الرقم الوظيفي ─────────────────────────── */

.number-mode { padding: 0; min-width: 0; }
.seg-opt { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.seg-opt + .seg-opt { border-inline-start: 1.5px solid var(--line); }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { padding: 6px 14px; font-size: .8rem; font-weight: 700; color: var(--ink-3); }
.seg-opt input:checked + span { background: var(--brand-soft); color: var(--brand-dark); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }

/* ── عدّاد المركز: رابط المحاور وزر الآليات ─────────────── */

.glink { display: block; color: inherit; }
.glink:hover { text-decoration: none; }
.gstats.two { grid-template-columns: repeat(2, 1fr); }
.gstat-btn {
  background: var(--paper);
  border: 1.5px solid transparent;
  border-radius: var(--r1);
  padding: 6px 4px;
  font: inherit;
  font-size: .72rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.gstat-btn b { display: block; font-size: .95rem; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.gstat-btn:hover { border-color: var(--brand); background: var(--brand-soft); }

/* ── نافذة تفاصيل الآليات ───────────────────────────── */

.sheet {
  border: 0;
  border-radius: var(--r3);
  padding: 20px;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  margin: auto;
  box-shadow: var(--el3);
  color: var(--ink);
}
.sheet::backdrop { background: rgba(11, 27, 51, .45); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.sheet-head h3 { margin-bottom: 2px; }
.vcard { border: 1px solid var(--line); border-radius: var(--r2); padding: 12px 14px; margin-bottom: 10px; }
.vhead { display: flex; justify-content: space-between; align-items: center; }
.vtype { font-weight: 700; margin: 2px 0 4px; }
.vgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.vfield { background: var(--paper); border-radius: var(--r1); padding: 6px 8px; }
.vfield span { display: block; font-size: .68rem; color: var(--ink-3); }
.vfield b { font-size: .84rem; font-variant-numeric: tabular-nums; }

/* ── الرتب والإعدادات ───────────────────────────────── */

.grow { flex: 1 1 260px; width: auto; }
.muted-row td { opacity: .55; }
.settings { display: grid; gap: 14px; margin-bottom: 14px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.setting h3 { margin-bottom: 2px; }
.setting .amount { width: 110px; }
.setting select { width: auto; }

/* ── خريطة الأفراد ──────────────────────────────────── */

.map-canvas { height: 520px; margin-bottom: 16px; overflow: hidden; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--ink-2); }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.dot.mission { background: #ea6c0a; }
.dot.normal { background: #0b1b33; }
.dot.stale { background: #9aa3b2; }
.map-info { font-family: var(--font); direction: rtl; font-size: .82rem; line-height: 1.6; color: var(--ink); }

@media (max-width: 640px) {
  .vgrid { grid-template-columns: repeat(2, 1fr); }
  .map-canvas { height: 380px; }
}

/* إنذار مغادرة موقع الدوام */
.geo-banner { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; font-weight: 700; text-decoration: none; }
.geo-banner[hidden] { display: none; }
.geo-banner .geo-link { margin-inline-start: auto; text-decoration: underline; font-weight: 800; }
.geo-dot { width: 10px; height: 10px; border-radius: 50%; background: #dc2626; box-shadow: 0 0 0 0 rgba(220, 38, 38, .6); animation: geo-pulse 1.4s infinite; flex: none; }
@keyframes geo-pulse { 70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
.tab-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-inline-start: 3px; border-radius: 9px; background: #dc2626; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.tab-count[hidden] { display: none; }

/* الاستئذانات */
.leave-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.leave-actions .reject-note { width: 230px; padding: 5px 8px; font-size: 12px; }
.count-pill { display: inline-block; min-width: 20px; padding: 0 6px; margin-inline-start: 4px; border-radius: 10px; background: rgba(255,255,255,.25); font-size: 11px; line-height: 18px; text-align: center; }
.nowrap { white-space: nowrap; }
.alert-card { border: 1px solid #fecaca; }
.alert-row td { background: #fff7f7; }
.geo-dot.inline { display: inline-block; vertical-align: middle; }
.section-title { margin: 20px 0 8px; font-size: 15px; }

/* مؤشر الإرهاق */
.fatigue { min-width: 150px; }
.fatigue-head { display: flex; align-items: center; gap: 6px; }
.fatigue-bar { height: 5px; margin: 4px 0 3px; border-radius: 3px; background: var(--line, #e5e7eb); overflow: hidden; }
.fatigue-bar i { display: block; height: 100%; border-radius: 3px; background: var(--ok, #16a34a); }
.fatigue.warn .fatigue-bar i { background: var(--warn, #d97706); }
.fatigue.bad .fatigue-bar i { background: var(--bad, #dc2626); }
.fatigue .muted.sm { font-size: 11px; line-height: 1.5; }
.fatigue-chip { font-size: 10.5px; padding: 1px 6px; margin-inline-start: 4px; }
.fatigue-bar i.w0 { width: 3%; }
.fatigue-bar i.w5 { width: 5%; }
.fatigue-bar i.w10 { width: 10%; }
.fatigue-bar i.w15 { width: 15%; }
.fatigue-bar i.w20 { width: 20%; }
.fatigue-bar i.w25 { width: 25%; }
.fatigue-bar i.w30 { width: 30%; }
.fatigue-bar i.w35 { width: 35%; }
.fatigue-bar i.w40 { width: 40%; }
.fatigue-bar i.w45 { width: 45%; }
.fatigue-bar i.w50 { width: 50%; }
.fatigue-bar i.w55 { width: 55%; }
.fatigue-bar i.w60 { width: 60%; }
.fatigue-bar i.w65 { width: 65%; }
.fatigue-bar i.w70 { width: 70%; }
.fatigue-bar i.w75 { width: 75%; }
.fatigue-bar i.w80 { width: 80%; }
.fatigue-bar i.w85 { width: 85%; }
.fatigue-bar i.w90 { width: 90%; }
.fatigue-bar i.w95 { width: 95%; }
.fatigue-bar i.w100 { width: 100%; }

/* معلومات الحادث */
.incident-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .incident-grid { grid-template-columns: 1fr; } }
.incident-grid .card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.incident-grid h3 { margin: 0; }
.incident-grid h4 { margin: 14px 0 6px; font-size: 13px; }
.facts { margin: 0; display: grid; gap: 8px; }
.facts dt { font-size: 11.5px; color: var(--muted, #64748b); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.facts-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.facts .num { font-size: 20px; font-weight: 800; }
.support-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line, #e5e7eb); flex-wrap: wrap; }
.timeline { list-style: none; margin: 0; padding: 0; max-height: 330px; overflow: auto; }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line, #e5e7eb); font-size: 13px; }
.timeline li:first-child { border-top: 0; }
.dialog form { display: grid; gap: 10px; min-width: min(460px, 86vw); }
.dialog label { display: grid; gap: 4px; font-size: 13px; }
.dialog .row-gap label { flex: 1; }
.dialog .end { justify-content: flex-end; }
.req { color: var(--bad, #dc2626); }

/* إدخال البيانات: الآليات، المناوبات */
.w-code { width: 110px; }
.w-time { width: 96px; }
.cycle { display: flex; flex-wrap: wrap; gap: 6px; }
.cycle select { width: auto; min-width: 92px; }
.people-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; max-height: 320px; overflow: auto; }
