@font-face { font-family: Cairo; font-weight: 400; src: url(fonts/Cairo-Regular.ttf); font-display: swap; }
@font-face { font-family: Cairo; font-weight: 600; src: url(fonts/Cairo-SemiBold.ttf); font-display: swap; }
@font-face { font-family: Cairo; font-weight: 700; src: url(fonts/Cairo-Bold.ttf); font-display: swap; }

/* هوية «المدى»: نفس نظام تصميم لوحة المدى للعيادات — خلفية بيضاء، كحلي أساسي، برتقالي للتمييز، رمادي مزرق للثانوي */
:root {
  --navy: #172b4d; --navy-soft: #24335a; --brand: #f36b3c; --brand-dark: #d9562a; --slate: #8a93a8; --line: #e4e7ee;
  --paper: #ffffff; --wash: #f6f7fa; --page: #f7f8fb; --ok: #1f8f55; --warn: #b7791f; --danger: #c93b3b; --info: #0e8f9a;
  --amber: #d89614;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: #000; font-family: Cairo, system-ui, "Segoe UI", Tahoma, sans-serif; font-size: 15px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; overflow-x: hidden; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: #fde3d8; }
.hidden { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--slate); font-size: 13px; }
.text-center { text-align: center; }

/* ---------- الشعار (صورة المشروع الرسمية؛ الخلفية البيضاء تذوب بالضرب فوق الخلفية الفاتحة) ---------- */
.brand-img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; user-select: none; }
.sidebar .head .brand-img { width: 170px; }

/* ---------- أزرار وحقول ---------- */
button, input, select, textarea { font: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; border: 1px solid transparent; border-radius: 12px; min-height: 42px; padding: 8px 18px; font-weight: 600; font-size: 15px; cursor: pointer; background: var(--blue); color: #fff; transition: background .15s, opacity .15s; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--blue-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.brand { background: var(--blue); }
.btn.brand:hover:not(:disabled) { background: var(--blue-dark); }
.btn.outline { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.outline:hover:not(:disabled) { background: var(--wash); }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover:not(:disabled) { background: var(--wash); }
.btn.danger { background: var(--danger); }
.btn.danger:hover:not(:disabled) { background: var(--danger); opacity: .9; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.sm { min-height: 34px; padding: 4px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.field { display: block; margin-bottom: 14px; }
.field > span:first-child, .field > label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.field .hint { margin-top: 4px; font-size: 12px; color: var(--slate); font-weight: 400; }
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--navy); }
textarea { min-height: 84px; resize: vertical; }
input::placeholder { color: rgba(138, 147, 168, .75); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
input:disabled, select:disabled { background: var(--wash); }
input[type="checkbox"] { width: 17px; height: 17px; min-height: 0; accent-color: var(--brand); }
.check { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; font-size: 14px; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.honeypot { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- التنبيهات والشارات ---------- */
.alert { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-radius: 12px; padding: 11px 16px; font-size: 14px; line-height: 1.7; background: #e0f4f6; color: var(--info); margin-bottom: 14px; }
.alert.ok { background: #e6f5ed; color: var(--ok); }
.alert.error { background: #fbe8e8; color: var(--danger); }
.alert.warn { background: #fbf1dc; color: var(--warn); }
.alert .close { border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: .6; padding: 0 4px; min-height: 0; width: auto; }
.alert .close:hover { opacity: 1; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 11px; font-size: 12px; font-weight: 600; background: var(--wash); color: var(--slate); white-space: nowrap; }
.badge.ok { background: #e6f5ed; color: var(--ok); }
.badge.warn { background: #fbf1dc; color: var(--warn); }
.badge.danger { background: #fbe8e8; color: var(--danger); }
.badge.info { background: #e0f4f6; color: var(--info); }
.badge.brand { background: #fde8e0; color: var(--brand-dark); }

/* ---------- الهيكل: شريط جانبي + شريط علوي ---------- */
.shell { min-height: 100vh; background: var(--page); }
.sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 50; width: 256px; display: flex; flex-direction: column; background: #fff; border-inline-end: 1px solid rgba(228, 231, 238, .8); transition: transform .2s; }
.sidebar .head { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 18px 14px; border-bottom: 1px solid rgba(228, 231, 238, .8); }
.sidebar .chip { border-radius: 999px; background: var(--wash); padding: 2px 12px; font-size: 11px; font-weight: 600; color: var(--slate); text-align: center; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 10px 12px; }
.nav-group { margin: 12px 8px 4px; font-size: 11px; font-weight: 700; color: var(--slate); letter-spacing: .02em; }
.nav-group:first-child { margin-top: 2px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 12px; margin-bottom: 2px; border: 0; border-radius: 12px; width: 100%; background: transparent; color: rgba(23, 35, 63, .9); font-size: 14.5px; text-align: start; cursor: pointer; text-decoration: none; }
.nav-item:hover { background: var(--wash); }
.nav-item.active { background: var(--blue); color: #fff; font-weight: 600; }
.nav-item.active::after { content: ""; position: absolute; inset-block: 8px; inset-inline-end: 0; width: 4px; border-radius: 999px; background: rgba(255, 255, 255, .8); }
.nav-item svg { width: 18px; height: 18px; flex: none; color: var(--slate); }
.nav-item.active svg { color: #fff; }
.sidebar .foot { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; border-top: 1px solid rgba(228, 231, 238, .8); }
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(23, 35, 63, .45); display: none; }
.content { margin-inline-start: 256px; }
.topbar { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; height: 64px; padding: 0 32px; background: rgba(255, 255, 255, .95); border-bottom: 1px solid rgba(228, 231, 238, .8); backdrop-filter: blur(6px); }
.topbar .title { text-align: center; min-width: 0; max-width: 46vw; }
.topbar .title h1 { font-size: 18px; color: #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title .date { font-size: 12px; color: var(--slate); }
.topbar .start { display: flex; align-items: center; gap: 12px; }
.topbar .end { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.menu-btn { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: transparent; cursor: pointer; color: var(--navy); }
.menu-btn:hover { background: var(--wash); }
.menu-btn svg { width: 24px; height: 24px; }
.user { display: flex; align-items: center; gap: 10px; padding-inline-start: 12px; border-inline-start: 1px solid rgba(228, 231, 238, .8); }
.avatar { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 14px; font-weight: 600; }
.user .name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; line-height: 1.2; }
.user .role { font-size: 11px; color: var(--slate); }
.page { padding: 28px 32px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head p { font-size: 14px; color: var(--slate); }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- البطاقات والإحصاءات ---------- */
.card { min-width: 0; border: 1px solid rgba(228, 231, 238, .8); border-radius: 16px; background: #fff; }
.card > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid rgba(228, 231, 238, .8); }
.card > header h2 { font-size: 15px; font-weight: 600; }
.card .body { padding: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.stat { position: relative; min-width: 0; overflow: hidden; border-radius: 16px; padding: 20px; color: #fff; background: linear-gradient(135deg, var(--from), var(--to)); box-shadow: 0 1px 2px rgba(23, 35, 63, .08); }
.stat::after { content: ""; position: absolute; inset-block-end: -24px; inset-inline-start: -24px; width: 96px; height: 96px; border-radius: 50%; background: rgba(255, 255, 255, .1); pointer-events: none; }
.stat .label { position: relative; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .85); }
.stat .value { position: relative; margin-top: 6px; font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .value.sm { font-size: 22px; }
.stat .hint { position: relative; margin-top: 4px; font-size: 12px; color: rgba(255, 255, 255, .75); }
.stat.navy { --from: #17233f; --to: #2c3e6b; }
.stat.blue { --from: #1e7fd6; --to: #4aa3f0; }
.stat.orange { --from: #f36b3c; --to: #f79a5e; }
.stat.teal { --from: #0e8f9a; --to: #33b8c2; }
.stat.green { --from: #1f8f55; --to: #45b97c; }
.stat.amber { --from: #d89614; --to: #f0bb4a; }
.stat.red { --from: #c93b3b; --to: #e66a6a; }
.stat.violet { --from: #6b5bd6; --to: #9486ee; }
.cols { display: grid; gap: 24px; grid-template-columns: 2fr 1fr; margin-top: 24px; }
.bars > div { margin-bottom: 14px; }
.bars .line { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 14px; }
.bars .track { height: 8px; overflow: hidden; border-radius: 999px; background: var(--wash); }
.bars .fill { height: 100%; border-radius: 999px; background: var(--slate); }
.bars .fill.ok { background: var(--ok); }
.bars .fill.warn { background: var(--amber); }
.bars .fill.danger { background: var(--danger); }
.bars .fill.info { background: var(--info); }
.quick { display: flex; flex-direction: column; gap: 10px; }
.quick .btn { width: 100%; }
.empty { padding: 40px 16px; text-align: center; font-size: 14px; color: var(--slate); border: 1px dashed var(--line); border-radius: 12px; }

/* ---------- جداول (بطاقات على الهاتف) ---------- */
.table-wrap { overflow: hidden; border: 1px solid rgba(228, 231, 238, .8); border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(23, 35, 63, .04); }
.table-wrap .scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: start; font-size: 14px; }
thead { background: #f1f5f9; color: var(--slate); font-size: 12.5px; }
th { padding: 12px 16px; text-align: start; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 14px 16px; vertical-align: middle; border-top: 1px solid rgba(228, 231, 238, .6); }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover { background: #f8f9fc; }
tbody tr.clickable { cursor: pointer; }
tr.row-expired { background: #fdf0f0; box-shadow: inset -4px 0 0 var(--danger); }
tr.row-soon { background: #fff8e8; box-shadow: inset -4px 0 0 var(--amber); }
td.num-cell, th.num-cell { text-align: end; }

/* ---------- أزرار التصفية ---------- */
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 6px 14px; font-size: 14px; cursor: pointer; color: var(--navy); }
.pill:hover { background: var(--wash); }
.pill.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill .count { border-radius: 999px; padding: 0 7px; font-size: 11px; background: var(--wash); color: var(--slate); }
.pill.on .count { background: rgba(255, 255, 255, .2); color: #fff; }
.pill .count.red { background: var(--danger); color: #fff; }
.pill .count.amber { background: var(--amber); color: #fff; }
.search { flex: 1 1 240px; max-width: 360px; margin-inline-start: auto; }
.search input { min-height: 38px; border-radius: 999px; padding: 6px 16px; }

/* ---------- النوافذ المنبثقة ---------- */
.modal-back { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px; background: rgba(23, 35, 63, .4); }
.modal { width: 100%; max-width: 520px; background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(23, 35, 63, .25); outline: none; }
.modal.wide { max-width: 720px; }
.modal > header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fff; border-radius: 16px 16px 0 0; }
.modal > header h3 { font-size: 17px; }
.modal .x { border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--slate); cursor: pointer; border-radius: 8px; padding: 0 8px; min-height: 0; width: auto; }
.modal .x:hover { background: var(--wash); }
.modal .body { padding: 20px; }
.modal .footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 16px; }
.kv dt { color: var(--slate); font-size: 14px; }
.kv dd { margin: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.code-box { font-family: Consolas, monospace; font-size: 22px; letter-spacing: 2px; direction: ltr; text-align: center; padding: 16px; background: var(--wash); border-radius: 12px; margin: 12px 0; user-select: all; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- صفحات الدخول والتسجيل: لوحة العلامة + بطاقة + شريط الصانع (نفس تصميم مولدات المدى) ---------- */
:root { --blue: #2563eb; --blue-dark: #1d4ed8; --teal: #0f766e; --orange: #f5652f; --footer: #172b4d; }
.auth-shell { position: relative; isolation: isolate; overflow: hidden; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-rows: 1fr auto; background: var(--page); color: #000; }
.auth-brand { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 48px 40px; text-align: center; border-inline-end: 1px solid var(--line);
  background: radial-gradient(40rem 26rem at 78% 18%, rgb(37 99 235 / .1), transparent 60%), radial-gradient(30rem 22rem at 6% 96%, rgb(15 118 110 / .08), transparent 65%), linear-gradient(165deg, #fff 0%, #f3f7ff 55%, #eaf1fd 100%); }
.auth-main { position: relative; display: grid; place-items: center; padding: 32px 20px; background: var(--page); }
/* زخرفة المسمار (wedges.svg) تُلوَّن بالقناع: أزرق على نصف الشعار وتيل على نصف النموذج */
.auth-brand::before, .auth-main::before { content: ""; position: absolute; inset: 0; pointer-events: none; }
.auth-brand::before { background: var(--blue); opacity: .3; -webkit-mask-image: url("brand/wedges.svg"), radial-gradient(70% 70% at 50% 50%, #000, transparent 85%); mask-image: url("brand/wedges.svg"), radial-gradient(70% 70% at 50% 50%, #000, transparent 85%);
  -webkit-mask-size: 300px, 100% 100%; mask-size: 300px, 100% 100%; -webkit-mask-repeat: repeat, no-repeat; mask-repeat: repeat, no-repeat; -webkit-mask-composite: source-in; mask-composite: intersect; animation: drift-mask 60s linear infinite; }
@keyframes drift-mask { to { -webkit-mask-position: 300px 300px, 0 0; mask-position: 300px 300px, 0 0; } }
.auth-main::before { background: var(--teal); opacity: .28; -webkit-mask-image: url("brand/wedges.svg"), radial-gradient(closest-side, #000, transparent); mask-image: url("brand/wedges.svg"), radial-gradient(closest-side, #000, transparent);
  -webkit-mask-size: 240px, 100% 100%; mask-size: 240px, 100% 100%; -webkit-mask-repeat: repeat, no-repeat; mask-repeat: repeat, no-repeat; -webkit-mask-position: center, center; mask-position: center, center; -webkit-mask-composite: source-in; mask-composite: intersect; }
.auth-brand > *, .auth-main > * { position: relative; z-index: 2; }
.auth-brand .brand-img { width: min(27rem, 90%); }
.auth-pitch { max-width: 32rem; display: grid; gap: 14px; text-align: center; }
.auth-slogan { margin: 0; font-size: 25px; font-weight: 800; line-height: 1.5; color: var(--orange); }
.auth-lead { margin: 0; color: #000; line-height: 1.9; font-size: 15px; }
.auth-points { list-style: none; margin: 4px auto 0; padding: 0; display: grid; gap: 8px; max-width: 24rem; }
.auth-points li { position: relative; color: #000; font-size: 15px; }
.auth-stack { width: min(27rem, 100%); display: grid; gap: 16px; justify-items: center; }
.auth-wide .auth-stack { width: min(46rem, 100%); }
.auth-stack:has(.doc) { width: min(46rem, 100%); }
.auth-panel { width: 100%; border: 1px solid var(--line); border-radius: 24px; background: #fff; padding: 24px; box-shadow: 0 24px 60px -28px rgb(23 43 77 / .35); }
.auth-panel .head { margin-bottom: 22px; text-align: center; }
.auth-title { margin: 0; font-size: 24px; font-weight: 800; color: var(--orange); }
.auth-panel .sub { margin: 4px 0 0; font-size: 14px; color: #000; }
.auth-panel label, .auth-panel p { color: #000; }
.auth-panel input:not([type="checkbox"]) { min-height: 48px; border-radius: 14px; background: #f8fafc; border: 1px solid var(--line); color: #000; }
.auth-panel input:not([type="checkbox"]):focus { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgb(37 99 235 / .09); outline: none; }
.auth-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s; }
.auth-btn:hover:not(:disabled) { background: var(--blue-dark); }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; }
.auth-btn.brand { background: var(--orange); }
.auth-btn.brand:hover:not(:disabled) { background: #e0541f; }
.auth-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; font-size: 13.5px; color: #000; }
.auth-legal a { color: #000; text-decoration: none; }
.auth-legal a:hover { color: var(--blue); }
.auth-footer { grid-column: 1 / -1; position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 24px; padding: 14px 20px; background: var(--footer); color: #fff; font-size: 13.5px; text-align: center; }
.auth-footer p { margin: 0; color: #fff; }
.auth-footer strong { color: var(--orange); }
.auth-footer .pride { opacity: .92; }
.auth-footer a { color: var(--orange); font-weight: 700; letter-spacing: .02em; text-decoration: none; direction: ltr; }
.auth-footer a:hover { text-decoration: underline; }
.auth-footer svg { display: inline-block; vertical-align: -3px; border-radius: 2px; box-shadow: 0 0 0 1px rgb(255 255 255 / .3); }
/* الحلقة حول الشعار ترسم على الصفحة كلها لتعبر إلى نصف النموذج (حاسبة فقط) */
@media (min-width: 62.01rem) {
  .auth-shell::after { content: ""; position: absolute; top: 50%; right: 25.6%; width: 68rem; height: 68rem; transform: translate(50%, -50%); border-radius: 50%; border: 2px solid rgb(37 99 235 / .32);
    box-shadow: 0 0 0 3.5rem rgb(37 99 235 / .07), 0 0 0 7rem rgb(37 99 235 / .045); pointer-events: none; z-index: 1; }
}
@media (max-width: 62rem) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; }
  .auth-brand { padding: 18px 20px; gap: 6px; border-inline-end: 0; }
  .auth-brand .brand-img { width: min(16rem, 80%); }
  .auth-lead, .auth-points { display: none; }
  .auth-slogan { font-size: 17px; }
  .auth-main { padding: 18px 14px; }
}
@media (prefers-reduced-motion: reduce) { .auth-brand::before { animation: none; } }

/* حقول بأيقونات وزر إظهار كلمة المرور (نفس بطاقة دخول مولدات المدى) */
.input-icon { position: relative; display: block; }
.input-icon > .lead { position: absolute; inset-inline-start: 14px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: var(--slate); pointer-events: none; }
.input-icon > input { padding-right: 44px; }                           /* الأيقونة على اليمين؛ خصائص فيزيائية لأن الحقل LTR داخل صفحة RTL */
.input-icon > input.has-eye { padding-left: 46px; }                     /* العين على اليسار فلا تغطي النص */
.input-icon .eye { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; min-height: 0; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--slate); cursor: pointer; }
.input-icon .eye:hover { background: var(--wash); color: var(--navy); }
.input-icon .eye svg { width: 19px; height: 19px; }
.auth-btn svg { flex: none; }
.auth-btn.soft { margin-top: 0; background: #eef4ff; color: var(--blue); border: 1px solid #b9cdf3; text-decoration: none; }
.auth-btn.soft:hover { background: #e3edff; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--slate); font-size: 12.5px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-fine { margin: 8px 0 0; text-align: center; font-size: 12px; color: #000; }
.auth-secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 18px 0 0; font-size: 12.5px; color: #000; }
.auth-secure svg { color: var(--slate); }

/* نقاط الشرح الجانبي مرتبة بعلامة مربعة تيل */
.auth-points { text-align: start; justify-content: center; }
.auth-points li { display: flex; align-items: center; gap: 10px; }
.auth-points li::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 2px; background: var(--teal); transform: rotate(45deg); }
/* تسمية كلمة المرور مع رابط «نسيت كلمة المرور؟» */
.field > span.row-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.forgot { color: var(--blue); font-size: 13px; font-weight: 600; text-decoration: none; }
.forgot:hover { text-decoration: underline; }
.auth-btn.danger { background: var(--danger); }
.auth-btn.danger:hover:not(:disabled) { background: #b03030; }
/* صفحات المستندات (الشروط والخصوصية وشرح الحذف) */
.doc { font-size: 14.5px; line-height: 1.95; }
.doc h3 { margin: 20px 0 4px; font-size: 16px; color: var(--orange); }
.doc p { margin: 6px 0; color: #000; }
.doc ul { margin: 6px 0; padding-inline-start: 22px; }
.doc li { margin: 3px 0; color: #000; }
.doc a { color: var(--blue); }
.auth-panel textarea { border-radius: 14px; background: #f8fafc; border: 1px solid var(--line); color: #000; }
.auth-panel textarea:focus { background: #fff; border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px rgb(37 99 235 / .09); }
.auth-legal span { color: var(--slate); }

/* صفحات طويلة (الشروط/الخصوصية/الحذف): الشعار والشرح في أعلى نصف العلامة بدل وسط الصفحة الطويلة */
.auth-shell:has(.doc) .auth-brand { justify-content: flex-start; padding-top: 56px; }
@media (min-width: 62.01rem) { .auth-shell:has(.doc)::after { top: 24rem; } }

/* اختيار نوع الحساب عند التسجيل */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.type-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px 18px; border: 1.5px solid var(--line); border-radius: 18px; background: #fff; color: #000; text-align: center; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.type-card:hover:not(:disabled) { border-color: var(--blue); box-shadow: 0 10px 28px -16px rgb(37 99 235 / .55); transform: translateY(-2px); }
.type-card:disabled { opacity: .55; cursor: not-allowed; background: var(--wash); }
.type-card > svg { width: 44px; height: 44px; color: var(--blue); margin-bottom: 2px; }
.type-card h3 { margin: 0; font-size: 18px; color: var(--orange); }
.type-card p { margin: 0; font-size: 13.5px; line-height: 1.7; color: #000; }
.type-card ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 12.5px; color: var(--slate); }
.type-pick { margin-top: 10px; padding: 6px 22px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 14px; font-weight: 600; }
.type-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 16px; padding: 8px 12px; border-radius: 12px; background: #eef4ff; font-size: 14px; }
.linklike { border: 0; background: transparent; padding: 0; min-height: 0; width: auto; color: var(--blue); font-weight: 600; cursor: pointer; text-decoration: underline; }
@media (max-width: 640px) { .type-grid { grid-template-columns: 1fr; } }

/* ---------- معالج التسجيل: شريط الخطوات ---------- */
.wizard { padding: 26px 28px 28px; }
.stepper { list-style: none; display: flex; align-items: center; margin: 0 0 26px; padding: 0; }
.step-item { display: flex; align-items: center; gap: 8px; color: var(--slate); font-size: 14px; white-space: nowrap; }
.step-item .dot { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #eef1f6; color: var(--slate); font-size: 14px; font-weight: 600; transition: background .2s, color .2s; }
.step-item .dot svg { width: 17px; height: 17px; stroke-width: 2.6; }
.step-item.current { color: var(--navy); font-weight: 700; }
.step-item.current .dot { background: var(--blue); color: #fff; box-shadow: 0 0 0 5px rgb(37 99 235 / .14); }
.step-item.done { color: #000; }
.step-item.done .dot { background: var(--ok); color: #fff; }
.step-item.clickable { cursor: pointer; }
.step-item.clickable:hover .label { text-decoration: underline; }
.step-line { flex: 1; min-width: 14px; height: 1.5px; margin: 0 10px; background: var(--line); }
.step-item.done + .step-line { background: var(--ok); opacity: .55; }
@media (max-width: 560px) {
  .wizard { padding: 20px 16px 22px; }
  .step-item:not(.current) .label { display: none; }
  .step-line { margin: 0 6px; }
}
/* خطوات المعالج */
.step { animation: stepIn .28s ease both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.step .head { margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span2 { grid-column: 1 / -1; }
.req { color: var(--danger); font-weight: 700; }
.field-error { display: block; min-height: 0; margin-top: 4px; font-size: 12.5px; color: var(--danger); }
.field-error:empty { display: none; }
.auth-panel input[aria-invalid="true"] { border-color: var(--danger); background: #fff8f8; }
.wizard-actions { display: flex; gap: 12px; margin-top: 22px; }
.wizard-actions .auth-btn { flex: 1; }
.wizard-actions .auth-btn.ghost { flex: 0 0 34%; }
.wizard-actions.single { justify-content: center; margin-top: 12px; }
.wizard-actions.single .auth-btn { flex: 0 1 220px; }
.auth-btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.auth-btn.ghost:hover:not(:disabled) { background: var(--wash); }
.auth-btn.soft-btn { background: #eef4ff; color: var(--blue); border: 1px solid #b9cdf3; }
.auth-btn.soft-btn:hover { background: #e3edff; }
.auth-fine.start { text-align: start; margin: 4px 0 0; }
.check.terms { margin: 14px 0 4px; align-items: flex-start; line-height: 1.8; }
.check.terms input { margin-top: 5px; }
.check.terms a { color: var(--blue); }
.review { margin: 0 0 6px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fbfcfe; }
.review .row { display: grid; grid-template-columns: 8.5rem 1fr auto; align-items: center; gap: 10px; padding: 11px 16px; border-top: 1px solid var(--line); }
.review .row:first-child { border-top: 0; }
.review dt { color: var(--slate); font-size: 13.5px; }
.review dd { margin: 0; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.done-badge { display: grid; place-items: center; width: 78px; height: 78px; margin: 2px auto 14px; border-radius: 50%; background: linear-gradient(135deg, #1f8f55, #45b97c); box-shadow: 0 14px 34px -14px rgb(31 143 85 / .7); }
.done-badge svg { width: 40px; height: 40px; color: #fff; stroke-width: 2.4; }
#step4 .head { text-align: center; }
.code-label { margin: 6px 0 0; text-align: center; font-weight: 600; font-size: 14px; }
.next-steps { margin: 20px 0 0; padding-inline-start: 22px; line-height: 2.1; font-size: 14.5px; color: #000; }
.next-steps a { color: var(--blue); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .review .row { grid-template-columns: 1fr auto; } .review dt { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .step { animation: none; } }

/* ---------- حقول المعالج بنمط مولدات المدى: تسمية + ملاحظة بين قوسين، حقول رمادية فاتحة، قوائم منسدلة، بطاقة موافقة ---------- */
.wizard .field > span:first-child { font-weight: 700; font-size: 14px; margin-bottom: 7px; }
.wizard .opt { font-style: normal; font-weight: 400; color: var(--slate); font-size: 12.5px; margin-inline-start: 2px; }
.wizard input:not([type="checkbox"]), .wizard select { min-height: 50px; padding: 10px 16px; border: 1px solid #e1e6ef; border-radius: 13px; background-color: #f5f7fb; color: #000; font-size: 15px; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.wizard input:not([type="checkbox"])::placeholder { color: #9aa5bb; }
.wizard input:not([type="checkbox"]):focus, .wizard select:focus { background-color: #fff; border-color: var(--blue); box-shadow: 0 0 0 4px rgb(37 99 235 / .1); outline: none; }
.wizard input.pw { letter-spacing: 1px; }
.wizard .input-icon > input.has-eye { padding-right: 16px; padding-left: 50px; }
.wizard .input-icon .eye { left: 8px; right: auto; }
/* قائمة منسدلة بسهم مخصص */
.wizard select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-inline-end: 16px; padding-inline-start: 42px; background-repeat: no-repeat; background-position: left 15px center; background-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.wizard select:invalid, .wizard select option[value=""] { color: #9aa5bb; }
.wizard select option { color: #000; }
/* بطاقة الموافقة على الشروط */
.terms-card { display: flex; align-items: flex-start; gap: 14px; margin: 18px 0 6px; padding: 16px 18px; border: 1.5px solid #e1e6ef; border-radius: 16px; background: #fff; cursor: pointer; line-height: 1.9; font-size: 14.5px; color: #000; transition: border-color .15s, background .15s; }
.terms-card:hover { border-color: #c4cfe3; }
.terms-card.on { border-color: var(--blue); background: #f4f8ff; }
.terms-card a { color: var(--blue); font-weight: 600; }
.terms-card input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; min-height: 0; margin: 3px 0 0; border: 1.8px solid #9aa5bb; border-radius: 7px; background: #fff; cursor: pointer; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.terms-card input[type="checkbox"]:checked { border-color: var(--blue); background-color: var(--blue); background-repeat: no-repeat; background-position: center; background-size: 15px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.terms-card input[type="checkbox"]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- التحقق برمز: اختيار القناة وإدخال الرمز ---------- */
.verify { margin: 4px 0 6px; padding: 16px 18px 18px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfe; }
.verify-title { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: #000; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-bottom: 10px; }
.seg-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border: 1.5px solid #e1e6ef; border-radius: 13px; background: #fff; color: #000; font-size: 15px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.seg-btn svg { width: 18px; height: 18px; }
.seg-btn:hover { border-color: #c4cfe3; }
.seg-btn.on { border-color: var(--ok); background: #eaf7f0; color: var(--ok); }
.verify-target { margin: 4px 2px 12px; font-size: 13.5px; color: #000; overflow-wrap: anywhere; }
.verify .soft-btn { width: 100%; }
.code-row { margin-top: 14px; }
.code-row .field { margin-bottom: 10px; }
.wizard input.code-input { text-align: center; font-size: 22px; letter-spacing: 8px; font-weight: 700; }
.verified { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border-radius: 13px; background: #eaf7f0; color: var(--ok); font-weight: 700; }
.verified-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.verify .alert { margin: 12px 0 0; }
/* ---------- بوابة صاحب المحل ---------- */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 190px; padding: 8px 4px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.bar { position: relative; flex: 1 0 14px; min-width: 14px; min-height: 2px; background: var(--brand); border-radius: 4px 4px 0 0; }
.bar:hover, .bar:focus { background: var(--brand-dark); }
.bar.zero { background: var(--line); }
.bar .tip { position: absolute; bottom: 100%; inset-inline-start: 50%; transform: translateX(-50%); display: none; z-index: 2; padding: 3px 8px; border-radius: 8px; background: var(--navy); color: #fff; font-size: 12px; white-space: nowrap; direction: ltr; }
.bar:hover .tip, .bar:focus .tip { display: block; }
.range { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; margin-top: 16px; }

/* ---------- متجاوب ---------- */
@media (max-width: 1023px) {
  .sidebar { width: 304px; max-width: 85vw; transform: translateX(100%); }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 20px 50px rgba(23, 35, 63, .3); }
  .backdrop.open { display: block; }
  .content { margin-inline-start: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .page { padding: 20px 12px; }
  .cols { grid-template-columns: 1fr; }
  .user .meta { display: none; }
}
@media (max-width: 767px) {
  .grid2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 16px; }
  .stat .value { font-size: 24px; }
  .table-wrap { border: 0; background: transparent; box-shadow: none; border-radius: 0; }
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tbody tr { margin-bottom: 12px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
  .rtable tbody tr:hover { background: #fff; }
  .rtable td { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 14px; border-top: 0; text-align: start; }
  .rtable td[data-label]::before { content: attr(data-label); flex: none; font-size: 12px; font-weight: 600; color: var(--slate); }
  .rtable td.num-cell { text-align: start; }
  .search { max-width: none; flex-basis: 100%; margin-inline-start: 0; }
  .topbar .title .date { display: none; }
  .modal-back { padding: 0; align-items: flex-end; }
  .modal { border-radius: 24px 24px 0 0; max-height: 92vh; overflow-y: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

.mt16 { margin-top: 16px; }
.actions-bar { display: flex; justify-content: flex-start; margin: 18px 0 8px; }

/* ---------- لوحة المنصة على نمط لوحة مولدات المدى ---------- */
.sidebar .head .logo-box { width: 100%; max-width: 14rem; padding: 8px 12px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.sidebar .head .logo-box .brand-img { width: 100%; }
.nav-item .nav-label { flex: 1; min-width: 0; }
.nav-item .count { flex: none; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.nav-item.active .count { background: #fff; color: var(--blue); }
.grid-cols { display: grid; gap: 24px; margin-top: 24px; }
.grid-cols.c21 { grid-template-columns: 2fr 1fr; }
.grid-cols.c11 { grid-template-columns: 1fr 1fr; }
.grid-cols.c32 { grid-template-columns: 3fr 2fr; }
@media (max-width: 1023px) { .grid-cols.c21, .grid-cols.c11, .grid-cols.c32 { grid-template-columns: 1fr; } }
.card > header .tools { display: flex; align-items: center; gap: 8px; }
.card > header .tools a, .card > header .tools button.plain { color: var(--slate); font-size: 13.5px; text-decoration: none; background: transparent; border: 0; cursor: pointer; padding: 0; }
.card > header .tools a:hover, .card > header .tools button.plain:hover { text-decoration: underline; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.lines li:first-child { border-top: 0; }
.lines .who { min-width: 0; }
.lines .who strong { color: #000; cursor: pointer; }
.lines .who strong:hover { text-decoration: underline; }
.lines .sub { font-size: 12.5px; color: var(--slate); margin-top: 2px; }
.lines .end { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.calm { padding: 12px 16px; border-radius: 12px; background: #e6f5ed; color: var(--teal); font-size: 14px; }
.callout { padding: 12px 16px; border-radius: 12px; background: #fbf1dc; color: var(--warn); font-size: 14px; line-height: 1.8; margin-bottom: 14px; }
.chart-label { display: flex; gap: 4px; padding: 4px 4px 0; overflow-x: auto; }
.chart-label span { flex: 1 0 14px; min-width: 14px; text-align: center; font-size: 11px; color: var(--slate); direction: ltr; }
.chart .bar.cur { background: var(--blue); }
.chart .bar { background: #93b4f5; }
.chart .bar:hover { background: var(--blue-dark); }
.plain-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.plain-table td, .plain-table th { padding: 10px 12px; }
.plain-table tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: #fbfcfe; }
.who-id { display: flex; flex-direction: column; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.form-narrow { max-width: 480px; }

/* ---------- الدعم الفني: محادثة التذكرة ---------- */
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; padding: 4px 2px 14px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 14px; background: var(--wash); }
.msg.customer { align-self: flex-start; }
.msg.admin { align-self: flex-end; background: #e8f0fe; }
.msg .who { font-size: 12px; color: var(--slate); margin-bottom: 4px; }
.msg .text { white-space: pre-wrap; line-height: 1.8; }
.picks { max-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; }
tr.clickable { cursor: pointer; }
.row-actions { display: inline-flex; gap: 6px; }

/* ---------- صفحة المشتركين: بطاقات تصفية + شريط أدوات ---------- */
.filter-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 14px; }
.filter-card { text-align: start; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; cursor: pointer; box-shadow: 0 1px 2px rgba(23, 35, 63, .04); }
.filter-card .l { display: block; font-size: 13px; color: var(--slate); }
.filter-card .n { display: block; font-size: 28px; font-weight: 800; color: var(--navy); margin-top: 6px; }
.filter-card.green .n { color: var(--ok); } .filter-card.blue .n { color: var(--blue); } .filter-card.amber .n { color: var(--warn); } .filter-card.red .n { color: var(--danger); } .filter-card.slate .n { color: var(--slate); }
.filter-card.on { border: 2px solid var(--navy); background: var(--wash); }
.toolbar-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.toolbar { display: flex; gap: 14px; align-items: flex-end; padding: 16px; flex-wrap: wrap; }
.toolbar .field { margin: 0; min-width: 160px; } .toolbar .field.grow { flex: 1; min-width: 220px; }
.toolbar > .muted { margin-inline-start: auto; padding-bottom: 12px; }
.legend { display: flex; gap: 18px; padding: 4px 16px 12px; font-size: 13px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--slate); }
.dot.green { background: var(--ok); } .dot.blue { background: var(--blue); } .dot.amber { background: var(--amber); } .dot.red { background: var(--danger); } .dot.slate { background: #94a3b8; }
.toolbar-card .table-wrap { border: 0; border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); }
.who { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; font-size: 13px; }
.who strong { font-size: 14px; }
th.end, td.end { text-align: end; }
@media (max-width: 1100px) { .filter-cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .filter-cards { grid-template-columns: repeat(2, 1fr); } }

.toolbar .field { width: auto; flex: 0 0 200px; }
.toolbar .field.grow { flex: 1 1 280px; }

/* ---------- ترويسة جداول اللوحة: كحلية كلوحة المولدات ---------- */
.rtable thead { background: #17233f; color: #fff; font-size: 13px; }
.rtable th { padding: 14px 16px; border-bottom: 0; font-weight: 700; }
.rtable td { padding: 16px; }
.rtable tbody tr { transition: background .12s; }
.rtable tbody tr.row-expired { box-shadow: inset -4px 0 0 var(--danger); }
.rtable tbody tr.row-soon { box-shadow: inset -4px 0 0 var(--amber); }
.rtable .badge { border-radius: 999px; padding: 3px 12px; font-weight: 700; }

/* ---------- تصميم مضغوط لصفحة المشتركين والجداول ---------- */
.filter-cards { gap: 10px; margin-bottom: 10px; }
.filter-card { padding: 8px 14px; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.filter-card .l { font-size: 12.5px; }
.filter-card .n { font-size: 20px; margin: 0; }
.toolbar { padding: 10px 14px; gap: 10px; }
.toolbar .field span:first-child { font-size: 12px; margin-bottom: 2px; }
.toolbar input, .toolbar select { min-height: 36px; padding: 4px 12px; }
.legend { padding: 0 14px 8px; font-size: 12px; gap: 14px; }
.rtable th { padding: 9px 14px; font-size: 12.5px; }
.rtable td { padding: 9px 14px; }
.rtable .btn.sm { padding: 3px 10px; min-height: 30px; font-size: 12.5px; }
.rtable .badge { padding: 2px 10px; font-size: 12px; }
.who { gap: 0; font-size: 12.5px; line-height: 1.5; }
.who strong { font-size: 13.5px; }

.sub-title { margin: 14px 0 8px; font-size: 14px; color: var(--navy); }

.kv dd { word-break: break-word; }

.save-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; position: sticky; bottom: 8px; }
.switch-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin-bottom: 10px; }
.switch-row input { width: 20px; min-height: 20px; margin-top: 4px; flex: none; }
.switch-row small { display: block; }

/* ---------- مفاتيح التبديل والإعدادات ---------- */
input.sw { appearance: none; -webkit-appearance: none; width: 42px !important; min-height: 24px !important; height: 24px; border-radius: 999px; background: #cbd5e1; position: relative; cursor: pointer; flex: none; border: 0; padding: 0; transition: background .15s; margin-top: 2px; }
input.sw::before { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
input.sw:checked { background: #1f8f55; }
input.sw:checked::before { inset-inline-start: 21px; }
input.sw:disabled { opacity: .55; cursor: not-allowed; }
.contact-row { display: grid; grid-template-columns: 170px 1fr 120px; gap: 12px; align-items: center; padding: 6px 0; }
.contact-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.contact-row .switch-row { margin: 0; }
.dot.navy { background: #172b4d; } .dot.pink { background: #c13584; } .dot.black { background: #111; } .dot.teal { background: #0f766e; }
.section-title { margin: 26px 0 4px; font-size: 18px; color: var(--navy); }
.channels { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.tpl { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; background: var(--wash); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; margin: 6px 0 12px; }
.tpl-text { white-space: pre-wrap; line-height: 1.8; font-size: 13px; flex: 1; }
.test-row { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.test-row .field { flex: 1; margin: 0; }
.adv summary { cursor: pointer; color: var(--blue); font-size: 13px; margin: 6px 0 10px; }
.bullets { margin: 6px 0 0; padding-inline-start: 18px; }
@media (max-width: 700px) { .contact-row { grid-template-columns: 1fr; } }

.perm-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.perm-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-height: 52vh; overflow: auto; padding: 2px; }
.perm-grid .check { margin-bottom: 6px; }
@media (max-width: 760px) { .perm-groups { grid-template-columns: 1fr; } }

/* ---------- صفحة الرسائل: مضغوطة ومرتّبة ---------- */
.msgs .pills { margin-bottom: 12px; }
.msgs .card { margin-bottom: 12px; }
.msgs .card > header { padding: 9px 16px; }
.msgs .card > header h2 { font-size: 14.5px; }
.msgs .card .body { padding: 14px 16px; }
.msgs .field { margin-bottom: 10px; }
.msgs .field > span:first-child, .msgs .field > label { margin-bottom: 4px; font-size: 12.5px; color: var(--slate); font-weight: 600; }
.msgs input, .msgs select { min-height: 36px; padding: 5px 11px; border-radius: 10px; font-size: 13.5px; }
.msgs input[type="checkbox"] { min-height: 0; }
.msgs .switch-row { margin-bottom: 8px; }
.msgs .grid2 { gap: 0 10px; }
.msgs .row-3-1 { display: grid; grid-template-columns: 3fr 1fr; gap: 0 10px; }
.msgs .msg-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.msgs .msg-cards .card { margin-bottom: 0; }
.msgs .test-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line); }
.msgs .test-row .field { flex: 1; margin-bottom: 0; }
.msgs .test-row .btn { white-space: nowrap; min-height: 36px; }
.msgs .pad-top { padding-top: 22px; }
.msgs .bullets { margin: 6px 18px 0; font-size: 12.5px; }
.design-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.design-tools .field { flex: 1 1 240px; margin-bottom: 0; }
.design-all { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.design-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.design-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) 2.4fr auto; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.design-row:last-child { border-bottom: 0; }
.design-name { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; }
.design-name small { font-size: 11.5px; }
.design-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.design-actions { display: flex; gap: 6px; }
.dchip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 6px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 12.5px; cursor: pointer; color: var(--navy); min-height: 0; width: auto; }
.dchip:hover { background: var(--wash); }
.dchip.on { border-color: var(--blue); background: rgba(37, 99, 235, .06); font-weight: 700; }
.thumb { position: relative; display: inline-block; width: 30px; height: 36px; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; overflow: hidden; flex: none; }
.thumb i, .thumb b, .thumb u { position: absolute; display: block; text-decoration: none; }
.thumb.classic i { inset: 0 0 auto 0; height: 4px; background: #2563eb; }
.thumb.classic b { top: 9px; left: 8px; right: 8px; height: 6px; background: #cbd5e1; border-radius: 2px; }
.thumb.classic u { top: 20px; left: 5px; right: 5px; height: 3px; background: #e2e8f0; box-shadow: 0 5px 0 #e2e8f0; }
.thumb.minimal i { top: 5px; right: 5px; width: 10px; height: 4px; background: #94a3b8; border-radius: 1px; }
.thumb.minimal b { top: 14px; right: 5px; width: 14px; height: 3px; background: #f5652f; border-radius: 1px; }
.thumb.minimal u { top: 21px; left: 5px; right: 5px; height: 3px; background: #e2e8f0; box-shadow: 0 5px 0 #e2e8f0; }
.thumb.bold i { inset: 0 0 auto 0; height: 15px; background: #2563eb; }
.thumb.bold b { top: 5px; left: 9px; right: 9px; height: 5px; background: #fff; border-radius: 2px; }
.thumb.bold u { top: 21px; left: 5px; right: 5px; height: 3px; background: #e2e8f0; box-shadow: 0 5px 0 #e2e8f0; }
.mail-frame { width: 100%; height: 62vh; border: 1px solid var(--line); border-radius: 12px; background: #f7f9fc; margin-top: 4px; }
@media (max-width: 900px) {
  .msgs .msg-cards { grid-template-columns: 1fr; }
  .design-row { grid-template-columns: 1fr; gap: 6px; }
}

/* أنواع النشاط */
.spec-add { display: flex; gap: 8px; margin: 12px 0; }
.spec-add input { flex: 1; }
.spec-list { display: grid; gap: 6px; margin-bottom: 14px; }
.spec-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; background: var(--card, #fff); }
.spec-row strong { flex: 1; font-weight: 600; }
.spec-n { width: 22px; height: 22px; border-radius: 50%; background: #eef2ff; color: #3730a3; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.btn.sm { padding: 4px 10px; font-size: 12px; }

/* حاسبات ومفاتيح */
.keys-limit { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: baseline; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; background: #fff; }
.keys-group { margin-top: 16px; }
.key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.key-card { border: 1px solid var(--line, #e5e7eb); border-radius: 14px; background: #fff; padding: 14px; display: grid; gap: 10px; }
.key-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.key-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.keys-staff { margin-top: 14px; }
.keys-staff-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.keys-staff-list li { padding: 8px 10px; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; }
.trial-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line, #e5e7eb); }
.trial-row small { display: block; }
.trial-row .field { margin: 0; max-width: 140px; }
#sessionBox { display: grid; gap: 12px; margin: 0 0 12px; }
#sessionBox p { margin: 0; }
#sessionBox .wizard-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
#sessionBox .auth-btn { width: 100%; justify-content: center; text-align: center; text-decoration: none; }

.captcha-box { display: flex; justify-content: center; min-height: 66px; margin: 8px 0; }
.plain-list { margin: 0; padding-inline-start: 18px; display: grid; gap: 6px; }

/* تنبيهات صاحب المحل */
.alert-list { display: grid; gap: 10px; }
.alert-card { border: 1px solid var(--line, #e5e7eb); border-inline-start-width: 4px; border-radius: 12px; background: #fff; padding: 12px 14px; display: grid; gap: 6px; }
.alert-card.critical { border-inline-start-color: var(--danger, #dc2626); }
.alert-card.warn { border-inline-start-color: var(--warn, #d97706); }
.alert-card.info { border-inline-start-color: var(--info, #0ea5b7); }
.alert-card p { margin: 0; }
.alert-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.dl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 10px 0; }
.dl-file { flex: 1; min-width: 220px; }
progress { width: 100%; height: 10px; }
