/* إدارة Waajeh — أبيض هادئ، أحمر العلامة، ومواجهة «VS» كعنصر مميّز واحد. */
:root {
  --bg: #ffffff;
  --surface: #f7f7f7;
  --surface-2: #f0f0f0;
  --raised: #ffffff;
  --ink: #161616;
  --ink-2: #555555;
  --ink-3: #8a8a8a;
  --line: #e9e9e9;
  --line-2: #dadada;
  --green: #e5484d;
  --green-ink: #c43338;
  --green-soft: rgba(229, 72, 77, .10);
  --green-line: rgba(229, 72, 77, .35);
  --blue: #4c8dff;
  --blue-ink: #2357b8;
  --blue-soft: rgba(76, 141, 255, .11);
  --coral: #e5484d;
  --coral-ink: #c4323a;
  --coral-soft: rgba(229, 72, 77, .1);
  --gold: #f2c14e;
  --gold-ink: #8a6200;
  --gold-soft: rgba(242, 193, 78, .18);
  --red: #e5484d;
  --red-ink: #b42328;
  --red-soft: rgba(229, 72, 77, .1);
  --shadow: 0 1px 2px rgba(16, 32, 25, .05), 0 8px 24px -12px rgba(16, 32, 25, .12);
  --shadow-lg: 0 24px 60px -20px rgba(16, 32, 25, .3);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --side: 264px;
  --font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0e0e0f;
  --surface: #151516;
  --surface-2: #1c1c1e;
  --raised: #18181a;
  --ink: #ededed;
  --ink-2: #b0b0b0;
  --ink-3: #7c7c7c;
  --line: #262628;
  --line-2: #333336;
  --green-ink: #ffb3b5;
  --green-soft: rgba(229, 72, 77, .18);
  --blue-ink: #a9c8ff;
  --blue-soft: rgba(76, 141, 255, .16);
  --coral-ink: #ffb3b5;
  --coral-soft: rgba(229, 72, 77, .16);
  --gold-ink: #e9d29a;
  --gold-soft: rgba(242, 193, 78, .14);
  --red-ink: #ffb3b5;
  --red-soft: rgba(229, 72, 77, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }
.ico { flex: none; }
[hidden] { display: none !important; }
.noscript { padding: 40px; text-align: center; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------------- أدوات */
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.gap { gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; }
.strong { font-weight: 600; }
.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt { margin-top: 16px; }
.pos { color: var(--green-ink); font-weight: 600; }
.neg { color: var(--red-ink); font-weight: 600; }
.link { background: none; border: 0; padding: 0; color: var(--green-ink); text-decoration: none; cursor: pointer; font-weight: 500; }
.link:hover { text-decoration: underline; }
time.rel { white-space: nowrap; color: var(--ink-3); font-size: 13px; }

/* ---------------- أزرار */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--raised); color: var(--ink); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { min-height: 32px; padding: 4px 11px; font-size: 13.5px; border-radius: 8px; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: #d63a3f; border-color: #d63a3f; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: #cf3a3f; }
.btn.danger-ghost { color: var(--red-ink); border-color: transparent; background: var(--red-soft); }
.btn.danger-ghost:hover { background: rgba(229, 72, 77, .18); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.google { width: 100%; min-height: 48px; font-weight: 600; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ---------------- حقول */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field-help { font-size: 12.5px; color: var(--ink-3); }
.field-err { font-size: 13px; color: var(--red-ink); min-height: 0; }
.field-err:empty { display: none; }
.input {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.input:disabled { background: var(--surface); color: var(--ink-3); }
textarea.input { resize: vertical; line-height: 1.7; }
select.input { cursor: pointer; padding-inline-end: 28px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }
input[type=range] { accent-color: var(--green); }
.with-unit { display: flex; align-items: stretch; }
.with-unit .input { border-start-end-radius: 0; border-end-end-radius: 0; min-width: 0; }
.unit { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-inline-start: 0; border-radius: 0 10px 10px 0; background: var(--surface); color: var(--ink-2); font-size: 13px; white-space: nowrap; }
[dir=rtl] .unit { border-radius: 10px 0 0 10px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch .thumb { position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: inset-inline-start .2s; }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track .thumb { inset-inline-start: 21px; }
.switch input:focus-visible + .track { outline: 2px solid var(--green); outline-offset: 2px; }
.switch-label { font-size: 14px; color: var(--ink-2); }

/* ---------------- رقائق ونقاط */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.green { background: var(--green-soft); color: var(--green-ink); }
.chip.gold { background: var(--gold-soft); color: var(--gold-ink); }
.chip.red { background: var(--red-soft); color: var(--red-ink); }
.chip.blue { background: var(--blue-soft); color: var(--blue-ink); }
.chip.coral { background: var(--coral-soft); color: var(--coral-ink); }
.chip.soft { background: var(--surface); border: 1px solid var(--line); }
a.chip { text-decoration: none; cursor: pointer; }
a.chip:hover { background: var(--green-soft); color: var(--green-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.live { background: var(--green); box-shadow: 0 0 0 0 var(--green-line); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47,179,109,.5); } 70% { box-shadow: 0 0 0 7px rgba(47,179,109,0); } 100% { box-shadow: 0 0 0 0 rgba(47,179,109,0); } }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--coral); color: #fff; font-size: 11.5px; font-weight: 700; }

/* ---------------- إقلاع وأخطاء الإعداد */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--ink-2); }
/* شعار Waajeh الأصلي: عمود أخضر (يسار) وعمود أبيض أقصر (يمين) على مربع داكن ليظهر في المظهرين. */
.wmark {
  --s: 34px; flex: none; direction: ltr;
  display: inline-flex; align-items: center; justify-content: center; gap: calc(var(--s) * .05);
  width: var(--s); height: var(--s); border-radius: calc(var(--s) * .27); background: #000;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.wmark i { display: block; }
/* مثل أيقونة التطبيق: العمود الكبير أحمر «سيادي» والصغير أبيض، ولكل واحد ستروك خفيف بدرجته */
.wmark .l { width: calc(var(--s) * .25); height: calc(var(--s) * .5); background: #E5484D; box-shadow: inset 0 0 0 max(1px, calc(var(--s) * .012)) #EC7074; border-radius: calc(var(--s) * .07) 0 0 calc(var(--s) * .07); }
.wmark .r { width: calc(var(--s) * .18); height: calc(var(--s) * .36); background: #fff; box-shadow: inset 0 0 0 max(1px, calc(var(--s) * .012)) #DDDDDD; border-radius: 0 calc(var(--s) * .07) calc(var(--s) * .07) 0; }
.wmark.lg { --s: 52px; }
.wmark.boot { --s: 72px; }
/* حركة شعار الدخول: عمود يصغر والآخر يكبر، والأكبر أحمر والأصغر أبيض (يتبادلون اللون مع الحجم) */
.wmark.boot .l { animation: wm-l .5s cubic-bezier(.65,0,.35,1) infinite alternate; }
.wmark.boot .r { animation: wm-r .5s cubic-bezier(.65,0,.35,1) infinite alternate; }
@keyframes wm-l { to { height: calc(var(--s) * .36); background: #fff; box-shadow: inset 0 0 0 max(1px, calc(var(--s) * .012)) #DDDDDD; } }
@keyframes wm-r { to { height: calc(var(--s) * .5); background: #E5484D; box-shadow: inset 0 0 0 max(1px, calc(var(--s) * .012)) #EC7074; } }

/* اسم المالك */
.owner-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--ink-3); }
.owner-line .ol-name { font-weight: 700; color: var(--ink-2); }
.owner-line .ol-title::after { content: '·'; margin-inline-start: 6px; opacity: .6; }
.owner-line.on-dark { margin-top: 14px; font-size: 14px; color: rgba(255,255,255,.75); }
.owner-line.on-dark .ol-name { color: #fff; }
.owner-line.side { margin-top: 8px; font-size: 12px; }
.side-brand { display: flex; flex-direction: column; min-width: 0; }
.setup-error { max-width: 560px; margin: 10vh auto; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.setup-error ol { margin: 0; padding-inline-start: 22px; color: var(--ink-2); }

/* ---------------- الدخول */
.login { min-height: 100vh; min-height: 100dvh; display: flex; background: var(--bg); }
.login-brand { position: relative; overflow: hidden; background: #0b0d0c; min-height: 260px; isolation: isolate; }
/* نصفان متساويان تمامًا: المنافس أ يمينًا والمنافس ب يسارًا، والخط الفاصل في المنتصف */
.login-brand .vs-half { position: absolute; top: 0; bottom: 0; width: 50%; overflow: hidden; }
.login-brand .vs-half.a { right: 0; }
.login-brand .vs-half.b { left: 0; }
.login-brand .vs-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-brand .vs-half::after { content: ''; position: absolute; inset: 0; }
.login-brand .vs-half.a::after { background: linear-gradient(to top, rgba(10,12,11,.92) 0, rgba(10,12,11,.2) 45%, rgba(76,141,255,.18) 100%); }
.login-brand .vs-half.b::after { background: linear-gradient(to top, rgba(10,12,11,.92) 0, rgba(10,12,11,.2) 45%, rgba(255,90,95,.18) 100%); }
.login-brand .vs-divider { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; transform: translateX(-50%); background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.55) 18%, rgba(255,255,255,.55) 82%, rgba(255,255,255,0)); z-index: 1; }
.login-brand .vs-label { position: absolute; top: 24px; z-index: 2; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; color: #fff; backdrop-filter: blur(6px); }
.login-brand .vs-label.a { right: 22px; background: rgba(76,141,255,.85); }
.login-brand .vs-label.b { left: 22px; background: rgba(255,90,95,.85); }
.login-brand .vs-tag { position: absolute; top: calc(44% + 84px); left: 50%; transform: translateX(-50%); z-index: 2; padding: 7px 14px; border-radius: 99px; background: rgba(10,12,11,.72); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; backdrop-filter: blur(6px); }
.brand-row { display: flex; align-items: center; gap: 14px; }
.login-brand .seal {
  z-index: 2;
  position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%);
  width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green); color: #fff; font-size: 46px; font-weight: 700; direction: ltr;
  box-shadow: 0 0 0 10px rgba(255,255,255,.14), 0 30px 60px -10px rgba(0,0,0,.45);
}
.brand-copy { position: absolute; inset-inline: 40px; bottom: 40px; color: #fff; z-index: 2; }
.brand-name { font-size: 40px; font-weight: 700; direction: ltr; text-align: end; line-height: 1; }
[dir=rtl] .brand-name { text-align: right; }
.brand-sub { opacity: .88; margin-top: 10px; font-size: 17px; }
.login-panel { display: flex; flex-direction: column; width: 100%; min-height: 100vh; min-height: 100dvh; padding: 28px clamp(20px, 5vw, 48px); background: var(--bg); }
.login-top { display: flex; justify-content: space-between; align-items: center; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; font-size: 16px; }
.logo .logo-mark { width: 34px; height: 34px; font-size: 12.5px; border-radius: 9px; }
.login-card { margin: auto 0; padding: 32px 0; display: flex; flex-direction: column; gap: 18px; max-width: 400px; width: 100%; align-self: center; }
.login-card h1 { font-size: 28px; }
.lead { color: var(--ink-2); white-space: pre-line; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .btn.primary { min-height: 46px; }
.form-msg { font-size: 14px; padding: 10px 12px; border-radius: 10px; }
.form-msg:empty { display: none; }
.form-msg.err { background: var(--red-soft); color: var(--red-ink); }
.form-msg.ok { background: var(--green-soft); color: var(--green-ink); }
.switch-line { color: var(--ink-2); font-size: 14px; text-align: center; }
.login-foot { color: var(--ink-3); font-size: 12.5px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.login-foot p { margin: 0; }
.owner-line.center { justify-content: center; font-size: 13.5px; }
.state-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--green-soft); color: var(--green-ink); }
.state-ico.pulse { animation: breathe 2.4s ease-in-out infinite; }
.mail { font-weight: 600; background: var(--surface); padding: 8px 12px; border-radius: 10px; align-self: flex-start; }
.wait-steps { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); }
.ws { display: flex; align-items: center; gap: 10px; color: var(--ink-3); }
.ws.done { color: var(--green-ink); }
.ws.now { color: var(--ink); font-weight: 600; }

/* ---------------- الهيكل */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-inline-end: 1px solid var(--line); background: var(--surface); }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 10px; }
.side-top .icon-btn { display: none; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.nav-group { margin-top: 14px; }
.nav-group-title { font-size: 12px; color: var(--ink-3); padding: 0 10px 6px; font-weight: 500; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14.5px; }
.nav-link span:not(.badge) { flex: 1; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.on { background: var(--raised); color: var(--ink); box-shadow: var(--shadow); }
.nav-link.on .ico { color: var(--green); }
.side-foot { padding: 14px 16px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; }
.me-name { font-weight: 600; font-size: 14px; }
.me-role { font-size: 12.5px; color: var(--ink-3); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green-ink); font-weight: 700; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 52px; height: 52px; font-size: 20px; }
.scrim { display: none; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px clamp(16px, 3vw, 32px); background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar > .icon-btn { display: none; }
.top-actions { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.live-ind { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--green-ink); padding: 4px 10px; border-radius: 99px; background: var(--green-soft); margin-inline-end: 4px; }
.live-ind.off { color: var(--gold-ink); background: var(--gold-soft); }
.live-ind.off .dot { background: var(--gold); animation: none; }
.top-user { display: flex; flex-direction: column; line-height: 1.25; padding: 0 8px; border-inline-start: 1px solid var(--line); margin-inline-start: 4px; }
.tu-name { font-weight: 600; font-size: 13.5px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tu-role { font-size: 12px; color: var(--ink-3); }
.main { flex: 1; padding: 28px clamp(16px, 3vw, 40px) 120px; outline: none; }
.page { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page.wide { max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 700; }
.page-head p { color: var(--ink-2); margin-top: 4px; max-width: 70ch; }
.page-actions { display: flex; gap: 8px; align-items: center; }
.page-actions .input { min-width: 240px; }
.page-loading { height: 3px; width: 100%; background: linear-gradient(90deg, transparent, var(--green), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: load 1s linear infinite; border-radius: 2px; }
@keyframes load { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* البحث العام */
.gsearch { position: relative; display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; max-width: 460px; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); }
.gsearch:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.gsearch-input { border: 0; background: transparent; outline: none; height: 40px; flex: 1; min-width: 0; width: 100%; color: var(--ink); }
.gsearch-spacer { flex: 1; }
.gsearch-pop { position: absolute; top: calc(100% + 6px); inset-inline: 0; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; max-height: 70vh; overflow: auto; }
.gs-head { font-size: 12px; color: var(--ink-3); padding: 8px 10px 4px; }
.gs-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; text-align: start; cursor: pointer; color: var(--ink); }
.gs-item:hover, .gs-item:focus { background: var(--surface); outline: none; }
.gs-t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-s { color: var(--ink-3); font-size: 12.5px; direction: ltr; }
.gs-none { padding: 12px; color: var(--ink-3); }

/* ---------------- بطاقات وعناوين */
.card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card.flat { border-radius: var(--r); padding: 16px; background: var(--bg); }
.card.off { opacity: .62; }
.card-title { font-size: 16.5px; font-weight: 600; }
.card h3 { font-size: 15px; }
.danger-card { border-color: rgba(229, 72, 77, .35); background: var(--red-soft); }
.attention { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.section-title { font-size: 17px; font-weight: 600; margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface); color: var(--ink-2); font-size: 14px; }
.notice.warn { background: var(--gold-soft); color: var(--gold-ink); }
.notice.err { background: var(--red-soft); color: var(--red-ink); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 16px; color: var(--ink-2); }
.empty-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); margin-bottom: 4px; }
.empty h3 { font-size: 16px; color: var(--ink); }
.empty p { max-width: 46ch; font-size: 14px; }
.skel-wrap { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.skel { position: relative; overflow: hidden; height: 16px; border-radius: 8px; background: var(--surface-2); }
.skel::after { content: ''; position: absolute; inset: 0; transform: translateX(100%); background: linear-gradient(90deg, transparent, var(--shimmer), transparent); animation: shimmer 1.2s ease-in-out infinite; }
.skel.round { border-radius: 50%; flex: none; }
@keyframes shimmer { to { transform: translateX(-100%); } }

/* ---------------- بطاقة الدخل (VS) */
.hero { position: relative; border-radius: 22px; padding: 28px clamp(18px, 3vw, 34px) 24px; background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 22px; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--coral) 0 33%, var(--green) 33% 67%, var(--blue) 67% 100%); }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hero-label { font-size: 15px; color: var(--ink-2); font-weight: 500; }
.hero-total { display: flex; align-items: baseline; gap: 2px; direction: ltr; justify-content: flex-end; font-weight: 700; letter-spacing: -1.5px; line-height: 1; margin-top: 8px; }
.ht-int { font-size: clamp(44px, 7vw, 76px); }
.ht-dec { font-size: clamp(22px, 3vw, 32px); color: var(--ink-3); }
.ht-cur { font-size: 18px; color: var(--ink-2); margin-left: 10px; letter-spacing: 0; font-weight: 600; }
.hero-note { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-3); }
.hero-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 0; }
.hv-side { padding: 18px 20px; border-radius: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hv-side.app { background: var(--green-soft); }
.hv-side.users { background: var(--blue-soft); text-align: end; }
.hv-label { font-size: 14px; font-weight: 600; }
.hv-side.app .hv-label { color: var(--green-ink); }
.hv-side.users .hv-label { color: var(--blue-ink); }
.hv-value { font-size: clamp(22px, 3.2vw, 32px); font-weight: 700; direction: ltr; letter-spacing: -.5px; }
.hv-side.app .hv-value { text-align: right; }
.hv-side.users .hv-value { text-align: left; }
.hv-sub { font-size: 12.5px; color: var(--ink-2); }
.hv-held { display: flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; color: var(--gold, #E2B53E); }
.hv-seal { align-self: center; width: 54px; height: 54px; margin: 0 -14px; z-index: 1; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 16px; direction: ltr; box-shadow: 0 0 0 6px var(--raised); }
.hero-split { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.hs.app { background: var(--green); }
.hs.fees { background: var(--ink-3); }
.hs.users { background: var(--blue); }
.hero-break { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; row-gap: 18px; margin: 0; border-top: 1px solid var(--line); padding-top: 18px; }
.hb { padding: 0 14px; border-inline-start: 1px solid var(--line); }
.hb:nth-child(4n+1) { border-inline-start: 0; padding-inline-start: 0; }
.hb dt { font-size: 12.5px; color: var(--ink-3); }
.hb dd { margin: 4px 0 0; font-weight: 600; direction: ltr; text-align: right; font-size: 15.5px; }
.hb dd small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; direction: rtl; }
.hb.warn dd { color: var(--gold-ink); }
.skel-text { color: var(--ink-3); }

/* ---------------- المؤشرات */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kpis.small { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid transparent; text-decoration: none; color: inherit; min-width: 0; }
a.stat:hover { border-color: var(--line-2); background: var(--raised); }
.stat-label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }
.stat-label .ico { color: var(--ink-3); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; line-height: 1.2; }
.kpis.small .stat-value { font-size: 20px; }
.stat-sub { font-size: 12.5px; color: var(--ink-3); }
.stat.accent .stat-value { color: var(--green-ink); }
.stat.warn { background: var(--gold-soft); }
.stat.warn .stat-label, .stat.warn .stat-label .ico { color: var(--gold-ink); }
.chart-pair { display: grid; grid-template-columns: 1fr; gap: 18px; }
.chart-title { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.mini-chart { height: 64px; }
.bars { width: 100%; height: 64px; display: block; }
.bars .bar { fill: var(--green); }
.bars .bar.zero { fill: var(--line); }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-item.clickable { cursor: pointer; border-radius: 8px; }
.feed-item.clickable:hover { background: var(--surface); }
.fi-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex: none; }
.feed-item.warn .fi-ico { background: var(--gold-soft); color: var(--gold-ink); }
.feed-item.danger .fi-ico { background: var(--red-soft); color: var(--red-ink); }
.fi-body { min-width: 0; flex: 1; }
.fi-text { font-size: 14px; overflow-wrap: anywhere; }
.fi-meta { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- جداول وأدوات */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar > .input[type=search] { flex: 1 1 260px; max-width: 420px; }
.toolbar > select.input { width: auto; }
.toolbar.tight { padding: 12px; border-bottom: 1px solid var(--line); }
.toolbar.tight .input { max-width: none; }
.toolbar input[type=date] { width: auto; }
.summary-line { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-weight: 500; font-size: 12.5px; color: var(--ink-3); padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--surface); }
.tbl tr.muted-row td { opacity: .55; }
.tbl .num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .actions { width: 1%; white-space: nowrap; }
.tbl .check { width: 1%; }
.tbl .side-a { color: var(--blue-ink); font-weight: 600; }
.tbl .side-b { color: var(--coral-ink); font-weight: 600; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.verified { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--green); color: #fff; margin-inline-start: 5px; vertical-align: -2px; }
.selbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; background: var(--surface); border-radius: var(--r); }
.selbar .btn { margin-inline-start: auto; }

/* شريط الأصوات أ/ب */
.vbar { display: flex; height: 5px; width: 100%; min-width: 70px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin-top: 5px; gap: 2px; }
.vbar.big { height: 10px; }
.vbar .va { background: var(--blue); }
.vbar .vbb { background: var(--coral); }
.score { display: inline-flex; align-items: center; gap: 8px; }
.score-n { display: inline-grid; place-items: center; min-width: 36px; height: 26px; padding: 0 8px; border-radius: 8px; font-weight: 700; font-size: 13px; }
.score.green .score-n { background: var(--green-soft); color: var(--green-ink); }
.score.gold .score-n { background: var(--gold-soft); color: var(--gold-ink); }
.score.red .score-n { background: var(--red); color: #fff; }
.score-sub { font-size: 12.5px; color: var(--ink-3); }

/* ---------------- نوافذ */
.modal-back, .drawer-back { position: fixed; inset: 0; z-index: 50; background: rgba(9, 20, 16, .5); animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal-back { display: grid; place-items: center; padding: 16px; z-index: 60; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--raised); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head, .drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2, .drawer-head h2 { font-size: 18px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }
.drawer { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(560px, 100%); background: var(--bg); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .2s ease-out; }
.drawer.wide { width: min(760px, 100%); }
@keyframes slide { from { transform: translateX(-24px); opacity: 0; } }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px 60px; display: flex; flex-direction: column; gap: 16px; }
.drawer-body > *, .modal-body > *, .tabs { flex-shrink: 0; }
.diff { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow: auto; }
.diff li { padding: 10px 12px; background: var(--surface); border-radius: 10px; }
.diff-k { font-weight: 600; font-size: 14px; }
.diff-v { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; margin-top: 4px; }
.diff-v .ico { transform: rotate(-90deg); color: var(--ink-3); }
.diff-v .old { color: var(--ink-3); text-decoration: line-through; }
.diff-v .new { color: var(--green-ink); font-weight: 600; }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 14px; max-width: min(520px, 92vw); animation: pop .2s ease-out; transition: opacity .3s, transform .3s; }
.toast.ok .ico { color: var(--green); }
.toast.err { background: var(--red); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------------- تبويبات */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; padding: 10px 14px; border: 0; background: none; color: var(--ink-2); font-weight: 500; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); }
.tab.on::after { content: ''; position: absolute; inset-inline: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--green); }
.tab-pane { display: flex; flex-direction: column; gap: 16px; }

/* ---------------- الإعدادات */
.chips-nav { display: flex; gap: 6px; flex-wrap: wrap; position: sticky; top: 65px; z-index: 5; padding: 8px 0; background: var(--bg); }
.settings-groups { display: flex; flex-direction: column; gap: 18px; }
.group-card { scroll-margin-top: 130px; }
.group-head p { margin-top: 2px; font-size: 14px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 18px; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span2 { grid-column: 1 / -1; }
.setting { display: flex; flex-direction: column; gap: 6px; padding: 12px; margin: -12px; border-radius: 12px; transition: background .2s; }
.setting.wide { grid-column: 1 / -1; }
.setting.dirty { background: var(--green-soft); }
.setting.invalid { background: var(--red-soft); }
.setting.danger .field-label { color: var(--red-ink); }
.setting-head { display: flex; align-items: center; gap: 8px; }
.tag-default { font-size: 11px; color: var(--ink-3); border: 1px dashed var(--line-2); border-radius: 6px; padding: 0 6px; }
.ta-wrap { position: relative; }
.counter { position: absolute; bottom: 6px; inset-inline-end: 10px; font-size: 11.5px; color: var(--ink-3); }
.chips-edit { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); align-items: center; }
.chips-edit .input { border: 0; min-height: 30px; width: auto; flex: 1 1 120px; padding: 4px 6px; box-shadow: none; }
.chip.edit { padding: 2px 4px 2px 10px; gap: 2px; background: var(--surface-2); color: var(--ink); font-size: 13.5px; }
[dir=rtl] .chip.edit { padding: 2px 10px 2px 4px; }
.chip.edit .icon-btn { width: 22px; height: 22px; border-radius: 6px; }
.chips-edit.big .chip.edit { font-size: 15px; padding-block: 4px; }
.packs { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pack-row { display: grid; grid-template-columns: 140px 140px 1fr auto; gap: 10px; align-items: center; width: 100%; max-width: 640px; }
.pack-row.head { font-size: 12.5px; color: var(--ink-3); }
/* نقاط بداية كل رتبة: بطاقة لكل رتبة برقم كبير واضح */
.tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tier-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; cursor: text; }
.tier-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--tier); }
.tier-card:focus-within { border-color: var(--tier); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tier) 22%, transparent); }
.tier-head { display: flex; align-items: center; gap: 8px; }
.tier-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--tier); }
.tier-name { font-weight: 700; font-size: 16px; }
.tier-step { margin-inline-start: auto; font-size: 12px; color: var(--ink-3); }
.tier-val { display: flex; align-items: baseline; gap: 8px; }
.tier-card input.tier-input { flex: 1; min-width: 0; width: 100%; height: 56px; padding: 0 12px; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.5px; text-align: center; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); -moz-appearance: textfield; }
.tier-card input.tier-input::-webkit-outer-spin-button, .tier-card input.tier-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tier-card input.tier-input:disabled { opacity: .6; }
.tier-unit { font-size: 13px; color: var(--ink-3); flex: none; }
.tier-note { font-size: 12px; color: var(--ink-3); margin-top: -4px; }
/* قيمة العملة الصافية المحسوبة */
.calc-box { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--green-soft, var(--surface)); border: 1px dashed var(--line); }
.calc-main { font-size: 14px; color: var(--ink-2); }
.calc-main strong { font-size: 24px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; margin-inline-end: 4px; }
.calc-rows { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ink-2); }
.calc-rows b { color: var(--ink); }
.savebar { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 18px; padding: 10px 10px 10px 18px; border-radius: 16px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); width: max-content; max-width: calc(100vw - 24px); flex-wrap: wrap; animation: pop .2s ease-out; }
[dir=rtl] .savebar { padding: 10px 18px 10px 10px; }
.savebar .btn:not(.primary) { background: transparent; color: var(--bg); border-color: rgba(255,255,255,.25); }
:root[data-theme='dark'] .savebar .btn:not(.primary) { border-color: rgba(0,0,0,.25); }
.sb-text { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }

/* ---------------- المحتوى */
.split-edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.preview-box { max-height: 70vh; overflow-y: auto; padding: 4px 2px; }
.prose p { margin: 0 0 12px; line-height: 1.9; max-width: 72ch; }
.faq-num { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.planner { display: flex; flex-direction: column; gap: 10px; }
.plan-day { display: grid; grid-template-columns: 170px 170px 1fr 150px; gap: 14px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.plan-day.today { border-color: var(--line-2); background: var(--surface); }
.plan-day.active { border-color: var(--green); background: var(--green-soft); }
.pd-date { display: flex; flex-direction: column; gap: 4px; align-self: center; }
.pd-name { font-weight: 600; }
.pd-num { font-size: 12.5px; color: var(--ink-3); text-align: right; }
.notif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.notif h3 { font-size: 15px; }
.notif.off .field, .notif.off .notif-prev { opacity: .5; }
.notif-prev { display: flex; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); }
.np-app { width: 28px; height: 28px; border-radius: 7px; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.np-title { font-weight: 600; font-size: 13.5px; }
.np-body { font-size: 13px; color: var(--ink-2); }
.kv-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 10px; align-items: center; }
.kv-row > .ico { transform: rotate(90deg); color: var(--ink-3); }

/* ---------------- المواجهات */
.ch-head { display: flex; flex-direction: column; gap: 14px; }
.vs-board { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.vb { padding: 14px; border-radius: 14px; text-align: center; }
.vb.a { background: var(--blue-soft); }
.vb.b { background: var(--coral-soft); }
.vb-l { font-size: 12.5px; color: var(--ink-2); }
.vb-n { font-size: 28px; font-weight: 700; }
.vb.a .vb-n { color: var(--blue-ink); }
.vb.b .vb-n { color: var(--coral-ink); }
.vb-mid { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv dd[dir=ltr] { text-align: right; }
.reason-bars { display: flex; flex-direction: column; gap: 10px; }
.rb { display: grid; grid-template-columns: 190px 1fr 50px; gap: 12px; align-items: center; font-size: 14px; }
.rb-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.rb-fill { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.comments { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.comment { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 6px; }
.comment.hidden-c { opacity: .55; border-style: dashed; }
.c-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------- المستخدمون */
.user-head { display: flex; align-items: center; gap: 14px; }
.restr-list { display: flex; flex-direction: column; gap: 8px; }
.restr { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.restr.on { border-color: var(--gold); background: var(--gold-soft); }
.restr select.input, .restr input.input { width: auto; min-height: 32px; padding-block: 4px; }

/* ---------------- صندوق الوارد والدردشة */
.inbox { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: calc(100vh - 210px); min-height: 480px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--raised); }
.inbox-side { border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.inbox-list { overflow-y: auto; flex: 1; }
.inbox-item { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: start; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; }
.inbox-item:hover { background: var(--surface); }
.inbox-item.on { background: var(--green-soft); }
.inbox-item.unread .ii-name, .inbox-item.unread .ii-subject { font-weight: 700; }
.ii-name { font-weight: 600; font-size: 14px; }
.ii-subject { font-size: 14px; }
.ii-last { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.convo { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.convo > .empty { margin: auto; }
.convo-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.convo-head > .icon-btn { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.day-sep { align-self: center; font-size: 12px; color: var(--ink-3); background: var(--raised); padding: 2px 12px; border-radius: 99px; margin: 8px 0; list-style: none; }
.bubble { max-width: min(78%, 560px); padding: 9px 13px; border-radius: 16px; display: flex; flex-direction: column; gap: 3px; }
.bubble.user { align-self: flex-start; background: var(--raised); border: 1px solid var(--line); border-start-start-radius: 4px; }
.bubble.staff { align-self: flex-end; background: var(--green-soft); border-start-end-radius: 4px; }
.b-who { font-size: 12px; font-weight: 600; color: var(--green-ink); }
.bubble.user .b-who { color: var(--blue-ink); }
.b-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.b-time { font-size: 11.5px; align-self: flex-end; }
.b-img { max-width: 260px; max-height: 260px; border-radius: 10px; object-fit: cover; }
.b-sticker { font-size: 30px; }
.composer { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { flex: 1; min-height: 44px; }
.readonly-foot { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; text-align: center; }

/* ---------------- البلاغات */
.report-list { display: flex; flex-direction: column; gap: 8px; }
.report-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; text-align: start; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); cursor: pointer; }
.report-item:hover { border-color: var(--line-2); background: var(--surface); }
.ri-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-ink); flex: none; }

/* ---------------- إشعارات النظام */
.bc-card { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); border-inline-start: 4px solid var(--green); }
.bc-card.blue { border-color: var(--blue); }
.bc-card.gold { border-color: var(--gold); }
.bc-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--green-soft); color: var(--green-ink); flex: none; }
.bc-ico.blue, .bc-card.blue .bc-ico { background: var(--blue-soft); color: var(--blue-ink); }
.bc-ico.gold, .bc-card.gold .bc-ico { background: var(--gold-soft); color: var(--gold-ink); }
.bc-row { flex-direction: row; align-items: flex-start; gap: 14px; }
.bc-row.off { opacity: .6; }

/* ---------------- الإعلانات */
.promos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.promo-card { display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface); align-items: center; }
.promo-card img, .promo-noimg { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); }
.promo-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.promo-tag { font-size: 11px; color: var(--ink-3); }
.promo-btn { align-self: flex-start; margin-top: 4px; padding: 3px 12px; border-radius: 99px; background: var(--green); color: #fff; font-size: 12.5px; font-weight: 600; }

/* ---------------- الوسائط */
.media-row { flex-direction: row; align-items: flex-start; gap: 14px; }
.media-row.off { opacity: .6; }
.cover { width: 64px; height: 64px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); overflow: hidden; flex: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.audio-box audio { width: 100%; height: 36px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.filter-card { gap: 10px; }
.filter-card.off { opacity: .6; }
.filter-swatch { height: 96px; border-radius: 12px; display: grid; grid-template-columns: 2fr 1fr 1fr; overflow: hidden; }
.fs-a { background: linear-gradient(160deg, #7fd8a8, #2a9d8f); }
.fs-b { background: linear-gradient(160deg, #6fa8dc, #3d85c6); }
.fs-c { background: linear-gradient(160deg, #ffb3b5, #e5484d); }

/* ---------------- الفريق */
.member { gap: 12px; }
.member.owner { background: var(--surface); }
.member-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.member-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.member-meta .muted { display: inline-flex; align-items: center; gap: 6px; }
.lock-note { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); font-weight: 400; margin-inline-start: 8px; }
.perm-details summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--green-ink); padding: 4px 0; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 12px; }
.perm-group h4 { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-bottom: 6px; }
.perm { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pending-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---------------- السجلات */
.log-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.log-item { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.log-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.log-target { font-size: 13px; color: var(--ink-3); direction: ltr; unicode-bidi: isolate; }
.log-time { flex: none; }
.log-diff summary { cursor: pointer; font-size: 13px; color: var(--green-ink); margin-top: 4px; }
.diff-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.diff-cols pre { margin: 4px 0 0; padding: 10px; background: var(--surface); border-radius: 10px; font-size: 12px; max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; text-align: left; }

/* ---------------- الحماية */
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check-row { display: flex; gap: 12px; align-items: flex-start; }
.ck-state { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.check-row.pass .ck-state { background: var(--green); color: #fff; }
.check-row.fail .ck-state { background: var(--red); color: #fff; }
.check-row.fail .strong { color: var(--red-ink); }
.spinner { width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.session-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.guide { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); max-width: 80ch; }

/* ---------------- الجوال والأجهزة الصغيرة */
@media (max-width: 1100px) {
  .hero-break { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
  .hb:nth-child(4) { border-inline-start: 0; padding-inline-start: 0; }
  .plan-day { grid-template-columns: 1fr 1fr; }
  .plan-day .pd-date { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 10px; }
}
@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(300px, 86vw); z-index: 45; transform: translateX(105%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  [dir=rtl] .sidebar { transform: translateX(105%); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(9, 20, 16, .4); }
  .side-top .icon-btn, .topbar > .icon-btn { display: inline-grid; }
  .grid-2, .split-edit { grid-template-columns: 1fr; }
  .top-user { display: none; }
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 190px); }
  .inbox .convo { display: none; }
  .inbox.has-open .inbox-side { display: none; }
  .inbox.has-open .convo { display: flex; }
  .convo-head > .icon-btn { display: inline-grid; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .main { padding: 18px 16px 110px; }
  .topbar { padding: 10px 12px; gap: 6px; }
  .live-ind .live-text { display: none; }
  .live-ind { padding: 6px; margin: 0; }
  .top-actions { gap: 0; }
  .gsearch { padding: 0 8px; }
  .gsearch-pop { position: fixed; top: 62px; inset-inline: 10px; }
  .page-head h1 { font-size: 22px; }
  .page-actions, .page-actions .input { width: 100%; min-width: 0; }
  .brand-copy { inset-inline: 20px; bottom: 16px; }
  .brand-name { font-size: 28px; }
  .brand-sub { font-size: 14px; }
  .hero { padding: 22px 16px 18px; }
  .hero-top { flex-direction: column; }
  .hero-vs { grid-template-columns: 1fr; gap: 8px; }
  .hv-seal { margin: -18px auto; width: 42px; height: 42px; font-size: 13px; }
  .hv-side.users { text-align: start; }
  .hv-side.users .hv-value { text-align: right; }
  .hero-break { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hb { border-inline-start: 0 !important; padding-inline-start: 0 !important; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 21px; }
  .fields.two, .fields.three { grid-template-columns: 1fr; }
  .pack-row { grid-template-columns: 1fr 1fr auto; }
  .pack-row > :nth-child(3) { display: none; }
  .plan-day { grid-template-columns: 1fr; }
  .kv-row { grid-template-columns: 1fr auto; }
  .kv-row > .ico { display: none; }
  .rb { grid-template-columns: 1fr 60px 34px; }
  .toolbar > * { flex: 1 1 140px; }
  .toolbar > .input[type=search] { flex-basis: 100%; max-width: none; }
  .diff-cols { grid-template-columns: 1fr; }
  .media-row { flex-direction: column; }
  /* الجداول تتحول إلى بطاقات */
  .table-wrap { border: 0; background: none; overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 6px 4px; background: var(--raised); }
  .tbl td { border: 0; padding: 6px 12px; display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: start; }
  .tbl td::before { content: attr(data-label); color: var(--ink-3); font-size: 12.5px; flex: none; }
  .tbl td[data-label='']::before { display: none; }
  .tbl .num { text-align: start; }
  .tbl .actions, .tbl .check { width: 100%; }
  .savebar { bottom: 10px; width: calc(100vw - 20px); justify-content: space-between; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; }
}

/* ---------------- إعدادات الموقع: معاينة */
.site-pv { background: #0b0d0c; border-radius: 16px; padding: 24px; color: #fff; display: flex; flex-direction: column; gap: 10px; }
.site-pv-name { font-size: 30px; font-weight: 700; direction: ltr; }
.site-pv-sub { opacity: .85; font-size: 15px; }

/* ---------------- ملفي: الاسم والصورة */
.me-btn { appearance: none; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: start; border-radius: 12px; }
.me-btn:hover { background: var(--surface); }
.me-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.side-foot .me { width: 100%; padding: 6px; }
.top-user { flex-direction: row !important; align-items: center; gap: 8px; padding: 4px 8px; }
.tu-text { display: flex; flex-direction: column; line-height: 1.25; }
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { width: 96px; height: 96px; font-size: 36px; }
.profile-edit { display: flex; flex-direction: column; gap: 16px; }
.pe-photo { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.warn-text { color: var(--gold-ink); font-weight: 600; }
[data-theme=dark] .warn-text { color: var(--gold); }

/* اختيار من خيارات (نوع الصيانة) */
.choice-list { display: grid; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; text-align: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--raised); color: var(--ink); font: inherit; cursor: pointer; }
.choice:hover { border-color: var(--line-2); }
.choice.on { border-color: var(--green-line); background: var(--green-soft); }
.choice-dot { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--line-2); }
.choice.on .choice-dot { border-color: var(--green); box-shadow: inset 0 0 0 4px var(--raised); background: var(--green); }
.choice-text { display: flex; flex-direction: column; gap: 3px; }
.choice-text small { color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.ksa-time { display: flex; flex-direction: column; gap: 6px; }
.ksa-time input { max-width: 260px; }

/* الإيقاف الطارئ في المالية: معزول بإطار أحمر خفيف */
.kill { border-color: rgba(229, 72, 77, .35); }
.kill-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--line); }
.kill-row:first-of-type { border-top: 0; }
.kill-row .kr-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kill-row .kr-text small { color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.kill-row.on .kr-text strong { color: var(--red-ink); }
[data-theme=dark] .kill-row.on .kr-text strong { color: var(--red); }

/* شعار المعلن في معاينة الإعلان */
.promo-brand { display: flex; align-items: center; gap: 8px; }
.promo-logo { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; background: #fff; border: 1px solid var(--line); }
.promo-logo.letter { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #000; }
.promo-card video { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; flex: none; background: #000; }

/* خانات الرفع في الإعلانات */
.media-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .media-row { grid-template-columns: 1fr; } }
.media-field { display: flex; flex-direction: column; gap: 8px; }
.mf-preview { width: 100%; max-width: 180px; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; }
.mf-preview.round { max-width: 96px; border-radius: 50%; }
.mf-preview img, .mf-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mf-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12px; padding: 10px; text-align: center; }
.mf-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mf-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; max-width: 180px; }
.mf-progress span { display: block; height: 100%; width: 0; background: var(--green); transition: width .15s; }
button.link { background: none; border: 0; padding: 4px 2px; color: var(--green-ink); font: inherit; cursor: pointer; text-decoration: underline; }
[data-theme=dark] button.link { color: var(--green); }

/* أداة القص */
.crop { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.crop-stage { background: #111; border-radius: 14px; overflow: hidden; touch-action: none; line-height: 0; }
.crop-canvas { cursor: grab; touch-action: none; display: block; }
.crop-canvas:active { cursor: grabbing; }
.crop-tools { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 12px; }
.crop-row { display: grid; grid-template-columns: 70px 1fr 44px; align-items: center; gap: 10px; font-size: 14px; }
.crop-range { width: 100%; accent-color: var(--green); }
.crop-val { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 13px; text-align: end; direction: ltr; }
.mf-link { display: flex; flex-direction: column; gap: 6px; }

/* إحصاءات الإعلان */
.promo-stats { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.promo-stats-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.promo-stats .kpis.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.promo-hist { display: flex; flex-direction: column; gap: 6px; }
.promo-hist .bars { width: 100%; height: 48px; }
.promo-hist-labels { display: grid; grid-template-columns: repeat(6, 1fr); font-size: 11px; color: var(--ink-3); text-align: center; }
.promo-verified { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #e5484d; flex: none; }

/* تصغير الإعلان: الاسم والنص فقط */
.promo-fold { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--raised); color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; }
.promo-fold:hover { border-color: var(--line-2); color: var(--ink); }
.promo-edit.folded > .fields, .promo-edit.folded > .promo-more { display: none; }
.promo-edit:not(.folded) > .promo-sum { display: none; }
.promo-edit.folded { gap: 10px; }
.promo-head { flex-wrap: wrap; min-width: 0; }
.promo-name { font-size: 16px; color: var(--ink); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ملخص الإعلان وهو مصغّر + مجموعات الإحصاءات + المدة */
.promo-sum { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.promo-sum span { display: inline-flex; align-items: center; gap: 5px; }
.promo-top { background: var(--surface); border-radius: 14px; padding: 14px; }
.promo-top .promo-stats { border-top: 0; padding-top: 0; }
.promo-group { display: flex; flex-direction: column; gap: 8px; }
.promo-group-title { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.promo-schedule { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.promo-schedule input[type=datetime-local] { max-width: 230px; }
.promo-schedule .dur-num { width: 90px; }
.row.nowrap { flex-wrap: nowrap; }
.promo-top .stat { background: var(--raised); }

/* هيكل التحميل (Skeleton) */
:root { --shimmer: rgba(255, 255, 255, .75); }
[data-theme=dark] { --shimmer: rgba(255, 255, 255, .07); }
.skel-page { animation: fade .2s ease-out; }
.skel-head { display: flex; flex-direction: column; gap: 10px; }
.skel-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.skel-card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.skel-card.big { gap: 14px; }
.skel-row { display: flex; align-items: center; gap: 12px; }
/* الجداول الطويلة: المتصفح يرسم الصفوف الظاهرة فقط */
.tbl tbody tr { content-visibility: auto; contain-intrinsic-size: auto 56px; }
.drawer { contain: layout paint; } .drawer-body, .modal-body { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

/* هياكل التحميل حسب شكل كل قسم */
.skel.pill { border-radius: 999px; }
.skel.input { border-radius: 12px; }
.skel-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.skel-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.skel-tabs { display: flex; gap: 22px; padding: 6px 2px 12px; border-bottom: 1px solid var(--line); }
.skel-card.flush { padding: 0; gap: 0; overflow: hidden; }
.skel-trow { display: grid; grid-template-columns: 2fr 1.4fr 1fr 1fr; gap: 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.skel-trow.head { border-top: 0; background: var(--surface); padding: 12px 18px; }
.skel-cell.user, .skel-li { display: flex; align-items: center; gap: 12px; }
.skel-li { padding: 14px 18px; border-top: 1px solid var(--line); }
.skel-li:first-child { border-top: 0; }
.skel-li.bare { padding: 0; border: 0; }
.skel-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.skel-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.skel-field { display: flex; flex-direction: column; gap: 8px; }
.skel-card.hero { gap: 18px; padding: 24px; }
.skel-hero-top { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.skel-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.skel-card.half { background: var(--surface); border: 0; }
.skel-kpis.tight { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.skel-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.skel-bars { display: flex; align-items: flex-end; gap: 3px; height: 60px; }
.skel-bars .skel { flex: 1; border-radius: 3px; }
.skel-adpv { display: flex; gap: 14px; background: var(--surface); border-radius: 14px; padding: 14px; }
@media (max-width: 760px) {
  .skel-trow { grid-template-columns: 2fr 1fr; } .skel-trow > :nth-child(n+3) { display: none; }
  .skel-fields, .skel-grid2 { grid-template-columns: 1fr; }
  .skel-kpis.tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* مرفقات الدعم الفني */
.composer-wrap { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.composer-wrap .composer { border-top: 0; }
.att-tray { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px 0; }
.att { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); max-width: 240px; font-size: 13px; }
.att img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.att-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att.busy { opacity: .7; }
.b-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.b-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: rgba(0,0,0,.06); color: inherit; text-decoration: none; font-size: 13px; }
.b-file img { width: 160px; max-height: 200px; border-radius: 10px; object-fit: cover; display: block; }
.b-file:has(img) { padding: 0; background: none; }
/* ملاحظات المستخدمين */
.fb-list { display: flex; flex-direction: column; gap: 12px; }
.fb-item.new { border-color: var(--green-line); }
.fb-msg { white-space: pre-wrap; line-height: 1.7; }
.fb-tech pre { font-size: 12px; background: var(--surface); padding: 10px; border-radius: 10px; overflow: auto; }
/* جرس التنبيهات */
.ntf-wrap { position: relative; }
.ntf-btn { position: relative; }
.ntf-btn.has { color: var(--green-ink); }
.ntf-badge { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.ntf-panel { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60; width: min(360px, 92vw); max-height: min(520px, 75vh); display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .15s ease-out; }
.ntf-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ntf-head .icon-btn.on { color: var(--green-ink); background: var(--green-soft); }
.ntf-panel > div:last-child { overflow-y: auto; overscroll-behavior: contain; }
.ntf-list { display: flex; flex-direction: column; }
.ntf-item { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.ntf-item:first-child { border-top: 0; }
.ntf-item:hover { background: var(--surface); }
.ntf-ico { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.ntf-ico.purchase { background: var(--gold-soft); color: var(--gold-ink); }
.ntf-ico.support { background: var(--green-soft); color: var(--green-ink); }
.ntf-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ntf-text { font-weight: 600; font-size: 14px; }
.ntf-sub { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ntf-time { font-size: 12px; color: var(--ink-3); }
.ntf-settings { display: flex; flex-direction: column; gap: 14px; padding: 14px; }
.ntf-set { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.ntf-set-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* تفاصيل السجل */
.log-item.clickable { cursor: pointer; border-radius: 10px; }
.log-item.clickable:hover { background: var(--surface); }
.log-item.clickable:focus-visible { outline: 2px solid var(--green); }
.pre-wrap { white-space: pre-wrap; line-height: 1.7; }
.tbl tr.changed td { background: var(--gold-soft); }
.log-msgs { max-height: 460px; overflow-y: auto; padding: 4px; border-radius: 12px; background: var(--surface); }
.log-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.log-mini li { padding: 10px 6px; border-top: 1px solid var(--line); font-size: 14px; }
.log-mini li:first-child { border-top: 0; }
.log-mini li:hover { background: var(--surface); }

/* طلبات «أعلن معنا» */
.adreq-card { margin-bottom: 18px; }
.adreq-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.adreq { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.adreq.new { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.adreq-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.adreq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13px; }
.adreq-kv { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.adreq-msg { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface); font-size: 14px; white-space: pre-wrap; line-height: 1.7; }
.adreq .row { align-items: center; flex-wrap: wrap; gap: 6px; }
.adreq .spacer { flex: 1; }
.adreq a.btn { text-decoration: none; }
.adreq .row select { width: auto; min-width: 140px; }

/* خزنة Waajeh */
.vault { position: relative; border-radius: 22px; padding: 24px clamp(18px, 3vw, 30px); margin-bottom: 18px; background: linear-gradient(135deg, color-mix(in srgb, var(--green) 14%, var(--raised)), var(--raised) 60%); border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line)); box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px 28px; }
.vault-head { display: flex; gap: 12px; align-items: center; grid-column: 1 / -1; }
.vault-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--green); color: #fff; flex: none; }
.vault-title { font-size: 20px; font-weight: 800; }
.vault-desc { font-size: 14px; color: var(--ink-2); }
.vault-amount { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 4px; direction: ltr; justify-content: flex-end; color: var(--green-ink, var(--ink)); }
.vault-amount.neg { color: var(--red, #d33); }
.va-int { font-size: clamp(40px, 6vw, 64px); font-weight: 800; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; line-height: 1; }
.va-dec { font-size: 26px; font-weight: 700; opacity: .7; }
.va-cur { font-size: 16px; margin-inline-start: 6px; color: var(--ink-2); }
.vault .notice { grid-column: 1 / -1; }
.vault-calc, .vault-side { display: flex; flex-direction: column; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.vrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.vrow:first-child { border-top: 0; }
.vr-label { font-weight: 600; font-size: 14px; }
.vr-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }
.vr-val { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vrow.minus .vr-val { color: var(--coral, #e5675a); }
.vrow.total { background: var(--green-soft); border-radius: 0 0 16px 16px; }
.vrow.total .vr-val { color: var(--green-ink, var(--green)); font-size: 18px; }
.vault-example { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; }
.ve-flow { display: flex; flex-wrap: wrap; gap: 8px; }
.ve-flow span { padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.ve-flow span.ok { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 40%, var(--line)); color: var(--ink); }
@media (max-width: 860px) { .vault { grid-template-columns: 1fr; } }
.vrow.plus .vr-val { color: var(--green-ink, var(--green)); }
.vault-side { align-self: start; }

/* مقاطع المستخدم في درج المستخدم */
.uclips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.uclip { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.uclip img, .uclip video { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000; display: block; }
.uclip figcaption { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.filter-img { max-width: 220px; }
.song-progress { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.song-progress span { display: block; height: 100%; background: var(--green, #e5484d); transition: width .2s; }
.song-part { display: flex; flex-direction: column; gap: 6px; }
.song-part input[type=range] { width: 100%; }
.sp-label { font-size: 13px; font-weight: 600; }
.sp-bar { position: relative; height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.sp-sel { position: absolute; top: 0; bottom: 0; background: var(--green); border-radius: 8px; }
.card.song-item { padding: 0; gap: 0; display: block; }
.song-item.off .song-head { opacity: .6; }
.song-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; border-radius: inherit; }
.song-head:hover { background: var(--surface-2); }
.song-head:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.song-thumb { width: 40px; height: 40px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); overflow: hidden; flex: none; }
.song-thumb img { width: 100%; height: 100%; object-fit: cover; }
.song-names { min-width: 0; }
.sn-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-chev { display: grid; color: var(--ink-3); transition: transform .2s; }
.song-chev.up { transform: rotate(180deg); }
.song-body { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .song-body { flex-direction: column; } }
/* ملف المستخدم الشخصي (زيارة) داخل الدرج */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { width: 84px; height: 84px; font-size: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.uprof { display: flex; flex-direction: column; gap: 16px; animation: uprof-in .22s ease-out; }
@keyframes uprof-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.uprof-bar { display: flex; align-items: center; justify-content: space-between; }
.uprof-back { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px 7px 12px; font: inherit; color: inherit; cursor: pointer; }
.uprof-back:hover { background: var(--line); }
.uprof-hero { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: var(--r-lg); background: linear-gradient(160deg, var(--surface-2), var(--bg)); border: 1px solid var(--line); }
.uprof-id { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.uprof-name { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.uprof-bio { margin: 2px 0; white-space: pre-wrap; }
.uprof-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.uprof-stats .stat { padding: 10px 12px; }
@media (max-width: 700px) { .uprof-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .uprof-hero { flex-direction: column; } }
.uprof-note { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }
.uprof-body h3 { margin: 18px 0 8px; }
.uprof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.uprof-card { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.uprof-card.off, .uprof-cm.off { opacity: .6; }
.uprof-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.uprof-side { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; min-width: 0; }
.uprof-side img, .uprof-ph { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); }
.uprof-side span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uprof-side.me img, .uprof-side.me .uprof-ph { outline: 2px solid var(--green); outline-offset: 1px; }
.uprof-vs-mark { font-weight: 800; font-size: 12px; color: var(--ink-3); }

/* بلاغات الغرف الصوتية */
.vr-group { display: flex; align-items: center; gap: 4px; margin: 16px 0 6px; font-size: 15px; }
.vr-chat { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.vr-msg { padding: 6px 10px; border-radius: 10px; background: var(--surface-2); line-height: 1.6; }
.vr-msg.hit { outline: 2px solid var(--red, #e5484d); background: transparent; }

/* ---- إصلاحات الإطلاق: المال المعطّل، البيانات الجزئية، المخالفات، سلة Cloudinary ---- */
.row.center { justify-content: center; }
.notice.money-off { flex-wrap: wrap; margin-bottom: 16px; border: 1px solid currentColor; }
.fin-meta { gap: 8px; align-items: center; margin: 6px 0; }
tr.warn-row td { background: var(--gold-soft); }
.bubble.hit { outline: 2px solid var(--red-ink); outline-offset: 2px; }
.appeal .c-text { white-space: pre-wrap; }
.trash-items { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.trash-items li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; word-break: break-all; }

/* الإحصائيات */
.an-wrap { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.an-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.an-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.an-chart { gap: 10px; }
.an-chart .bars { height: 80px; }
.an-total { font-size: 20px; font-weight: 700; }
.an-split { display: flex; flex-direction: column; gap: 12px; }
.an-row { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.an-meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.an-meter i { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
@media (max-width: 1000px) { .an-grid.three { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .an-grid { grid-template-columns: 1fr; } }

/* إقفال الموقع التعريفي */
.landing-state { display: flex; align-items: center; gap: 6px; }
.landing-form { display: flex; flex-direction: column; gap: 12px; }
.landing-pv { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 32px 20px; border-radius: var(--r-lg); background: #000; color: #fff; min-height: 240px; }
.landing-pv-name { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.landing-pv-title { font-size: 20px; font-weight: 700; }
.landing-pv-msg { color: #a1a1a1; font-size: 14.5px; line-height: 1.8; max-width: 340px; }


/* ===== تفاعل بدرجات أحمر Waajeh (عند مرور الماوس) ===== */
:root { --hover: rgba(229, 72, 77, .06); }
:root[data-theme='dark'] { --hover: rgba(229, 72, 77, .10); }
.btn:hover:not(:disabled):not(.primary):not(.danger) { background: var(--green-soft); border-color: var(--green-line); color: var(--green-ink); }
.icon-btn:hover { background: var(--green-soft); color: var(--green-ink); }
.nav-link:hover { background: var(--green-soft); color: var(--green-ink); }
.tab:hover { color: var(--green-ink); }
a.stat:hover, .report-item:hover, .choice:hover, .promo-fold:hover { border-color: var(--green-line); }
.gs-item:hover, .gs-item:focus, .feed-item.clickable:hover, .inbox-item:hover, .me-btn:hover, .ntf-item:hover, .log-item.clickable:hover, .log-mini li:hover { background: var(--hover); }
.tbl tr.clickable:hover td { background: var(--hover); }
.song-head:hover { background: var(--green-soft); }
