[hidden] { display: none !important; }
/* هوية قطعتك: أزرق المخطط للأفعال، أصفر القطعة لنتيجة البحث فقط، الحبر للنصوص، أخضر متاحة، أحمر مباعة — القيم من brand/qitatuk */
:root {
  --gold: #2148C8; --gold-soft: #E8EEFC; --black: #13233A; --white: #F4F6F9; --blue: #2148C8; --green: #0B6B3B;
  --ink: #3A4659; --line: #DFE4EC;
  --font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --head: 'Readex Pro', 'IBM Plex Sans Arabic', Tahoma, sans-serif;
  --parcel: #FFC23D; --sale: #13A05A; --sold: #D8433F; --muted: #5F6B7D;
}
* { box-sizing: border-box; }
/* الخلفية فاتحة: متصفح الجوال يلوّن شريط الحالة وشريط العنوان بلون خلفية الصفحة */
html, body { margin: 0; height: 100%; font-family: var(--font); background: var(--white); color: var(--black); }
body { display: flex; flex-direction: column; position: fixed; inset: 0; height: auto; overflow: hidden; }
#map { background: #DFE4EC; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

header {
  display: flex; align-items: center; gap: 14px; padding: 9px 18px; padding-top: calc(9px + env(safe-area-inset-top)); min-height: 58px;
  background: #FFFFFF; color: var(--black); border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px rgba(19,35,58,.06); z-index: 5;
}
header .logo { height: 34px; display: block; }
header .brand { font: 700 15px/1.3 var(--head); padding-inline-start: 14px; border-inline-start: 1px solid #CFD6E2; }
header .brand small { display: block; font: 500 12px var(--font); color: #2148C8; }
header .spacer { flex: 1; }
header a.link { color: var(--gold); font-size: 14px; text-decoration: none; font-weight: 700; }

#map { flex: 1; position: relative; }
.ui { position: absolute; top: 14px; right: 14px; z-index: 3; width: 330px; max-width: calc(100% - 28px); display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--white); border-radius: 14px; box-shadow: 0 6px 22px rgba(12,12,12,.32); }

.search { display: flex; align-items: center; padding: 5px; gap: 4px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 10px 12px; font: 500 16px var(--font); color: var(--black); }
.search input:focus { outline: none; }
.search:focus-within { box-shadow: 0 6px 22px rgba(12,12,12,.32), 0 0 0 2px var(--gold); }
.search button { border: 0; border-radius: 10px; background: var(--gold); color: #fff; padding: 10px 18px; font: 700 15px var(--head); cursor: pointer; }
.search button:hover { background: #1A3AA3; }

.panel { overflow: hidden; }
.panel > summary {
  list-style: none; cursor: pointer; padding: 13px 16px; font: 700 15px var(--head);
  display: flex; align-items: center; gap: 8px;
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::after { content: ''; margin-inline-start: auto; width: 8px; height: 8px; border: solid var(--gold); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); transition: transform .15s; }
.panel:not([open]) > summary::after { transform: rotate(135deg); }
.panel .count { background: var(--black); color: var(--gold); border-radius: 20px; padding: 1px 9px; font: 700 12px var(--font); }
.panel .body { padding: 0 14px 14px; max-height: 58vh; overflow: auto; }

.plans { list-style: none; margin: 0; padding: 0; }
.plans li {
  padding: 11px 13px; border-radius: 10px; cursor: pointer; border: 1px solid var(--line); margin-bottom: 7px; background: #fff;
  border-inline-start: 4px solid var(--gold); transition: background .12s;
}
.plans li:hover { background: var(--gold-soft); }
.plans li b { display: block; font: 700 14.5px/1.5 var(--head); }
.plans li span { color: #6b6b6b; font-size: 12.5px; }
#results:empty { display: none; }
#results { padding: 10px 12px 4px; }
#results .hint { margin: 0 0 8px; }

.opts { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.seg { display: flex; background: #E6EAF1; border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.seg button { flex: 1; padding: 7px; border: 0; border-radius: 8px; background: none; font: 500 14px var(--font); cursor: pointer; color: var(--ink); }
.seg button.on { background: var(--black); color: var(--gold); font-weight: 700; }
label.row { display: block; font-size: 13px; color: var(--ink); margin: 10px 0 4px; }
input[type=range] { width: 100%; accent-color: var(--gold); }
input[type=number], input[type=text] { width: 100%; padding: 8px 10px; border: 1px solid #C9D0DC; border-radius: 8px; font: 500 14px var(--font); background: #fff; }
.empty { font-size: 13.5px; color: var(--ink); background: var(--gold-soft); padding: 11px 13px; border-radius: 10px; line-height: 1.8; margin: 0; }
.hint { font-size: 12.5px; color: #666; line-height: 1.8; margin: 8px 0 0; }

.btn {
  display: block; width: 100%; padding: 10px; border: 0; border-radius: 10px; margin-top: 8px; text-align: center; text-decoration: none;
  background: var(--gold); color: #fff; font: 700 14px var(--head); cursor: pointer;
}
.btn.dark { background: var(--black); color: var(--gold); }
.btn.go { background: var(--green); }
.btn.route { background: #3fb4ff; color: var(--black); margin-top: 6px; }
.btn:disabled { opacity: .7; cursor: wait; }
.btn.ghost { background: none; color: var(--blue); border: 1px solid #C9D5F5; }

.plan-label {
  background: rgba(19,35,58,.9); color: var(--white); border: 1px solid var(--gold); border-radius: 12px;
  padding: 2px 8px; font: 700 11px var(--head); cursor: pointer; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.zoomed .plan-label { display: none; }

/* بطاقة القطعة */
.maplibregl-popup-content { border-radius: 14px; padding: 0; font-family: var(--font); direction: rtl; overflow: hidden; box-shadow: 0 8px 28px rgba(12,12,12,.4); background: var(--white); }
.maplibregl-popup-close-button { color: var(--white); font-size: 20px; left: 4px; right: auto; top: 4px; }

.maplibregl-ctrl-group { border-radius: 10px !important; overflow: hidden; }
.handle { width: 24px; height: 24px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.6); cursor: grab; }
.handle.move { background: var(--gold); }
.handle.rot { background: var(--parcel); }
textarea { width: 100%; height: 130px; direction: ltr; font: 12px/1.5 monospace; border: 1px solid #ccc; border-radius: 8px; padding: 8px; margin-top: 8px; }

@media (max-width: 600px) {
  header { padding: 6px 12px; padding-top: calc(6px + env(safe-area-inset-top)); min-height: 44px; border-bottom-width: 2px; }
  header .logo { height: 28px; }
  header .brand { font-size: 14px; }
  .maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { padding-bottom: env(safe-area-inset-bottom); }
  header .brand small { display: none; }
  .ui { top: 10px; right: 10px; left: 10px; width: auto; max-width: none; }
}

.search input#q { border: 0; background: none; padding: 10px 12px; font-size: 16px; }
.search { border-radius: 14px; }

/* بطاقة القطعة: مضغوطة، تبقى ظاهرة حتى «إلغاء». على الحاسوب تحت البحث، وعلى الجوال أسفل الشاشة */
.plot-sheet { overflow: hidden; }
.plot-sheet:empty { display: none; }
.plot-card .top { display: flex; align-items: center; gap: 10px; background: var(--black); color: var(--white); padding: 9px 12px 8px; border-bottom: 3px solid var(--gold); }
.plot-card .tt { flex: 1; min-width: 0; }
.plot-card h3 { margin: 0; font: 800 17px/1.3 var(--head); }
.plot-card h3 em { font-style: normal; color: var(--gold); }
.plot-card .pn { margin: 1px 0 0; font-size: 12px; color: #AFC0F0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plot-card .cancel { flex: none; border: 1px solid #4a4a4a; background: #262626; color: var(--white); border-radius: 8px; padding: 6px 14px; font: 700 13px var(--head); cursor: pointer; }
.plot-card .in { padding: 8px 10px 10px; }
.plot-card .ar { margin: 0 2px 7px; font-size: 13.5px; font-weight: 700; color: var(--black); }
.plot-card .rt { margin: 0 2px 7px; font-size: 12.5px; line-height: 1.6; color: var(--ink); }
.plot-card .ar:empty, .plot-card .rt:empty { display: none; }
.plot-card .acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.plot-card .acts .btn { margin: 0; padding: 8px 4px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.basemap-btn { width: auto !important; padding: 0 10px !important; font: 700 12px var(--font) !important; color: var(--black); }
#results .hint { font-weight: 700; color: var(--black); }

@media (max-width: 600px) {
  .plot-sheet {
    position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 6;
    box-shadow: 0 -4px 22px rgba(12,12,12,.4);
  }
  .sheet-open .maplibregl-ctrl-bottom-left, .sheet-open .maplibregl-ctrl-bottom-right { display: none; }
}
#results li { padding: 7px 12px; margin-bottom: 6px; }
#results li b { font-size: 14px; }
.row-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.row-btns .btn { margin-top: 6px; padding: 8px 4px; font-size: 13px; }

@media (max-width: 600px) { .plan-label { font-size: 10px; padding: 1px 7px; } }

/* ——— صفحات الحسابات ——— */
.auth-page { min-height: 100%; background: var(--white); }
.auth-wrap { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px 48px; background: #EEF1F6; overflow: auto; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; box-shadow: 0 6px 24px rgba(12,12,12,.12); padding: 24px 22px; border-top: 4px solid var(--gold); }
.auth-card.wide { max-width: 1100px; }
.auth-card h1 { margin: 0 0 4px; font: 800 22px var(--head); }
.auth-card .sub { margin: 0 0 18px; color: #666; font-size: 14px; line-height: 1.7; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 5px; }
.field input, .field select { width: 100%; padding: 11px 12px; border: 1px solid #C9D0DC; border-radius: 10px; font: 500 15px var(--font); background: #fff; }
.field input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.field .help { font-size: 12px; color: #777; margin-top: 4px; }
.form-msg { font-size: 14px; line-height: 1.7; border-radius: 10px; padding: 0; margin: 4px 0 8px; }
.form-msg.err { background: #FBE8E7; color: #8E2421; padding: 10px 12px; }
.form-msg.ok { background: #E3F5EC; color: #0B6B3B; padding: 10px 12px; }
.auth-links { margin-top: 14px; font-size: 14px; text-align: center; color: #555; }
.auth-links a { color: var(--blue); font-weight: 700; text-decoration: none; }
.btn:disabled { opacity: .65; cursor: wait; }
.top-links { display: flex; gap: 14px; align-items: center; }
.top-links a { color: var(--gold); font-weight: 700; text-decoration: none; font-size: 14px; }
.top-links button { background: none; border: 0; color: #8E2421; font: 700 14px var(--font); cursor: pointer; }
/* لوحة الإدارة */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 16px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 10px 12px; font: 700 14px var(--head); color: #666; cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--black); border-bottom-color: var(--gold); }
.tabs .badge { background: #c0392b; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; margin-inline-start: 4px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: start; background: #F4F6F9; padding: 9px 10px; font-weight: 700; white-space: nowrap; }
table.data td { padding: 9px 10px; border-top: 1px solid #eee; vertical-align: top; }
table.data td.actions { white-space: nowrap; }
table.data .mini { display: inline-block; width: auto; margin: 0 0 4px; padding: 6px 10px; font-size: 13px; }
.mini.danger { background: #8E2421; color: #fff; }
.pill { display: inline-block; border-radius: 10px; padding: 1px 9px; font-size: 12px; font-weight: 700; }
.pill.pending { background: #fff4d6; color: #7a5a00; } .pill.active { background: #E3F5EC; color: #0B6B3B; }
.pill.rejected { background: #FBE8E7; color: #8E2421; } .pill.suspended { background: #E8EEFC; color: #3a2f7a; }
.empty-row { text-align: center; color: #777; padding: 18px; }
.qr-box { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.qr-box #qr { background: #fff; padding: 8px; border: 1px solid #eee; border-radius: 10px; }
.secret { direction: ltr; font: 700 15px monospace; background: #F4F6F9; padding: 8px 10px; border-radius: 8px; word-break: break-all; }
.linkbox { direction: ltr; font: 13px monospace; background: #F4F6F9; padding: 8px 10px; border-radius: 8px; word-break: break-all; margin-top: 6px; }
.tool-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.tool-list li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tool-list a { color: var(--blue); font-weight: 700; text-decoration: none; font-size: 13px; margin-inline-end: 10px; }
.header-login { color: var(--gold); font-weight: 700; text-decoration: none; font-size: 14px; }

/* ——— الإحصاءات ——— */
.stats { display: flex; flex-direction: column; gap: 16px; }
.period { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.period .custom { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: #5F6B7D; margin-inline-start: auto; }
.period input[type=date] { font: 13px var(--font); padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.chip { font: 600 13px var(--font); padding: 6px 12px; border-radius: 20px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.chip.on { background: var(--black); color: var(--gold); border-color: var(--black); }
.chip small { color: #7C8698; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi { background: #F7F9FC; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi .k { font: 600 13px var(--font); color: #5F6B7D; }
.kpi b { font: 800 26px var(--head); color: var(--black); font-variant-numeric: tabular-nums; }
.kpi small { font-size: 12px; color: #7C8698; min-height: 1em; }
.spanel { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.spanel h3, .panel-head h3 { margin: 0 0 4px; font: 800 16px var(--head); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; background: #EEF1F6; border-radius: 10px; padding: 3px; }
.seg button { font: 600 12.5px var(--font); border: 0; background: none; padding: 5px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.seg button.on { background: #fff; color: var(--black); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.chart { position: relative; }
.chart svg { direction: ltr; display: block; overflow: visible; }
.chart .grid { stroke: #E6EAF1; stroke-width: 1; }
.chart .ax { font: 11px var(--font); fill: #7C8698; }
.chart .bar { fill: var(--gold); }
.chart .bar.hl { fill: #2148C8; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .tip { position: absolute; top: 0; width: 140px; background: var(--black); color: #fff; border-radius: 8px; padding: 6px 10px; pointer-events: none; display: flex; flex-direction: column; font-size: 13px; }
.chart .tip small { color: #C3CBE0; font-size: 11.5px; }
table.stat td.num, table.stat th.num { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.stat td.zero { color: #c3c0b8; }
table.stat th.sortable { cursor: pointer; user-select: none; }
table.stat th.on { color: var(--gold); }
table.stat tr.click { cursor: pointer; }
table.stat tr.click:hover td { background: var(--gold-soft); }
.misses { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.find { font: 14px var(--font); padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; width: 180px; margin: 6px 0 10px; }
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 22px; }
  .period .custom { margin-inline-start: 0; }
}
.period .btn, .panel-head .btn { width: auto; margin: 0; padding: 6px 14px; }
.seg button { white-space: nowrap; }

/* حذف الحساب */
.btn.mini.del { background: none; color: #8E2421; border: 1px solid #F2C4C2; }
.btn.mini.del:hover { background: #FBE8E7; }
.modal { position: fixed; inset: 0; background: rgba(12,12,12,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-card { background: #fff; border-radius: 16px; border-top: 4px solid #8E2421; width: 100%; max-width: 420px; padding: 22px; box-shadow: 0 12px 40px rgba(0,0,0,.3); max-height: calc(100% - 32px); overflow: auto; }
.modal-card h2 { margin: 0 0 12px; font: 800 19px var(--head); color: #8E2421; }
.del-who { display: flex; flex-direction: column; gap: 2px; background: #F7F9FC; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.del-who span { text-align: right; font-size: 13.5px; color: var(--ink); }
.del-who small { color: #7C8698; }
.modal-card .warn { color: #8E2421; font-size: 14px; line-height: 1.7; margin: 12px 0 4px; }
.modal-acts { display: flex; gap: 8px; }
.modal-acts .btn { margin: 0; }
.btn.danger { background: #8E2421; color: #fff; }

/* حالة القطع */
.plot-card .stt { display: inline-block; margin: 0 2px 7px; padding: 2px 10px; border-radius: 20px; font: 700 13px var(--font); color: #fff; }
.plot-card .stt.avail { background: #13A05A; }
.plot-card .stt.sold { background: #D8433F; }
.legend { display: flex; gap: 14px; padding: 7px 12px; font: 600 13px var(--font); align-self: flex-start; }
.legend[hidden] { display: none; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
.legend i.avail { background: #13A05A; }
.legend i.sold { background: #D8433F; }

/* صفحة تأشير القطع */
.farm-panel { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.farm-panel.off .search, .farm-panel.off .row-btns, .farm-panel.off #clear { display: none; }
.fcounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fcounts div { background: #EEF1F6; border-radius: 10px; padding: 8px 4px; text-align: center; display: flex; flex-direction: column; }
.fcounts b { font: 800 20px var(--head); }
.fcounts small { font-size: 12px; color: #5F6B7D; }
.fcounts .avail { background: #E3F5EC; } .fcounts .avail b { color: #0B6B3B; }
.fcounts .sold { background: #FBE8E7; } .fcounts .sold b { color: #8E2421; }
.farm-panel .hint { margin: 2px 0 0; font-size: 13px; color: #5F6B7D; line-height: 1.6; }
.sel-info { margin: 0; font: 700 13.5px var(--font); }
.farm-panel .row-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.farm-panel .btn { margin: 0; }
.btn.mark.sold { background: #D8433F; color: #fff; }
.btn.mark.avail { background: #13A05A; color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.farm-panel .form-msg:empty { display: none; }
.legend i.pick { background: #FFC23D; outline: 1.5px solid #13233A; }
@media (max-width: 600px) {
  .farm .ui { top: auto; bottom: 10px; right: 10px; left: 10px; width: auto; max-width: none; }
  .farm .farm-panel { max-height: 48vh; overflow: auto; padding: 10px; gap: 6px; }
  .farm .farm-panel .hint { display: none; }
  .farm .legend { order: -1; }
}

/* لوحة صاحب المقاطعة */
.notice { background: var(--gold-soft); border: 1px solid #C9D5F5; border-radius: 12px; padding: 16px; }
.notice p { margin: 6px 0 0; color: var(--ink); line-height: 1.7; }
.farm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.farm-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.farm-card h3 { margin: 0; font: 800 18px var(--head); }
.sbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: #eee; gap: 2px; }
.sbar i { display: block; height: 100%; }
.sbar i.sold { background: #D8433F; } .sbar i.avail { background: #13A05A; }
.farm-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.farm-acts .btn { margin: 0; width: auto; flex: 1; text-align: center; text-decoration: none; }
.btn.mini.link { background: none; color: #0B6B3B; border: 1px solid #A8DCC0; }
.btn.mini.link:hover { background: #E3F5EC; }
small.linked { display: block; width: fit-content; margin-top: 3px; padding: 1px 8px; border-radius: 10px; background: #E3F5EC; color: #0B6B3B; font-size: 11.5px; }
.modal-card.link { border-top-color: #13A05A; max-width: 480px; }
.modal-card.link h2 { color: var(--black); }
.link-list ul { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.link-list li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.link-list li span { flex: 1; font-weight: 700; }
.link-list .btn.mini { width: auto; margin: 0; padding: 5px 10px; font-size: 12.5px; }
.mini-link { font-size: 12.5px; color: var(--blue); }
.modal-card .find { width: 100%; }

/* المخطط المضمّن في لوحة صاحب المقاطعة */
.farm-plans { display: flex; flex-direction: column; gap: 22px; }
.farm-plan { display: flex; flex-direction: column; gap: 10px; }
.farm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.farm-head h3 { margin: 0; font: 800 20px var(--head); flex: 1 1 auto; }
.farm-head .fcounts { flex: 0 1 360px; }
.farm-head .fcounts div { padding: 6px 4px; }
.farm-head .fcounts b { font-size: 18px; }
.farm-head .farm-acts { flex: 0 0 auto; }
.farm-head .farm-acts .btn { padding: 8px 14px; font-size: 13.5px; }
.farm-frame { width: 100%; height: min(78vh, 760px); min-height: 480px; border: 1px solid var(--line); border-radius: 14px; background: #DFE4EC; display: block; }
body.embed header { display: none; }
body.embed .farm-panel .fcounts { display: none; }
body.embed .ui { top: 10px; right: 10px; width: 300px; }
@media (max-width: 760px) {
  .farm-head .fcounts { flex: 1 1 100%; }
  .farm-head .farm-acts { flex: 1 1 100%; }
  .farm-frame { height: 72vh; min-height: 420px; }
}
@media (max-width: 600px) {
  body.embed .ui { top: auto; bottom: 8px; right: 8px; left: 8px; width: auto; }
}
.farm-head .farm-acts .btn { white-space: nowrap; }
/* ألوان الحالة الأخف */
.legend i.avail { background: #13A05A; opacity: .55; }
.legend i.sold { background: #D8433F; opacity: .7; }

/* نوع المخطط: زراعي (أخضر فاتح) وسكني (أزرق فاتح) */
.plan-label.k-farm { background: rgba(227,245,236,.96); color: #0B6B3B; border-color: #A8DCC0; }
.plan-label.k-res { background: rgba(232,238,252,.96); color: #13233A; border-color: #C9D5F5; }
.plot-card.k-farm .top { background: #E3F5EC; color: var(--black); border-bottom-color: #13A05A; }
.plot-card.k-farm h3 em { color: #0B6B3B; }
.plot-card.k-farm .pn { color: #0B6B3B; }
.plot-card.k-res .top { background: #E8EEFC; color: var(--black); border-bottom-color: #2148C8; }
.plot-card.k-res h3 em { color: #2148C8; }
.plot-card.k-res .pn { color: #2148C8; }
.plot-card.k-farm .cancel, .plot-card.k-res .cancel { background: #fff; color: var(--black); border-color: rgba(0,0,0,.15); }
/* صاحب المقاطعة داخل بطاقة القطعة */
.plot-card .owner { margin-top: 9px; padding: 9px 10px; border-radius: 10px; background: #E3F5EC; border: 1px solid #C8E9D6; }
.owner .o-lbl { margin: 0; font-size: 11px; color: #0B6B3B; font-weight: 700; }
.owner .o-title { margin: 1px 0 2px; font: 800 15px var(--head); }
.owner p { margin: 2px 0; font-size: 12.5px; line-height: 1.6; color: var(--ink); }
.owner .o-about { white-space: pre-line; }
.owner .o-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; margin-top: 7px; }
.owner .o-acts .btn { margin: 0; padding: 7px 4px; font-size: 12.5px; text-align: center; text-decoration: none; }
.owner .o-call { background: #0B6B3B; color: #fff; }
.owner .o-wa { background: #25d366; color: #13233A; }
.owner .o-office { background: #fff; color: #0B6B3B; border: 1px solid #A8DCC0; }
.tool-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.kind-sel { font: 700 12.5px var(--font); border-radius: 8px; padding: 4px 6px; border: 1px solid var(--line); }
.kind-sel.farm { background: #E3F5EC; color: #0B6B3B; border-color: #A8DCC0; }
.kind-sel.res { background: #E8EEFC; color: #13233A; border-color: #C9D5F5; }
.profile-wrap { max-width: 560px; }
.profile-form textarea { width: 100%; font: 15px var(--font); padding: 10px 12px; border: 1px solid #CFD6E2; border-radius: 10px; resize: vertical; }
.profile-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.loc-row { display: flex; gap: 6px; }
.loc-row input { flex: 1; }
.loc-row .btn { width: auto; margin: 0; white-space: nowrap; }
@media (max-width: 500px) { .profile-form .two { grid-template-columns: 1fr; } }
/* بطاقات أسماء المخططات: كتابة بيضاء وألوان أغمق قليلاً */
.plan-label.k-farm { background: rgba(11,107,59,.94); color: #fff; border-color: #A8DCC0; }
.plan-label.k-res { background: rgba(33,72,200,.94); color: #fff; border-color: #b3c8ee; }

/* التطبيق القابل للتثبيت */
.install-btn { border: 1px solid var(--gold); background: var(--black); color: var(--gold); border-radius: 20px; padding: 6px 12px; font: 700 13px var(--head); cursor: pointer; white-space: nowrap; }
.install-btn[hidden] { display: none; }
/* داخل التطبيق المثبت: لا حاجة لزر التثبيت */
.in-app .install-btn { display: none; }
@media (max-width: 600px) { .install-btn { padding: 5px 9px; font-size: 12px; } }
header .brand { white-space: nowrap; }
@media (max-width: 420px) { header .brand { font-size: 13.5px; padding-inline-start: 10px; } header .brand small { font-size: 11px; } header { gap: 9px; } }

/* محرر المخططات */
.handle.plan-move { width: 30px; height: 30px; background: var(--black); border-color: var(--gold); }
.handle[hidden] { display: none; }
.k-dark { color: var(--black); }
.ed-panel { width: 360px; }
.ed-panel .body { max-height: calc(100vh - 160px); }
.ed-tabs { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; margin-bottom: 10px; }
.ed-tabs button { padding: 7px 4px; }
.editor section { display: flex; flex-direction: column; gap: 6px; }
.editor section[hidden] { display: none; }
.ed-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed-two label { display: flex; flex-direction: column; gap: 3px; font: 600 12.5px var(--font); color: #5F6B7D; }
.editor input[type=number], .ed-note, .editor select { font: 600 15px var(--font); padding: 7px 9px; border: 1px solid #CFD6E2; border-radius: 8px; width: 100%; background: #fff; }
.editor input:disabled { background: #EEF1F6; color: #aaa; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.ed-rot { display: grid; grid-template-columns: 1fr 1fr 1.3fr 1fr 1fr; gap: 4px; align-items: center; }
.ed-rot .btn { margin: 0; padding: 7px 2px; font-size: 12.5px; }
.ed-rot input { text-align: center; padding: 6px 2px; }
.ed-val { text-align: center; font: 700 13px var(--font); }
.ed-pad { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(3, 36px); gap: 4px; justify-content: center; direction: ltr; }
.ed-pad .btn { margin: 0; padding: 0; font-size: 18px; }
.ed-pad .btn:nth-child(1) { grid-area: 1 / 2; } .ed-pad .btn:nth-child(2) { grid-area: 2 / 1; }
.ed-pad .btn:nth-child(3) { grid-area: 2 / 3; } .ed-pad .btn:nth-child(4) { grid-area: 3 / 2; }
.ed-foot { display: flex; align-items: center; gap: 10px; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.ed-foot .btn { margin: 0; width: auto; padding: 7px 14px; }
.ed-foot label { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.ed-foot select { width: auto; padding: 5px 6px; font-size: 13px; }
.ed-state { background: #fff3d6; color: #2148C8; border: 1px solid #e8cf8f; border-radius: 20px; padding: 3px 10px; font: 700 12px var(--font); }
.ed-state[hidden] { display: none; }
.ed-measure { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #F7F9FC; }
.m-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 3px 0; }
.m-row.total { border-top: 1px dashed var(--line); margin-top: 3px; padding-top: 5px; }
.m-label { background: #ff3b30; color: #fff; font: 700 12px var(--font); padding: 2px 7px; border-radius: 10px; white-space: nowrap; pointer-events: none; }
.ed-hist { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow: auto; display: flex; flex-direction: column; gap: 5px; }
.ed-hist li { display: flex; align-items: center; gap: 8px; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12.5px; }
.ed-hist li span { display: flex; flex-direction: column; }
.ed-hist li small { color: #7C8698; }
.ed-hist .btn.mini { width: auto; margin: 0; padding: 4px 10px; }
.editor .btn:disabled { opacity: .4; }
@media (max-width: 600px) { .ed-panel { width: auto; } }
.tool-list a.ed-link { color: var(--gold); }

/* اختيار المخطط في خانة البحث */
.plan-pick { display: flex; align-items: center; gap: 8px; padding: 8px 12px 4px; border-bottom: 1px solid #E6EAF1; margin: 0 4px; }
.plan-pick span { font: 700 13px var(--head); color: #2148C8; white-space: nowrap; }
.plan-pick select { flex: 1; min-width: 0; border: 0; background: none; font: 600 15px var(--font); color: var(--black); padding: 6px 2px; cursor: pointer; }
.plan-pick select:focus { outline: none; }
.plan-pick:focus-within { border-bottom-color: var(--gold); }

/* اختيار نوع الحساب عند التسجيل */
.type-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field .type-pick label { display: flex; align-items: center; gap: 8px; margin: 0; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 10px; cursor: pointer; min-width: 0; }
.field .type-pick label:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
/* الحقول العامة تأخذ عرض السطر كاملاً؛ زر الاختيار يجب ألا يأخذه */
.field .type-pick input { width: 18px; height: 18px; flex: none; margin: 0; padding: 0; accent-color: var(--gold); }
.type-pick b { font: 700 14px var(--head); line-height: 1.4; }

/* لوحة المكتب العقاري */
.off-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.off-head .btn { width: auto; margin: 0 auto 0 0; padding: 8px 14px; }
.quota { background: #EEF1F6; border-radius: 12px; padding: 8px 14px; display: flex; flex-direction: column; }
.quota b { font: 800 20px var(--head); }
.quota small { font-size: 12px; color: #5F6B7D; }
.lst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.lst-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; background: #fff; border-top: 4px solid #13A05A; }
.lst-card.sold { border-top-color: #D8433F; background: #FFF8F7; }
.lst-top { display: flex; justify-content: space-between; align-items: center; }
.lst-top b { font: 800 17px var(--head); }
.pill.avail { background: #E3F5EC; color: #0B6B3B; } .pill.sold { background: #FBE8E7; color: #8E2421; }
.lst-plan { margin: 0; font-size: 13px; color: #5F6B7D; }
.lst-price { margin: 2px 0; font: 800 15px var(--head); color: var(--black); }
.tag { display: inline-block; width: fit-content; background: var(--gold-soft); color: #2148C8; border: 1px solid #C9D5F5; border-radius: 20px; padding: 1px 9px; font: 700 11.5px var(--font); }
.lst-acts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.lst-acts .btn.mini { width: auto; margin: 0; padding: 5px 9px; font-size: 12px; text-decoration: none; }
.off-form { max-width: 620px; display: flex; flex-direction: column; }
.off-form h3 { font: 800 17px var(--head); margin: 0 0 10px; }
.off-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.off-form select, .off-form textarea { width: 100%; font: 15px var(--font); padding: 10px 12px; border: 1px solid #CFD6E2; border-radius: 10px; background: #fff; }
.chk-row { display: flex; flex-wrap: wrap; gap: 14px; padding: 4px 0; }
.chk.guar { margin: 4px 0 12px; font-weight: 700; }
.plot-check { margin: -6px 0 10px; } .plot-check.ok { color: #0B6B3B; } .plot-check.bad { color: #8E2421; }
.logo-box { display: flex; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 16px; }
.logo-prev { width: 84px; height: 84px; object-fit: contain; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.logo-box .btn { width: auto; margin: 0; padding: 7px 14px; }
.row-inline { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
@media (max-width: 500px) { .off-form .two { grid-template-columns: 1fr; } }

/* صفحة المكتب العامة */
.office-head { display: flex; gap: 14px; align-items: center; }
.office-head h1 { margin: 0; }
.office-head .sub { margin: 2px 0 0; }
.office-logo { width: 86px; height: 86px; object-fit: contain; border-radius: 16px; border: 1px solid var(--line); background: #fff; flex: none; }
.office-logo.ph { display: flex; align-items: center; justify-content: center; font: 800 36px var(--head); color: var(--gold); background: var(--black); }
.office-about { margin: 14px 0 6px; line-height: 1.8; color: var(--ink); white-space: pre-line; }
.office-page .o-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.office-page .o-acts .btn { width: auto; margin: 0; padding: 9px 18px; text-decoration: none; }
.office-h { font: 800 17px var(--head); margin: 22px 0 10px; }
a.lst-card { text-decoration: none; color: inherit; }
a.lst-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }

/* عرض المكتب داخل بطاقة القطعة */
.plot-card .listing { margin-top: 8px; font-size: 13px; color: var(--ink); }
.listing .l-price { margin: 0 2px 6px; font: 800 18px var(--head); color: var(--black); }
.listing .l-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.listing .tag.g { background: #E3F5EC; color: #0B6B3B; border-color: #A8DCC0; }
.listing .l-note { margin: 3px 2px; line-height: 1.6; font-size: 12.5px; white-space: pre-line; }
.plot-card .owner.office { background: #F2F5FD; border-color: #C9D5F5; }
.owner.office .o-lbl { color: #2148C8; }
.owner .o-logo { float: left; width: 46px; height: 46px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; margin: 0 0 4px 8px; }
.owner .o-profile { background: var(--black); color: var(--gold); }
.plot-sheet { max-height: calc(100vh - 170px); overflow: auto; }
small.linked.off { background: #E8EEFC; color: #13233A; }
.office-page .o-call { background: #0B6B3B; color: #fff; }
.office-page .o-wa { background: #25d366; color: #13233A; }
.office-page .o-office { background: #fff; color: #0B6B3B; border: 1px solid #A8DCC0; }
.map-lost { position: absolute; inset: 0; z-index: 20; background: rgba(249,249,249,.94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
.map-lost p { font: 700 15px var(--head); margin: 0; }
.map-lost .btn { width: auto; padding: 10px 22px; }
.pill.office { background: #E8EEFC; color: #13233A; } .pill.farm { background: #E3F5EC; color: #0B6B3B; }
/* عدد القطع المعروضة للبيع فوق اسم المخطط */
.plan-label .sale-count { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); background: #0B6B3B; color: #fff; border: 1.5px solid #fff; border-radius: 10px; padding: 0 7px; font: 700 10.5px var(--font); white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.plan-label .sale-count[hidden] { display: none; }

/* ——— صفحات العرض العامة (المكتب وتفاصيل العرض) ——— */
.pub-page { background: #F4F6F9; }
.pub-page main.pub-wrap { flex: 1; overflow: auto; padding: 18px 16px 40px; }
.pub-wrap > * { max-width: 1100px; margin-inline: auto; }
.pub-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pub-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pub-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; }
.pub-card { background: #fff; border-radius: 18px; padding: 18px; box-shadow: 0 2px 14px rgba(12,12,12,.06); border: 1px solid #E3E8F0; }
.pub-card.center { text-align: center; max-width: 480px; }
.pub-card h1 { margin: 6px 0 2px; font: 800 26px var(--head); }
.pub-card h2 { margin: 0 0 12px; font: 800 17px var(--head); }
.pub-text { margin: 0; line-height: 1.9; white-space: pre-line; color: var(--ink); }
.pub-map { height: 320px; border-radius: 14px; overflow: hidden; margin: 14px 0; border: 1px solid var(--line); }
.pub-map.small { height: 240px; margin: 0; }
.pub-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-acts .btn, .pub-side .btn { margin: 0; width: auto; text-decoration: none; text-align: center; }
.pub-acts .btn { flex: 1 1 160px; }
.lst-hero { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.price-box { background: var(--black); color: #fff; border-radius: 14px; padding: 10px 18px; text-align: center; }
.price-box small { display: block; color: #C3CBE0; font-size: 12px; }
.price-box b { font: 800 22px var(--head); color: var(--gold); white-space: nowrap; }
.l-tags.big { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.l-tags.big .tag { font-size: 13px; padding: 3px 12px; }
.tag.g { background: #E3F5EC; color: #0B6B3B; border-color: #A8DCC0; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 0; }
dl.facts dt, dl.facts dd { padding: 10px 0; border-bottom: 1px solid #EEF1F6; margin: 0; }
dl.facts dt { color: #5F6B7D; font-size: 14px; padding-inline-end: 20px; }
dl.facts dd { font-weight: 700; }
dl.facts dd[dir=ltr] { text-align: right; }
.office-card { display: flex; flex-direction: column; gap: 10px; }
.office-card .o-lbl { margin: 0; font: 700 12px var(--font); color: #2148C8; }
.office-card .o-lbl:empty { display: none; }
.office-id { display: flex; gap: 12px; align-items: center; }
.office-id h3 { margin: 0; font: 800 18px var(--head); }
.office-id .sub { margin: 2px 0 0; font-size: 13px; }
.office-logo { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; border: 1px solid var(--line); background: #fff; flex: none; }
.office-logo.ph { display: flex; align-items: center; justify-content: center; font: 800 28px var(--head); color: var(--gold); background: var(--black); }
.office-logo.xl { width: 110px; height: 110px; border-radius: 22px; border: 3px solid #fff; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.office-logo.xl.ph { font-size: 46px; }
.contact-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.contact-btns .btn { margin: 0; font-size: 15px; padding: 12px 6px; text-decoration: none; text-align: center; }
.contact-btns .btn:only-child { grid-column: 1 / -1; }
.c-call { background: #0B6B3B; color: #fff; }
.c-wa { background: #25d366; color: #13233A; }
.btn.dark { background: var(--black); color: var(--gold); }
.office-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; background: linear-gradient(135deg, #13233A 0%, #1B3260 100%); color: #fff; border-radius: 22px; padding: 24px; margin-bottom: 16px; border-bottom: 4px solid var(--gold); }
.oh-text { flex: 1 1 240px; min-width: 0; }
.oh-text h1 { margin: 6px 0 4px; font: 800 28px var(--head); color: #fff; }
.oh-text p { margin: 0; color: #C3CBE0; }
.verified { display: inline-block; background: rgba(255,194,61,.18); color: var(--gold); border: 1px solid var(--gold); border-radius: 20px; padding: 2px 10px; font: 700 12px var(--font); }
.oh-stats { display: flex; gap: 10px; }
.o-stat { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 14px; padding: 10px 14px; text-align: center; min-width: 84px; }
.o-stat b { display: block; font: 800 22px var(--head); color: var(--gold); }
.o-stat small { color: #C3CBE0; font-size: 12px; }
.lst-more { margin-top: auto; padding-top: 6px; font: 700 12.5px var(--font); color: var(--blue); }
.plot-card .listing .l-more { display: block; margin: 8px 0 2px; text-align: center; text-decoration: none; }
@media (max-width: 860px) {
  .pub-grid { grid-template-columns: 1fr; }
  .pub-side { position: static; order: -1; }
  .office-hero { padding: 18px; }
  .oh-stats { width: 100%; }
  .o-stat { flex: 1; min-width: 0; }
  .pub-card h1 { font-size: 22px; }
}

/* ——— هوية قطعتك ——— */
.btn, .search button { font-family: var(--font); font-weight: 600; }
h1, h2, h3, .brand, .plan-label, .price-box b, .lst-price, .kpi b { font-family: var(--head); }
@media (max-width: 600px) { header .logo { height: 28px; } }
/* التباين على الخلفيات الداكنة (هوية قطعتك) */
.verified { background: rgba(255,255,255,.12); color: #FFFFFF; border-color: rgba(255,255,255,.35); }
.o-stat b, .price-box b { color: #FFFFFF; }
.price-box small, .o-stat small { color: #C3CBE0; }
.owner .o-profile, .btn.dark { background: var(--black); color: #FFFFFF; }
.chip.on { background: var(--black); color: #FFFFFF; border-color: var(--black); }

/* ═══════════ مكونات قطعتك (دليل الهوية: الأقسام 05 و07) ═══════════ */
:root {
  --q-brand: #2148C8; --q-brand-soft: #E8EEFC; --q-parcel: #FFC23D; --q-ink: #13233A;
  --q-sale: #13A05A; --q-sale-soft: #E3F5EC; --q-sold: #D8433F; --q-sold-soft: #FBE8E7;
  --q-paper: #F4F6F9; --q-surface: #FFFFFF; --q-line: #DFE4EC; --q-muted: #5F6B7D;
  --q-radius-sm: 8px; --q-radius-md: 12px; --q-radius-lg: 18px;
  --q-shadow: 0 1px 2px rgba(19,35,58,.06), 0 8px 24px rgba(19,35,58,.10);
}
body { color: var(--q-ink); }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* البطاقات واللوحات: زاوية 18، حد رفيع، الظل الموحد */
.card, .pub-card, .auth-card, .spanel, .farm-card, .modal-card, .plot-card, .lst-card, .kpi, .notice { border-radius: var(--q-radius-lg); border: 1px solid var(--q-line); box-shadow: var(--q-shadow); background: var(--q-surface); }
.kpi, .lst-card, .spanel, .farm-card { box-shadow: 0 1px 2px rgba(19,35,58,.06); }
.auth-card { border-top: 1px solid var(--q-line); }
.lst-card { border-top: 3px solid var(--q-sale); } .lst-card.sold { border-top-color: var(--q-sold); }

/* الأزرار: أساسي أزرق، ثانوي أبيض بحد، رابط نصي — زاوية 12 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--q-radius-md); font: 600 15px/20px var(--font); padding: 12px 16px; background: var(--q-brand); color: #fff; border: 1px solid transparent; box-shadow: none; }
.btn:hover { background: #1A3AA3; }
.btn.ghost, .btn.sec, .btn.go { background: var(--q-surface); color: var(--q-ink); border: 1px solid var(--q-line); }
.btn.ghost:hover, .btn.sec:hover, .btn.go:hover { background: var(--q-paper); }
.btn.dark { background: var(--q-ink); color: #fff; }
.btn.danger, .btn.mark.sold { background: var(--q-sold); color: #fff; }
.btn.mark.avail { background: var(--q-sale); color: #fff; }
.btn .ic { width: 18px; height: 18px; }
.btn.mini { border-radius: var(--q-radius-sm); padding: 6px 10px; font-size: 13px; }

/* الحقول: زاوية 12 وحلقة تركيز زرقاء */
.field input, .field select, .field textarea, .off-form select, .off-form textarea, .profile-form textarea, .editor input[type=number], .ed-note, .find { border: 1px solid var(--q-line); border-radius: var(--q-radius-md); }
.field input:focus, .field select:focus, .field textarea:focus, .find:focus { outline: none; border-color: var(--q-brand); box-shadow: 0 0 0 3px var(--q-brand-soft); }

/* الشارات (حالة) بنقطة، والوسوم رمادية */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 12px; font: 600 13px/18px var(--font); background: var(--q-paper); color: var(--q-muted); }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.avail, .pill.active { background: var(--q-sale-soft); color: var(--q-sale); }
.pill.sold, .pill.rejected, .pill.suspended { background: var(--q-sold-soft); color: var(--q-sold); }
.pill.mine { background: var(--q-parcel); color: var(--q-ink); }
.tag, .listing .tag, .l-tags .tag { display: inline-flex; align-items: center; background: var(--q-paper); color: #3A4659; border: 1px solid var(--q-line); border-radius: var(--q-radius-sm); padding: 4px 12px; font: 400 13px/18px var(--font); }
.tag.g { background: var(--q-paper); color: #3A4659; border-color: var(--q-line); }

/* شريط البحث: حقل بحد وأيقونة، وزر أساسي */
.ui > .card:first-child { padding: 10px; }
.search { gap: 8px; padding: 0; }
.search .s-ic { color: var(--q-muted); display: flex; margin-inline-start: 12px; position: absolute; pointer-events: none; }
.search { position: relative; }
.search input#q { border: 1px solid var(--q-line); border-radius: var(--q-radius-md); padding: 11px 42px 11px 12px; background: var(--q-surface); font: 400 16px var(--font); }
.search input#q:focus { border-color: var(--q-brand); box-shadow: 0 0 0 3px var(--q-brand-soft); }
.search:focus-within { box-shadow: none; }
.search button { border-radius: var(--q-radius-md); padding: 11px 20px; font: 600 15px var(--font); background: var(--q-brand); }
.plan-pick { border-bottom: 0; padding: 2px 4px 10px; }

/* ——— بطاقة القطعة ——— */
.plot-sheet.card { padding: 0; overflow: auto; }
.plot-card { box-shadow: none; border: 0; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.pc-head { display: flex; align-items: flex-start; gap: 12px; }
.pc-titles { flex: 1; min-width: 0; }
.pc-sub { margin: 0 0 2px; font: 400 13px/20px var(--font); color: var(--q-muted); }
.pc-title { margin: 0; font: 700 26px/32px var(--head); color: var(--q-ink); }
.pc-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: var(--q-radius-sm); background: var(--q-paper); color: var(--q-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.pc-x:hover { background: var(--q-line); color: var(--q-ink); }
.pc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pc-row[hidden] { display: none; }
.pc-price { display: flex; align-items: baseline; gap: 6px; }
.pc-price b { font: 700 26px/32px var(--head); color: var(--q-ink); }
.pc-price b.pc-ask { font-size: 18px; }
.pc-price small { font: 400 15px var(--font); color: var(--q-muted); }
.pc-loading { font-size: 13px; color: var(--q-muted); }
.pc-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-tags[hidden] { display: none; }
.pc-acts { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 8px; }
.pc-acts .btn { margin: 0; padding: 11px 8px; font-size: 14px; text-decoration: none; white-space: nowrap; }
.plot-card .rt { margin: 0; font-size: 13px; line-height: 1.7; color: var(--q-muted); }
.plot-card .rt:empty { display: none; }
.pc-extra { display: flex; flex-direction: column; gap: 12px; }
.pc-extra:empty { display: none; }
.seller { display: flex; align-items: center; gap: 12px; background: var(--q-paper); border-radius: var(--q-radius-md); padding: 12px; }
.sl-av { width: 44px; height: 44px; border-radius: var(--q-radius-md); background: var(--q-brand-soft); color: var(--q-brand); display: flex; align-items: center; justify-content: center; font: 700 20px var(--head); object-fit: contain; flex: none; }
img.sl-av { background: #fff; border: 1px solid var(--q-line); }
.sl-who { flex: 1; min-width: 0; display: flex; flex-direction: column; text-decoration: none; color: var(--q-ink); }
.sl-who b { font: 700 15px/22px var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-who small { font-size: 12.5px; color: var(--q-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.sl-who:hover b { color: var(--q-brand); }
.sl-btns { display: flex; gap: 8px; flex: none; }
.ibtn { width: 44px; height: 44px; border-radius: var(--q-radius-md); background: var(--q-surface); border: 1px solid var(--q-line); color: var(--q-ink); display: flex; align-items: center; justify-content: center; }
.ibtn:hover { border-color: var(--q-brand); }
.ibtn.wa { color: var(--q-sale); }
.pc-link { display: inline-flex; align-items: center; gap: 8px; font: 600 15px var(--font); color: var(--q-brand); text-decoration: none; align-self: flex-start; }
.pc-note { margin: 0; font-size: 12px; color: var(--q-muted); }
.plot-card.k-farm .top, .plot-card.k-res .top { background: none; }

/* شارة عدد المعروض للبيع والعلامة على الخريطة بلون «متاحة» */
.plan-label .sale-count { background: var(--q-sale); }

/* بطاقة المكتب في صفحات العرض: أزرار ثانوية بأيقونات */
.contact-btns .btn { background: var(--q-surface); color: var(--q-ink); border: 1px solid var(--q-line); }
.contact-btns .btn.c-wa .ic { color: var(--q-sale); }
.office-logo { border-radius: var(--q-radius-md); }
.price-box { border-radius: var(--q-radius-md); }
.pub-acts .btn { padding: 12px 16px; }
@media (max-width: 600px) {
  .plot-card { padding: 14px; gap: 10px; }
  .pc-title, .pc-price b { font-size: 22px; line-height: 28px; }
}
.ui { width: 372px; }
.plot-card .btn.route { background: var(--q-brand); color: #fff; border-color: transparent; }
.plot-card .btn.route:hover { background: #1A3AA3; }
.plot-card h3.pc-title { font: 700 26px/32px var(--head); margin: 0; }
.plot-card .pc-sub { font-size: 13px; color: var(--q-muted); white-space: normal; }
@media (max-width: 600px) { .plot-card h3.pc-title { font-size: 22px; line-height: 28px; } }

/* ═══════════ ترتيب الواجهة (حسب التصميم): شريط علوي، بحث مزدوج، مفتاح الخريطة، أدوات وأسطورة أسفل اليسار ═══════════ */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
header.topbar { gap: 20px; padding: 10px 20px; padding-top: calc(10px + env(safe-area-inset-top)); min-height: 64px; }
.tb-logo { display: flex; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 9px 16px; border-radius: var(--q-radius-md); font: 600 15px var(--font); color: var(--q-muted); text-decoration: none; white-space: nowrap; }
.topnav a:hover { color: var(--q-ink); background: var(--q-paper); }
.topnav a.on { background: var(--q-brand-soft); color: var(--q-brand); }
.tb-login { width: auto; margin: 0; padding: 9px 16px; font-size: 14px; text-decoration: none; white-space: nowrap; }

/* البحث: حقلان متجاوران (المخطط، رقم القطعة) */
.search-card { padding: 12px !important; }
.qbar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fld { position: relative; display: flex; align-items: center; height: 48px; border: 1px solid var(--q-line); border-radius: var(--q-radius-md); background: var(--q-surface); padding: 0; margin: 0; }
.fld:focus-within { border-color: var(--q-brand); box-shadow: 0 0 0 3px var(--q-brand-soft); }
.fld .f-ic { display: flex; color: var(--q-muted); padding-inline-start: 12px; pointer-events: none; }
.fld select, .fld input { flex: 1; min-width: 0; height: 100%; border: 0 !important; background: none; box-shadow: none !important; outline: none; padding: 0 10px 0 8px !important; font: 500 15px var(--font); color: var(--q-ink); }
.fld select { appearance: none; -webkit-appearance: none; cursor: pointer; text-overflow: ellipsis; }
.fld input::-webkit-search-cancel-button { -webkit-appearance: none; }
.q-fld input#q { font: 600 16px var(--head); }
.search.q-fld, form.q-fld { gap: 0; }
.ui .search-card + .plot-sheet { margin-top: 0; }

/* مفتاح نوع الخريطة (أعلى اليسار) */
.basemap-seg { position: absolute; top: 14px; left: 14px; z-index: 3; display: flex; gap: 4px; padding: 5px; border-radius: var(--q-radius-md); }
.basemap-seg button { border: 0; background: none; padding: 8px 14px; border-radius: var(--q-radius-sm); font: 600 14px var(--font); color: var(--q-muted); cursor: pointer; }
.basemap-seg button.on { background: var(--q-brand-soft); color: var(--q-brand); }

/* أدوات الخريطة (أسفل اليسار): موقعي، تكبير، تصغير — في عمود واحد */
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-group { border-radius: 0 !important; box-shadow: none !important; margin: 0 0 0 14px !important; border: 1px solid var(--q-line); border-top: 0; background: var(--q-surface); }
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-group:first-child { border-top: 1px solid var(--q-line); border-radius: var(--q-radius-md) var(--q-radius-md) 0 0 !important; }
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-group:last-of-type { border-radius: 0 0 var(--q-radius-md) var(--q-radius-md) !important; margin-bottom: 14px !important; box-shadow: var(--q-shadow) !important; }
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-group button { width: 44px; height: 44px; }
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib { margin-left: 14px; }

/* الأسطورة بجانب الأدوات */
.map-legend { position: absolute; left: 72px; bottom: 14px; z-index: 2; padding: 10px 16px; gap: 16px; border-radius: var(--q-radius-md); }
.legend i.avail { background: var(--q-sale); opacity: 1; } .legend i.sold { background: var(--q-sold); opacity: 1; }
.legend i.mine { background: var(--q-parcel); }
.legend i { width: 14px; height: 14px; border-radius: 4px; }

@media (max-width: 760px) {
  header.topbar { gap: 8px; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); min-height: 56px; }
  .topnav a { padding: 7px 9px; font-size: 13.5px; }
  .tb-login { padding: 7px 10px; font-size: 13px; }
}
@media (max-width: 600px) {
  header.topbar .logo { height: 24px; }
  .topnav { gap: 0; }
  .topnav a { padding: 7px 7px; font-size: 13px; }
  .tb-login { padding: 6px 8px; font-size: 12px; }
  .qbar { gap: 8px; }
  .fld { height: 44px; }
  .basemap-seg { top: auto; bottom: calc(14px + env(safe-area-inset-bottom)); left: auto; right: 10px; padding: 4px; }
  .basemap-seg button { padding: 6px 10px; font-size: 12.5px; }
  .map-legend { left: 66px; bottom: calc(14px + env(safe-area-inset-bottom)); padding: 8px 10px; gap: 10px; font-size: 12px; }
  .sheet-open .map-legend, .sheet-open .basemap-seg { display: none; }
}
@media (max-width: 600px) {
  .basemap-seg { top: 82px; bottom: auto; left: 10px; right: auto; }
  .map-legend { bottom: calc(40px + env(safe-area-inset-bottom)); }
}
.fld { min-width: 0; }
.tl-short { display: none; }
@media (max-width: 600px) { .tl-long { display: none; } .tl-short { display: inline; } header.topbar { gap: 6px; } }
/* صفحتا «عروض للبيع» و«المكاتب» */
.pub-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.pub-head h1 { margin: 0 0 4px; font: 700 28px var(--head); }
.pub-head .sub { margin: 0; }
.pub-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.pub-filters .fld { min-width: 200px; }
.lst-office { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--q-line); }
.lst-office img, .lst-office span { width: 28px; height: 28px; border-radius: 8px; object-fit: contain; background: var(--q-brand-soft); color: var(--q-brand); display: flex; align-items: center; justify-content: center; font: 700 13px var(--head); }
.lst-office small { color: var(--q-muted); font-size: 12.5px; }
.off-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.off-item { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.off-item:hover { border-color: var(--q-brand); }
.oi-text h3 { margin: 0; font: 700 17px var(--head); }
.oi-text .sub { margin: 2px 0 6px; font-size: 13px; }
.oi-stats { display: flex; gap: 6px; }
@media (max-width: 600px) { .pub-head h1 { font-size: 22px; } .pub-filters, .pub-filters .fld { width: 100%; min-width: 0; } }
/* زر البحث داخل حقل رقم القطعة */
.q-fld { padding-inline-end: 4px; }
.q-go { flex: none; height: 38px; padding: 0 14px; border: 0; border-radius: var(--q-radius-sm); background: var(--q-brand); color: #fff; font: 600 14px var(--font); cursor: pointer; }
.q-go:hover { background: #1A3AA3; }
@media (max-width: 600px) { .q-go { height: 34px; padding: 0 10px; font-size: 13px; } .q-fld input#q { padding-inline: 4px !important; } }
