/* Itqan — واجهة RTL */
:root {
    --primary: #0e7c7b;
    --primary-dark: #0a5f5e;
    --primary-soft: #e3f4f3;
    --ink: #12303a;
    --muted: #5d7480;
    --line: #dbe6e9;
    --bg: #f4f9f9;
    --card: #ffffff;
    --red: #d6334a;
    --green: #1c8f4e;
    --amber: #c98a0a;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(18, 48, 58, .06), 0 6px 20px rgba(18, 48, 58, .06);
    --font: 'Tajawal', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.7; font-size: 16px; }
img { max-width: 100%; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
code { background: var(--primary-soft); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.nowrap { white-space: nowrap; }
.num { text-align: center; font-variant-numeric: tabular-nums; }
.text-red { color: var(--red) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section { padding: 28px 0; }
.section-title { font-size: 1.35rem; margin-bottom: 14px; }
.link-sm { font-size: .9rem; }
.stack > * + * { margin-top: 10px; }

/* ---------- أزرار ونماذج ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 10px; border: 1.5px solid transparent; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none !important; transition: .15s; line-height: 1.3; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--primary-dark); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #fff; border-color: var(--primary); }
.btn-light { background: rgba(255, 255, 255, .95); color: var(--primary-dark); }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-whatsapp { background: #25d366; color: #073b1c; }
.btn-sm { padding: 6px 12px; font-size: .88rem; border-radius: 8px; }
.btn-block { width: 100%; }
button:disabled { opacity: .6; cursor: wait; }

.field { margin-bottom: 14px; }
.field label, label.lbl { display: block; font-weight: 700; margin-bottom: 4px; font-size: .92rem; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=file], input:not([type]), select, textarea {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 124, 123, .15); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.alert { padding: 12px 16px; border-radius: 10px; margin: 14px 0; font-weight: 500; }
.alert-success { background: #e6f6ec; color: #145c34; border: 1px solid #b8e4c8; }
.alert-error { background: #fdebee; color: #8c1d2d; border: 1px solid #f4c1c9; }
.alert-info { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- ترويسة الموقع ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--primary); color: #fff; font-weight: 800; font-size: 1.2rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.25rem; font-weight: 800; }
.brand-text small { color: var(--muted); font-size: .72rem; letter-spacing: .08em; }
.main-nav { display: flex; gap: 4px; align-items: center; }
.main-nav a { padding: 8px 14px; border-radius: 9px; color: var(--ink); font-weight: 700; }
.main-nav a:hover { background: var(--primary-soft); text-decoration: none; }
.main-nav a.active { background: var(--primary-soft); color: var(--primary-dark); }
.main-nav .nav-ai { background: linear-gradient(135deg, #0e7c7b, #2563eb); color: #fff !important; }
.nav-toggle { display: none; background: none; border: 1.5px solid var(--line); border-radius: 9px; font-size: 1.3rem; padding: 4px 11px; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(160deg, #0a5f5e 0%, #0e7c7b 55%, #1a9a8f 100%); color: #fff; padding: 56px 0 48px; text-align: center; }
.hero h1 span { color: #ffe08a; }
.hero .lead { max-width: 640px; margin: 8px auto 26px; opacity: .95; font-size: 1.1rem; }
.hero-search { display: flex; gap: 8px; max-width: 640px; margin: 0 auto 14px; background: #fff; padding: 6px; border-radius: 14px; box-shadow: var(--shadow); }
.hero-search input { border: 0; box-shadow: none !important; font-size: 1.05rem; }
.near-me-btn { margin-top: 4px; }

.entry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.entry-card { position: relative; background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none !important; border: 1.5px solid transparent; transition: .15s; }
.entry-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.entry-card p { color: var(--muted); margin: 0; }
.entry-icon { font-size: 2rem; display: block; margin-bottom: 6px; }
.entry-ai { background: linear-gradient(135deg, #f0fbfa, #eef3ff); }
.tag { position: absolute; top: 14px; left: 14px; background: #2563eb; color: #fff; font-size: .75rem; padding: 2px 10px; border-radius: 99px; font-weight: 700; }

.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.type-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 8px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none !important; border-bottom: 4px solid var(--c, var(--primary)); transition: .15s; }
.type-tile:hover { transform: translateY(-2px); }
.type-icon { font-size: 2rem; }
.type-tile small { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 6px 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 99px; color: var(--ink); font-weight: 500; text-decoration: none !important; }
.chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.chip-green { background: #eaf7ef; border-color: #bfe5cd; }

.stats-band { background: var(--ink); color: #fff; padding: 26px 0; margin-top: 20px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; gap: 12px; }
.stats strong { display: block; font-size: 1.9rem; color: #ffe08a; }
.stats span { opacity: .85; }

/* ---------- صفحات داخلية ---------- */
.page-head { background: #fff; border-bottom: 1px solid var(--line); padding: 22px 0 10px; margin-bottom: 18px; }
.page-head h1 { margin-bottom: 4px; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 8px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.block { padding: 18px 20px; margin-bottom: 16px; }

.search-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; padding-bottom: 32px; }
.filters { padding: 18px; position: sticky; top: 80px; }
.filter-actions { display: flex; gap: 8px; }
.filter-actions .btn-primary { flex: 1; }
.geo-on { margin-top: 10px; display: grid; gap: 6px; }
.results-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sort-form select { width: auto; padding: 6px 10px; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.provider-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; border: 1.5px solid transparent; }
.provider-card:hover { border-color: var(--primary); }
.pc-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.pc-title { margin: 2px 0; font-size: 1.1rem; }
.pc-title a { color: var(--ink); }
.pc-specs { color: var(--primary-dark); font-weight: 500; margin: 0; font-size: .92rem; }
.pc-loc, .pc-addr { margin: 0; color: var(--muted); font-size: .92rem; }
.dist { display: inline-block; margin-inline-start: 8px; background: var(--primary-soft); color: var(--primary-dark); padding: 0 8px; border-radius: 99px; font-weight: 700; font-size: .8rem; }
.pc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
.type-chip { display: inline-block; padding: 2px 12px; border-radius: 99px; background: color-mix(in srgb, var(--c, var(--primary)) 14%, white); color: color-mix(in srgb, var(--c, var(--primary)) 80%, black); font-weight: 700; font-size: .85rem; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #eee; color: #444; }
.badge-red { background: #fdebee; color: #a3182c; }
.badge-green { background: #e6f6ec; color: #17653a; }
.badge-teal { background: var(--primary-soft); color: var(--primary-dark); }
.badge-amber { background: #fff3d6; color: #8a5a00; }
.badge-gray { background: #eef1f3; color: #8a99a1; }
.empty { text-align: center; padding: 40px 20px; }
.empty-icon { font-size: 2.6rem; }

.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 22px 0; }
.pager .page { padding: 6px 14px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); text-decoration: none !important; font-weight: 500; }
.pager .page:hover { border-color: var(--primary); }
.pager .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager .dots { padding: 6px 4px; color: var(--muted); }

.detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; padding-bottom: 32px; }
.block h2 { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px; }
.info-list { list-style: none; margin: 0 0 14px; padding: 0; }
.info-list li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.info-list li > span { flex: none; }
.contact-card { position: sticky; top: 80px; }
.mini-map { height: 300px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); z-index: 0; }

.assistant-soon { background: #fff; padding: 40px 24px; border-radius: 20px; box-shadow: var(--shadow); }
.assistant-orb { width: 84px; height: 84px; margin: 0 auto 14px; display: grid; place-items: center; font-size: 2.4rem; border-radius: 50%; background: linear-gradient(135deg, #0e7c7b, #2563eb); box-shadow: 0 8px 30px rgba(37, 99, 235, .35); }
.check-list { text-align: right; list-style: none; padding: 0; margin: 18px auto; max-width: 520px; }
.check-list li { padding: 6px 28px 6px 0; position: relative; }
.check-list li::before { content: '✔'; position: absolute; right: 0; color: var(--primary); font-weight: 800; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--primary); line-height: 1; }

.site-footer { background: #0c2a33; color: #c8dce2; padding: 26px 0; margin-top: 30px; font-size: .92rem; }
.site-footer a { color: #ffe08a; font-weight: 800; }
.emergency-bar { background: rgba(214, 51, 74, .18); border: 1px solid rgba(214, 51, 74, .5); padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.disclaimer { opacity: .85; }
.copy { opacity: .6; margin: 0; }

/* ---------- البحث الموجّه ---------- */
.guide-wrap { padding: 22px 0 10px; }
.guide { padding: 0 0 18px; overflow: hidden; }
.guide-loading { padding: 40px 0; }
.g-progress { height: 6px; background: #e4eef0; }
.g-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #0e7c7b, #2fb5a8); transition: width .3s; }
.g-emergency { margin: 14px 18px 0; padding: 10px 14px; border-radius: 12px; background: #fff4e5; border: 1px solid #f3d29b; color: #6b4600; font-size: .92rem; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.g-emergency.strong { background: #fdebee; border-color: #f4a8b3; color: #8c1d2d; font-weight: 700; font-size: 1rem; }
.g-911 { background: var(--red); color: #fff !important; padding: 4px 14px; border-radius: 99px; font-weight: 800; text-decoration: none !important; white-space: nowrap; }
.g-head { padding: 18px 20px 0; }
.g-title { font-size: 1.5rem; margin-bottom: 4px; }
.g-body { padding: 4px 20px 6px; }
.g-sub { font-size: 1rem; margin: 18px 0 8px; }
.g-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 20px 0; }
.g-count { margin: 14px 20px 0; padding: 8px 14px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; font-size: .92rem; min-height: 0; }
.g-count:empty { display: none; }
.g-count.zero { background: #fff4e5; color: #6b4600; }
.g-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.g-tiles.small { grid-template-columns: repeat(3, 1fr); }
.g-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 104px; padding: 14px 8px; background: #fff; border: 2px solid var(--line); border-radius: 14px; font: inherit; color: var(--ink); cursor: pointer; transition: .15s; text-align: center; }
.g-tile:hover { border-color: var(--primary); background: var(--primary-soft); }
.g-tile.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px rgba(14, 124, 123, .18); }
.g-tile.danger { border-color: #f4a8b3; background: #fff6f7; }
.g-tile.danger:hover { background: #fdebee; border-color: var(--red); }
.g-ico { font-size: 2rem; line-height: 1; }
.g-lbl { font-weight: 700; line-height: 1.35; }
.g-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.g-chip { padding: 8px 16px; border-radius: 99px; border: 2px solid var(--line); background: #fff; font: inherit; font-weight: 500; color: var(--ink); cursor: pointer; }
.g-chip:hover { border-color: var(--primary); }
.g-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.g-search { margin: 8px 0; }
.g-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 52vh; overflow: auto; padding: 2px; }
.g-opt { display: flex; align-items: center; gap: 8px; padding: 11px 14px; background: #fff; border: 2px solid var(--line); border-radius: 12px; font: inherit; color: var(--ink); cursor: pointer; text-align: right; }
.g-opt:hover { border-color: var(--primary); background: var(--primary-soft); }
.g-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.g-opt-name { flex: 1; font-weight: 500; }
.g-opt-n { min-width: 28px; text-align: center; background: #eef4f5; color: var(--muted); border-radius: 99px; font-size: .8rem; font-weight: 700; padding: 1px 8px; }
.g-sugg { background: #fff3d6; color: #8a5a00; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; }
.g-panel { padding: 4px 0 8px; border-bottom: 1px dashed var(--line); }
.g-panel:last-child { border-bottom: 0; }
.g-panel .ok { color: var(--green); font-weight: 700; margin: 4px 0; }
.g-summary { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 12px 0 16px; }
.g-sum-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.g-sum-row:last-child { border-bottom: 0; }
.g-sum-k { color: var(--muted); min-width: 90px; }
.g-sum-v { flex: 1; }
.g-edit { background: none; border: 0; color: var(--primary-dark); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.btn-lg { padding: 14px 22px; font-size: 1.1rem; }
.guide-foot { margin-top: 12px; }
.active-kind { display: inline-flex; align-items: center; gap: 8px; background: var(--primary-soft); color: var(--primary-dark); padding: 4px 12px; border-radius: 99px; font-weight: 700; font-size: .9rem; }

@media (max-width: 560px) {
    .g-tiles { grid-template-columns: 1fr 1fr; }
    .g-tiles.small { grid-template-columns: repeat(3, 1fr); }
    .g-list { grid-template-columns: 1fr; }
    .g-title { font-size: 1.3rem; }
}

/* ---------- عدم الاتصال ---------- */
.offline-bar[hidden] { display: none !important; }
.offline-bar { position: sticky; top: 0; z-index: 60; background: #fff4e5; color: #6b4600; border-bottom: 1px solid #f3d29b; text-align: center; padding: 6px 12px; font-weight: 700; font-size: .92rem; }
.offline-bar a { color: #fff; background: var(--red); padding: 0 10px; border-radius: 99px; text-decoration: none; }
.offline-card { padding: 32px 22px; }
.offline-icon { font-size: 3rem; line-height: 1; margin-bottom: 8px; }
.offline-911 { margin: 22px 0; padding: 16px; border-radius: 14px; background: #fdebee; border: 1.5px solid #f4a8b3; display: grid; gap: 10px; color: #6d1220; }
.offline-call { background: var(--red); color: #fff !important; font-size: 1.3rem; padding: 14px; }

/* ---------- المساعد الذكي ---------- */
.chat-wrap { padding: 18px 0 8px; }
.chat { display: flex; flex-direction: column; min-height: 70vh; overflow: hidden; }
.chat-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-title { display: flex; align-items: center; gap: 12px; }
.chat-title small { display: block; line-height: 1.3; }
.chat-tools { display: flex; gap: 6px; }
.chat-tools .on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }
.assistant-orb.sm { width: 44px; height: 44px; font-size: 1.3rem; margin: 0; flex: none; box-shadow: none; }
.chat-911 { padding: 8px 18px; background: #fff4e5; color: #6b4600; font-size: .9rem; border-bottom: 1px solid #f3d29b; }
.chat-911 a { background: var(--red); color: #fff; padding: 1px 10px; border-radius: 99px; font-weight: 800; text-decoration: none; }
.chat-notice { margin: 12px 18px 0; }
.chat-log { flex: 1; padding: 16px 18px 8px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 62vh; }
.chat-starters { padding: 0 18px; }
.chat-intro { text-align: center; padding: 18px 0 6px; }
.chat-intro h2 { margin: 6px 0 4px; font-size: 1.3rem; }
.chat-starters .g-chips { justify-content: center; margin-bottom: 8px; }
.msg { display: flex; flex-direction: column; gap: 8px; max-width: 92%; }
.msg-user { align-self: flex-start; align-items: flex-start; }
.msg-assistant { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 10px 14px; border-radius: 16px; line-height: 1.75; max-width: 100%; word-wrap: break-word; }
.bubble p { margin: 0 0 .5em; } .bubble p:last-child { margin-bottom: 0; }
.chat-list { margin: 0 0 .5em; padding-inline-start: 20px; }
.msg-user .bubble { background: var(--primary); color: #fff; border-end-start-radius: 4px; }
.msg-assistant .bubble { background: #eef6f6; color: var(--ink); border-end-end-radius: 4px; }
.msg-emergency .bubble { background: #fdebee; border: 1.5px solid #f4a8b3; color: #6d1220; }
.msg-error .bubble { background: #fff4e5; border: 1px solid #f3d29b; color: #6b4600; }
.msg-typing .bubble { display: inline-flex; gap: 5px; padding: 14px 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); opacity: .35; animation: blink 1.2s infinite; }
.dot:nth-child(2) { animation-delay: .2s; } .dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; width: 100%; }
.ai-card-box { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ai-card { display: flex; flex-direction: column; gap: 3px; color: var(--ink); text-decoration: none !important; }
.ai-card-top { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-card-name { font-size: 1rem; }
.ai-card-sub { color: var(--primary-dark); font-size: .88rem; }
.ai-card-place { color: var(--muted); font-size: .88rem; }
.ai-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-links { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chat-form { display: flex; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--line); background: #fbfdfd; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; max-height: 140px; line-height: 1.6; }
.chat-foot { padding: 0 18px 12px; margin: 0; }
@media (max-width: 560px) { .msg { max-width: 100%; } .chat-log { max-height: 58vh; } .chat-title small { display: none; } }

/* ---------- الخريطة ---------- */
.map-page .site-footer { display: none; }
.map-page main { display: block; }
.map-shell { display: flex; flex-direction: column; height: calc(100vh - 65px); height: calc(100dvh - 65px); }
.map-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); align-items: center; }
.map-filters input[type=search] { width: 180px; padding: 7px 10px; }
.map-filters select { width: auto; max-width: 170px; padding: 7px 10px; }
.map-status { padding: 4px 14px; font-size: .85rem; color: var(--muted); background: #fff; min-height: 26px; }
.map-canvas { flex: 1; min-height: 300px; z-index: 0; }
.pin { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.pin span { transform: rotate(45deg); font-size: 16px; line-height: 1; }
.leaflet-popup-content { direction: rtl; text-align: right; font-family: var(--font); min-width: 190px; }
.popup-title { font-weight: 800; margin: 0 0 2px; font-size: 1rem; }
.popup-type { font-size: .82rem; color: var(--muted); margin-bottom: 4px; }
.popup-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.popup-actions a { padding: 4px 10px; border-radius: 8px; background: var(--primary); color: #fff !important; font-size: .82rem; font-weight: 700; text-decoration: none; }
.popup-actions a.alt { background: #fff; color: var(--primary-dark) !important; border: 1px solid var(--primary); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background-color: rgba(14, 124, 123, .25); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background-color: rgba(14, 124, 123, .85); color: #fff; font-weight: 800; }

/* ---------- الإدارة ---------- */
body.admin { background: #eef4f5; }
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-side { background: #0c2a33; color: #dbe9ed; padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand-light { color: #fff; }
.brand-light .brand-text small { color: #8fb0ba; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { color: #dbe9ed; padding: 9px 12px; border-radius: 9px; font-weight: 500; text-decoration: none !important; }
.side-nav a:hover { background: rgba(255, 255, 255, .08); }
.side-nav a.active { background: var(--primary); color: #fff; font-weight: 700; }
.side-user { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .9rem; }
.side-user .btn-ghost { color: #dbe9ed; border-color: rgba(255, 255, 255, .25); }
.admin-main { padding: 24px 28px 48px; min-width: 0; }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.admin-head h1 { font-size: 1.5rem; margin: 0; }
.admin-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi strong { display: block; font-size: 1.7rem; color: var(--primary-dark); line-height: 1.2; }
.kpi span { color: var(--muted); font-size: .88rem; }
.kpi a { text-decoration: none !important; color: inherit; display: block; }
.kpi-warn strong { color: var(--amber); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.align-start { align-items: start; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row input[type=search], .filter-row select { width: auto; min-width: 150px; padding: 7px 10px; }
.filter-row input[type=search] { flex: 1; min-width: 200px; }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.add-row input, .add-row select { width: auto; flex: 1; min-width: 150px; padding: 7px 10px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: middle; }
.table th { background: #f4f9f9; font-size: .85rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.table input { padding: 5px 8px; border-radius: 7px; }
.table tr.row-new { background: #fffaf0; }
.table .num { text-align: center; }
form.inline { display: inline; }
.form-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.form-grid .col-main, .form-grid .col-side { min-width: 0; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; position: sticky; bottom: 0; background: #eef4f5; padding: 12px 0; }
.check-list-box { max-height: 260px; overflow: auto; border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 12px; margin-top: 6px; }
.list-filter { padding: 6px 10px !important; }
.map-table td:nth-child(2) { min-width: 180px; }
.sample-cell { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 14px; background: #e4eef0; border-radius: 99px; overflow: hidden; margin-top: 14px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, #0e7c7b, #2fb5a8); transition: width .25s; }
.result-box { margin-top: 12px; padding: 14px; border-radius: 12px; background: #e6f6ec; border: 1px solid #b8e4c8; }
.result-box.err { background: #fdebee; border-color: #f4c1c9; }
.result-box ul { margin: 6px 0 10px; padding-inline-start: 20px; }

/* ---------- دخول / تثبيت ---------- */
body.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: linear-gradient(160deg, #0a5f5e, #0e7c7b 60%, #1a9a8f); }
.auth-card { width: 100%; max-width: 400px; padding: 28px; }
.auth-card.wide { max-width: 560px; }
.auth-brand { text-align: center; margin-bottom: 14px; }
.auth-brand .brand-mark { margin: 0 auto 6px; width: 52px; height: 52px; font-size: 1.6rem; }
.auth-brand h1 { margin: 0; }
.req-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 4px; font-size: .92rem; }
.req-list .ok { color: #17653a; }
.req-list .bad { color: var(--red); font-weight: 700; }

/* ---------- متجاوب ---------- */
@media (max-width: 980px) {
    .search-layout, .detail-layout, .form-grid, .grid-2 { grid-template-columns: 1fr; }
    .filters, .contact-card { position: static; }
    .entry-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .side-nav { flex-direction: row; flex-wrap: wrap; }
    .side-user { margin-top: 0; }
    .admin-main { padding: 16px; }
}
@media (max-width: 720px) {
    .nav-toggle { display: block; }
    .main-nav { display: none; position: absolute; top: 64px; inset-inline: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 10px 16px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
    .main-nav.open { display: flex; }
    .cards { grid-template-columns: 1fr; }
    .row2 { grid-template-columns: 1fr; }
    .hero { padding: 38px 0 32px; }
    .hero-search { flex-direction: column; }
    .map-filters input[type=search], .map-filters select { flex: 1 1 140px; max-width: none; }
}
@media print { .site-header, .site-footer, .pc-actions { display: none; } }

/* ---------- صفحات قانونية / حساب ---------- */
.legal h3 { margin-top: 1.2em; }
.legal ul { padding-inline-start: 22px; }
.legal li { margin-bottom: .4em; }
.side-me { color: #dbe9ed; text-decoration: none !important; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.side-me:hover { color: #fff; }
