/* =====================================================================
   SCOPE MEDIA — PRODUCTION MANAGER
   الهوية مأخوذة من دليل الهوية (Brand Guidelines V1.1) وملف CSS لموقع scopemedia.sa
   ===================================================================== */

:root {
  /* ألوان الهوية الأساسية */
  --black: #000000;
  --white: #FFFFFF;
  --green: #92E0A1;          /* Growth Green */
  --orange: #FE6806;         /* Fiery Orange — لمسات صغيرة فقط (1%) */

  /* درجات الأخضر الداكن من الموقع */
  --g-soft: #C3EECB;
  --g-78: #72AF7E;
  --g-46: #43674A;
  --g-34: #324C37;
  --g-24: #233627;
  --g-16: #17241A;
  --g-10: #0F1610;
  --g-06: #090D0A;
  --g-03: #040705;

  --ink-1: var(--g-03);      /* الخلفية */
  --ink-2: var(--g-06);      /* السطح */
  --ink-3: var(--g-10);      /* البطاقات */
  --ink-4: var(--g-16);      /* بطاقات مرتفعة */
  --line: rgba(146, 224, 161, .20);
  --line-2: rgba(146, 224, 161, .10);
  --mute: rgba(255, 255, 255, .64);
  --mute-2: rgba(255, 255, 255, .46);

  /* حالة المرحلة: غير منجزة (أحمر) */
  --red: #FF5B4D;
  --red-soft: rgba(255, 91, 77, .12);
  --red-line: rgba(255, 91, 77, .38);
  --green-soft: rgba(146, 224, 161, .12);
  --green-line: rgba(146, 224, 161, .45);
  --orange-soft: rgba(254, 104, 6, .14);

  /* الخطوط */
  --f-disp: "Zain", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --f-text: "IBM Plex Sans Arabic", "Zain", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-lat: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;

  --r: 18px;
  --r-lg: 24px;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --topbar-h: 64px;
  --nav-h: 68px;
  --pad: clamp(16px, 4.5vw, 32px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

html, body {
  margin: 0;
  background: var(--ink-1);
  color: var(--white);
  font-family: var(--f-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 100% -10%, rgba(146, 224, 161, .07), transparent 60%),
    radial-gradient(80% 50% at 0% 110%, rgba(146, 224, 161, .04), transparent 60%),
    var(--ink-1);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--green); text-decoration: none; }
[hidden] { display: none !important; }

.num, .lat { font-family: var(--f-lat); font-feature-settings: "tnum"; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 10px; }

/* ---------------------------------------------------------------------
   شاشة التحميل
   --------------------------------------------------------------------- */
.boot {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 28px;
  background: var(--ink-1);
  transition: opacity .4s var(--ease);
}
.boot.is-done { opacity: 0; pointer-events: none; }
.boot img { width: 96px; height: auto; animation: bootPulse 1.6s var(--ease) infinite; }
.boot__bar { width: 120px; height: 2px; border-radius: 2px; background: var(--line-2); position: relative; overflow: hidden; }
.boot__bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--green); animation: bootBar 1.1s var(--ease) infinite; }
@keyframes bootPulse { 50% { opacity: .55; } }
@keyframes bootBar { from { transform: translateX(260%); } to { transform: translateX(-120%); } }

/* ---------------------------------------------------------------------
   الهيكل العام
   --------------------------------------------------------------------- */
.app { min-height: 100vh; min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  padding: calc(var(--safe-t) + 10px) calc(var(--pad) + var(--safe-r)) 10px calc(var(--pad) + var(--safe-l));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(4, 7, 5, .82);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--line-2);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--white); }
.brand img { height: 30px; width: auto; }
.brand__sub {
  font-family: var(--f-lat); font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--mute-2); border-inline-start: 1px solid var(--line); padding-inline-start: 12px; line-height: 1.3;
  white-space: nowrap;
}
.topbar__actions { display: flex; align-items: center; gap: 6px; }

.main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px calc(var(--pad) + var(--safe-r)) calc(var(--nav-h) + var(--safe-b) + 32px) calc(var(--pad) + var(--safe-l));
}

/* شريط التنقل السفلي */
.nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 6px calc(8px + var(--safe-r)) var(--safe-b) calc(8px + var(--safe-l));
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(9, 13, 10, .92);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  backdrop-filter: saturate(140%) blur(18px);
  border-top: 1px solid var(--line-2);
}
.nav__item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; border-radius: 16px;
  color: var(--mute-2); font-size: 12.5px; font-weight: 500;
  transition: color .2s;
}
.nav__item svg { width: 24px; height: 24px; }
.nav__item.is-active { color: var(--green); }
.nav__item.is-active::before {
  content: ""; position: absolute; top: -6px; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--green);
}
.nav__item:active { background: var(--line-2); }

.badge {
  position: absolute; top: 6px; inset-inline-end: calc(50% - 24px);
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--orange); color: var(--black);
  font-family: var(--f-lat); font-size: 11px; font-weight: 700; line-height: 1;
  border: 2px solid var(--ink-2);
}

/* سطح المكتب: التنقل يصبح عموديًا */
@media (min-width: 960px) {
  :root { --nav-w: 232px; }
  .nav {
    top: 0; bottom: 0; inset-inline-start: 0; inset-inline-end: auto;
    width: var(--nav-w); height: auto;
    grid-auto-flow: row; grid-auto-rows: min-content; align-content: start; gap: 4px;
    padding: calc(var(--topbar-h) + 28px) 16px 24px;
    border-top: 0; border-inline-end: 1px solid var(--line-2);
    background: rgba(9, 13, 10, .6);
  }
  .nav__item { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 16px; min-height: 50px; font-size: 15px; }
  .nav__item.is-active { background: var(--green-soft); }
  .nav__item.is-active::before { top: 12px; bottom: 12px; inset-inline-start: 0; width: 3px; height: auto; border-radius: 3px; }
  .badge { position: static; margin-inline-start: auto; }
  .topbar, .main { padding-inline-start: calc(var(--nav-w) + 40px); }
  .topbar { z-index: 45; }
  .main { max-width: none; padding-bottom: 48px; padding-inline-end: 40px; }
  .main > * { max-width: 1040px; }
}

/* ---------------------------------------------------------------------
   الطباعة
   --------------------------------------------------------------------- */
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-lat); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--mute-2);
}
.kicker::before { content: ""; width: 7px; height: 7px; background: var(--orange); }

.h1 { font-family: var(--f-disp); font-weight: 800; font-size: clamp(30px, 8vw, 42px); line-height: 1.15; margin: 6px 0 4px; letter-spacing: 0; }
.h2 { font-family: var(--f-disp); font-weight: 700; font-size: 26px; line-height: 1.2; margin: 0; }
.h3 { font-family: var(--f-disp); font-weight: 700; font-size: 22px; line-height: 1.25; margin: 0; }
.lead { color: var(--mute); font-size: 17px; margin: 0; }
.muted { color: var(--mute); }
.muted-2 { color: var(--mute-2); }
.small { font-size: 14px; }
.accent { color: var(--green); }

.page-head { margin: 4px 0 22px; }
.page-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.section { margin-top: 34px; }
.section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section__head .h2 { font-size: 24px; }
.link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; white-space: nowrap; color: var(--green); font-weight: 600; font-size: 15px; }

/* ---------------------------------------------------------------------
   الأزرار
   --------------------------------------------------------------------- */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border: 0; border-radius: 100px;
  background: var(--green); color: var(--black);
  font-family: var(--f-text); font-weight: 600; font-size: 16px; line-height: 1;
  cursor: pointer; text-align: center;
  transition: transform .15s var(--ease), color .3s var(--ease), opacity .2s;
  -webkit-user-select: none; user-select: none;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--white); transform: scaleY(0); transform-origin: bottom;
  transition: transform .45s var(--ease);
}
@media (hover: hover) { .btn:hover::before { transform: scaleY(1); } }
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn--block { width: 100%; }
.btn--sm { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn--ghost { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.btn--ghost::before { background: var(--green); }
@media (hover: hover) { .btn--ghost:hover { color: var(--black); } }
.btn--danger { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1px var(--red-line); }
.btn--danger::before { background: var(--red); }
@media (hover: hover) { .btn--danger:hover { color: var(--black); } }
.btn--solid-danger { background: var(--red); color: var(--black); }
.btn--google { background: var(--white); color: #111; }
.btn--google::before { background: var(--green); }

.icon-btn {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: transparent; color: var(--white); cursor: pointer;
  transition: background .2s;
}
.icon-btn:active, .icon-btn:hover { background: var(--line-2); }
.icon-btn svg { width: 22px; height: 22px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 140px; }

/* ---------------------------------------------------------------------
   البطاقات
   --------------------------------------------------------------------- */
.card {
  background: linear-gradient(180deg, rgba(23, 36, 26, .55), rgba(15, 22, 16, .9));
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 20px;
}
.card--flat { background: var(--ink-3); }
.card + .card { margin-top: 12px; }

.grid { display: grid; gap: 12px; }
@media (min-width: 680px) { .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 680px) and (max-width: 1099px) { .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* عدادات لوحة التحكم */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat {
  border-radius: var(--r); padding: 16px 14px 14px; min-width: 0;
  background: var(--ink-3); border: 1px solid var(--line-2);
}
.stat__num { font-family: var(--f-lat); font-weight: 700; font-size: clamp(30px, 9vw, 44px); line-height: 1; color: var(--white); }
.stat__label { margin-top: 10px; color: var(--mute); font-size: 14px; line-height: 1.35; }
.stat--accent { background: var(--green); border-color: var(--green); }
.stat--accent .stat__num, .stat--accent .stat__label { color: var(--black); }

/* تنبيه بارز */
.notice {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: var(--r);
  background: var(--orange-soft); border: 1px solid rgba(254, 104, 6, .35);
  color: var(--white);
}
.notice__dot { width: 10px; height: 10px; flex: none; background: var(--orange); }
.notice__text { flex: 1; min-width: 0; font-weight: 500; }
.notice svg { width: 20px; height: 20px; flex: none; color: var(--orange); }

/* بطاقة مشروع */
.pcard { display: block; color: inherit; transition: border-color .2s, transform .15s var(--ease); }
.pcard:active { transform: scale(.99); }
@media (hover: hover) { .pcard:hover { border-color: var(--line); } }
.pcard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pcard__name { font-family: var(--f-disp); font-weight: 700; font-size: 23px; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.pcard__client { color: var(--mute); font-size: 15px; margin-top: 2px; }
.pcard__meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; font-size: 14px; color: var(--mute); }
.pcard__meta strong { color: var(--white); font-weight: 600; }

.progress { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 10px; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .6s var(--ease); }

/* حلقة الإنجاز */
.ring { --p: 0; width: 76px; height: 76px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), rgba(255, 255, 255, .08) 0); }
.ring__in { width: 62px; height: 62px; border-radius: 50%; background: var(--ink-2); display: grid; place-items: center;
  font-family: var(--f-lat); font-weight: 700; font-size: 18px; }

/* ---------------------------------------------------------------------
   الشارات
   --------------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 12px; border-radius: 100px;
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
  background: rgba(255, 255, 255, .06); color: var(--mute);
  border: 1px solid transparent;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip--plain::before { display: none; }
.chip--green, .chip--approved, .chip--active { background: var(--green-soft); color: var(--green); border-color: rgba(146, 224, 161, .25); }
.chip--red, .chip--rejected { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.chip--pending { background: var(--orange-soft); color: #FF9A55; border-color: rgba(254, 104, 6, .3); }
.chip--disabled, .chip--closed { background: rgba(255, 255, 255, .06); color: var(--mute); border-color: rgba(255, 255, 255, .12); }
.chip--me { background: var(--green); color: var(--black); }
.chip--me::before { display: none; }

.people { display: flex; flex-wrap: wrap; gap: 6px; }
.person {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  min-height: 32px; padding: 0 12px 0 4px; border-radius: 100px;
  background: rgba(255, 255, 255, .06); font-size: 14.5px; font-weight: 500;
}
.person.is-me { background: var(--green-soft); color: var(--g-soft); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--g-24); color: var(--green);
  font-size: 13px; font-weight: 700; font-family: var(--f-disp);
}
.avatar--lg { width: 48px; height: 48px; font-size: 22px; }
.person__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------------
   رأس المشروع
   --------------------------------------------------------------------- */
.phead { padding: 22px; }
.phead__row { display: flex; gap: 16px; align-items: center; }
.phead__info { flex: 1; min-width: 0; }
.phead__name { font-family: var(--f-disp); font-weight: 800; font-size: clamp(28px, 7.5vw, 38px); line-height: 1.15; margin: 4px 0 2px; overflow-wrap: anywhere; }
.phead__client { color: var(--mute); font-size: 16px; }
.phead__client strong { color: var(--white); font-weight: 600; }
.phead__desc { margin: 16px 0 0; color: var(--mute); white-space: pre-line; overflow-wrap: anywhere; }
.phead__desc.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.phead__count { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 15px; color: var(--mute); }
.phead__count strong { color: var(--white); font-family: var(--f-lat); }
.phead__actions { margin-top: 16px; }

/* ---------------------------------------------------------------------
   الخط الزمني الرأسي للمراحل (Vertical Workflow)
   --------------------------------------------------------------------- */
.timeline { list-style: none; margin: 26px 0 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; top: 24px; bottom: 24px; inset-inline-start: 21px;
  width: 2px; background: linear-gradient(var(--line), var(--line-2));
}
.tl { position: relative; padding-inline-start: 58px; }
.tl + .tl { margin-top: 12px; }

.tl__node {
  position: absolute; inset-inline-start: 0; top: 14px;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-lat); font-weight: 700; font-size: 16px;
  background: var(--ink-1); border: 2px solid var(--red); color: var(--red);
  z-index: 1;
}
.tl.is-done .tl__node { background: var(--green); border-color: var(--green); color: var(--black); }
.tl.is-done .tl__node .tl__num { display: none; }
.tl__node svg { width: 22px; height: 22px; display: none; }
.tl.is-done .tl__node svg { display: block; }

.tl__card {
  display: block; width: 100%; text-align: start; cursor: pointer;
  padding: 16px 18px; border-radius: var(--r);
  background: var(--ink-3);
  border: 1px solid var(--red-line);
  border-inline-start: 4px solid var(--red);
  transition: transform .15s var(--ease), background .2s;
}
.tl__card:active { transform: scale(.99); }
@media (hover: hover) { .tl__card:hover { background: var(--ink-4); } }
.tl.is-done .tl__card { border-color: var(--green-line); border-inline-start-color: var(--green); background: linear-gradient(90deg, rgba(146, 224, 161, .07), var(--ink-3) 70%); }
.tl.is-target .tl__card { box-shadow: 0 0 0 2px var(--white); }

.tl__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tl__title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.tl__step { font-family: var(--f-lat); font-size: 11px; letter-spacing: .14em; color: var(--mute-2); white-space: nowrap; }
.tl__name { font-family: var(--f-disp); font-weight: 700; font-size: 21px; line-height: 1.25; }
.tl__people { margin-top: 10px; }
.tl__nobody { margin-top: 8px; font-size: 14.5px; color: var(--mute-2); }
.tl__foot { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--mute-2); }
.tl__more { display: inline-flex; align-items: center; gap: 4px; color: var(--mute); font-weight: 500; }
.tl__more svg { width: 16px; height: 16px; }

.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 100px; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.status svg { width: 15px; height: 15px; }
.status--todo { background: var(--red-soft); color: var(--red); }
.status--done { background: var(--green); color: var(--black); }

/* ---------------------------------------------------------------------
   قوائم (مهام / إشعارات / موظفون)
   --------------------------------------------------------------------- */
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.item {
  display: flex; align-items: center; gap: 14px; width: 100%; min-width: 0;
  padding: 16px; border-radius: var(--r);
  background: var(--ink-3); border: 1px solid var(--line-2);
  color: inherit; text-align: start; cursor: pointer;
  transition: background .2s, transform .15s var(--ease);
}
.item:active { transform: scale(.99); }
@media (hover: hover) { .item:hover { background: var(--ink-4); } }
.item__icon { width: 44px; height: 44px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--g-16); color: var(--green); }
.item__icon svg { width: 22px; height: 22px; }
.item__icon--red { background: var(--red-soft); color: var(--red); }
.item__body { flex: 1; min-width: 0; }
.item__title, .item__sub { display: block; }
.item__title { font-weight: 600; font-size: 16.5px; line-height: 1.4; overflow-wrap: anywhere; }
.item__sub { color: var(--mute); font-size: 14.5px; margin-top: 2px; overflow-wrap: anywhere; }
.item__desc { color: var(--mute-2); font-size: 14px; margin-top: 6px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item__end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.item__chev { width: 18px; height: 18px; color: var(--mute-2); flex: none; }
.item__mail { display: block; margin-top: 4px; font-family: var(--f-lat); font-size: 13.5px; color: var(--mute-2); direction: ltr; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.is-unread { border-color: var(--line); background: linear-gradient(90deg, rgba(146, 224, 161, .06), var(--ink-3) 60%); }
.item.is-unread .item__title::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-start: 8px; vertical-align: middle; background: var(--orange); }
.item--task { border-inline-start: 4px solid var(--red); }

.req { padding: 18px; }
.req__top { display: flex; align-items: center; gap: 14px; }
.req__mail { font-family: var(--f-lat); font-size: 13.5px; color: var(--mute); direction: ltr; text-align: right; overflow-wrap: anywhere; }
.req__meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 14px 0 16px; font-size: 14.5px; color: var(--mute); }
.req__meta strong { color: var(--white); font-weight: 600; }

/* ---------------------------------------------------------------------
   التبويبات والبحث
   --------------------------------------------------------------------- */
.seg {
  display: flex; gap: 4px; padding: 4px; border-radius: 100px;
  background: var(--ink-3); border: 1px solid var(--line-2);
  overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg__btn {
  flex: 1 0 auto; min-height: 42px; padding: 0 16px; border: 0; border-radius: 100px;
  background: transparent; color: var(--mute); font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
}
.seg__btn.is-active { background: var(--green); color: var(--black); }
.seg__btn .num { font-size: 13px; opacity: .8; margin-inline-start: 4px; }

.search { position: relative; margin: 14px 0; }
.search svg { position: absolute; top: 50%; inset-inline-start: 16px; transform: translateY(-50%); width: 20px; height: 20px; color: var(--mute-2); pointer-events: none; }
.search input { padding-inline-start: 46px !important; }

/* ---------------------------------------------------------------------
   النماذج
   --------------------------------------------------------------------- */
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 15px; }
.field small { color: var(--mute-2); font-size: 13.5px; }
.input, .select, .textarea {
  width: 100%; min-height: 52px; padding: 12px 16px;
  background: var(--ink-1); color: var(--white);
  border: 1px solid var(--line); border-radius: 14px;
  font-size: 16px; /* 16px يمنع التكبير التلقائي في iPhone */
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2392E0A1' stroke-width='2' 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 14px center; padding-inline-end: 44px;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(146, 224, 161, .18); }
.input::placeholder, .textarea::placeholder { color: var(--mute-2); }

/* اختيار الموظفين (Checklist) */
.pick { display: grid; gap: 8px; max-height: 46dvh; overflow-y: auto; padding: 2px; }
.pick__opt {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 14px; border-radius: 14px;
  background: var(--ink-1); border: 1px solid var(--line-2); cursor: pointer;
}
.pick__opt input { position: absolute; opacity: 0; pointer-events: none; }
.pick__box { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--g-46); flex: none; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.pick__box svg { width: 16px; height: 16px; color: var(--black); opacity: 0; }
.pick__opt input:checked ~ .pick__box { background: var(--green); border-color: var(--green); }
.pick__opt input:checked ~ .pick__box svg { opacity: 1; }
.pick__opt:has(input:checked) { border-color: var(--green-line); background: var(--green-soft); }
.pick__opt input:focus-visible ~ .pick__box { outline: 2px solid var(--green); outline-offset: 2px; }
.pick__txt { flex: 1; min-width: 0; }
.pick__name { font-weight: 600; }
.pick__job { color: var(--mute); font-size: 14px; }

/* ---------------------------------------------------------------------
   النافذة السفلية (Bottom Sheet) / الحوار
   --------------------------------------------------------------------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0, 0, 0, .62);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .25s var(--ease);
}
.sheet {
  width: 100%; max-width: 640px; max-height: calc(100dvh - var(--safe-t) - 24px);
  display: flex; flex-direction: column;
  background: var(--ink-2); border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 26px 26px 0 0;
  animation: sheetUp .35s var(--ease);
  overscroll-behavior: contain;
}
.sheet__handle { width: 44px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .18); margin: 10px auto 0; flex: none; }
.sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 22px 6px; flex: none; }
.sheet__title { font-family: var(--f-disp); font-weight: 800; font-size: 26px; line-height: 1.2; margin: 2px 0 0; }
.sheet__body { padding: 8px 22px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet__foot { padding: 12px 22px calc(16px + var(--safe-b)); border-top: 1px solid var(--line-2); flex: none; }
@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { border-radius: 26px; border-bottom: 1px solid var(--line-2); max-height: 86vh; }
  .sheet__handle { display: none; }
  .sheet__foot { padding-bottom: 18px; }
}
.sheet-backdrop.is-closing { animation: fadeOut .2s var(--ease) forwards; }
.sheet-backdrop.is-closing .sheet { animation: sheetDown .22s var(--ease) forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
@keyframes sheetDown { to { transform: translateY(40px); opacity: 0; } }

.steps { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.steps li { position: relative; padding-inline-start: 20px; color: var(--mute); }
.steps li::before { content: ""; position: absolute; inset-inline-start: 0; top: .72em; width: 7px; height: 7px; background: var(--green); }

.kv { display: grid; gap: 12px; margin: 16px 0; padding: 16px; border-radius: var(--r); background: var(--ink-1); border: 1px solid var(--line-2); }
.kv__row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.kv__row span:first-child { color: var(--mute); }
.kv__row span:last-child { text-align: left; font-weight: 500; overflow-wrap: anywhere; }

.divider { height: 1px; background: var(--line-2); margin: 20px 0; border: 0; }
.label-sm { font-weight: 700; font-size: 15px; margin: 18px 0 10px; display: block; }

/* ---------------------------------------------------------------------
   شاشات الدخول والحالات
   --------------------------------------------------------------------- */
.gate {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 28px) calc(var(--pad) + var(--safe-r)) calc(var(--safe-b) + 28px) calc(var(--pad) + var(--safe-l));
  position: relative; overflow: hidden;
}
.gate::before {
  /* خطوط الشبكة كما في دليل الهوية */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    linear-gradient(var(--line-2) 1px, transparent 1px) 0 22% / 100% 100% no-repeat,
    linear-gradient(var(--line-2) 1px, transparent 1px) 0 64% / 100% 100% no-repeat,
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px) 18% 0 / 100% 100% no-repeat,
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px) 82% 0 / 100% 100% no-repeat;
}
.gate__top { display: flex; justify-content: space-between; align-items: center; position: relative; }
.gate__top img { height: 26px; width: auto; }
.gate__body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 460px; width: 100%; margin: 0 auto; position: relative; padding: 32px 0; }
.gate__logo { width: min(220px, 60vw); margin-bottom: 28px; }
.gate__title { font-family: var(--f-disp); font-weight: 800; font-size: clamp(36px, 10vw, 52px); line-height: 1.08; margin: 12px 0 12px; }
.gate__title em { font-style: normal; color: var(--green); }
.gate__text { color: var(--mute); font-size: 17px; margin: 0 0 28px; }
.gate__foot { position: relative; text-align: center; color: var(--mute-2); font-size: 13px; font-family: var(--f-lat); letter-spacing: .08em; }
.gate__icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin-bottom: 20px; }
.gate__icon svg { width: 32px; height: 32px; }
.gate__icon--wait { background: var(--orange-soft); color: var(--orange); }
.gate__icon--no { background: var(--red-soft); color: var(--red); }
.gate__icon--ok { background: var(--green-soft); color: var(--green); }
.gate__mail { display: inline-block; font-family: var(--f-lat); font-size: 14px; direction: ltr; color: var(--mute); padding: 6px 12px; border-radius: 100px; background: var(--ink-3); border: 1px solid var(--line-2); margin-bottom: 22px; max-width: 100%; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------------
   الحالات الفارغة والتحميل والتنبيهات
   --------------------------------------------------------------------- */
.empty { text-align: center; padding: 36px 20px; border-radius: var(--r-lg); border: 1px dashed var(--line); color: var(--mute); }
.empty svg { width: 40px; height: 40px; color: var(--g-46); margin: 0 auto 12px; }
.empty__title { font-family: var(--f-disp); font-weight: 700; font-size: 22px; color: var(--white); margin-bottom: 4px; }

.skel { border-radius: var(--r); background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink-4) 50%, var(--ink-3) 100%); background-size: 200% 100%; animation: skel 1.2s linear infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.toasts {
  position: fixed; z-index: 120; inset-inline: 0; top: calc(var(--safe-t) + 12px);
  display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px;
}
.toast {
  pointer-events: auto; max-width: 520px; width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 16px;
  background: var(--g-16); border: 1px solid var(--line); color: var(--white);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  font-weight: 500; animation: toastIn .35s var(--ease);
}
.toast svg { width: 22px; height: 22px; flex: none; color: var(--green); }
.toast--error { border-color: var(--red-line); }
.toast--error svg { color: var(--red); }
.toast.is-out { animation: fadeOut .25s forwards; }
.toast__btn { margin-inline-start: auto; background: none; border: 0; color: var(--green); font-weight: 700; cursor: pointer; min-height: 36px; padding: 0 4px; }
@keyframes toastIn { from { transform: translateY(-14px); opacity: 0; } }

.offline-bar { position: fixed; z-index: 90; inset-inline: 0; bottom: calc(var(--nav-h) + var(--safe-b)); text-align: center; padding: 8px; background: var(--orange); color: var(--black); font-weight: 600; font-size: 14px; }
@media (min-width: 960px) { .offline-bar { bottom: 0; } }

.fade-in { animation: pageIn .35s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------------
   شاشة التثبيت
   --------------------------------------------------------------------- */
.install .gate__body { justify-content: flex-start; padding-top: 24px; }
.install__icon { width: 88px; height: 88px; border-radius: 22px; border: 1px solid var(--line); margin-bottom: 18px; box-shadow: 0 18px 40px rgba(146, 224, 161, .12); }
.install__seg { margin: 4px 0 16px; }
.install__now { margin-top: 2px; }
.install__warn { margin-bottom: 12px; }
.install__steps { list-style: none; margin: 16px 0 12px; padding: 0; display: grid; gap: 12px; }
.install__step { padding: 16px; }
.install__head { display: flex; gap: 12px; align-items: flex-start; }
.install__num { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--green); color: var(--black); font-weight: 700; }
.install__title { font-family: var(--f-disp); font-weight: 700; font-size: 21px; line-height: 1.3; }
.install__ill { margin-top: 14px; display: flex; justify-content: center; }
.ill { width: min(220px, 64vw); height: auto; font-family: var(--f-text); direction: ltr; }

/* ---------------------------------------------------------------------
   بطاقة تفعيل الإشعارات
   --------------------------------------------------------------------- */
.push-card { border-color: var(--green-line); background: linear-gradient(135deg, rgba(146, 224, 161, .12), var(--ink-3) 60%); margin-bottom: 18px; }
.push-card--granted { border-color: var(--line-2); background: var(--ink-3); }
.push-card--denied, .push-card--needs-install { border-color: rgba(254, 104, 6, .35); background: var(--orange-soft); }
.push-card__row { display: flex; align-items: center; gap: 14px; }
.push-card__icon { width: 46px; height: 46px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--green); color: var(--black); }
.push-card--denied .push-card__icon, .push-card--needs-install .push-card__icon { background: var(--orange); }
.push-card__icon svg { width: 24px; height: 24px; }
.push-card__title { font-family: var(--f-disp); font-weight: 700; font-size: 21px; line-height: 1.3; }

/* شريط وضع الإشراف */
.rolebar { display: flex; align-items: center; gap: 10px; margin: -6px 0 18px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); color: var(--mute); font-size: 14px; }
.rolebar svg { width: 18px; height: 18px; color: var(--green); flex: none; }
.chip--role { background: rgba(146, 224, 161, .08); color: var(--g-soft); border-color: var(--line); }
.chip--role::before { display: none; }

/* اختيار الصلاحية */
.access { display: grid; gap: 8px; }
.access__opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--ink-1); border: 1px solid var(--line-2); cursor: pointer; }
.access__opt input { margin-top: 5px; accent-color: var(--green); width: 20px; height: 20px; flex: none; }
.access__opt:has(input:checked) { border-color: var(--green-line); background: var(--green-soft); }
.access__name { font-weight: 700; }
.access__desc { color: var(--mute); font-size: 14px; }
