﻿/* ================= دارة — تشغيل المكتب · 2030 ================= */

:root {
  /* هوية معمارية باردة: كحلي + تيل — بدون ورق كريمي */
  --brand: #0b3d5c;
  --brand-deep: #071a2b;
  --brand-soft: #0b3d5c14;
  --accent: #0d8f72;
  --accent-soft: #0d8f7216;

  --bg: #e8eef5;
  --surface: #ffffff;
  --surface-2: #f4f7fb;
  --sidebar: #061420;
  --sidebar-text: #9db0c0;
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: #0d8f72;
  --sidebar-active-text: #ffffff;
  --line: #d5deea;
  --line-strong: #b8c5d6;
  --text: #0c1a28;
  --text-2: #4a5d70;
  --text-3: #7a8b9c;

  --green: #0f7a52;
  --green-bg: #0f7a5216;
  --blue: #1565a8;
  --blue-bg: #1565a816;
  --amber: #a67c12;
  --amber-bg: #a67c1218;
  --red: #c0392b;
  --red-bg: #c0392b14;
  --purple: #4a5d78;
  --purple-bg: #4a5d7814;
  --gray: #5a6b7a;
  --gray-bg: #5a6b7a12;
  --orange: #c45a12;
  --orange-bg: #c45a1214;
  --pink: #a63d66;
  --pink-bg: #a63d6614;
  --brown: #7a5a42;
  --brown-bg: #7a5a4214;
  --teal: #0d8f72;
  --teal-bg: #0d8f7214;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --shadow-xs: 0 1px 0 rgba(7, 26, 43, 0.04);
  --shadow: 0 10px 30px rgba(7, 26, 43, 0.07);
  --shadow-lg: 0 24px 60px rgba(7, 26, 43, 0.14);
  --sidebar-w: 268px;
  --font: 'IBM Plex Sans Arabic', 'Cairo', 'Noto Sans Arabic', sans-serif;
  --font-display: 'Alexandria', 'IBM Plex Sans Arabic', sans-serif;
  --mesh-a: rgba(11, 61, 92, 0.07);
  --mesh-b: rgba(13, 143, 114, 0.06);
}

[data-theme='dark'] {
  --bg: #070d14;
  --surface: #0f1720;
  --surface-2: #141e2a;
  --sidebar: #050a10;
  --sidebar-text: #a8b8c8;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: #0d8f72;
  --sidebar-active-text: #ffffff;
  --line: #1e2c3a;
  --line-strong: #2a3c4e;
  --text: #e8eef5;
  --text-2: #9aabbc;
  --text-3: #6b7d90;
  --brand-soft: #0d8f7228;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.55);
  --green-bg: #0f7a5230;
  --blue-bg: #1565a830;
  --amber-bg: #a67c1230;
  --red-bg: #c0392b30;
  --purple-bg: #4a5d7830;
  --gray-bg: #5a6b7a30;
  --orange-bg: #c45a1230;
  --pink-bg: #a63d6630;
  --brown-bg: #7a5a4230;
  --teal-bg: #0d8f7230;
  --mesh-a: rgba(13, 143, 114, 0.08);
  --mesh-b: rgba(11, 61, 92, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 90% 55% at 100% -10%, var(--mesh-a), transparent 55%),
    radial-gradient(ellipse 70% 45% at -5% 100%, var(--mesh-b), transparent 50%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 92%, #c5d4e8) 0%, var(--bg) 42%, var(--bg) 100%);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--brand);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 20px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ================= شاشة الإقلاع ================= */
.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  background:
    radial-gradient(ellipse 80% 55% at 50% 35%, rgba(13, 143, 114, 0.22), transparent 58%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(11, 61, 92, 0.35), transparent 50%),
    linear-gradient(160deg, #040c14 0%, #071a2b 50%, #052018 100%);
  z-index: 999;
}
.boot-inner {
  display: grid;
  justify-items: center;
  gap: 16px;
  animation: bootIn 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.boot-logo {
  width: auto;
  min-width: 128px;
  height: auto;
  padding: 20px 40px;
  border-radius: 4px 18px 4px 18px;
  background: linear-gradient(135deg, #0d8f72 0%, #0b3d5c 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 0.14em;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 24px 64px rgba(0, 0, 0, 0.45);
}
.boot-text {
  color: rgba(180, 200, 215, 0.75);
  font-size: 12.5px;
  letter-spacing: 0.22em;
  font-family: var(--font-display);
  font-weight: 600;
}
@keyframes bootIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes bootPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 20px 56px rgba(196, 163, 90, 0.25);
  }
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.07);
    opacity: 1;
  }
}

/* ================= الهيكل ================= */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns 0.22s ease;
}

/* سطح المكتب: طي القائمة لمساحة الجداول (عروض / طلبات…) */
#app.nav-collapsed {
  grid-template-columns: 0 1fr;
}

#app.nav-collapsed .sidebar {
  width: 0;
  min-width: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  border: none;
  box-shadow: none;
  pointer-events: none;
  visibility: hidden;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(13, 143, 114, 0.08) 0%, transparent 28%),
    var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  gap: 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  border-inline-end: 1px solid var(--sidebar-border);
  box-shadow: 8px 0 32px rgba(4, 12, 20, 0.18);
  width: var(--sidebar-w);
  box-sizing: border-box;
  transition: width 0.22s ease, opacity 0.18s ease, padding 0.22s ease, visibility 0.18s;
}

.sidebar .brand {
  position: relative;
}

.sidebar-close {
  margin-inline-start: auto;
  width: 32px;
  height: 32px;
  color: var(--sidebar-text) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  font-size: 18px;
  line-height: 1;
  flex: none;
}

.sidebar-close:hover {
  color: #fff !important;
  background: rgba(13, 143, 114, 0.35) !important;
}

.sidebar-toggle {
  flex: none;
}

#app.nav-collapsed .sidebar-toggle {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--line-strong);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(4, 12, 20, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, #12a884, #0b3d5c 70%);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  flex: none;
  box-shadow: 0 10px 24px rgba(13, 143, 114, 0.35);
}
.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand-text strong {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -0.02em;
  color: #f2f7fb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 800;
}
.brand-text span {
  font-size: 11px;
  color: rgba(157, 176, 192, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  flex: 1;
  padding-inline-end: 2px;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}
.nav-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: rgba(157, 176, 192, 0.55);
  padding: 16px 12px 8px;
  font-weight: 700;
  text-transform: none;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  border: 1px solid transparent;
  position: relative;
}
.nav a:hover {
  background: var(--sidebar-hover);
  color: #e8f0f6;
}
.nav a.active {
  background: linear-gradient(100deg, #0d8f72 0%, #0a7a62 100%);
  color: var(--sidebar-active-text);
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(13, 143, 114, 0.35);
}
.nav a .ic {
  font-size: 14px;
  width: 20px;
  text-align: center;
  opacity: 0.8;
  font-family: var(--font-display);
}
.nav a.active .ic {
  opacity: 1;
  color: #fff;
}
.nav a .nav-text {
  min-width: 0;
  flex: 1;
}
.nav a .count {
  margin-inline-start: auto;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(232, 240, 246, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 8px;
  min-width: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.nav a.active .count {
  background: rgba(255, 255, 255, 0.2);
  border-color: transparent;
  color: #fff;
}
.nav-logout {
  margin-top: 4px !important;
  color: rgba(157, 176, 192, 0.65) !important;
}
.nav-logout:hover {
  color: #ffb4a8 !important;
  background: rgba(192, 57, 43, 0.18) !important;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--sidebar-border);
  padding-top: 12px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.user-chip .avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #12a884, #0b3d5c);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  flex: none;
}
.user-chip .meta {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.user-chip .meta strong {
  font-size: 12.5px;
  color: #eef5fa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip .meta span {
  font-size: 11px;
  color: rgba(157, 176, 192, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.license-chip {
  font-size: 11.5px;
  padding: 10px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(180, 200, 215, 0.85);
  line-height: 1.45;
  display: grid;
  gap: 3px;
}
.license-chip .chip-k {
  font-size: 10.5px;
  color: rgba(157, 176, 192, 0.55);
  letter-spacing: 0.04em;
}
.license-chip b {
  color: #eef5fa;
  font-weight: 600;
  font-size: 12px;
}
.license-chip a {
  color: #5ed4b5;
  text-decoration: none;
  font-size: 11.5px;
}
.license-chip.trial {
  background: rgba(166, 124, 18, 0.15);
  color: #f0d78a;
  border-color: rgba(166, 124, 18, 0.3);
}
.license-chip.trial b {
  color: #ffe9a8;
}
.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-2);
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12.5px;
}
.ghost-btn:hover {
  background: var(--surface-2);
  color: var(--brand-deep);
  border-color: var(--line-strong);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
}
.page-head {
  flex: 1;
  min-width: 0;
}
.page-head h1 {
  font-size: clamp(1.25rem, 2.1vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand-deep);
}
.page-head p {
  margin: 2px 0 0;
  color: var(--text-2);
  font-size: 13px;
  max-width: 44rem;
}
.topbar-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.view {
  padding: 24px 28px 80px;
  flex: 1;
  min-width: 0;
  animation: viewIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
  max-width: 1480px;
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= عناصر عامة ================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  padding: 9px 15px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  box-shadow: none;
}
.btn:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line-strong));
  background: var(--surface-2);
  color: var(--text);
}
.btn.primary {
  background: var(--brand);
  border-color: var(--brand-deep);
  color: #fff;
  box-shadow: none;
}
.btn.primary:hover {
  filter: none;
  background: color-mix(in srgb, var(--brand) 88%, #000);
  color: #fff;
  border-color: var(--brand-deep);
}
.btn.accent {
  background: var(--surface);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}
.btn.accent:hover {
  background: var(--brand-soft);
}
.btn.danger {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
  background: var(--surface);
}
.btn.danger:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn.sm {
  padding: 5px 10px;
  font-size: 12.5px;
  border-radius: 8px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search input {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 34px 8px 12px;
  width: 240px;
  outline: none;
}
.search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.search::before {
  content: '🔍';
  position: absolute;
  inset-inline-start: 10px;
  font-size: 13px;
  opacity: 0.55;
  pointer-events: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 15px;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
.section-title .more {
  margin-inline-start: auto;
  font-size: 12.5px;
  color: var(--text-2);
  text-decoration: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--gray-bg);
  color: var(--gray);
}
.badge.green {
  background: var(--green-bg);
  color: var(--green);
}
.badge.blue {
  background: var(--blue-bg);
  color: var(--blue);
}
.badge.amber {
  background: var(--amber-bg);
  color: var(--amber);
}
.badge.red {
  background: var(--red-bg);
  color: var(--red);
}
.badge.purple {
  background: var(--purple-bg);
  color: var(--purple);
}
.badge.orange {
  background: var(--orange-bg);
  color: var(--orange);
}
.badge.pink {
  background: var(--pink-bg);
  color: var(--pink);
}
.badge.brown {
  background: var(--brown-bg);
  color: var(--brown);
}
.badge.teal {
  background: var(--teal-bg);
  color: var(--teal);
}

.muted {
  color: var(--text-3);
}
.nowrap {
  white-space: nowrap;
}
.num {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  display: inline-block;
}

/* ================= لوحة التحكم ================= */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) {
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 540px) {
  .kpis {
    grid-template-columns: 1fr;
  }
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: start;
}
.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.kpi.kpi-link {
  cursor: pointer;
}
.kpi.kpi-link:hover {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
}
.kpi.kpi-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.kpi .kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--brand-soft);
  color: var(--brand);
  grid-row: 1 / span 3;
  grid-column: 2;
  align-self: center;
}
.kpi.gold .kpi-icon {
  background: #fef6e7;
  color: #9a7b28;
}
.kpi.blue .kpi-icon {
  background: var(--blue-bg);
  color: var(--blue);
}
.kpi.green .kpi-icon {
  background: var(--green-bg);
  color: var(--green);
}
.kpi .label {
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  grid-column: 1;
}
.kpi .value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--brand-deep);
  grid-column: 1;
  line-height: 1.15;
}
.kpi .value small {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-inline-start: 4px;
}
.kpi .sub {
  font-size: 12px;
  color: var(--text-3);
  grid-column: 1;
}

.profile-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--brand) 8%, #fff) 0%, var(--surface) 50%, color-mix(in srgb, var(--accent) 7%, #fff) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 18px;
}

/* بطاقة NetworkDeal أعلى لوحة المكتب */
.nd-banner-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.nd-deal-card {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}
.nd-deal-card.nd-deal-urgent {
  border-color: color-mix(in srgb, #c0392b 45%, var(--line));
  background:
    linear-gradient(105deg, color-mix(in srgb, #c0392b 10%, #fff) 0%, var(--surface) 55%);
}
.nd-deal-title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--brand-deep, #1a2e22);
  letter-spacing: -0.01em;
}
.nd-deal-urgent .nd-deal-title {
  color: #8b1e14;
}
.nd-deal-meta {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--text-2);
}
.nd-deal-meta .nd-k {
  display: inline-block;
  min-width: 5.5rem;
  color: var(--text-3);
  font-size: 12px;
}
.nd-deal-actions {
  display: flex;
  align-items: center;
  margin-inline-start: auto;
}
@media (max-width: 720px) {
  .nd-deal-actions {
    width: 100%;
  }
  .nd-deal-actions .btn {
    width: 100%;
  }
}
.profile-strip .ps-text {
  flex: 1;
  min-width: 180px;
}
.profile-strip .ps-text strong {
  display: block;
  font-size: 13.5px;
  color: var(--brand-deep);
  margin-bottom: 2px;
}
.profile-strip .ps-text span {
  font-size: 12.5px;
  color: var(--text-2);
}
.profile-strip .ps-bar {
  flex: 1.2;
  min-width: 160px;
  height: 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.profile-strip .ps-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 99px;
  transition: width 0.4s ease;
}
.profile-strip .ps-pct {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--brand);
  font-size: 13px;
  min-width: 3ch;
}

.follow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.follow-row:last-child {
  border-bottom: none;
}
.follow-row:hover strong {
  color: var(--brand);
}

.dash-empty {
  background: var(--surface);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-xl);
  padding: 48px 28px;
  text-align: center;
  box-shadow: var(--shadow-xs);
}
.dash-empty .de-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 28px;
}
.dash-empty h3 {
  font-size: 1.2rem;
  color: var(--brand-deep);
  margin-bottom: 6px;
}
.dash-empty p {
  color: var(--text-2);
  max-width: 28rem;
  margin: 0 auto 18px;
  font-size: 13.5px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  align-items: start;
}
.dash-matches-panel {
  margin-bottom: 16px;
}
.dash-sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 16px;
}
.dash-sec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.dash-secondary {
  grid-template-columns: 1fr 1fr;
}
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(minmax(280px, 1fr), 1fr));
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.office-match-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.office-match-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}
.opp-share-gate {
  display: flex;
  justify-content: center;
  padding: 28px 12px 40px;
}
.opp-share-gate-card {
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow);
  text-align: center;
}
.opp-share-gate-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
}
.opp-share-gate-card h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  color: var(--brand-deep);
}
.opp-share-points {
  text-align: start;
  margin: 0 0 20px;
  padding: 0 0 0 1.15rem;
  line-height: 1.7;
  color: var(--text-2);
  font-size: 0.92rem;
}
.opp-share-points li {
  margin-bottom: 6px;
}
.opp-share-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.opp-share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 16%, var(--line));
  font-size: 0.9rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.9), var(--surface));
}

.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 42px;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
}
.bar {
  height: 8px;
  border-radius: 20px;
  background: var(--line);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--brand), #2d6a4f);
}
.bar.gold > span {
  background: linear-gradient(90deg, var(--accent), #e3c464);
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px dashed var(--line);
  cursor: pointer;
  border-radius: 8px;
  margin-bottom: 0;
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--line);
}
.list-item:last-child {
  border-bottom: none;
}
.list-item:hover {
  background: var(--surface-2);
}
.list-item .t {
  min-width: 0;
  flex: 1;
}
.list-item .t strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item .t span {
  font-size: 12px;
  color: var(--text-3);
}

/* فرص التوافق — بطاقة فرصة */
.match-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.match-opp {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s, box-shadow 0.15s;
}
.match-opp:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.match-opp-accent {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--brand));
}
.match-opp-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px 10px 16px;
  background:
    radial-gradient(ellipse 80% 120% at 100% 0%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 55%),
    var(--surface);
}
.match-opp-score {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green) calc(var(--score) * 1%), #e8ece9 0);
  position: relative;
}
.match-opp-score::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--surface);
}
.match-opp-score b {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
}
.match-opp-meta {
  min-width: 0;
  flex: 1;
}
.match-opp-meta .label {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 2px;
}
.match-opp-meta h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  cursor: pointer;
}
.match-opp-meta h4:hover {
  color: var(--brand);
}
.match-opp-meta .sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.match-opp-body {
  padding: 0 12px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.match-listing {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: border-color 0.15s, background 0.15s;
}
.match-listing:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: color-mix(in srgb, var(--brand) 6%, #fff);
}
.match-listing .pct {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line));
  padding: 3px 8px;
  border-radius: 999px;
  margin-top: 2px;
}
.match-listing .info strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  cursor: pointer;
}
.match-listing .info strong:hover {
  color: var(--brand);
}
.match-listing .info span {
  font-size: 11.5px;
  color: var(--text-3);
}
.match-listing .go {
  color: var(--text-3);
  font-size: 16px;
}
.score {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-bg);
  padding: 1px 8px;
  border-radius: 20px;
}
.match-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--surface-2);
}
.match-card h4 {
  font-size: 13.5px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0 0 4px;
}
.match-card-meta {
  font-size: 12.5px;
  line-height: 1.55;
}
.match-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}
.match-reasons .badge {
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
  text-align: start;
}
.match-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.match-card-actions .btn {
  flex: 0 0 auto;
}
.match-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12.5px;
  border-top: 1px dashed var(--line);
  cursor: pointer;
}

/* ================= شريط أدوات المجموعة ================= */
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  overflow: hidden;
}
.seg button {
  border: none;
  background: transparent;
  padding: 7px 13px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
}
.seg button.on {
  background: var(--brand);
  color: #fff;
}
select.filter,
input.filter {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 10px;
  padding: 7px 10px;
  outline: none;
  max-width: 170px;
}
select.filter:focus,
input.filter:focus {
  border-color: var(--brand);
}

/* —— قوائم اختيار قابلة للبحث (Combo) —— */
.combo {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  z-index: 1;
}
.combo:focus-within {
  z-index: 40;
}
.combo input[role='combobox'],
.combo > input[type='text'] {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 34px 9px 12px;
  font: inherit;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
}
.combo input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}
.combo-toggle {
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1;
  z-index: 2;
}
.combo-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}
.combo-list {
  position: absolute;
  z-index: 90;
  inset-inline: 0;
  top: calc(100% + 4px);
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 30, 22, 0.18);
}
.combo-list[hidden] {
  display: none !important;
}
.combo-list li {
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
}
.combo-list li:hover,
.combo-list li.on {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand-deep, var(--brand));
}
.combo-list li.combo-custom {
  border-top: 1px dashed var(--line);
  margin-top: 4px;
  padding-top: 10px;
  color: var(--brand);
  font-weight: 600;
}
.combo-list li.combo-empty {
  color: var(--text-2);
  cursor: default;
  font-size: 12.5px;
}
.combo-filter {
  min-width: 140px;
  max-width: 200px;
  flex: 0 1 180px;
}
.combo-filter input {
  padding: 7px 30px 7px 10px;
  font-size: 13px;
  max-width: 100%;
}
.form-grid .combo {
  margin-top: 2px;
}
.combo-list li.current {
  font-weight: 700;
}
.combo-list li.current::after {
  content: ' ✓';
  opacity: 0.7;
}

.owner-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.owner-create-panel {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
}
.owner-create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* اختيار ثابت (حالة الطلب، نوع صاحب الطلب…) */
.choice-field {
  width: 100%;
}
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.choice-pick {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.choice-pick:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line-strong));
  background: var(--surface-2);
}
.choice-pick.on {
  background: var(--brand);
  border-color: var(--brand-deep, var(--brand));
  color: #fff;
}
.form-grid .field.full .choice-row {
  max-width: 100%;
}

.chip-clear {
  font-size: 12.5px;
  color: var(--red);
  background: none;
  border: none;
  cursor: pointer;
}
.count-note {
  margin-inline-start: auto;
  font-size: 12.5px;
  color: var(--text-2);
}

.match-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--brand, #1b4332) 22%, transparent);
  background: color-mix(in srgb, var(--brand, #1b4332) 7%, #fff);
  border-radius: 10px;
}
.match-strip.on {
  border-color: color-mix(in srgb, var(--brand, #1b4332) 45%, transparent);
  background: color-mix(in srgb, var(--brand, #1b4332) 12%, #fff);
}
.match-strip.empty {
  justify-content: flex-start;
  gap: 10px;
  background: #f7f7f5;
  border-color: #e5e5e0;
  color: var(--text-2);
  font-size: 13px;
}
.match-strip-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13.5px;
}
.match-strip-text strong {
  font-size: 15px;
  color: var(--brand, #1b4332);
}
.match-filter-chip {
  border: 1px solid color-mix(in srgb, var(--brand, #1b4332) 28%, transparent);
  background: #fff;
  color: var(--brand, #1b4332);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.match-filter-chip.on {
  background: var(--brand, #1b4332);
  color: #fff;
  border-color: var(--brand, #1b4332);
}
.match-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand, #1b4332) 12%, #fff);
  color: var(--brand, #1b4332);
  font-size: 11.5px;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.match-badge-ic {
  font-size: 10px;
  opacity: 0.85;
}
table.data th.match-col,
table.data td.match-col {
  width: 52px;
  min-width: 52px;
  max-width: 56px;
  text-align: center;
  padding-inline: 4px;
  vertical-align: middle;
}
table.data td.match-col .match-badge {
  margin: 0;
}

.ready-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.ready-badge.ready-ok {
  background: var(--green-bg);
  color: var(--green);
}
.ready-badge.ready-gap {
  background: var(--amber-bg);
  color: var(--amber);
}
.ready-badge.ready-sold {
  background: var(--red-bg, #b4231818);
  color: var(--red, #b42318);
}
.ready-out-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--red-bg, #b4231818);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.7;
}
.ready-out-box strong {
  color: var(--red, #b42318);
  margin-inline-end: 6px;
}
table.data th.ready-col,
table.data td.ready-col {
  width: 72px;
  min-width: 68px;
  text-align: center;
  padding-inline: 4px;
  vertical-align: middle;
}
.ready-missing-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--amber-bg);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.7;
}
.ready-missing-box strong {
  color: var(--amber);
  margin-inline-end: 6px;
}
.mini-card .ready-badge,
.g-card .ready-badge {
  margin-inline-start: 6px;
  vertical-align: middle;
}

/* ================= الجدول ================= */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: auto;
  max-height: calc(100vh - 230px);
  box-shadow: var(--shadow-xs);
}
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
}
table.data th {
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--surface-2) 88%, var(--brand) 4%);
  z-index: 2;
  text-align: start;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-2);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  letter-spacing: 0.03em;
}
table.data th:hover {
  color: var(--brand);
}
table.data th .dir {
  font-size: 10px;
  opacity: 0.8;
}
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
  font-size: 13.5px;
  vertical-align: middle;
}
table.data tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}
table.data tbody tr:hover td {
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}
table.data tbody tr.selected td {
  background: var(--brand-soft);
}
table.data td.title-cell {
  font-weight: 600;
  color: var(--brand-deep);
}
table.data .check {
  width: 38px;
}
input[type='checkbox'] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* ================= اللوح (Board) ================= */
.board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 14px;
  align-items: flex-start;
}
.board-col {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  width: 290px;
  flex: none;
  padding: 12px;
  max-height: calc(100vh - 240px);
  display: flex;
  flex-direction: column;
}
.board-col.drag-over {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.board-col h3 {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.board-col h3 .n {
  margin-inline-start: auto;
  font-size: 11.5px;
  color: var(--text-3);
}
.board-cards {
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  min-height: 40px;
}
.mini-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px 12px;
  cursor: grab;
  box-shadow: var(--shadow-xs);
}
.mini-card:active {
  cursor: grabbing;
}
.mini-card:hover {
  border-color: var(--brand);
}
.mini-card strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 5px;
}
.mini-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.mini-card.dragging {
  opacity: 0.4;
}

/* ================= المعرض (Gallery) ================= */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 14px;
}
.g-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: 0.18s;
  box-shadow: var(--shadow-xs);
}
.g-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--brand);
}
.g-card .top {
  height: 78px;
  background: linear-gradient(135deg, var(--brand), #2d6a4f);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 12.5px;
}
.g-card .top .ic {
  font-size: 26px;
}
.g-card .body {
  padding: 13px 14px;
}
.g-card .body strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}
.g-card .kv {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-2);
  padding: 2px 0;
}
.g-card.has-cover {
  position: relative;
}

/* ================= صورة العقار (غلاف) ================= */
.cover {
  position: relative;
  background-color: var(--surface-2);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.cover.card {
  height: 158px;
}
.cover.mini {
  width: 52px;
  height: 44px;
  border-radius: 9px;
  flex: 0 0 auto;
}
.cover.mini.empty .cover-icon {
  font-size: 20px;
}
.cover.mini .cover-note,
.cover.mini .cover-count {
  display: none;
}
.mini-card.with-thumb {
  display: flex;
  gap: 9px;
  align-items: center;
}
.mini-card.with-thumb .mini-text {
  min-width: 0;
}
.cover.hero {
  height: 200px;
  border-radius: 14px;
  overflow: hidden;
}
.cover.empty {
  display: grid;
  place-items: center;
  gap: 2px;
  color: #fff;
  background-image: linear-gradient(140deg, var(--brand), #2d6a4f 78%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 12px, transparent 12px 24px);
  background-blend-mode: overlay;
}
.cover.empty .cover-icon {
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}
.cover.empty .cover-note {
  font-size: 12px;
  opacity: 0.85;
}
.cover.hero.empty .cover-icon {
  font-size: 56px;
}
.cover-count,
.cover-code {
  position: absolute;
  bottom: 8px;
  font-size: 11.5px;
  color: #fff;
  background: rgba(15, 23, 33, 0.62);
  backdrop-filter: blur(3px);
  padding: 3px 9px;
  border-radius: 999px;
}
.cover-count {
  inset-inline-start: 8px;
}
.cover-code {
  inset-inline-end: 8px;
  letter-spacing: 0.4px;
  z-index: 2;
}
.detail-cover {
  margin-bottom: 12px;
}
.cover-thumbs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.cover-thumbs img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--line);
  display: block;
}
.cell-thumb-wrap {
  position: relative;
  display: inline-block;
}
.cell-thumb {
  width: 44px;
  height: 34px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
  display: block;
}
.cell-thumb.ph {
  display: grid;
  place-items: center;
  font-size: 16px;
  background: var(--surface-2);
}
.cell-thumb-wrap .thumb-count {
  position: absolute;
  bottom: -3px;
  inset-inline-start: -3px;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  display: grid;
  place-items: center;
  padding: 0 3px;
}

/* ================= الحالة الفارغة ================= */
.empty {
  text-align: center;
  padding: 54px 20px;
  color: var(--text-2);
}
.empty .ic {
  font-size: 42px;
  opacity: 0.35;
  display: block;
  margin-bottom: 8px;
}
.empty h3 {
  font-size: 16px;
  margin-bottom: 4px;
}
.empty p {
  margin: 0 0 16px;
  font-size: 13px;
}

#panelRoot,
#modalRoot {
  position: relative;
  z-index: 10120;
}
#panelRoot:empty {
  pointer-events: none;
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 20, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10050;
  animation: fade 0.15s;
}
.overlay[hidden] {
  display: none !important;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal {
  position: fixed;
  z-index: 200;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  animation: none;
  pointer-events: none;
}
.modal > header,
.modal > .body,
.modal > footer {
  pointer-events: auto;
}
/* بطاقة المحتوى ككتلة واحدة قابلة للنقر */
.modal {
  pointer-events: none;
}
.modal::before {
  content: none;
}
/* اجعل صندوق المحتوى يعمل: غلاف داخلي عبر children تحت flex */
.modal > * {
  pointer-events: auto;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* header/body/footer already structure - wrap as single card by resetting per-child card look and wrap in one box look */
.modal > header {
  width: min(920px, calc(100vw - 32px));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface);
  box-shadow: none;
}
.modal > .body {
  width: min(920px, calc(100vw - 32px));
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
  overflow-y: auto;
}
.modal > footer {
  width: min(920px, calc(100vw - 32px));
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  background: var(--surface);
  box-shadow: none;
}
.modal.sm > header,
.modal.sm > .body,
.modal.sm > footer {
  width: min(460px, calc(100vw - 32px));
}
.modal.sm {
  width: auto;
}
@keyframes pop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal header,
.slideover header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal header h2,
.slideover header h2 {
  font-size: 16px;
  flex: 1;
  min-width: 0;
}
.modal .body,
.slideover .body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
/* داخل لوحة السجل: المحتوى يمرّر ككتلة واحدة مع الرأس */
.slideover .detail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.slideover .detail-scroll .body {
  flex: none;
  overflow: visible;
  min-height: 0;
}
.slideover .detail-scroll > .body {
  min-height: auto;
}
.modal footer,
.slideover footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}
.modal footer .btn,
.slideover footer .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.modal footer .spacer,
.slideover footer .spacer {
  flex: 1 1 8px;
  min-width: 8px;
}

/* شريط أسفل السجل — مدمج بدون فراغ وسط */
.slideover footer.detail-foot {
  display: block;
  padding: 0;
  overflow: hidden;
  flex: 0 0 auto;
  z-index: 2;
  box-shadow: 0 -6px 18px rgba(12, 36, 28, 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.detail-foot-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.detail-foot-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}
.detail-foot-track > .btn[data-close] {
  flex: 0 0 auto;
  margin-inline-start: auto;
}
.detail-foot-track .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.close-x {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-3);
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
}
.close-x:hover {
  background: var(--line);
  color: var(--text);
}

.slideover {
  position: fixed;
  z-index: 10120;
  inset-block: 0;
  inset-inline-end: 0;
  width: min(560px, 100vw);
  max-width: 100%;
  min-width: 0;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--surface);
  box-shadow: -16px 0 48px rgba(7, 26, 43, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  border-inline-start: 1px solid var(--line);
  pointer-events: auto;
}
@keyframes slide {
  from {
    transform: translateX(28px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ================= النماذج ================= */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  align-items: start;
  overflow: visible;
}
.rec-form {
  overflow: visible;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  position: relative;
  overflow: visible;
}
.field.full {
  grid-column: 1 / -1;
}
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.field label .req {
  color: var(--red);
}
.field input,
.field select,
.field textarea {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 11px;
  outline: none;
  width: 100%;
  transition: 0.15s;
  box-sizing: border-box;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.field input[type='color'] {
  height: 40px;
  padding: 3px;
  cursor: pointer;
}
.field textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.7;
}
.field .hint {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.45;
}
.form-error {
  margin: 4px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--red, #c0392b) 12%, #fff);
  color: var(--red, #a32020);
  font-size: 13px;
  font-weight: 600;
}
.modal-card .body {
  min-height: 0;
}
.rec-form .form-stack {
  padding-bottom: 4px;
}
@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}
.check-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
  cursor: pointer;
  line-height: 1.6;
  font-weight: 500;
}
.check-field input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}
.ai-assist-clean {
  display: grid;
  gap: 16px;
}
.ai-step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.ai-step-label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 14%, #fff);
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.ai-step-help {
  margin: 0 0 12px;
  line-height: 1.75;
  color: var(--text-2);
  font-size: 13px;
}
.ai-connect {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--brand) 5%, #fff);
}
.ai-connect-ok {
  background: color-mix(in srgb, var(--brand) 10%, #fff);
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
}
.ai-connect-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ai-connect-row strong {
  font-weight: 700;
}
.ai-connect-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
  flex-shrink: 0;
}
.ai-connect-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed color-mix(in srgb, var(--brand) 25%, var(--line));
}
.ai-key-fields {
  display: grid;
  gap: 10px;
}
.ai-key-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
}
.ai-key-row .field {
  flex: 1 1 180px;
  min-width: 0;
}
.ai-key-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 8px;
}
.ai-key-link:hover {
  text-decoration: underline;
}
.ai-extract-block {
  display: grid;
  gap: 4px;
}
.ai-mode-field {
  margin-top: 2px;
}
.ai-assist-preview {
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  max-height: 220px;
}
.ai-assist-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: #0f1713;
}
.ai-assist-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin: 10px 0 4px;
}
.ai-preview-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0f1713;
  aspect-ratio: 1;
}
.ai-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ai-preview-rm {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  font-size: 16px;
}
.ai-fill-banner {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 16%, #fff);
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
}
.store-locked {
  max-width: 720px;
}
.store-locked .btn {
  margin-top: 12px;
}
.field input[readonly] {
  background: var(--surface-2);
  color: var(--text-3);
}
.multi-box {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px;
  max-height: 170px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.multi-box label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 7px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}
.multi-box label:hover {
  background: var(--surface-2);
}
.multi-box label > span {
  flex: 1;
  min-width: 0;
}
.multi-box label > input {
  flex: none;
}

.image-field .image-preview,
.images-preview .thumb img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
}
.image-field .image-preview {
  margin-bottom: 8px;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-radius: 12px;
  overflow: hidden;
}
.images-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.images-preview .thumb {
  position: relative;
}
.images-preview .thumb button {
  position: absolute;
  top: -6px;
  inset-inline-start: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font-size: 11px;
}
.owner-listings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sub-banner {
  background: linear-gradient(90deg, var(--amber-bg), transparent);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
}
.private-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.private-field .private-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.btn-eye {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 30px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  flex-shrink: 0;
}
.btn-eye:hover {
  border-color: var(--brand, #1b4332);
  background: #f4f7f5;
}

/* رابط صاحب العرض — اسم مخفي + انتقال */
.owner-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2, #f7f9f7);
  color: var(--text-2);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.owner-jump:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.owner-jump-ic {
  flex: none;
  font-size: 13px;
  opacity: 0.85;
}
.owner-jump-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.owner-jump-go {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.7;
}
.owner-jump:hover .owner-jump-go {
  opacity: 1;
}

.detail-private-title h2 {
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ================= مساعد التقييم ================= */
.valuation-live-calc {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--brand) 38%, var(--line));
  border-radius: 12px;
  background: var(--brand-soft);
}
.valuation-live-calc span {
  color: var(--text-2);
  font-size: 12.5px;
}
.valuation-live-calc strong {
  color: var(--brand);
  direction: ltr;
}
.val-steps {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.val-step {
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 8px 10px;
}
.val-step b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  margin-inline-end: 6px;
}
.val-sources {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.val-source {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
}
.val-source-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.val-source .btn {
  margin-top: 8px;
}
.val-comp-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.val-comp-form select,
.val-comp-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface);
  font: inherit;
}
.val-comp-form .btn {
  grid-column: 1 / -1;
}
.val-comps {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.val-comp {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  flex-wrap: wrap;
}
.val-comp-nums {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.val-result {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(160deg, var(--brand-soft), transparent);
  margin-bottom: 8px;
}
.val-result-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .val-comp-form,
  .val-result {
    grid-template-columns: 1fr;
  }
}


/* ================= لوحة التفاصيل ================= */
.detail-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(160deg, var(--brand-soft), transparent);
  flex-shrink: 0;
}
.detail-head .detail-cover {
  max-height: min(42vh, 280px);
  overflow: hidden;
  border-radius: 12px;
}
.detail-head .detail-cover img,
.detail-head .detail-cover .cover,
.detail-head .detail-cover .cover-hero {
  max-height: min(42vh, 280px);
  width: 100%;
  object-fit: cover;
}
.detail-head .code {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.5px;
}
.detail-head h2 {
  font-size: 19px;
  margin: 3px 0 8px;
}
.detail-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.kv-list {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 1px 12px;
  font-size: 13.5px;
}
.kv-list dt {
  color: var(--text-2);
  padding: 7px 0;
  font-size: 12.5px;
}
.kv-list dd {
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  word-break: break-word;
}
.kv-list dt {
  border-bottom: 1px dashed var(--line);
}
.sub-head {
  font-size: 13px;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 7px;
}
[data-theme='dark'] .sub-head {
  color: var(--accent);
}
.rel-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 12.5px;
  margin: 0 0 6px 6px;
  cursor: pointer;
  background: var(--surface-2);
}
.rel-pill:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.wa-box {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.wa-notice {
  padding: 10px 12px;
  background: var(--amber-bg);
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.7;
}
.wa-box textarea {
  width: 100%;
  border: none;
  padding: 12px;
  min-height: 150px;
  resize: vertical;
  outline: none;
  background: var(--surface-2);
  line-height: 1.85;
  font-size: 13px;
}
.wa-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ================= ملاحظة سريعة للمنصة ================= */
.feedback-fab {
  position: fixed;
  inset-block-end: 22px;
  inset-inline-end: 18px;
  z-index: 260;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
  background: var(--brand, #0b1f33);
  box-shadow: var(--shadow-lg, 0 10px 28px rgba(0, 0, 0, 0.22));
}
.feedback-fab:hover {
  filter: brightness(1.08);
}
.feedback-panel {
  position: fixed;
  inset-block-end: 78px;
  inset-inline-end: 18px;
  z-index: 261;
  width: min(340px, calc(100vw - 28px));
  background: var(--surface, #fff);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg, 0 14px 36px rgba(0, 0, 0, 0.18));
  padding: 12px 14px 14px;
}
.feedback-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.feedback-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted, #6b7280);
  line-height: 1.5;
}
.feedback-panel textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 96px;
  background: var(--surface-2, #f7f7f8);
  color: inherit;
  font: inherit;
  line-height: 1.7;
}
.feedback-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* ================= التنبيهات ================= */
.toasts {
  position: fixed;
  inset-block-end: 20px;
  inset-inline-start: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 11px 16px;
  border-radius: 11px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  animation: toastIn 0.18s;
  max-width: 380px;
}
.toast.err {
  background: var(--red);
  color: #fff;
}
.toast.ok {
  background: var(--green);
  color: #fff;
}
@keyframes toastIn {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

/* ================= الإعدادات ================= */
.settings-stack {
  display: grid;
  gap: 16px;
}
.profile-hero {
  padding: 18px 20px;
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
    linear-gradient(145deg, color-mix(in srgb, var(--brand) 8%, var(--surface)) 0%, var(--surface) 60%);
}
.profile-hero-main {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}
.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--brand-deep, #1b4332);
  color: #fff;
  display: grid;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, #fff);
  box-shadow: 0 8px 22px rgba(27, 67, 50, 0.12);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-letter {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
}
.profile-avatar-edit {
  cursor: pointer;
}
.profile-hero-meta {
  flex: 1;
  min-width: 200px;
}
.profile-hero-name {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-family: var(--font-display);
  color: var(--brand-deep, var(--text));
}
.profile-hero-sub {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-2);
}
.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.prof-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
}
.prof-badge.plan {
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  color: var(--brand-deep);
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
}
.prof-badge.fal {
  background: color-mix(in srgb, #15803d 12%, #fff);
  color: #14532d;
  border-color: color-mix(in srgb, #15803d 30%, var(--line));
}
.prof-badge.warn {
  background: color-mix(in srgb, var(--accent) 20%, #fff);
  color: #7a5a10;
}
.prof-badge.soft {
  background: var(--surface-2);
}
.profile-link {
  margin: 10px 0 0;
  font-size: 12px;
}
.profile-hero-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.profile-score-ring {
  --pct: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--surface) 58%, transparent 59%),
    conic-gradient(var(--brand) calc(var(--pct) * 1%), var(--line) 0);
}
.profile-score-ring strong {
  font-size: 15px;
  line-height: 1;
  color: var(--brand-deep);
}
.profile-score-ring span {
  font-size: 10px;
  color: var(--text-3);
}
.profile-complete-banner {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.profile-complete-banner .ps-text strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}
.profile-complete-banner .ps-text span {
  font-size: 12.5px;
  color: var(--text-2);
}
.profile-complete-banner .ps-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.profile-complete-banner .ps-bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 99px;
}
.profile-complete-banner.is-done .ps-text strong {
  color: #166534;
}
.prof-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.prof-chip {
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.prof-chip.miss {
  background: color-mix(in srgb, #b45309 10%, #fff);
  color: #9a3412;
  border-color: color-mix(in srgb, #b45309 25%, var(--line));
}
.prof-chip.ok {
  background: color-mix(in srgb, #15803d 10%, #fff);
  color: #166534;
}
.fal-status {
  border-radius: 12px;
  padding: 12px 14px;
  line-height: 1.55;
  border: 1px solid var(--line);
}
.fal-status strong {
  display: block;
  margin-bottom: 2px;
}
.fal-status span {
  font-size: 12.5px;
  color: var(--text-2);
}
.fal-status.is-on {
  background: color-mix(in srgb, #15803d 8%, #fff);
  border-color: color-mix(in srgb, #15803d 25%, var(--line));
}
.fal-status.is-off {
  background: color-mix(in srgb, var(--accent) 10%, #fff);
}
.profile-strip-id {
  background: linear-gradient(100deg, #f5efe3 0%, #eef5f1 100%);
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 16px;
  align-items: start;
}
.setting-card h3 {
  font-size: 14.5px;
  margin-bottom: 4px;
}
.settings-save-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.settings-save-row .btn.primary {
  min-width: 10rem;
}
.token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.token {
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
  cursor: pointer;
  direction: ltr;
}
.token:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ================= مساعد السوق ================= */
.market-workspace {
  display: grid;
  gap: 16px;
}
.market-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 12% 20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 32%),
    linear-gradient(135deg, var(--brand-soft), var(--surface));
}
.market-hero h2 {
  margin: 5px 0 7px;
  font-size: 22px;
}
.market-hero p {
  margin: 0;
  color: var(--text-2);
  line-height: 1.8;
}
.market-eyebrow {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}
.market-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.market-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.market-section-head .section-title,
.market-section-head p {
  margin-top: 0;
}
.market-section-head p {
  margin-bottom: 0;
  font-size: 12.5px;
}
.market-listing-select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.market-property-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 12.5px;
}
.market-property-line > span {
  padding: 4px 9px;
  background: var(--surface-2);
  border-radius: 999px;
}
.market-property-line .btn {
  margin-inline-start: auto;
}
.market-query {
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px dashed color-mix(in srgb, var(--brand) 45%, var(--line));
  border-radius: 10px;
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
  text-align: center;
}
.market-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.market-source {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  transition: 0.18s;
}
.market-source:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-xs);
}
.market-source-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}
.market-source-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
}
.market-source p,
.market-source small {
  display: block;
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.6;
}
.market-source small {
  color: var(--text-3);
}
.market-privacy-note {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
}
.market-comp-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.market-comp-form label {
  display: grid;
  gap: 5px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}
.market-comp-form input,
.market-comp-form select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.market-comp-form .wide {
  grid-column: 1 / -1;
}
.market-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.market-result {
  display: grid;
  gap: 5px;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}
.market-result > span,
.market-result small {
  color: var(--text-2);
  font-size: 12px;
}
.market-result strong {
  font-size: 18px;
}
.market-result.featured {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  background: linear-gradient(145deg, var(--brand-soft), var(--surface));
}
.market-result.danger {
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
}
.market-result.success {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
}
.market-empty {
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--text-2);
  text-align: center;
}
.market-empty.compact {
  padding: 16px;
}
.market-empty > span {
  font-size: 26px;
}
.market-empty p {
  margin: 0;
}
.market-evidence {
  display: grid;
  gap: 7px;
}
.market-evidence-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: start;
  cursor: pointer;
}
.market-evidence-row:hover {
  border-color: var(--brand);
}
.market-evidence-row small {
  display: block;
  margin-top: 2px;
  color: var(--text-2);
}
.market-operations {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.market-operation {
  display: grid;
  gap: 4px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-align: start;
  font: inherit;
  cursor: pointer;
}
.market-operation:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.market-operation > span {
  font-size: 24px;
}
.market-operation small {
  color: var(--text-2);
  line-height: 1.5;
}

/* ================= متجر المكتب والموافقات ================= */
.store-admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: var(--r-lg);
  background: linear-gradient(145deg, var(--brand-soft), var(--surface));
}
.store-admin-hero h2 {
  margin: 4px 0;
}
.store-admin-hero p {
  margin: 0;
  color: var(--text-2);
}
.store-admin-link {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: end;
}
.store-admin-link code {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  direction: ltr;
  font-size: 13px;
}
.store-slug-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.store-slug-row input {
  flex: 1;
  min-width: 120px;
}
.store-admin-kpis {
  margin-bottom: 14px;
}
.store-admin-grid {
  align-items: start;
}
.submission-list {
  display: grid;
  gap: 9px;
}
.submission-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.submission-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}
.submission-card-head strong,
.submission-card-head small {
  display: block;
}
.submission-card-head small {
  margin-top: 2px;
  color: var(--text-3);
  font-size: 11px;
}
.submission-card > p {
  margin: 8px 0;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.7;
}
.submission-contact,
.submission-land {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
}
.submission-contact a {
  color: var(--brand);
  font-weight: 600;
}
.submission-land {
  margin-top: 6px;
}
.submission-actions {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}
.submission-history {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}
.submission-history summary {
  margin-bottom: 9px;
  color: var(--text-2);
  cursor: pointer;
  font-size: 12.5px;
}
.submission-history .submission-card {
  margin-bottom: 7px;
  opacity: 0.82;
}

/* ================= تسجيل الدخول ================= */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 20%, #1b433218, transparent 60%), var(--bg);
}
.login-card {
  width: min(390px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 30px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-card .mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  font-weight: 700;
  font-size: 19px;
}

/* اختيار إعدادات (مثل التوافق) */
.choice-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.choice-chip {
  flex: 1;
  min-width: 96px;
  cursor: pointer;
  position: relative;
}
.choice-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.choice-chip span {
  display: block;
  text-align: center;
  padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-2);
  transition: 0.15s ease;
}
.choice-chip input:checked + span {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.choice-chip:hover span {
  border-color: var(--brand);
}
.choice-chip input:disabled + span {
  opacity: 0.55;
  cursor: not-allowed;
}
.choice-chip.is-static {
  cursor: default;
  flex: 0 1 auto;
  min-width: 0;
}
.choice-chip.is-static span {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

/* ================= الطباعة ================= */
@media print {
  .sidebar,
  .topbar,
  .toolbar,
  .overlay,
  .toasts,
  .slideover footer,
  .wa-actions,
  .no-print {
    display: none !important;
  }
  #app {
    grid-template-columns: 1fr;
  }
  .slideover {
    position: static;
    width: 100%;
    box-shadow: none;
  }
  body {
    background: #fff;
  }
}

/* ================= الاستجابة ================= */
.only-mobile {
  display: none !important;
}
.only-desktop {
  display: contents;
}
/* أزرار visible على سطح المكتب (display:contents يفسد شكلها) */
button.only-desktop,
.icon-btn.only-desktop {
  display: grid !important;
}
@media (max-width: 980px) {
  .grid-2,
  .grid-3,
  .dash-secondary {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .market-sources,
  .market-results,
  .market-operations {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .map-layout {
    grid-template-columns: 1fr;
  }
  .map-page {
    height: auto;
    min-height: 0;
  }
}
@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }
  #app {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .main {
    width: 100%;
    min-width: 0;
  }
  .only-mobile {
    display: grid !important;
  }
  .only-desktop {
    display: none !important;
  }

  /* درج جانبي: خارج الشاشة يمينًا حتى يُفتح — بدون الاعتماد على transform في RTL */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    right: 0 !important;
    z-index: 300 !important;
    width: min(300px, 86vw) !important;
    max-width: 300px;
    height: 100% !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
    transform: translate3d(105%, 0, 0) !important;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.22s ease, visibility 0.22s;
    box-shadow: none;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.open {
    transform: translate3d(0, 0, 0) !important;
    visibility: visible;
    pointer-events: auto;
    box-shadow: -18px 0 48px rgba(0, 0, 0, 0.35);
  }
  .sidebar-backdrop {
    z-index: 290;
  }
  .sidebar-backdrop.on {
    opacity: 1;
    pointer-events: auto;
  }
  body.drawer-open {
    overflow: hidden;
    touch-action: none;
  }

  .view {
    padding: 14px 12px 56px;
  }
  .topbar {
    padding: 10px 12px;
    gap: 8px 10px;
    flex-wrap: wrap;
    align-items: center;
  }
  .page-head {
    min-width: 0;
    flex: 1 1 calc(100% - 52px);
  }
  .page-head h1 {
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .page-head p,
  #pageSub {
    display: none;
  }
  .topbar-actions {
    flex: 1 1 100%;
    flex-shrink: 1;
    margin-inline-start: 0;
    gap: 6px;
    justify-content: stretch;
  }
  .topbar-actions .btn {
    padding: 7px 10px;
    font-size: 12.5px;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
  }
  .toolbar {
    gap: 6px;
  }
  .toolbar .seg {
    width: 100%;
  }
  .toolbar .seg button {
    flex: 1;
  }
  .toolbar .search {
    flex: 1 1 100%;
  }
  .toolbar .search input,
  .search input {
    width: 100%;
  }
  .toolbar select.filter,
  .toolbar input.filter {
    max-width: none;
    flex: 1 1 calc(50% - 6px);
    min-width: calc(50% - 6px);
  }
  .toolbar .count-note {
    margin-inline-start: 0;
    width: 100%;
  }
  .table-wrap {
    max-height: calc(100vh - 300px);
  }
  table.data th,
  table.data td {
    padding: 8px 10px;
    font-size: 12.5px;
  }
  table.data th.check,
  table.data td.check {
    width: 36px;
    padding-inline: 6px;
  }
  .bar-row {
    grid-template-columns: minmax(64px, 28vw) 1fr 36px;
    gap: 8px;
    font-size: 12px;
  }
  .list-item {
    gap: 8px;
    padding: 10px 2px;
  }
  .kv-list {
    grid-template-columns: 100px 1fr;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .kpi {
    padding: 12px 14px;
  }
  .kpi .value {
    font-size: 20px;
  }
  .panel-card {
    padding: 14px;
  }
  .market-hero,
  .market-section-head,
  .store-admin-hero {
    align-items: stretch;
    flex-direction: column;
  }
  .store-admin-link {
    justify-content: start;
  }
  .market-sources,
  .market-results,
  .market-operations,
  .market-comp-form {
    grid-template-columns: 1fr;
  }
  .market-comp-form .wide {
    grid-column: auto;
  }
  .market-source {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .market-source .btn {
    grid-column: 1 / -1;
  }
  .market-evidence-row {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 420px) {
  .kpis {
    grid-template-columns: 1fr;
  }
  .topbar-actions .btn .hide-xs {
    display: none;
  }
}

/* ——— خريطة العقارات ——— */
.nav-pro {
  font-size: 10px;
  opacity: 0.7;
  font-weight: 600;
}
.map-locked {
  max-width: 520px;
  margin: 48px auto;
  text-align: center;
  padding: 32px;
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid var(--border);
}
.map-locked h2 { margin: 0 0 12px; }
.map-locked p { color: var(--muted); line-height: 1.8; margin-bottom: 20px; }
.map-page { display: flex; flex-direction: column; gap: 12px; height: calc(100vh - 140px); min-height: 520px; }
.map-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.map-toolbar select { min-width: 140px; }
.map-layout { flex: 1; display: grid; grid-template-columns: 260px 1fr; gap: 12px; min-height: 0; }
.map-side {
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
}
.map-folder { border-bottom: 1px solid var(--border); padding: 6px 0; }
.map-folder summary {
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
}
.map-folder summary span {
  background: var(--bg);
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
}
.map-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: right;
  color: inherit;
}
.map-item:hover { background: var(--bg); }
.map-item b { font-size: 13px; }
.map-item span { font-size: 12px; color: var(--muted); }
.map-canvas {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 420px;
  z-index: 0;
}
.map-pin { background: transparent !important; border: 0 !important; }
.map-pin-inner {
  background: var(--pin, #1b4332);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  white-space: nowrap;
  text-align: center;
}
.map-pin-pulse {
  animation: mapPinPulse 1.4s ease-out 3;
  box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.55);
}
@keyframes mapPinPulse {
  0% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.55); transform: scale(1); }
  70% { box-shadow: 0 0 0 14px rgba(201, 162, 39, 0); transform: scale(1.06); }
  100% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0); transform: scale(1); }
}

.map-opp {
  gap: 10px;
  height: calc(100vh - 128px);
  min-height: 560px;
}
.map-opp-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
}
.map-opp-bar-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.map-opp-bar-copy strong {
  font-size: 15px;
}
.map-opp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.map-opp-filters select,
.map-opp-filters .combo-filter {
  min-width: 120px;
}
.map-opp-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: block;
}
.map-opp-stage .map-canvas {
  height: 100%;
  min-height: 480px;
  border-radius: 16px;
}
.map-opp-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  width: min(280px, calc(100% - 72px));
  max-height: calc(100% - 24px);
  overflow: auto;
  background: color-mix(in srgb, var(--panel, #fff) 92%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  z-index: 2;
}
.map-opp-panel-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 8px 10px;
}
.map-opp-panel-h span {
  background: var(--bg);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 600;
}
.map-opp-empty {
  padding: 16px 12px;
  text-align: center;
}
.map-opp-empty b { display: block; margin-bottom: 6px; }
.map-opp-empty p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 12px; }
.map-item.is-focus {
  background: color-mix(in srgb, #c9a227 18%, var(--bg, #f4f1ea));
  outline: 1px solid color-mix(in srgb, #c9a227 55%, transparent);
}
@media (max-width: 900px) {
  .map-opp-panel {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    max-height: 200px;
    margin-top: 8px;
  }
  .map-opp-stage .map-canvas { min-height: 360px; }
}
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  white-space: nowrap;
  text-align: center;
}
.map-cluster-wrap {
  background: transparent !important;
  border: 0 !important;
}
.map-cluster {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, #2d6a4f, #1b4332 70%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(15, 61, 46, 0.45);
  border: 3px solid #fff;
  line-height: 1.1;
  cursor: pointer;
}
.map-cluster b {
  font-size: 15px;
  font-weight: 800;
}
.map-cluster small {
  font-size: 9px;
  max-width: 44px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.92;
  font-weight: 600;
}
.map-cluster-lg {
  width: 64px;
  height: 64px;
}
.map-cluster-lg b { font-size: 18px; }
.map-cluster-lg small { font-size: 10px; max-width: 54px; }
.map-cluster-sm {
  width: 42px;
  height: 42px;
  background: radial-gradient(circle at 30% 28%, #e0bc4d, #c9a227 72%);
  color: #21301f;
}
.map-cluster-sm b { font-size: 13px; }
.map-cluster-sm small { font-size: 8px; max-width: 34px; color: #21301f; }
.map-popup { min-width: 180px; font-family: inherit; }
.map-popup .muted { color: #666; font-size: 12px; margin: 4px 0; }
.map-popup .btn { margin-top: 8px; }
@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-side { max-height: 180px; }
}

.map-engine-note {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: -4px;
}
.map-canvas .gm-style {
  font-family: inherit;
}

.map-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.map-stage { position: relative; min-height: 0; }
.map-stage .map-canvas { height: 100%; min-height: 420px; }
.map-zoom-box {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.map-zoom-out { top: 54px; }
.map-page.map-expanded {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--bg, #0f1410);
  padding: 12px;
  height: 100vh !important;
  min-height: 100vh !important;
  box-sizing: border-box;
}
.map-page.map-expanded .map-layout { height: calc(100vh - 90px); }
.plan .price small:empty { display: none; }

/* ——— صفحة الاشتراك ——— */
.billing-page {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 960px;
  margin-inline: auto;
  width: 100%;
  padding-block: 12px 32px;
}
.billing-status {
  padding: 18px 20px !important;
}
.billing-status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.billing-status-top h3 {
  margin: 0;
  font-size: 16px;
}
.billing-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 0;
}
.billing-status-grid dt {
  margin: 0;
  font-size: 12px;
  color: var(--text-3);
}
.billing-status-grid dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
}
.billing-plans {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  row-gap: 36px;
  align-items: stretch;
  justify-content: center;
  padding: 8px 4px 12px;
}
.billing-payments {
  padding: 18px 20px !important;
}
.billing-payments h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.plan-bill {
  flex: 0 1 380px;
  width: 100%;
  max-width: 400px;
  min-height: 440px;
  padding: 28px 26px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 10px 32px rgba(16, 24, 40, 0.07);
}
.plan-bill-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.plan-bill-head h3 {
  margin: 0;
  font-size: 22px;
}
.plan-bill-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.plan-bill-price {
  font-size: 32px;
  font-weight: 700;
  margin: 4px 0 0;
  line-height: 1.15;
}
.plan-bill-price small {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.75;
}
.plan-bill-features {
  margin: 0;
  padding: 8px 18px 0 0;
  font-size: 14px;
  line-height: 2;
  color: var(--text-2);
  flex: 1;
}
.plan-bill-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 12px;
}
.plan-bill-pro {
  background: linear-gradient(145deg, #0f3d2e 0%, #1b4332 45%, #2d6a4f 100%);
  color: #fff;
  border: none;
  box-shadow: 0 14px 36px rgba(15, 61, 46, 0.26);
}
.plan-bill-pro h3,
.plan-bill-pro .plan-bill-features,
.plan-bill-pro .plan-bill-price {
  color: #fff;
}
.plan-bill-pro .plan-bill-features {
  color: rgba(255, 255, 255, 0.9);
}
.plan-bill-pro .btn.primary {
  background: #fff;
  color: #1b4332;
  border: none;
}
.plan-bill-free.is-current,
.plan-bill-pro.is-current,
.plan-bill-standard.is-current {
  outline: 2px solid #15803d;
  outline-offset: 1px;
}
.plan-bill-standard {
  background: #fff;
  border: 1px solid #d8dde3;
}
.plan-bill-price-quiet {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: var(--text-2) !important;
}
.plan-bill-pro .plan-bill-price-quiet {
  color: rgba(255, 255, 255, 0.85) !important;
}
.plan-badge-gold.badge.amber,
.badge.plan-badge-gold {
  background: linear-gradient(135deg, #c9a227, #e0bc4d);
  color: #21301f;
  border: none;
  font-weight: 700;
}
.plan-interval-row {
  margin: 0;
}
.plan-interval-row {
  margin: 2px 0;
  gap: 10px;
}
.plan-interval-row .choice-chip span {
  padding: 10px 14px;
  font-size: 13.5px;
}
.plan-bill-pro .choice-chip span {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.9);
}
.plan-bill-pro .choice-chip input:checked + span {
  background: #fff;
  border-color: #fff;
  color: #1b4332;
}
.plan-bill-pro .choice-chip:hover span {
  border-color: rgba(255, 255, 255, 0.55);
}
@media (max-width: 720px) {
  .billing-status-grid {
    grid-template-columns: 1fr 1fr;
  }
  .plan-bill {
    max-width: none;
    flex: 1 1 100%;
  }
}

/* —— لوحة الفرص (صفحة مستقلة — بدون شبكة الجانبي #app) —— */
body.opp-page-body {
  min-height: 100vh;
  margin: 0;
  background: #eef1ef;
  background-image:
    radial-gradient(900px 380px at 85% 0%, rgba(201, 162, 74, 0.1), transparent 55%),
    linear-gradient(180deg, #e8ece9 0%, #f4f6f5 35%, #f7f8f7 100%);
}
body.opp-page-body #app,
body.opp-page-body #app.opp-page,
body.opp-page-body #app.view {
  display: block !important;
  width: 100% !important;
  max-width: 1120px !important;
  margin: 0 auto !important;
  min-height: 100vh;
  padding: 20px 18px 48px !important;
  grid-template-columns: none !important;
  box-sizing: border-box;
}

.opp-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.opp-topbar h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 700;
  color: #1b4332;
  line-height: 1.25;
}
.opp-topbar-lead {
  margin: 6px 0 0;
  color: #55665d;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 36rem;
}
.opp-topbar-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.opp-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(27, 67, 50, 0.1);
  box-shadow: 0 4px 16px rgba(20, 40, 30, 0.04);
}
.opp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.opp-filter-btn {
  border: 1px solid #d7ddd9;
  background: #fff;
  color: #222;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: 0.12s ease;
}
.opp-filter-btn em {
  font-style: normal;
  opacity: 0.65;
  margin-inline-start: 4px;
  font-weight: 600;
}
.opp-filter-btn.active,
.opp-filter-btn[aria-selected="true"] {
  background: #1b4332;
  border-color: #1b4332;
  color: #fff;
}
.opp-filter-btn.active em {
  opacity: 0.9;
  color: #f0d78c;
}
.opp-toolbar-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.opp-main {
  min-height: 120px;
}
.opp-deal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.opp-deal {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) minmax(130px, auto);
  background: #fff;
  border: 1px solid rgba(27, 67, 50, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(20, 40, 30, 0.045);
}
.opp-deal.score-gold {
  border-color: rgba(201, 162, 74, 0.42);
}
.opp-deal-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 10px;
  background: #1b4332;
  color: #f0d78c;
  text-align: center;
}
.opp-deal-score-val {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.opp-deal-score-val span {
  font-size: 0.8rem;
}
.opp-deal-score-label {
  font-size: 0.7rem;
  opacity: 0.75;
}
.opp-deal-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(240, 215, 140, 0.14);
  border: 1px solid rgba(240, 215, 140, 0.28);
  color: #f7e7b0;
}
.opp-deal-badge.opp-badge-urgent {
  background: rgba(201, 120, 40, 0.22);
  border-color: rgba(201, 120, 40, 0.45);
  color: #ffe1b8;
  font-weight: 700;
}
.opp-ref-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 4px;
}
.opp-ref-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.opp-ref-code em {
  font-style: normal;
  font-weight: 600;
  opacity: 0.9;
  font-size: 0.75rem;
}
.opp-ref-code b {
  font-family: "IBM Plex Sans Arabic", "Alexandria", sans-serif;
  font-weight: 800;
}
.opp-ref-code.request {
  background: #ff6b1a;
  color: #fff;
  border: 1px solid #e85a0c;
}
.opp-ref-code.listing {
  background: #0f766e;
  color: #fff;
  border: 1px solid #0d9488;
}
.opp-deal.opp-peer-wait {
  outline: 2px solid rgba(201, 120, 40, 0.35);
  outline-offset: 0;
}
.opp-office-box.opp-peer-incoming {
  background: linear-gradient(135deg, rgba(255, 244, 228, 0.95), rgba(255, 250, 240, 0.9));
  border: 1px solid rgba(201, 120, 40, 0.28);
}

.opp-deal-body {
  padding: 14px 16px;
  min-width: 0;
}
.opp-deal-sides {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: start;
}
.opp-side-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #6a7a72;
  margin-bottom: 4px;
}
.opp-side-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
  color: #15261e;
}
.opp-side-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.opp-side-facts > span {
  font-size: 0.82rem;
  padding: 3px 8px;
  border-radius: 8px;
  background: #f2f5f3;
  color: #314439;
}
.opp-side-facts .opp-price {
  background: rgba(27, 67, 50, 0.1);
  color: #1b4332;
  font-weight: 600;
}
.opp-side-facts .opp-price.budget {
  background: rgba(201, 162, 74, 0.16);
  color: #7a5c18;
}
.opp-office-box {
  border-radius: 10px;
  padding: 9px 11px;
  background: #f6f8f7;
  border: 1px solid #e4ebe6;
}
.opp-office-k {
  font-size: 0.7rem;
  color: #6a7a72;
}
.opp-office-name {
  font-weight: 650;
  color: #1b4332;
  margin: 2px 0 4px;
}
.opp-office-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.82rem;
  color: #4a5a52;
}
.opp-office-contact a {
  color: #1b4332;
  text-decoration: none;
  font-weight: 550;
}
.opp-office-contact a:hover {
  text-decoration: underline;
}

.opp-deal-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding-top: 24px;
  color: #c9a24a;
  gap: 4px;
}
.opp-bridge-line {
  width: 1px;
  flex: 1;
  min-height: 12px;
  background: linear-gradient(180deg, transparent, #c9a24a88, transparent);
}
.opp-bridge-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  background: #fff;
  border: 1px solid rgba(201, 162, 74, 0.45);
}

.opp-deal-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.opp-deal-reasons li {
  font-size: 0.78rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef6f1;
  color: #234936;
  border: 1px solid #d7e8dd;
}

.opp-deal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  padding: 14px;
  background: #fafbfa;
  border-inline-start: 1px solid #e8eeea;
}
.opp-deal-actions .btn {
  width: 100%;
  justify-content: center;
}
.opp-action-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.opp-action-block.admin-report {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed rgba(27, 67, 50, 0.15);
}
.opp-action-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1b4332;
  letter-spacing: 0.01em;
  line-height: 1.4;
}
.opp-action-hint {
  font-weight: 500;
  color: #6b7c74;
}
.opp-action-help {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.55;
  color: #55665d;
}
.opp-report-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.opp-action-block.admin-report .btn {
  border-color: rgba(12, 74, 110, 0.2);
  background: #f0f9ff;
  color: #0c4a6e;
}
.opp-action-block.admin-report .btn:hover {
  background: #e0f2fe;
}

.opp-empty {
  text-align: center;
  padding: 48px 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px dashed rgba(27, 67, 50, 0.2);
}
.opp-empty h3 {
  margin: 0 0 8px;
  color: #1b4332;
}

/* مدخل سريع من إدارة المنصة */
.opp-launch {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(120deg, rgba(27, 67, 50, 0.05), rgba(201, 162, 74, 0.08)), #fff;
  border: 1px solid rgba(27, 67, 50, 0.12);
  box-shadow: 0 6px 18px rgba(20, 40, 30, 0.04);
}
.opp-launch:hover {
  box-shadow: 0 10px 24px rgba(20, 40, 30, 0.07);
}
.opp-launch-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  background: #1b4332;
  color: #f0d78c;
}
.opp-launch-text h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: #1b4332;
}
.opp-launch-text p {
  margin: 0;
  color: #55665d;
  line-height: 1.5;
  font-size: 0.92rem;
}
.opp-launch-cta {
  font-weight: 650;
  color: #1b4332;
  white-space: nowrap;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(27, 67, 50, 0.08);
}

@media (max-width: 900px) {
  .opp-deal {
    grid-template-columns: 1fr;
  }
  .opp-deal-score {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }
  .opp-deal-sides {
    grid-template-columns: 1fr;
  }
  .opp-deal-bridge {
    flex-direction: row;
    padding: 0;
    min-height: 24px;
  }
  .opp-bridge-line {
    width: auto;
    height: 1px;
    flex: 1;
    min-height: 0;
  }
  .opp-deal-actions {
    flex-direction: row;
    flex-wrap: wrap;
    border-inline-start: 0;
    border-top: 1px solid #e8eeea;
  }
  .opp-deal-actions .btn {
    width: auto;
    flex: 1 1 auto;
  }
  .opp-launch {
    grid-template-columns: auto 1fr;
  }
  .opp-launch-cta {
    grid-column: 1 / -1;
    text-align: center;
  }
}
@media (max-width: 560px) {
  body.opp-page-body #app {
    padding: 12px 12px 40px !important;
  }
}

/* فرص المكتب + بوابة 10٪ */
.opp-tenant-page {
  max-width: 1100px;
}
.opp-summary-card {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f3f7f4 0%, #eef4f8 100%);
  border: 1px solid #d7e8dd;
}
.opp-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.opp-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.9rem;
  color: #314439;
}
.opp-stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 8px 0 12px;
  font-size: 0.78rem;
}
.opp-stage-step {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f0;
  color: #6b7c72;
}
.opp-stage-step.done {
  background: #d8eee0;
  color: #1b4332;
}
.opp-stage-step.current {
  background: #1b4332;
  color: #fff;
  font-weight: 600;
}
.opp-stage-sep {
  color: #a8b5ad;
  font-size: 0.75rem;
}
.opp-legal-note a {
  color: #1b4332;
  text-decoration: underline;
}
.opp-invoice-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff8e8;
  border: 1px solid #f0dfb2;
}
.opp-notif-strip {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2ebe5;
}
.opp-notif-strip.has-unread {
  background: #fff8ef;
  border-color: #f0c48a;
  box-shadow: 0 0 0 1px rgba(196, 92, 18, 0.08);
}
.opp-notif-hot {
  color: #7a3410;
  background: rgba(255, 186, 120, 0.22);
  border-radius: 8px;
  padding: 4px 8px;
  margin: 4px 0;
}
.opp-outcome-banner {
  margin: 10px 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.55;
  font-size: 0.92rem;
}
.opp-outcome-banner.conflict {
  background: #fff1f0;
  border: 1px solid #f0b4ae;
  color: #7f1d1d;
}
.opp-outcome-banner.pending {
  background: #fff8eb;
  border: 1px solid #f0d2a0;
  color: #7a4b10;
}
.opp-outcome-banner.peer {
  background: #eef6ff;
  border: 1px solid #b7d3f3;
  color: #1e3a5f;
}
.opp-soft-nudge {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f7fbf9 0%, #eef6f2 100%);
  border: 1px solid #cfe3d8;
}
.opp-soft-nudge-title {
  font-weight: 700;
  color: #1b4332;
  font-size: 0.95rem;
}
.opp-soft-nudge-text {
  margin: 6px 0 10px;
  line-height: 1.65;
  color: #3d5348;
  font-size: 0.9rem;
}
.opp-soft-nudge-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.opp-soft-nudge .btn.ghost {
  background: transparent;
  border-style: dashed;
  color: #5b6f65;
}
.opp-stage-more {
  margin: 0;
}
.opp-stage-more > summary {
  cursor: pointer;
  list-style: none;
  color: #5b6f65;
  font-size: 0.86rem;
}
.opp-stage-more > summary::-webkit-details-marker {
  display: none;
}
.opp-policy-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(27, 67, 50, 0.06);
  border: 1px solid rgba(27, 67, 50, 0.12);
  color: #314439;
  line-height: 1.55;
  font-size: 0.92rem;
}
.opp-deal.opp-locked {
  opacity: 0.98;
  border-style: dashed;
}
.opp-calc-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f3f7f4;
  border: 1px solid #d7e8dd;
  color: #1b4332;
  line-height: 1.6;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 30, 24, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop .modal.card {
  position: relative;
  inset: auto;
  transform: none;
  max-height: min(90vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 43, 32, 0.22);
}
.modal-backdrop label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: #314439;
}
.modal-backdrop .input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d7ddd9;
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
}

/* ——— التسويق بالعمولة ——— */
.aff-page { display:flex; flex-direction:column; gap:20px; max-width:960px; margin-inline:auto; width:100%; padding-block:8px 28px; }
.aff-hero h2 { margin:0 0 8px; font-size:1.25rem; }
.aff-hero p { margin:0; line-height:1.85; color:var(--text-2, #3d4f45); }
.aff-network { margin-top:10px !important; padding:12px 14px; background:linear-gradient(135deg, rgba(27,67,50,.08), rgba(201,162,39,.1)); border-radius:12px; color:var(--text, #1b2e24) !important; font-weight:500; }
.aff-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-top:16px; }
.aff-kpi { background:var(--surface-2, #f4f7f5); border-radius:12px; padding:12px 14px; }
.aff-kpi span { display:block; font-size:12px; color:var(--text-3,#6b7a72); }
.aff-kpi b { display:block; margin-top:4px; font-size:1.15rem; font-variant-numeric:tabular-nums; }
.aff-section-head { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.aff-list { display:flex; flex-direction:column; gap:14px; }
.aff-marketer { border:1px solid var(--border, #e2e8e4); border-radius:14px; padding:14px 16px; background:var(--surface, #fff); }
.aff-marketer.is-off { opacity:.72; }
.aff-marketer-head { display:flex; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.aff-marketer-head h3 { margin:0; font-size:1.05rem; }
.aff-marketer-stats { display:flex; gap:14px; flex-wrap:wrap; }
.aff-marketer-stats > div { text-align:center; min-width:72px; }
.aff-marketer-stats span { display:block; font-size:11px; color:var(--text-3); }
.aff-marketer-stats b { font-size:1rem; }
.aff-link-row { display:flex; gap:8px; flex-wrap:wrap; }
.aff-link-row .input { flex:1; min-width:180px; }
.aff-msg { font-family:inherit; line-height:1.7; white-space:pre-wrap; resize:vertical; min-height:140px; }
.aff-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.billing-wallet { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:16px; padding-top:14px; border-top:1px solid var(--border, #e2e8e4); }
.billing-wallet strong { display:block; font-size:1.2rem; margin-top:2px; }
@media (max-width:720px) {
  .aff-kpis { grid-template-columns:1fr 1fr; }
}

/* ================= لوحة التحكم v2 + هيكل نظيف ================= */
.dash-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 1.6rem 1.55rem 1.65rem;
  margin-bottom: 18px;
  border-radius: 18px;
  color: #eef5fa;
  background:
    radial-gradient(ellipse 55% 80% at 100% 0%, rgba(13, 143, 114, 0.35), transparent 55%),
    radial-gradient(ellipse 45% 60% at 0% 100%, rgba(21, 101, 168, 0.25), transparent 50%),
    linear-gradient(128deg, #061420 0%, #0b3d5c 52%, #0a2f42 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 40px rgba(7, 26, 43, 0.18);
  animation: viewIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  position: relative;
  overflow: hidden;
}
.dash-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.04) 50%, transparent 60%);
  pointer-events: none;
}
.dash-hero.empty { min-height: 220px; align-items: center; }
.dash-eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #7ad4bc;
  text-transform: none;
}
.dash-hero h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  color: #fff;
  max-width: 16ch;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.dash-hero-copy p:not(.dash-eyebrow) {
  margin: 0;
  max-width: 34rem;
  color: rgba(232, 240, 246, 0.78);
  font-size: 0.92rem;
  line-height: 1.7;
}
.dash-hero .btn.primary {
  background: #fff;
  color: var(--brand-deep);
  border-color: #fff;
  font-weight: 700;
}
.dash-hero .btn.primary:hover {
  background: #e8f4f0;
  color: var(--brand-deep);
}
.dash-hero .btn:not(.primary) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  box-shadow: none;
  backdrop-filter: blur(6px);
}
.dash-hero .btn:not(.primary):hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  display: grid;
  gap: 2px;
  animation: viewIn 0.45s ease both;
}
.stat:nth-child(2) { animation-delay: 0.04s; }
.stat:nth-child(3) { animation-delay: 0.08s; }
.stat:nth-child(4) { animation-delay: 0.12s; }
.stat-label { font-size: 0.75rem; color: var(--text-3); font-weight: 600; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.stat-sub { font-size: 0.78rem; color: var(--text-2); }

.dash-block {
  margin-bottom: 16px;
  padding: 1rem 1.1rem 1.15rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
}
.dash-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.dash-block-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--brand-deep);
}
.dash-block-head .muted {
  margin: 4px 0 0;
  font-size: 0.8rem;
}
.dash-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.dash-empty {
  padding: 8px 2px 4px;
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.65;
}
.dash-recent { cursor: pointer; }
.dash-recent:hover { background: var(--surface-2); }

.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.nav-pro {
  font-size: 0.7rem;
  opacity: 0.65;
  font-weight: 600;
  margin-inline-start: 4px;
}

@media (max-width: 900px) {
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .dash-split { grid-template-columns: 1fr; }
  .dash-hero h2 { max-width: none; }
}

/* Office match review */
.office-match-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 14px 0 8px;
}
.office-match-toolbar .input {
  flex: 1 1 220px;
  min-width: 180px;
}
.om-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.om-legend {
  font-size: 12.5px;
  line-height: 1.7;
  margin: 0 0 14px;
}
.match-row {
  flex-wrap: wrap;
  align-items: flex-start !important;
  gap: 8px !important;
  cursor: default !important;
}
.match-row .info {
  flex: 1 1 160px;
  min-width: 0;
}
.match-row .pair-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  margin-top: 6px;
  grid-column: 1 / -1;
}
.match-actions .btn {
  flex: 0 0 auto;
}

/* توافق — جوال */
@media (max-width: 640px) {
  .detail-foot-track {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .detail-foot-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }
  .detail-foot-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .detail-foot-actions .btn.primary {
    grid-column: 1 / -1;
  }
  .detail-foot-track > .btn[data-close] {
    width: 100%;
    margin: 0;
    justify-content: center;
  }

  .match-card {
    padding: 12px;
  }
  .match-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .match-card-actions .btn {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 6px;
  }
  .match-card-actions .btn.danger {
    grid-column: 1 / -1;
  }
  .match-reasons {
    gap: 5px;
  }

  .match-grid {
    grid-template-columns: 1fr !important;
  }
  .match-listing {
    padding: 10px;
  }
  .match-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .match-actions .btn {
    width: 100%;
    justify-content: center;
    font-size: 12px;
    padding: 8px 6px;
  }
  .match-actions .btn.danger {
    grid-column: 1 / -1;
  }
  .office-match-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .office-match-toolbar .input {
    width: 100%;
    min-width: 0;
  }
  .om-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: 6px;
  }
  .om-filters .btn,
  .om-filters button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .om-legend {
    font-size: 12px;
  }
  .match-opp-head {
    padding: 12px;
  }
  .match-opp-body {
    padding: 0 10px 10px 12px;
  }
}

.rel-pill-wrap {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 6px 6px;
}
.rel-unlink {
  border: 1px solid color-mix(in srgb, var(--red, #b42318) 35%, var(--line));
  background: var(--red-bg, #b4231814);
  color: var(--red, #b42318);
  border-radius: 999px;
  width: 22px;
  height: 22px;
  line-height: 1;
  cursor: pointer;
  font-weight: 700;
  padding: 0;
}
.rel-unlink:hover {
  background: var(--red, #b42318);
  color: #fff;
}
.opp-sim-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.opp-sim-bar strong {
  display: block;
  color: var(--brand-deep);
  margin-bottom: 2px;
}
.opp-sim-bar .muted {
  font-size: 12.5px;
  line-height: 1.55;
}
.opp-sim-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.opp-deal.opp-sim {
  border-color: color-mix(in srgb, #0284c7 35%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, #0284c7 12%, transparent);
}
.opp-sim-only-note {
  background: color-mix(in srgb, var(--amber) 10%, var(--surface));
}

/* ================= لمسة 2030: ترتيب أوضح · بدون خَبصة ================= */
.overlay[hidden] { display: none !important; }
.overlay:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 10050 !important;
  background: rgba(4, 12, 20, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: overlayIn 0.22s ease both;
  pointer-events: auto;
}
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.btn {
  border-radius: 11px;
  letter-spacing: 0.01em;
}
.btn.primary {
  background: linear-gradient(135deg, #0e4a6e 0%, var(--brand) 55%, #0a3550 100%);
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(11, 61, 92, 0.22);
}
.btn.primary:hover {
  background: linear-gradient(135deg, #125f8a 0%, #0d4a70 100%);
  filter: none;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.toolbar .search input {
  border-radius: 10px;
  background: var(--surface-2);
  border-color: var(--line);
}
.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.seg button.on,
.seg button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(11, 61, 92, 0.2);
}

.badge {
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.kpi {
  border-radius: 16px;
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--surface) 96%, #fff) 0%, var(--surface) 100%);
  border-color: color-mix(in srgb, var(--line) 85%, transparent);
}
.kpi .value {
  font-size: 28px;
  font-weight: 800;
}

.field label {
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.field input,
.field select,
.field textarea,
.combo input {
  border-radius: 11px !important;
  background: var(--surface-2);
  border-color: var(--line) !important;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.combo input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}

.detail-head {
  padding: 20px 20px 14px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 5%, var(--surface)) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--line);
}
.detail-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
}
.detail-head .code {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 6px;
}

.modal-card,
.modal-shell .modal-card {
  border-radius: 18px !important;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.g-card,
.mini-card {
  border-radius: 14px;
  border-color: var(--line);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.g-card:hover,
.mini-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* الجوال: القائمة الجانبية تبقى غامقة وحديثة */
@media (max-width: 900px) {
  .view {
    padding: 16px 14px 88px;
    max-width: none;
  }
  .topbar {
    padding: 12px 14px;
  }
  .sidebar {
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
  }
}

[data-theme='dark'] .brand-text strong {
  color: #f2f7fb;
}
[data-theme='dark'] .page-head h1,
[data-theme='dark'] .kpi .value,
[data-theme='dark'] table.data td.title-cell {
  color: var(--text);
}
[data-theme='dark'] .toolbar,
[data-theme='dark'] .table-wrap {
  background: var(--surface);
}
