:root{
  --bg:#ffffff;
  --panel:#ffffff;
  --panel-2:#f9fafb;
  --text:#111827;
  --muted:#6b7280;
  --brand:#2563eb;
  --border:#e5e7eb;
  --danger:#c6001a;
  --warning:#eb7d00;
  --success:#10b981;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:'Segoe UI', Tahoma, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

/* ===== Header (topbar) ===== */
.site-header{
  position:sticky; top:0; z-index:50;
  background:#fff; border-bottom:1px solid var(--border);
  padding:12px 24px; display:flex; align-items:center; justify-content:space-between; gap:16px;
  box-shadow:0 2px 10px rgba(0,0,0,.06);
}
.site-header::after{
  content:""; position:absolute; left:0; right:0; bottom:-12px; height:12px;
  background:radial-gradient(rgba(17,24,39,0.04) 1px, transparent 1px); background-size:8px 8px;
  box-shadow:0 6px 8px -6px rgba(0,0,0,.08);
}
.site-header .left{ display:flex; align-items:center; gap:12px }
.site-header .logo img{ height:100px; display:block }
.site-header .divider{ width:1px; height:28px; background:var(--border) }

.nav.primary a{
  color:#6b7280; text-decoration:none; margin:0 6px;
  font-size:15px; font-weight:700; padding:8px 10px; border-radius:8px; transition:.15s ease;
}
.nav.primary a:hover{ color:#374151 }
.nav.primary a.active{ color:#111827; background:#f3f4f6 }

.searchbar{ min-width: 320px; max-width: 520px; width: 40vw }
.searchbar input{
  width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:10px; outline:none;
  background:#fff; color:var(--text);
}
.searchbar input:focus{ box-shadow:0 0 0 3px rgba(37,99,235,.15); border-color:var(--brand) }

.right{ display:flex; align-items:center; gap:10px }
.icon-btn{
  border:1px solid var(--border); background:#fff; border-radius:10px; padding:8px 10px; cursor:pointer;
}
.icon-btn:hover{ background:#f9fafb }
.btn{
  display:inline-flex; align-items:center; gap:8px; border:none; border-radius:10px;
  background:var(--brand); color:#fff; padding:10px 14px; cursor:pointer; transition:.15s ease;
  font-weight:700;
}
.btn:hover{ filter:brightness(1.03) }
.btn.ghost{ background:#fff; color:#374151; border:1px solid var(--border) }
.lang-switch{ cursor:pointer; border:1px solid var(--border); padding:8px 10px; border-radius:8px; color:#374151; text-decoration:none; background:#fff }

.user{ position:relative }
.user .avatar{ width:34px; height:34px; border-radius:50%; border:1px solid var(--border); cursor:pointer }
.user:hover .menu{ display:block }
.user .menu{
  display:none; position:absolute; right:0; top:42px; background:#fff; border:1px solid var(--border);
  border-radius:10px; min-width:160px; padding:8px; box-shadow:0 10px 24px rgba(0,0,0,.1);
}
.user .menu a{ display:block; padding:8px 10px; color:#374151; text-decoration:none; border-radius:8px }
.user .menu a:hover{ background:#f3f4f6 }

/* ===== Subnav (tabs) ===== */
.subnav.container{ display:flex; align-items:center; gap:10px; margin:20px auto 8px; }
.tab{
  display:inline-block; padding:8px 12px; border-radius:10px; border:1px solid var(--border);
  color:#374151; text-decoration:none; font-weight:700; cursor:pointer;
}
.tab.active{ background:#f3f4f6; color:#111827 }

/* ===== Layout ===== */
.container{ max-width:1200px; margin:0 auto; padding:0 20px }
.grid-2{ display:grid; grid-template-columns: 1.5fr 1fr; gap:16px; align-items:start; margin:16px auto 40px }

/* KPIs */
.kpis{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:8px auto 16px }
.kpi-card{
  background:#fff; border:1px solid var(--border); border-radius:12px; padding:18px;
  box-shadow:0 6px 16px rgba(0,0,0,.04);
}
.kpi-label{ color:var(--muted); font-size:13px; margin-bottom:8px }
.kpi-value{ font-size:28px; font-weight:800 }

/* Panels */
.panel{
  background:#fff; border:1px solid var(--border); border-radius:12px; padding:16px;
  box-shadow:0 6px 16px rgba(0,0,0,.04);
}
.panel-title{ font-size:14px; color:var(--muted); margin-bottom:10px }

.map-panel #map{ width:100%; height:480px; border-radius:12px }

/* Sidebar content */
.sidebar .actions{ display:flex; flex-direction:column; gap:10px }
.button{
  background:#f3f4f6; color:#111827; padding:12px 14px; border:none; border-radius:10px; font-size:15px;
  display:flex; align-items:center; gap:10px; cursor:pointer; transition:.15s ease; width:100%;
}
.button:hover{ background:#e5e7eb }
.button.danger{ background:#fee2e2; color:#991b1b }
.button.danger:hover{ background:#fecaca }

.mt24{ margin-top:24px }

.alerts{ list-style:none; padding:0; margin:10px 0 0 }
.alerts li{ display:flex; align-items:center; gap:8px; padding:8px 0; border-bottom:1px dashed var(--border) }
.alerts li:last-child{ border-bottom:none }
.dot{ width:10px; height:10px; border-radius:50%; display:inline-block }
.dot.danger{ background:var(--danger) }
.dot.warning{ background:var(--warning) }
.dot.success{ background:var(--success) }

.list{ display:flex; flex-direction:column; gap:10px }
.item{
  display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px;
  border:1px solid var(--border); border-radius:10px; background:#fff;
}
.item .name{ font-weight:700 }
.item .meta{ color:var(--muted); font-size:13px }
.badge{
  padding:6px 10px; border-radius:999px; font-size:12px; font-weight:700; border:1px solid transparent;
}
.badge.success{ background:#ecfdf5; color:#065f46; border-color:#a7f3d0 }
.badge.warning{ background:#fffbeb; color:#92400e; border-color:#fde68a }
.badge.danger{ background:#fef2f2; color:#b91c1c; border-color:#fecaca }

.panel.actions{ display:flex; gap:10px }

/* Forms in Settings */
.panel.form label{ display:block; margin:10px 0 6px; color:#374151; font-size:14px }
.panel.form input, .panel.form select{
  width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:8px; background:#fff; color:#111827;
}

/* ===== Modals ===== */
.modal{
  position:fixed; inset:0; display:none; align-items:center; justify-content:center;
  background:rgba(17,24,39,.4); z-index:100;
}
.modal.open{ display:flex }
.modal-dialog{
  width:min(520px, 92vw); background:#fff; border:1px solid var(--border); border-radius:16px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
}
.modal-header, .modal-footer{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px 16px; border-bottom:1px solid var(--border) }
.modal-footer{ border-top:1px solid var(--border); border-bottom:none }
.modal-body{ padding:16px }
.modal-body label{ display:block; margin:10px 0 6px; color:#374151 }
.modal-body input, .modal-body select{
  width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:8px;
}
.icon-btn{ font-size:14px }

/* ===== Footer ===== */
.site-footer{
  border-top:1px solid var(--border); padding:24px 40px; color:#6b7280; text-align:center; background:#fff; margin-top:24px;
}

/* ===== Responsive ===== */
@media (max-width:1024px){
  .grid-2{ grid-template-columns:1fr; }
  .searchbar{ min-width: 0; width: 100% }
}
@media (max-width:640px){
  .nav.primary{ display:none }
  .searchbar{ display:none }
  .site-header{ padding:12px 16px }
}
/* Google Map box */
.map-box{
  width:100%;
  height:360px;          /* عدّل الارتفاع حسب رغبتك */
  border-radius:10px;
  background:#f3f4f6;    /* يظهر كلون مؤقت إذا الـ API ما اشتغل */
  overflow:hidden;
}
@media (max-width:640px){
  .map-box{ height:300px; }
}
:root{ --brand:#349c52; --border:#e5e7eb; --muted:#6b7280; --text:#111827; --panel:#fff }

/* Header */
.site-header{
  position: sticky;     /* لازم sticky أو fixed */
  top: 0;
  z-index: 100;         /* فوق كل العناصر */
  position: relative;   /* مهم عشان ::after يتموضع صح */
  background:#fff;
  border-bottom:1px solid var(--border);
  padding:12px 24px;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  box-shadow:0 2px 10px rgba(0,0,0,.06);
}
.site-header::after{
  content:""; position:absolute; left:0; right:0; bottom:-12px; height:12px;
  background:radial-gradient(rgba(17,24,39,0.04) 1px, transparent 1px);
  background-size:8px 8px; box-shadow:0 6px 8px -6px rgba(0,0,0,.08);
}
.left{ display:flex; align-items:center; gap:12px }
.logo img{ height: 48px; width:auto; display:block } /* كبّر/صغّر الرقم */
.divider{ width:1px; height:28px; background:var(--border) }
.nav a{
  color:#6b7280; text-decoration:none; margin:0 6px;
  font-size:15px; font-weight:700; padding:8px 10px; border-radius:8px; transition:.15s;
}
.nav a:hover{ color:#374151 }
.nav a.active{ color:#111827; background:#f3f4f6 }
.right{ display:flex; align-items:center; gap:10px }
.icon-btn{ border:1px solid var(--border); background:#fff; border-radius:10px; padding:8px 10px; cursor:pointer }
.lang-switch{ cursor:pointer; border:1px solid var(--border); padding:8px 10px; border-radius:8px; background:#fff; color:#374151; text-decoration:none }
.avatar{ width:34px; height:34px; border-radius:50%; border:1px solid var(--border) }
