/*
 * لوحة الموظفين — مجموعة المزاد الدولي / MACCHINAA
 * نفس هوية الحاسبة: أسود #1c191a + أحمر #bf2229 + أبيض، RTL، جوّال أولاً.
 */
:root {
  --navy: #1c191a;
  --navy-2: #38302f;
  --gold: #bf2229;       /* الأحمر الأساسي */
  --gold-soft: #f3c3c5;
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1b1718;
  --muted: #6b7785;
  --line: #e2e7ee;
  --good: #0f7a4d;
  --warn-bg: #fff7d6;
  --warn-line: #e9c84a;
  --late-bg: #fdecec;
  --late-line: #bf2229;
  --shadow: 0 6px 24px rgba(28, 25, 26, 0.10);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", Tahoma, Arial, "Noto Sans Arabic", sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* ===== الهيدر ===== */
.site-header { background: #fff; padding: 12px 16px 0; border-bottom: 3px solid var(--gold); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50; }
.header-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; }
.brand img { width: 56px; height: 56px; flex: none; object-fit: contain; }
.brand-text .ar { font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.brand-text .en { font-size: .8rem; color: var(--gold); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.staff-id { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; line-height: 1.1; }
.staff-name { font-weight: 800; font-size: .9rem; color: var(--navy-2); }

.tabs { max-width: 1180px; margin: 10px auto 0; display: flex; gap: 4px; flex-wrap: wrap; }
.tab { background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--muted); padding: 10px 14px; font-weight: 800; font-size: .9rem; cursor: pointer; font-family: inherit; }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ===== أزرار عامة ===== */
.btn-gold { background: var(--gold); color: #fff; border: 0; padding: 12px 20px; border-radius: 10px; font-weight: 800; cursor: pointer; font-size: .95rem; font-family: inherit; }
.btn-gold:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--navy-2); border: 1px solid var(--line); padding: 9px 16px; border-radius: 10px; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 7px 12px; font-size: .82rem; border-radius: 8px; }
.btn-danger { background: var(--gold); color: #fff; border: 0; }

.badge { display: inline-block; font-size: .68rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #eef2f7; color: var(--navy-2); border: 1px solid var(--line); }
/* شارة توثيق الزبون */
.badge.verified { background: #e3f5ec; color: var(--good); border-color: #a8e0c4; }
.badge.unverified { background: #eef2f7; color: var(--muted); border-color: var(--line); }
.badge.warn-chip { background: var(--warn-bg); color: #5b4a00; border-color: var(--warn-line); }

/* ضمان إخفاء أي عنصر عليه خاصية hidden (يتغلّب على قواعد display) — لكل المستخدمين */
[hidden] { display: none !important; }

/* ===== شاشة الدخول ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--card); width: min(380px, 100%); border-radius: 16px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 26px 22px; text-align: center; }
.login-logo { width: 72px; height: 72px; object-fit: contain; }
.login-card h2 { margin: 10px 0 4px; font-size: 1.25rem; color: var(--navy-2); }
.login-sub { margin: 0 0 16px; color: var(--muted); font-size: .85rem; }
.login-card .field { text-align: start; margin-bottom: 12px; }
.login-card .btn-gold { width: 100%; margin-top: 6px; }

/* ===== الحقول ===== */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: .78rem; color: var(--muted); font-weight: 700; }
.field input, .field select, .stack-form input, .stack-form select {
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: .95rem;
  background: var(--card); color: var(--ink); min-height: 44px; width: 100%; font-family: inherit;
}
.field input:focus, .field select:focus, .stack-form input:focus, .stack-form select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }

.form-msg { font-size: .85rem; font-weight: 700; min-height: 1.1em; margin-top: 8px; }
.form-msg.ok { color: var(--good); }
.form-msg.err { color: var(--gold); }

/* ===== المنطقة الرئيسية ===== */
.app-main { max-width: 1180px; margin: 0 auto; padding: 0 16px 40px; }
.controls { margin: 18px 0 8px; display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field.search { flex: 1 1 280px; }
.result-count { color: var(--muted); font-size: .85rem; padding: 4px 0; }

/* ===== شبكة الطلبات ===== */
.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 8px; }
.order-card { background: var(--card); border: 1px solid var(--line); border-inline-start: 5px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px; cursor: pointer; transition: box-shadow .15s, transform .1s; }
.order-card:hover { box-shadow: 0 10px 28px rgba(28,25,26,.16); transform: translateY(-2px); }
.order-card .oc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.order-card .oc-ref { font-weight: 900; color: var(--navy-2); font-size: 1rem; }
.order-card .oc-vehicle { color: var(--ink); font-size: .9rem; margin-top: 2px; }
.order-card .oc-row { display: flex; gap: 6px; margin-top: 8px; font-size: .82rem; color: var(--ink); }
.order-card .oc-row .lbl { color: var(--muted); font-weight: 700; min-width: 62px; }
.order-card .oc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.order-card .oc-total { font-weight: 900; color: var(--good); font-variant-numeric: tabular-nums; }

/* شارة الحالة */
.status-chip { display: inline-block; font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: #eef2f7; color: var(--navy-2); border: 1px solid var(--line); white-space: nowrap; }
.status-chip.s-awaiting { background: #eef2f7; }
.status-chip.s-processing { background: #e7f0ff; border-color: #bcd4ff; color: #1d4ed8; }
.status-chip.s-on_the_way { background: #fff3e0; border-color: #ffd699; }
.status-chip.s-at_yard { background: #ede7f6; border-color: #cdbef0; }
.status-chip.s-shipped { background: #e3f5ec; border-color: #a8e0c4; color: var(--good); }
.status-chip.s-delivered { background: var(--good); color: #fff; border-color: var(--good); }
.status-chip.s-cancelled { background: #f3f3f3; color: var(--muted); text-decoration: line-through; }

/* تلوين التقادم */
.aging-warn { background: var(--warn-bg); border-inline-start-color: var(--warn-line); }
.aging-late { background: var(--late-bg); border-inline-start-color: var(--late-line); animation: pulseLate 1.2s ease-in-out infinite; }
@keyframes pulseLate {
  0%, 100% { box-shadow: 0 0 0 0 rgba(191, 34, 41, .45); border-inline-start-color: var(--late-line); }
  50%      { box-shadow: 0 0 0 6px rgba(191, 34, 41, .05); border-inline-start-color: #ff5a60; }
}
.aging-tag { font-size: .66rem; font-weight: 900; padding: 2px 7px; border-radius: 6px; }
.aging-tag.warn { background: var(--warn-line); color: #5b4a00; }
.aging-tag.late { background: var(--gold); color: #fff; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* ===== لوحات المدير ===== */
.panel-cols { display: grid; grid-template-columns: 320px 1fr; gap: 16px; margin-top: 18px; }
.panel-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; margin-top: 18px; }
.panel-card.grow { margin-top: 0; }
.panel-cols .panel-card { margin-top: 0; }
.panel-card h3 { margin: 0 0 12px; color: var(--navy-2); font-size: 1.05rem; }
.stack-form { display: grid; gap: 10px; }

.data-table { border-collapse: collapse; width: 100%; min-width: 420px; font-size: .85rem; }
.data-table th { background: var(--navy); color: #fff; text-align: start; padding: 8px 10px; white-space: nowrap; font-size: .76rem; position: sticky; top: 0; }
.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tr:nth-child(even) td { background: #fafbfd; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* التحليلات */
.stats-body { margin-top: 18px; display: grid; gap: 16px; }
.stat-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-card { flex: 1 1 130px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px; text-align: center; }
.stat-card.alert { border-color: var(--gold); background: #fff8f8; }
.stat-n { display: block; font-size: 1.8rem; font-weight: 900; color: var(--navy-2); font-variant-numeric: tabular-nums; }
.stat-card.alert .stat-n { color: var(--gold); }
.stat-l { display: block; font-size: .76rem; color: var(--muted); margin-top: 4px; }
.stat-bars { display: grid; gap: 8px; }
.stat-bar-row { display: flex; align-items: center; gap: 10px; font-size: .82rem; }
.stat-bar-row .sb-lbl { flex: 0 0 130px; font-weight: 700; color: var(--navy-2); }
.stat-bar-row .sb-track { flex: 1 1 auto; background: #eef2f7; border-radius: 999px; height: 16px; overflow: hidden; }
.stat-bar-row .sb-fill { height: 100%; background: var(--gold); border-radius: 999px; }
.stat-bar-row .sb-n { flex: 0 0 36px; text-align: end; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ===== Modal التفاصيل ===== */
.overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(20,20,25,.55); display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; }
.overlay[hidden] { display: none; }
.detail-box { background: #fff; width: min(720px, 100%); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden; margin: auto; }
.detail-head { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, var(--navy-2), var(--navy)); color: #fff; padding: 14px 18px; }
.detail-head h3 { margin: 0; font-size: 1.1rem; }
.detail-x { background: transparent; border: 0; color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.detail-body { padding: 16px 18px; max-height: 80vh; overflow-y: auto; }

.det-sec { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.det-sec:last-child { border-bottom: 0; }
.det-sec h4 { margin: 0 0 10px; color: var(--gold); font-size: .95rem; }
.det-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: .88rem; }
.det-grid .k { color: var(--muted); font-weight: 700; }
.det-grid .v { color: var(--ink); font-weight: 600; }

/* خط زمني الحالات */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 22px 14px 0; border-inline-start: 2px solid var(--line); margin-inline-start: 6px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.tl-status { font-weight: 800; color: var(--navy-2); font-size: .9rem; }
.tl-meta { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.tl-note { font-size: .82rem; margin-top: 3px; }

/* أزرار تغيير الحالة */
.status-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-actions button { font-family: inherit; }
.note-input { width: 100%; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: .9rem; font-family: inherit; }
.rbac-note { font-size: .78rem; color: var(--muted); margin-top: 8px; }
.alert-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.alert-actions button { background: #fff3e0; border: 1px solid #ffb74d; color: #8a5200; border-radius: 8px; padding: 8px 12px; font-weight: 800; cursor: pointer; font-size: .82rem; font-family: inherit; }
.alert-actions button:hover { background: #ffe0b2; }

/* صندوق توثيق الزبون في التفاصيل */
.verify-box { border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.verify-box .vb-text { font-weight: 800; font-size: .9rem; line-height: 1.5; }
.verify-box.danger { background: var(--late-bg); border: 1px solid var(--late-line); color: var(--gold); }
.verify-box.ok { background: #e3f5ec; border: 1px solid #a8e0c4; color: var(--good); }

/* بطاقات الزبائن */
.cust-card { cursor: default; }
.cust-card:hover { transform: none; box-shadow: var(--shadow); }
.cust-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* ===== تتبّع الدفع ===== */
.pay-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pay-chip { display: inline-block; font-size: .72rem; font-weight: 800; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.pay-chip.p-unpaid { background: var(--late-bg); color: var(--gold); border-color: var(--late-line); }
.pay-chip.p-partial { background: var(--warn-bg); color: #5b4a00; border-color: var(--warn-line); }
.pay-chip.p-paid { background: #e3f5ec; color: var(--good); border-color: #a8e0c4; }
.pay-amount { font-weight: 800; color: var(--navy-2); font-variant-numeric: tabular-nums; font-size: .9rem; }
.pay-form { display: grid; gap: 8px; margin-bottom: 12px; }
.pay-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-fields .pay-input { flex: 1 1 120px; }
.pay-input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .9rem; font-family: inherit; background: var(--card); color: var(--ink); min-height: 44px; width: 100%; }
.pay-input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.pay-form .btn-gold { justify-self: start; }
.pay-list { display: grid; gap: 6px; }
.pay-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; font-size: .82rem; }
.pay-row .pr-amount { font-weight: 900; color: var(--good); font-variant-numeric: tabular-nums; }
.pay-row .pr-method { font-weight: 700; color: var(--navy-2); }
.pay-row .pr-meta { color: var(--muted); margin-inline-start: auto; }
.pay-row .pr-note { flex: 1 1 100%; color: var(--ink); }

/* ===== المرفقات ===== */
.att-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.att-file { flex: 1 1 200px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: .85rem; font-family: inherit; background: var(--card); color: var(--ink); }
.att-file:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.att-tile { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.att-link { display: block; text-decoration: none; color: var(--navy-2); }
.att-thumb { width: 100%; height: 88px; object-fit: cover; display: block; background: #eef2f7; }
.att-icon { height: 88px; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; background: #eef2f7; }
.att-name { padding: 6px 8px; font-size: .72rem; font-weight: 700; word-break: break-word; line-height: 1.3; }
.att-del { position: absolute; inset-block-start: 4px; inset-inline-end: 4px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: rgba(28,25,26,.7); color: #fff; font-size: .9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.att-del:hover { background: var(--gold); }

/* ===== زر تفعيل الإشعارات ===== */
.btn-notify { white-space: nowrap; }
.btn-notify[hidden] { display: none; }

/* ===== الدردشة ===== */
.chat-box { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.chat-msgs { max-height: 260px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fafbfd; }
.chat-empty { color: var(--muted); font-size: .85rem; text-align: center; padding: 18px; }
.chat-msg { max-width: 78%; padding: 8px 12px; border-radius: 12px; font-size: .88rem; line-height: 1.5; }
.chat-msg .cm-who { display: block; font-size: .68rem; font-weight: 800; margin-bottom: 2px; opacity: .8; }
.chat-msg.staff { align-self: flex-start; background: var(--gold-soft); border: 1px solid #e7a9ab; }
.chat-msg.customer { align-self: flex-end; background: #e7f0ff; border: 1px solid #bcd4ff; }
.chat-time { font-size: .64rem; color: var(--muted); margin-top: 3px; }
.chat-send { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-send input { flex: 1 1 auto; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .9rem; font-family: inherit; }
.chat-send button { flex: none; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 20px; inset-inline: 0; margin: 0 auto; width: max-content; max-width: 90%; background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 700; font-size: .9rem; box-shadow: var(--shadow); z-index: 1100; text-align: center; }
.toast[hidden] { display: none; }
.toast.err { background: var(--gold); }
.toast.ok { background: var(--good); }

/* ===== شارة عدّاد على التبويب (الرسائل) ===== */
.tab { position: relative; }
.tab-badge { display: inline-block; margin-inline-start: 6px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #fff; font-size: .66rem; font-weight: 900; text-align: center; vertical-align: middle; }
.tab-badge[hidden] { display: none; }

/* ===== الرئيسية (KPIs) ===== */
.home-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 18px; }
.kpi-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 16px; text-align: center; border-top: 4px solid var(--navy-2); }
.kpi-card.alert { border-top-color: var(--gold); background: #fff8f8; }
.kpi-card.accent { border-top-color: var(--gold); }
.kpi-card.good { border-top-color: var(--good); }
.kpi-n { display: block; font-size: 1.9rem; font-weight: 900; color: var(--navy-2); font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-card.alert .kpi-n { color: var(--gold); }
.kpi-card.good .kpi-n { color: var(--good); }
.kpi-l { display: block; font-size: .78rem; color: var(--muted); margin-top: 6px; font-weight: 700; }

.home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
.home-cols .panel-card.grow { margin-top: 18px; }
.home-list { display: grid; gap: 8px; }
.home-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; cursor: pointer; transition: border-color .12s, background .12s; }
.home-item:hover { border-color: var(--gold); background: #fff; }
.home-item.late { border-inline-start: 4px solid var(--late-line); background: var(--late-bg); }
.home-item .hi-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-item .hi-ttl { font-weight: 800; color: var(--navy-2); font-size: .88rem; }
.home-item .hi-sub { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }

/* ===== مركز الرسائل ===== */
.inbox-list { display: grid; gap: 8px; margin-top: 8px; }
.inbox-row { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; cursor: pointer; transition: border-color .12s, transform .1s; }
.inbox-row:hover { border-color: var(--gold); transform: translateY(-1px); }
.inbox-row.has-unread { border-inline-start: 4px solid var(--gold); background: #fffafa; }
.inbox-row .ir-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inbox-row .ir-who { font-weight: 800; color: var(--navy-2); font-size: .9rem; }
.inbox-row .ir-time { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.inbox-row .ir-veh { font-size: .76rem; color: var(--muted); margin-top: 3px; }
.inbox-row .ir-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.inbox-row .ir-preview { font-size: .82rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.inbox-unread { flex: none; min-width: 20px; height: 20px; line-height: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #fff; font-size: .68rem; font-weight: 900; text-align: center; }
.thread-view { display: grid; gap: 10px; margin-top: 8px; }
.thread-back { justify-self: start; }
.thread-view .chat-box { background: #fff; }
.thread-view .chat-msgs { max-height: 52vh; }

/* ===== الاستفسارات (عملاء محتملون) ===== */
.inq-row .ir-who.lead { font-size: .96rem; color: var(--gold); }
.inq-chip { display: inline-block; font-size: .68rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #eef2f7; color: var(--navy-2); border: 1px solid var(--line); white-space: nowrap; }
.inq-chip.iq-new { background: var(--late-bg); color: var(--gold); border-color: var(--gold-soft); }
.inq-chip.iq-handled { background: #e7f0ff; color: #1d4ed8; border-color: #bcd4ff; }
.inq-chip.iq-converted { background: #e3f5ec; color: var(--good); border-color: #a8e0c4; }
.inq-chip.iq-closed { background: #f3f3f3; color: var(--muted); border-color: var(--line); }
.inq-lead { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.inq-lead-id { display: flex; flex-direction: column; gap: 3px; line-height: 1.2; min-width: 0; }
.inq-lead-id .il-name { font-weight: 900; font-size: 1.05rem; color: var(--ink); }
.inq-lead-id .il-phone { font-weight: 800; font-size: .92rem; color: var(--gold); direction: ltr; text-align: start; }
.wa-link { flex: none; background: var(--good); color: #fff; text-decoration: none; padding: 9px 16px; border-radius: 10px; font-weight: 800; font-size: .9rem; }
.wa-link:hover { opacity: .9; }
.inq-status-bar { display: flex; align-items: center; gap: 10px; }
.inq-status-bar label { font-weight: 800; font-size: .85rem; color: var(--navy-2); }
.inq-status-bar select { flex: 1 1 auto; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: .9rem; background: #fff; color: var(--ink); }

/* ===== العروض (الحملات التسويقية) ===== */
.stack-form textarea { width: 100%; box-sizing: border-box; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: .92rem; background: #fff; color: var(--ink); resize: vertical; line-height: 1.6; }
.stack-form textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.camp-templates { display: flex; flex-wrap: wrap; gap: 8px; }
.camp-templates .btn-sm { flex: 1 1 auto; }
.camp-history { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow: auto; }
.camp-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.camp-row-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.camp-ttl { font-weight: 900; color: var(--ink); font-size: 1rem; }
.camp-aud { flex: none; font-size: .68rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--late-bg); color: var(--gold); border: 1px solid var(--gold-soft); white-space: nowrap; }
.camp-body-preview { color: var(--navy-2); font-size: .9rem; line-height: 1.6; white-space: pre-wrap; margin-bottom: 8px; }
.camp-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.camp-sent { font-weight: 800; color: var(--good); }

/* ===== استجابة الجوّال ===== */
@media (max-width: 760px) {
  .panel-cols { grid-template-columns: 1fr; }
  .home-cols { grid-template-columns: 1fr; }
  .det-grid { grid-template-columns: 1fr; }
  .brand img { width: 46px; height: 46px; }
  .brand-text .ar { font-size: 1.1rem; }
  .stat-bar-row .sb-lbl { flex: 0 0 96px; }
}
