/* ==========================================================================
   نشاط · نظام التصميم (الإصدار 2)
   هوية الهيئة الملكية للجبيل وينبع: الكحلي أساسًا، والبنفسجي والسماوي والأخضر مساندة.
   العناوين والأزرار والأرقام بخط Ping AR + LT، والنص بخط القاهرة إلى حين توفر وزن Regular من Ping.
   كل الألوان رموز (tokens) لها قيمة نهارية وليلية. الحركة تُلغى عند «تقليل الحركة».
   ========================================================================== */

@font-face { font-family: "Ping"; src: url("../fonts/PingARLT-ExtraLight.366335e2a1cc.woff") format("woff"); font-weight: 200; font-display: swap; }
@font-face { font-family: "Ping"; src: url("../fonts/PingARLT-Bold.b5c5fb3c4956.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Ping"; src: url("../fonts/PingARLT-Black.3465ce22fde0.woff") format("woff"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("../fonts/Cairo-Variable.0e355a997fd3.ttf") format("truetype"); font-weight: 200 1000; font-display: swap; }

:root {
  /* ألوان الهيئة الرسمية */
  --navy: #052976; --navy-2: #103576;
  --sky: #4cc4ff; --sky-l: #a4e0ff; --sky-xl: #ecf8ff;
  --green: #20cc76; --green-d: #0a9d76;
  --blue: #2633ff; --blue-xl: #f3f4ff;
  --violet: #8142ff; --violet-l: #bf9fff; --violet-xl: #f1ebff;
  --beige: #bc9470; --beige-l: #dcc8b6; --sand: #f4eee9; --ivory: #fff9f3;
  --red: #d92d20; --red-xl: #fdecea;

  /* رموز الواجهة (النهاري) */
  --bg: #f4f6fc;
  --bg-tint: radial-gradient(1200px 600px at 100% -10%, rgba(129,66,255,.07), transparent 60%),
             radial-gradient(900px 500px at -10% 0%, rgba(76,196,255,.08), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f8f9fe;
  --surface-3: #eff2fa;
  --glass: rgba(255, 255, 255, .7);
  --glass-strong: rgba(255, 255, 255, .86);
  --border: rgba(5, 41, 118, .08);
  --border-2: rgba(5, 41, 118, .15);
  --heading: #052976;
  --text: #13265a;
  --text-2: #3d4d77;
  --muted: #66749a;
  --link: #2633ff;
  --primary: #052976;
  --primary-2: #1d3f9a;
  --on-primary: #ffffff;
  --hover: rgba(5, 41, 118, .045);
  --active-bg: linear-gradient(90deg, rgba(129,66,255,.10), rgba(76,196,255,.10));
  --ring: 0 0 0 3px rgba(76, 196, 255, .45);
  --input-bg: #ffffff;
  --sh-1: 0 1px 2px rgba(5,41,118,.05), 0 1px 1px rgba(5,41,118,.03);
  --sh-2: 0 1px 2px rgba(5,41,118,.05), 0 8px 24px -8px rgba(5,41,118,.12);
  --sh-3: 0 2px 4px rgba(5,41,118,.06), 0 24px 48px -16px rgba(5,41,118,.22);
  --ok-bg: #e7f8f1; --ok-fg: #066048; --ok-bd: #b5e9d5;
  --err-bg: #fdeeec; --err-fg: #8f1d14; --err-bd: #f3c4bf;
  --warn-bg: #fff6e6; --warn-fg: #7a4d0b; --warn-bd: #f2d9ae;
  --info-bg: #edf8ff; --info-fg: #0a4c7a; --info-bd: #bfe6fb;

  --radius-sm: 10px; --radius: 16px; --radius-lg: 22px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .5, 1);
  --t-fast: 140ms; --t: 240ms; --t-slow: 520ms;
  --topbar-h: 68px;
  --font-ui: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --font-brand: "Ping", "Cairo", "Segoe UI", Tahoma, sans-serif;
  color-scheme: light;
}

/* الوضع الليلي: من إعداد الجهاز، أو باختيار المستخدم */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060b1e;
    --bg-tint: radial-gradient(1200px 600px at 100% -10%, rgba(129,66,255,.16), transparent 60%),
               radial-gradient(900px 500px at -10% 0%, rgba(76,196,255,.10), transparent 60%);
    --surface: #0c1431; --surface-2: #0f1a3c; --surface-3: #142047;
    --glass: rgba(12, 20, 49, .62); --glass-strong: rgba(12, 20, 49, .84);
    --border: rgba(164, 224, 255, .09); --border-2: rgba(164, 224, 255, .17);
    --heading: #ffffff; --text: #e3e9ff; --text-2: #b8c3e6; --muted: #8592bb; --link: #8fd6ff;
    --primary: #4cc4ff; --primary-2: #7ad3ff; --on-primary: #041a44;
    --hover: rgba(164, 224, 255, .06);
    --active-bg: linear-gradient(90deg, rgba(129,66,255,.26), rgba(76,196,255,.16));
    --input-bg: #0a1230;
    --sh-1: 0 1px 2px rgba(0,0,0,.4); --sh-2: 0 10px 30px -10px rgba(0,0,0,.6); --sh-3: 0 30px 60px -20px rgba(0,0,0,.75);
    --ok-bg: rgba(32,204,118,.12); --ok-fg: #7be8b4; --ok-bd: rgba(32,204,118,.3);
    --err-bg: rgba(217,45,32,.14); --err-fg: #ffb3ac; --err-bd: rgba(217,45,32,.35);
    --warn-bg: rgba(242,173,60,.12); --warn-fg: #ffd28a; --warn-bd: rgba(242,173,60,.3);
    --info-bg: rgba(76,196,255,.10); --info-fg: #a4e0ff; --info-bd: rgba(76,196,255,.28);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #060b1e;
  --bg-tint: radial-gradient(1200px 600px at 100% -10%, rgba(129,66,255,.16), transparent 60%),
             radial-gradient(900px 500px at -10% 0%, rgba(76,196,255,.10), transparent 60%);
  --surface: #0c1431; --surface-2: #0f1a3c; --surface-3: #142047;
  --glass: rgba(12, 20, 49, .62); --glass-strong: rgba(12, 20, 49, .84);
  --border: rgba(164, 224, 255, .09); --border-2: rgba(164, 224, 255, .17);
  --heading: #ffffff; --text: #e3e9ff; --text-2: #b8c3e6; --muted: #8592bb; --link: #8fd6ff;
  --primary: #4cc4ff; --primary-2: #7ad3ff; --on-primary: #041a44;
  --hover: rgba(164, 224, 255, .06);
  --active-bg: linear-gradient(90deg, rgba(129,66,255,.26), rgba(76,196,255,.16));
  --input-bg: #0a1230;
  --sh-1: 0 1px 2px rgba(0,0,0,.4); --sh-2: 0 10px 30px -10px rgba(0,0,0,.6); --sh-3: 0 30px 60px -20px rgba(0,0,0,.75);
  --ok-bg: rgba(32,204,118,.12); --ok-fg: #7be8b4; --ok-bd: rgba(32,204,118,.3);
  --err-bg: rgba(217,45,32,.14); --err-fg: #ffb3ac; --err-bd: rgba(217,45,32,.35);
  --warn-bg: rgba(242,173,60,.12); --warn-fg: #ffd28a; --warn-bd: rgba(242,173,60,.3);
  --info-bg: rgba(76,196,255,.10); --info-fg: #a4e0ff; --info-bd: rgba(76,196,255,.28);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- الأساس */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  color: var(--text);
  background: var(--bg-tint), var(--bg);
  background-attachment: fixed;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
::selection { background: rgba(129, 66, 255, .22); }
a { color: var(--link); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 {
  margin: 0 0 .7rem; font-family: var(--font-brand); font-weight: 700; color: var(--heading);
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; line-height: 1.45; text-wrap: balance;
}
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
h1 .ic, h2 .ic { color: var(--violet); }
.muted { color: var(--muted); font-weight: 400; }
small, .small { font-size: .85rem; }
/* عزل التواريخ والأرقام اللاتينية داخل النص العربي حتى لا ينقلب ترتيبها */
[dir="ltr"] { unicode-bidi: isolate; }
span[dir="ltr"], strong[dir="ltr"], dd[dir="ltr"] { direction: ltr; unicode-bidi: isolate; }
span[dir="ltr"], strong[dir="ltr"] { display: inline-block; }
.center { text-align: center; }
.pre { white-space: pre-line; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

.ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; stroke: currentColor; }
.ic-missing { display: inline-block; width: 1.15em; height: 1.15em; border-radius: 50%; background: var(--sky-l); vertical-align: -0.2em; }

.skip-link { position: absolute; inset-inline-start: 1rem; top: -60px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: .5rem 1rem; border-radius: 10px; }
.skip-link:focus { top: .7rem; }

/* ---------------------------------------------------------------- التدرج اللوني المتحرك */
.mesh { position: absolute; inset: 0; overflow: hidden; pointer-events: none; isolation: isolate; background: #061a55; }
.mesh > span {
  position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%;
  will-change: transform; opacity: .9; mix-blend-mode: screen;
  animation: mesh-drift var(--d, 22s) var(--ease) infinite alternate;
}
.mesh > span:nth-child(1) { --d: 24s; background: radial-gradient(circle, #8142ff 0%, rgba(129,66,255,0) 65%); top: -30%; right: -15%; }
.mesh > span:nth-child(2) { --d: 28s; background: radial-gradient(circle, #4cc4ff 0%, rgba(76,196,255,0) 62%); bottom: -35%; left: -10%; animation-delay: -6s; }
.mesh > span:nth-child(3) { --d: 32s; background: radial-gradient(circle, #20cc76 0%, rgba(32,204,118,0) 60%); top: 20%; left: 30%; width: 55%; opacity: .55; animation-delay: -12s; }
.mesh > span:nth-child(4) { --d: 26s; background: radial-gradient(circle, #2633ff 0%, rgba(38,51,255,0) 62%); top: -20%; left: -20%; animation-delay: -3s; }
.mesh > i { /* بقعة ضوء تتبع مؤشر الفأرة */
  position: absolute; width: 46%; aspect-ratio: 1; border-radius: 50%;
  left: calc(var(--mx, 50) * 1%); top: calc(var(--my, 40) * 1%);
  transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(164,224,255,.38), rgba(164,224,255,0) 60%);
  transition: left 1.2s var(--ease), top 1.2s var(--ease); mix-blend-mode: screen;
}
.mesh::after { /* حبيبات خفيفة تمنع تشرّط التدرج */
  content: ""; position: absolute; inset: 0; opacity: .16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes mesh-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  33%  { transform: translate3d(-12%, 10%, 0) scale(1.15) rotate(20deg); }
  66%  { transform: translate3d(10%, -6%, 0) scale(.92) rotate(-10deg); }
  100% { transform: translate3d(-6%, -12%, 0) scale(1.08) rotate(14deg); }
}
.paused .mesh > span { animation-play-state: paused; }

/* ---------------------------------------------------------------- الرأس */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0 1.4rem; background: var(--glass); border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(170%) blur(18px); backdrop-filter: saturate(170%) blur(18px);
  view-transition-name: topbar;
}
.topbar::after { /* خط الهوية المتدرج أسفل الرأس */
  content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--sky), var(--violet), var(--navy), var(--green));
  background-size: 300% 100%; animation: line-flow 14s linear infinite; opacity: .85;
}
@keyframes line-flow { to { background-position: 300% 0; } }
.brand-wrap { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.brand { display: flex; align-items: center; gap: .8rem; min-width: 0; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none; position: relative; overflow: hidden;
  display: grid; place-items: center; color: #fff; font: 900 1.25rem/1 var(--font-brand);
  background: linear-gradient(135deg, var(--navy) 0%, var(--violet) 55%, var(--sky) 100%);
  box-shadow: 0 6px 16px -6px rgba(129, 66, 255, .6), inset 0 1px 0 rgba(255,255,255,.25);
}
.logo { height: 44px; }
.brand-org { font-size: .76rem; color: var(--muted); line-height: 1.3; }
.brand-app { font-family: var(--font-brand); font-weight: 700; font-size: 1.02rem; color: var(--heading); line-height: 1.35; white-space: nowrap; }
.userbox { display: flex; align-items: center; gap: .55rem; }
.userbox form { margin: 0; }
.uchip { display: flex; align-items: center; gap: .6rem; padding: .25rem .35rem .25rem .8rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font: 700 .9rem/1 var(--font-brand); color: #fff;
  background: conic-gradient(from 140deg, var(--violet), var(--sky), var(--green), var(--violet));
}
.uname { font-weight: 700; font-size: .9rem; color: var(--heading); line-height: 1.2; }
.urole { font-size: .74rem; color: var(--muted); line-height: 1.2; display: block; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; flex: none;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { color: var(--violet); border-color: var(--border-2); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .ic { width: 1.2em; height: 1.2em; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
.nav-toggle { display: none; }

/* ---------------------------------------------------------------- القائمة الجانبية */
.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 1.1rem .75rem 1.5rem; display: flex; flex-direction: column; gap: 2px;
  border-inline-end: 1px solid var(--border); background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  scrollbar-width: thin; view-transition-name: sidebar;
}
.nav-label { font: 700 .7rem/1 var(--font-brand); color: var(--muted); letter-spacing: .04em; padding: .2rem .8rem .55rem; }
.navlink {
  position: relative; display: flex; align-items: center; gap: .7rem;
  color: var(--text-2); padding: .5rem .7rem; border-radius: 12px; font-weight: 600; font-size: .93rem;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.navlink:hover { background: var(--hover); color: var(--heading); text-decoration: none; }
.navlink:active { transform: scale(.985); }
.navlink.active { background: var(--active-bg); color: var(--heading); font-weight: 700; }
.navlink.active::before { /* مؤشر جانبي متدرج */
  content: ""; position: absolute; inset-inline-start: -.75rem; top: 22%; bottom: 22%; width: 3px; border-radius: 0 4px 4px 0;
  background: linear-gradient(var(--sky), var(--violet));
}
.navicon {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: var(--surface-3); color: var(--text-2); transition: background var(--t-fast), color var(--t-fast), transform var(--t) var(--ease-spring);
}
.navlink:hover .navicon { transform: translateY(-1px) rotate(-4deg); color: var(--violet); }
.navlink.active .navicon { background: linear-gradient(135deg, var(--navy), var(--violet)); color: #fff; box-shadow: 0 6px 14px -6px rgba(129,66,255,.7); }
.count {
  margin-inline-start: auto; min-width: 22px; height: 22px; padding: 0 .45rem; border-radius: 99px;
  display: inline-grid; place-items: center; font: 700 .72rem/1 var(--font-brand); color: #fff;
  background: linear-gradient(135deg, var(--violet), #a26bff); box-shadow: 0 0 0 3px rgba(129,66,255,.15);
}
.content { padding: 1.8rem 2.2rem 2rem; max-width: 1320px; width: 100%; min-width: 0; view-transition-name: content; }
.app-footer { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.scrim { display: none; }

/* ---------------------------------------------------------------- البطاقات */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--sh-1);
  padding: 1.25rem 1.4rem; margin-bottom: 1.15rem; border: 1px solid var(--border);
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease);
}
.card:hover { box-shadow: var(--sh-2); }
.card > h2:first-child { padding-bottom: .7rem; margin-bottom: .8rem; border-bottom: 1px solid var(--border); }
.card.empty { text-align: center; padding: 2.8rem; color: var(--muted); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .7rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.3rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head h1 .ic {
  width: 40px; height: 40px; padding: 9px; border-radius: 12px; color: #fff; vertical-align: middle;
  background: linear-gradient(135deg, var(--navy), var(--violet)); box-shadow: 0 8px 18px -8px rgba(129,66,255,.65);
}

/* بطاقات المؤشرات (KPI) */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.tile {
  position: relative; overflow: hidden; display: flex; gap: 1rem; align-items: center;
  background: var(--surface); border-radius: var(--radius); padding: 1.15rem 1.2rem;
  box-shadow: var(--sh-1); border: 1px solid var(--border); color: var(--text);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t);
}
.tile::after { /* لمعة متدرجة تظهر عند المرور */
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3px; opacity: 0;
  background: linear-gradient(90deg, var(--sky), var(--violet)); transition: opacity var(--t) var(--ease);
}
a.tile:hover, .tile:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--sh-3); border-color: var(--border-2); }
.tile:hover::after { opacity: 1; }
.tile-icon {
  width: 50px; height: 50px; border-radius: 15px; display: inline-grid; place-items: center; font-size: 1.3rem; flex: none;
  transition: transform var(--t) var(--ease-spring);
}
.tile:hover .tile-icon { transform: scale(1.08) rotate(-6deg); }
.tile-num { font: 900 1.85rem/1.1 var(--font-brand); color: var(--heading); font-variant-numeric: tabular-nums; }
.tile-label { color: var(--muted); font-size: .86rem; line-height: 1.5; }
a.tile .tile-label::after { content: " ←"; opacity: 0; transition: opacity var(--t-fast), margin var(--t-fast); }
a.tile:hover .tile-label::after { opacity: 1; }
.c-navy { background: rgba(5,41,118,.08); color: var(--navy); }
.c-green { background: rgba(10,157,118,.12); color: var(--green-d); }
.c-violet { background: rgba(129,66,255,.12); color: var(--violet); }
.c-sky { background: rgba(76,196,255,.16); color: #0a7fb8; }
.c-red { background: rgba(217,45,32,.10); color: var(--red); }
.c-gold { background: rgba(188,148,112,.16); color: #8a6440; }
:root[data-theme="dark"] .c-navy { background: rgba(164,224,255,.10); color: var(--sky-l); }
:root[data-theme="dark"] .c-sky { color: var(--sky); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .c-navy { background: rgba(164,224,255,.10); color: var(--sky-l); }
  :root:not([data-theme="light"]) .c-sky { color: var(--sky); }
}

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.4rem; margin: 0 0 .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; color: var(--heading); }
.ack { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1.1rem; margin: .7rem 0; }
.change { border-top: 1px solid var(--border); padding: .8rem 0; }
.change:first-of-type { border-top: 0; }

/* ---------------------------------------------------------------- الأزرار */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--heading);
  border-radius: 12px; padding: .5rem 1.05rem; font: 700 .9rem/1.4 var(--font-brand); cursor: pointer; white-space: nowrap;
  box-shadow: var(--sh-1);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease), background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:hover { background: var(--surface-2); border-color: var(--violet-l); text-decoration: none; transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(0) scale(.97); box-shadow: var(--sh-1); }
.btn.primary {
  color: #fff; border-color: transparent; overflow: hidden;
  background: linear-gradient(135deg, var(--navy) 0%, #2a2fc0 55%, var(--violet) 100%);
  background-size: 160% 160%; background-position: 0% 50%;
  box-shadow: 0 8px 20px -8px rgba(38, 51, 255, .55), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn.primary:hover { background-position: 100% 50%; box-shadow: 0 14px 28px -10px rgba(129, 66, 255, .65), inset 0 1px 0 rgba(255,255,255,.22); }
.btn.primary::after { /* لمعة تعبر الزر عند المرور */
  content: ""; position: absolute; inset: 0; transform: translateX(120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  transition: transform 700ms var(--ease);
}
.btn.primary:hover::after { transform: translateX(-120%); }
.btn.danger { color: var(--red); border-color: var(--err-bd); }
.btn.danger:hover { background: var(--err-bg); border-color: var(--red); }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); border-color: var(--border); }
.btn.small { padding: .28rem .75rem; font-size: .8rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btns { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row-actions { display: flex; gap: .35rem; align-items: center; }
.row-actions form { margin: 0; }
.submit-row { margin-top: 1.1rem; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------- الشارات والحالات */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .7rem; border-radius: 99px;
  font-size: .76rem; font-weight: 700; white-space: nowrap; line-height: 1.6;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge:has(.ic)::before { display: none; }
.st-draft { background: rgba(188,148,112,.18); color: #7a5a3b; }
.st-pending_head { background: rgba(76,196,255,.18); color: #0a5f8f; }
.st-pending_vice { background: rgba(129,66,255,.15); color: #6a2ff0; }
.st-approved { background: rgba(10,157,118,.14); color: #077a5c; }
.st-rejected { background: rgba(217,45,32,.12); color: #b3261c; }
.st-pending_coord { background: rgba(164,224,255,.3); color: #0a5f8f; }
.st-pending_fund { background: rgba(188,148,112,.22); color: #7a5a3b; }
.st-paid { background: rgba(32,204,118,.16); color: #067a46; }
.ev-scheduled { background: rgba(16,53,118,.1); color: var(--navy-2); }
.ev-upcoming { background: rgba(76,196,255,.18); color: #0a5f8f; }
.ev-awaiting_report { background: rgba(188,148,112,.2); color: #7a5a3b; }
.ev-done { background: rgba(10,157,118,.14); color: #077a5c; }
.ev-cancelled { background: rgba(120,130,150,.15); color: var(--muted); text-decoration: line-through; }
:root[data-theme="dark"] :is(.st-draft, .st-pending_fund, .ev-awaiting_report) { color: #e6c9ac; }
:root[data-theme="dark"] :is(.st-pending_head, .st-pending_coord, .ev-upcoming) { color: var(--sky-l); }
:root[data-theme="dark"] .st-pending_vice { color: var(--violet-l); }
:root[data-theme="dark"] :is(.st-approved, .st-paid, .ev-done) { color: #7be8b4; }
:root[data-theme="dark"] .st-rejected { color: #ffb3ac; }
:root[data-theme="dark"] .ev-scheduled { background: rgba(164,224,255,.1); color: var(--sky-l); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.st-draft, .st-pending_fund, .ev-awaiting_report) { color: #e6c9ac; }
  :root:not([data-theme="light"]) :is(.st-pending_head, .st-pending_coord, .ev-upcoming) { color: var(--sky-l); }
  :root:not([data-theme="light"]) .st-pending_vice { color: var(--violet-l); }
  :root:not([data-theme="light"]) :is(.st-approved, .st-paid, .ev-done) { color: #7be8b4; }
  :root:not([data-theme="light"]) .st-rejected { color: #ffb3ac; }
  :root:not([data-theme="light"]) .ev-scheduled { background: rgba(164,224,255,.1); color: var(--sky-l); }
}
/* «خارج الخطة» شارة بإطار متقطع حتى لا تختلط بحالة «بانتظار التقرير» */
.out-plan { background: transparent; color: #a0764e; border: 1.5px dashed var(--beige); }
.out-plan::before { display: none; }
.legend { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .9rem; }

/* ---------------------------------------------------------------- التنبيهات */
.messages { margin-bottom: 1.1rem; display: flex; flex-direction: column; gap: .5rem; }
.alert {
  border-radius: 12px; padding: .75rem 1rem; margin-bottom: .6rem; border: 1px solid var(--border);
  background: var(--surface); display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
  animation: alert-in var(--t-slow) var(--ease) both;
}
.messages .alert { margin: 0; }
@keyframes alert-in { from { opacity: 0; transform: translateY(-6px); } }
.alert.success { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-fg); }
.alert.error { background: var(--err-bg); border-color: var(--err-bd); color: var(--err-fg); font-weight: 600; }
.alert.warning { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-fg); }
.alert.info { background: var(--info-bg); border-color: var(--info-bd); color: var(--info-fg); }
.issues { color: var(--red); font-size: .8rem; font-weight: 600; }

/* ---------------------------------------------------------------- الجداول */
.table-wrap { overflow-x: auto; }
.card > .table, .card .table { margin: 0 -.2rem; width: calc(100% + .4rem); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: transparent; }
.table th {
  text-align: start; font-size: .76rem; color: var(--muted); font-weight: 700; letter-spacing: .02em;
  border-bottom: 1px solid var(--border-2); padding: .55rem .7rem; white-space: nowrap; background: transparent;
}
.table td { border-bottom: 1px solid var(--border); padding: .7rem .7rem; vertical-align: middle; transition: background var(--t-fast); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--hover); }
.table tbody tr:hover td:first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; }
.table tbody tr:hover td:last-child { border-start-end-radius: 10px; border-end-end-radius: 10px; }
.table tr.muted td { opacity: .6; }
.table td.empty { text-align: center; color: var(--muted); padding: 1.6rem; }
.table tbody tr:hover td.empty { background: transparent; }

/* ---------------------------------------------------------------- النماذج */
.form { max-width: 780px; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.field label { font-weight: 700; font-size: .88rem; color: var(--heading); }
.field.check { flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: .55rem; }
.req { color: var(--red); }
.help { color: var(--muted); font-size: .8rem; }
.err { color: var(--red); font-size: .85rem; font-weight: 600; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red); box-shadow: 0 0 0 3px rgba(217,45,32,.12); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=time], input[type=number], input[type=month], input[type=url], input[type=tel], select, textarea, input:not([type]) {
  font: inherit; color: var(--text); border: 1px solid var(--border-2); border-radius: 12px; padding: .55rem .85rem;
  background: var(--input-bg); width: 100%; box-shadow: var(--sh-1) inset;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast);
}
input:hover, select:hover, textarea:hover { border-color: var(--violet-l); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: var(--ring); }
input[type=file] { font: inherit; color: var(--text-2); }
input[type=file]::file-selector-button { font: 700 .85rem var(--font-brand); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--heading); border-radius: 10px; padding: .35rem .8rem; margin-inline-end: .7rem; cursor: pointer; }
.field ul { list-style: none; padding: 0; margin: 0; columns: 2; }
.field ul li label { font-weight: 400; display: flex; gap: .4rem; align-items: center; }
.filters { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.1rem; }
.filters input, .filters select { width: auto; min-width: 180px; }
label.inline { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.search-lg { font-size: 1.05rem; padding: .8rem 1.1rem; margin-bottom: .9rem; border-radius: 14px; }
.pager { display: flex; gap: .8rem; align-items: center; justify-content: center; margin: 1.1rem 0; }
.field > div[id] { display: flex; flex-wrap: wrap; gap: .45rem 1.4rem; }
.field > div[id] label { font-weight: 500; display: inline-flex; gap: .4rem; align-items: center; cursor: pointer; }
.field input[type=radio], .field input[type=checkbox] { width: auto; accent-color: var(--violet); }

/* ---------------------------------------------------------------- التقويم */
.calendar { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--sh-1); border: 1px solid var(--border); }
.calendar th { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; padding: .55rem; font: 700 .85rem var(--font-brand); }
.calendar td { border-inline-start: 1px solid var(--border); border-top: 1px solid var(--border); vertical-align: top; height: 112px; padding: .35rem; transition: background var(--t-fast); }
.calendar td:hover { background: var(--hover); }
.calendar td.other { background: var(--surface-2); color: var(--muted); opacity: .7; }
.calendar td.today { box-shadow: inset 0 0 0 2px var(--violet); background: rgba(129,66,255,.05); }
.daynum { font: 700 .8rem var(--font-brand); text-align: end; color: var(--muted); }
.calendar td.today .daynum { color: var(--violet); }
.cal-ev { display: block; font-size: .74rem; border-radius: 7px; padding: .1rem .4rem; margin-top: .22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: transform var(--t-fast) var(--ease), filter var(--t-fast); }
.cal-ev:hover { text-decoration: none; transform: translateX(-2px); filter: brightness(1.05); }
.cal-ev.is-out { box-shadow: inset -3px 0 0 var(--beige); }

/* ---------------------------------------------------------------- الإنجازات */
.medal-gold { background: linear-gradient(135deg, #c9a27c, #a9805a); color: #fff; }
.medal-silver { background: linear-gradient(135deg, #d4d9e2, #aab2c0); color: #2c3445; }
.medal-bronze { background: linear-gradient(135deg, #c98448, #a35f27); color: #fff; }
.medal-other { background: rgba(129,66,255,.14); color: #6a2ff0; }
.medal-gold::before, .medal-silver::before, .medal-bronze::before { display: none; }
.badge.big { font-size: .92rem; padding: .25rem .95rem; }
.lvl { display: inline-flex; align-items: center; gap: .3rem; }

/* ---------------------------------------------------------------- رفع الملفات والمعرض */
.uploader { background: var(--info-bg); border: 1.5px dashed var(--sky); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1rem; transition: background var(--t), border-color var(--t); }
.uploader:hover { border-color: var(--violet); }
.uploader label.btn { cursor: pointer; }
.upload-log { list-style: none; padding: 0; margin: .8rem 0 0; display: flex; flex-direction: column; gap: .4rem; }
.upload-log li { display: grid; grid-template-columns: 1fr 180px 1.4fr; gap: .6rem; align-items: center; background: var(--surface); border-radius: 10px; padding: .45rem .75rem; border: 1px solid var(--border); }
.upload-log li.ok { border-color: var(--ok-bd); }
.upload-log li.ok .up-msg { color: var(--green-d); font-weight: 700; }
.upload-log li.rejected { border-color: var(--err-bd); background: var(--err-bg); }
.upload-log li.rejected .up-msg { color: var(--red); font-weight: 700; }
.upload-log progress { width: 100%; accent-color: var(--violet); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.gallery figure { margin: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: .45rem; display: flex; flex-direction: column; gap: .35rem; transition: transform var(--t) var(--ease), box-shadow var(--t); }
.gallery figure:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.gallery figure.wide { grid-column: span 2; }
.gallery img, .gallery video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: #000; }
.gallery figcaption { font-size: .75rem; color: var(--muted); }
.inline-form { display: inline; }

/* ---------------------------------------------------------------- الشهادات والتحقق */
.verify { max-width: 540px; }
.verify-ok, .verify-bad { display: flex; align-items: center; justify-content: center; gap: .5rem; font: 900 1.1rem var(--font-brand); border-radius: 14px; padding: .8rem; margin: .8rem 0; }
.verify-ok { background: var(--ok-bg); color: var(--ok-fg); }
.verify-bad { background: var(--err-bg); color: var(--err-fg); }
.sig-preview { background: #fff; border: 1px dashed var(--border-2); border-radius: 14px; padding: 1rem; margin: .8rem 0; text-align: center; }
.sig-preview img { max-width: 320px; max-height: 140px; }

/* ---------------------------------------------------------------- أعضاء الأندية */
.role { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; padding: .08rem .65rem; border-radius: 99px; font-size: .82rem; }
.role-president { background: rgba(188,148,112,.18); color: #8a6440; }
.role-vice_president { background: rgba(129,66,255,.13); color: #6a2ff0; }
.role-executive { background: rgba(76,196,255,.16); color: #0a6aa0; }
.role-member { background: var(--surface-3); color: var(--muted); }
.inline-end { display: flex; gap: .3rem; align-items: center; margin: 0; }
.inline-end input { width: 160px; padding: .25rem .55rem; }

/* ---------------------------------------------------------------- المكافآت */
.hours-form { display: grid; grid-template-columns: 90px 1fr auto; gap: .4rem; align-items: start; margin: 0; }
.hours-form textarea { min-height: 2.4rem; }
tr.over-cap td { background: var(--warn-bg); }
td.small { font-size: .8rem; color: var(--muted); }
.attend .big-btn { font-size: 1.15rem; padding: 1rem; margin: .5rem 0; }

/* ---------------------------------------------------------------- الرئيسية: الواجهة الترحيبية */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); margin-bottom: 1.4rem;
  min-height: 210px; color: #fff; isolation: isolate; box-shadow: var(--sh-3);
}
.hero .mesh { z-index: -1; }
.hero-body { position: relative; padding: 1.9rem 2.1rem; display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; min-height: 210px; }
.hero-kicker { display: inline-flex; align-items: center; gap: .45rem; font: 700 .78rem var(--font-brand); padding: .25rem .75rem; border-radius: 99px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hero h1 { color: #fff; font: 900 clamp(1.5rem, 1.1rem + 1.6vw, 2.3rem)/1.3 var(--font-brand); margin: .7rem 0 .3rem; }
.hero p { margin: 0; color: rgba(255,255,255,.82); font-size: .98rem; }
.hero-side { display: flex; gap: .7rem; flex-wrap: wrap; }
.glass-stat {
  min-width: 150px; padding: .85rem 1.1rem; border-radius: 16px; color: #fff;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.24);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2); transition: transform var(--t) var(--ease), background var(--t);
}
a.glass-stat:hover { text-decoration: none; transform: translateY(-3px); background: rgba(255,255,255,.2); }
.glass-stat b { display: block; font: 900 1.7rem/1.1 var(--font-brand); }
.glass-stat span { font-size: .82rem; opacity: .9; }

/* ---------------------------------------------------------------- الموافقات */
.queue { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1.4rem; }
.queue a {
  display: flex; align-items: center; gap: .7rem; padding: .8rem .9rem; border-radius: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-1);
  transition: transform var(--t) var(--ease), box-shadow var(--t), border-color var(--t);
}
.queue a:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--violet-l); }
.queue .q-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--muted); }
.queue .q-label { font-weight: 700; font-size: .86rem; line-height: 1.35; color: var(--heading); }
.queue .q-num { margin-inline-start: auto; font: 900 1.25rem/1 var(--font-brand); color: var(--muted); }
.queue a.has { border-color: rgba(129,66,255,.28); }
.queue a.has .q-ic { background: linear-gradient(135deg, var(--navy), var(--violet)); color: #fff; }
.queue a.has .q-num { color: var(--violet); }
.q-section { scroll-margin-top: calc(var(--topbar-h) + 1rem); }
.q-section.is-empty { padding: .9rem 1.4rem; }
.q-section.is-empty > h2 { border: 0; padding: 0; margin: 0; font-size: 1rem; color: var(--muted); }
.q-section.is-empty > h2 .ic { color: var(--muted); }
.q-section.is-empty .table { display: none; }
.q-section .q-empty-note { margin-inline-start: auto; font: 400 .82rem var(--font-ui); color: var(--muted); }
.q-section h2 .q-count { margin-inline-start: .2rem; font: 700 .75rem/1 var(--font-brand); padding: .3rem .55rem; border-radius: 99px; background: rgba(129,66,255,.13); color: var(--violet); }

/* ---------------------------------------------------------------- صفحات الدخول (الموظفون) */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.2rem; position: relative; isolation: isolate; overflow: hidden; }
.auth > .mesh { position: fixed; z-index: -1; }
.auth > .messages { width: 100%; max-width: 460px; }
.auth-card {
  width: 100%; max-width: 440px; padding: 2.2rem; border-radius: var(--radius-lg);
  background: var(--glass-strong); border: 1px solid rgba(255,255,255,.35);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  box-shadow: 0 40px 80px -30px rgba(2, 10, 40, .55); animation: rise var(--t-slow) var(--ease) both;
}
.auth-card:hover { box-shadow: 0 40px 80px -30px rgba(2, 10, 40, .55); }
.auth-card h1 { font-size: 1.3rem; justify-content: center; text-align: center; }
.auth-card .brand-org { text-align: center; }
.auth-logo { display: block; margin: 0 auto .8rem; height: 70px; }
.auth-card .brand-mark { width: 56px; height: 56px; border-radius: 17px; font-size: 1.7rem; margin: 0 auto 1rem; }
.auth-split { width: 100%; max-width: 1120px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.auth-pitch { color: #fff; animation: rise var(--t-slow) var(--ease) 80ms both; }
.auth-pitch .eyebrow { display: inline-flex; gap: .45rem; align-items: center; font: 700 .8rem var(--font-brand); padding: .3rem .85rem; border-radius: 99px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); }
.auth-pitch h2 { color: #fff; font: 900 clamp(2rem, 1.3rem + 2.6vw, 3.4rem)/1.2 var(--font-brand); margin: 1rem 0 .8rem; display: block; }
.auth-pitch h2 em { font-style: normal; background: linear-gradient(90deg, var(--sky-l), #d9c7ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-pitch p { color: rgba(255,255,255,.8); font-size: 1.05rem; max-width: 34rem; margin: 0 0 1.6rem; }
.pitch-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; max-width: 34rem; }
.pitch-list li { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); font-size: .9rem; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pitch-list .ic { color: var(--sky-l); width: 1.3em; height: 1.3em; }
.auth-foot { margin-top: 1.3rem; text-align: center; font-size: .78rem; color: rgba(255,255,255,.7); }
.auth-card .btn.primary { padding: .75rem 1rem; font-size: 1rem; border-radius: 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* ---------------------------------------------------------------- بوابة الطلاب */
.portal-body .auth { align-items: start; padding-top: max(1.2rem, 5vh); }
.portal-card { max-width: 480px; }
.portal-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.2rem; }
.portal-head .brand-mark { margin: 0; width: 44px; height: 44px; font-size: 1.3rem; }
.portal-brand { font: 700 1rem/1.3 var(--font-brand); color: var(--heading); text-align: start; margin: 0; }
.portal-card .brand-org { text-align: start; }
.portal-hello { margin-bottom: 1.1rem; }
.portal-hello h1 { justify-content: flex-start; text-align: start; font-size: 1.35rem; margin: 0; }
.id-chip { display: inline-flex; align-items: center; gap: .35rem; font: 700 .8rem var(--font-brand); color: var(--muted); background: var(--surface-3); border-radius: 99px; padding: .15rem .7rem; }
.opp {
  position: relative; display: grid; grid-template-columns: 62px 1fr; gap: .2rem .9rem; align-items: start;
  border: 1px solid var(--border); border-radius: 16px; padding: .9rem; margin-bottom: .75rem; background: var(--surface);
  transition: transform var(--t) var(--ease), box-shadow var(--t), border-color var(--t);
}
.opp:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.opp > :not(.opp-date) { grid-column: 2; }
.opp > .btn, .opp > .opp-wait { grid-column: 1 / -1; margin-top: .45rem; }
.opp-date { grid-row: 1 / span 4; width: 62px; border-radius: 14px; text-align: center; padding: .45rem 0; background: var(--surface-3); color: var(--heading); }
.opp-date b { display: block; font: 900 1.45rem/1.1 var(--font-brand); }
.opp-date span { font-size: .72rem; color: var(--muted); }
.opp.open { border-color: rgba(10,157,118,.45); box-shadow: 0 0 0 4px rgba(32,204,118,.1); }
.opp.open .opp-date { background: linear-gradient(160deg, var(--green-d), var(--green)); color: #fff; }
.opp.open .opp-date span { color: rgba(255,255,255,.85); }
.opp-title { font: 700 1rem/1.45 var(--font-brand); color: var(--heading); }
.opp-meta { font-size: .85rem; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: .4rem; font: 700 .75rem var(--font-brand); color: var(--green-d); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(32,204,118,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(32,204,118,0); } 100% { box-shadow: 0 0 0 0 rgba(32,204,118,0); } }
.nid-input { font: 700 1.35rem/1.4 var(--font-brand) !important; letter-spacing: .22em; text-align: center; padding: .8rem !important; border-radius: 14px !important; }
.portal-note { display: flex; gap: .55rem; align-items: flex-start; font-size: .83rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .7rem .85rem; margin: 1rem 0 0; }
.portal-note .ic { color: var(--violet); margin-top: .2rem; }
.portal-out { display: flex; justify-content: center; margin-top: .6rem; }

/* ---------------------------------------------------------------- الظهور التدريجي عند التمرير */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); transition-delay: calc(var(--i, 0) * 55ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- الانتقال بين الصفحات */
@view-transition { navigation: auto; }
::view-transition-old(content) { animation: vt-out 160ms var(--ease) both; }
::view-transition-new(content) { animation: vt-in 320ms var(--ease) both; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 200ms; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------------------------------------------------------------- الجوال والأجهزة اللوحية */
@media (max-width: 1100px) {
  .auth-split { grid-template-columns: 1fr; gap: 1.6rem; justify-items: center; }
  .auth-pitch { text-align: center; }
  .auth-pitch p, .pitch-list { margin-inline: auto; }
  .pitch-list { display: none; }
}
@media (max-width: 900px) {
  :root { --topbar-h: 62px; }
  .layout { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-grid; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; height: 100vh; width: min(300px, 86vw); z-index: 60;
    background: var(--glass-strong); transform: translateX(105%); transition: transform 320ms var(--ease);
    box-shadow: var(--sh-3); padding-top: 1.2rem;
  }
  .nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(3, 10, 35, .45); opacity: 0; pointer-events: none; transition: opacity 320ms var(--ease); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .content { padding: 1.1rem 1rem 1.5rem; }
  .topbar { padding: 0 .9rem; }
  .brand-org, .uchip .uname, .uchip .urole { display: none; }
  .brand > div { min-width: 0; }
  .brand-app { overflow: hidden; text-overflow: ellipsis; }
  .table th, .table td { white-space: nowrap; }
  .uchip { padding: .2rem; border: 0; background: transparent; }
  .field ul { columns: 1; }
  .hero-body { padding: 1.4rem; }
  .table th, .table td { padding: .55rem .5rem; }
  .card { padding: 1rem; }
  .card .table, .card > .table { display: block; overflow-x: auto; }
}
@media (max-width: 520px) {
  .brand > div { display: none; }
  .page-head h1 { font-size: 1.3rem; }
  .auth-card { padding: 1.5rem; }
  .glass-stat { min-width: 0; flex: 1; }
  .tiles { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .tile { flex-direction: column; align-items: flex-start; gap: .6rem; padding: .95rem; }
  .facts { grid-template-columns: 1fr; gap: .1rem; }
  .facts dd { margin-bottom: .5rem; }
  .upload-log li { grid-template-columns: 1fr; }
}

/* احترام «تقليل الحركة» في الجهاز */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .mesh > span { animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}

@media print {
  .topbar, .sidebar, .btn, form, .filters, .mesh, .scrim, .app-footer { display: none !important; }
  .layout { display: block; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 0; }
}
.portal-id { flex: 1; min-width: 0; }
.btn.primary .live { color: #fff; }
.btn.primary .live::before { background: #7dffc0; }

/* ===== الإحصائيات والاجتماعات ===== */
.metric-picks { border: 0; padding: 0; margin: .4rem 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.metric-picks legend { font-weight: 700; color: var(--heading); margin-bottom: .5rem; }
.metric-pick { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border: 1px solid var(--border); border-radius: 14px; cursor: pointer; background: var(--surface); transition: border-color .2s, box-shadow .2s, transform .2s; }
.metric-pick:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(5,41,118,.08); }
.metric-pick:has(input:checked) { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(129,66,255,.14); }
.metric-pick input { width: 1.05rem; height: 1.05rem; accent-color: var(--violet); flex: none; }
.metric-pick .tile-icon { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.metric-pick .tile-icon .ic { width: 18px; height: 18px; }
.agenda { margin: 0; padding-inline-start: 1.4rem; display: grid; gap: .45rem; }
.agenda li { padding: .45rem .7rem; border-radius: 10px; background: var(--hover); }
.tile-num.compact { font-size: 1.25rem; white-space: nowrap; }
.danger-zone { margin-top: 1rem; display: flex; justify-content: flex-end; }
