/* ============================================================
   SalmanBot — لوحة تحكم فاتحة (مرجع الصورة) + شاشة دخول داكنة
   لون العلامة: عنّابي #b51e44 (ثابت) · RTL · Mobile-first · ديسكتوب واسع
   ============================================================ */
:root {
  --bg: #f4f3f7;
  --surface: #ffffff;
  --ink: #211d2e;
  --muted: #8b8598;
  --line: #ededf2;
  --line-strong: #e0dee7;
  --accent: #b51e44;          /* عنّابي — لون العلامة الثابت */
  --accent-2: #8e1635;
  --accent-soft: #f8e9ee;
  --icon-bg: #efecf7;         /* دائرة أيقونة الإحصاء (لافندر فاتح) */
  --navy: #1f2150;
  --purple: #8b6fd6;
  --up: #1f9d55; --down: #e0354b;
  --radius: 20px; --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(33, 20, 50, .07);
  --shadow-sm: 0 4px 14px rgba(33, 20, 50, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Cairo", "Tajawal", "Segoe UI", system-ui, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.6; min-height: 100dvh; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }
[data-lucide], .lucide { width: 20px; height: 20px; stroke-width: 1.9; vertical-align: middle; }

/* أزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 24px; border: none;
  border-radius: 980px; font-weight: 700; font-size: 15px; background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff;
  transition: transform .12s, box-shadow .15s, filter .15s; box-shadow: 0 8px 22px rgba(181,30,68,.28); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(181,30,68,.36); }
.btn:active { transform: translateY(0); }
.btn.green { background: linear-gradient(160deg, var(--accent), var(--accent-2)); }
.btn.green:hover { filter: brightness(1.05); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: #faf9fc; }
.btn:disabled { opacity: .5; cursor: default; }
.btn .lucide { width: 18px; height: 18px; }

input[type="text"], input[type="password"], textarea, select {
  width: 100%; padding: 12px 15px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font-family: inherit; font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(181,30,68,.14); }
textarea { min-height: 340px; resize: vertical; line-height: 1.55; }
textarea.mini { min-height: 60px; } textarea.mid { min-height: 150px; }
label.fld { display: block; font-weight: 700; margin: 16px 2px 7px; font-size: 14px; }
.muted { color: var(--muted); }
.error { color: var(--down); margin-top: 12px; font-size: 14px; font-weight: 600; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 8px; background: var(--accent-soft); font-size: 12px; color: var(--accent); }
.prompt-preview { background: #faf9fc; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 12px;
  white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.85; max-height: 440px; overflow: auto; }

/* ============ شاشة الدخول (داكنة — مستقلّة بألوانها) ============ */
.login { min-height: 100dvh; display: flex; align-items: flex-start; justify-content: center; padding: 0; position: relative; overflow: hidden;
  background: radial-gradient(125% 75% at 50% 0%, #2a1f47 0%, #161029 46%, #0e0a1f 100%); color: #f3eefb; }
.login::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 18% 11%, rgba(255,120,160,.7), transparent 60%),
    radial-gradient(2px 2px at 82% 16%, rgba(255,120,160,.55), transparent 60%),
    radial-gradient(1.6px 1.6px at 66% 8%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1.6px 1.6px at 32% 24%, rgba(255,120,160,.5), transparent 60%),
    radial-gradient(2px 2px at 90% 42%, rgba(255,120,160,.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 10% 40%, rgba(255,255,255,.45), transparent 60%); }
.login-inner { width: 100%; max-width: 430px; min-height: 100dvh; display: flex; flex-direction: column; padding: 46px 26px 28px; position: relative; z-index: 1; }
.login-head { text-align: center; }
.login-head .welcome { color: #a99dbf; font-size: 13px; margin-bottom: 10px; letter-spacing: .04em; }
.login-head h1 { font-size: 30px; font-weight: 800; margin-bottom: 12px; letter-spacing: -.02em; color: #fff; }
.login-head p { color: #a99dbf; font-size: 14px; line-height: 1.7; max-width: 300px; margin: 0 auto; }
.login-robot { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 170px; position: relative; }
.login-robot::before { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; border: 1px solid rgba(193,46,87,.18); transform: rotate(-16deg) scaleY(.52); }
.login-robot img { width: 188px; height: auto; object-fit: contain; animation: bob 4s ease-in-out infinite; filter: drop-shadow(0 16px 24px rgba(0,0,0,.55)); position: relative; z-index: 1; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.login-form { display: flex; flex-direction: column; gap: 13px; }
.lfield { position: relative; }
.lfield > .lucide, .lfield > [data-lucide] { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); color: #a99dbf; width: 19px; height: 19px; }
.lfield input { width: 100%; padding: 15px 46px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.16); color: #fff; font-size: 15px; outline: none; }
.lfield input::placeholder { color: #a99dbf; }
.lfield input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(181,30,68,.25); }
.lfield .eye { position: absolute; inset-inline-end: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #a99dbf; padding: 4px; display: flex; cursor: pointer; }
.lfield .eye .lucide { width: 19px; height: 19px; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #a99dbf; cursor: pointer; margin: 2px; }
.remember input { width: 17px; height: 17px; accent-color: var(--accent); }
.login-btn { width: 100%; padding: 16px; font-size: 16px; border-radius: 14px; margin-top: 4px; }
.login-support { text-align: center; color: #a99dbf; font-size: 12.5px; margin-top: 16px; display: flex; gap: 6px; align-items: center; justify-content: center; }
.login-support a { color: #ff7eb0; font-weight: 700; }
.login-support .lucide { width: 15px; height: 15px; }

/* ============ هيكل اللوحة (فاتح) ============ */
.app { min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: rgba(255,255,255,.88); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.hamburger { background: none; border: none; color: var(--ink); padding: 4px; display: inline-flex; }
.hamburger .lucide { width: 26px; height: 26px; }
.topbar .brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; flex: 1; justify-content: flex-end; letter-spacing: -.01em; }
.topbar .brand .lucide, .side-brand .lucide { color: var(--accent); width: 26px; height: 26px; }
.icon-btn { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 13px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }

.nav-overlay { position: fixed; inset: 0; background: rgba(20,14,30,.42); z-index: 35; display: none; }
.nav-overlay.show { display: block; }
.sidebar { position: fixed; inset-inline-start: 0; top: 0; z-index: 40; height: 100dvh; width: 286px; background: var(--surface);
  box-shadow: -8px 0 40px rgba(0,0,0,.12); padding: 22px 16px; overflow-y: auto; transform: translateX(110%); transition: transform .28s cubic-bezier(.3,.8,.3,1); }
.sidebar.open { transform: translateX(0); }
.side-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; padding: 6px 8px 20px; letter-spacing: -.01em; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a { display: flex; align-items: center; gap: 13px; padding: 13px 16px; border-radius: 14px; color: var(--ink); font-size: 15px; font-weight: 600; transition: background .14s, color .14s; }
.sidebar nav a .lucide { width: 21px; height: 21px; flex: none; color: var(--muted); }
.sidebar nav a:hover { background: #f6f5f9; }
.sidebar nav a.active { background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 18px rgba(181,30,68,.32); }
.sidebar nav a.active .lucide { color: #fff; }
.sidebar nav .sep { height: 1px; background: var(--line); margin: 10px 6px; }
.sidebar nav a.logout-link { color: var(--accent); }
.sidebar nav a.logout-link .lucide { color: var(--accent); }
.content { padding: 20px 16px 40px; }

h2 { margin-bottom: 16px; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }

/* ترويسة الصفحة */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .ph-title { text-align: start; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-head .ph-sub { color: var(--muted); font-size: 14px; }
.date-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 14px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-sm); }
.date-pill .lucide { width: 16px; height: 16px; color: var(--accent); }

/* بطاقات KPI */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .kpi-ic { width: 38px; height: 38px; border-radius: 50%; background: var(--icon-bg); display: flex; align-items: center; justify-content: center; flex: none; }
.kpi .kpi-ic .lucide { width: 19px; height: 19px; color: #6b6480; }
.kpi .kpi-title { color: var(--ink); font-size: 13.5px; font-weight: 700; }
.kpi .kpi-num { font-size: 30px; font-weight: 800; margin-top: 8px; letter-spacing: -.02em; }
.kpi .kpi-trend { font-size: 12px; font-weight: 700; margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.kpi .kpi-trend span { color: var(--muted); font-weight: 600; }
.kpi .kpi-trend.up { color: var(--up); }
.kpi .kpi-trend.down { color: var(--down); }

/* بطاقات الرسوم */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.panel-head h3 { font-size: 16px; font-weight: 800; }
.panel-head .mini-pill { font-size: 12px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px 10px; }
.chart-plot { height: 190px; display: flex; align-items: flex-end; gap: 9px; border-bottom: 1px solid var(--line); }
.chart-plot .col { flex: 1; display: flex; align-items: flex-end; justify-content: center; height: 100%; }
.chart-plot .fill { width: 100%; max-width: 30px; min-height: 4px; background: linear-gradient(180deg, #c2295a, var(--accent-2)); border-radius: 7px 7px 0 0; }
.chart-labels { display: flex; gap: 9px; margin-top: 8px; }
.chart-labels span { flex: 1; text-align: center; color: var(--muted); font-size: 11px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 132px; height: 132px; border-radius: 50%; flex: none; position: relative; }
.donut::after { content: ""; position: absolute; inset: 20px; background: var(--surface); border-radius: 50%; }
.legend { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 11px; }
.legend .lg { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.legend .lg .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.legend .lg .lg-name { flex: 1; }
.legend .lg .lg-pct { font-weight: 800; }

/* أحدث المحادثات */
.recent-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.recent-head a { color: var(--accent); font-weight: 700; font-size: 13px; }
.recent-item { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.recent-item:last-child { border-bottom: none; }
.recent-item .r-ava { width: 46px; height: 46px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; position: relative;
  background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 18px; }
.recent-item .r-ava .ch { position: absolute; bottom: -2px; inset-inline-end: -2px; width: 18px; height: 18px; border-radius: 50%; background: #25d366; border: 2px solid var(--surface); display: flex; align-items: center; justify-content: center; }
.recent-item .r-ava .ch .lucide { width: 10px; height: 10px; color: #fff; }
.recent-item .r-body { flex: 1; min-width: 0; }
.recent-item .r-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.recent-item .r-top b { font-size: 14.5px; }
.recent-item .r-top span { color: var(--muted); font-size: 11.5px; flex: none; }
.recent-item .r-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* الوصول السريع */
.quick-title { font-size: 18px; font-weight: 800; margin: 22px 2px 14px; text-align: start; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 10px; text-align: center; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .12s, box-shadow .15s; }
.quick-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.quick-tile .lucide { width: 26px; height: 26px; color: var(--accent); margin-bottom: 9px; }
.quick-tile span { display: block; font-size: 13px; font-weight: 700; }

/* إعدادات متقدمة */
.adv-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.adv-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; cursor: pointer; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .15s; }
.adv-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.adv-card .ic { width: 50px; height: 50px; border-radius: 14px; flex: none; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; }
.adv-card .ic .lucide { width: 24px; height: 24px; }
.adv-card b { display: block; font-size: 16px; }
.adv-card span { color: var(--muted); font-size: 13px; }

/* جداول */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: block; overflow-x: auto; white-space: nowrap; box-shadow: var(--shadow-sm); }
th, td { padding: 13px 15px; text-align: right; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: #faf9fc; color: var(--accent); font-weight: 800; }
tr:last-child td { border-bottom: none; }
.badge { padding: 4px 11px; border-radius: 980px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.ok { background: #e9f7ef; color: var(--up); }
.badge.off { background: #fdecee; color: var(--down); }
.badge.warn { background: #fff4e5; color: #b9770a; }
.badge.hot { background: #fdecee; color: var(--down); }
.badge.warm { background: #fff4e5; color: #b9770a; }
.badge.cold { background: var(--accent-soft); color: var(--accent); }

/* المحادثات — أسلوب واتساب */
.chat-wrap { display: grid; grid-template-columns: 1fr; gap: 14px; }
.convo-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-height: 44vh; overflow: auto; box-shadow: var(--shadow-sm); }
.convo-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.convo-item:hover, .convo-item.active { background: #faf9fc; }
.convo-item .avatar { width: 46px; height: 46px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 19px; }
.convo-item .ci-body { flex: 1; min-width: 0; }
.convo-item .ci-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.convo-item .ci-top .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-item .ci-time { color: var(--muted); font-size: 11px; flex: none; }
.convo-item .ci-sub { color: var(--muted); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-item .ci-badges { margin-top: 6px; display: flex; gap: 5px; flex-wrap: wrap; }
.chat-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; max-height: 60vh; overflow: auto; box-shadow: var(--shadow-sm); }
.msg { max-width: 80%; padding: 11px 15px; border-radius: 18px; margin-bottom: 9px; white-space: pre-wrap; font-size: 14px; line-height: 1.5; }
.msg.user { background: #f1eef6; margin-inline-start: auto; border-bottom-right-radius: 5px; }
.msg.assistant { background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; border-bottom-left-radius: 5px; }
.ad-note { background: #faf9fc; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; }
.ad-note a { color: var(--accent); text-decoration: underline; }
.chat-input { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.chat-input input { border-radius: 980px; background: #f4f3f7; }
.send-btn { flex: none; width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; border: none; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px rgba(181,30,68,.4); }
.send-btn .lucide { width: 20px; height: 20px; }
.channel-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.score-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.score-grid label { font-size: 13px; font-weight: 700; display: flex; flex-direction: column; gap: 5px; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card .num { font-size: 30px; font-weight: 800; color: var(--accent); }
.card .lbl { color: var(--muted); font-size: 13px; margin-top: 3px; font-weight: 600; }
.toast { position: fixed; bottom: 22px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 13px 24px; border-radius: 980px; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; }

/* ============ ديسكتوب — يتوسّع على الشاشة ============ */
@media (min-width: 980px) {
  .topbar { display: none; }
  .app { display: grid; grid-template-columns: 286px 1fr; align-items: start; }
  .nav-overlay { display: none !important; }
  .sidebar { position: sticky; top: 0; transform: none !important; box-shadow: none; border-inline-end: 1px solid var(--line); }
  .content { padding: 30px 38px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .charts-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
  .charts-row .panel { margin-bottom: 0; }
  .quick-grid { grid-template-columns: repeat(6, 1fr); }
  .adv-grid { grid-template-columns: repeat(2, 1fr); }
  .chat-wrap { grid-template-columns: 330px 1fr; }
  .convo-list { max-height: 72vh; }
}

/* ============ صفحة الهبوط (فاتحة) ============ */
.lp-nav { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; max-width: 1080px; margin: 0 auto; }
.lp-nav .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.lp-nav .logo img { width: 36px; height: 36px; border-radius: 10px; padding: 4px; background: var(--accent-soft); }
.hero { text-align: center; padding: 50px 22px 56px; max-width: 760px; margin: 0 auto; }
.hero .ava { width: 150px; height: 150px; margin: 0 auto 26px; border-radius: 38px; padding: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero .ava img { width: 100%; height: 100%; object-fit: contain; }
.hero h1 { font-size: 34px; line-height: 1.3; margin-bottom: 18px; letter-spacing: -.03em; font-weight: 800; }
.hero h1 .grad { color: var(--accent); }
.hero p { color: var(--muted); font-size: 18px; margin-bottom: 30px; }
.hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.section { max-width: 1000px; margin: 0 auto; padding: 40px 22px; }
.section h2 { text-align: center; font-size: 27px; margin-bottom: 32px; }
.feat-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.feat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.feat .ic { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; }
.feat .ic .lucide { width: 25px; height: 25px; }
.feat h3 { font-size: 17px; margin-bottom: 7px; }
.feat p { color: var(--muted); font-size: 14px; }
.steps { display: grid; grid-template-columns: 1fr; gap: 12px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow-sm); }
.step .n { flex: none; width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.cta-band { text-align: center; border-radius: 28px; padding: 50px 24px; margin: 40px auto; max-width: 1000px; background: var(--accent-soft); border: 1px solid var(--line); }
.cta-band h2 { font-size: 27px; margin-bottom: 10px; }
.cta-band p { color: var(--muted); margin-bottom: 24px; }
.lp-footer { text-align: center; color: var(--muted); padding: 34px 20px; font-size: 14px; border-top: 1px solid var(--line); }
@media (min-width: 800px) { .hero h1 { font-size: 48px; } .feat-grid { grid-template-columns: repeat(3, 1fr); } .steps { grid-template-columns: repeat(2, 1fr); } }

/* ============ صفحة المحادثات (واتساب) ============ */
.conv-top h1 { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 14px; }
.conv-filters { display: flex; gap: 8px; margin-bottom: 14px; }
.conv-filters .cf { flex: 1; padding: 11px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.conv-filters .cf.active { background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.conv-filters .cf .cf-count { background: rgba(0,0,0,.12); border-radius: 980px; padding: 1px 9px; font-size: 12px; }
.conv-filters .cf.active .cf-count { background: rgba(255,255,255,.28); }
.conv-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 0 15px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.conv-search .lucide { color: var(--muted); width: 19px; height: 19px; flex: none; }
.conv-search input { border: none; background: none; padding: 13px 0; flex: 1; }
.conv-search input:focus { box-shadow: none; }
.wa-item { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 13px 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .12s, box-shadow .15s; }
.wa-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.wa-ava { width: 54px; height: 54px; border-radius: 50%; flex: none; position: relative; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 20px; }
.wa-ava .wa-ch { position: absolute; bottom: -1px; inset-inline-start: -1px; width: 20px; height: 20px; border-radius: 50%; background: #25d366; border: 2px solid var(--surface); display: flex; align-items: center; justify-content: center; }
.wa-ava .wa-ch .lucide { width: 11px; height: 11px; color: #fff; }
.wa-body { flex: 1; min-width: 0; }
.wa-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wa-name { font-weight: 800; font-size: 15.5px; }
.wa-time { color: var(--muted); font-size: 12px; flex: none; }
.wa-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; }
.wa-sub { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.wa-unread { background: var(--accent); color: #fff; min-width: 22px; height: 22px; border-radius: 980px; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; flex: none; }

/* شاشة المحادثة المفتوحة */
.chat-header { display: flex; align-items: center; gap: 12px; padding: 4px 2px 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.chat-header .ch-back { background: none; border: none; color: var(--ink); padding: 4px; display: inline-flex; }
.chat-header .ch-back .lucide { width: 24px; height: 24px; }
.chat-header .ch-ava { width: 46px; height: 46px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 18px; }
.chat-header .ch-info { flex: 1; min-width: 0; }
.chat-header .ch-info b { font-size: 16px; }
.chat-header .ch-info span { color: var(--up); font-size: 12px; display: block; }
.chat-header .ch-info span.off { color: #b9770a; }
.lead-tag { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.lead-tag .lt-main { display: flex; align-items: center; gap: 11px; }
.lead-tag .lt-main > .lucide { color: var(--accent); width: 22px; height: 22px; }
.lead-tag .lt-main b { display: block; font-size: 14px; }
.lead-tag .lt-main span { color: var(--muted); font-size: 12px; }
.lead-tag .lt-badge { background: #e9f7ef; color: var(--up); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 980px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.lead-tag .lt-badge .lucide { width: 14px; height: 14px; }
.date-sep { text-align: center; margin: 6px 0 14px; }
.date-sep span { background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 5px 16px; border-radius: 980px; }
.msgs { display: flex; flex-direction: column; max-height: 54vh; overflow-y: auto; padding: 2px; }
.mrow { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 10px; max-width: 86%; }
.mrow.user { flex-direction: row-reverse; margin-inline-start: auto; }
.mrow .m-ava { width: 32px; height: 32px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; overflow: hidden; }
.mrow.user .m-ava { background: var(--icon-bg); color: var(--accent); }
.mrow.bot .m-ava { background: #eef0fb; padding: 3px; }
.mrow.bot .m-ava img { width: 100%; height: 100%; object-fit: contain; }
.mrow .m-bubble { padding: 11px 15px; border-radius: 16px; font-size: 14px; line-height: 1.55; }
.mrow.user .m-bubble { background: #eef0f5; border-bottom-right-radius: 5px; }
.mrow.bot .m-bubble { background: #f1edf8; border-bottom-left-radius: 5px; }
.mrow .m-time { color: var(--muted); font-size: 10.5px; margin-top: 4px; display: block; }
.quick-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }
.quick-chips button { border: 1px solid var(--accent); color: var(--accent); background: var(--surface); border-radius: 980px; padding: 9px 15px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.quick-chips button .lucide { width: 16px; height: 16px; }
.quick-chips button:hover { background: var(--accent-soft); }

/* شارة قناة عامة (واتساب) */
.wa-ch { position: absolute; bottom: -1px; inset-inline-start: -1px; width: 20px; height: 20px; border-radius: 50%; background: #25d366; border: 2px solid var(--surface); display: flex; align-items: center; justify-content: center; }
.wa-ch .lucide { width: 11px; height: 11px; color: #fff; }

/* ============ صفحة الطلبات ============ */
.page-head2 { text-align: center; margin-bottom: 16px; }
.page-head2 h1 { font-size: 26px; font-weight: 800; }
.page-head2 .ph-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.ord-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.ord-filters::-webkit-scrollbar { display: none; }
.ord-tab { flex: none; white-space: nowrap; padding: 9px 16px; border-radius: 980px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font-weight: 700; font-size: 14px; }
.ord-tab.active { background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.ord-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-c { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 12px; text-align: center; box-shadow: var(--shadow-sm); }
.stat-ic { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; }
.stat-ic .lucide { width: 20px; height: 20px; }
.stat-num { font-size: 28px; font-weight: 800; }
.stat-lbl { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 2px; }
.ord-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .12s, box-shadow .15s; }
.ord-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ord-card-top { display: flex; align-items: flex-start; gap: 12px; }
.ord-ava { width: 54px; height: 54px; border-radius: 50%; flex: none; position: relative; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 20px; }
.ord-info { flex: 1; min-width: 0; }
.ord-ref { color: var(--muted); font-size: 12px; font-weight: 600; }
.ord-name { font-weight: 800; font-size: 16px; margin-top: 1px; }
.ord-items { color: var(--muted); font-size: 13.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ord-meta { text-align: left; flex: none; }
.ord-total { font-weight: 800; font-size: 15px; white-space: nowrap; }
.ord-date { color: var(--muted); font-size: 12px; margin-top: 4px; display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.ord-date .lucide { width: 14px; height: 14px; }
.ord-card-foot { margin-top: 12px; }
.ord-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 980px; font-size: 12.5px; font-weight: 700; }
.ord-dot { width: 8px; height: 8px; border-radius: 50%; }
@media (min-width: 700px) { .ord-stats { grid-template-columns: repeat(4, 1fr); } }

/* تفاصيل الطلب */
.od-summary .od-sum-row { display: flex; justify-content: space-between; gap: 10px; text-align: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.od-summary .od-sum-row > div { flex: 1; }
.od-summary .od-sum-row2 { display: flex; justify-content: space-between; gap: 10px; padding-top: 14px; }
.od-summary .od-sum-row2 > div { flex: 1; text-align: center; }
.od-k { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.od-v { font-size: 16px; }
.od-v2 { font-size: 13.5px; font-weight: 600; }
.od-customer { display: flex; align-items: center; gap: 14px; }
.od-ava { width: 60px; height: 60px; border-radius: 50%; flex: none; position: relative; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 22px; }
.od-cust-info { flex: 1; min-width: 0; }
.od-cust-info b { font-size: 17px; }
.od-cust-line { color: var(--muted); font-size: 13px; margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.od-cust-line .lucide { width: 15px; height: 15px; }
.od-stepper { display: flex; justify-content: space-between; position: relative; padding: 4px 0; }
.od-stepper::before { content: ""; position: absolute; top: 23px; inset-inline: 10%; height: 2px; background: var(--line-strong); z-index: 0; }
.od-step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; position: relative; z-index: 1; }
.od-circle { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--surface); color: var(--muted); border: 2px solid var(--line-strong); }
.od-circle .lucide { width: 18px; height: 18px; }
.od-step.done .od-circle { background: var(--up); color: #fff; border-color: var(--up); }
.od-step.active .od-circle { background: var(--accent); color: #fff; border-color: var(--accent); }
.od-step-lbl { font-size: 11.5px; color: var(--muted); text-align: center; }
.od-step.active .od-step-lbl { color: var(--ink); font-weight: 700; }
.od-canceled { text-align: center; color: var(--down); font-weight: 700; padding: 10px; }
.od-details > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.od-details > div:last-child { border-bottom: none; }
.od-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.od-actions .btn { width: 100%; }
@media (min-width: 700px) { .od-actions { flex-direction: row; } }

/* ============ صفحة المواعيد ============ */
.appt-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.appt-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px; cursor: pointer; }
.appt-when { color: var(--muted); font-size: 12.5px; margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.appt-when .lucide { width: 14px; height: 14px; }
.appt-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.appt-chev { color: var(--muted); transition: transform .2s; }
.appt-card.open .appt-chev { transform: rotate(180deg); }
.appt-detail { display: none; padding: 0 16px 16px; border-top: 1px solid var(--line); }
.appt-card.open .appt-detail { display: block; }
.appt-note { background: #f6f4fb; border-radius: 12px; padding: 11px 14px; font-size: 13px; color: var(--ink); margin: 14px 0 10px; display: flex; align-items: center; gap: 8px; }
.appt-note .lucide { width: 18px; height: 18px; color: var(--accent); flex: none; }
.appt-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.appt-actions .btn { width: 100%; }
@media (min-width: 700px) { .appt-actions { flex-direction: row; } }

/* ============ العملاء المحتملون ============ */
.ai-hint { display: flex; align-items: center; gap: 10px; background: #f6f4fb; border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; margin-bottom: 16px; font-size: 13.5px; font-weight: 600; }
.ai-hint > .lucide { color: var(--accent); flex: none; }
.ai-hint span { flex: 1; }
.ai-hint img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.lead-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .12s, box-shadow .15s; }
.lead-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.lead-top { display: flex; align-items: flex-start; gap: 12px; }
.lead-line { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.lead-line .lucide { width: 14px; height: 14px; flex: none; color: var(--accent); }
.lead-score { text-align: center; flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; }
.lead-score-num { font-size: 26px; font-weight: 800; line-height: 1; }
.lead-score-lbl { color: var(--muted); font-size: 10px; }
.lead-actions { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.lead-actions .btn { flex: 1; }
.lead-status { width: auto; flex: none; padding: 10px 12px; border-radius: 980px; border: 1px solid var(--line-strong); font-weight: 700; font-size: 13px; background: var(--surface); }

/* تفاصيل العميل المحتمل */
.lead-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.lead-hero-info { flex: 1; min-width: 0; }
.ld-tag { display: inline-block; background: #fff4d6; color: #c77700; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 980px; margin-bottom: 8px; }
.lead-hero-info h3 { font-size: 20px; }
.lead-gauge { width: 116px; height: 116px; border-radius: 50%; flex: none; position: relative; }
.lead-gauge::after { content: ""; position: absolute; inset: 12px; background: var(--surface); border-radius: 50%; }
.lead-gauge .gv { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; }
.lead-gauge .gv b { font-size: 30px; font-weight: 800; }
.lead-gauge .gv span { font-size: 12px; font-weight: 700; }
.ld-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ld-chips span { background: var(--surface); border: 1px solid var(--line); border-radius: 980px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow-sm); }
.lead-notes { display: flex; align-items: center; gap: 14px; }
.lead-notes .ln-text { flex: 1; }
.lead-notes .ln-text b { color: var(--accent); font-size: 14px; }
.lead-notes .ln-text p { color: var(--muted); font-size: 13.5px; margin-top: 6px; line-height: 1.6; }
.lead-notes img { width: 78px; height: 78px; object-fit: contain; flex: none; }
.signal-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.signal-row:last-child { border-bottom: none; }
.signal-row .lucide { width: 18px; height: 18px; color: var(--muted); flex: none; }
.signal-row .sig-name { flex: 1; font-size: 14px; }
.signal-row .sig-val { font-weight: 800; font-size: 13px; color: var(--muted); }
.signal-row .sig-val.on { color: var(--up); }
.info-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.info-row:last-child { border-bottom: none; }
.info-row > .lucide { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 3px; }
.info-row .ir-body { flex: 1; min-width: 0; }
.info-row .ir-k { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.info-row .ir-pts { color: var(--up); font-weight: 800; font-size: 11px; }
.info-row .ir-v { font-weight: 600; font-size: 14px; margin-top: 3px; word-break: break-word; }
.info-row .ir-v.ir-empty { color: var(--muted); font-weight: 500; }

/* ============ تحويلات لموظف ============ */
.ho-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.ho-top { display: flex; align-items: flex-start; gap: 12px; }
.ho-reason { color: var(--muted); font-size: 13px; margin-top: 5px; display: flex; gap: 6px; align-items: flex-start; }
.ho-reason .lucide { width: 14px; height: 14px; flex: none; color: var(--accent); margin-top: 2px; }
.ho-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.ho-actions { display: flex; gap: 8px; margin-top: 14px; }
.ho-actions .btn { flex: 1; }
.ld-next { display: flex; align-items: center; gap: 12px; }
.ld-next > .lucide { color: var(--accent); flex: none; }
.ld-next b { display: block; font-size: 14px; }
.ld-next span { color: var(--muted); font-size: 13px; }
