
/* ============================ المشاريع ومعرض الصور ============================ */
.proj-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.proj-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .18s;
}
.proj-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.proj-media { position: relative; height: 168px; background: #0b1a26; overflow: hidden; }
.proj-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proj-badges { position: absolute; top: 9px; inset-inline-start: 9px; display: flex; gap: 6px; flex-wrap: wrap; }
.proj-code {
  position: absolute; top: 9px; inset-inline-end: 9px; background: rgba(0, 0, 0, .5);
  color: #fff; border-radius: 7px; padding: 2px 8px; font-size: 11px; letter-spacing: .4px;
}
.proj-body { padding: 13px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.proj-name { font-size: 15px; line-height: 1.5; }
.proj-dev { font-size: 11.5px; color: var(--muted); margin: 0; }
.proj-loc { font-size: 12px; color: var(--muted); }
.proj-stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.proj-price { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-2); margin-top: auto; }
.proj-price b { color: var(--brand-dark); font-size: 14px; }
.proj-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 4px; border-top: 1px dashed var(--line); }
.tbl-thumb { width: 42px; height: 32px; object-fit: cover; border-radius: 6px; flex: 0 0 42px; }
.prop-project {
  font-size: 11.5px; color: var(--brand); background: #eef4fa; border: 1px solid #cfe0ef;
  border-radius: 7px; padding: 2px 7px; display: inline-block; cursor: pointer;
}
.prop-project:hover { background: #dfeaf5; }

.gallery { display: grid; gap: 9px; }
.gal-main { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #0b1a26; }
.gal-main img { width: 100%; max-height: 330px; object-fit: cover; display: block; }
.gal-caption {
  position: absolute; inset-block-end: 0; inset-inline: 0; padding: 8px 12px; font-size: 12px;
  color: #fff; background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .72));
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.gal-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gal-thumb {
  position: relative; width: 92px; height: 66px; border-radius: 9px; overflow: hidden; padding: 0;
  border: 2px solid var(--line); background: none; cursor: pointer; transition: border-color .15s, transform .15s;
}
.gal-thumb:hover { transform: translateY(-2px); }
.gal-thumb.active { border-color: var(--brand-2); }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-cover-tag {
  position: absolute; inset-block-end: 0; inset-inline: 0; background: rgba(11, 107, 69, .92);
  color: #fff; font-size: 9.5px; padding: 1px 0; text-align: center;
}
.gal-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gal-actions label.btn { position: relative; overflow: hidden; }
@media print { .gal-thumbs, .gal-actions { display: none !important; } }

/* صور كتيّب المشروع المطبوع */
.brochure-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.brochure-grid figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.brochure-grid figure.wide { grid-column: span 3; }
.brochure-grid img { width: 100%; height: 130px; object-fit: cover; display: block; }
.brochure-grid figure.wide img { height: 220px; }
.brochure-grid figcaption { font-size: 10.5px; color: var(--muted); padding: 4px 7px; background: #fbfdfc; }
@media print { .brochure-grid { page-break-inside: avoid; } }
/* ==================== الحجوزات ومصفوفة المخزون (طوابق × نماذج) ==================== */
.mx-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.mx-legend span { display: flex; align-items: center; gap: 5px; }
.mx-dot { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1px solid rgba(0,0,0,.08); }
.mx-scroll { overflow-x: auto; padding-bottom: 4px; }
.mx-table { width: 100%; border-collapse: separate; border-spacing: 4px; min-width: 560px; }
.mx-table th, .mx-table td { text-align: center; border-radius: 9px; padding: 8px 6px; }
.mx-corner { background: var(--brand-dark); color: #fff; font-size: 12px; width: 92px; }
.mx-table thead th { background: #eef3f8; vertical-align: top; }
.mx-model { font-size: 15px; font-weight: 700; color: var(--brand-dark); }
.mx-model-sub { font-size: 10.5px; color: var(--muted); font-weight: 400; line-height: 1.5; }
.mx-model-price { font-size: 11px; font-weight: 700; color: var(--brand); margin-top: 3px; }
.mx-floor { background: #eef3f8; color: var(--brand-dark); font-size: 12px; font-weight: 700; width: 92px; }
.mx-cell { cursor: pointer; border: 1px solid transparent; transition: transform .12s, box-shadow .12s; }
.mx-cell b { display: block; font-size: 15px; line-height: 1.2; }
.mx-cell span { display: block; font-size: 10.5px; opacity: .8; }
.mx-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-2); }
.mx-cell.mx-empty { background: #fafbfc; color: #c3ccd4; cursor: default; }
.mx-cell.mx-empty:hover { transform: none; box-shadow: none; }
.st-available { background: #e8f7ee; color: #14532d; }
.st-reserved { background: #fdf3d9; color: #713f12; }
.st-sold { background: #f7e3e3; color: #7f1d1d; }
.st-off_market { background: #eef1f4; color: #475569; }
.st-rented { background: #e0f2fe; color: #0c4a6e; }
.mx-annex { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.mx-annex-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; min-width: 140px;
  cursor: pointer; transition: transform .12s, box-shadow .12s;
}
.mx-annex-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mx-annex-item b { display: block; font-size: 12.5px; }
.mx-annex-item span { display: block; font-size: 11px; opacity: .85; }
.mx-annex-item small { font-size: 10px; opacity: .75; }
.card-foot { padding: 11px 14px; border-top: 1px solid var(--line); background: #fbfdfc; border-radius: 0 0 var(--radius) var(--radius); }
.voucher-page { page-break-inside: avoid; }
.page-break { page-break-after: always; }

/* مصفوفة داخل المستندات المطبوعة */
.mx-doc { border-collapse: collapse !important; }
.mx-doc th, .mx-doc td { border: 1px solid #d8dee5 !important; border-radius: 0 !important; }
.mx-doc .mx-floor { background: #eef3f8 !important; }
.mx-doc .mx-td b { display: block; font-size: 12px; }
.mx-doc .mx-td small { display: block; font-size: 9px; }
.mx-doc .mx-empty { background: #fafbfc !important; color: #b8c1c9; }
.mx-chip { display: inline-block; border-radius: 6px; padding: 1px 7px; font-size: 10.5px; margin-inline-end: 4px; }
.mx-chip.av { background: #e8f7ee; color: #14532d; }
.mx-chip.rs { background: #fdf3d9; color: #713f12; }
.mx-chip.sd { background: #f7e3e3; color: #7f1d1d; }
@media print {
  .mx-table, .mx-annex { page-break-inside: avoid; }
  .mx-doc .mx-td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .st-available, .st-reserved, .st-sold { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* شريحة «مُباع بالكامل» في التقارير */
.mx-chip.so { background: #f7e3e3; color: #7f1d1d; font-weight: 700; }

/* قائمة اختيار المشاريع المعروضة */
.pick-list { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.pick-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .12s;
}
.pick-row:last-child { border-bottom: none; }
.pick-row:hover { background: #f7fafd; }
.pick-row.on { background: #eef4fa; }
.pick-box {
  width: 20px; height: 20px; flex: 0 0 20px; border-radius: 6px; border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; background: #fff;
}
.pick-row.on .pick-box { background: var(--brand); border-color: var(--brand); }
.pick-main { flex: 1; min-width: 0; }
.pick-main b { display: block; font-size: 13px; }
.pick-main small { font-size: 11px; }
.pick-stats { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.pick-stats .tag { font-size: 10.5px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; }

/* شريط تعريف القسم (داخلي / خارجي) */
.scope-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-radius: 12px; padding: 10px 14px; margin: 12px 0 4px; font-size: 12.5px;
}
.scope-banner.int { background: #fdf3d9; border: 1px solid #ecd9a0; color: #7a5c00; }
.scope-banner.ext { background: #eef4fa; border: 1px solid #cfe0ef; color: #123c63; }
.scope-tag {
  font-weight: 700; font-size: 11px; border-radius: 7px; padding: 2px 9px; color: #fff; white-space: nowrap;
}
.scope-banner.int .scope-tag { background: #b8860b; }
.scope-banner.ext .scope-tag { background: var(--brand, #1b4a72); }
.scope-text { flex: 1; min-width: 200px; }
.scope-hint { font-size: 11px; opacity: .85; }
@media print { .scope-banner { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
