/* ===== هوية جامعة الجلالة — مركز الإعلام ===== */
:root {
  --brand: #1E2F7A;        /* كحلي الجلالة */
  --brand-2: #2E45A8;
  --accent: #8CC63F;       /* أخضر الجلالة */
  --accent-soft: #EEF7E2;
  --gold: #F2B705;
  --silver: #A9B4C2;
  --bronze: #C7834A;
  --bg: #F3F5FA;
  --card: #FFFFFF;
  --text: #121A33;
  --muted: #667089;
  --line: #E3E7F0;
  --danger: #D92D20;
  --warn: #B54708;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 26, 51, .04), 0 8px 24px rgba(18, 26, 51, .06);
  --shadow-lg: 0 12px 40px rgba(30, 47, 122, .18);
  --font: "Cairo", "Segoe UI", Tahoma, "Geeza Pro", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); }
svg:not([width]):not(.chart svg) { max-width: 100%; }
.iconbtn svg, button svg, h2 svg, summary svg, .ic svg, .empty svg { width: 18px; height: 18px; }
.muted { color: var(--muted); font-size: 13.5px; }
.num, td.num { font-variant-numeric: tabular-nums; }

/* ---- شاشة التحميل ---- */
.splash { min-height: 100vh; display: grid; place-items: center; gap: 18px; align-content: center; }
.splash img { width: 150px; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: rot .8s linear infinite; }
.loading { text-align: center; padding: 80px 16px; color: var(--muted); }

/* ---- الحركة ---- */
@keyframes rot { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.96); opacity: .8; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes shine { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes draw { from { stroke-dashoffset: var(--len, 2000); } to { stroke-dashoffset: 0; } }
.anim { animation: fadeIn .35s ease-out both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
body.nomotion *, body.nomotion *::before, body.nomotion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---- الهيكل ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 75%);
  color: #fff;
  box-shadow: 0 6px 24px rgba(30, 47, 122, .25);
}
.topbar .in { max-width: 1280px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 12px; height: 70px; }
.brandmark { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.brandmark .logo { background: #fff; border-radius: 12px; padding: 4px 8px; height: 50px; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.15); flex: none; }
.brandmark .logo img { height: 40px; display: block; }
.brandmark h1 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brandmark h1 small { display: block; font-size: 12px; font-weight: 500; opacity: .85; }
.userchip { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.12); border-radius: 99px; padding: 4px 4px 4px 14px; }
.userchip .meta { line-height: 1.2; font-size: 13px; font-weight: 700; }
.userchip .meta small { display: block; opacity: .8; font-size: 11.5px; font-weight: 500; }
@media (max-width: 700px) { .userchip .meta, .brandmark h1 small { display: none; } .brandmark h1 { font-size: 14px; } }
.iconbtn { position: relative; width: 42px; height: 42px; border-radius: 12px; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .2s; padding: 0; flex: none; }
.iconbtn:hover { background: rgba(255,255,255,.24); }
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn.ringing svg { animation: ring 1s var(--ease) 2; transform-origin: 50% 0; }
.bn { position: absolute; top: -5px; left: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #0E1A3A; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--brand); }
.nav { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 70px; z-index: 15; }
.nav .in { max-width: 1280px; margin: 0 auto; padding: 0 12px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav .in::-webkit-scrollbar { display: none; }
.nav button { border: 0; background: none; padding: 13px 14px; font: inherit; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 7px; white-space: nowrap; position: relative; border-radius: 0; }
.nav button svg { width: 17px; height: 17px; opacity: .8; }
.nav button::after { content: ""; position: absolute; inset-inline: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); transform: scaleX(0); transition: transform .3s var(--ease); }
.nav button:hover { color: var(--brand); }
.nav button.on { color: var(--brand); }
.nav button.on::after { transform: scaleX(1); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 22px 20px 70px; }

/* ---- البطاقات ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 14px; font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h2 svg { width: 18px; height: 18px; color: var(--brand-2); flex: none; }
.card h2 .tag { margin-inline-start: auto; }
.grid2 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; margin-bottom: 18px; }
.grid2 > .card { margin: 0; min-width: 0; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
@media (max-width: 960px) { .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; } }

/* ---- النماذج ---- */
label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 5px; }
label .req { color: var(--danger); }
input, select, textarea, button { font: inherit; border: 1px solid var(--line); border-radius: calc(var(--radius) * .7); padding: 9px 13px; background: #fff; color: var(--text); }
input, select, textarea { width: 100%; transition: border-color .2s, box-shadow .2s; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
input[type=color] { padding: 3px; height: 44px; cursor: pointer; }
input[type=range] { padding: 0; accent-color: var(--brand); border: 0; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(46, 69, 168, .15); }
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button { cursor: pointer; white-space: nowrap; font-weight: 700; transition: transform .15s var(--ease), box-shadow .2s, background .2s; }

button.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(30, 47, 122, .28); }
button.primary:hover { box-shadow: 0 10px 24px rgba(30, 47, 122, .36); }
button.green { background: var(--accent); color: #0E1A3A; border-color: transparent; }
button.danger { color: var(--danger); }
button.small { padding: 4px 11px; font-size: 13px; }
button:disabled { opacity: .55; cursor: default; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.grid .wide { grid-column: 1 / -1; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 150px; }
.actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
details.more > summary { cursor: pointer; font-weight: 800; color: var(--brand-2); list-style: none; display: flex; align-items: center; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: 14px; }

/* ---- أنواع الشغل: علامات صح ---- */
.worktypes { display: flex; flex-wrap: wrap; gap: 10px; }
.wt { position: relative; margin: 0; }
.wt input { position: absolute; opacity: 0; pointer-events: none; }
.wt span { display: flex; align-items: center; gap: 8px; padding: 9px 16px 9px 12px; border: 2px solid var(--line); border-radius: 99px; background: #fff; font-weight: 700; cursor: pointer; transition: all .2s var(--ease); user-select: none; }
.wt span::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; color: #fff; transition: all .2s var(--ease); flex: none; }
.wt span em { font-style: normal; font-size: 11.5px; color: var(--muted); background: var(--bg); padding: 1px 8px; border-radius: 99px; }
.wt span:hover { border-color: var(--accent); }
.wt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: #234106; }
.wt input:checked + span::before { content: "✓"; background: var(--accent); border-color: var(--accent); }
.wt input:checked + span em { background: #fff; color: #3B6D11; }
.wt input:focus-visible + span { box-shadow: 0 0 0 4px rgba(140, 198, 63, .35); }
.wt.extra span { border-style: dashed; }
.wt span em, .stat b, bdi.n { direction: ltr; unicode-bidi: isolate; }
.pts-live { font-weight: 900; color: #3B6D11; background: var(--accent-soft); padding: 4px 12px; border-radius: 99px; }

/* ---- الدخول ---- */
.authpage { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.authhero { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 22px;
  background: radial-gradient(circle at 12% 18%, rgba(140, 198, 63, .45), transparent 42%), linear-gradient(140deg, var(--brand) 0%, var(--brand-2) 100%); }
.authhero::after { content: ""; position: absolute; inset: auto -120px -160px auto; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.06); }
.authhero .logo { background: #fff; border-radius: 20px; padding: 14px 20px; width: max-content; box-shadow: var(--shadow-lg); }
.authhero .logo img { height: 92px; display: block; }
.authhero h1 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 900; margin: 0; line-height: 1.3; }
.authhero p { margin: 0; opacity: .9; font-size: 16px; max-width: 460px; }
.authhero .feats { display: flex; flex-wrap: wrap; gap: 10px; position: relative; z-index: 1; }
.authhero .feats span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 99px; padding: 6px 14px; font-size: 13.5px; font-weight: 600; }
.authside { display: grid; place-items: center; padding: 32px 16px; }
.auth { width: min(420px, 100%); }
.auth h2 { font-size: 24px; font-weight: 900; margin: 0 0 4px; }
.auth .card { padding: 24px; }
.auth form > * + * { margin-top: 14px; }
.auth button.primary { width: 100%; padding: 12px; font-size: 16px; }
.auth .code { font-size: 26px; text-align: center; letter-spacing: 4px; direction: ltr; font-weight: 800; }
@media (max-width: 860px) {
  .authpage { grid-template-columns: 1fr; }
  .authhero { padding: 28px 20px; }
  .authhero .logo img { height: 64px; }
  .authhero .feats { display: none; }
}

/* ---- الجداول ---- */
.tablewrap { overflow-x: auto; border-radius: calc(var(--radius) * .7); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: right; vertical-align: middle; }
th { background: #F7F9FC; white-space: nowrap; font-size: 12.5px; color: var(--muted); font-weight: 800; }
tbody tr { transition: background .15s; }
tbody tr:hover td { background: #FAFBFE; }
tbody tr:last-child td { border-bottom: 0; }
td.num, td.ltr { direction: ltr; text-align: right; white-space: nowrap; }
td.cell { white-space: pre-wrap; word-break: break-word; max-width: 320px; }
td.ops { white-space: nowrap; }
td.tick { color: #4E8A16; font-weight: 900; font-size: 16px; text-align: center; }
tr.late td { background: #FFF7F6; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { background: var(--bg); border-radius: 99px; padding: 5px 14px; font-size: 13.5px; font-weight: 600; }
.stat b { color: var(--brand); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge.off { background: #FDECEA; color: var(--danger); }
.badge.warn { background: #FFF4DE; color: var(--warn); }
.badge.st-new { background: #E8EDFB; color: var(--brand-2); }
.badge.st-progress { background: #FFF4DE; color: var(--warn); }
.badge.st-done, .badge.ls-approved, .badge.ok { background: var(--accent-soft); color: #3B6D11; }
.badge.ls-rejected { background: #FDECEA; color: var(--danger); }
.badge.urgent { background: #FDE7F3; color: #B4236A; }
.neg { color: var(--danger); }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); }
.empty svg { width: 28px; height: 28px; opacity: .35; display: block; margin: 0 auto 6px; }

/* ---- لوحة البيانات ---- */
.hero { position: relative; overflow: hidden; border-radius: calc(var(--radius) * 1.3); padding: 26px; color: #fff; margin-bottom: 18px;
  background: radial-gradient(circle at 92% 8%, rgba(140, 198, 63, .55), transparent 42%), linear-gradient(130deg, var(--brand) 0%, var(--brand-2) 100%);
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap; box-shadow: var(--shadow-lg); }
.hero::before { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; border: 44px solid rgba(255,255,255,.06); top: -120px; left: -80px; }
.hero .txt { flex: 1; min-width: 240px; position: relative; }
.hero h2 { margin: 0; font-size: clamp(20px, 2.2vw, 26px); font-weight: 800; }
.hero p { margin: 4px 0 0; opacity: .9; }
.hero .lvl { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 99px; padding: 6px 16px; font-weight: 800; }
.xp { margin-top: 14px; max-width: 440px; }
.xp .track { height: 12px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.xp .fill { height: 100%; border-radius: 99px; width: 0; background: var(--accent); transition: width 1.2s var(--ease); }
.xp small { display: flex; justify-content: space-between; margin-top: 5px; opacity: .85; font-size: 12.5px; }
.ringbox { position: relative; width: 130px; height: 130px; flex: none; }
.ringbox svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ringbox .bgc { stroke: rgba(255,255,255,.16); }
.ringbox .fgc { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease); }
.ringbox .mid { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; line-height: 1.1; }
.ringbox .mid b { font-size: 28px; font-weight: 900; display: block; }
.ringbox .mid small { opacity: .85; font-size: 12px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s; }
.kpi:hover { box-shadow: var(--shadow-lg); }
.kpi::after { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--k, var(--brand)); }
.kpi .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--kb, #E8EDFB); color: var(--k, var(--brand)); }
.kpi .ic svg { width: 17px; height: 17px; }
.kpi .v { font-size: 26px; font-weight: 900; margin-top: 0; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi .s { font-size: 12px; font-weight: 700; margin-top: 2px; color: var(--muted); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--len, 2000); animation: draw 1.2s ease-out both; }
.chart .line.me { stroke-width: 3.5; }
.chart .line.dim { opacity: .3; }
.chart .area { opacity: .1; animation: areaIn 1s ease-out both; }
@keyframes areaIn { from { opacity: 0; } to { opacity: .1; } }
.chart .dot { stroke: #fff; stroke-width: 2; }
.chart .bar-r { transform-origin: bottom; transform-box: fill-box; animation: rise .9s var(--ease) both; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font-size: 13px; font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; flex: none; }
.donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut .center { position: relative; width: 170px; height: 170px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle.seg { fill: none; stroke-width: 24; transition: stroke-dasharray 1.2s var(--ease); }
.donut .center .mid { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; line-height: 1.1; }
.donut .center .mid b { font-size: 28px; font-weight: 900; display: block; }
.donut .center .mid small { color: var(--muted); font-size: 12px; }
.donut .legend { flex-direction: column; flex: 1; min-width: 160px; margin: 0; }
.donut .legend span { justify-content: space-between; gap: 10px; }
.donut .legend em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 800; }

/* ---- منصة التتويج ---- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; padding-top: 18px; }
.pod { flex: 1; max-width: 190px; text-align: center; }
.pod .av { margin: 0 auto 8px; }
.pod .nm { font-weight: 800; font-size: 14px; line-height: 1.3; }
.pod .pt { font-weight: 900; color: var(--brand); font-size: 18px; }
.pod .block { margin-top: 10px; border-radius: 10px 10px 4px 4px; display: grid; place-items: start center; padding-top: 8px; color: #fff; font-size: 22px; font-weight: 900; transform-origin: bottom; animation: rise .7s ease-out both; position: relative; }
.pod.p1 .block { height: 120px; background: var(--gold); }
.pod.p2 .block { height: 88px; background: var(--silver); }
.pod.p3 .block { height: 64px; background: var(--bronze); }
.crown { font-size: 20px; display: block; line-height: 1; margin-bottom: 4px; }
.av { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 19px; background: var(--c, var(--brand)); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c, var(--brand)); flex: none; }
.av.sm { width: 40px; height: 40px; font-size: 14px; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--c, var(--brand)); }
.av.xs { width: 34px; height: 34px; font-size: 17px; line-height: 1; box-shadow: none; }
.pod.p1 .av { width: 60px; height: 60px; font-size: 22px; --c: var(--gold); }
.pod.p2 .av { --c: #8794A6; } .pod.p3 .av { --c: var(--bronze); }

/* ---- قائمة الترتيب ---- */
.ranklist { display: flex; flex-direction: column; gap: 12px; }
.rk { display: grid; grid-template-columns: 46px auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: box-shadow .2s; }
.rk:hover { box-shadow: var(--shadow); }
.rk.me { border-color: var(--accent); background: linear-gradient(90deg, #fff, var(--accent-soft)); }
.rk .pos { font-size: 22px; font-weight: 900; color: var(--muted); text-align: center; }
.rk .pos.g { color: var(--gold); } .rk .pos.s { color: #8794A6; } .rk .pos.b { color: var(--bronze); }
.rk .who { min-width: 0; }
.rk .who b { font-size: 15px; }
.rk .bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.rk .bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--brand-2); transition: width 1.1s var(--ease); }
.rk.me .bar i { background: var(--accent); }
.rk .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rk .score { text-align: center; }
.rk .score b { display: block; font-size: 26px; font-weight: 900; color: var(--brand); line-height: 1; font-variant-numeric: tabular-nums; }
.rk .score small { color: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .rk { grid-template-columns: 34px auto 1fr; } .rk .score { grid-column: 1 / -1; text-align: start; display: flex; gap: 8px; align-items: baseline; } }
.lvlb { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 99px; color: #fff; background: var(--lc, var(--brand)); vertical-align: middle; }
.ach { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: #FFF6DB; color: #8A5A00; border: 1px solid #F7DE8C; }
.stc { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.levels { display: flex; gap: 10px; flex-wrap: wrap; }
.levels .lv { flex: 1; min-width: 120px; text-align: center; padding: 12px 8px; border-radius: var(--radius); border: 1px solid var(--line); }
.levels .lv.cur { border-color: var(--accent); background: var(--accent-soft); }
.levels .lv b { display: block; margin-top: 4px; }

/* ---- المهام ---- */
.tasklist { display: flex; flex-direction: column; gap: 10px; }
.tk { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: calc(var(--radius) * .8); background: #fff; transition: transform .2s var(--ease), box-shadow .2s; }
.tk:hover { box-shadow: var(--shadow); }
.tk .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--brand-2); }
.tk.late .dot { background: var(--danger); box-shadow: 0 0 0 4px #FDECEA; }
.tk.done .dot { background: var(--accent); }
.tk .t { flex: 1; min-width: 0; }
.tk .t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk .due { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tk.late .due { color: var(--danger); font-weight: 700; }

/* ---- الإجازات ---- */
.balances { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.balcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; }
.balcard .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 800; }
.balrow { display: flex; gap: 14px; }
.bal { flex: 1; display: flex; gap: 10px; align-items: center; }
.mini { position: relative; width: 78px; height: 78px; flex: none; }
.mini svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.mini .bgc { stroke: var(--bg); }
.mini .fgc { stroke-linecap: round; transition: stroke-dashoffset 1.3s var(--ease); }
.mini .mid { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; line-height: 1; }
.mini .mid b { font-size: 20px; font-weight: 900; display: block; }
.mini .mid small { font-size: 10.5px; color: var(--muted); }
.bal .info { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.bal .info b { display: block; color: var(--text); font-size: 13.5px; }

/* ---- الإجازات (تصميم جديد) ---- */
.balrow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
@media (max-width: 700px) { .balrow2 { grid-template-columns: 1fr; } }
.balbig { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; align-items: center; gap: 18px; }
.balbig .bv { margin: 2px 0; }
.balbig .bv b { font-size: 30px; font-weight: 900; line-height: 1; }
.balbig .bv span { color: var(--muted); font-weight: 700; font-size: 13.5px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; background: var(--bg); padding: 4px; border-radius: 12px; width: fit-content; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 16px; border-radius: 9px; font-weight: 700; font-size: 14px; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.seg input:checked + span { background: var(--card); color: var(--brand); box-shadow: 0 1px 4px rgba(18,26,51,.12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.lv-list { display: flex; flex-direction: column; gap: 10px; }
.lv-item { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; border: 1px solid var(--line); border-radius: calc(var(--radius) * .8); padding: 14px 16px; background: #fff; border-inline-start: 4px solid var(--line); }
.lv-item.ls-approved { border-inline-start-color: var(--accent); }
.lv-item.ls-rejected { border-inline-start-color: var(--danger); }
.lv-item.ls-pending { border-inline-start-color: #F2B705; }
.lv-main { min-width: 0; flex: 1; }
.lv-who { display: block; margin-bottom: 2px; }
.lv-date { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.lv-date b { direction: ltr; unicode-bidi: isolate; }
.lv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.lv-btns { display: flex; gap: 6px; }
button.ghost { background: transparent; border-color: transparent; }
.steps { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.steps .st { display: inline-flex; align-items: center; gap: 6px; }
.steps .st i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: inline-block; }
.steps .st.ok { color: #3B6D11; } .steps .st.ok i { background: var(--accent); }
.steps .st.no { color: var(--danger); } .steps .st.no i { background: var(--danger); }
.steps .st.wait i { background: #F2B705; }
.steps small { font-weight: 500; color: var(--muted); }
.attn { border-color: #F7DE8C; background: #FFFCF2; }
.baltable td { vertical-align: middle; }
.cellbar { min-width: 160px; }
.cellbar span { font-size: 13px; color: var(--muted); }
.cellbar span b { color: var(--text); font-size: 15px; }
.cellbar .track { height: 7px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.cellbar .track i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width 1s var(--ease); }

/* ---- التقويم ---- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { text-align: center; font-size: 12.5px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.cal .day { min-height: 98px; border: 1px solid var(--line); border-radius: 12px; padding: 5px; background: #fff; cursor: pointer; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.cal .day:hover { border-color: var(--brand-2); box-shadow: var(--shadow); }
.cal .day.empty { border: 0; background: transparent; cursor: default; box-shadow: none; }
.cal .day.today { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.cal .day.wk { background: #FAFBFD; }
.cal .dn { font-size: 13px; color: var(--muted); font-weight: 800; }
.chip { font-size: 11.5px; line-height: 1.55; border-radius: 6px; padding: 1px 6px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #E8EDFB; color: var(--brand-2); font-weight: 700; }
.chip.st-progress { background: #FFF4DE; color: var(--warn); }
.chip.st-done { background: var(--accent-soft); color: #3B6D11; text-decoration: line-through; }
.chip.late { background: #FDECEA; color: var(--danger); }
.chip.leave { background: #EFEAFB; color: #5B3AA8; }
@media (max-width: 640px) { .cal .day { min-height: 66px; } .cal .dow { font-size: 10.5px; } .chip { font-size: 10px; padding: 0 3px; } }

/* ---- الإعدادات والمظهر ---- */
.fieldrow { display: grid; grid-template-columns: 1.3fr 1fr 1.6fr auto; gap: 8px; align-items: center; margin-bottom: 6px; padding: 8px; border-radius: 10px; }
.fieldrow:hover { background: var(--bg); }
.fieldrow .flags { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.fieldrow .flags .check { font-weight: 600; }
@media (max-width: 860px) { .fieldrow { grid-template-columns: 1fr 1fr; border-bottom: 1px dashed var(--line); } }
.presets { display: flex; gap: 10px; flex-wrap: wrap; }
.preset { border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; background: #fff; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.preset:hover { border-color: var(--brand-2); }
.preset i { width: 18px; height: 18px; border-radius: 50%; display: inline-block; }
.preview { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.preview .pv-top { padding: 16px; color: #fff; background: linear-gradient(130deg, var(--brand), var(--brand-2)); font-weight: 900; display: flex; align-items: center; gap: 10px; }
.preview .pv-top img { height: 34px; background: #fff; border-radius: 8px; padding: 3px 6px; }
.preview .pv-body { padding: 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-weight: 700; margin: 0; cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch input { appearance: none; width: 44px; height: 24px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; padding: 0; border: 0; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s var(--ease); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(-20px); }

/* ---- محرر الواجهة ---- */
.banner { background: #FFF6DB; border-bottom: 1px solid #F7DE8C; color: #7A4F00; font-weight: 700; }
.banner .in { max-width: 1280px; margin: 0 auto; padding: 10px 20px; }
.quicklinks { display: flex; flex-wrap: wrap; gap: 10px; }
.qlink { display: inline-block; padding: 9px 18px; border-radius: 99px; border: 1.5px solid var(--brand-2); color: var(--brand); font-weight: 700; text-decoration: none; transition: background .2s, color .2s; }
.qlink:hover { background: var(--brand); color: #fff; }
.imgrow { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.imgbox { display: flex; gap: 14px; align-items: center; }
.imgbox .ph { width: 150px; height: 84px; border-radius: 12px; border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; background: var(--bg); flex: none; }
.imgbox .ph img { max-width: 100%; max-height: 100%; object-fit: contain; }
.imgbox .ph.hero img { width: 100%; height: 100%; object-fit: cover; }
.filebtn { display: inline-block; padding: 6px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 13.5px; cursor: pointer; margin: 0; }
.filebtn:hover { border-color: var(--brand-2); }
.linkrow { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; margin-bottom: 8px; }
.txlist { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.tx { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.tx .muted { text-decoration: line-through; }
#__edbtn { position: fixed; bottom: 20px; left: 20px; z-index: 60; padding: 10px 18px; border-radius: 99px; border: 0; background: var(--brand); color: #fff; font-weight: 800; box-shadow: var(--shadow-lg); }
#__edbtn.on { background: var(--accent); color: #0E1A3A; }
body.editmode #app * { cursor: crosshair !important; }
.ed-hover { outline: 2px dashed var(--accent) !important; outline-offset: 2px; }
.ed-sel { outline: 3px solid #F2B705 !important; outline-offset: 2px; }
#__pvbtn { position: fixed; bottom: 20px; left: 160px; z-index: 60; padding: 10px 18px; border-radius: 99px; border: 0; background: #fff; color: var(--brand); font-weight: 800; box-shadow: var(--shadow-lg); }
#__pvbtn.on { background: #F2B705; color: #0E1A3A; }
.banner.pv { background: #FFE9A8; }
#__edit .edtop { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
#__edit .edtop button { margin-inline-start: auto; }
#__edit .edgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 10px; }
#__edit .edgrid label { font-size: 12px; margin-bottom: 2px; }
#__edit .edgrid input, #__edit .edgrid select { padding: 5px 8px; }
#__edit .colorpair { display: flex; gap: 6px; align-items: center; }
#__edit .colorpair input { height: 34px; }
#__edit [data-empty] { opacity: .35; }
#__edit { position: fixed; z-index: 70; bottom: 74px; left: 20px; width: min(460px, calc(100vw - 40px)); max-height: calc(100vh - 110px); overflow: auto; background: #fff; border-radius: 16px; padding: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
#__edit textarea { margin-top: 10px; min-height: 70px; }
#__edit .actions { margin-top: 10px; }

/* ---- البلوكات والصفحات ---- */
.page-blocks { display: flex; flex-direction: column; gap: 16px; }
.page-blocks > .card, .page-blocks > .banner { margin: 0; }
.blk-h { font-size: 22px; font-weight: 800; margin: 6px 0 0; }
.blk-text { white-space: normal; line-height: 1.9; }
.blk-note { border-radius: var(--radius); border: 1px solid #F7DE8C; }
.blk-img { margin: 0; text-align: center; }
.blk-img img { max-width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.blk-img.half img { max-width: 50%; } .blk-img.small img { max-width: 260px; }
.blk-img figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }
.blk-embed { padding: 0; overflow: hidden; } .blk-embed iframe, .blk-html iframe { width: 100%; border: 0; display: block; }
.blk-html { padding: 0; overflow: hidden; }
.navrows, .blklist { display: flex; flex-direction: column; gap: 8px; }
.navrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.navrow input:not([type=checkbox]) { flex: 1; min-width: 160px; }
.blkrow { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: #FBFCFE; }
.blkhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.addblk { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pagebox { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.pagebox > summary { cursor: pointer; display: flex; gap: 10px; align-items: center; }
.code-area { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: #0F172A; color: #E2E8F0; border-color: #0F172A; }

/* ---- اللائحة والأولوية ---- */
.policy { padding: 0; overflow: visible; }
.pol { display: grid; grid-template-columns: 260px 1fr; gap: 0; }
.pol-toc { position: sticky; top: 130px; align-self: start; padding: 20px; border-inline-end: 1px solid var(--line); max-height: calc(100vh - 150px); overflow: auto; }
.pol-toc nav { display: flex; flex-direction: column; gap: 2px; margin: 10px 0; }
.pol-toc nav a { text-decoration: none; color: var(--text); padding: 7px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.pol-toc nav a:hover { background: var(--accent-soft); color: var(--brand); }
.pol-toc input { margin-top: 10px; }
.pol-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.pol-main { padding: 24px 30px; line-height: 2; min-width: 0; }
.pol-head h1 { font-size: 22px; font-weight: 900; color: var(--brand); margin: 0 0 10px; line-height: 1.5; }
.pol-intro { background: var(--bg); border-radius: 12px; padding: 12px 16px; }
.pol-intro p { margin: 4px 0 0; }
.pol-quick { margin: 18px 0; border: 1px solid #F7DE8C; background: #FFFCF2; border-radius: 12px; padding: 14px 16px; }
.pol-quick div { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; }
.pol-quick span { background: #fff; border-radius: 10px; padding: 8px 12px; border: 1px solid #F3E6B5; line-height: 1.6; font-size: 14px; }
.pol-quick em { display: block; font-style: normal; font-weight: 800; color: #8A5A00; font-size: 13px; }
.pol-sec { margin-top: 22px; scroll-margin-top: 130px; }
.pol-sec h2 { font-size: 17px; font-weight: 800; color: var(--brand); margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--accent-soft); }
.pol-item { border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: #fff; }
.pol-item > summary { cursor: pointer; padding: 10px 14px; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.pol-item > summary::-webkit-details-marker { display: none; }
.pol-item > summary::after { content: "+"; color: var(--muted); font-weight: 900; }
.pol-item[open] > summary::after { content: "−"; }
.pol-item[open] > summary { border-bottom: 1px solid var(--line); background: var(--bg); border-radius: 10px 10px 0 0; }
.pol-item > div { padding: 6px 16px 10px; }
.pol-item ul { margin: 4px 0; padding-inline-start: 22px; }
.pol-item p { margin: 4px 0; }
.polfoot { margin: 0 30px 24px; }
@media (max-width: 900px) { .pol { grid-template-columns: 1fr; } .pol-toc { position: static; max-height: none; border-inline-end: 0; border-bottom: 1px solid var(--line); } .pol-main { padding: 18px; } .polfoot { margin: 0 18px 18px; } }
@media print { .pol { grid-template-columns: 1fr; } .pol-toc, .polfoot { display: none !important; } .pol-item { break-inside: avoid; } .pol-item > div { display: block !important; } }
.checklist { display: flex; flex-direction: column; gap: 6px; }
.clprog { height: 5px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 6px; max-width: 120px; }
.clprog i { display: block; height: 100%; background: var(--accent); }
.polfoot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.banner.polnote { border-radius: var(--radius); margin-bottom: 16px; border: 1px solid #F7DE8C; }
.badge.pr-high { background: #FFF4DE; color: var(--warn); }
.badge.pr-urgent { background: #FDECEA; color: var(--danger); }
.badge.pr-president { background: #1E2F7A; color: #fff; }

/* ---- نافذة وتنبيه ---- */
dialog { border: 0; border-radius: calc(var(--radius) * 1.2); padding: 24px; width: min(660px, calc(100vw - 28px)); box-shadow: var(--shadow-lg); }
dialog[open] { animation: fadeIn .2s ease-out; }
dialog::backdrop { background: rgba(14, 26, 58, .45); backdrop-filter: blur(3px); }
dialog h2 { margin-top: 0; font-size: 18px; font-weight: 900; display: flex; align-items: center; gap: 8px; }
dialog h2 svg { width: 22px; height: 22px; color: var(--brand-2); flex: none; }
button svg { width: 16px; height: 16px; vertical-align: -3px; flex: none; }
.nav button svg { width: 17px; height: 17px; }
.iconbtn svg { width: 20px; height: 20px; }
summary svg { width: 18px; height: 18px; }
.notes { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; }
.notes li { padding: 12px 14px; border-radius: 12px; margin-bottom: 6px; display: flex; gap: 10px; }
.notes li .nd { width: 9px; height: 9px; border-radius: 50%; background: var(--line); margin-top: 8px; flex: none; }
.notes li.unread { background: var(--accent-soft); font-weight: 700; }
.notes li.go { cursor: pointer; transition: background .15s; }
.notes li.go:hover { background: #E8EDFB; }
@keyframes flash { 0%, 100% { box-shadow: none; } 30%, 70% { box-shadow: 0 0 0 3px var(--accent); } }
.flash, .flash td { animation: flash 1.2s ease-in-out 2; background: var(--accent-soft) !important; }
.notes li.unread .nd { background: var(--accent); }
.notes small { display: block; color: var(--muted); font-weight: 500; }
#toast { position: fixed; bottom: 24px; inset-inline: 0; margin: 0 auto; width: max-content; max-width: calc(100vw - 32px); z-index: 50;
  background: var(--brand); color: #fff; padding: 12px 20px; border-radius: 14px; font-size: 14px; font-weight: 700; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .25s, transform .35s var(--ease); }
#toast.show { opacity: 1; transform: none; }
#toast.err { background: var(--danger); }

/* ---- الطباعة ---- */
.print-only { display: none; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; font-size: 12px; }
  .topbar, .nav, .no-print, #toast, td.ops, th.ops { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; margin: 0; box-shadow: none; }
  .print-only { display: block; }
  .print-head { text-align: center; margin-bottom: 10px; }
  .print-head h1 { font-size: 18px; margin: 0; }
  .print-head p { margin: 2px 0; }
  .print-sign { display: flex; justify-content: space-between; margin-top: 40px; padding: 0 30px; }
  th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tr { break-inside: avoid; }
}

/* الاجتماعات */
.chip.meet { background: #EEF7E2; color: #3E6E12; border-inline-start: 3px solid var(--green, #8CC63F); cursor: pointer; }
.banner.meetnote { background: #EEF7E2; color: #2F4F0F; }
.banner.meetnote a { color: var(--primary, #1E2F7A); font-weight: 700; }
.mt-sched { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 10px; }
.mt-s { border: 1px solid var(--line, #E3E7F1); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; border-inline-start: 4px solid var(--primary, #1E2F7A); }
.agenda { display: grid; gap: 10px; }
.ag-row { border: 1px solid var(--line, #E3E7F1); border-radius: 12px; padding: 10px 14px; }
.ag-who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-who .muted { margin-inline-start: auto; font-size: .85em; }
.ag-list { margin: 8px 0 0; padding-inline-start: 20px; display: grid; gap: 4px; }
.ag-empty { margin-top: 6px; font-size: .9em; }
.mt-min { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line, #E3E7F1); }
.mt-min h3 { margin: 0 0 8px; font-size: 1rem; }
.mt-ed { border: 1px solid var(--line, #E3E7F1); border-radius: 12px; padding: 12px; margin: 10px 0; }

/* توقيع المطوّر */
.credit { text-align: center; font-size: .78rem; color: var(--muted, #6B7390); padding: 18px 16px 26px; opacity: .85; }
.credit a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* زرار اللغة */
.langbtn { border: 1px solid rgba(255,255,255,.35); background: transparent; color: inherit; border-radius: 99px; padding: 5px 12px; font-weight: 800; font-size: 13px; cursor: pointer; font-family: inherit; }
.topbar .langbtn { color: #fff; }
.authside { position: relative; }
.authlang { position: absolute; top: 18px; inset-inline-end: 18px; border-color: var(--line, #E3E7F1); color: var(--brand, #1E2F7A); background: #fff; }
/* English = من الشمال لليمين */
[dir="ltr"] th, [dir="ltr"] td, [dir="ltr"] td.num, [dir="ltr"] td.ltr { text-align: left; }
[dir="ltr"] .switch input::after { right: auto; left: 3px; }
[dir="ltr"] .switch input:checked::after { transform: translateX(20px); }
[dir="ltr"] .bn { left: auto; right: -5px; }
[dir="ltr"] #__edbtn, [dir="ltr"] #__edit { left: auto; right: 20px; }
[dir="ltr"] #__pvbtn { left: auto; right: 160px; }
[dir="ltr"] body { font-family: "Cairo", system-ui, sans-serif; }

/* كود التفعيل */
.invite-code { font: 800 30px/1.2 ui-monospace, Menlo, monospace; letter-spacing: 4px; text-align: center; padding: 16px; margin: 12px 0; border: 2px dashed var(--accent, #8CC63F); border-radius: 14px; background: #F6FBEF; color: var(--brand, #1E2F7A); cursor: copy; user-select: all; }

/* Google Authenticator */
.qrbox { width: 210px; max-width: 70vw; margin: 10px 0; padding: 8px; background: #fff; border: 1px solid var(--line, #E3E7F1); border-radius: 12px; }
.qrbox svg { width: 100%; height: auto; display: block; }
.setupkey { font: 700 14px ui-monospace, Menlo, monospace; background: #F2F4FA; padding: 3px 8px; border-radius: 6px; user-select: all; }
.steps-list { padding-inline-start: 20px; display: grid; gap: 8px; }

/* تطور الأداء */
.pf-chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.pf-grid { stroke: var(--line, #E3E7F1); stroke-width: 1; }
.pf-ax { font: 600 11px var(--font, Cairo), sans-serif; fill: #8A93AE; }
.pf-line { fill: none; stroke: var(--c); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.pf-line.dash { stroke-dasharray: 6 5; stroke-width: 2; }
.pf-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: .88rem; }
.pf-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.pf-up { color: #3E8A12; font-weight: 700; } .pf-down { color: var(--danger, #E5484D); font-weight: 700; }
tr.pf-team td { font-weight: 800; background: #F6F8FD; }

/* طلبات التغطية */
.cov-list { display: grid; gap: 12px; }
.cov-item { border: 1px solid var(--line, #E3E7F1); border-inline-start: 4px solid #F2B705; border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.cov-item.approved { border-inline-start-color: #8CC63F; } .cov-item.rejected { border-inline-start-color: #CBD2E1; opacity: .8; }
.cov-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cov-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .9rem; }

/* ---- القائمة الجانبية ---- */
.topbar .in { max-width: none; }
.layout { display: flex; align-items: flex-start; }
.layout > .wrap { flex: 1; min-width: 0; }
.nav.side { position: sticky; top: 70px; width: 236px; flex: none; height: calc(100vh - 70px); border-bottom: 0; border-inline-end: 1px solid var(--line); overflow-y: auto; z-index: 15; }
.nav.side .in { flex-direction: column; max-width: none; padding: 14px 10px; gap: 2px; overflow: visible; }
.nav.side button { width: 100%; padding: 10px 14px; border-radius: 10px; text-align: start; transition: background .2s, color .2s; }
.nav.side button:hover { background: var(--bg); }
.nav.side button.on { background: #EDF0FA; }
.nav.side button::after { inset-inline-start: 0; inset-inline-end: auto; top: 9px; bottom: 9px; width: 3px; height: auto; border-radius: 3px; transform: scaleY(0); }
.nav.side button.on::after { transform: scaleY(1); }
.menubtn, .navscrim { display: none; }
@media (max-width: 900px) {
  .menubtn { display: grid; }
  .nav.side { position: fixed; top: 70px; inset-inline-start: 0; z-index: 40; width: min(270px, 82vw); box-shadow: var(--shadow-lg); visibility: hidden; opacity: 0; transform: translateX(var(--navshift, 16px)); transition: transform .25s var(--ease), opacity .25s, visibility .25s; }
  [dir="ltr"] .nav.side { --navshift: -16px; }
  body.navopen .nav.side { visibility: visible; opacity: 1; transform: none; }
  body.navopen .navscrim { display: block; position: fixed; inset: 70px 0 0; background: rgba(14, 26, 58, .35); z-index: 35; }
}

/* ---- المعدات ---- */
.eqgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 12px; }
.eqcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: var(--card); }
.eqcard.off { opacity: .55; }
.eqcard .ops { display: flex; gap: 6px; margin-top: auto; }
.eqhist { margin-top: 14px; }
.eqhist summary { cursor: pointer; font-weight: 700; color: var(--muted); }
/* ---- لينكات التسليم والأرشيف ---- */
.lrows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.lrow { display: grid; grid-template-columns: 1fr 1.6fr; gap: 6px; }
.lchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.lchip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--brand-2); text-decoration: none; }
.lchip.main { background: var(--accent-soft); border-color: transparent; color: #3E6B12; }
.lchip svg { width: 14px; height: 14px; }
.lchip:hover { border-color: var(--brand-2); }
.arfilter { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; }
.arfilter input[name=q] { flex: 1 1 200px; }
.arfilter select, .arfilter input[type=date] { flex: 0 1 170px; }
.arlist { display: flex; flex-direction: column; gap: 8px; }
.aritem { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.arhead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-bottom: 4px; }
@media (max-width: 600px) { .lrow { grid-template-columns: 1fr; } }

.navinstall { display: none; }
.nav.side .navinstall:not([hidden]) { display: flex; align-items: center; gap: 7px; margin-top: 14px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 10px; background: none; font: inherit; font-weight: 700; font-size: 13px; color: var(--brand-2); cursor: pointer; width: 100%; text-align: start; }
.nav.side .navinstall:hover { background: var(--bg); border-color: var(--brand-2); }
.navinstall svg { width: 16px; height: 16px; }
@media (display-mode: standalone) { .navinstall { display: none !important; } }

/* ---- نافذة التأكيد ---- */
dialog.cfm { width: min(420px, calc(100vw - 28px)); }
dialog.cfm p { margin: 4px 0 4px; line-height: 1.8; }
button.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
button.danger.solid:hover { filter: brightness(1.05); }
a.btn { display: inline-flex; align-items: center; gap: 5px; border-radius: 10px; text-decoration: none; font-weight: 700; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 8px 14px; white-space: nowrap; }
a.btn.small { padding: 4px 11px; font-size: 13px; }
a.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; }
a.btn svg { width: 15px; height: 15px; }
.st-at { font-weight: 500; color: var(--muted); font-size: 11.5px; }
/* ---- السجل الزمني ---- */
.timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--line); max-height: 60vh; overflow: auto; }
.timeline li { position: relative; padding: 4px 18px 12px 0; }
[dir="ltr"] .timeline li { padding: 4px 0 12px 18px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--brand-2); }
.timeline li.k-approved::before { border-color: var(--accent); background: var(--accent); }
.timeline li.k-returned::before, .timeline li.k-issue::before { border-color: var(--danger); }
.timeline time { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
td.tline { min-width: 150px; line-height: 1.6; }
.rv-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.rv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.rv-head button { margin-inline-start: auto; }
.rv-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); }
/* ---- بنود الاجتماعات ---- */
.mi-box { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.mi-box h3 { font-size: 1rem; margin: 0 0 8px; }
.mi-weekly { margin-top: 14px; background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.mi-weekly h4 { margin: 0 0 6px; font-size: .95rem; color: var(--brand-2); }
.mi-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: var(--card); }
.mi-row.child { margin-inline-start: 26px; border-style: dashed; }
.mi-row.mi-done .mi-main b { text-decoration: line-through; color: var(--muted); }
.mi-side { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: flex-end; }
.mi-last { font-size: 13px; margin-top: 3px; }
.badge.mi-b-done { background: var(--accent-soft); color: #3E6B12; } .badge.mi-b-progress { background: #FFF4D6; color: #8A5A00; }
.mi-add { display: grid; grid-template-columns: 1fr 170px 150px auto; gap: 6px; margin: 6px 0 8px; }
@media (max-width: 700px) { .mi-add { grid-template-columns: 1fr 1fr; } .mi-row { flex-direction: column; } .mi-side { justify-content: flex-start; } }
/* ---- التقرير اليومي ---- */
.kpis.dk { grid-template-columns: repeat(6, 1fr); gap: 10px; }
.kpis.dk .kpi { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.kpis.dk .kpi b { font-size: 22px; color: var(--brand); } .kpis.dk .kpi span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.kpis.dk .kpi.bad b { color: var(--danger); } .kpis.dk .kpi.warnk b { color: var(--warn); }
@media (max-width: 900px) { .kpis.dk { grid-template-columns: repeat(3, 1fr); } }
/* ---- لوحة المشرف ---- */
.kpi.sk { text-align: start; cursor: pointer; font: inherit; }
.kpi.sk:hover { border-color: var(--brand-2); }
.supbars { display: flex; flex-direction: column; gap: 8px; }
.supbars .sb { display: grid; grid-template-columns: 230px 1fr 50px; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 700; }
.supbars .track { height: 9px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.supbars .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--accent)); border-radius: 99px; transition: width .6s var(--ease); }
.supbars b { text-align: end; color: var(--brand); }
@media (max-width: 700px) { .supbars .sb { grid-template-columns: 1fr 50px; } .supbars .track { grid-column: 1 / -1; grid-row: 2; } }
.calseg { margin: 10px 0 4px; }
.calseg span { display: inline-flex; align-items: center; gap: 6px; }
.chip.meet.done { background: var(--accent-soft); color: #3E6B12; }
.chip.meet.miss { opacity: .6; }
.chip.mitem { background: #FFF4D6; color: #8A5A00; }
.chip.mitem.done { text-decoration: line-through; opacity: .6; }
.chip.meet { background: #E8EDFB; color: var(--brand); border-inline-start-color: var(--brand-2); }
.chip.meet.done { background: var(--accent-soft); color: #3E6B12; border-inline-start-color: var(--accent); }
.kpis.dk .kpi span { white-space: normal; line-height: 1.4; }
/* ---- الجودة ---- */
.q-wrap { display: grid; grid-template-columns: 290px 1fr; gap: 16px; align-items: start; }
.q-toc { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow: auto; padding: 14px; }
.q-toc input { margin-bottom: 10px; }
.q-cat h4 { margin: 12px 0 6px; font-size: 13px; color: var(--muted); }
.q-item { display: block; padding: 7px 10px; border-radius: 9px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 13.5px; line-height: 1.5; }
.q-item:hover { background: var(--bg); } .q-item.on { background: #EDF0FA; color: var(--brand); }
.q-code { display: inline-block; font-size: 11px; background: var(--bg); border-radius: 6px; padding: 0 6px; margin-inline-end: 6px; color: var(--muted); }
.q-main { min-width: 0; }
.q-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.q-head h2 { margin: 6px 0 2px; }
.q-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.q-tools { background: var(--bg); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.q-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 4px; }
.qdoc { line-height: 1.9; overflow-x: auto; }
.qdoc.editing { outline: 2px dashed var(--brand-2); outline-offset: 6px; border-radius: 6px; min-height: 200px; }
.qdoc table { border-collapse: collapse; width: 100%; margin: 10px 0 16px; font-size: 13.5px; }
.qdoc td, .qdoc th { border: 1px solid #C9D0E0; padding: 6px 8px; vertical-align: top; text-align: start; }
.qdoc tr:first-child td { background: #F4F6FB; font-weight: 700; }
.qdoc p { margin: 6px 0; } .qdoc h3 { color: var(--brand); }
@media (max-width: 900px) { .q-wrap { grid-template-columns: 1fr; } .q-toc { position: static; max-height: none; } }
.cov-det { margin: 6px 0; } .cov-det summary { cursor: pointer; font-weight: 700; color: var(--brand-2); font-size: 13.5px; }
.cov-det dl { display: grid; grid-template-columns: 190px 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 13.5px; }
.cov-det dt { font-weight: 700; color: var(--muted); } .cov-det dd { margin: 0; }
@media (max-width: 600px) { .cov-det dl { grid-template-columns: 1fr; } }

/* ===== لمسات المشرف ===== */
:root { --sup-gold: #E3B341; --sup-teal: #0F6A73; }
body.r-sup .topbar { box-shadow: 0 6px 24px rgba(30, 47, 122, .25), inset 0 -3px 0 var(--sup-gold); }
body.r-sup .userchip { box-shadow: inset 0 0 0 1px rgba(227, 179, 65, .55); }
body.r-sup .userchip .av { box-shadow: 0 0 0 2px var(--sup-gold); }
body.r-sup .nav.side button.on { background: linear-gradient(90deg, rgba(227, 179, 65, .14), rgba(30, 47, 122, .06)); }
body.r-sup .nav.side button::after { background: var(--sup-gold); }
body.r-sup .nav.side { background: linear-gradient(180deg, #FFFDF6, var(--card) 220px); }
.supchip { display: inline-flex; align-items: center; gap: 3px; background: var(--sup-gold); color: #2A1F00; border-radius: 99px; padding: 0 7px; font-size: 10.5px; font-weight: 800; line-height: 1.6; vertical-align: 1px; }
.supchip svg { width: 11px; height: 11px; }

.suphero { position: relative; overflow: hidden; border-radius: calc(var(--radius) * 1.3); padding: 22px 24px 18px; margin-bottom: 18px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, rgba(227, 179, 65, .22), transparent 45%), linear-gradient(135deg, #14235E 0%, #1E2F7A 55%, var(--sup-teal) 100%);
  box-shadow: 0 14px 40px rgba(20, 35, 94, .28); }
.suphero::after { content: ""; position: absolute; inset-inline-end: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(255, 255, 255, .05); pointer-events: none; }
.sh-top { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; position: relative; z-index: 1; }
.sh-role { display: inline-flex; align-items: center; gap: 6px; background: rgba(227, 179, 65, .16); color: #FFE7A8; border: 1px solid rgba(227, 179, 65, .45); padding: 3px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 800; }
.sh-role svg { width: 14px; height: 14px; }
.sh-hello h2 { margin: 10px 0 4px; font-size: 26px; font-weight: 900; color: #fff; }
.sh-hello p { margin: 0; opacity: .88; font-size: 14px; } .sh-hello p b { color: #FFE7A8; }
.sh-score { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; opacity: .95; }
.sh-ring { position: relative; width: 92px; height: 92px; }
.sh-ring svg .bgc { stroke: rgba(255, 255, 255, .15); }
.sh-ring-v { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.sh-ring-v b { font-size: 22px; font-weight: 900; } .sh-ring-v small { font-size: 11px; opacity: .8; }
.sh-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 18px 0 14px; position: relative; z-index: 1; }
.shk { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; font: inherit; color: #fff; cursor: pointer; padding: 11px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(4px); transition: background .2s, transform .2s var(--ease); }
.shk:hover { background: rgba(255, 255, 255, .14); transform: translateY(-2px); }
.shk-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); margin-bottom: 4px; }
.shk-ic svg { width: 15px; height: 15px; }
.shk b { font-size: 24px; font-weight: 900; line-height: 1.1; }
.shk-l { font-size: 12px; font-weight: 700; opacity: .85; line-height: 1.35; }
.shk.warnk { border-color: rgba(227, 179, 65, .7); } .shk.warnk .shk-ic { background: var(--sup-gold); color: #2A1F00; }
.shk.bad { border-color: rgba(255, 120, 120, .6); } .shk.bad .shk-ic { background: #F26B6B; }
.shk.ok .shk-ic { background: var(--accent); color: #12300A; }
.sh-actions { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.sh-actions button { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 8px 16px; font-weight: 800; background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .22); }
.sh-actions button:hover { background: rgba(255, 255, 255, .18); }
.sh-actions .sh-main { background: var(--sup-gold); color: #2A1F00; border-color: transparent; box-shadow: 0 6px 18px rgba(227, 179, 65, .35); }
.sh-note { margin: 12px 0 0; font-size: 12px; opacity: .7; position: relative; z-index: 1; }
body.r-sup #view > .card h2 svg { color: #B8891B; }
body.r-sup .supbars .track i { background: linear-gradient(90deg, var(--brand-2), var(--sup-gold)); }
@media (max-width: 1000px) { .sh-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .sh-kpis { grid-template-columns: repeat(2, 1fr); } .sh-hello h2 { font-size: 21px; } .suphero { padding: 18px 16px; } }

/* ===================== الوضع الليلي ===================== */
html[data-mode="dark"] { color-scheme: dark; }
html[data-mode="dark"] body {
  --bg: var(--dk-bg, #0B1020); --card: var(--dk-card, #131B30); --text: #E6EAF5; --muted: #98A2BE; --line: #26314F;
  --brand: #93A9FF; --brand-2: #6F8CFF; --accent-soft: rgba(140, 198, 63, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
  background: var(--bg); color: var(--text);
}
html[data-mode="dark"] .topbar { background: linear-gradient(120deg, #101A3C 0%, #1B2758 75%); }
html[data-mode="dark"] input, html[data-mode="dark"] select, html[data-mode="dark"] textarea, html[data-mode="dark"] button { background: #0F1628; color: var(--text); border-color: var(--line); }
html[data-mode="dark"] button.primary, html[data-mode="dark"] a.btn.primary { background: linear-gradient(135deg, #3F5BD9, #5B78F0); color: #fff; }
html[data-mode="dark"] button.green { background: var(--accent); color: #0E1A3A; }
html[data-mode="dark"] dialog { background: var(--card); color: var(--text); }
html[data-mode="dark"] th, html[data-mode="dark"] tr.pf-team td, html[data-mode="dark"] .qdoc tr:first-child td { background: #18213A; }
html[data-mode="dark"] tbody tr:hover td { background: #172038; }
html[data-mode="dark"] tr.late td { background: rgba(217, 45, 32, .12); }
html[data-mode="dark"] .badge { background: #1D2742; }
html[data-mode="dark"] .badge.off, html[data-mode="dark"] .badge.ls-rejected, html[data-mode="dark"] .badge.pr-urgent, html[data-mode="dark"] .chip.late { background: rgba(240, 80, 70, .16); color: #FF8A80; }
html[data-mode="dark"] .badge.warn, html[data-mode="dark"] .badge.st-progress, html[data-mode="dark"] .badge.pr-high, html[data-mode="dark"] .chip.st-progress, html[data-mode="dark"] .chip.mitem, html[data-mode="dark"] .badge.mi-b-progress { background: rgba(242, 183, 5, .15); color: #F5C451; }
html[data-mode="dark"] .badge.st-new, html[data-mode="dark"] .chip.meet { background: rgba(111, 140, 255, .16); color: #A9BBFF; }
html[data-mode="dark"] .badge.ok, html[data-mode="dark"] .badge.mi-b-done, html[data-mode="dark"] .chip.meet.done, html[data-mode="dark"] .lchip.main { background: rgba(140, 198, 63, .16); color: #B5E07A; }
html[data-mode="dark"] .badge.urgent { background: rgba(236, 72, 153, .16); color: #F9A8D4; }
html[data-mode="dark"] .chip.leave { background: rgba(139, 92, 246, .18); color: #C4B5FD; }
html[data-mode="dark"] .kpi .ic { background: rgba(255, 255, 255, .06); color: var(--k, #A9BBFF); }
html[data-mode="dark"] .rk.me { background: linear-gradient(90deg, var(--card), var(--accent-soft)); }
html[data-mode="dark"] .balcard, html[data-mode="dark"] .cal .day, html[data-mode="dark"] .preset, html[data-mode="dark"] .filebtn, html[data-mode="dark"] .pol-item, html[data-mode="dark"] .pol-quick span, html[data-mode="dark"] .blkrow { background: var(--card); }
html[data-mode="dark"] .cal .day.wk { background: #10172A; }
html[data-mode="dark"] .attn, html[data-mode="dark"] .pol-quick { background: rgba(242, 183, 5, .07); border-color: rgba(242, 183, 5, .35); }
html[data-mode="dark"] .banner { background: #2A2410; border-color: #4A3E14; color: #F5D27A; }
html[data-mode="dark"] .banner.meetnote { background: #16261A; color: #B5E07A; }
html[data-mode="dark"] .banner.pv { background: #3A3010; }
html[data-mode="dark"] .notes li.go:hover, html[data-mode="dark"] .q-item:hover, html[data-mode="dark"] .nav.side button:hover { background: #18213A; }
html[data-mode="dark"] .nav.side button.on, html[data-mode="dark"] .q-item.on { background: #1C2747; }
html[data-mode="dark"] .setupkey, html[data-mode="dark"] .q-code { background: #1A2340; }
html[data-mode="dark"] .lchip { background: #18213A; border-color: var(--line); color: #A9BBFF; }
html[data-mode="dark"] .qdoc td, html[data-mode="dark"] .qdoc th { border-color: #2C3858; }
html[data-mode="dark"] .wt span { background: var(--card); }
html[data-mode="dark"] .steps .st.ok { color: #B5E07A; }
html[data-mode="dark"] a { color: #A9BBFF; }
html[data-mode="dark"] .mi-weekly, html[data-mode="dark"] .q-tools { background: #0F1628; }
html[data-mode="dark"] body.r-sup .nav.side { background: linear-gradient(180deg, rgba(227, 179, 65, .06), var(--card) 220px); }
html[data-mode="dark"] .supbars .track, html[data-mode="dark"] .track { background: #1A2340; }
html[data-mode="dark"] .authside, html[data-mode="dark"] .auth { background: var(--card); color: var(--text); }
html[data-mode="dark"] .switch input { background: #2A3554; }
.modebtn svg { width: 19px; height: 19px; }
.authmode { position: absolute; top: 18px; inset-inline-end: 110px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; padding: 0; color: var(--brand); }
.authmode svg { width: 19px; height: 19px; }

/* ===================== حساب المبرمج (admin) ===================== */
body.r-owner { --mono: "JetBrains Mono", ui-monospace, Menlo, monospace; }
body.r-owner .topbar { background: linear-gradient(120deg, #070B14 0%, #0E1526 70%, #0B1A20 100%); box-shadow: 0 6px 24px rgba(0, 0, 0, .35), inset 0 -2px 0 var(--own); }
body.r-owner .brandmark h1 small::after { content: "  ~/admin"; font-family: var(--mono); color: var(--own); font-size: 11px; direction: ltr; unicode-bidi: isolate; }
body.r-owner .userchip { background: rgba(34, 211, 166, .08); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--own) 50%, transparent); }
body.r-owner .userchip .av { box-shadow: 0 0 0 2px var(--own); }
body.r-owner .nav.side { background-image: linear-gradient(color-mix(in srgb, var(--own) 6%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--own) 6%, transparent) 1px, transparent 1px); background-size: 22px 22px; }
body.r-owner .nav.side button::after { background: var(--own); }
body.r-owner .nav.side button.on { color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--own) 35%, transparent); }
body.r-owner .kpi b, body.r-owner .num, body.r-owner .ltr, body.r-owner code { font-family: var(--mono); }
body.r-owner #view > .card h2 svg { color: var(--own); }

.console { position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 18px; background: #070B14; color: #CFE7DF; border: 1px solid #1B2A33;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35), 0 0 0 1px rgba(34, 211, 166, .08); font-family: var(--mono, ui-monospace, Menlo, monospace); }
.console::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px); }
.con-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: #0D1422; border-bottom: 1px solid #1B2A33; font-size: 12px; color: #7F95A3; }
.con-bar i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; } .con-bar i:nth-child(2) { background: #FEBC2E; } .con-bar i:nth-child(3) { background: #28C840; }
.con-bar span { margin-inline-start: 8px; } .con-bar em { margin-inline-start: auto; font-style: normal; color: var(--own, #22D3A6); }
.con-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; padding: 16px 18px; position: relative; }
.con-lines { font-size: 12.8px; line-height: 1.9; min-width: 0; }
.con-p { color: var(--own, #22D3A6); font-weight: 800; }
.con-o { color: #A9C4BC; padding-inline-start: 14px; } .con-ok { color: #28C840; }
.con-log { font-family: var(--font); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.con-log b { color: #E7F6F1; font-weight: 700; } .con-time { color: #5F7B86; font-family: var(--mono, monospace); }
.con-dim { color: #5F7B86; }
.con-cursor { display: inline-block; width: 8px; height: 15px; background: var(--own, #22D3A6); vertical-align: -2px; animation: conblink 1.1s steps(1) infinite; }
@keyframes conblink { 50% { opacity: 0; } }
body.nomotion .con-cursor { animation: none; }
.con-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; align-content: start; }
.con-t { background: #0C1320; border: 1px solid #18262F; border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; }
.con-k { font-size: 11px; color: #6E8894; } .con-t b { font-size: 22px; color: #EAFBF5; font-weight: 800; line-height: 1.3; } .con-t small { font-size: 11px; color: var(--own, #22D3A6); }
.con-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 16px; position: relative; }
.con-actions button { background: #0D1422; color: #CFE7DF; border: 1px solid #1F313B; border-radius: 9px; padding: 7px 14px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.con-actions button:hover { border-color: var(--own, #22D3A6); color: #fff; }
.con-actions button svg { color: var(--own, #22D3A6); }
@media (max-width: 900px) { .con-body { grid-template-columns: 1fr; } }
html[data-mode="dark"] .nav button { background: none; border: 0; }
html[data-mode="dark"] .nav.side button.on { background: #1C2747; }
html[data-mode="dark"] .hero { background: radial-gradient(120% 140% at 100% 0%, rgba(140, 198, 63, .16), transparent 45%), linear-gradient(135deg, #16204A 0%, #22306A 60%, #1A3A4A 100%) !important; }
html[data-mode="dark"] .iconbtn, html[data-mode="dark"] .langbtn { background: rgba(255, 255, 255, .08); color: #fff; }
html[data-mode="dark"] button.ghost { background: transparent; border-color: transparent; }
html[data-mode="dark"] button.danger { color: #FF8A80; }
.con-o[dir="rtl"], .con-actions button { font-family: var(--font); letter-spacing: 0; }

/* ===================== مدير الإدارة ===================== */
:root { --boss: #34D399; }
body.r-boss .topbar { box-shadow: 0 6px 24px rgba(30, 47, 122, .25), inset 0 -3px 0 var(--boss); }
body.r-boss .userchip .av { box-shadow: 0 0 0 2px var(--boss); }
body.r-boss .nav.side button::after { background: var(--boss); }
body.r-boss .nav.side button.on { background: color-mix(in srgb, var(--boss) 12%, transparent); }
.mghero { position: relative; overflow: hidden; border-radius: calc(var(--radius) * 1.3); padding: 22px 24px; margin-bottom: 18px; color: #fff;
  background: radial-gradient(110% 130% at 0% 0%, color-mix(in srgb, var(--boss) 22%, transparent), transparent 45%), linear-gradient(135deg, #0E1638 0%, #1A2660 50%, #253573 100%);
  box-shadow: 0 14px 40px rgba(14, 22, 56, .3); }
.mghero::before { content: ""; position: absolute; inset: 0; pointer-events: none; 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: 36px 36px; mask-image: linear-gradient(90deg, transparent, #000 60%); }
.mg-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; position: relative; }
.mg-role { display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--boss) 16%, transparent); color: #C8F7E4; border: 1px solid color-mix(in srgb, var(--boss) 45%, transparent); padding: 3px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 800; }
.mg-role svg { width: 14px; height: 14px; }
.mg-head h2 { margin: 10px 0 4px; font-size: 26px; font-weight: 900; color: #fff; }
.mg-head p { margin: 0; opacity: .88; font-size: 14px; } .mg-head p b { color: #C8F7E4; }
.mg-kpis { display: flex; gap: 10px; }
.mg-kpis div { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .13); border-radius: 14px; padding: 10px 14px; min-width: 110px; display: flex; flex-direction: column; }
.mg-kpis b { font-size: 24px; font-weight: 900; } .mg-kpis small { font-size: 11.5px; opacity: .8; font-weight: 700; }
.mg-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; position: relative; }
.mg-sw { display: flex; align-items: center; gap: 12px; text-align: start; font: inherit; color: #fff; cursor: pointer; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); transition: background .2s, border-color .2s, transform .2s var(--ease); }
.mg-sw:hover { background: rgba(255, 255, 255, .1); transform: translateY(-2px); }
.mg-sw.on { background: rgba(255, 255, 255, .14); border-color: var(--boss); box-shadow: 0 0 0 3px color-mix(in srgb, var(--boss) 25%, transparent); }
.mg-sw-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); flex: none; }
.mg-sw.on .mg-sw-ic { background: var(--boss); color: #06281C; }
.mg-sw-ic svg { width: 21px; height: 21px; }
.mg-sw b { display: block; font-size: 17px; } .mg-sw small { display: block; font-size: 12px; opacity: .78; font-weight: 600; }
.mg-sw em { margin-inline-start: auto; font-style: normal; font-size: 22px; font-weight: 900; opacity: .9; }
.mg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mg-card, .mg-sup { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--card); display: flex; flex-direction: column; gap: 10px; }
.mg-sup { margin-bottom: 14px; border-inline-start: 4px solid var(--sup-gold); }
.mg-top { display: flex; align-items: center; gap: 10px; } .mg-top b { display: block; } .mg-top small { color: var(--muted); font-size: 12px; }
.mg-pts { margin-inline-start: auto; text-align: center; line-height: 1.1; } .mg-pts b { font-size: 22px; color: var(--brand); } .mg-pts small { display: block; font-size: 11px; color: var(--muted); }
.mg-pts.gold b { color: #B8891B; }
.mg-stats { display: flex; flex-wrap: wrap; gap: 6px; } .mg-stats span { background: var(--bg); border-radius: 99px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mg-stats span b { color: var(--text); } .mg-stats .bad b { color: var(--danger); } .mg-stats .warn b { color: var(--warn); }
.mg-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.mg-acts { display: flex; gap: 6px; }
.mg-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mg-nums div { background: var(--bg); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; } .mg-nums b { font-size: 20px; color: var(--brand); } .mg-nums small { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.mg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .mg-cols h4 { margin: 4px 0 6px; font-size: 13.5px; }
.mg-li { font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--line); line-height: 1.6; }
html[data-mode="dark"] .mg-pts.gold b { color: var(--sup-gold); }
@media (max-width: 760px) { .mg-switch, .mg-cols { grid-template-columns: 1fr; } .mg-nums { grid-template-columns: repeat(2, 1fr); } .mg-kpis { width: 100%; } .mg-kpis div { flex: 1; min-width: 0; } }
.sup-by { font-size: 12px; display: flex; align-items: center; gap: 4px; margin-top: 3px; } .sup-by svg { width: 13px; height: 13px; color: var(--sup-gold); }
.sup-btn { border-color: color-mix(in srgb, var(--sup-gold) 60%, var(--line)); } .sup-btn svg { color: #B8891B; }
.apv { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 3px 10px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.apv svg { width: 14px; height: 14px; }
.apv.ok { background: var(--accent-soft); color: #3E6B12; } .apv.wait { background: #FFF4DE; color: var(--warn); } .apv.back { background: #FDECEA; color: var(--danger); } .apv.none { color: var(--muted); padding-inline: 0; font-weight: 600; }
.apv-by { font-size: 11.5px; margin-top: 3px; }
html[data-mode="dark"] .apv.ok { background: rgba(140, 198, 63, .16); color: #B5E07A; } html[data-mode="dark"] .apv.wait { background: rgba(242, 183, 5, .15); color: #F5C451; } html[data-mode="dark"] .apv.back { background: rgba(240, 80, 70, .16); color: #FF8A80; }
tr[data-tid] td.cell:first-child { min-width: 190px; }
tr[data-tid] td:nth-child(2) { min-width: 110px; }
tr[data-tid] td.ops { min-width: 150px; }
tr[data-tid] td.ops button { margin: 2px 0; }

/* =====================================================================
   استوديو المبرمج — هيكل وثيم مستقلين تمامًا لحساب admin
   ===================================================================== */
html.studio-on body {
  --bg: #07090E; --card: #0E121B; --text: #E4E9F2; --muted: #8590A6; --line: #1C2333;
  --brand: #7EE8C8; --brand-2: #5BC8F5; --accent: var(--own, #22D3A6); --accent-soft: rgba(34, 211, 166, .12);
  --shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 10px 30px rgba(0, 0, 0, .35); --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  background: radial-gradient(1200px 600px at 100% -10%, rgba(34, 211, 166, .07), transparent 60%), radial-gradient(900px 500px at -10% 110%, rgba(139, 92, 246, .07), transparent 60%), var(--bg);
  color: var(--text); color-scheme: dark; min-height: 100vh;
}
html.studio-on[data-mode="light"] body { --bg: #F4F6FA; --card: #FFFFFF; --text: #0D1220; --muted: #5B6478; --line: #E2E6EF; --brand: #0E8F72; --brand-2: #0B7FB8; color-scheme: light; background: var(--bg); }
.studio { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.st-rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: color-mix(in srgb, var(--card) 85%, transparent); border-inline-end: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; backdrop-filter: blur(8px); z-index: 30; }
.st-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.st-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--own, #22D3A6), #8B5CF6); color: #04110C; box-shadow: 0 6px 18px rgba(34, 211, 166, .3); }
.st-logo svg { width: 20px; height: 20px; }
.st-brand b { font-family: var(--mono); font-size: 16px; display: block; letter-spacing: .5px; } .st-brand small { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.st-group { font-size: 11px; font-weight: 800; color: var(--muted); padding: 12px 10px 4px; letter-spacing: .5px; }
.st-rail button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: start; background: none; border: 0; border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--muted); cursor: pointer; position: relative; transition: background .15s, color .15s; }
.st-rail button svg { width: 16px; height: 16px; flex: none; }
.st-rail button:hover { background: color-mix(in srgb, var(--own, #22D3A6) 7%, transparent); color: var(--text); }
.st-rail button.on { background: color-mix(in srgb, var(--own, #22D3A6) 13%, transparent); color: var(--text); }
.st-rail button.on::before { content: ""; position: absolute; inset-inline-start: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--own, #22D3A6); box-shadow: 0 0 10px var(--own, #22D3A6); }
.st-rail button.on svg { color: var(--own, #22D3A6); }
.st-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.st-main { min-width: 0; display: flex; flex-direction: column; }
.st-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 22px; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.st-crumb { font-family: var(--mono); font-size: 13px; color: var(--muted); } .st-crumb span { color: var(--own, #22D3A6); } .st-crumb b { color: var(--text); }
.st-cmd { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; min-width: 260px; background: var(--card); border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.st-cmd:hover { border-color: var(--own, #22D3A6); color: var(--text); } .st-cmd svg { width: 15px; height: 15px; }
.st-cmd kbd { margin-inline-start: auto; font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.st-env { font-family: var(--mono); font-size: 11px; font-weight: 800; color: #FF6B6B; border: 1px solid rgba(255, 107, 107, .4); border-radius: 6px; padding: 2px 8px; background: rgba(255, 107, 107, .08); }
.st-env.loc { color: #F5C451; border-color: rgba(245, 196, 81, .4); background: rgba(245, 196, 81, .08); }
.st-ib { position: relative; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; padding: 0; background: var(--card); border: 1px solid var(--line); color: var(--text); font-weight: 800; font-size: 12px; }
.st-ib svg { width: 17px; height: 17px; }
.st-user { background: var(--card) !important; border: 1px solid var(--line); cursor: pointer; color: var(--text); padding: 3px 3px 3px 12px; }
.st-user .meta small { font-family: var(--mono); color: var(--own, #22D3A6); opacity: 1; }
.st-view { padding: 20px 22px 60px; max-width: 1400px; width: 100%; }
.st-title { font-size: 22px; font-weight: 900; margin: 2px 0 16px; display: flex; align-items: center; gap: 10px; }
.st-title::before { content: "›"; font-family: var(--mono); color: var(--own, #22D3A6); }
.studio .menubtn { display: none; }
html.studio-on .card { background: var(--card); border-color: var(--line); }
html.studio-on input, html.studio-on select, html.studio-on textarea { background: color-mix(in srgb, var(--bg) 60%, var(--card)); color: var(--text); border-color: var(--line); }
html.studio-on button { color: var(--text); }
html.studio-on button.primary { background: linear-gradient(135deg, var(--own, #22D3A6), #12A383); color: #03140E; border-color: transparent; box-shadow: 0 6px 18px rgba(34, 211, 166, .25); }
html.studio-on #view > .card h2 svg, html.studio-on .card h2 svg { color: var(--own, #22D3A6); }
html.studio-on th { background: color-mix(in srgb, var(--card) 70%, var(--line)); }
html.studio-on dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); }
@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; }
  .st-rail { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(280px, 84vw); transform: translateX(var(--navshift, 100%)); transition: transform .25s var(--ease); }
  [dir="ltr"] .st-rail { --navshift: -100%; }
  body.navopen .st-rail { transform: none; }
  body.navopen .navscrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 25; }
  .studio .menubtn { display: grid; } .st-cmd { min-width: 0; } .st-cmd span, .st-cmd kbd, .st-env, .st-user .meta { display: none; } .st-view { padding: 16px; }
}
/* نظرة عامة */
.sx-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.sx-t { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; font: inherit; transition: border-color .2s, transform .2s var(--ease); }
.sx-t:hover { border-color: var(--own, #22D3A6); transform: translateY(-2px); }
.sx-t span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); } .sx-t b { font-size: 28px; font-weight: 900; font-family: var(--mono); color: var(--text); } .sx-t small { font-size: 12px; color: var(--own, #22D3A6); font-weight: 700; }
.sx-spark { display: flex; align-items: flex-end; gap: 3px; height: 70px; padding: 8px; background: #0B111B; border: 1px solid #18262F; border-radius: 10px; }
.sx-spark i { flex: 1; background: linear-gradient(180deg, var(--own, #22D3A6), rgba(34, 211, 166, .25)); border-radius: 2px; min-height: 3px; }
.sx-tables { display: flex; flex-wrap: wrap; gap: 8px; }
.sx-tb { display: inline-flex; align-items: center; gap: 10px; background: color-mix(in srgb, var(--bg) 60%, var(--card)); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; font-family: var(--mono); font-size: 12.5px; cursor: pointer; }
.sx-tb b { color: var(--own, #22D3A6); } .sx-tb:hover { border-color: var(--own, #22D3A6); }
.sx-acts { display: flex; flex-wrap: wrap; gap: 8px; } .sx-acts button { display: inline-flex; align-items: center; gap: 7px; }
/* قاعدة البيانات */
.db-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }
.db-tables { padding: 8px; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.db-tables button { display: flex; justify-content: space-between; width: 100%; background: none; border: 0; border-radius: 8px; padding: 6px 9px; font-family: var(--mono); font-size: 12.5px; cursor: pointer; color: var(--muted); }
.db-tables button em { font-style: normal; font-size: 11px; } .db-tables button:hover { color: var(--text); } .db-tables button.on { background: color-mix(in srgb, var(--own, #22D3A6) 13%, transparent); color: var(--text); }
.db-main { min-width: 0; } .db-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; } .db-bar h2 { margin: 0; font-family: var(--mono); font-size: 18px; } .db-bar h2 small { color: var(--muted); font-size: 12px; }
.db-search { display: flex; gap: 6px; margin-inline-start: auto; } .db-search input { width: 220px; }
.db-grid table { font-family: var(--mono); font-size: 12px; } .db-grid td { white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; } .db-null { color: var(--muted); font-style: italic; }
.db-pager { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 10px 0; font-family: var(--mono); font-size: 12.5px; }
/* محرر الأكواد */
.code-ed { position: relative; display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #070A10; }
.code-ed .ln { flex: none; width: 44px; padding: 10px 6px; text-align: end; font: 12.5px/1.6 var(--mono, monospace); color: #3F4B60; background: #0A0E16; border-inline-end: 1px solid #161D2A; overflow: hidden; white-space: pre; user-select: none; direction: ltr; }
.code-ed textarea { flex: 1; border: 0 !important; border-radius: 0; background: transparent !important; color: #D6F5EA !important; font: 12.5px/1.6 var(--mono, monospace); padding: 10px 12px; resize: vertical; tab-size: 2; white-space: pre; overflow: auto; box-shadow: none !important; min-height: 140px; }
.code-ed.big textarea { min-height: 420px; }
.ce-tabs { display: flex; gap: 6px; margin-bottom: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.ce-tabs button { background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 14px; font-weight: 800; color: var(--muted); }
.ce-tabs button.on { border-color: var(--line); background: color-mix(in srgb, var(--own, #22D3A6) 10%, transparent); color: var(--text); }
.ce-wrap { display: grid; grid-template-columns: 230px 1fr; gap: 14px; }
.ce-list { display: flex; flex-direction: column; gap: 4px; }
.ce-list button:not(.primary) { display: grid; grid-template-columns: 12px 1fr; grid-template-rows: auto auto; column-gap: 8px; text-align: start; background: color-mix(in srgb, var(--bg) 60%, var(--card)); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.ce-list button.on { border-color: var(--own, #22D3A6); } .ce-list b { font-size: 13px; } .ce-list small { grid-column: 2; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ce-dot { grid-row: span 2; align-self: center; width: 9px; height: 9px; border-radius: 50%; background: #3F4B60; } .ce-dot.on { background: var(--own, #22D3A6); box-shadow: 0 0 8px var(--own, #22D3A6); }
.ce-meta { margin-bottom: 10px; }
.sql-ok { font-family: var(--mono); color: var(--own, #22D3A6); } .sql-hist { margin-top: 12px; } .sql-hist summary { cursor: pointer; color: var(--muted); font-weight: 700; } .sql-hist .sqlx, .sqlx { margin: 3px; font-family: var(--mono); font-size: 11.5px; }
/* لوحة الأوامر */
.palette { position: fixed; inset: 0; z-index: 200; background: rgba(3, 6, 12, .6); backdrop-filter: blur(4px); display: grid; place-items: start center; padding-top: 12vh; }
.pl-box { width: min(620px, calc(100vw - 28px)); background: #0E121B; border: 1px solid #243045; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: hidden; color: #E4E9F2; }
.pl-box input { width: 100%; border: 0; border-bottom: 1px solid #243045; border-radius: 0; background: transparent; color: #E4E9F2; padding: 16px 18px; font-size: 16px; box-shadow: none; }
.pl-list { max-height: 50vh; overflow: auto; padding: 6px; }
.pl-list button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-radius: 9px; padding: 9px 12px; color: #C8D1E0; text-align: start; font: inherit; cursor: pointer; }
.pl-list button svg { width: 16px; height: 16px; color: #7EE8C8; } .pl-list button em { margin-inline-start: auto; font-style: normal; font-size: 11.5px; color: #6B778C; }
.pl-list button.on, .pl-list button:hover { background: rgba(34, 211, 166, .12); color: #fff; }
.pl-hint { font-family: var(--mono, monospace); font-size: 11px; color: #5B667A; padding: 8px 14px; border-top: 1px solid #1A2232; }
@media (max-width: 900px) { .sx-grid { grid-template-columns: repeat(2, 1fr); } .db-wrap, .ce-wrap { grid-template-columns: 1fr; } .db-tables { position: static; max-height: 180px; } }
html .st-rail button, html .db-tables button, html .ce-tabs button:not(.on), html .pl-list button { background: none; border: 0; }
html .st-rail button.on, html .db-tables button.on { background: color-mix(in srgb, var(--own, #22D3A6) 13%, transparent); }
html .st-rail button:hover { background: color-mix(in srgb, var(--own, #22D3A6) 7%, transparent); }
html .pl-list button.on, html .pl-list button:hover { background: rgba(34, 211, 166, .12); }
/* ---- نوافذ الإشعارات اللحظية ---- */
.pops { position: fixed; top: 84px; inset-inline-end: 18px; z-index: 300; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 28px)); pointer-events: none; }
.pop { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; background: var(--card); color: var(--text); border: 1px solid var(--line); border-inline-start: 4px solid var(--accent); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-lg); cursor: pointer;
  opacity: 0; transform: translateY(-10px) scale(.98); transition: opacity .25s, transform .25s var(--ease); }
.pop.show { opacity: 1; transform: none; }
.pop-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--brand); flex: none; } .pop-ic svg { width: 18px; height: 18px; }
.pop-tx { flex: 1; min-width: 0; } .pop-tx b { display: block; font-size: 13.5px; } .pop-tx span { display: block; font-size: 13px; color: var(--muted); line-height: 1.5; max-height: 4.5em; overflow: hidden; }
.pop-x { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 2px; }
.pushsheet { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translate(50%, 20px); z-index: 290; width: min(560px, calc(100vw - 28px)); display: flex; gap: 12px; align-items: center; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .3s, transform .3s var(--ease); }
[dir="ltr"] .pushsheet { transform: translate(-50%, 20px); }
.pushsheet.show { opacity: 1; transform: translate(50%, 0); } [dir="ltr"] .pushsheet.show { transform: translate(-50%, 0); }
.ps-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--brand); flex: none; } .ps-ic svg { width: 21px; height: 21px; }
.ps-tx { flex: 1; } .ps-tx b { display: block; } .ps-tx span { font-size: 13px; color: var(--muted); }
.ps-btns { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 560px) { .pops { top: 76px; inset-inline-end: 14px; } .pushsheet { flex-wrap: wrap; } .ps-btns { flex-direction: row; width: 100%; } .ps-btns button { flex: 1; } }
/* ---- الحضور والانصراف ---- */
.bad { color: var(--danger) !important; } em.bad { font-style: normal; font-weight: 800; font-size: 12.5px; margin-inline-start: 6px; }
.att-hero { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; border-inline-start: 5px solid var(--line); }
.att-hero.st-in { border-inline-start-color: var(--accent); } .att-hero.st-out { border-inline-start-color: var(--gold); } .att-hero.st-none { border-inline-start-color: var(--brand-2); }
.att-clock { width: 150px; height: 150px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(circle, var(--accent-soft), transparent 70%); border: 2px solid var(--line); flex: none; }
.att-clock b { font: 900 34px/1 var(--mono, ui-monospace, monospace); color: var(--brand); } .att-clock span { font-size: 12px; color: var(--muted); margin-top: 6px; }
.att-main { flex: 1; min-width: 260px; } .att-main h2 { margin: 0 0 4px; }
.att-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0; font-size: 14px; }
.att-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.att-btns button.big { padding: 11px 18px; font-size: 15px; display: inline-flex; align-items: center; gap: 7px; }
.att-since { font-weight: 700; } .att-note { font-size: 12px; margin-top: 10px; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; margin-bottom: 18px; }
.att-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; border-top: 4px solid var(--line); box-shadow: var(--shadow); }
.att-card.s-present, .att-card.s-left { border-top-color: var(--accent); } .att-card.s-late { border-top-color: var(--gold); } .att-card.s-out { border-top-color: #F59E0B; } .att-card.s-absent { border-top-color: var(--danger); }
.att-card.over { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, var(--card)); border-top-color: var(--danger); }
.att-ct { display: flex; align-items: center; gap: 10px; } .att-ct b { display: block; } .att-ct small { color: var(--muted); font-size: 12px; } .att-ct .badge { margin-inline-start: auto; }
.att-row { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; } .att-row span { color: var(--muted); min-width: 92px; } .att-row small { color: var(--muted); }
.att-row.bad b, .att-row.bad span { color: var(--danger); } .att-row.bad-soft b { color: #D97706; }
.att-why { font-size: 12.5px; background: var(--bg); border-radius: 8px; padding: 4px 8px; } .att-br { font-size: 12px; color: var(--muted); padding-inline-start: 100px; }
.att-acts { display: flex; justify-content: flex-end; }
.att-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.att-chip { display: flex; flex-direction: column; align-items: flex-start; text-align: start; font: inherit; cursor: pointer; padding: 7px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); border-inline-start: 4px solid var(--line); }
.att-chip small { font-size: 11.5px; color: var(--muted); } .att-chip.s-present, .att-chip.s-left { border-inline-start-color: var(--accent); } .att-chip.s-late { border-inline-start-color: var(--gold); } .att-chip.s-out { border-inline-start-color: #F59E0B; } .att-chip.s-absent { border-inline-start-color: var(--danger); }
.att-chip.over { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--card)); } .att-chip.over small { color: var(--danger); }
.stat.bad b { color: var(--danger); }
@media (max-width: 600px) { .att-clock { width: 110px; height: 110px; } .att-clock b { font-size: 26px; } .att-br { padding-inline-start: 0; } }
tr.fresh td { background: color-mix(in srgb, var(--accent) 9%, transparent) !important; }
tr.fresh td:first-child { box-shadow: inset -4px 0 0 var(--accent); } [dir="ltr"] tr.fresh td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.rv-row.fresh { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 8px; padding-inline: 8px; }
.badge.fresh-b { background: var(--accent); color: #12300A; font-weight: 800; }
.last-up { font-size: 12px; margin-top: 3px; display: flex; gap: 4px; align-items: center; } .last-up svg { width: 12px; height: 12px; flex: none; }
.last-up { display: block; line-height: 1.5; } .last-up svg { vertical-align: -2px; margin-inline-end: 3px; } .last-up small { white-space: nowrap; }
.tl-reset { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; }
