@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Noto+Naskh+Arabic:wght@500;600;700&display=swap');

/* خط العناوين: سكّال مجلّة من جهاز الزائر (ويندوز وأوفيس)، لأن رخصته لا تسمح برفعه مع الموقع.
   حجمه الطبيعي صغير، فيُكبَّر بـ size-adjust ليتناسق مع بقية الخطوط. ومن لا يملكه يرى Noto Naskh Arabic. */
@font-face { font-family: 'Majalla'; src: local('Sakkal Majalla'), local('SakkalMajalla'); font-weight: 400; size-adjust: 128%; }
@font-face { font-family: 'Majalla'; src: local('Sakkal Majalla Bold'), local('SakkalMajalla-Bold'), local('Sakkal Majalla'); font-weight: 700; size-adjust: 128%; }

:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #efefec;
  --border: #dcdcd8;
  --gray: #a6a6a6;   /* رمادي الهوية: للخطوط والزخارف والعناصر غير النشطة، لا للنصوص */
  --gray-soft: #cbcbcb;
  --line: var(--gray);
  --text: #17231f;
  --text-2: #4c5a54;
  --muted: #84908a;
  --brand: #274b41;
  --brand-ink: #ffffff;
  --brand-soft: #e3ebe6;
  --brand-deep: #1b352e;
  --accent: #7c804d;
  --accent-soft: #eeefe3;
  --good: #2f7a55;
  --good-soft: #e1f2e7;
  --warn: #a0742a;
  --warn-soft: #fbefd6;
  --bad: #b2463b;
  --bad-soft: #fbe3e2;
  --info: #2f6a8a;
  --info-soft: #e2edf8;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 16px rgba(20, 30, 25, .06);
  --radius: 14px;
  --font-body: 'IBM Plex Sans Arabic', Tahoma, 'Segoe UI', Arial, sans-serif;
  --font-display: 'Majalla', 'Sakkal Majalla', 'Noto Naskh Arabic', 'Traditional Arabic', serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1613;
    --surface: #16201c;
    --surface-2: #1d2925;
    --border: #2b3833;
  --line: #5d6662;
    --gray: #8a8f8c;
    --gray-soft: #4a524e;
    --text: #edf2ef;
    --text-2: #b3c0b9;
    --muted: #82918a;
    --brand: #8cc0a8;
    --brand-ink: #0c1a15;
    --brand-soft: #1d3029;
    --brand-deep: #0b1712;
    --accent: #b9bc86;
    --accent-soft: #2c2e1d;
    --good: #5cc283;
    --good-soft: #1b3324;
    --warn: #e0a23a;
    --warn-soft: #3a2e17;
    --bad: #ef7471;
    --bad-soft: #3d1f1e;
    --info: #6aa7e8;
    --info-soft: #1b2b3d;
    --series-1: #3987e5;
    --series-2: #d95926;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1613;
  --surface: #16201c;
  --surface-2: #1d2925;
  --border: #2b3833;
  --line: #5d6662;
  --gray: #8a8f8c;
  --gray-soft: #4a524e;
  --text: #edf2ef;
  --text-2: #b3c0b9;
  --muted: #82918a;
  --brand: #8cc0a8;
  --brand-ink: #0c1a15;
  --brand-soft: #1d3029;
  --brand-deep: #0b1712;
  --accent: #b9bc86;
  --accent-soft: #2c2e1d;
  --good: #5cc283;
  --good-soft: #1b3324;
  --warn: #e0a23a;
  --warn-soft: #3a2e17;
  --bad: #ef7471;
  --bad-soft: #3d1f1e;
  --info: #6aa7e8;
  --info-soft: #1b2b3d;
  --series-1: #3987e5;
  --series-2: #d95926;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.35; font-weight: 700; text-wrap: balance; }
h1, h2 { font-family: var(--font-display); font-weight: 700; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
span.logo.has-img, .site-brand span.logo.has-img, .side .brand span.logo.has-img { background: transparent; padding: 0; overflow: hidden; }
.logo.has-img img, .auth-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* الشعار الافتراضي أخضر داكن: يُفتَّح في الوضع الداكن */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .def img { filter: brightness(0) invert(.94); } }
:root[data-theme="dark"] .def img { filter: brightness(0) invert(.94); }
.auth-logo { display: block; width: 150px; height: 148px; margin: 0 auto 10px; }
.auth h2, .auth .auth-sub { text-align: center; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- أزرار وحقول ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 10px; padding: 8px 14px; font: inherit; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); border-color: var(--bad-soft); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); font-weight: 500; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; width: 100%;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form-grid .span-all { grid-column: 1 / -1; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text); }
.check input { width: auto; }

/* ---------- بطاقات وجداول ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 17px; }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--text-2); font-weight: 500; font-size: 13px; background: var(--surface-2); position: sticky; top: 0; }
tbody tr:hover { background: var(--surface-2); }
td.actions { white-space: nowrap; text-align: left; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

.amount-in { color: var(--good); font-weight: 700; }
.amount-out { color: var(--bad); font-weight: 700; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { color: var(--text-2); font-size: 13px; }
.stat .value { font-size: 22px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: 12px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; min-width: 140px; flex: 0 1 auto; }
.toolbar .grow { flex: 1 1 200px; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 16px; }

/* ---------- نوافذ ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10, 15, 12, .5); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); border: 1px solid var(--border); }
.modal.wide { max-width: 880px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-start; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; z-index: 100; box-shadow: var(--shadow); font-weight: 500; max-width: calc(100% - 32px); }

.alert { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.good { background: var(--good-soft); color: var(--good); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--info-soft); color: var(--info); }

/* ---------- تقويم التوفر ---------- */
.cal { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-grid .dow { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-grid .day {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: 13px; background: var(--surface-2); border: 1px solid transparent; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.cal-grid .day.off { visibility: hidden; }
.cal-grid .day.past { opacity: .35; cursor: default; }
.cal-grid .day.booked { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; cursor: not-allowed; }
.cal-grid .day.sel { background: var(--brand); color: var(--brand-ink); }
.cal-grid .day.range { background: var(--brand-soft); color: var(--brand); }
.cal-grid .day.today { border-color: var(--accent); }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-left: 4px; }

/* ---------- رسم بياني ---------- */
.chart { position: relative; }
.chart svg { direction: ltr; display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--border); }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .s1 { fill: var(--series-1); }
.chart .s2 { fill: var(--series-2); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: var(--surface-2); }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 10px; padding: 8px 10px; font-size: 13px; white-space: nowrap; z-index: 5; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); margin-bottom: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; vertical-align: -1px; }

.meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 80px; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

@media (max-width: 640px) {
  .modal-back { padding: 16px 8px; }
  .stat .value { font-size: 19px; }
}

/* ---------- الحجز ---------- */
.book-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .book-layout { grid-template-columns: 1fr; } }
.summary { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.summary .row { display: flex; justify-content: space-between; gap: 10px; }
.summary .total { font-weight: 800; font-size: 18px; color: var(--brand); border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 6px; }
.cal-grid .day.partial { background: var(--warn-soft); color: var(--warn); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.slot { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: right; font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.slot:hover { border-color: var(--brand); }
.slot .t { font-size: 13px; color: var(--text-2); direction: ltr; }
.slot .p { font-size: 13px; font-weight: 700; color: var(--brand); }
.slot.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.slot.taken { opacity: .55; cursor: not-allowed; background: var(--surface-2); }
.slot.taken .p { color: var(--bad); }

/* ---------- شجرة العائلة ---------- */
.tree-wrap { overflow-x: auto; padding: 8px 0 4px; }
.tree { display: inline-block; min-width: 100%; text-align: center; }
.tree ul { position: relative; padding-top: 18px; margin: 0; padding-inline: 0; display: flex; justify-content: center; }
.tree > ul { padding-top: 0; }
.tree li { list-style: none; position: relative; padding: 18px 6px 0; display: flex; flex-direction: column; align-items: center; }
.tree > ul > li { padding-top: 0; }
.tree li::before, .tree li::after { content: ''; position: absolute; top: 0; width: 50%; height: 18px; border-top: 2px solid var(--border); }
/* في الاتجاه من اليمين لليسار: before = النصف الأيسر، after = النصف الأيمن ويحمل الخط العمودي */
.tree li::before { right: 50%; }
.tree li::after { left: 50%; border-left: 2px solid var(--border); }
.tree li:only-child::before, .tree li:only-child::after { border-top: 0; }
.tree li:first-child::after, .tree li:last-child::before { border-top: 0; }
.tree > ul > li::before, .tree > ul > li::after { display: none; }
.tree ul ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 18px; border-left: 2px solid var(--border); }
.tree li:only-child { padding-top: 18px; }
.tree > ul > li:only-child { padding-top: 0; }
.couple { display: flex; gap: 6px; align-items: stretch; padding: 4px; border-radius: 16px; border: 1px dashed var(--border); }
.tnode { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 96px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1.5px solid var(--border); font-size: 14px; white-space: nowrap; }
.tnode span { font-size: 12px; color: var(--muted); }
.tnode .age { font-size: 11px; }
.tnode.me { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.tnode.me span { color: inherit; opacity: .85; }
.tnode.m { border-color: var(--info); }
.tnode.f { border-color: var(--accent); }

/* ---------- ملصقات الإعلانات ---------- */
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.poster { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.poster-art { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.poster-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-gen { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 18px; text-align: center; color: #fff; background: linear-gradient(135deg, #274b41, #1b352e); }
.poster-gen .ic { font-size: 46px; }
.poster-gen b { font-size: 20px; line-height: 1.35; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.t-course .poster-gen { background: linear-gradient(135deg, #3f7262, #274b41); }
.t-activity .poster-gen { background: linear-gradient(135deg, #7c804d, #5a5d36); }
.t-skill .poster-gen { background: linear-gradient(135deg, #5b6b45, #3d4a2c); }
.t-meeting .poster-gen { background: linear-gradient(135deg, #1b352e, #10231d); }
.t-other .poster-gen { background: linear-gradient(135deg, #8d8f6a, #64664a); }
.poster-tag { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.92); color: #1d2420; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.poster-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.poster-body h3 { margin: 0; font-size: 17px; }
.poster-body p { margin: 0; }
.poster-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--text-2); }
.poster-actions { margin-top: auto; padding-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- المالية ---------- */
.subtabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 14px; scrollbar-width: thin; }
.subtabs button { font: inherit; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; color: var(--text-2); cursor: pointer; white-space: nowrap; font-weight: 500; }
.subtabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.subtabs button:hover { color: var(--text); }
table.je tbody.je-group td { border-bottom: 0; padding-block: 5px; }
table.je tbody.je-group tr.je-memo td { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
table.je td.je-cr { padding-right: 28px; }
table.je tbody.je-group:hover { background: var(--surface-2); }
table.je tbody tr:hover { background: transparent; }
table tfoot td { background: var(--surface-2); border-top: 2px solid var(--border); }
table.stmt td { padding-block: 7px; }
table.stmt tr.sec td { font-weight: 700; color: var(--brand); background: var(--brand-soft); }
table.stmt tr.sub td { font-weight: 700; border-top: 1px solid var(--text-2); }
table.stmt tr.grand td { font-weight: 800; font-size: 15px; border-top: 2px solid var(--text); border-bottom: 3px double var(--text); }

/* عناصر من هوية الصندوق: خطوط زيتونية متقطعة ومعيّن بزوايا دائرية */
.dash-line { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 6px; align-items: center; margin-top: 10px; }
.dash-line i { display: block; height: 3px; border-radius: 2px; background: var(--accent); }
.dash-line i:nth-child(1) { background: var(--gray); }
.dash-line i:nth-child(1) { width: 14px; } .dash-line i:nth-child(2) { width: 14px; } .dash-line i:nth-child(3) { width: 90px; }
.diamond.gray { border-color: var(--gray); }
.diamond { position: absolute; width: 70px; height: 70px; border: 2px solid var(--accent); border-radius: 16px; transform: rotate(45deg); opacity: .7; pointer-events: none; }

/* ---------- الملف التطويري ---------- */
.dev-steps { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 14px; color: var(--text-2); }
.dev-steps .done { color: var(--good); font-weight: 600; }
.dev-nudge { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; text-decoration: none; color: var(--text); border-color: var(--accent); margin-bottom: 16px; }
.skill-group + .skill-group { margin-top: 14px; }
.skill-group-t { font-weight: 700; color: var(--accent); font-size: 13px; margin-bottom: 4px; }
.skill-row { display: grid; grid-template-columns: minmax(150px, 1fr) auto 80px; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.skill-row:last-child { border-bottom: 0; }
.lv { display: flex; gap: 4px; }
.lv button { width: 34px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; }
.lv button.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.lv button:hover { border-color: var(--brand); }
@media (max-width: 560px) { .skill-row { grid-template-columns: 1fr auto; } .skill-row .lv-name { display: none; } }
.riasec-code { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.riasec-code .rc { display: flex; flex-direction: column; align-items: center; min-width: 96px; padding: 10px 14px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); }
.riasec-code .rc.first { background: var(--brand); color: var(--brand-ink); }
.riasec-code .rc b { font-size: 18px; }
.riasec-code .rc small { font-size: 12px; opacity: .85; }
.riasec-bars { display: grid; gap: 6px; max-width: 520px; }
.riasec-bars .rb { display: grid; grid-template-columns: 70px 1fr 48px; gap: 10px; align-items: center; font-size: 14px; color: var(--text-2); }
.riasec-bars .rb .meter > span { background: var(--gray); }
.riasec-bars .rb.top { color: var(--text); font-weight: 600; }
.riasec-bars .rb.top .meter > span { background: var(--brand); }
.riasec-desc { display: grid; gap: 8px; margin-top: 14px; font-size: 15px; }
.rq { margin: 0; padding: 0 22px 0 0; display: grid; gap: 6px; }
.rq li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.rq-t { display: block; margin-bottom: 6px; }
.rq-o { display: flex; gap: 6px; flex-wrap: wrap; }
.rq-o label { display: inline-flex; }
.rq-o input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rq-o span { border: 1px solid var(--border); border-radius: 99px; padding: 4px 14px; font-size: 14px; cursor: pointer; color: var(--text-2); background: var(--surface); }
.rq-o input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.rq-o input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
.rq-progress { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; position: sticky; top: -20px; background: var(--surface); padding: 6px 0; z-index: 1; }
.rq-progress .meter { flex: 1; }
.act-list { list-style: none; margin: 0; padding: 0; }
.act-list li { display: grid; grid-template-columns: 90px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }

/* ---------- تحرير برامج الصفحة الرئيسية ---------- */
.prog-edit { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--border); }
.prog-edit.off { opacity: .6; }
.prog-edit .pe-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.prog-edit .pe-icon svg { width: 28px; height: 28px; }
.prog-edit .pe-tools { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 640px) { .prog-edit { flex-wrap: wrap; } .prog-edit .pe-tools { flex-direction: row; } }

/* ---------- قيود اليومية (على نمط قيود) ---------- */
.btn.dark { background: #17231f; border-color: #17231f; color: #fff; }
.btn.warn { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); font-weight: 600; }
.card.jx { padding: 0; overflow: hidden; }
.jx-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--brand); color: #fff; padding: 18px 22px; border-top: 4px solid var(--accent); }
.jx-head h2 { margin: 0; font-size: 26px; color: #fff; }
.jx-head-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.jx-head .btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.jx-head .btn.primary { background: #fff; border-color: #fff; color: var(--brand); }
.jx-sync { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 22px; background: var(--brand-soft); font-size: 14px; }
.jx-sync .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-inline-end: 6px; }
.jx-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 20px 22px 6px; }
.jx-filters input, .jx-filters select { width: 100%; padding: 10px 14px; border-radius: 10px; }
.jx-date { position: relative; display: block; }
.jx-date span { position: absolute; inset-inline-start: 14px; top: -9px; font-size: 12px; background: var(--surface); color: var(--muted); padding: 0 4px; }
.jx-btns { display: flex; gap: 8px; }
.jx-btns .btn { flex: 1; justify-content: center; padding-block: 10px; }
.jx-per { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 22px 12px; }
.jx-per label { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.jx-per select { width: auto; padding: 8px 12px; border-radius: 10px; }
.jx-table thead th { background: var(--surface-2); font-weight: 700; color: var(--text); padding-block: 14px; }
.jx-table td { padding-block: 14px; vertical-align: middle; }
.jx-table tbody tr:hover { background: var(--surface-2); }
.th-sort { font: inherit; font-weight: 700; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.th-sort span { color: var(--muted); font-size: 11px; }
.th-sort.on span { color: var(--brand); }
.jx-src { font-size: 11px; color: var(--accent); font-weight: 600; }
.jx-acts { white-space: nowrap; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 36px; margin-inline-end: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-2); cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.jx-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; }
.jx-meta { display: grid; gap: 6px; margin: 0 0 14px; }
.jx-meta div { display: grid; grid-template-columns: 90px 1fr; }
.jx-meta dt { color: var(--muted); }
.jx-meta dd { margin: 0; }
.jx-lines tfoot th { background: var(--surface-2); }
.card.jx .table-wrap { margin: 0; }
@media (max-width: 700px) { .jx-head h2 { font-size: 22px; } .jx-filters { grid-template-columns: 1fr 1fr; padding-inline: 14px; } .jx-btns { grid-column: 1 / -1; } }
@media print { .jx-filters, .jx-per, .jx-acts, .jx-head-btns, .jx-pager { display: none !important; } }
.jx-origin { direction: ltr; unicode-bidi: isolate; user-select: all; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.cloud-state { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.cloud-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; }
.cloud-state .dot.saving { background: var(--warn); }
.cloud-state .dot.err { background: var(--bad); }

/* ---------- اللوائح والأنظمة ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 5px 13px; cursor: pointer; font: inherit; color: var(--text-2); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip.on .muted { color: inherit; opacity: .8; }
.reg-group { margin-bottom: 18px; }
.reg-group h3 { font-size: 18px; color: var(--brand); margin: 0 0 10px; }
.reg-list { display: grid; gap: 10px; }
.reg-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.reg-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; font-size: 20px; flex: none; }
.reg-body { flex: 1; min-width: 0; }
.reg-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.reg-text { white-space: normal; line-height: 2; font-size: 16px; max-height: 60vh; overflow: auto; background: var(--surface-2); border-radius: 12px; padding: 14px 16px; }
@media (max-width: 560px) { .reg-card { flex-wrap: wrap; } .reg-acts { width: 100%; } }

/* ---------- فيديو يوتيوب ---------- */
.vplay { position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .95); box-shadow: 0 4px 18px rgba(0, 0, 0, .3); cursor: pointer; display: grid; place-items: center; z-index: 2; transition: transform .15s; }
.vplay::after { content: ''; border-style: solid; border-width: 11px 0 11px 17px; border-color: transparent transparent transparent var(--brand); margin-left: 5px; }
.vplay:hover { transform: scale(1.07); }
.vplay:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.vplay.lg { width: 78px; height: 78px; }
.vplay.inline { position: relative; inset: auto; margin: 0 auto 12px; }
.vplay.lg::after { border-width: 15px 0 15px 23px; margin-left: 7px; }
.vbadge { position: absolute; bottom: 10px; inset-inline-start: 10px; background: rgba(0, 0, 0, .6); color: #fff; border-radius: 99px; padding: 2px 10px; font-size: 12px; z-index: 2; }
.poster-art { position: relative; }
.vframe { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.vframe iframe, .vid-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vid-sec { display: grid; grid-template-columns: 1fr 1.4fr; gap: 28px; align-items: center; }
.vid-sec h2 { margin: 0; }
.vid-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, #274b41, #1b352e); box-shadow: var(--shadow); }
.vid-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 820px) { .vid-sec { grid-template-columns: 1fr; } }
