/* =============================================================
   سيستم متابعة المهام والحملات — التصميم (RTL)
   هوية: بنفسجي-نيلي حديث، زوايا ناعمة، ظلال هوائية، حركات خفيفة
   ============================================================= */
:root {
  --bg: #f4f5fa;
  --card: #ffffff;
  --ink: #161b2e;
  --muted: #6d7488;
  --line: #e7eaf3;
  --line-soft: #eef0f7;

  --brand: #5a5df0;
  --brand-strong: #4a4de0;
  --brand-soft: #edeffe;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --grad-soft: linear-gradient(135deg, #eef0fe 0%, #f3effe 100%);

  --ok: #0f9d63;
  --ok-soft: #e2f6ec;
  --warn: #c77414;
  --warn-soft: #fdf2e0;
  --danger: #e0454e;
  --danger-soft: #fdebec;
  --info: #2f6fed;
  --info-soft: #e9f0fe;

  --side-top: #161b30;
  --side-bottom: #1d2342;
  --side-ink: #b9c0d8;

  --r-card: 18px;
  --r-input: 10px;
  --shadow-card: 0 1px 2px rgba(22, 27, 46, .04), 0 12px 32px -20px rgba(22, 27, 46, .22);
  --shadow-pop: 0 24px 70px -20px rgba(22, 27, 46, .35);
  --shadow-brand: 0 8px 18px -8px rgba(90, 93, 240, .55);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Cairo", "Segoe UI", Tahoma, "Noto Sans Arabic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}
body.no-scroll { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { line-height: 1.35; }
::selection { background: #d9dcfd; }

/* شريط تمرير أنيق */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccd2e4; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #b3bad2; }

.muted { color: var(--muted); }
.text-danger { color: var(--danger); font-weight: 700; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.loading { text-align: center; color: var(--muted); padding: 70px 16px; font-size: 14px; }

/* ================= الهيكل ================= */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 258px;
  flex: none;
  background: linear-gradient(180deg, var(--side-top) 0%, var(--side-bottom) 100%);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 18px; }
.brand-logo {
  font-size: 21px;
  background: var(--grad);
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 13px;
  box-shadow: var(--shadow-brand);
  flex: none;
}
.brand-name { color: #fff; font-weight: 800; font-size: 15.5px; letter-spacing: -.2px; }
.brand-sub { font-size: 11px; opacity: .5; font-weight: 500; }

.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 5px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; border-radius: 12px;
  color: var(--side-ink); font-weight: 600; font-size: 14px;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.nav-ico { width: 22px; text-align: center; font-size: 16px; }

.side-foot { padding: 16px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 12px; }
.user-chip { display: flex; gap: 11px; align-items: center; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 800;
  flex: none; font-size: 15px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .12);
}
.user-name { color: #fff; font-size: 13.5px; font-weight: 700; }
.user-role { font-size: 11px; opacity: .5; font-weight: 500; }

.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 19px; margin: 0; flex: 1; font-weight: 800; letter-spacing: -.3px; }
.topbar-date {
  background: var(--line-soft); color: var(--muted);
  border-radius: 999px; padding: 5px 14px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.menu-btn { display: none; font-size: 18px; }

.content { padding: 24px; max-width: 1680px; width: 100%; margin: 0 auto; }

.scrim { position: fixed; inset: 0; background: rgba(15, 18, 35, .5); opacity: 0; pointer-events: none; transition: .25s; z-index: 40; }
.scrim.show { opacity: 1; pointer-events: auto; }

/* ================= بطاقات ================= */
.card {
  background: var(--card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line-soft);
  padding: 20px;
  margin-bottom: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15.5px; font-weight: 800; letter-spacing: -.2px; }
.dash-grid .card { margin-bottom: 0; }
.card-overdue {
  background: linear-gradient(180deg, #fff4f4 0%, #fff 55%);
  border-color: #f7d9da;
}

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card {
  background: var(--card);
  border-radius: var(--r-card);
  padding: 18px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--line-soft);
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-ico {
  font-size: 19px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--brand-soft);
}
.sc-danger .stat-ico { background: var(--danger-soft); }
.sc-warn .stat-ico { background: var(--warn-soft); }
.sc-muted .stat-ico { background: #eef0f6; }
.stat-num { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.stat-num small { font-size: 15px; color: var(--muted); font-weight: 700; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 4px; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ================= أدوات الشاشات ================= */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 190px; }

/* أيقونة الفلتر + شريط الفلاتر القابل للطي (صفحة الحملات) */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; flex: 0 0 auto; }
.btn-icon svg { width: 17px; height: 17px; }
.btn-icon.active { color: var(--brand); border-color: var(--brand-soft); background: var(--brand-soft); }
.cm-filters-wrap { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .28s ease; flex: 1 1 auto; min-width: 0; }
.cm-filters-wrap.closed { grid-template-rows: 0fr; }
.cm-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; overflow: hidden; min-height: 0; }
.notes-cell { max-width: 220px; min-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brief-link { color: var(--brand); font-weight: 700; font-size: 13px; white-space: nowrap; }
.brief-link:hover { text-decoration: underline; }

/* ترقيم صفوف الجداول + تحجيم الأعمدة بالسحب */
.row-num { width: 34px; min-width: 34px; text-align: center; }
.table th.row-num { color: var(--muted); font-size: 11px; }
.table td.row-num { color: var(--muted); font-size: 12px; font-weight: 700; }
.table th { position: relative; }
.col-resize-handle { position: absolute; left: -4px; top: 0; bottom: 0; width: 9px; cursor: col-resize; z-index: 3; }
.col-resize-handle::after { content: ""; position: absolute; left: 3px; top: 22%; bottom: 22%; width: 2px; border-radius: 2px; background: var(--brand); opacity: 0; transition: opacity .15s ease; }
.table th:hover .col-resize-handle::after { opacity: .6; }
body.col-resize-on, body.col-resize-on * { user-select: none !important; cursor: col-resize !important; }

/* ================= المبيعات (Outreach) ================= */
.wa-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #25d366; color: #fff; font-weight: 700; font-size: 13px;
  padding: 7px 12px; border-radius: 10px; white-space: nowrap;
  box-shadow: 0 4px 12px -4px rgba(37, 211, 102, .55);
  transition: transform .15s ease, background .15s ease;
}
.wa-btn:hover { background: #1eb558; transform: translateY(-1px); }
.wa-btn:active { transform: translateY(0); }
.wa-btn svg { width: 15px; height: 15px; }
.lead-msg { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-status {
  font-size: 12.5px; font-weight: 700; padding: 6px 8px;
  border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.lead-status.st-sent { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.lead-status.st-not_sent { background: #eef0f6; color: var(--muted); border-color: transparent; }
.lead-status.st-no_whatsapp { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.mini-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.mini-stat {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 16px; box-shadow: var(--shadow-card);
}
.mini-stat span { font-size: 13px; color: var(--muted); font-weight: 600; }
.mini-stat b { font-size: 18px; }
.mini-stat.st-sent span { color: var(--ok); }
.mini-stat.st-no_whatsapp span { color: var(--danger); }
.w-auto { width: auto; }
.inline-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }

.input, input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
.input {
  border: 1px solid #dfe3ef; border-radius: var(--r-input);
  padding: 10px 13px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(90, 93, 240, .14);
}
input::placeholder, textarea::placeholder { color: #a6adc4; }

.seg { display: inline-flex; background: #e9ebf4; border-radius: 12px; padding: 4px; gap: 3px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent;
  padding: 8px 15px; border-radius: 9px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  cursor: pointer; font-family: inherit;
  transition: all .15s ease;
}
.seg button:hover { color: var(--ink); }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(22, 27, 46, .1); }

/* ================= أزرار ================= */
.btn {
  border: 1px solid transparent; border-radius: 11px;
  padding: 10px 18px; font-size: 14px; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  font-family: inherit;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -8px rgba(90, 93, 240, .65); }
.btn-ghost { background: #fff; border-color: #dfe3ef; color: var(--ink); }
.btn-ghost:hover { background: #f6f7fc; border-color: #cfd5e8; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d13842; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn {
  background: none; border: 0; cursor: pointer;
  font-size: 14px; padding: 7px; border-radius: 9px; line-height: 1;
  transition: background .15s ease, transform .15s ease;
}
.icon-btn:hover { background: #edeff7; transform: scale(1.08); }

/* ================= الجداول ================= */
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 700px; }
.table th {
  text-align: right; font-size: 11.5px; color: var(--muted); font-weight: 800;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: #f8f9fd; white-space: nowrap; letter-spacing: .2px;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover td { background: #f8f9fe; }
.table tbody tr:last-child td { border-bottom: 0; }
.cell-strong { font-weight: 700; }
.cell-sub { font-size: 12px; margin-top: 2px; color: var(--muted); }
.actions-cell { white-space: nowrap; }
.row-late { background: var(--danger-soft) !important; }
.row-late td { background: transparent; }
.row-done .cell-strong { text-decoration: line-through; color: var(--muted); }
.check-cell { width: 42px; text-align: center; }
.check-cell input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* ================= شارات وعناصر صغيرة ================= */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-muted { background: #eef0f6; color: var(--muted); }

.chip {
  display: inline-block; background: var(--brand-soft); color: var(--brand);
  border-radius: 8px; padding: 3px 9px; font-size: 12px; font-weight: 700;
  margin: 1px; white-space: nowrap;
}
.chip-soft { background: #eef0f6; color: var(--muted); }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; vertical-align: middle; }
.dot-high { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot-medium { background: #f5a524; box-shadow: 0 0 0 3px #fdf2e0; }
.dot-low { background: #98a1b8; box-shadow: 0 0 0 3px #eef0f6; }

.pill {
  background: var(--grad-soft); color: var(--brand);
  font-weight: 800; border-radius: 999px;
  min-width: 28px; height: 28px;
  display: grid; place-items: center; font-size: 12.5px;
  padding: 0 10px; flex: none;
}
.repeat-ico { font-size: 12px; }

/* ================= صفوف التاسكات (الداشبورد) ================= */
.task-list { margin: 0 -8px; }
.task-row {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 13px;
  position: relative;
  transition: background .15s ease;
}
.task-row:last-child { border-bottom: 0; }
.task-row::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px;
  width: 4px; border-radius: 99px; background: #dfe3f0;
}
.task-row:hover { background: #f8f9fe; }
.task-row.task-late { background: var(--danger-soft); }
.task-row.task-late::before { background: var(--danger); }
.task-row.task-done { background: #f4faf7; }
.task-row.task-done::before { background: var(--ok); }
.task-row.task-done:hover { background: #f4faf7; }
.task-row.task-done .task-title { text-decoration: line-through; color: var(--muted); }

.check {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #ccd2e4; background: #fff; cursor: pointer;
  color: transparent; font-size: 13px; line-height: 1;
  flex: none; margin-top: 2px; display: grid; place-items: center;
  transition: all .15s ease;
}
.check:hover { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.08); }
.check.checked {
  background: linear-gradient(135deg, #12b981, #0a9e6b);
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 10px -3px rgba(15, 157, 99, .5);
}
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 700; font-size: 14.5px; }
.task-sub { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; align-items: center; }
.task-sub .sep { opacity: .45; }
.status-select {
  font-size: 12.5px; font-weight: 700;
  border: 1px solid transparent; border-radius: 9px;
  padding: 6px 9px; background: #eef0f7; color: var(--ink);
  flex: none; width: auto; cursor: pointer;
  transition: all .15s ease;
}
.status-select:hover { background: #fff; border-color: #dfe3ef; }
.status-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(90, 93, 240, .14); }
.interest-select.st-none { background: #f1f2f7; color: var(--muted); font-weight: 600; }
.interest-select.st-follow { background: #e8f7ee; color: #1f8a4c; }
.interest-select.st-not_interested { background: #fdecec; color: #c0392b; }
.interest-select.st-dropped { background: #f2e8e7; color: #8e2f26; }
.interest-select.st-bailing { background: #fff4e4; color: #a9660a; }
.interest-select.st-let_go { background: #eceaf9; color: #5b4bb8; }

/* فلاتر صفحة العملاء المحتملين */
.fu-filters { margin-top: -6px; }
.fu-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: 4px; }
.fu-chip {
  font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  border: 1px solid #e4e6f2; background: #fff; color: var(--muted);
  border-radius: 999px; padding: 5px 11px; transition: all .15s ease;
}
.fu-chip b { font-weight: 800; }
.fu-chip:hover { border-color: #c3c8e6; color: var(--ink); }
.fu-chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

/* ================= صفوف عامة ================= */
.row-item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.row-item:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 14.5px; }
.row-sub { font-size: 12.5px; margin-top: 3px; }
.more-note { color: var(--muted); font-size: 12.5px; text-align: center; padding-top: 12px; font-weight: 600; }
.empty-state { text-align: center; color: var(--muted); padding: 34px 12px; font-size: 14px; font-weight: 600; }
.empty-ico {
  font-size: 26px; margin-bottom: 10px;
  width: 58px; height: 58px; margin-inline: auto;
  display: grid; place-items: center;
  background: #eef0f8; border-radius: 50%;
}

/* ================= النماذج ================= */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: span 2; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 700; color: #3d445c; }
label input, label select, label textarea, label .input { font-weight: 500; }
input, select, textarea {
  border: 1px solid #dfe3ef; border-radius: var(--r-input);
  padding: 10px 13px; background: #fff; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(90, 93, 240, .14);
}
textarea { resize: vertical; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.form-error { color: var(--danger); font-size: 13px; font-weight: 700; margin-top: 14px; min-height: 18px; }
.hint {
  font-size: 12.5px; color: #4c44a8; background: var(--grad-soft);
  border: 1px solid #e2e0fc;
  border-radius: 12px; padding: 11px 14px; font-weight: 600;
}

.check-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid #dfe3ef; border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 700;
  cursor: pointer; background: #fff; color: var(--muted);
  transition: all .15s ease; user-select: none;
}
.check-chip:hover { border-color: #b9bfe2; }
.check-chip input { display: none; }
.check-chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.check-chip input:disabled + span { opacity: .45; }

/* مفتاح تفعيل/تعطيل */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: #cfd5e6; border-radius: 999px;
  transition: .2s ease; cursor: pointer;
}
.slider:before {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; right: 3px; transition: .2s ease;
  box-shadow: 0 2px 5px rgba(22, 27, 46, .25);
}
.switch input:checked + .slider { background: linear-gradient(135deg, #12b981, #0a9e6b); }
.switch input:checked + .slider:before { transform: translateX(-20px); }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line-soft); background: #fafbfe;
  border-radius: 12px; padding: 12px 15px;
  font-size: 13.5px; font-weight: 700; color: #3d445c;
}

.platform-add { display: flex; gap: 10px; margin-bottom: 12px; }

/* ================= المودال ================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 18, 35, .55);
  backdrop-filter: blur(5px);
  display: grid; place-items: center;
  z-index: 100; padding: 18px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 20px;
  width: 100%; max-width: 540px; max-height: 92vh; overflow: auto;
  box-shadow: var(--shadow-pop);
  animation: modalIn .22s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-wide { max-width: 700px; }
.modal-sm { max-width: 410px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; background: #fff; z-index: 1;
  border-radius: 20px 20px 0 0;
}
.modal-head h3 { margin: 0; font-size: 16.5px; font-weight: 800; letter-spacing: -.2px; }
.modal-body { padding: 20px 22px; }
.confirm-body p { font-weight: 700; margin: 0 0 18px; font-size: 14.5px; }
.confirm-actions { display: flex; gap: 10px; }

/* ================= التوست ================= */
#toast-box {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 9px; z-index: 200;
  max-width: min(360px, 82vw);
}
.toast {
  background: #1c2237; color: #fff;
  padding: 12px 18px; border-radius: 13px;
  font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow-pop);
  animation: toastIn .25s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.toast::before { content: '✓'; display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: rgba(255,255,255,.14); font-size: 11px; margin-left: 8px; }
.toast-err { background: linear-gradient(135deg, #e0454e, #c7343d); }
.toast-err::before { content: '!'; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .3s ease; }

/* ================= شاشة الدخول ================= */
.auth-wrap {
  position: relative;
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(160deg, #12162a 0%, #1d2447 55%, #262e5c 100%);
  overflow: hidden;
}
.auth-wrap::before,
.auth-wrap::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; pointer-events: none;
}
.auth-wrap::before { width: 420px; height: 420px; background: #6366f1; top: -120px; inset-inline-start: -100px; }
.auth-wrap::after { width: 380px; height: 380px; background: #0ea5e9; bottom: -140px; inset-inline-end: -80px; opacity: .25; }
.auth-card {
  position: relative;
  background: #fff; border-radius: 24px;
  padding: 38px 34px; width: 100%; max-width: 420px;
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .55);
  animation: modalIn .3s ease;
}
.auth-logo {
  font-size: 30px; text-align: center;
  width: 68px; height: 68px; margin: 0 auto;
  display: grid; place-items: center;
  background: var(--grad-soft); border-radius: 50%;
  box-shadow: inset 0 0 0 1px #e2e0fc;
}
.auth-card h2 { text-align: center; margin: 14px 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 24px; font-weight: 600; }
.auth-card form { display: flex; flex-direction: column; gap: 15px; }
.auth-card input { padding: 12px 14px; font-size: 14.5px; }

/* ================= موبايل ================= */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; right: 0; bottom: 0;
    z-index: 50; width: 272px;
    transform: translateX(105%);
    transition: transform .28s cubic-bezier(.2, .9, .3, 1);
  }
  .sidebar.open { transform: translateX(0); box-shadow: -16px 0 50px rgba(0, 0, 0, .35); }
  .menu-btn { display: inline-grid; font-size: 19px; }
  .content { padding: 16px; }
  .topbar { padding: 11px 16px; }
  .page-title { font-size: 16.5px; }
  .topbar-date { display: none; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .toolbar .grow { min-width: 140px; }
  .status-select { width: 108px; }
  .interest-select { width: 132px; }
  .stat-num { font-size: 24px; }
  .auth-card { padding: 30px 24px; }
  #toast-box { right: 14px; left: 14px; bottom: 14px; max-width: none; }
}


/* ---- تحديد جماعي (عمود checkbox في العملاء المحتملين) ---- */
.sel-cell { width: 44px; min-width: 44px; text-align: center; padding-left: 4px !important; padding-right: 4px !important; }
.sel-cell input[type="checkbox"] { width: 17px; height: 17px; margin: 0; cursor: pointer; accent-color: var(--danger, #d13842); vertical-align: middle; }


/* ---- طي القائمة الجانبية (دسكتوب) ---- */
.sidebar-toggle { display: none; }
@media (min-width: 901px) {
  .sidebar-toggle { display: inline-grid; }
  .sidebar { transition: width .25s ease; }
  .layout.collapsed .sidebar { width: 74px; }
  .layout.collapsed .brand { justify-content: center; padding: 20px 8px 18px; }
  .layout.collapsed .brand > div:last-child { display: none; }
  .layout.collapsed .nav { padding: 14px 8px; }
  .layout.collapsed .nav a { justify-content: center; padding: 11px 8px; }
  .layout.collapsed .nav a > span:last-child { display: none; }
  .layout.collapsed .side-foot { padding: 16px 8px; }
  .layout.collapsed .user-chip { justify-content: center; }
  .layout.collapsed .user-meta { display: none; }
  .layout.collapsed #logout-btn { width: 100%; }
  #logout-btn .logout-ico { display: none; }
  .layout.collapsed #logout-btn .logout-txt { display: none; }
  .layout.collapsed #logout-btn .logout-ico { display: inline; }
}


/* ---- لوجو العميل ---- */
.client-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.client-logo, .client-logo-letter { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.client-logo { object-fit: cover; background: #fff; border: 1px solid var(--line-soft); }
.client-logo-letter { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; }
.logo-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-preview { width: 44px; height: 44px; border-radius: 12px; border: 1.5px dashed var(--line); display: grid; place-items: center; overflow: hidden; background: #fff; flex: none; }
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.logo-remove { display: flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; }
.logo-field { display: flex; flex-direction: column; gap: 7px; }
.logo-title { font-size: 13px; font-weight: 700; color: #3d445c; }
.logo-file-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 700; color: #3d445c; background: #fff; user-select: none; }
.logo-file-btn:hover { border-color: #6366f1; color: #6366f1; }

/* ==========================================================================
   كروت العملاء + صفحة العميل (المنصات ← المنصة)
   ========================================================================== */
.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.client-card {
  display: flex; flex-direction: column; gap: 12px; text-decoration: none;
  background: #fff; border: 1px solid #eef0f7; border-radius: 16px; padding: 16px 18px;
  color: var(--ink); transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}
.client-card:hover { box-shadow: 0 12px 28px -20px rgba(23,26,43,.55); border-color: #dfe2f2; transform: translateY(-1px); }
.cc-top { display: flex; align-items: center; gap: 11px; }
.cc-logo { flex: none; display: flex; align-items: center; }
.cc-logo .client-logo, .cc-logo .client-logo-letter { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; font-size: 17px; }
.cc-main { flex: 1 1 auto; min-width: 0; }
.cc-name { font-size: 15.5px; font-weight: 800; line-height: 1.5; overflow-wrap: anywhere; }
.cc-sub { font-size: 12.5px; color: var(--muted); }
.cc-plats { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-plat {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700;
  background: #f5f6fc; border: 1px solid #ebedf7; color: #4a4f6b; border-radius: 999px; padding: 4px 10px;
}
.cc-no-plat { font-size: 12px; color: #a9aec4; }
.cc-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid #f4f5fa; padding-top: 11px; }
.cc-nums > div { display: flex; flex-direction: column; gap: 1px; }
.cc-nums span { font-size: 11.5px; color: var(--muted); }
.cc-nums b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #f4f5fa; padding-top: 10px; }
.cc-open { font-size: 12.5px; font-weight: 700; color: var(--brand); }
.cc-actions { display: flex; gap: 4px; }
.cc-link { text-decoration: none; }
.cc-link:hover { color: var(--brand); text-decoration: underline; }

/* ===== صفحة العميل ===== */
.cd-crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.cd-crumbs a { color: var(--brand); font-weight: 700; text-decoration: none; }
.cd-crumbs a:hover { text-decoration: underline; }
.cd-crumbs span { color: #cfd3e4; }
.cd-crumbs b { color: var(--ink); }

.cd-head { display: flex; align-items: flex-start; gap: 16px; background: #fff; border: 1px solid #eef0f7; border-radius: 16px; padding: 18px; flex-wrap: wrap; }
.cd-head-logo .client-logo, .cd-head-logo .client-logo-letter { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; font-size: 26px; }
.cd-head-main { flex: 1 1 240px; min-width: 0; }
.cd-name { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-sub { font-size: 13px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cd-tel { color: var(--brand); text-decoration: none; font-weight: 600; }
.cd-sep { color: #cfd3e4; }
.cd-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cd-notes { background: #fffbeb; border: 1px solid #fdeec2; border-radius: 12px; padding: 11px 14px; margin-top: 12px; font-size: 13px; color: #7a5b12; }

.cd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 14px; }
.cd-stat { background: #fff; border: 1px solid #eef0f7; border-radius: 14px; padding: 13px 16px; display: flex; flex-direction: column; gap: 2px; }
.cd-stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.cd-stat b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cd-stat i { font-size: 11.5px; color: #9aa0b8; font-style: normal; }

.cd-sec-title { font-size: 15px; font-weight: 800; margin: 22px 0 10px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cd-hint { font-size: 12px; font-weight: 600; color: var(--muted); background: #f5f6fc; border-radius: 999px; padding: 3px 10px; }

/* كروت المنصات (المستوى اللي في النص) */
.cd-plats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 13px; }
.cd-plat {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink);
  background: #fff; border: 1px solid #eef0f7; border-radius: 16px; padding: 16px 17px;
  transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}
.cd-plat:hover { box-shadow: 0 12px 26px -20px rgba(23,26,43,.55); transform: translateY(-1px); border-color: #dfe2f2; }
.cd-plat-top { display: flex; align-items: center; gap: 9px; }
.cd-plat-ico { font-size: 22px; }
.cd-plat-ico.big { font-size: 30px; }
.cd-plat-name { font-size: 16px; font-weight: 800; }
.cd-plat-nums { display: flex; gap: 16px; flex-wrap: wrap; }
.cd-plat-nums > div { display: flex; flex-direction: column; }
.cd-plat-nums span { font-size: 11.5px; color: var(--muted); }
.cd-plat-nums b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cd-plat-go { font-size: 12.5px; font-weight: 700; color: var(--brand); border-top: 1px solid #f4f5fa; padding-top: 9px; }
.cd-empty-plat { background: #fff; border: 1px dashed #dfe2f2; border-radius: 16px; padding: 18px; font-size: 13px; color: var(--muted); }

.cd-plat-head { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid #eef0f7; border-radius: 16px; padding: 16px 18px; margin-bottom: 6px; }
.cd-plat-h1 { font-size: 18px; font-weight: 800; }

.cd-tasks { padding: 6px 4px; }
.cd-task { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f6f7fb; font-size: 13.5px; }
.cd-task:last-child { border-bottom: none; }
.cd-task-n { flex: 1 1 auto; overflow-wrap: anywhere; }
.cd-task-p { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px; background: #f2f3f8; color: #5c6180; flex: none; }
.cd-task-p.high { background: #fdeaea; color: #b3261e; }
.cd-task-p.medium { background: #fff4e2; color: #8a5a00; }


@media (max-width: 640px) {
  .clients-grid { grid-template-columns: 1fr; }
  .cd-plats { grid-template-columns: 1fr; }
  .cd-head { gap: 12px; }
  .cd-head-actions { width: 100%; }
}

/* Shared cards / table switch — same controls and data in either layout. */
.list-view-toggle { flex-shrink:0; margin-inline-start:auto; }
.list-view-bar { display:flex; margin-bottom:14px; }
.table-card.lv-shell { background:transparent; border:0; box-shadow:none; overflow:visible; }
.table-wrap.lv-wrap { overflow:visible; }
.table.lv-cards { display:block; min-width:0; width:100%; }
.table.lv-cards thead { display:block; }
.table.lv-cards thead tr { display:block; }
.table.lv-cards thead th { display:none; }
.table.lv-cards thead th.lv-select-head { display:flex; align-items:center; gap:8px; width:auto !important; padding:0 4px 12px; border:0; background:transparent; }
.table.lv-cards .lv-select-head::after { content:'تحديد الكل'; font-size:12px; color:var(--muted); }
.table.lv-cards .col-resize-handle { display:none; }
.table.lv-cards tbody { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr)); gap:16px; }
.table.lv-cards tbody tr { position:relative; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); column-gap:16px; align-content:start; min-width:0; background:#fff; border:1px solid var(--line-soft); border-radius:16px; padding:18px; box-shadow:0 3px 12px rgba(24,34,65,.035); }
.table.lv-cards tbody tr:hover { border-color:#d5d3fa; }
.table.lv-cards tbody tr td { display:block; width:auto !important; min-width:0; max-width:none; padding:8px 0; border:0; white-space:normal; overflow-wrap:anywhere; text-align:start; }
.table.lv-cards tbody tr:hover td { background:transparent; }
.table.lv-cards td[data-lv-label]:not(.lv-title):not(.lv-select)::before { content:attr(data-lv-label); display:block; color:var(--muted); font-family:'Cairo',sans-serif; font-size:11px; font-weight:600; margin-bottom:4px; direction:rtl; text-align:right; }
.table.lv-cards td.lv-title { order:-1; font-size:15px; font-weight:800; padding:0 0 12px; margin-bottom:4px; border-bottom:1px solid var(--line-soft); padding-inline-end:28px; }
.table.lv-cards td.lv-select { position:absolute; inset-inline-end:18px; top:18px; padding:0; }
.table.lv-cards td.lv-actions { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin-top:auto; padding-top:12px; border-top:1px solid var(--line-soft); }
.table.lv-cards td.lv-actions::before { display:none !important; }
.table.lv-cards td.lead-msg { white-space:normal; text-overflow:clip; max-width:none; }
.table.lv-cards .row-done { opacity:.75; }
.table.lv-cards .row-late { border-inline-start:3px solid #ed7676; }
.table.lv-cards tbody tr.lv-empty { grid-column:1/-1; }
.table.lv-cards .lv-empty td::before { display:none !important; }
.table.lv-cards .status-select { max-width:100%; }
@media(max-width:600px) {
  .table.lv-cards tbody { grid-template-columns:1fr; gap:12px; }
  .list-view-toggle { margin-inline-start:0; }
}

.table.lv-cards td.lv-title, .table.lv-cards td.lv-actions,
.table.lv-cards td.notes-cell, .table.lv-cards td.lead-msg,
.table.lv-cards .lv-empty td { grid-column:1/-1; }
.table.lv-cards td.row-num { display:none; }
.table.lv-cards .row-late { background:#fff !important; }

/* Client archive, distinct from completed tasks. */
.archive-tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
.archive-tabs a { color:var(--muted); padding:9px 16px; border-radius:11px; text-decoration:none; font-weight:700; font-size:13px; }
.archive-tabs a.active { background:#fff; color:var(--brand); box-shadow:0 2px 8px #2020400d; }
.archive-description { color:var(--muted); font-size:12.5px; margin:0 0 20px; line-height:1.9; }
.cc-archive-date { padding:0 18px 14px; font-size:12px; color:var(--muted); }
.cc-archive-date b { color:var(--ink); font-weight:600; }

/* Visible campaign editing beside the name in both tables and cards. */
.cm-name-edit { display:flex; align-items:flex-start; gap:12px; justify-content:space-between; }
.cm-name-edit > div { min-width:0; }
.cm-edit-btn { white-space:nowrap; flex-shrink:0; color:var(--brand); border:1px solid #e4defb; }
.table.lv-cards td.lv-title:has(.cm-name-edit) { padding-inline-end:0; }
@media(max-width:600px) { .cm-name-edit { flex-wrap:wrap; } }

/* Direct brief action on client cards; keep the footer usable on narrow screens. */
.cc-foot { flex-wrap:wrap; }
.cc-actions { margin-inline-start:auto; align-items:center; flex-wrap:wrap; }
.cc-brief { color:var(--brand); background:#f3f1ff; white-space:nowrap; padding:5px 9px; }
.cc-brief:disabled { opacity:.45; cursor:not-allowed; }

/* v38 — وضع العميل: نص حر، مستقل عن حالة التعاقد */
.cc-situation { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--border, #e4e8ef); border-radius: 10px; background: var(--bg, #f8fafc); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cc-situation-label { font-size: 11px; font-weight: 600; color: var(--muted, #64748b); }
.cc-situation-text { font-size: 13px; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
.client-situation-cell { min-width: 180px; max-width: 300px; }
.client-situation-value { display: block; white-space: pre-line; overflow-wrap: anywhere; font-size: 13px; line-height: 1.8; }
.cd-situation { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 16px; padding: 12px 16px; background: var(--card, #fff); border: 1px solid var(--border, #e4e8ef); border-radius: 12px; }

/* v39 — إبراز وضع العميل بنفسجي واضح ومتناسق مع هوية اللوحة */
.cc-situation, .cd-situation {
  border: 1.5px solid #9690ee;
  border-inline-start: 4px solid #6558d3;
  background: #f2efff;
}
.cc-situation-label { color: #5142ae; font-size: 12px; font-weight: 700; }
.cc-situation-text { color: #302659; font-weight: 600; }
.cc-situation-text.muted { color: #74698f; font-weight: 400; }
.client-situation-value {
  padding: 8px 11px;
  border: 1.5px solid #9690ee;
  border-inline-start: 4px solid #6558d3;
  border-radius: 9px;
  background: #f2efff;
  color: #302659;
  font-weight: 600;
}
.client-situation-value.muted { color: #74698f; font-weight: 400; }

/* v40 — المتبقي في الاشتراك: سطر بسيط على الكارت وعمود في الجدول */
.cc-subscription { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; min-width: 0; }
.cc-subscription-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.client-subscription { display: inline-flex; align-items: center; padding: 5px 10px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 700; line-height: 1.8; white-space: nowrap; }
.client-subscription.is-active { color: #146341; background: #edf9f1; border-color: #b4ddc5; }
.client-subscription.is-soon { color: #885017; background: #fff5e6; border-color: #ebce9b; }
.client-subscription.is-expired { color: #a03843; background: #fff0f1; border-color: #edbec4; }
.client-subscription.is-unknown { color: #626a7c; background: #f4f5f8; border-color: #d9deea; font-weight: 500; }
.client-subscription-cell { min-width: 155px; }

/* v42 — تنبيهات التجديد داخل السيستم، وتعديل الوضع من الكارت فقط */
.renewal-alert-slot { position: relative; flex: none; }
.renewal-alert-button { position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--muted); cursor: pointer; }
.renewal-alert-button svg { width: 21px; height: 21px; }
.renewal-alert-button.has-renewals { background: #fff7eb; border-color: #ecd0a1; color: #885017; }
.renewal-alert-count { position: absolute; top: -7px; inset-inline-end: -7px; min-width: 19px; padding: 0 5px; border-radius: 10px; color: #fff; background: #ad5423; border: 2px solid #fff; font-size: 10px; font-weight: 800; line-height: 18px; }
.renewal-alert-count[hidden], .renewal-alert-panel[hidden] { display: none; }
.renewal-alert-panel { position: absolute; top: calc(100% + 12px); inset-inline-end: 0; width: min(400px, calc(100vw - 32px)); padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); box-shadow: var(--shadow-pop); z-index: 60; text-align: start; }
.renewal-alert-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.renewal-alert-head .icon-btn { flex: none; font-size: 21px; }
.renewal-alert-message { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 10px 0 12px; }
.renewal-alert-bands { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.renewal-alert-bands > span { background: #fff6e8; color: #80501f; border: 1px solid #f2dfbc; border-radius: 7px; padding: 5px 8px; font-size: 10px; }
.renewal-alert-bands b { padding-inline-start: 7px; font-weight: 800; }
.renewal-alert-list { list-style: none; padding: 0; margin: 0; max-height: min(330px, 45vh); overflow-y: auto; }
.renewal-alert-list li + li { border-top: 1px solid var(--line); }
.renewal-alert-list a { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 1px; color: var(--ink); }
.renewal-alert-list a:hover strong { color: var(--brand); }
.renewal-alert-list a > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.renewal-alert-list strong { font-size: 12px; overflow-wrap: anywhere; }
.renewal-alert-list small { color: var(--muted); font-size: 10px; }
.renewal-alert-days { font-size: 11px; white-space: nowrap; font-weight: 700; color: #885017; }
.renewal-alert-days.urgent { color: #a03843; }
.renewal-alert-view { display: block; margin-top: 10px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.cl-renewal-filter.is-active { border-color: #d0b277; background: #fff5e6; color: #80501f; }
.cl-renewal-note { margin: 0 0 15px; padding: 10px 13px; border-inline-start: 3px solid #cc9636; border-radius: 7px; background: #fff7eb; color: #80501f; font-size: 12px; }
.client-card { cursor: pointer; }
.client-card .cc-name { color: inherit; text-decoration: none; }
.client-card .cc-name:hover { color: var(--brand); }
.cc-situation { cursor: text; }
.cc-situation-edit { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 0; background: transparent; border: 0; font: inherit; color: #5142ae; cursor: pointer; text-align: start; }
.cc-situation-edit > span:last-child { font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.cc-situation-edit:disabled { cursor: default; opacity: .6; }
.cc-situation-form { margin-top: 7px; cursor: auto; }
.cc-quick-label { display: block; font-size: 11px; color: #5142ae; margin-bottom: 5px; }
.cc-situation-form textarea { display: block; box-sizing: border-box; width: 100%; min-height: 86px; resize: vertical; padding: 8px 10px; border: 1px solid #9690ee; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; line-height: 1.8; }
.cc-situation-form small { display: block; margin-top: 5px; color: #74698f; font-size: 10px; }
.cc-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.cc-quick-error { color: #a03843; font-size: 11px; line-height: 1.8; margin: 6px 0 0; }
.cc-quick-error:empty { display: none; }
.cc-situation-form :disabled { opacity: .65; cursor: wait; }
.renewal-alert-button:focus-visible, .cc-situation-edit:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.renewal-alert-panel { max-height: calc(100dvh - 90px); overflow-y: auto; }

/* v43 — تثبيت شخصي للعملاء، بدون عمود إضافي أو تغيير ترتيب التجديدات */
.cc-top-actions { display: flex; align-items: center; gap: 7px; flex: none; }
.client-pin { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; padding: 5px; border: 1px solid #dce0eb; border-radius: 8px; background: #fff; color: #798198; cursor: pointer; }
.client-pin svg { display: block; width: 19px; height: 19px; }
.client-pin:hover { border-color: #a69ae5; color: #5b45bc; background: #f6f3ff; }
.client-pin.is-pinned { color: #5b45bc; background: #eee9ff; border-color: #ad9fe9; }
.client-pin.is-pinned svg path:first-child { fill: currentColor; }
.client-pin:disabled { opacity: .5; cursor: wait; }
.client-pin:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.client-card.is-pinned { border-color: #b5a8e9; }
@media(max-width:420px) { .cc-top-actions { flex-direction: column; align-items: flex-end; gap: 6px; } }

/* Manual platform navigation; no duplicated campaign table. */
.cd-manual-actions { margin-top:14px; }
