/* =========================================================
   نقاء المتحدة — الثيم الجديد (أزرق/أبيض، خط القاهرة)
   يُحمَّل بعد كل الأنماط الأخرى ويعيد تعريف الألوان والمكوّنات
   دون أي تغيير في الوظائف أو البنية.
   ========================================================= */

/* خط القاهرة مضمّن محلياً حتى لا يظهر أي خط بديل قبل تحميله */
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 800;
  font-display: block;
  src: url("fonts/cairo-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 800;
  font-display: block;
  src: url("fonts/cairo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --nq-ink: #0b1f3a;
  --nq-ink-2: #34476a;
  --nq-muted: #55677f;
  --nq-muted-2: #6b7d97;
  --nq-blue: #1668e3;
  --nq-blue-dark: #0d4fb0;
  --nq-navy: #0b2b5e;
  --nq-tint: #eaf2fd;
  --nq-tint-2: #f5f9ff;
  --nq-bg: #f7fafe;
  --nq-surface: #ffffff;
  --nq-line: #e7eefa;
  --nq-line-2: #dbe6f5;
  --nq-line-3: #cfe0f8;
  --nq-ok-bg: #dff0e4;
  --nq-ok: #22683c;
  --nq-danger-bg: #fdf1f3;
  --nq-danger: #b4384e;
  --nq-idle-bg: #e9eef6;
  --nq-idle: #46587a;
  --nq-warn-bg: #fff4dc;
  --nq-warn: #8a5a00;
  --nq-shadow: 0 8px 28px rgba(11, 31, 58, 0.08);

  /* إعادة تعريف متغيرات التطبيق الأصلية */
  --bg: var(--nq-bg);
  --surface: var(--nq-surface);
  --surface-muted: var(--nq-tint-2);
  --ink: var(--nq-ink);
  --muted: var(--nq-muted);
  --line: var(--nq-line);
  --brand: var(--nq-blue);
  --brand-strong: var(--nq-blue-dark);
  --brand-soft: var(--nq-tint);
  --sidebar: var(--nq-navy);
  --sidebar-muted: #8fb0e0;
  --blue: var(--nq-blue);
  --rose: var(--nq-danger);
  --green: var(--nq-ok);
  --gold: #f1b34a;
  --shadow: var(--nq-shadow);
  --radius: 12px;
  --font: "Cairo";
  --text-muted: var(--nq-muted);
}

html {
  font-family: var(--font);
}

body {
  background: var(--nq-bg);
  color: var(--nq-ink);
  font-family: var(--font);
  font-weight: 500;
}

h1,
h2,
h3,
strong,
b,
th {
  color: var(--nq-ink);
}

button,
input,
select,
textarea {
  font-family: var(--font);
}

/* ---------- الهيكل والقائمة الجانبية (يمين في RTL) ---------- */
.app-shell {
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  background: var(--nq-navy);
  color: #d5e4f8;
  gap: 18px;
  padding: 18px 12px;
}

.brand strong {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.brand span {
  color: #8fb0e0;
  font-size: 11px;
}

.brand-logo {
  border-radius: 10px;
}

.nav-list {
  gap: 2px;
}

.nav-button {
  border: 0;
  border-radius: 10px;
  color: #d5e4f8;
  font-size: 13.5px;
  font-weight: 600;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  min-height: 40px;
  padding: 8px 11px;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
  color: #fff;
}

.nav-button.active,
.nav-button.active:hover {
  background: #fff;
  border-color: transparent;
  color: var(--nq-navy);
  font-weight: 800;
}

.nav-icon {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  font-size: 11px;
  height: 22px;
  width: 22px;
}

.nav-button.active .nav-icon {
  background: var(--nq-tint);
  color: var(--nq-navy);
}

.nav-count {
  background: #8fb0e0;
  color: var(--nq-navy);
  font-size: 10.5px;
  font-weight: 800;
  min-width: 22px;
  padding: 1px 7px;
}

.nav-button.active .nav-count {
  background: var(--nq-blue);
  color: #fff;
}

.sidebar-footer {
  border-top-color: rgba(255, 255, 255, 0.12);
}

.sidebar .ghost-button {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #d5e4f8;
  font-size: 12.5px;
  font-weight: 600;
  min-height: 36px;
}

.sidebar .ghost-button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ---------- الشريط العلوي ---------- */
.main {
  padding: 18px 22px 28px;
}

.topbar {
  align-items: center;
  background: var(--nq-surface);
  border: 1px solid var(--nq-line);
  border-radius: 14px;
  margin-bottom: 18px;
  padding: 14px 18px;
}

.topbar h1 {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  margin: 0;
}

.eyebrow {
  color: var(--nq-blue);
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 2px;
}

.user-session {
  background: var(--nq-surface);
  border-color: var(--nq-line-2);
  border-radius: 10px;
  min-height: 38px;
}

.user-session strong {
  font-size: 12.5px;
}

.user-session span {
  color: var(--nq-muted);
  font-size: 11px;
}

.search-box input {
  background: var(--nq-bg);
  border-color: var(--nq-line-2);
  border-radius: 999px;
  font-size: 12.5px;
  min-height: 36px;
  padding: 6px 14px;
}

.search-box input:focus {
  background: #fff;
  border-color: var(--nq-blue);
  box-shadow: 0 0 0 3px var(--nq-line-3);
}

.icon-button {
  border-color: var(--nq-line-2);
  border-radius: 10px;
  min-height: 36px;
}

.icon-button small {
  background: var(--nq-danger);
}

/* ---------- الأزرار ---------- */
.primary-button,
.secondary-button,
.danger-button,
.main .ghost-button,
.import-button {
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  min-height: 36px;
  padding: 8px 15px;
}

.primary-button {
  background: var(--nq-blue);
  box-shadow: none;
  color: #fff;
}

.primary-button:hover {
  background: var(--nq-blue-dark);
}

.secondary-button,
.main .ghost-button,
.import-button {
  background: #fff;
  border: 1px solid var(--nq-line-2);
  color: var(--nq-ink);
}

.secondary-button:hover,
.main .ghost-button:hover,
.import-button:hover {
  background: var(--nq-tint-2);
  border-color: var(--nq-line-3);
}

.danger-button {
  background: #fff;
  border: 1px solid #f3d3d8;
  color: var(--nq-danger);
}

.danger-button:hover {
  background: var(--nq-danger-bg);
}

.mini-button,
a.mini-button {
  background: #fff;
  border: 1px solid var(--nq-line-2);
  border-radius: 8px;
  color: var(--nq-ink);
  font-size: 12px;
  font-weight: 600;
  min-height: 32px;
  padding: 6px 12px;
}

.mini-button:hover {
  background: var(--nq-tint-2);
  border-color: var(--nq-line-3);
}

.mini-button.primary {
  background: var(--nq-blue);
  border-color: var(--nq-blue);
  color: #fff;
}

.mini-button.primary:hover {
  background: var(--nq-blue-dark);
  border-color: var(--nq-blue-dark);
}

.mini-button.danger {
  background: #fff;
  border-color: #f3d3d8;
  color: var(--nq-danger);
}

.mini-button.warn {
  background: var(--nq-warn-bg);
  border-color: #f4dfae;
  color: var(--nq-warn);
}

select.mini-button {
  padding-left: 26px;
}

/* ---------- البطاقات والألواح ---------- */
.metric-card,
.panel,
.list-card,
.conversation-card,
.employee-card,
.user-card,
.maintenance-card,
.notification-row,
.customer-summary,
.chat-window,
.schedule-summary {
  background: var(--nq-surface);
  border: 1px solid var(--nq-line);
  border-radius: 14px;
  box-shadow: none;
}

.list-card,
.employee-card,
.user-card,
.maintenance-card,
.notification-row,
.conversation-card {
  border-radius: 12px;
}

.panel {
  padding: 16px 17px;
}

.panel-header h2,
.panel-header h3 {
  font-size: 15px;
  font-weight: 800;
}

.panel-header .muted.small,
.panel-header p {
  color: var(--nq-muted);
}

.list-card h3,
.employee-card h3,
.user-card h3 {
  font-size: 14px;
  font-weight: 700;
}

.muted,
.muted.small,
.metric-card span,
.metric-card small,
.list-card p,
.panel p,
.meta-list,
.meta-list span,
td .muted,
td .small {
  color: var(--nq-muted);
}

.small {
  font-size: 11.5px;
}

.meta-list {
  color: var(--nq-muted);
  font-size: 11.5px;
}

/* المؤشرات */
.metric-card {
  min-height: 96px;
  padding: 15px 17px;
}

.metric-card span {
  color: var(--nq-muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.metric-card strong {
  font-size: 26px;
  font-weight: 800;
}

.metric-card small {
  color: var(--nq-muted);
  font-size: 11.5px;
  margin-top: 8px;
}

.metric-card.alert,
.nq-kpi.alert {
  background: var(--nq-navy);
  border-color: var(--nq-navy);
  color: #fff;
}

.metric-card.alert span,
.metric-card.alert small,
.nq-kpi.alert small {
  color: #a8c4ea;
}

.metric-card.alert strong,
.nq-kpi.alert b {
  color: #fff;
}

.metric-card .danger,
.nq-kpi .danger {
  color: var(--nq-danger);
}

/* البطل في لوحة التشغيل */
.ops-hero {
  background: var(--nq-navy);
  border-radius: 14px;
  box-shadow: none;
  min-height: 0;
  padding: 20px 22px;
}

.ops-hero::after {
  display: none;
}

.ops-hero .eyebrow {
  color: #a8c4ea;
}

.ops-hero h2 {
  font-size: 20px;
  font-weight: 800;
}

.ops-hero .secondary-button {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.ops-hero .secondary-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ---------- الشارات ---------- */
.badge,
.priority,
.channel-chip,
.due-chip {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  min-height: 22px;
  padding: 3px 10px;
}

.badge.new,
.badge.pending {
  background: var(--nq-tint);
  color: var(--nq-blue);
}

.badge.assigned,
.badge.scheduled,
.badge.in-progress {
  background: var(--nq-ok-bg);
  color: var(--nq-ok);
}

.badge.complete {
  background: var(--nq-idle-bg);
  color: var(--nq-idle);
}

.badge.delayed,
.badge.cancelled {
  background: var(--nq-danger-bg);
  color: var(--nq-danger);
}

/* ---------- الفلاتر والشرائح ---------- */
.segmented-control {
  background: transparent;
  border: 0;
  gap: 6px;
  padding: 0;
}

.segment-button {
  background: #fff;
  border: 1px solid var(--nq-line-2);
  border-radius: 999px;
  color: var(--nq-idle);
  font-size: 12px;
  font-weight: 500;
  min-height: 32px;
  padding: 6px 13px;
}

.segment-button.active {
  background: var(--nq-blue);
  border-color: var(--nq-blue);
  box-shadow: none;
  color: #fff;
  font-weight: 700;
}

.nq-chips {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.nq-chip {
  background: #fff;
  border: 1px solid var(--nq-line-2);
  border-radius: 999px;
  color: var(--nq-idle);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  min-height: 32px;
  padding: 6px 13px;
  white-space: nowrap;
}

.nq-chip b {
  font-weight: 700;
  margin-inline-start: 4px;
}

.nq-chip.is-active {
  background: var(--nq-blue);
  border-color: var(--nq-blue);
  color: #fff;
  font-weight: 700;
}

.nq-chips .spacer {
  flex: 1;
  min-width: 80px;
}

.nq-search {
  background: var(--nq-bg);
  border: 1px solid var(--nq-line-2);
  border-radius: 999px;
  color: var(--nq-ink);
  font-size: 12.5px;
  min-height: 34px;
  min-width: 220px;
  padding: 6px 14px;
}

.nq-search:focus {
  background: #fff;
  border-color: var(--nq-blue);
  box-shadow: 0 0 0 3px var(--nq-line-3);
  outline: none;
}

.nq-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: 1.25fr repeat(3, minmax(0, 1fr));
}

.nq-kpi {
  background: var(--nq-surface);
  border: 1px solid var(--nq-line);
  border-radius: 14px;
  padding: 14px 16px;
}

.nq-kpi small {
  color: var(--nq-muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.nq-kpi b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
}

.nq-kpi .row {
  align-items: baseline;
  display: flex;
  gap: 8px;
}

/* ---------- الحقول ---------- */
.field label,
.compact-field span {
  color: var(--nq-ink-2);
  font-size: 12.5px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.compact-field input,
.compact-field select {
  border-color: var(--nq-line-2);
  border-radius: 8px;
  font-size: 13px;
  min-height: 36px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.compact-field input:focus {
  border-color: var(--nq-blue);
  box-shadow: 0 0 0 3px var(--nq-line-3);
}

/* ---------- الجداول ---------- */
table {
  border-collapse: collapse;
  width: 100%;
}

thead th {
  background: #fbfdff;
  border-bottom: 1px solid var(--nq-line);
  color: var(--nq-muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 10px 14px;
  text-align: right;
}

tbody td {
  border-bottom: 1px solid #eef4fc;
  color: var(--nq-ink);
  font-size: 13px;
  padding: 12px 14px;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fbfdff;
}

td .badge {
  white-space: nowrap;
}

/* ---------- عناصر متفرقة ---------- */
.timeline-item {
  border-color: var(--nq-line-3);
}

.timeline-item::before {
  background: var(--nq-blue);
}

.toast {
  background: var(--nq-navy);
  border: 0;
  border-radius: 12px;
  box-shadow: var(--nq-shadow);
  color: #fff;
}

.dialog {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(11, 31, 58, 0.18);
}

.dialog-body {
  border-radius: 16px;
}

.conversation-card.active {
  background: var(--nq-tint-2);
  border-color: var(--nq-blue);
  box-shadow: inset 0 0 0 1px var(--nq-blue);
}

.message {
  border-radius: 10px;
  font-size: 12.5px;
}

.endpoint-code {
  background: var(--nq-tint-2);
  border: 1px solid var(--nq-line);
  border-radius: 8px;
  color: var(--nq-ink-2);
  font-size: 12px;
}

.empty-state {
  background: var(--nq-tint-2);
  border: 1px dashed var(--nq-line-3);
  border-radius: 12px;
  color: var(--nq-muted);
}

/* ---------- شاشة الدخول ---------- */
.login-screen {
  background: var(--nq-bg);
}

.login-panel {
  background: #fff;
  border: 1px solid var(--nq-line);
  border-radius: 16px;
  box-shadow: var(--nq-shadow);
}

.login-brand .brand-logo {
  box-shadow: none;
}

.login-brand strong {
  color: var(--nq-ink);
}

.login-brand span {
  color: var(--nq-muted);
}

/* ---------- صفحة طلبات زد (بعد تحويل الجدول إلى بطاقات) ---------- */
#appView .zid-hero {
  background: var(--nq-navy) !important;
  border-color: var(--nq-navy) !important;
  border-radius: 14px !important;
  box-shadow: none !important;
}

#appView .zid-hero h2 {
  font-size: 20px !important;
}

#appView .zid-hero-actions .secondary-button {
  color: var(--nq-navy) !important;
}

#appView .zid-filter-panel,
#appView .zid-order-card {
  border-color: var(--nq-line) !important;
  border-radius: 14px !important;
  box-shadow: none !important;
}

#appView .zid-order-card:hover {
  border-color: var(--nq-line-3) !important;
}

#appView .zid-order-card.is-done {
  opacity: 0.72;
}

#appView .zid-order-card.is-done:hover {
  opacity: 1;
}

#appView .zid-order-card.is-unassigned {
  border-right: 3px solid var(--nq-blue) !important;
}

#appView .zid-order-main {
  background: var(--nq-tint-2) !important;
  border-bottom-color: var(--nq-line) !important;
}

#appView .zid-order-id span {
  color: var(--nq-blue) !important;
  font-size: 12px !important;
  font-weight: 700;
}

#appView .zid-order-id strong {
  color: var(--nq-ink) !important;
  font-size: 17px !important;
}

#appView .zid-order-id small {
  color: var(--nq-muted);
  font-size: 12px;
}

#appView .zid-order-badges .badge {
  font-size: 11px !important;
  min-height: 24px !important;
  padding: 3px 10px !important;
}

#appView .zid-info-item {
  background: #fff !important;
  border: 1px solid var(--nq-line) !important;
  border-radius: 10px !important;
  min-height: 62px !important;
}

#appView .zid-info-item span {
  color: var(--nq-muted);
  font-size: 11.5px;
  font-weight: 600;
}

#appView .zid-info-item strong {
  color: var(--nq-ink);
  font-size: 12.5px !important;
}

#appView .zid-order-actions {
  background: #fbfdff !important;
  border-top-color: var(--nq-line) !important;
}

#appView .zid-order-controls select,
#appView .zid-order-controls .mini-button,
#appView .zid-order-actions .mini-button,
#appView .compact-field input {
  border-radius: 8px !important;
  min-height: 36px !important;
}

#appView .zid-stats-grid .metric-card {
  border-radius: 14px !important;
}

/* ---------- الجوال ---------- */
@media (max-width: 980px) {
  .nq-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .main {
    padding: 14px 14px 28px;
  }

  .topbar {
    border-radius: 12px;
    padding: 12px 14px;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .nq-kpis {
    grid-template-columns: 1fr;
  }

  .nq-search {
    min-width: 0;
    width: 100%;
  }
}

/* بطاقة موعد الصيانة: تاريخ بارز على خلفية كحلية */
.maintenance-card .maintenance-date {
  background: var(--nq-navy);
  border-radius: 12px;
  color: #fff;
}

.maintenance-card .maintenance-date strong {
  color: #fff;
}

.maintenance-card .maintenance-date span {
  color: #a8c4ea;
}

/* نصوص ثانوية أوضح داخل البطاقات والجداول */
.timeline-item p,
.timeline-item span,
.list-card .muted,
.notification-row .muted,
.conversation-card .muted,
.message small,
.field label {
  color: var(--nq-muted);
}

.metric-card strong,
.nq-kpi b,
.list-card h3,
.panel-header h2 {
  color: var(--nq-ink);
}

.nq-chip {
  color: var(--nq-idle);
  font-weight: 600;
}

.badge.complete {
  color: var(--nq-idle);
}

/* ---------- العناوين فوق الخلفيات الكحلية تبقى بيضاء ---------- */
.ops-hero h2,
.ops-hero .eyebrow,
.ops-hero p,
.toast strong,
.toast h3,
.toast p,
.sidebar strong,
.sidebar h3,
.metric-card.alert strong,
.metric-card.alert span,
.nq-kpi.alert b,
.nq-kpi.alert small,
.maintenance-card .maintenance-date strong,
#appView .zid-hero h2,
#appView .zid-hero .eyebrow,
#appView .zid-hero p {
  color: #fff;
}

/* ---------- القائمة الجانبية: مجموعات وبطاقة المستخدم ---------- */
.nav-group {
  color: #6f92c7;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 10px 0 2px;
  padding: 0 12px;
  text-transform: uppercase;
}

.nav-group:first-child {
  margin-top: 0;
}

.sidebar-user {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: 38px minmax(0, 1fr);
  margin-top: auto;
  min-height: 0;
  padding: 10px;
}

.sidebar-user .avatar {
  align-items: center;
  background: var(--nq-blue);
  border-radius: 10px;
  color: #fff;
  display: inline-flex;
  font-size: 15px;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.sidebar-user .user-meta {
  min-width: 0;
}

.sidebar-user strong {
  color: #fff;
  display: block;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user span {
  color: #8fb0e0;
  display: block;
  font-size: 11px;
}

.sidebar-user .user-actions {
  display: grid;
  gap: 6px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sidebar-user .mini-button {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #e6efff;
  font-size: 12px;
  min-height: 32px;
  padding: 5px 8px;
}

.sidebar-user .mini-button:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.sidebar-user .mini-button.danger {
  background: rgba(180, 56, 78, 0.18);
  border-color: rgba(255, 150, 170, 0.35);
  color: #ffd6de;
}

.sidebar-footer {
  margin-top: 12px;
}

/* ---------- الشريط العلوي: عناصر متناسقة ---------- */
.topbar-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.topbar-actions .sync-status {
  align-items: center;
  background: var(--nq-tint-2);
  border: 1px solid var(--nq-line-2);
  border-radius: 999px;
  color: var(--nq-ink-2);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.topbar-actions .sync-dot {
  background: var(--nq-ok);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--nq-ok-bg);
  height: 8px;
  width: 8px;
}

.topbar-actions .sync-status.saving .sync-dot,
.topbar-actions .sync-status.checking .sync-dot {
  background: var(--nq-blue);
  box-shadow: 0 0 0 3px var(--nq-tint);
}

.topbar-actions .sync-status.failed .sync-dot {
  background: var(--nq-danger);
  box-shadow: 0 0 0 3px var(--nq-danger-bg);
}

.topbar-actions .search-box input {
  min-width: min(340px, 34vw);
}

.topbar-actions .icon-button {
  background: #fff;
  border-radius: 999px;
  height: 36px;
  min-height: 36px;
  min-width: 36px;
  padding: 0;
  width: 36px;
}

.topbar-actions .icon-button small {
  right: -6px;
  top: -6px;
}

@media (max-width: 760px) {
  .sidebar-user {
    display: none;
  }

  body.mobile-nav-open .sidebar-user {
    display: grid;
    margin: 8px 0 0;
  }
}

/* بطاقة المستخدم: الاسم قابل للضغط لفتح الملف الشخصي */
.sidebar-user {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar-user .user-identity {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 38px minmax(0, 1fr);
  margin: -4px;
  padding: 4px;
  text-align: right;
  width: calc(100% + 8px);
}

.sidebar-user .user-identity:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-user .user-identity:hover strong {
  text-decoration: underline;
  text-decoration-color: #8fb0e0;
  text-underline-offset: 3px;
}

.sidebar-user .user-meta {
  display: block;
}

.sidebar-user .user-actions {
  grid-template-columns: 1fr;
}

/* ---------- صفحة الدخول: لوحة كحلية + نموذج أبيض ---------- */
body.auth-mode {
  background: #fff;
  display: block;
}

.login-screen {
  background: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 100vh;
  padding: 0;
  place-items: stretch;
}

.login-side {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 40px 24px;
}

.login-screen .login-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 8px;
  max-width: 360px;
  padding: 0;
  width: 100%;
}

.login-panel h1 {
  color: var(--nq-ink);
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}

.login-subtitle {
  color: var(--nq-muted);
  font-size: 13px;
  margin: 0 0 18px;
}

.login-form {
  gap: 14px;
}

.login-form .field label {
  font-size: 12.5px;
}

.login-form .field input {
  background: var(--nq-tint-2);
  border-color: var(--nq-line-2);
  min-height: 42px;
}

.login-form .field input:focus {
  background: #fff;
}

.login-form .primary-button {
  border-radius: 10px;
  font-size: 14px;
  margin-top: 4px;
  min-height: 44px;
}

.login-hero {
  background:
    radial-gradient(520px 420px at 22% 78%, rgba(22, 104, 227, 0.55), transparent 62%),
    radial-gradient(380px 320px at 78% 18%, rgba(143, 176, 224, 0.22), transparent 60%),
    linear-gradient(160deg, #061a3a 0%, var(--nq-navy) 55%, #08234d 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  overflow: hidden;
  padding: 34px 40px;
  position: relative;
}

.login-hero-brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.login-hero-brand .brand-logo {
  background: #fff;
  border-radius: 12px;
  height: 50px;
  object-fit: contain;
  padding: 5px;
  width: 50px;
}

.login-hero-brand strong {
  color: #fff;
  display: block;
  font-size: 16px;
  font-weight: 800;
}

.login-hero-brand span {
  color: #a8c4ea;
  display: block;
  font-size: 12px;
}

.login-hero-copy {
  max-width: 520px;
}

.login-hero-copy h2 {
  color: #fff;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 800;
  line-height: 1.5;
  margin: 0 0 18px;
}

.login-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-hero-chips span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #e6efff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  white-space: nowrap;
}

.login-hero-footer {
  color: #8fb0e0;
  direction: ltr;
  font-size: 12px;
  margin: 0;
  text-align: right;
}

@media (max-width: 860px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-hero {
    gap: 22px;
    min-height: 0;
    order: -1;
    padding: 24px 20px;
  }

  .login-hero-copy h2 {
    font-size: 21px;
    margin-bottom: 12px;
  }

  .login-hero-footer {
    display: none;
  }

  .login-side {
    padding: 28px 20px 40px;
  }
}

/* صفحة الطلبات تمتد على كامل عرض الشاشة */
#appView [data-zid-orders-addon="true"].zid-page {
  max-width: none !important;
  width: 100% !important;
}

/* ---------- نافذة المحادثة بأسلوب واتساب ---------- */
.dialog-body:has(.wa-chat) {
  overflow: hidden;
  padding: 0;
}

.dialog-body:has(.wa-chat) .close-dialog {
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  color: #fff;
  left: 12px;
  top: 12px;
  z-index: 2;
}

.wa-chat {
  background: #efeae2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(78vh, 680px);
}

.wa-head {
  align-items: center;
  background: var(--nq-navy);
  color: #fff;
  display: flex;
  gap: 12px;
  padding: 12px 16px 12px 56px;
}

.wa-avatar {
  align-items: center;
  background: var(--nq-blue);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: none;
  font-size: 17px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.wa-title {
  flex: 1;
  min-width: 0;
}

.wa-title strong {
  color: #fff;
  display: block;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-title span {
  color: #a8c4ea;
  display: block;
  font-size: 11.5px;
}

.wa-window {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  white-space: nowrap;
}

.wa-window.open {
  background: rgba(37, 211, 102, 0.18);
  color: #9ff0bd;
}

.wa-window.closed {
  background: rgba(255, 190, 90, 0.18);
  color: #ffd699;
}

.wa-body {
  background-color: #efeae2;
  background-image:
    radial-gradient(rgba(11, 43, 94, 0.05) 1px, transparent 1px),
    radial-gradient(rgba(11, 43, 94, 0.04) 1px, transparent 1px);
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding: 16px 14px;
}

.wa-day {
  display: flex;
  justify-content: center;
  margin: 6px 0 8px;
}

.wa-day span {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
  color: #54656f;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
}

.wa-msg {
  border-radius: 10px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  font-size: 13.5px;
  line-height: 1.6;
  max-width: min(78%, 520px);
  padding: 7px 10px 6px;
  position: relative;
}

.wa-msg p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.wa-msg small {
  color: #667781;
  direction: ltr;
  display: flex;
  float: left;
  font-size: 10.5px;
  gap: 4px;
  margin: 6px 0 0 4px;
  align-items: center;
}

.wa-msg.in {
  align-self: flex-end;
  background: #fff;
  border-top-right-radius: 2px;
  color: #111b21;
}

.wa-msg.out {
  align-self: flex-start;
  background: #d9fdd3;
  border-top-left-radius: 2px;
  color: #111b21;
}

.wa-msg.in::before,
.wa-msg.out::before {
  border-style: solid;
  content: "";
  height: 0;
  position: absolute;
  top: 0;
  width: 0;
}

.wa-msg.in::before {
  border-color: #fff transparent transparent transparent;
  border-width: 10px 0 0 10px;
  right: -8px;
}

.wa-msg.out::before {
  border-color: #d9fdd3 transparent transparent transparent;
  border-width: 10px 10px 0 0;
  left: -8px;
}

.wa-tick {
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: -2px;
}

.wa-tick.sent {
  color: #8696a0;
}

.wa-tick.read {
  color: #53bdeb;
}

.wa-tick.pending {
  color: #8696a0;
  letter-spacing: 0;
}

.wa-tick.failed {
  color: var(--nq-danger);
  letter-spacing: 0;
}

.wa-empty {
  align-self: center;
  background: #fff8d6;
  border-radius: 8px;
  color: #6b5a1a;
  font-size: 12.5px;
  margin: auto;
  padding: 8px 14px;
}

.wa-compose {
  align-items: flex-end;
  background: #f0f2f5;
  border-top: 1px solid #e2e6ea;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
}

.wa-compose textarea {
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 22px;
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  max-height: 140px;
  min-height: 44px;
  padding: 10px 16px;
  resize: none;
}

.wa-compose textarea:focus {
  border-color: var(--nq-blue);
  box-shadow: 0 0 0 3px var(--nq-line-3);
  outline: none;
}

.wa-send {
  align-items: center;
  background: var(--nq-blue);
  border: 0;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: none;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.wa-send svg {
  transform: scaleX(-1);
}

.wa-send:hover {
  background: var(--nq-blue-dark);
}

@media (max-width: 640px) {
  .wa-chat {
    height: min(84vh, 720px);
  }

  .wa-msg {
    max-width: 88%;
  }

  .wa-window {
    display: none;
  }
}

/* عناصر القائمة روابط حقيقية */
a.nav-button {
  text-decoration: none;
}

a.nav-button:hover {
  text-decoration: none;
}

/* ---------- رأس المحادثة: عدّاد نافذة الـ24 ساعة ---------- */
.wa-head {
  background: linear-gradient(90deg, #0a2450, var(--nq-navy));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 18px 12px 56px;
}

.wa-avatar {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.wa-title strong {
  font-size: 16px;
  line-height: 1.3;
}

.wa-meta {
  align-items: center;
  color: #a8c4ea;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 10px;
  margin-top: 2px;
}

.wa-phone {
  color: #cfe0f8;
  direction: ltr;
  letter-spacing: 0.3px;
  text-decoration: none;
}

.wa-phone:hover {
  color: #fff;
  text-decoration: underline;
}

.wa-meta em {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #dbe6f5;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  padding: 1px 7px;
}

.wa-window {
  align-items: center;
  border: 1px solid transparent;
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
  padding: 6px 12px;
}

.wa-window b {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.wa-window.open {
  background: rgba(37, 211, 102, 0.14);
  border-color: rgba(37, 211, 102, 0.35);
  color: #9ff0bd;
}

.wa-window.closed {
  background: rgba(180, 56, 78, 0.18);
  border-color: rgba(255, 150, 170, 0.35);
  color: #ffd6de;
}

.wa-compose.is-closed {
  background: #fbf3f4;
  border-top-color: #f3d3d8;
}

.wa-compose.is-closed textarea {
  background: #fff6f7;
  border-color: #f3d3d8;
  color: var(--nq-danger);
}

.wa-compose.is-closed textarea::placeholder {
  color: var(--nq-danger);
}

.wa-send:disabled {
  background: #c9d3e3;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .wa-window {
    display: inline-flex;
    font-size: 11px;
    padding: 4px 9px;
  }

  .wa-window b {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* رأس المحادثة: الرقم تحت الاسم، والشارة بيضاء بلون الهوية */
.wa-head {
  padding: 12px 18px 12px 60px;
}

.wa-meta {
  display: grid;
  gap: 4px;
  justify-items: start;
  margin-top: 3px;
}

.wa-phone {
  color: #cfe0f8;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.wa-window {
  margin-inline-start: auto;
  padding: 6px 12px;
}

.wa-window.open {
  background: #fff;
  border-color: #fff;
  color: var(--nq-blue);
}

.wa-window.closed {
  background: #fff;
  border-color: #fff;
  color: var(--nq-danger);
}

/* ---------- طلبات زد: شبكة بطاقات مدمجة ---------- */
#appView .zid-order-list {
  align-items: start;
  display: grid !important;
  gap: 14px !important;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)) !important;
}

#appView .zid-order-card {
  gap: 12px !important;
}

#appView .zid-order-main {
  gap: 10px !important;
  grid-template-columns: minmax(0, 1fr) !important;
  padding: 14px 14px 12px !important;
}

#appView .zid-order-badges {
  justify-content: flex-start !important;
  max-width: none !important;
}

#appView .zid-order-id strong {
  font-size: 16px !important;
}

#appView .zid-order-info {
  gap: 8px !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  padding: 0 14px !important;
}

#appView .zid-info-item {
  min-height: 54px !important;
  padding: 8px 10px !important;
}

#appView .zid-info-item:first-child {
  grid-column: 1 / -1;
}

#appView .zid-order-controls {
  gap: 8px !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  padding: 0 14px !important;
}

#appView .zid-order-controls .zid-assign-control {
  grid-column: 1 / -1;
}

#appView .zid-order-controls > button {
  grid-column: 1 / -1;
}

#appView .zid-order-actions {
  gap: 8px !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  padding: 12px 14px 14px !important;
}

@media (max-width: 860px) {
  #appView .zid-order-list {
    grid-template-columns: 1fr !important;
  }
}

/* ---------- طلبات زد: جدول مرتب ---------- */
#appView .zid-page {
  display: grid !important;
  gap: 16px !important;
}

#appView .zid-orders-table {
  background: #fff;
  border: 1px solid var(--nq-line);
  border-radius: 14px;
  overflow: auto;
}

.zid-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1080px;
  width: 100%;
}

.zid-table thead th {
  background: #fbfdff;
  border-bottom: 1px solid var(--nq-line);
  color: var(--nq-muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 11px 14px;
  position: sticky;
  top: 0;
  white-space: nowrap;
  z-index: 1;
}

.zid-table tbody td {
  border-bottom: 1px solid #eef4fc;
  color: var(--nq-ink);
  font-size: 13px;
  padding: 11px 14px;
  vertical-align: middle;
}

.zid-table tbody tr:last-child td {
  border-bottom: 0;
}

.zid-table tbody tr:hover td {
  background: #fbfdff;
}

.zid-table tbody tr.is-unassigned td:first-child {
  box-shadow: inset 3px 0 0 var(--nq-blue);
}

.zid-table tbody tr.is-done td {
  opacity: 0.68;
}

.zid-table tbody tr.is-done:hover td {
  opacity: 1;
}

.zid-table td strong {
  display: block;
  font-weight: 700;
  line-height: 1.35;
}

.zid-table td .muted.small {
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

.zid-col-order strong {
  color: var(--nq-blue);
  font-size: 12.5px;
}

.zid-col-customer strong {
  font-size: 13.5px;
}

.zid-phone {
  color: var(--nq-muted);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.zid-phone:hover {
  color: var(--nq-blue);
}

.zid-col-date {
  white-space: nowrap;
}

.zid-select {
  appearance: none;
  -webkit-appearance: none;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'><path fill='%2355677f' d='M7 10l5 5 5-5z'/></svg>") no-repeat left 9px center;
  border: 1px solid var(--nq-line-2);
  border-radius: 999px;
  color: var(--nq-ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  min-height: 32px;
  min-width: 128px;
  padding: 4px 12px 4px 26px;
}

.zid-select:focus {
  border-color: var(--nq-blue);
  box-shadow: 0 0 0 3px var(--nq-line-3);
  outline: none;
}

.zid-select.tone-pending,
.zid-select.tone-new {
  background-color: var(--nq-tint);
  border-color: var(--nq-tint);
  color: var(--nq-blue);
}

.zid-select.tone-assigned,
.zid-select.tone-scheduled,
.zid-select.tone-in-progress {
  background-color: var(--nq-ok-bg);
  border-color: var(--nq-ok-bg);
  color: var(--nq-ok);
}

.zid-select.tone-complete {
  background-color: var(--nq-idle-bg);
  border-color: var(--nq-idle-bg);
  color: var(--nq-idle);
}

.zid-select.tone-delayed,
.zid-select.tone-cancelled {
  background-color: var(--nq-danger-bg);
  border-color: var(--nq-danger-bg);
  color: var(--nq-danger);
}

.zid-assign {
  align-items: center;
  display: flex;
  gap: 6px;
}

.zid-assign .zid-select {
  max-width: 190px;
  min-width: 150px;
}

.zid-owner-name {
  font-weight: 700;
}

.zid-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.zid-actions .mini-button {
  min-height: 30px;
  padding: 4px 10px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .zid-table {
    min-width: 960px;
  }
}

.zid-table {
  min-width: 1180px;
}

.zid-col-order strong,
.zid-col-customer strong,
.zid-col-product,
.zid-col-place {
  white-space: nowrap;
}

.zid-col-order .muted.small {
  white-space: nowrap;
}

/* رقم العدّاد داخل شرائح الفلترة */
.nq-chip b {
  background: rgba(11, 31, 58, 0.08);
  border-radius: 999px;
  color: inherit;
  font-size: 11px;
  line-height: 1;
  margin-inline-start: 6px;
  min-width: 18px;
  padding: 3px 6px;
  text-align: center;
}

.nq-chip.is-active,
.nq-chip.is-active b {
  color: #fff;
}

.nq-chip.is-active b {
  background: rgba(255, 255, 255, 0.24);
}

/* ---------- اختيار قالب معتمد عند إغلاق النافذة ---------- */
.wa-compose.wa-template {
  align-items: stretch;
  background: #fff8e8;
  border-top-color: #f2dfb0;
  flex-direction: column;
  gap: 8px;
}

.wa-template-note {
  color: #8a5a00;
  font-size: 12px;
  font-weight: 700;
}

.wa-template-row {
  align-items: center;
  display: flex;
  gap: 8px;
}

.wa-template-row .zid-select {
  background-color: #fff;
  border-color: #f2dfb0;
  border-radius: 22px;
  color: var(--nq-ink);
  flex: 1;
  font-size: 13px;
  min-height: 44px;
  padding: 8px 16px 8px 30px;
}

.wa-template-preview {
  background: #fff;
  border: 1px dashed #f2dfb0;
  border-radius: 10px;
  color: var(--nq-ink-2);
  font-size: 12.5px;
  line-height: 1.7;
  margin: 0;
  padding: 8px 12px;
}

/* ---------- صفحة الطلب ---------- */
.order-link {
  color: var(--nq-blue);
  font-weight: 700;
  text-decoration: none;
}

.order-link:hover {
  text-decoration: underline;
}

.order-link.muted-link {
  color: var(--nq-ink);
}

.order-link.muted-link:hover {
  color: var(--nq-blue);
}

.order-page {
  display: grid;
  gap: 16px;
}

.order-hero {
  align-items: center;
  background: var(--nq-navy);
  border-radius: 14px;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  padding: 20px 22px;
}

.order-back {
  color: #a8c4ea;
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 8px;
  text-decoration: none;
}

.order-back:hover {
  color: #fff;
}

.order-hero h2 {
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}

.order-hero p {
  color: #cfe0f8;
  font-size: 13px;
  margin: 4px 0 12px;
}

.order-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-hero-actions .secondary-button {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  text-decoration: none;
}

.order-hero-actions .secondary-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.order-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-grid .order-conversation {
  grid-column: 1 / -1;
}

.order-facts {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-fact {
  background: var(--nq-tint-2);
  border: 1px solid var(--nq-line);
  border-radius: 10px;
  padding: 9px 12px;
}

.order-fact span {
  color: var(--nq-muted);
  display: block;
  font-size: 11.5px;
  font-weight: 600;
}

.order-fact strong {
  display: block;
  font-size: 13.5px;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.order-notes {
  border-top: 1px solid var(--nq-line);
  margin-top: 12px;
  padding-top: 10px;
}

.order-notes span {
  color: var(--nq-muted);
  font-size: 11.5px;
  font-weight: 600;
}

.order-notes p {
  margin: 4px 0 0;
}

.order-controls {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.order-assign {
  display: flex;
  gap: 8px;
}

.order-assign select {
  flex: 1;
}

.order-steps {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.order-steps li {
  display: flex;
  font-size: 13px;
  gap: 10px;
}

.order-steps i {
  background: var(--nq-blue);
  border-radius: 50%;
  flex: none;
  height: 10px;
  margin-top: 6px;
  width: 10px;
}

.order-steps li.is-pending {
  color: var(--nq-muted);
}

.order-steps li.is-pending i {
  background: var(--nq-line-2);
}

.order-steps time {
  color: var(--nq-muted);
  display: block;
  font-size: 11.5px;
}

.order-messages {
  display: grid;
  gap: 8px;
}

.order-message {
  border-radius: 10px;
  max-width: 640px;
  padding: 8px 12px;
}

.order-message.in {
  background: var(--nq-tint-2);
  border: 1px solid var(--nq-line);
}

.order-message.out {
  background: #d9fdd3;
  justify-self: start;
}

.order-message p {
  margin: 0;
}

.order-message small {
  color: var(--nq-muted);
  display: block;
  font-size: 11px;
  margin-top: 4px;
}

@media (max-width: 860px) {
  .order-grid,
  .order-facts {
    grid-template-columns: 1fr;
  }
}

/* ---------- السلات المتروكة ---------- */
.carts-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.carts-filters {
  margin-bottom: 14px;
}

.carts-city {
  min-width: 140px;
}

.carts-table {
  min-width: 1100px;
}

.carts-check {
  width: 36px;
}

.carts-check input {
  accent-color: var(--nq-blue);
  height: 16px;
  width: 16px;
}

.carts-products {
  color: var(--nq-ink-2);
  max-width: 220px;
}

.carts-value strong {
  color: var(--nq-ink);
  white-space: nowrap;
}

.carts-table td .order-link.small {
  display: block;
  font-size: 11px;
  margin-top: 4px;
}

@media (max-width: 980px) {
  .carts-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- مواعيد الصيانة ---------- */
.schedule-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.schedule-chips {
  margin-bottom: 10px;
}

.schedule-filters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.schedule-filters .zid-select {
  min-width: 140px;
}

.schedule-date {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.schedule-date span {
  color: var(--nq-muted);
  font-size: 12px;
  font-weight: 700;
}

.schedule-date input {
  border: 1px solid var(--nq-line-2);
  border-radius: 999px;
  font-size: 12.5px;
  min-height: 34px;
  padding: 4px 12px;
}

.schedule-view-toggle .segment-button {
  border-radius: 8px;
}

.schedule-list-head {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.schedule-select-all {
  align-items: center;
  color: var(--nq-muted);
  display: inline-flex;
  font-size: 12.5px;
  font-weight: 700;
  gap: 8px;
}

.schedule-select-all input,
.maintenance-select input {
  accent-color: var(--nq-blue);
  height: 16px;
  width: 16px;
}

.maintenance-card {
  position: relative;
}

.maintenance-card.is-selected {
  border-color: var(--nq-blue);
  box-shadow: 0 0 0 2px var(--nq-line-3);
}

.maintenance-card.is-overdue .maintenance-date {
  background: var(--nq-danger);
}

.maintenance-select {
  left: 14px;
  position: absolute;
  top: 14px;
  z-index: 1;
}

.due-chip.is-overdue {
  background: var(--nq-danger-bg);
  color: var(--nq-danger);
}

.maintenance-actions {
  align-items: center;
}

.maintenance-reschedule {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.maintenance-reschedule input {
  min-width: 150px;
}

/* التقويم */
.schedule-calendar {
  display: grid;
  gap: 10px;
}

.cal-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.cal-title {
  text-align: center;
}

.cal-title strong {
  display: block;
  font-size: 16px;
}

.cal-weekdays,
.cal-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-weekdays span {
  color: var(--nq-muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 0;
  text-align: center;
}

.cal-cell {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--nq-line);
  border-radius: 10px;
  color: var(--nq-ink);
  cursor: default;
  display: flex;
  flex-direction: column;
  font-family: inherit;
  gap: 4px;
  min-height: 84px;
  padding: 8px;
  position: relative;
  text-align: right;
}

.cal-cell.is-empty {
  background: transparent;
  border-color: transparent;
}

.cal-cell.has-items {
  background: var(--nq-tint-2);
  border-color: var(--nq-line-3);
  cursor: pointer;
}

.cal-cell.has-items:hover {
  border-color: var(--nq-blue);
}

.cal-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--nq-blue);
}

.cal-cell.is-overdue {
  background: var(--nq-danger-bg);
  border-color: #f3d3d8;
}

.cal-day {
  color: var(--nq-muted);
  font-size: 12px;
  font-weight: 700;
}

.cal-cell.is-today .cal-day {
  color: var(--nq-blue);
}

.cal-count {
  background: var(--nq-blue);
  border-radius: 999px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  left: 8px;
  min-width: 20px;
  padding: 1px 6px;
  position: absolute;
  text-align: center;
  top: 8px;
}

.cal-cell.is-overdue .cal-count {
  background: var(--nq-danger);
}

.cal-names {
  display: grid;
  gap: 2px;
  width: 100%;
}

.cal-names em {
  font-size: 11px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .schedule-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cal-cell {
    min-height: 56px;
  }

  .cal-names {
    display: none;
  }
}

/* ---------- جدول مواعيد الصيانة ---------- */
.schedule-table {
  min-width: 1240px;
}

.sched-date {
  white-space: nowrap;
}

.sched-day {
  align-items: center;
  background: var(--nq-navy);
  border-radius: 10px;
  color: #fff;
  display: inline-flex;
  flex-direction: column;
  line-height: 1.1;
  margin-inline-end: 8px;
  min-width: 46px;
  padding: 5px 6px;
  vertical-align: middle;
}

.sched-day b {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.sched-day small {
  color: #a8c4ea;
  font-size: 10px;
}

.sched-day.is-overdue {
  background: var(--nq-danger);
}

.sched-day.is-overdue small {
  color: #ffd6de;
}

.sched-day.is-today {
  background: var(--nq-blue);
}

.sched-date .due-chip {
  vertical-align: middle;
}

.sched-reminded {
  display: inline-block;
  margin-top: 4px;
}

.sched-reschedule input[type="date"] {
  min-width: 140px;
}

.schedule-table .zid-assign .zid-select {
  min-width: 140px;
}

.schedule-table tbody tr.is-overdue td:first-child {
  box-shadow: inset 3px 0 0 var(--nq-danger);
}

/* ---------- العملاء ---------- */
.customers-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.customer-page-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.customers-chips {
  margin-bottom: 10px;
}

.customers-table {
  min-width: 1180px;
}

.customers-table td .due-chip {
  display: inline-block;
  margin-inline-start: 6px;
}

.bulk-bar {
  align-items: center;
  background: var(--nq-tint-2);
  border: 1px dashed var(--nq-line-3);
  border-radius: 12px;
  color: var(--nq-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12.5px;
  font-weight: 700;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
}

.bulk-bar span {
  margin-inline-end: auto;
}

.bulk-bar.is-active {
  background: var(--nq-tint);
  border-style: solid;
  border-color: var(--nq-blue);
  color: var(--nq-blue);
}

.bulk-bar .mini-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.customer-hero-id {
  align-items: center;
  display: flex;
  gap: 12px;
}

.customer-hero-avatar {
  align-items: center;
  background: var(--nq-blue);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
  color: #fff;
  display: inline-flex;
  font-size: 20px;
  font-weight: 800;
  height: 52px;
  justify-content: center;
  width: 52px;
}

.customer-hero-phone {
  margin: 2px 0 12px !important;
  text-align: right;
}

@media (max-width: 980px) {
  .customers-kpis,
  .customer-page-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- صندوق WATI بأسلوب واتساب ويب ---------- */
.wa-inbox {
  background: #fff;
  border: 1px solid var(--nq-line);
  border-radius: 14px;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  height: calc(100vh - 150px);
  min-height: 560px;
  overflow: hidden;
}

.wa-list {
  border-left: 1px solid var(--nq-line);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.wa-list-head {
  border-bottom: 1px solid var(--nq-line);
  display: grid;
  gap: 10px;
  padding: 14px;
}

.wa-list-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.wa-list-title h2 {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}

.wa-list-head .nq-search {
  min-width: 0;
  width: 100%;
}

.wa-list-head .nq-chips {
  gap: 5px;
}

.wa-list-head .nq-chip {
  font-size: 11px;
  min-height: 28px;
  padding: 4px 9px;
}

.wa-list-items {
  overflow-y: auto;
}

.wa-item {
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #f0f3f8;
  cursor: pointer;
  display: flex;
  font-family: inherit;
  gap: 10px;
  padding: 11px 14px;
  text-align: right;
  width: 100%;
}

.wa-item:hover {
  background: #f7f9fc;
}

.wa-item.active {
  background: var(--nq-tint);
}

.wa-item-avatar {
  align-items: center;
  background: var(--nq-navy);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: none;
  font-size: 16px;
  font-weight: 800;
  height: 44px;
  justify-content: center;
  position: relative;
  width: 44px;
}

.wa-item-avatar i {
  border: 2px solid #fff;
  border-radius: 50%;
  bottom: 0;
  height: 12px;
  left: 0;
  position: absolute;
  width: 12px;
}

.wa-item-avatar i.open {
  background: #25d366;
}

.wa-item-avatar i.closed {
  background: #c9d3e3;
}

.wa-item-main {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.wa-item-top,
.wa-item-bottom {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.wa-item-top strong {
  color: var(--nq-ink);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-item-top small {
  color: var(--nq-muted);
  flex: none;
  font-size: 11px;
}

.wa-item-preview {
  color: var(--nq-muted);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-item.is-unread .wa-item-preview {
  color: var(--nq-ink);
  font-weight: 700;
}

.wa-item.is-unread .wa-item-top small {
  color: #1faa59;
  font-weight: 700;
}

.wa-item-unread {
  background: #25d366;
  border-radius: 999px;
  color: #fff;
  flex: none;
  font-size: 11px;
  min-width: 20px;
  padding: 1px 6px;
  text-align: center;
}

.wa-thread {
  min-height: 0;
  min-width: 0;
}

.wa-chat-inline {
  height: 100%;
}

.wa-chat-inline .wa-head {
  padding: 12px 18px;
}

.wa-title-link {
  color: #fff;
  text-decoration: none;
}

.wa-title-link:hover {
  text-decoration: underline;
}

.wa-order-chip {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #dbe6f5;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  text-decoration: none;
}

.wa-order-chip:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.wa-msg-error {
  clear: both;
  color: var(--nq-danger);
  display: block;
  font-size: 11px;
  margin-top: 4px;
}

@media (max-width: 860px) {
  .wa-inbox {
    grid-template-columns: 1fr;
    grid-template-rows: 300px minmax(480px, 1fr);
    height: auto;
  }

  .wa-list {
    border-bottom: 1px solid var(--nq-line);
    border-left: 0;
  }
}

.wa-list-items {
  overflow-x: hidden;
}

.wa-item {
  min-width: 0;
  overflow: hidden;
}

/* ---------- الحملات ---------- */
.campaign-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.campaign-composer textarea:disabled {
  background: var(--nq-tint-2);
  color: var(--nq-ink-2);
}

.campaign-footer {
  align-items: center;
  border-top: 1px solid var(--nq-line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
}

.campaign-count {
  color: var(--nq-muted);
  font-size: 13px;
}

.campaign-count b {
  color: var(--nq-blue);
  font-size: 18px;
  font-weight: 800;
}

.campaign-phone {
  border: 1px solid var(--nq-line);
  border-radius: 14px;
  height: auto;
  overflow: hidden;
}

.campaign-phone .wa-head {
  padding: 10px 14px;
}

.campaign-phone .wa-body {
  min-height: 180px;
}

.campaign-recipients {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.campaign-result {
  white-space: nowrap;
}

.campaign-result .badge {
  margin-inline-end: 4px;
}

.panel-header .automation-strip {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

@media (max-width: 980px) {
  .campaign-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- لوحة المهام ---------- */
.kpi-text {
  font-size: 18px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-form {
  background: var(--nq-tint-2);
  border: 1px solid var(--nq-line-3);
  border-radius: 12px;
  margin-bottom: 14px;
  padding: 14px;
}

.task-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-board {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  overflow-x: auto;
}

.task-column {
  background: #f4f7fb;
  border: 1px solid var(--nq-line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  transition: border-color 120ms ease, background 120ms ease;
}

.task-column.is-over {
  background: var(--nq-tint);
  border-color: var(--nq-blue);
}

.task-column-head {
  align-items: center;
  border-bottom: 1px solid var(--nq-line);
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
}

.task-column-head strong {
  font-size: 13.5px;
}

.task-column-head b {
  background: #fff;
  border: 1px solid var(--nq-line-2);
  border-radius: 999px;
  color: var(--nq-ink-2);
  font-size: 11px;
  min-width: 22px;
  padding: 1px 8px;
  text-align: center;
}

.task-column-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.task-empty {
  border: 1px dashed var(--nq-line-2);
  border-radius: 10px;
  color: var(--nq-muted);
  font-size: 12px;
  padding: 14px;
  text-align: center;
}

.task-tile {
  background: #fff;
  border: 1px solid var(--nq-line);
  border-radius: 12px;
  border-right: 3px solid var(--nq-line-3);
  cursor: grab;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
}

.task-tile.priority-high {
  border-right-color: var(--nq-danger);
}

.task-tile.priority-medium {
  border-right-color: #e6a23c;
}

.task-tile.priority-low {
  border-right-color: var(--nq-ok);
}

.task-tile.is-overdue {
  background: #fffafa;
}

.task-tile.is-dragging {
  opacity: 0.5;
}

.task-tile h3 {
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0;
}

.task-tile p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-tile-top,
.task-tile-meta {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.task-owner {
  align-items: center;
  color: var(--nq-ink-2);
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
}

.task-owner i {
  align-items: center;
  background: var(--nq-navy);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-style: normal;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.task-tile .order-link.small {
  font-size: 11.5px;
}

.task-tile-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.task-tile-actions .mini-button {
  min-height: 28px;
  padding: 3px 10px;
}

@media (max-width: 980px) {
  .task-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- الموظفون ---------- */
.staff-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

.staff-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.staff-head {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.staff-avatar {
  align-items: center;
  background: var(--nq-navy);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--nq-ok-bg);
  color: #fff;
  display: inline-flex;
  font-size: 17px;
  font-weight: 800;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.staff-avatar.assigned {
  box-shadow: 0 0 0 3px #fde7c2;
}

.staff-avatar.cancelled {
  box-shadow: 0 0 0 3px var(--nq-danger-bg);
}

.staff-id h3 {
  font-size: 14.5px;
  margin: 0;
}

.staff-id p {
  margin: 2px 0 0;
}

.staff-head .zid-select {
  min-width: 96px;
}

.staff-stats {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.staff-stats div {
  background: var(--nq-tint-2);
  border: 1px solid var(--nq-line);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.staff-stats b {
  display: block;
  font-size: 18px;
  font-weight: 800;
}

.staff-stats span {
  color: var(--nq-muted);
  font-size: 11px;
}

.staff-load {
  align-items: center;
  display: flex;
  gap: 8px;
}

.staff-bar {
  background: var(--nq-line);
  border-radius: 999px;
  flex: 1;
  height: 6px;
  overflow: hidden;
}

.staff-bar i {
  background: var(--nq-blue);
  border-radius: 999px;
  display: block;
  height: 100%;
}

.staff-foot {
  align-items: center;
  border-top: 1px solid var(--nq-line);
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
}

.zid-select.tone-available { background-color: var(--nq-ok-bg); border-color: var(--nq-ok-bg); color: var(--nq-ok); }
.zid-select.tone-busy { background-color: var(--nq-warn-bg); border-color: var(--nq-warn-bg); color: var(--nq-warn); }
.zid-select.tone-leave { background-color: var(--nq-danger-bg); border-color: var(--nq-danger-bg); color: var(--nq-danger); }
.staff-avatar.available { box-shadow: 0 0 0 3px var(--nq-ok-bg); }
.staff-avatar.busy { box-shadow: 0 0 0 3px #fde7c2; }
.staff-avatar.leave { box-shadow: 0 0 0 3px var(--nq-danger-bg); }

/* ---------- المستخدمون ---------- */
.users-table {
  min-width: 980px;
}

.users-table .zid-select {
  min-width: 150px;
}

.user-avatar {
  align-items: center;
  background: var(--nq-navy);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  height: 26px;
  justify-content: center;
  margin-inline-end: 8px;
  vertical-align: middle;
  width: 26px;
}

.access-table th,
.access-cell {
  text-align: center;
}

.access-table td:first-child,
.access-table th:first-child {
  text-align: right;
}

.access-yes {
  align-items: center;
  background: var(--nq-ok-bg);
  border-radius: 50%;
  color: var(--nq-ok);
  display: inline-flex;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.access-no {
  color: var(--nq-line-3);
}

.temp-password {
  align-items: center;
  background: var(--nq-tint-2);
  border: 1px dashed var(--nq-line-3);
  border-radius: 12px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 12px;
  padding: 12px 14px;
}

.temp-password code {
  direction: ltr;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ---------- صفحة الموظف ---------- */
.portal-hero {
  align-items: center;
  background: linear-gradient(135deg, var(--nq-navy), #12408a);
  border-radius: 14px;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  padding: 22px;
}

.portal-date {
  color: #a8c4ea;
  font-size: 12.5px;
  font-weight: 700;
}

.portal-hero h2 {
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  margin: 4px 0;
}

.portal-hero p {
  color: #cfe0f8;
  margin: 0;
}

.portal-hero-side {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.portal-switch {
  display: grid;
  gap: 4px;
}

.portal-switch span {
  color: #a8c4ea;
  font-size: 11.5px;
  font-weight: 700;
}

.portal-switch .zid-select {
  min-width: 160px;
}

.portal-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.job-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.job-card {
  background: #fff;
  border: 1px solid var(--nq-line);
  border-radius: 14px;
  border-right: 4px solid var(--nq-blue);
  display: grid;
  gap: 10px;
  padding: 14px;
}

.job-card.is-overdue {
  border-right-color: var(--nq-danger);
}

.job-card.is-done {
  border-right-color: var(--nq-ok);
  opacity: 0.8;
}

.job-head {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.job-head h3 {
  font-size: 16px;
  margin: 2px 0 0;
}

.job-facts {
  display: grid;
  gap: 6px;
}

.job-facts span {
  color: var(--nq-ink);
  font-size: 13px;
}

.job-facts b {
  color: var(--nq-muted);
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  min-width: 56px;
}

.job-facts em {
  font-style: normal;
  margin-inline-start: 6px;
}

.job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.job-actions .mini-button {
  flex: 1 1 auto;
  justify-content: center;
  text-align: center;
}

@media (max-width: 760px) {
  .portal-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .job-actions .mini-button {
    min-height: 40px;
  }
}

/* ---------- الإشعارات ---------- */
.notif-list {
  display: grid;
  gap: 6px;
}

.notif-day {
  color: var(--nq-muted);
  font-size: 12px;
  font-weight: 800;
  margin: 10px 2px 2px;
}

.notif-row {
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--nq-line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  padding: 12px 14px;
}

.notif-row.is-unread {
  background: var(--nq-tint-2);
  border-color: var(--nq-line-3);
}

.notif-icon {
  align-items: center;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.notif-zid { background: #6c3fd1; }
.notif-wati { background: #1faa59; }
.notif-system { background: var(--nq-navy); }

.notif-top {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.notif-top strong {
  font-size: 14px;
}

.notif-top time {
  color: var(--nq-muted);
  flex: none;
  font-size: 11.5px;
}

.notif-main p {
  color: var(--nq-ink-2);
  font-size: 13px;
  margin: 3px 0 6px;
}

.notif-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.notif-read {
  background: var(--nq-blue);
  border: 3px solid var(--nq-tint);
  border-radius: 50%;
  cursor: pointer;
  height: 16px;
  margin-top: 4px;
  padding: 0;
  width: 16px;
}

.notif-read:hover {
  background: var(--nq-ok);
}

.notif-more {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

/* ---------- التكاملات: جاهزية الربط ---------- */
.readiness {
  align-items: center;
  background: linear-gradient(135deg, var(--nq-navy), #12408a);
  border-radius: 14px;
  color: #fff;
  display: grid;
  gap: 22px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 22px 24px;
}

.readiness-ring {
  display: grid;
  place-items: center;
  position: relative;
}

.readiness-ring svg circle:last-child {
  transition: stroke-dashoffset 600ms ease;
}

.readiness-value {
  display: grid;
  inset: 0;
  place-content: center;
  position: absolute;
  text-align: center;
}

.readiness-value b {
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.readiness-value span {
  color: #a8c4ea;
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}

.readiness-body h2 {
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  margin: 0;
}

.readiness-body > p {
  color: #cfe0f8;
  margin: 4px 0 12px;
}

.readiness-list {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.readiness-list li {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  padding: 8px 10px;
}

.readiness-list li i {
  align-items: center;
  background: #f1b34a;
  border-radius: 50%;
  color: var(--nq-navy);
  display: inline-flex;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.readiness-list li.is-done {
  opacity: 0.7;
}

.readiness-list li.is-done i {
  background: #25d366;
  color: #fff;
}

.readiness-list strong {
  color: #fff;
  display: block;
  font-size: 13px;
}

.readiness-list span {
  color: #cfe0f8;
  display: block;
  font-size: 11.5px;
  line-height: 1.5;
}

.readiness-list .mini-button {
  background: #fff;
  border-color: #fff;
  color: var(--nq-navy);
}

.templates-table {
  min-width: 900px;
}

.compact-input {
  background: #fff;
  border: 1px solid var(--nq-line-2);
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  min-height: 34px;
  padding: 6px 10px;
  resize: vertical;
  width: 100%;
}

.compact-input:focus {
  border-color: var(--nq-blue);
  box-shadow: 0 0 0 3px var(--nq-line-3);
  outline: none;
}

.templates-table td:nth-child(1) { width: 18%; }
.templates-table td:nth-child(2) { width: 22%; }
.templates-table td:nth-child(4) { width: 70px; }

.endpoints-table code {
  display: inline-block;
  max-width: 560px;
  overflow: hidden;
  padding: 4px 8px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .readiness {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .readiness-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- قائمة المحادثات: بلا قص ---------- */
.wa-list,
.wa-list-items,
.wa-item {
  min-width: 0;
  max-width: 100%;
}

.wa-list-items {
  overflow-x: hidden;
}

.wa-item {
  border-bottom: 0;
  gap: 12px;
  padding: 10px 14px;
  position: relative;
}

.wa-item::after {
  background: #eef2f8;
  bottom: 0;
  content: "";
  height: 1px;
  left: 14px;
  position: absolute;
  right: 70px;
}

.wa-item.active {
  background: var(--nq-tint);
  box-shadow: inset -3px 0 0 var(--nq-blue);
}

.wa-item-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.wa-item-top,
.wa-item-bottom {
  min-width: 0;
  width: 100%;
}

.wa-item-top strong {
  flex: 1 1 auto;
  min-width: 0;
}

.wa-item-top small {
  flex: 0 0 auto;
  white-space: nowrap;
}

.wa-item-preview {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-item-unread {
  flex: 0 0 auto;
}

.wa-list-head .nq-chips {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.wa-list-head .nq-chips::-webkit-scrollbar {
  display: none;
}

/* فلترة المحادثات: شريط مقسّم يملأ عرض القائمة */
.inbox-segments {
  background: var(--nq-tint-2);
  border: 1px solid var(--nq-line-2);
  border-radius: 12px;
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 3px;
}

.inbox-seg {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: var(--nq-idle);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  gap: 2px;
  justify-content: center;
  min-height: 44px;
  min-width: 0;
  padding: 4px 2px;
  white-space: nowrap;
}

.inbox-seg b {
  background: #fff;
  border: 1px solid var(--nq-line-2);
  border-radius: 999px;
  color: var(--nq-ink-2);
  font-size: 10.5px;
  line-height: 1.3;
  min-width: 20px;
  padding: 0 6px;
}

.inbox-seg:hover {
  background: #fff;
}

.inbox-seg.is-active {
  background: var(--nq-blue);
  color: #fff;
}

.inbox-seg.is-active b {
  background: rgba(255, 255, 255, 0.24);
  border-color: transparent;
  color: #fff;
}

/* ---------- رسائل واتساب الغنية ---------- */
.wa-msg {
  position: relative;
}

.wa-media {
  border-radius: 8px;
  display: block;
  margin: -2px -4px 6px;
  overflow: hidden;
  position: relative;
}

.wa-image img,
.wa-video video {
  background: #e4ddd3;
  border-radius: 8px;
  display: block;
  max-height: 320px;
  max-width: min(320px, 100%);
  object-fit: cover;
  width: 100%;
}

.wa-sticker img {
  height: 140px;
  object-fit: contain;
  width: 140px;
}

.wa-msg.is-sticker {
  background: transparent !important;
  box-shadow: none !important;
}

.wa-msg.is-sticker::before {
  display: none;
}

.wa-audio {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 240px;
}

.wa-audio audio {
  height: 36px;
  max-width: 100%;
  width: 240px;
}

.wa-audio-icon {
  align-items: center;
  background: #1faa59;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: none;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.wa-document,
.wa-location,
.wa-contact {
  align-items: center;
  background: rgba(11, 43, 94, 0.06);
  color: var(--nq-ink);
  display: flex;
  gap: 10px;
  min-width: 220px;
  padding: 10px;
  text-decoration: none;
}

.wa-document b,
.wa-location b,
.wa-contact b {
  display: block;
  font-size: 13px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-document small,
.wa-location small {
  color: #667781;
  display: block;
  font-size: 11px;
}

.wa-doc-icon {
  align-items: center;
  background: #d9534f;
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  flex: none;
  font-size: 10px;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  width: 34px;
}

.wa-location-pin,
.wa-contact-avatar {
  font-size: 24px;
}

.wa-contact a {
  color: var(--nq-blue);
  display: block;
  font-size: 12px;
}

.wa-media-missing {
  color: #667781;
  font-size: 12.5px;
  margin: 0 0 4px;
}

.wa-broken {
  display: none;
}

.wa-media.is-broken img,
.wa-media.is-broken video,
.wa-media.is-broken audio {
  display: none;
}

.wa-media.is-broken .wa-broken {
  background: rgba(11, 43, 94, 0.06);
  border-radius: 8px;
  color: var(--nq-ink-2);
  display: block;
  font-size: 12.5px;
  padding: 12px;
  text-decoration: none;
}

.wa-msg.is-emoji {
  background: transparent !important;
  box-shadow: none !important;
}

.wa-msg.is-emoji::before {
  display: none;
}

.wa-msg.is-emoji p {
  font-size: 40px;
  line-height: 1.2;
}

.wa-quote {
  background: rgba(11, 43, 94, 0.06);
  border-radius: 6px;
  border-right: 4px solid #25d366;
  cursor: pointer;
  display: block;
  margin: -2px -4px 6px;
  padding: 5px 8px;
}

.wa-quote.is-agent {
  border-right-color: var(--nq-blue);
}

.wa-quote b {
  color: #1faa59;
  display: block;
  font-size: 11.5px;
}

.wa-quote.is-agent b {
  color: var(--nq-blue);
}

.wa-quote span {
  color: #54656f;
  display: -webkit-box;
  font-size: 12px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.wa-button-reply {
  border: 1px solid rgba(11, 43, 94, 0.15);
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  margin-top: 4px;
  padding: 2px 10px;
}

.wa-msg.has-reactions {
  margin-bottom: 14px;
}

.wa-reactions {
  background: #fff;
  border-radius: 999px;
  bottom: -14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  display: inline-flex;
  font-size: 14px;
  gap: 2px;
  padding: 1px 6px;
  position: absolute;
}

.wa-msg.in .wa-reactions {
  right: 10px;
}

.wa-msg.out .wa-reactions {
  left: 10px;
}

.wa-reactions i {
  font-style: normal;
}

.wa-reply-btn {
  align-items: center;
  background: #fff;
  border: 1px solid var(--nq-line-2);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  color: var(--nq-ink-2);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  height: 26px;
  justify-content: center;
  opacity: 0;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 120ms ease;
  width: 26px;
}

.wa-msg.in .wa-reply-btn {
  left: -34px;
}

.wa-msg.out .wa-reply-btn {
  right: -34px;
}

.wa-msg:hover .wa-reply-btn,
.wa-reply-btn:focus {
  opacity: 1;
}

.zid-chat-messages .wa-reply-btn,
.wa-chat:not(.wa-chat-inline) .wa-reply-btn {
  display: none;
}

.wa-msg.is-highlight {
  animation: wa-flash 1.6s ease;
}

@keyframes wa-flash {
  0%, 60% { box-shadow: 0 0 0 3px rgba(22, 104, 227, 0.45); }
  100% { box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1); }
}

.wa-reply-bar {
  align-items: center;
  background: #f0f2f5;
  border-top: 1px solid #e2e6ea;
  display: flex;
  gap: 10px;
  padding: 8px 14px 0;
}

.wa-reply-bar div {
  background: #fff;
  border-radius: 8px;
  border-right: 4px solid var(--nq-blue);
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
}

.wa-reply-bar b {
  color: var(--nq-blue);
  display: block;
  font-size: 12px;
}

.wa-reply-bar span {
  color: #54656f;
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-reply-bar button {
  background: transparent;
  border: 0;
  color: var(--nq-muted);
  cursor: pointer;
  font-size: 20px;
}

.wa-chat-inline {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

@media (max-width: 760px) {
  .wa-reply-btn {
    opacity: 0.85;
  }

  .wa-msg.in .wa-reply-btn {
    left: -30px;
  }

  .wa-msg.out .wa-reply-btn {
    right: -30px;
  }

  .wa-audio,
  .wa-document,
  .wa-location,
  .wa-contact {
    min-width: 0;
  }
}

/* ---------- مربع المحادثة: يملأ المساحة بلا تمرير أفقي ---------- */
.wa-chat-inline {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: 100%;
  min-height: 0;
}

.wa-body.messages,
.wa-chat .wa-body {
  align-content: initial;
  background-color: #efeae2 !important;
  border: 0 !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  max-height: none !important;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto;
  padding: 16px 44px !important;
}

.wa-body .wa-msg {
  flex: none;
  max-width: min(75%, 560px);
}

.wa-body .wa-msg p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.wa-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wa-thread > .wa-chat-inline {
  flex: 1;
}

.wa-list-title .row-actions {
  display: flex;
  gap: 6px;
}

@media (max-width: 760px) {
  .wa-body.messages,
  .wa-chat .wa-body {
    padding: 12px 34px !important;
  }
}


/* ---------- عارض الصور داخل المحادثة ---------- */
.image-viewer { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(8, 17, 38, 0.92); animation: image-viewer-in 0.18s ease-out; }
.image-viewer[hidden] { display: none; }
.image-viewer-img { max-width: min(92vw, 1400px); max-height: calc(100vh - 140px); object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); background: #fff; }
.image-viewer-bar { position: absolute; top: 0; inset-inline: 0; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; color: #fff; }
.image-viewer-count { font-size: 14px; font-weight: 600; opacity: 0.85; }
.image-viewer-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 20px; line-height: 1; text-decoration: none; cursor: pointer; transition: background 0.15s; }
.image-viewer-btn:hover, .image-viewer-btn:focus-visible { background: rgba(255, 255, 255, 0.28); outline: none; }
.image-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.image-viewer-nav:hover { background: rgba(255, 255, 255, 0.28); }
.image-viewer-nav.is-prev { right: 20px; }
.image-viewer-nav.is-next { left: 20px; }
.image-viewer.is-single .image-viewer-nav { display: none; }
html.image-viewer-open, html.image-viewer-open body { overflow: hidden; }
.wa-image { cursor: zoom-in; }
@keyframes image-viewer-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 767px) {
  .image-viewer-img { max-width: 100vw; max-height: calc(100vh - 120px); border-radius: 0; }
  .image-viewer-nav { width: 40px; height: 40px; font-size: 24px; }
  .image-viewer-nav.is-prev { right: 8px; }
  .image-viewer-nav.is-next { left: 8px; }
}


/* ---------- أزرار القوالب والبوت داخل الفقاعة ---------- */
.wa-msg .wa-buttons { display: flex; flex-direction: column; gap: 4px; margin: 8px -4px 2px; }
.wa-msg .wa-buttons span { display: block; padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(15, 76, 180, 0.12); color: #1b5fd6; font-size: 13px; font-weight: 600; text-align: center; }
.wa-msg .wa-template-tag { display: inline-block; margin-bottom: 4px; padding: 1px 8px; border-radius: 999px; background: rgba(27, 95, 214, 0.1); color: #1b5fd6; font-size: 11px; font-weight: 600; }


/* ---------- ثبات التمرير وحركة الرسائل الجديدة ---------- */
#inboxMessages, .wa-body.messages, .wa-chat .wa-body { scroll-behavior: auto !important; overflow-anchor: none; }
.wa-body .wa-msg.is-new { animation: wa-msg-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.wa-body .wa-msg.in.is-new { transform-origin: bottom right; }
.wa-body .wa-msg.out.is-new { transform-origin: bottom left; }
@keyframes wa-msg-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
.wa-row-new { animation: wa-row-glow 1.8s ease; }
@keyframes wa-row-glow { 0%, 40% { background: rgba(27, 95, 214, 0.16); } 100% { background: transparent; } }
.wa-toast { position: fixed; bottom: 24px; left: 24px; z-index: 9000; display: flex; align-items: center; gap: 10px; max-width: 340px; padding: 12px 16px; border: 0; border-radius: 14px; background: #0f2a5c; color: #fff; font: inherit; text-align: right; box-shadow: 0 14px 40px rgba(11, 43, 94, 0.35); cursor: pointer; animation: wa-toast-in 0.3s ease; transition: opacity 0.4s, transform 0.4s; }
.wa-toast.is-leaving { opacity: 0; transform: translateY(12px); }
.wa-toast b { display: block; font-size: 14px; }
.wa-toast small { display: block; font-size: 12px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.wa-toast-icon { font-size: 22px; }
@keyframes wa-toast-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (max-width: 767px) { .wa-toast { left: 12px; right: 12px; bottom: 84px; max-width: none; } }
@media (prefers-reduced-motion: reduce) { .wa-body .wa-msg.is-new, .wa-row-new, .wa-toast { animation: none; } }


/* ---------- رسائل البوت بشكل واتساب: ترويسة، توقيع وأزرار ---------- */
.wa-body .wa-msg p b, .wa-body .wa-msg .wa-bot-header { font-weight: 700; }
.wa-body .wa-msg p a { color: #027eb5; text-decoration: underline; word-break: break-all; }
.wa-body .wa-msg p code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: rgba(0, 0, 0, 0.05); padding: 0 3px; border-radius: 3px; }
.wa-body .wa-msg .wa-bot-header { display: block; margin-bottom: 4px; font-size: 14.5px; }
.wa-body .wa-msg .wa-bot-footer { display: block; margin-top: 6px; color: #667781; font-size: 12.5px; white-space: pre-line; }
.wa-body .wa-msg.has-buttons { padding-bottom: 0; overflow: hidden; }
.wa-body .wa-msg .wa-buttons { display: flex; flex-direction: column; gap: 0; margin: 6px -10px 0; }
.wa-body .wa-msg .wa-buttons span { display: block; padding: 10px 12px; border: 0; border-top: 1px solid rgba(0, 0, 0, 0.08); border-radius: 0; background: #fff; color: #027eb5; font-size: 14px; font-weight: 600; text-align: center; }
.wa-body .wa-msg.out .wa-buttons span { background: rgba(255, 255, 255, 0.72); }

/* ---------- أزرار البوت: صفوف كاملة العرض أسفل الفقاعة مثل واتساب ---------- */
.wa-body .wa-msg.has-buttons { overflow: visible; padding-bottom: 0; min-width: 240px; }
.wa-body .wa-msg.has-buttons > small { float: none; justify-content: flex-end; margin: 2px 0 6px; }
.wa-body .wa-msg .wa-buttons { clear: both; display: flex; flex-direction: column; gap: 0; margin: 0 -10px; border-top: 1px solid rgba(11, 20, 26, 0.1); }
.wa-body .wa-msg .wa-buttons span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 12px; border: 0; border-radius: 0; background: transparent; color: #027eb5; font-size: 14px; font-weight: 600; line-height: 1.3; text-align: center; }
.wa-body .wa-msg .wa-buttons span + span { border-top: 1px solid rgba(11, 20, 26, 0.1); }
.wa-body .wa-msg .wa-buttons span::before { content: "↩"; font-size: 13px; opacity: 0.8; transform: scaleX(-1); }
.wa-body .wa-msg.out .wa-buttons span { background: transparent; }

/* ---------- إشعار الرسالة الجديدة ---------- */
.wa-toast-stack { position: fixed; bottom: 24px; left: 24px; z-index: 9000; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 32px)); pointer-events: none; }
.wa-toast-stack .wa-toast { position: relative; display: flex; align-items: stretch; width: 100%; max-width: none; padding: 0; border: 1px solid #e3e9f4; border-radius: 16px; background: #fff; color: #0f1f3d; box-shadow: 0 18px 44px rgba(15, 42, 92, 0.18), 0 2px 6px rgba(15, 42, 92, 0.06); overflow: hidden; pointer-events: auto; animation: wa-toast-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); transition: opacity 0.3s, transform 0.3s; cursor: default; bottom: auto; left: auto; }
.wa-toast-stack .wa-toast::before { content: ""; position: absolute; inset-block: 0; right: 0; width: 4px; background: linear-gradient(180deg, #25d366, #1b5fd6); }
.wa-toast-stack .wa-toast.is-leaving { opacity: 0; transform: translateX(-24px); }
.wa-toast-main { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px 16px 16px 8px; border: 0; background: transparent; color: inherit; font: inherit; text-align: right; cursor: pointer; }
.wa-toast-main:hover .wa-toast-body b { color: #1b5fd6; }
.wa-toast-avatar { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #1b5fd6, #0f2a5c); color: #fff; font-size: 18px; font-weight: 700; }
.wa-toast-avatar i { position: absolute; bottom: -2px; left: -2px; width: 18px; height: 18px; border: 2px solid #fff; border-radius: 50%; background: #25d366 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 3a9 9 0 0 0-7.8 13.5L3 21l4.6-1.2A9 9 0 1 0 12 3z'/%3E%3C/svg%3E") center / 10px no-repeat; }
.wa-toast-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wa-toast-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wa-toast-head em { color: #128c4a; font-size: 11.5px; font-style: normal; font-weight: 700; }
.wa-toast-head time { color: #8a96ab; font-size: 11px; }
.wa-toast-body b { color: #0f1f3d; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.15s; }
.wa-toast-body small { color: #56627a; font-size: 12.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; max-width: none; }
.wa-toast-close { flex: none; align-self: flex-start; width: 28px; height: 28px; margin: 8px 0 0 8px; border: 0; border-radius: 50%; background: transparent; color: #8a96ab; font-size: 13px; cursor: pointer; }
.wa-toast-close:hover { background: #eef2f9; color: #0f1f3d; }
.wa-toast-progress { position: absolute; bottom: 0; right: 0; height: 3px; width: 100%; background: linear-gradient(90deg, #25d366, #1b5fd6); transform-origin: right; animation: wa-toast-progress 6s linear forwards; opacity: 0.7; }
.wa-toast.is-paused .wa-toast-progress { animation-play-state: paused; }
@keyframes wa-toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 767px) { .wa-toast-stack { left: 12px; right: 12px; bottom: 84px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .wa-toast-progress { animation: none; } }

/* ---------- تنبيه تفعيل إشعارات سطح المكتب ---------- */
.notify-permission { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 12px 10px; padding: 9px 12px; border: 1px solid #cfe0fb; border-radius: 12px; background: #eef4ff; color: #0f2a5c; font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.notify-permission button { flex: none; padding: 5px 14px; border: 0; border-radius: 999px; background: #1b5fd6; color: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.notify-permission button:hover { background: #164db0; }

/* ======================================================================
   مركز التنبيهات
   ====================================================================== */
.notif-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 22px; margin-bottom: 14px; border-radius: 18px; color: #fff;
  background: radial-gradient(420px 200px at 15% 120%, rgba(47, 123, 240, 0.55), transparent 60%), linear-gradient(135deg, #0b2b5e, #123f86);
  box-shadow: 0 12px 30px rgba(11, 43, 94, 0.18);
}
.notif-hero-main { display: flex; align-items: center; gap: 14px; }
.notif-hero-bell { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, 0.14); }
.notif-hero-main strong { display: block; font-size: 18px; font-weight: 800; }
.notif-hero-main small { display: block; font-size: 12.5px; opacity: 0.8; margin-top: 2px; }
.notif-hero .primary-button { background: #fff; color: #0b2b5e; border-color: #fff; font-weight: 700; }
.notif-hero .primary-button:disabled { background: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.7); border-color: transparent; }

.notif-summaries { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.notif-summary {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border: 1px solid #e3e9f4; border-radius: 16px; background: #fff; color: #0f1f3d; font: inherit; text-align: right; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.notif-summary:hover { border-color: #bcd2f5; box-shadow: 0 8px 20px rgba(11, 43, 94, 0.08); transform: translateY(-1px); }
.notif-summary.is-active { border-color: #1b5fd6; box-shadow: 0 0 0 3px rgba(27, 95, 214, 0.12); }
.notif-summary-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; }
.notif-summary-text small { display: block; color: #56627a; font-size: 12.5px; font-weight: 600; }
.notif-summary-text strong { display: block; font-size: 22px; font-weight: 800; line-height: 1.2; }
.notif-summary em { position: absolute; top: 10px; left: 12px; padding: 2px 8px; border-radius: 999px; background: #e8f0ff; color: #1b5fd6; font-size: 11px; font-style: normal; font-weight: 700; }

.notif-cat-orders .notif-summary-icon, .notif-row.notif-cat-orders .notif-icon { background: #e8f0ff; color: #1b5fd6; }
.notif-cat-carts .notif-summary-icon, .notif-row.notif-cat-carts .notif-icon { background: #fff3e0; color: #d9730d; }
.notif-cat-service .notif-summary-icon, .notif-row.notif-cat-service .notif-icon { background: #e6f7ef; color: #128c4a; }
.notif-cat-system .notif-summary-icon, .notif-row.notif-cat-system .notif-icon { background: #f0eefc; color: #6c3fd1; }

.notif-panel { padding: 18px 20px !important; }
.notif-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.notif-tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.notif-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid #e3e9f4; border-radius: 999px;
  background: #fff; color: #33415c; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.notif-tab b { padding: 0 7px; border-radius: 999px; background: #eef2f9; color: #33415c; font-size: 11.5px; line-height: 20px; }
.notif-tab:hover { border-color: #bcd2f5; }
.notif-tab.is-active { background: #1b5fd6; border-color: #1b5fd6; color: #fff; }
.notif-tab.is-active b { background: rgba(255, 255, 255, 0.22); color: #fff; }
.notif-toolbar .nq-search { width: min(280px, 100%); }
.notif-hint { margin: 10px 0 4px !important; }

.notif-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.notif-day { display: flex; align-items: center; gap: 10px; margin: 12px 0 2px; color: #56627a; font-size: 12.5px; font-weight: 700; }
.notif-day::after { content: ""; flex: 1; height: 1px; background: #e8edf5; }
.notif-list .notif-row {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin: 0;
  border: 1px solid #e8edf5; border-radius: 14px; background: #fff; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.notif-list .notif-row.is-unread { background: #f6f9ff; border-color: #d6e4fb; }
.notif-list .notif-row.is-unread::before { content: ""; position: absolute; top: 14px; bottom: 14px; right: 0; width: 3px; border-radius: 3px; background: #1b5fd6; }
.notif-list .notif-row.is-link { cursor: pointer; }
.notif-list .notif-row.is-link:hover { border-color: #bcd2f5; box-shadow: 0 6px 16px rgba(11, 43, 94, 0.07); }
.notif-list .notif-row:focus-visible { outline: 2px solid #1b5fd6; outline-offset: 2px; }
.notif-list .notif-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; font-size: 0; }
.notif-list .notif-main { flex: 1; min-width: 0; }
.notif-list .notif-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.notif-list .notif-top strong { font-size: 14.5px; font-weight: 700; color: #0f1f3d; }
.notif-list .notif-row:not(.is-unread) .notif-top strong { font-weight: 600; color: #33415c; }
.notif-list .notif-top time { flex: none; color: #8a96ab; font-size: 12px; }
.notif-list .notif-main p { margin: 4px 0 8px; color: #33415c; font-size: 13.5px; line-height: 1.7; overflow-wrap: anywhere; }
.notif-list .notif-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.notif-tag { padding: 2px 9px; border-radius: 999px; background: #eef2f9; color: #33415c; font-size: 11.5px; font-weight: 600; }
.notif-tag.is-soft { background: transparent; border: 1px solid #e3e9f4; color: #56627a; }
.notif-go { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: auto; color: #1b5fd6; font-size: 12.5px; font-weight: 700; }
.notif-list .notif-read {
  flex: none; align-self: center; width: 12px; height: 12px; padding: 0; border: 0; border-radius: 50%;
  background: #1b5fd6; box-shadow: 0 0 0 4px rgba(27, 95, 214, 0.15); cursor: pointer;
}
.notif-list .notif-read:hover { box-shadow: 0 0 0 6px rgba(27, 95, 214, 0.2); }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 16px; color: #56627a; text-align: center; }
.notif-empty svg { color: #25a36a; }
.notif-empty strong { color: #0f1f3d; font-size: 15px; }
.notif-more { display: flex; justify-content: center; margin-top: 14px; }

@media (max-width: 900px) { .notif-summaries { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .notif-hero { padding: 14px 16px; border-radius: 16px; }
  .notif-hero-actions, .notif-hero .primary-button { width: 100%; }
  .notif-summary { padding: 12px; gap: 10px; }
  .notif-summary-icon { width: 36px; height: 36px; }
  .notif-summary-text strong { font-size: 19px; }
  .notif-panel { padding: 14px 12px !important; }
  .notif-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; }
  .notif-tabs::-webkit-scrollbar { display: none; }
  .notif-tab { flex: none; }
  .notif-toolbar .nq-search { width: 100%; }
  .notif-list .notif-row { padding: 12px; gap: 10px; }
  .notif-list .notif-icon { width: 36px; height: 36px; }
  .notif-go { margin-inline-start: 0; width: 100%; }
}
@media (max-width: 760px) {
  .notif-summary em { top: auto; bottom: 10px; left: 10px; }
  .notif-summary-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .notif-summary-text { min-width: 0; }
}

/* ---------- شريط تفعيل الإشعارات: صف مستقل فوق المحادثات ---------- */
.wa-list:has(> .notify-permission) { grid-template-rows: auto auto minmax(0, 1fr); }
.wa-list > .notify-permission {
  display: flex; align-items: center; gap: 10px; margin: 8px 12px 10px; padding: 10px 12px;
  border: 1px solid #cfe0fb; border-radius: 12px; background: #eef4ff; color: #0f2a5c;
  font-size: 12.5px; font-weight: 600; line-height: 1.6; overflow: visible; min-height: 0;
}
.wa-list > .notify-permission > span { flex: 1; min-width: 0; }
.wa-list > .notify-permission.is-denied { border-color: #f4d9a6; background: #fff8ea; color: #7a4b00; }
.wa-list > .notify-permission [data-enable-notify] { flex: none; }
.notify-permission .notify-close {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit; opacity: 0.6; font-size: 12px; cursor: pointer;
}
.notify-permission .notify-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }

/* ---------- أيقونات SVG موحدة ---------- */
.nq-icon { display: block; flex: none; }
.nav-icon { display: grid !important; place-items: center; width: 28px !important; height: 28px !important; border-radius: 8px !important; font-size: 0 !important; background: rgba(255, 255, 255, 0.1) !important; color: #cfe0ff; transition: background 0.15s, color 0.15s; }
.nav-button:hover .nav-icon { background: rgba(255, 255, 255, 0.18) !important; color: #fff; }
.nav-button.active .nav-icon { background: #e8f0ff !important; color: #1b5fd6 !important; }
#notificationButton svg { display: block; }
.close-dialog svg { display: block; margin: auto; }
.wa-reply-btn svg, .image-viewer-btn svg, .wa-toast-close svg, .notify-close svg, .install-close svg { display: block; margin: auto; }
.notify-permission > span { display: flex; align-items: center; gap: 8px; }
.notify-permission > span .nq-icon { flex: none; }
.wa-location-pin, .wa-contact-avatar, .wa-audio-icon { display: grid; place-items: center; color: #1b5fd6; }
.wa-body .wa-msg .wa-buttons span::before {
  content: ""; width: 14px; height: 14px; opacity: 0.85; transform: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 17 5-5-5-5'/%3E%3Cpath d='M4 18v-2a4 4 0 0 1 4-4h12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 17 5-5-5-5'/%3E%3Cpath d='M4 18v-2a4 4 0 0 1 4-4h12'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- خانات التاريخ: تلميح عربي صحيح بدل نص كروم المعكوس ---------- */
.date-field { position: relative; display: inline-flex; align-items: stretch; min-width: 0; }
.date-field > input[type="date"] { flex: 1; min-width: 0; width: 100%; }
.date-field.is-empty > input[type="date"]::-webkit-datetime-edit { color: transparent; }
.date-field.is-empty::after {
  content: attr(data-hint); position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  color: #8a96ab; font-size: 13px; font-weight: 500; pointer-events: none; white-space: nowrap;
}
label > .date-field, .field > .date-field { width: 100%; }

/* ---------- بطاقة المستخدم في القائمة الجانبية ---------- */
.sidebar .sidebar-user {
  display: flex !important; align-items: center; gap: 6px;
  padding: 8px !important; border-radius: 16px !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.sidebar .sidebar-user .user-identity {
  flex: 1; min-width: 0; display: flex !important; align-items: center; gap: 10px;
  width: auto !important; margin: 0 !important; padding: 6px !important; border-radius: 12px !important;
  transition: background 0.15s;
}
.sidebar .sidebar-user .user-identity:hover { background: rgba(255, 255, 255, 0.08) !important; }
.sidebar .sidebar-user .user-identity:hover strong { text-decoration: none !important; }
.sidebar .sidebar-user .avatar {
  position: relative; flex: none; width: 40px !important; height: 40px !important; border-radius: 12px !important;
  background: linear-gradient(135deg, #3b86f5, #1b5fd6) !important; color: #fff; font-size: 17px !important; font-weight: 800;
  box-shadow: 0 4px 12px rgba(27, 95, 214, 0.35);
}
.sidebar .sidebar-user .avatar-dot {
  position: absolute; bottom: -2px; left: -2px; width: 11px; height: 11px; border-radius: 50%;
  background: #34d17a; border: 2px solid #0f2a5c;
}
.sidebar .sidebar-user .user-meta { flex: 1; min-width: 0; display: flex !important; flex-direction: column; gap: 3px; }
.sidebar .sidebar-user .user-meta strong { color: #fff; font-size: 13.5px !important; font-weight: 700; }
.sidebar .sidebar-user .user-sub { display: flex !important; align-items: center; gap: 6px; min-width: 0; font-size: 11px !important; color: #9fbbe6 !important; }
.sidebar .sidebar-user .user-sub em {
  flex: none; padding: 1px 7px; border-radius: 999px; background: rgba(143, 176, 224, 0.18);
  color: #cfe0ff; font-style: normal; font-weight: 700; font-size: 10.5px; line-height: 16px;
}
.sidebar .sidebar-user .user-sub bdi { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.85; }
.sidebar .sidebar-user .user-edit { flex: none; display: grid; place-items: center; color: #8fb0e0; opacity: 0; transition: opacity 0.15s; }
.sidebar .sidebar-user .user-identity:hover .user-edit, .sidebar .sidebar-user .user-identity:focus-visible .user-edit { opacity: 1; }
.sidebar .sidebar-user .user-actions { display: block !important; flex: none; margin: 0 !important; }
.sidebar .sidebar-user .user-logout {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid rgba(255, 140, 160, 0.28); border-radius: 12px; background: rgba(214, 69, 96, 0.14);
  color: #ffb3c1; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sidebar .sidebar-user .user-logout:hover { background: #d64560; border-color: #d64560; color: #fff; }
.sidebar .sidebar-user .user-logout:focus-visible { outline: 2px solid #ffb3c1; outline-offset: 2px; }
.sidebar .sidebar-user .user-logout .nq-icon { transform: scaleX(-1); }
.sidebar .sidebar-user .user-logout span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) {
  body.mobile-nav-open .sidebar .sidebar-user { display: flex !important; }
}

/* ---------- القائمة الجانبية ثابتة بطول الشاشة مهما طالت الصفحة ---------- */
@media (min-width: 761px) {
  .app-shell { align-items: start !important; }
  .app-shell > .sidebar {
    position: sticky !important; top: 0 !important; align-self: start !important;
    height: 100vh !important; height: 100dvh !important; max-height: 100dvh !important;
    overflow-y: auto !important; overflow-x: hidden !important; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  }
  .app-shell > .sidebar::-webkit-scrollbar { width: 6px; }
  .app-shell > .sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 6px; }
  .app-shell > .sidebar .sidebar-user { margin-top: auto !important; flex: none; }
  .app-shell > .sidebar .nav-list { flex: none; }
}
/* overflow-x: hidden on html/body turns body into a scroll box and breaks
   sticky; clip hides horizontal overflow without that side effect. */
html, body { overflow-x: clip !important; overflow-y: visible !important; }
body.wa-app-mode { overflow: hidden !important; }
body.mobile-nav-open { overflow: hidden !important; }
@media (min-width: 761px) {
  .app-shell > .sidebar { display: flex !important; flex-direction: column !important; overflow-y: hidden !important; }
  .app-shell > .sidebar .nav-list { flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; margin-inline: -4px; padding-inline: 4px; }
  .app-shell > .sidebar .nav-list::-webkit-scrollbar { width: 5px; }
  .app-shell > .sidebar .nav-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 5px; }
  .app-shell > .sidebar .brand, .app-shell > .sidebar .sidebar-user, .app-shell > .sidebar .sidebar-footer { flex: none !important; }
  .app-shell > .sidebar .sidebar-user { margin-top: 10px !important; }
}

/* بطاقة المستخدم: الاسم كامل وزر خروج أصغر */
.sidebar .sidebar-user .user-meta strong { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.35 !important; overflow-wrap: anywhere; }
.sidebar .sidebar-user .user-identity { position: relative; }
.sidebar .sidebar-user .user-edit { position: absolute; top: 4px; left: 4px; }
.sidebar .sidebar-user .user-logout { width: 30px !important; height: 30px !important; border-radius: 9px !important; align-self: center; }
.sidebar .sidebar-user .avatar { width: 36px !important; height: 36px !important; font-size: 15px !important; }

/* ---------- تبويبات صفحة الفريق ---------- */
.team-tabs {
  display: flex; gap: 6px; margin-bottom: 14px; padding: 6px;
  border: 1px solid #e3e9f4; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(11, 43, 94, 0.04);
  overflow-x: auto; scrollbar-width: none;
}
.team-tabs::-webkit-scrollbar { display: none; }
.team-tab {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px; border: 0; border-radius: 12px; background: transparent;
  color: #33415c; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.team-tab:hover { background: #f1f5fc; color: #0f2a5c; }
.team-tab.is-active { background: #1b5fd6; color: #fff; box-shadow: 0 6px 16px rgba(27, 95, 214, 0.25); }
.team-tab b { min-width: 22px; padding: 0 7px; border-radius: 999px; background: #eef2f9; color: #33415c; font-size: 11.5px; line-height: 20px; }
.team-tab.is-active b { background: rgba(255, 255, 255, 0.22); color: #fff; }
@media (max-width: 760px) {
  .team-tabs { border-radius: 14px; margin-bottom: 10px; }
  .team-tab { flex: 0 0 auto; min-height: 40px; padding: 6px 12px; font-size: 13px; }
}

/* ======================================================================
   المستخدمون: بطاقة موحدة للشخص + نافذة التعديل والصلاحيات
   ====================================================================== */
.person-card.is-suspended { opacity: 0.7; }
.staff-avatar.account { background: linear-gradient(135deg, #6c3fd1, #4a2aa0) !important; color: #fff !important; }
.person-access { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.person-role { padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: #eef2f9; color: #33415c; }
.person-role.role-admin { background: #0f2a5c; color: #fff; }
.person-role.role-operations { background: #e8f0ff; color: #1b5fd6; }
.person-role.role-employee { background: #e6f7ef; color: #128c4a; }
.person-role.role-technician { background: #fff3e0; color: #b35d00; }
.person-role.role-none { background: transparent; border: 1px dashed #c7d2e3; color: #56627a; }
.person-username { color: #56627a; font-size: 12px; }
.person-pages { color: #8a96ab; font-size: 11.5px; }

.dialog-body:has(.person-form) { width: min(760px, 96vw); }
.person-form { display: flex; flex-direction: column; gap: 16px; }
.person-form-head { display: flex; align-items: center; gap: 12px; padding-left: 40px; }
.person-form-head h2 { margin: 0; font-size: 19px; }
.person-form-head p { margin: 2px 0 0; }
.person-section { padding: 14px 16px; border: 1px solid #e3e9f4; border-radius: 14px; background: #fbfcfe; }
.person-section h3 { margin: 0 0 10px; font-size: 14.5px; color: #0f2a5c; }
.person-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.person-section-head h3 { margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: #1b5fd6; }
.person-login[hidden] { display: none !important; }
.perm-title { margin: 14px 0 8px; font-size: 13px; color: #33415c; }
.access-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.access-level { position: relative; cursor: pointer; }
.access-level input { position: absolute; opacity: 0; pointer-events: none; }
.access-level span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px; border: 1px solid #dbe3f0; border-radius: 12px; background: #fff; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.access-level b { font-size: 13.5px; color: #0f1f3d; }
.access-level small { font-size: 11.5px; color: #56627a; line-height: 1.5; }
.access-level input:checked + span { border-color: #1b5fd6; background: #f3f7ff; box-shadow: 0 0 0 3px rgba(27, 95, 214, 0.14); }
.access-level input:focus-visible + span { outline: 2px solid #1b5fd6; outline-offset: 2px; }
.access-level input:disabled + span { opacity: 0.6; cursor: not-allowed; }
.perm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.perm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.perm-group { margin: 0; padding: 10px 12px; border: 1px solid #e3e9f4; border-radius: 12px; background: #fff; min-width: 0; }
.perm-group legend { padding: 0 6px; font-size: 12px; font-weight: 700; color: #56627a; }
.perm-item { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 13px; cursor: pointer; }
.perm-item input { width: 17px; height: 17px; flex: none; accent-color: #1b5fd6; }
.perm-item span { display: inline-flex; align-items: center; gap: 6px; color: #0f1f3d; }
.perm-item span .nq-icon { color: #56627a; }
.perm-item input:disabled + span { opacity: 0.7; }
.perm-note { margin: 8px 0 0 !important; }
.person-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; }
@media (max-width: 760px) {
  .access-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perm-grid { grid-template-columns: 1fr; }
  .person-section { padding: 12px; }
  .person-form-foot { flex-direction: column-reverse; align-items: stretch; }
  .person-form-foot .row-actions { justify-content: stretch; }
  .person-form-foot .row-actions > * { flex: 1; }
}
.dialog:has(.person-form) { width: min(780px, 96vw) !important; max-width: 96vw !important; }
.dialog-body:has(.person-form) { width: auto !important; overflow-x: hidden !important; }
.person-form .form-grid { min-width: 0; }
.person-form .field > * { min-width: 0; max-width: 100%; }

/* ---------- صلاحيات الأدوار ---------- */
#rolesButton { display: inline-flex; align-items: center; gap: 6px; }
.roles-matrix-wrap { border: 1px solid #e3e9f4; border-radius: 14px; overflow: auto; max-height: min(58vh, 520px); }
.roles-matrix { width: 100%; margin: 0 !important; }
.roles-matrix thead th { position: sticky; top: 0; z-index: 1; background: #f6f9ff; }
.roles-matrix th.role-col, .roles-matrix td.role-col { width: 110px; text-align: center; }
.roles-matrix th.role-col b { display: block; font-size: 13px; color: #0f1f3d; }
.roles-matrix th.role-col small { display: block; font-size: 11px; font-weight: 500; color: #8a96ab; }
.roles-matrix td.role-col input { width: 18px; height: 18px; accent-color: #1b5fd6; cursor: pointer; }
.roles-matrix td.role-col input:disabled { cursor: not-allowed; opacity: 0.55; }
.roles-matrix .roles-group td { padding: 8px 14px !important; background: #fbfcfe; color: #56627a; font-size: 12px; font-weight: 700; }
.roles-page { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #0f1f3d; }
.roles-page .nq-icon { color: #56627a; }
.roles-matrix tbody tr:not(.roles-group):hover td { background: #f8fbff; }
@media (max-width: 760px) {
  .roles-matrix th.role-col, .roles-matrix td.role-col { width: 70px; }
  .roles-matrix th.role-col small { display: none; }
}
.roles-matrix { min-width: 0 !important; table-layout: fixed; }
.roles-matrix th:first-child, .roles-matrix td:first-child { width: auto; }
.roles-matrix th, .roles-matrix td { white-space: normal !important; }
.roles-matrix-wrap { overflow-x: hidden; overflow-y: auto; }

/* ======================================================================
   قائمة المستخدمين المختصرة + صفحة المستخدم
   ====================================================================== */
.person-list { display: flex; flex-direction: column; border: 1px solid #e3e9f4; border-radius: 14px; overflow: hidden; background: #fff; }
.person-list-head, .person-row { display: grid; grid-template-columns: 44px minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.4fr) 20px; align-items: center; gap: 12px; padding: 10px 16px; }
.person-list-head { background: #f6f9ff; color: #56627a; font-size: 12px; font-weight: 700; border-bottom: 1px solid #e3e9f4; }
.person-row { color: inherit; text-decoration: none; border-bottom: 1px solid #eef2f8; transition: background 0.15s; }
.person-row:last-child { border-bottom: 0; }
.person-row:hover { background: #f6f9ff; }
.person-row:focus-visible { outline: 2px solid #1b5fd6; outline-offset: -2px; }
.person-row.is-suspended { opacity: 0.6; }
.person-row .staff-avatar { width: 40px !important; height: 40px !important; font-size: 16px !important; }
.person-row-main { display: flex; flex-direction: column; min-width: 0; }
.person-row-main b { font-size: 14px; color: #0f1f3d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-row-main small { font-size: 12px; color: #56627a; }
.person-self { margin-inline-start: 6px; padding: 0 7px; border-radius: 999px; background: #e6f7ef; color: #128c4a; font-size: 11px; font-style: normal; font-weight: 700; }
.person-row-access { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.person-row-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #33415c; }
.avail-dot { width: 8px; height: 8px; border-radius: 50%; background: #8a96ab; }
.avail-available { background: #25a36a; } .avail-busy { background: #e59a1a; } .avail-leave { background: #d64560; }
.person-row-work { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: #56627a; }
.person-row-work b { color: #0f1f3d; }
.person-row-work .is-late, .person-row-work .is-late b { color: #c0243c; }
.person-row-go { color: #8a96ab; display: grid; place-items: center; }
.person-row:hover .person-row-go { color: #1b5fd6; }

.pp-back { margin-bottom: 10px; }
.pp-back a { display: inline-flex; align-items: center; gap: 4px; color: #1b5fd6; font-size: 13px; font-weight: 700; text-decoration: none; }
.pp-back a svg { transform: scaleX(-1); }
.pp-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 22px; margin-bottom: 14px; border: 1px solid #e3e9f4; border-radius: 18px; background: #fff; }
.pp-avatar { width: 64px !important; height: 64px !important; font-size: 26px !important; border-radius: 18px !important; }
.pp-hero-main { flex: 1; min-width: 200px; }
.pp-hero-main h2 { margin: 0; font-size: 21px; color: #0f1f3d; }
.pp-hero-main p { margin: 3px 0 8px; color: #56627a; font-size: 13.5px; }
.pp-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pp-hero-actions { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.pp-avail { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: #56627a; }
.pp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.pp-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pp-col > .panel { margin: 0 !important; }
.pp-stats { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 14px !important; }
.pp-stats > div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; background: #f6f9ff; }
.pp-stats b { font-size: 22px; color: #0f1f3d; }
.pp-stats span { font-size: 12px; color: #56627a; text-align: center; }
.pp-stats .is-late b { color: #c0243c; }
.pp-list { display: flex; flex-direction: column; gap: 6px; }
.pp-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #eef2f8; border-radius: 12px; color: inherit; text-decoration: none; }
a.pp-item:hover { border-color: #bcd2f5; background: #f8fbff; }
.pp-item.is-late { border-color: #f5c2c7; background: #fff7f8; }
.pp-item-main { display: flex; flex-direction: column; min-width: 0; }
.pp-item-main b { font-size: 13.5px; color: #0f1f3d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-item-main small { font-size: 12px; color: #56627a; }
.pp-empty { margin: 4px 0 !important; }
.pp-contact { display: flex; flex-direction: column; gap: 6px; }
.pp-contact a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #eef2f8; border-radius: 12px; color: inherit; text-decoration: none; }
.pp-contact a:hover { border-color: #bcd2f5; }
.pp-contact span { font-size: 12px; color: #56627a; }
.pp-contact b { font-size: 13.5px; color: #1b5fd6; }
.pp-facts { display: grid; gap: 8px; margin: 0; }
.pp-facts div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed #e3e9f4; }
.pp-facts dt { font-size: 12.5px; color: #56627a; }
.pp-facts dd { margin: 0; font-size: 13px; font-weight: 700; color: #0f1f3d; }
.pp-sub { margin: 14px 0 8px; font-size: 13px; color: #33415c; }
.pp-pages { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-pages span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: #eef4ff; color: #1b5fd6; font-size: 12px; font-weight: 600; }
.pp-account-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

@media (max-width: 1100px) { .pp-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .person-list-head { display: none; }
  .person-row { grid-template-columns: 40px minmax(0, 1fr) 16px; grid-template-areas: "av main go" "av access go" "av work go"; row-gap: 4px; padding: 12px; }
  .person-row .staff-avatar { grid-area: av; align-self: start; }
  .person-row-main { grid-area: main; }
  .person-row-access { grid-area: access; }
  .person-row-status { display: none; }
  .person-row-work { grid-area: work; }
  .person-row-go { grid-area: go; }
  .pp-hero { padding: 16px; }
  .pp-hero-actions { width: 100%; }
  .pp-hero-actions .primary-button { flex: 1; }
  .pp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.person-role.role-customerService { background: #e8f0ff; color: #1b5fd6; }

/* ---------- صفحة المستخدمين: ترويسة، بطاقات الأدوار، شريط الفلترة ---------- */
.users-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; padding: 14px 18px; border: 1px solid #e3e9f4; border-radius: 16px; background: #fff; }
.users-stats { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 0; color: #56627a; font-size: 13px; }
.users-stats span { display: inline-flex; align-items: center; gap: 6px; }
.users-stats b { color: #0f1f3d; font-size: 16px; }
.users-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.users-head-actions .secondary-button { display: inline-flex; align-items: center; gap: 6px; }
.role-cards { margin-bottom: 14px; }
.role-card { flex-wrap: wrap; }
.role-card .role-card-pages { position: static !important; flex-basis: 100%; margin-top: 2px; padding: 0 !important; background: transparent !important; color: #8a96ab !important; font-size: 11.5px !important; font-weight: 600 !important; }
.role-card-admin .notif-summary-icon { background: #e6ebf5; color: #0f2a5c; }
.role-card-customerService .notif-summary-icon { background: #e8f0ff; color: #1b5fd6; }
.role-card-employee .notif-summary-icon { background: #e6f7ef; color: #128c4a; }
.role-card-technician .notif-summary-icon { background: #fff3e0; color: #d9730d; }
.users-panel { padding: 16px 18px !important; }
.users-panel .notif-toolbar { margin-bottom: 12px; }
@media (max-width: 760px) {
  .users-head { padding: 12px 14px; }
  .users-head-actions { width: 100%; }
  .users-head-actions > * { flex: 1; justify-content: center; }
  .users-stats { gap: 12px; }
  .users-panel { padding: 12px !important; }
}

/* ---------- قوالب واتساب ---------- */
#syncWatiTemplates { display: inline-flex; align-items: center; gap: 6px; }
.tpl-list { display: flex; flex-direction: column; gap: 10px; }
.tpl-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid #e3e9f4; border-radius: 14px; background: #fff; }
.tpl-card.is-muted { background: #fbfcfe; }
.tpl-card.is-muted .tpl-body { opacity: 0.7; }
.tpl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tpl-label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 260px; max-width: 420px; }
.tpl-label span { font-size: 12px; font-weight: 700; color: #56627a; }
.tpl-label input { font-weight: 700; }
.tpl-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tpl-meta code { padding: 3px 8px; border-radius: 8px; background: #f1f5fc; color: #33415c; font-size: 12px; }
.tpl-meta input[name="templateName"] { width: 220px; }
.tpl-lang { color: #8a96ab; font-size: 11.5px; font-weight: 700; text-transform: uppercase; }
.tpl-body { padding: 10px 12px; border-radius: 12px; background: #eefbe9; border: 1px solid #d7f0cc; font-size: 13.5px; line-height: 1.8; color: #111b21; }
.tpl-body p { margin: 0; white-space: pre-line; }
.tpl-body b { display: block; margin-bottom: 4px; }
.tpl-body small { display: block; margin-top: 6px; color: #667781; font-size: 12px; }
.tpl-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tpl-buttons span { padding: 4px 12px; border-radius: 999px; background: #fff; border: 1px solid #d7e3f5; color: #027eb5; font-size: 12px; font-weight: 700; }
.tpl-textarea { width: 100%; min-height: 64px; }
.tpl-params { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tpl-params-title { font-size: 12px; font-weight: 700; color: #56627a; }
.tpl-param { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border: 1px solid #e3e9f4; border-radius: 10px; background: #fbfcfe; }
.tpl-param code { font-size: 12px; color: #1b5fd6; }
.tpl-param span { color: #8a96ab; }
.tpl-param select { min-height: 32px; padding-block: 2px; }
.tpl-hint { margin: 12px 0 0 !important; }
@media (max-width: 760px) { .tpl-label { max-width: none; } .tpl-meta input[name="templateName"] { width: 100%; } }

/* ======================================================================
   تتبع الفنيين: خريطة حية + قائمة الفريق
   ====================================================================== */
.trk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 12px 16px; border: 1px solid #e3e9f4; border-radius: 16px; background: #fff; }
.trk-live { display: flex; align-items: center; gap: 8px; color: #0f1f3d; }
.trk-live small { color: #6b7489; font-size: 12px; }
.trk-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #15803d; box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.5); animation: trk-pulse 1.8s infinite; }
@keyframes trk-pulse { 0% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.45); } 70% { box-shadow: 0 0 0 10px rgba(21, 128, 61, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); } }
.trk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.trk-actions .secondary-button { display: inline-flex; align-items: center; gap: 6px; }
.trk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: stretch; }
.trk-map-wrap { position: relative; min-height: 560px; border: 1px solid #e3e9f4; border-radius: 18px; overflow: hidden; background: #eef2f7; }
.trk-map { position: absolute; inset: 0; }
.trk-legend { position: absolute; z-index: 500; top: 12px; right: 12px; display: flex; gap: 10px; flex-wrap: wrap; padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.92); box-shadow: 0 4px 14px rgba(11, 27, 61, 0.12); font-size: 11.5px; font-weight: 600; color: #33415c; }
.trk-legend span { display: inline-flex; align-items: center; gap: 5px; }
.trk-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg-tech { background: #2563eb; } .lg-stop { background: #f59e0b; } .lg-customer { background: #15803d; } .lg-warehouse { background: #0b1b3d; }
.trk-hint { position: absolute; z-index: 500; bottom: 16px; left: 50%; transform: translateX(-50%); padding: 8px 16px; border-radius: 12px; background: #0b1b3d; color: #fff; font-size: 13px; font-weight: 600; }
.trk-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.trk-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.trk-summary div { display: flex; flex-direction: column; align-items: center; padding: 12px 6px; border: 1px solid #e3e9f4; border-radius: 14px; background: #fff; }
.trk-summary b { font-size: 20px; color: #0b1b3d; }
.trk-summary span { font-size: 11.5px; color: #5c6478; }
.trk-people { display: flex; flex-direction: column; gap: 8px; max-height: 480px; overflow-y: auto; }
.trk-person { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border: 1px solid #e3e9f4; border-radius: 14px; background: #fff; font: inherit; text-align: right; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.trk-person:hover { border-color: #bcd2f5; }
.trk-person.is-focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14); }
.trk-avatar { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: #eef3fe; color: #2563eb; font-weight: 700; }
.trk-avatar.is-live::after { content: ""; position: absolute; bottom: -2px; left: -2px; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: #15803d; }
.trk-person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trk-person-main b { font-size: 14px; color: #0b1b3d; }
.trk-person-main small { font-size: 11.5px; color: #5c6478; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trk-status { font-size: 11.5px; font-weight: 700; color: #6b7489; }
.trk-status.is-live { color: #15803d; }
.trk-status.is-off { color: #b42318; }
.trk-person-stats { display: grid; grid-template-columns: auto auto; column-gap: 4px; align-items: baseline; font-size: 11px; color: #6b7489; }
.trk-person-stats b { font-size: 14px; color: #0b1b3d; }
.trk-empty { padding: 24px; text-align: center; color: #6b7489; font-size: 13px; }

/* map pins */
.nq-pin { display: grid !important; place-items: center; }
.pin-warehouse { border-radius: 11px; background: #0b1b3d; color: #fff; border: 2px solid #fff; box-shadow: 0 4px 12px rgba(11, 27, 61, 0.35); }
.pin-stop { border-radius: 50%; background: #f59e0b; color: #fff; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); font-size: 10.5px; }
.pin-customer { border-radius: 50%; background: #15803d; color: #fff; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25); }
.pin-current { border-radius: 50%; background: #2563eb; color: #fff; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45); font-weight: 700; font-size: 13px; }
.pin-done { border-radius: 50%; background: #15803d; color: #fff; border: 3px solid #fff; font-weight: 700; font-size: 12px; }
.pin-next { border-radius: 50%; background: #fff; color: #0b1b3d; border: 2px solid #0b1b3d; font-weight: 700; font-size: 12px; }
.pin-tech span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(11, 27, 61, 0.35); }
.pin-tech.is-live span { animation: trk-pulse 1.8s infinite; }
.pin-tech.is-idle span { filter: grayscale(0.6); opacity: 0.85; }
.pin-me { border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.18); }
.leaflet-container { font-family: inherit !important; }
.leaflet-tooltip { font-family: inherit; font-size: 12px; font-weight: 600; border-radius: 10px; }

@media (max-width: 1000px) { .trk-layout { grid-template-columns: 1fr; } .trk-map-wrap { min-height: 420px; } .trk-people { max-height: none; } }
@media (max-width: 760px) { .trk-map-wrap { min-height: 360px; border-radius: 16px; } .trk-toolbar { padding: 10px 12px; } }
/* softer map colours to match the app */
.nq-tiles { filter: saturate(0.75) brightness(1.03); }

/* ======================================================================
   المخزون والمستودعات والعُهد
   ====================================================================== */
.inv-kpis .notif-summary.is-static { cursor: default; }
.inv-kpis .notif-summary.is-static:hover { transform: none; box-shadow: none; border-color: #e3e9f4; }
.inv-ic-blue { background: #e8f0ff; color: #1b5fd6; } .inv-ic-green { background: #e6f7ef; color: #128c4a; }
.inv-ic-amber { background: #fff3e0; color: #d9730d; } .inv-ic-red { background: #fdecea; color: #b42318; }
.inv-danger { color: #b42318 !important; }
.inv-on { color: #128c4a; font-weight: 700; }
.inv-tabs { margin-top: 2px; }
.inv-actions { flex-wrap: wrap; }
.inv-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #eef4ff; color: #0f2a5c; font-size: 13px; }
.inv-table td strong { display: block; }
.inv-table td .muted { display: block; }
.inv-num { text-align: center !important; white-space: nowrap; }
.inv-type { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.inv-wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.inv-wh { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid #e3e9f4; border-radius: 16px; background: #fff; }
.inv-wh-head { display: flex; align-items: center; gap: 12px; }
.inv-wh-head > div { flex: 1; min-width: 0; }
.inv-wh-head h3 { margin: 0; font-size: 15px; color: #0f1f3d; }
.inv-wh-head small { font-size: 12px; color: #56627a; }
.inv-wh-ic { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #0b1b3d; color: #fff; }
.inv-wh-ic.inv-person { background: #eef3fe; color: #2563eb; font-weight: 700; font-size: 17px; }
.inv-wh-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.inv-wh-stats div { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px; background: #f6f9ff; }
.inv-wh-stats b { font-size: 17px; color: #0f1f3d; }
.inv-wh-stats span { font-size: 11px; color: #56627a; }
.inv-wh-team { display: flex; flex-wrap: wrap; gap: 6px; }
.inv-wh-team span { padding: 3px 10px; border-radius: 999px; background: #eef2f9; color: #33415c; font-size: 12px; font-weight: 600; }
.inv-wh-team span.is-on { background: #e6f7ef; color: #128c4a; }
.inv-wh-stock { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.inv-wh-stock li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 10px; background: #fbfcfe; font-size: 13px; }
.inv-wh-stock b { color: #0f1f3d; }
.inv-used { margin: 0 !important; }
.inv-wh .mini-button { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; }

.inv-modal { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; padding: 16px; background: rgba(8, 16, 36, 0.5); animation: m-fade 0.2s; }
.inv-modal-card { width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; border-radius: 20px; background: #fff; box-shadow: 0 24px 60px rgba(11, 27, 61, 0.3); overflow: hidden; }
.inv-modal-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid #eef2f8; }
.inv-modal-card header h2 { margin: 0; font-size: 17px; color: #0f1f3d; }
.inv-x { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: #f1f5fc; color: #33415c; cursor: pointer; }
.inv-modal-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.inv-modal-body .mini-button { align-self: flex-start; }
.inv-modal-card footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid #eef2f8; }
.inv-error { margin: 0 18px 4px; padding: 10px 12px; border-radius: 10px; background: #fff4f5; color: #b42335; font-size: 13px; font-weight: 600; }
.inv-wide { grid-column: 1 / -1; }
.inv-label { font-size: 13px; font-weight: 700; color: #33415c; }
.inv-lines { display: flex; flex-direction: column; gap: 8px; }
.inv-line { display: grid; grid-template-columns: minmax(0, 1fr) 110px 36px; gap: 8px; align-items: center; }
.inv-map { height: 280px; border-radius: 14px; border: 1px solid #e3e9f4; overflow: hidden; }

/* phone app: shift gate, custody, quantity sheets */
@media (max-width: 760px) {
  #mShell .m-shift-gate { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; border: 1px dashed #C9D8F7; background: #F6F9FF; }
  #mShell .m-shift-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: #0B1B3D; color: #fff; }
  #mShell .m-shift-gate > b { font-size: 15px; }
  #mShell .m-shift-gate p { margin: 0 0 6px; font-size: 12px; color: #5C6478; line-height: 1.7; }
  #mShell .m-shift-gate .m-btn { width: 100%; }
  #mShell .m-row.is-static { cursor: default; }
  #mShell .m-custody-qty { flex: none; font-size: 13px; font-weight: 700; color: #0B1B3D; }
  #mShell .m-qty-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid #EDEFF4; border-radius: 16px; }
  #mShell .m-stepper { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 14px; background: #F3F4F8; }
  #mShell .m-stepper button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 11px; background: #fff; font-size: 18px; font-weight: 700; color: #0B1B3D !important; cursor: pointer; box-shadow: 0 1px 2px rgba(11, 27, 61, 0.08); }
  #mShell .m-stepper b { min-width: 26px; text-align: center; font-size: 15px; }
  #mShell .m-sheet-actions { display: flex; gap: 8px; margin-top: 12px; }
  #mShell .m-track-pill:not(button) { cursor: default; opacity: 0.8; }
}

/* sidebar sections never stretch when a role has only a few pages */
.app-shell > .sidebar .nav-list { align-content: start !important; align-items: start; grid-auto-rows: max-content; }

/* typed password fields in user dialogs */
.pw-field { position: relative; }
.pw-field input { width: 100%; padding-inline-end: 46px !important; }
.pw-field .password-toggle { position: absolute; top: 50%; left: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: #7a879c; cursor: pointer; }
.pw-field .password-toggle:hover { background: #eef2f9; color: #0f2a5c; }
.pw-generate { margin-top: 6px; align-self: flex-start; }
/* the eye button sits on the left of left-to-right password fields */
.pw-field input[dir="ltr"] { padding-left: 46px !important; padding-right: 12px !important; }

/* warehouse team: link / unlink technicians */
.inv-wh-team span { display: inline-flex; align-items: center; gap: 4px; }
.inv-unlink { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: rgba(15, 31, 61, 0.08); color: #56627a; cursor: pointer; }
.inv-unlink:hover { background: #fdecea; color: #b42318; }
.inv-link-select { width: 100%; }

/* technician shifts on the person page */
.pp-shift-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.pp-shift-kpis > div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: #f6f9ff; }
.pp-shift-kpis b { font-size: 18px; color: #0f1f3d; }
.pp-shift-kpis span { font-size: 12px; color: #56627a; }
.pp-shift-kpis .is-accent { background: #0b1b3d; }
.pp-shift-kpis .is-accent b, .pp-shift-kpis .is-accent span { color: #fff; }
.pp-shift-table td strong, .pp-shift-table td .muted { display: block; }
@media (max-width: 760px) { .pp-shift-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pp-shift-table { min-width: 0 !important; width: 100%; }
.pp-shift-table th, .pp-shift-table td { white-space: normal !important; padding-inline: 10px !important; }
