/* واصل — هوية شوقت ميديا: كهرماني/بنفسجي، خط Cairo، تصميم RTL بالكامل */

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-2: #f1ece2;
  --ink: #241f1a;
  --ink-dim: #746b5c;
  --line: #e4dccb;
  --amber: #d9820b;
  --amber-ink: #241305;
  --amber-soft: #fbe8c8;
  --purple: #6a4c93;
  --purple-soft: #ece4f5;
  --ok: #2f7a4f;
  --ok-soft: #dcefe1;
  --warn: #9c7a17;
  --warn-soft: #f4ecd2;
  --bad: #b34040;
  --bad-soft: #f6dede;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120f;
    --surface: #1f1a15;
    --surface-2: #28221b;
    --ink: #f3ede2;
    --ink-dim: #ab9f8c;
    --line: #3a3127;
    --amber: #f0a435;
    --amber-ink: #1c1206;
    --amber-soft: #3a2c13;
    --purple: #ab8fd6;
    --purple-soft: #2c2440;
    --ok: #6fc590;
    --ok-soft: #223a2a;
    --warn: #e0c667;
    --warn-soft: #3a331d;
    --bad: #e08888;
    --bad-soft: #3a2323;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15120f;
  --surface: #1f1a15;
  --surface-2: #28221b;
  --ink: #f3ede2;
  --ink-dim: #ab9f8c;
  --line: #3a3127;
  --amber: #f0a435;
  --amber-ink: #1c1206;
  --amber-soft: #3a2c13;
  --purple: #ab8fd6;
  --purple-soft: #2c2440;
  --ok: #6fc590;
  --ok-soft: #223a2a;
  --warn: #e0c667;
  --warn-soft: #3a331d;
  --bad: #e08888;
  --bad-soft: #3a2323;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  direction: rtl;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans Arabic', 'Tahoma', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3, h4 { font-family: 'Cairo', 'Tahoma', sans-serif; margin: 0; text-wrap: balance; font-weight: 800; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
button { font-family: inherit; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }

.wrap { max-width: 1120px; margin: 0 auto; padding-block: 24px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding-block: 24px; }

/* ---- nav ---- */
.site-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding-block: 18px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--amber), var(--purple));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: 'Cairo', sans-serif; font-weight: 800; font-size: 17px; flex: 0 0 auto;
}
.nav-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.nav-brand-name { font-family: 'Cairo', sans-serif; font-weight: 800; font-size: 16px; }
.nav-brand-sub { font-size: 11px; color: var(--ink-dim); }
.nav-links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nav-link {
  padding: 8px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 700;
  text-decoration: none; color: var(--ink-dim);
}
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { color: var(--ink); background: var(--surface-2); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none; transition: filter .12s ease, transform .12s ease;
}
.btn:hover { filter: brightness(0.97); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-dim); }
.btn-danger { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.btn-lg { padding: 13px 26px; font-size: 15.5px; border-radius: 12px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }

/* ---- cards / sections ---- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; min-width: 0;
}
.section { padding-block: 48px; }
.section-head { max-width: 640px; margin-bottom: 28px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--purple);
  background: var(--purple-soft); padding: 5px 12px; border-radius: 999px; margin-bottom: 10px;
}
.section-head h2 { font-size: 26px; margin-bottom: 8px; }
.section-head p { color: var(--ink-dim); font-size: 15px; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.feature-card { display: flex; flex-direction: column; gap: 10px; }
.feature-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--amber-soft); color: var(--amber);
  display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.feature-card h3 { font-size: 16px; }
.feature-card p { font-size: 13.5px; color: var(--ink-dim); }

.compliance-banner {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
  border-radius: 12px; padding: 14px 16px; font-size: 13.5px;
}
.compliance-banner b { color: var(--ok); }

footer.site-footer {
  border-top: 1px solid var(--line); padding-block: 24px; margin-top: 24px;
  color: var(--ink-dim); font-size: 12.5px; text-align: center;
}

/* ---- forms ---- */
label.field-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-dim); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
input[type=text], input[type=email], input[type=password], input[type=datetime-local],
textarea, select {
  width: 100%; font-family: inherit; font-size: 14px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
  border-radius: 9px; padding: 10px 12px;
}
textarea { min-height: 110px; line-height: 1.7; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--amber); outline-offset: 1px; }

.alert { border-radius: 10px; padding: 12px 14px; font-size: 13.5px; margin-bottom: 16px; }
.alert-bad { background: var(--bad-soft); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.alert-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }

/* ---- dashboard shell ---- */
.dash-shell { max-width: 1180px; margin: 0 auto; padding-block: 20px; }
.dash-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); text-decoration: none; color: var(--ink);
  margin-bottom: 10px;
}
.page-row:hover { border-color: var(--amber); }
.page-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-family: 'Cairo', sans-serif; flex: 0 0 auto; overflow: hidden;
}
.page-avatar img { width: 100%; height: 100%; object-fit: cover; }
.page-meta { flex: 1; min-width: 0; }
.page-meta .name { font-weight: 700; font-size: 14.5px; }
.page-meta .sub { font-size: 12px; color: var(--ink-dim); }
.page-stat { text-align: center; }
.page-stat .num { font-family: 'IBM Plex Mono', monospace; font-size: 18px; font-weight: 600; }
.page-stat .label { font-size: 11px; color: var(--ink-dim); }

.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab-link {
  padding: 10px 16px; font-size: 13.5px; font-weight: 700; color: var(--ink-dim);
  text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab-link.active { color: var(--amber); border-color: var(--amber); }

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-option {
  flex: 1 1 160px; border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  cursor: pointer; background: var(--surface-2);
}
.tag-option input { display: none; }
.tag-option.checked { border-color: var(--amber); background: var(--amber-soft); }
.tag-option .t-name { font-weight: 700; font-size: 12.5px; }
.tag-option .t-desc { font-size: 11px; color: var(--ink-dim); margin-top: 2px; }

.audience-summary {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 12px 14px; background: var(--surface-2); border-radius: 10px; margin-top: 14px;
}
.audience-count { font-family: 'IBM Plex Mono', monospace; font-size: 22px; font-weight: 600; }
.pill-mini { font-size: 11px; border-radius: 999px; padding: 3px 10px; font-weight: 700; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: right; color: var(--ink-dim); font-weight: 700; font-size: 11px; padding-block: 8px; border-bottom: 1px solid var(--line); }
td { padding-block: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-inline-end: 5px; }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  font-size: 11.5px; border: 1px solid var(--line); background: var(--surface-2);
  padding: 5px 10px; border-radius: 999px; cursor: pointer; color: var(--ink-dim); border: none;
}
.chip:hover { color: var(--ink); }

.empty-state { text-align: center; padding: 40px 16px; color: var(--ink-dim); }
.empty-state .icon { font-size: 32px; margin-bottom: 10px; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; border-bottom: 1px solid var(--line); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .t-label { font-weight: 700; font-size: 13.5px; }
.toggle-row .t-desc { font-size: 12px; color: var(--ink-dim); }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .track {
  position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s;
}
.switch .track::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; right: 3px; transition: transform .15s;
}
.switch input:checked + .track { background: var(--amber); }
.switch input:checked + .track::before { transform: translateX(-18px); }

@media (max-width: 860px) {
  .dash-top { flex-direction: column; align-items: stretch; }
}
