:root {
  --green: #428177;
  --green-dark: #054239;
  --green-soft: #edebe0;
  --ink: #002623;
  --muted: #3d3a3b;
  --line: #edebe0;
  --paper: #ffffff;
  --canvas: #edebe0;
  --gold: #b9a779;
  --red: #6b1f2a;
  font-family: "Qomra", "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

@font-face {
  font-family: "Qomra";
  src: url("fonts/QomraArabic-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }
.dashboard-page { min-height: 100vh; background: #ffffff; }
.topbar { height: 82px; padding: 0 clamp(22px, 5vw, 82px); display: flex; align-items: center; justify-content: space-between; background: #ffffff; border-bottom: 1px solid #edebe0; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 43px; height: 35px; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 11px; background: linear-gradient(140deg, #428177, #054239); color: #ffffff; box-shadow: 0 5px 12px #05423928; }
.brand-mark .star { color: #ffffff; font-size: 8px; }
.brand-leaf { width: 12px; height: 17px; display: block; border-radius: 10px 2px 10px 2px; background: #ffffff; transform: rotate(35deg); position: relative; }
.brand-leaf::after { position: absolute; content: ""; height: 13px; width: 1px; background: #428177; top: 2px; left: 6px; transform: rotate(-35deg); }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 15px; font-weight: 700; }
.brand-copy small { color: #b9a779; font-size: 10px; }
.topbar-right { display: flex; align-items: center; gap: 23px; }
.live-status { display: inline-flex; gap: 8px; align-items: center; color: #428177; font-size: 10px; }
.live-status i, .footer-live-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #428177; box-shadow: 0 0 0 4px #4281771a; }
.user-chip { display: flex; align-items: center; gap: 10px; border-right: 1px solid var(--line); padding-right: 20px; }
.user-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: #edebe0; color: var(--green); font-size: 14px; font-weight: 700; }
.user-chip > span:last-child { display: grid; gap: 3px; }
.user-chip b { font-size: 10px; font-weight: 600; }
.user-chip small { color: #b9a779; font-size: 9px; }
.logout-form { margin: 0; }
.logout-button, .admin-link { color: #428177; background: none; border: 0; font-size: 10px; text-decoration: none; }
.logout-button span { color: var(--red); }
.admin-link { color: var(--green); }
.dashboard-main { width: min(1320px, calc(100% - 64px)); margin: 0 auto; padding: 36px 0 70px; }
.welcome-row { min-height: 130px; display: flex; align-items: center; justify-content: space-between; position: relative; }
.section-kicker { color: var(--green); font-size: 10px; font-weight: 600; letter-spacing: .15px; }
.spark { color: var(--gold); margin-left: 4px; font-size: 14px; vertical-align: -1px; }
.welcome-row h1 { margin: 9px 0 6px; color: #002623; font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -.8px; }
.welcome-row h1 span { color: var(--green); }
.muted { color: #b9a779; font-size: 11px; line-height: 1.9; margin: 0; }
.welcome-emblem { width: 110px; height: 100px; display: grid; place-items: center; position: relative; margin-left: 26px; border-radius: 50% 50% 46% 54%; background: radial-gradient(circle, #edebe0 0, #edebe0 51%, transparent 52%); }
.emblem-text { color: #428177; font-size: 12px; line-height: 1.5; text-align: center; font-weight: 700; }
.emblem-star, .emblem-spark { position: absolute; color: var(--gold); font-size: 16px; }
.emblem-star { top: 9px; right: 12px; }
.emblem-spark { bottom: 8px; left: 13px; color: #428177; }
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 14px 0 24px; }
.stat-card { height: 105px; padding: 18px 20px; display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden; border: 1px solid #edebe0; border-radius: 13px; background: #ffffff; box-shadow: 0 5px 18px #3d3a3b05; }
.stat-icon { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 13px; font-size: 24px; }
.stat-green .stat-icon { color: var(--green); background: #edebe0; }
.stat-gold .stat-icon { color: #b9a779; background: #edebe0; }
.stat-rose .stat-icon { color: #b9a779; background: #edebe0; }
.stat-card > div:nth-child(2) { display: grid; gap: 2px; }
.stat-label { color: #428177; font-size: 10px; }
.stat-card strong { color: #3d3a3b; font-size: 23px; line-height: 1.2; font-weight: 700; }
.stat-card small { color: #b9a779; font-size: 9px; }
.stat-decoration { position: absolute; left: 12px; bottom: -19px; font-size: 65px; color: #428177; opacity: .055; transform: rotate(-18deg); }
.stat-gold .stat-decoration { color: #b9a779; }
.stat-rose .stat-decoration { color: #b9a779; }
.map-card, .locations-card { background: #ffffff; border: 1px solid #edebe0; border-radius: 14px; box-shadow: 0 8px 26px #05423908; overflow: hidden; }
.map-toolbar { min-height: 83px; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #edebe0; }
.map-title { display: flex; align-items: center; gap: 12px; min-width: 210px; }
.map-pin-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 21px; }
.map-title h2 { margin: 0 0 3px; font-size: 12px; font-weight: 700; }
.map-title p { margin: 0; color: #b9a779; font-size: 9px; }
.map-actions { display: flex; align-items: center; gap: 9px; }
.search-box { width: min(290px, 26vw); height: 37px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #edebe0; border-radius: 8px; background: #ffffff; color: #428177; }
.search-box > span { font-size: 21px; line-height: 1; }
.search-box input { flex: 1; min-width: 50px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 9px; }
.search-box input::placeholder { color: #b9a779; }
.search-box button { padding: 5px 8px; border: 0; border-radius: 5px; background: #edebe0; color: var(--green); font-size: 9px; }
.toggle-track { width: 25px; height: 14px; display: block; position: relative; border-radius: 10px; background: #edebe0; transition: background .2s ease; }
.toggle-track b { width: 10px; height: 10px; position: absolute; top: 2px; right: 2px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 3px #00262322; transition: transform .2s ease; }
.button { min-height: 37px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 0; border-radius: 8px; font-size: 10px; font-weight: 600; }
.button-primary { padding: 0 14px; color: #ffffff; background: linear-gradient(135deg, #428177, #054239); box-shadow: 0 4px 10px #42817724; transition: transform .15s, box-shadow .15s; }
.button-primary:hover { transform: translateY(-1px); box-shadow: 0 7px 15px #4281772e; }
.add-point-button span { font-size: 16px; }
.map-container { height: 470px; position: relative; background: #edebe0; }
#map { width: 100%; height: 100%; }
.map-legend { position: absolute; bottom: 17px; right: 18px; z-index: 1; display: flex; gap: 15px; padding: 10px 12px; border: 1px solid #edebe0; border-radius: 8px; background: #ffffffed; box-shadow: 0 3px 12px #00262316; color: #428177; font-size: 8px; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: #428177; box-shadow: 0 0 0 3px #42817725; }
.map-loading, .map-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; color: #428177; background: radial-gradient(ellipse at 50% 48%, #ffffff 0, #edebe0 70%, #edebe0 100%); text-align: center; font-size: 11px; }
.map-empty[hidden], .map-loading[hidden] { display: none; }
.map-empty { z-index: 2; padding: 25px; }
.map-empty-symbol { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 17px; background: #ffffff; color: var(--green); box-shadow: 0 6px 20px #3d3a3b10; font-size: 31px; }
.map-empty h3 { margin: 3px 0 -7px; color: #3d3a3b; font-size: 14px; }
.map-empty p { max-width: 500px; line-height: 2; color: #b9a779; font-size: 10px; }
.map-empty code { direction: ltr; display: inline-block; padding: 2px 4px; border-radius: 3px; background: #ffffff; color: #428177; font-family: Consolas, monospace; }
.loading-spinner { width: 24px; height: 24px; border: 2px solid #edebe0; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.map-footer { height: 40px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; color: #b9a779; font-size: 8px; }
.map-footer > span:first-child { display: flex; align-items: center; gap: 7px; }
.footer-live-dot { width: 5px; height: 5px; box-shadow: none; }
.map-footer b { padding: 0 3px; color: #b9a779; }
.mapboxgl-popup-content, .mapboxgl-ctrl { font-family: "Qomra", "Segoe UI", sans-serif; }
.mapboxgl-popup-content { padding: 12px 14px; border-radius: 10px; direction: rtl; text-align: right; box-shadow: 0 8px 28px #00262322; }
.mapboxgl-popup-close-button { right: auto; left: 5px; font-size: 17px; color: #b9a779; }
.point-popup { min-width: 155px; display: grid; gap: 6px; padding-top: 3px; }
.point-popup strong { color: #3d3a3b; font-size: 11px; }
.point-popup > span { color: #b9a779; font-size: 9px; }
.point-popup > b { color: var(--green); font-size: 10px; }
.point-popup small { color: #b9a779; font-size: 8px; }
.popup-edit { margin-top: 3px; padding: 6px; border: 0; border-radius: 5px; background: #edebe0; color: var(--green); font-size: 9px; }
.popup-actions { display: flex; gap: 6px; margin-top: 3px; }
.popup-actions .popup-edit { flex: 1; margin: 0; }
.popup-delete { flex: 1; padding: 6px; border: 0; border-radius: 5px; background: #ffffff; color: #6b1f2a; font-size: 9px; }
.locations-card { margin-top: 20px; padding: 19px 21px 5px; }
.locations-heading { display: flex; justify-content: space-between; align-items: center; }
.locations-heading h2 { margin: 4px 0 13px; font-size: 15px; }
.table-count { padding: 6px 9px; border-radius: 6px; background: #edebe0; color: var(--green); font-size: 9px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: right; white-space: nowrap; }
th { padding: 11px 9px; border-bottom: 1px solid #edebe0; color: #b9a779; font-size: 9px; font-weight: 500; }
td { padding: 12px 9px; border-bottom: 1px solid #edebe0; color: #428177; font-size: 10px; }
tbody tr:last-child td { border-bottom: 0; }
.clickable-row { cursor: pointer; transition: background .15s; }
.clickable-row:hover { background: #ffffff; }
.table-empty { padding: 27px; text-align: center; color: #b9a779; }
.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: none; align-items: center; justify-content: center; padding: 20px; background: #00262385; backdrop-filter: blur(4px); }
.modal-backdrop.is-open { display: flex; animation: appear .18s ease-out; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
.point-modal { width: min(450px, 100%); max-height: min(90vh, 760px); overflow-y: auto; position: relative; padding: 29px; border-radius: 17px; background: #ffffff; box-shadow: 0 20px 70px #00262342; animation: lift .22s ease-out; }
.admin-locations-modal { width: min(920px, 100%); max-height: min(90vh, 820px); overflow-y: auto; position: relative; padding: 28px; border-radius: 17px; background: #ffffff; box-shadow: 0 20px 70px #00262342; animation: lift .22s ease-out; }
.admin-locations-header { display: flex; align-items: center; gap: 13px; padding-left: 35px; }
.admin-locations-header .modal-icon { flex: 0 0 42px; margin: 0; }
.admin-locations-modal h2 { margin: 0 0 4px; color: #054239; font-size: 19px; }
.admin-locations-modal h3 { margin: 24px 0 10px; color: #054239; font-size: 14px; }
.admin-locations-header .muted { font-size: 11px; }
.admin-locations-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 21px; }
.admin-locations-summary article { display: grid; gap: 7px; padding: 13px 15px; border: 1px solid #edebe0; border-radius: 10px; background: #ffffff; }
.admin-locations-summary span { color: #b9a779; font-size: 11px; }
.admin-locations-summary strong { color: #428177; font-size: 22px; }
.governorate-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 8px; }
.governorate-stat { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px 10px; padding: 11px 12px; border: 1px solid #edebe0; border-radius: 9px; background: #ffffff; }
.governorate-stat > strong { grid-column: 1 / -1; color: #054239; font-size: 12px; }
.governorate-stat > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #b9a779; font-size: 10px; }
.governorate-stat b { color: #428177; font-size: 12px; }
.registered-locations h3 { margin-top: 24px; }
.admin-locations-modal .admin-point-list { max-height: none; overflow: visible; }
@keyframes lift { from { transform: translateY(9px); } to { transform: translateY(0); } }
.modal-close { width: 29px; height: 29px; position: absolute; top: 16px; left: 16px; border: 0; border-radius: 8px; background: #ffffff; color: #b9a779; font-size: 20px; line-height: 1; }
.modal-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 13px; background: #edebe0; color: var(--green); font-size: 23px; }
.point-modal h2 { margin: 6px 0 5px; color: #054239; font-size: 19px; }
.point-modal > .muted { margin-bottom: 21px; }
.point-modal form { display: grid; gap: 14px; }
.form-field { display: grid; gap: 7px; }
.form-field label { color: #428177; font-size: 10px; font-weight: 600; }
.form-field > input, .form-field > select, .number-field { width: 100%; height: 42px; border: 1px solid #edebe0; border-radius: 8px; background: #ffffff; outline: 0; color: #3d3a3b; font-size: 11px; transition: border-color .2s, box-shadow .2s; }
.form-field > input { padding: 0 12px; }
.form-field > select { padding: 0 12px; }
.form-field > input:focus, .form-field > select:focus, .number-field:focus-within { border-color: #b9a779; box-shadow: 0 0 0 3px #42817714; }
.form-field input::placeholder { color: #b9a779; }
.governorate-readonly { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid #edebe0; border-radius: 8px; background: #ffffff; color: var(--green); }
.governorate-readonly strong { color: #3d3a3b; font-size: 10px; }
.governorate-readonly small { margin-right: auto; color: #b9a779; font-size: 8px; }
.number-field { display: flex; align-items: center; padding-left: 12px; }
.number-field input { width: 100%; height: 100%; padding: 0 12px; border: 0; outline: 0; background: transparent; color: #3d3a3b; font-size: 13px; }
.number-field span { padding-right: 10px; color: #b9a779; white-space: nowrap; font-size: 9px; }
.coordinates-note { padding: 9px 10px; border-radius: 7px; background: #ffffff; color: #b9a779; font-size: 9px; direction: rtl; }
.modal-submit { width: 100%; height: 43px; margin-top: 2px; }
.modal-submit span { font-size: 14px; }
.toast-region { position: fixed; z-index: 20; bottom: 22px; left: 22px; display: grid; gap: 8px; }
.toast { max-width: min(380px, calc(100vw - 44px)); padding: 11px 15px; border: 1px solid #edebe0; border-radius: 9px; background: #ffffff; color: #3d3a3b; box-shadow: 0 8px 28px #0026231c; font-size: 10px; animation: lift .2s ease-out; }
.alert { margin: 12px 0; padding: 10px 13px; border-radius: 8px; font-size: 10px; }
.alert-error { background: #ffffff; color: #6b1f2a; }
.alert-success { background: #edebe0; color: #428177; }
.alert-info { background: #ffffff; color: #428177; }

.login-page { height: 100vh; min-height: 100dvh; display: grid; place-items: center; position: relative; overflow: hidden; padding: 16px 18px 42px; background: radial-gradient(ellipse at 50% 12%, #ffffff 0, #f3f5ef 56%, #e8eee8 100%); }
.login-page::before { content: ""; position: fixed; z-index: 0; inset: 0; pointer-events: none; background-image: radial-gradient(circle at 50% 50%, transparent 0 13px, #b9a77926 13px 14px, transparent 14px), repeating-conic-gradient(from 22.5deg at 50% 50%, transparent 0deg 43deg, #42817720 43deg 44deg, transparent 44deg 45deg), repeating-linear-gradient(45deg, transparent 0 26px, #b9a77912 27px 28px, transparent 29px 56px), repeating-linear-gradient(-45deg, transparent 0 26px, #42817712 27px 28px, transparent 29px 56px); background-size: 112px 112px; }
.login-decoration { position: fixed; border: 1px solid #42817720; border-radius: 50%; pointer-events: none; }
.decoration-one { width: 560px; height: 560px; top: -290px; right: -210px; }
.decoration-two { width: 420px; height: 420px; bottom: -260px; left: -150px; }
.login-shell { width: min(600px, 100%); position: relative; z-index: 1; overflow: hidden; isolation: isolate; border: 1px solid #e4e9e3; border-radius: 24px; background: #ffffff; box-shadow: 0 24px 70px #05423918; }
.login-shell::before { content: ""; position: absolute; z-index: 0; inset: 0; border-radius: inherit; background: url("images/j.jpg") center / cover no-repeat; opacity: .28; pointer-events: none; }
.brand-eagle { width: 120px; height: 40px; flex: 0 0 auto; }
.brand-logo-slot { position: relative; display: inline-grid; place-items: center; overflow: hidden; border: 1px solid #e5e9e4; border-radius: 14px; background: #ffffff; color: #428177; }
.brand-logo-image { width: 100%; height: 100%; position: absolute; inset: 0; z-index: 1; object-fit: contain; }
.brand-logo-placeholder { font-family: "Segoe UI", Tahoma, sans-serif; font-size: 24px; line-height: 1; }
.login-card { position: relative; z-index: 1; padding: 24px 38px 22px; text-align: center; }
.login-identity { display: grid; justify-items: center; gap: 6px; margin-bottom: 13px; text-align: center; }
.login-location { color: #173e2a; font-size: 12px; font-weight: 800; letter-spacing: .2px; text-shadow: 0 1px 2px #ffffffc0; }
.brand-eagle-login { width: 320px; height: 220px; border-color: transparent; border-radius: 16px; background: transparent; box-shadow: none; }
.login-brand-name { color: #002623; font-size: 22px; font-weight: 800; text-shadow: 0 1px 2px #ffffffa8; }
.login-card .section-kicker { margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.login-card h2 { margin: 0 0 6px; color: #002623; font-size: 30px; font-weight: 800; text-shadow: 0 1px 2px #ffffffa8; }
.login-card > .muted { margin: 0 0 14px; font-size: 13px; font-weight: 600; }
.login-form { display: grid; gap: 7px; padding: 16px 18px; border: 1px solid #e5e9e4; border-radius: 16px; }
.login-form label { margin-top: 4px; color: #315d45; font-size: 13px; font-weight: 700; text-align: center; }
.input-wrap { height: 46px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid #edebe0; border-radius: 8px; background: #ffffff; color: #b9a779; transition: border-color .2s, box-shadow .2s; }
.input-wrap:focus-within { border-color: #b9a779; box-shadow: 0 0 0 3px #42817712; }
.input-icon { font-size: 15px; }
.input-wrap input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: #3d3a3b; font-size: 14px; font-weight: 600; text-align: center; }
.input-wrap input::placeholder { color: #8f7748; font-weight: 600; }
.login-submit { height: 44px; margin-top: 8px; font-size: 14px; font-weight: 700; }
.login-submit span { font-size: 14px; }
.login-note { margin-top: 19px; display: flex; align-items: center; gap: 7px; color: #b9a779; font-size: 8px; }
.lock-icon { font-size: 13px; color: #b9a779; }
.login-footer { position: absolute; bottom: 8px; max-width: calc(100% - 24px); color: #568177; font-size: 8px; text-align: center; }

@media (max-width: 1020px) {
  .dashboard-main { width: min(100% - 40px, 850px); }
  .map-toolbar { align-items: flex-start; flex-direction: column; }
  .map-actions { width: 100%; }
  .search-box { width: auto; flex: 1; }
}
@media (max-width: 680px) {
  .topbar { height: 70px; padding: 0 17px; }
  .brand-copy small, .live-status, .user-chip > span:last-child, .admin-link { display: none; }
  .topbar-right { gap: 13px; }
  .user-chip { padding-right: 0; border: 0; }
  .dashboard-main { width: calc(100% - 30px); padding-top: 21px; }
  .welcome-row { min-height: 112px; }
  .welcome-row h1 { font-size: 23px; }
  .welcome-row .muted { max-width: 300px; font-size: 9px; }
  .welcome-emblem { width: 70px; height: 72px; margin-left: 0; flex: 0 0 70px; }
  .emblem-text { font-size: 9px; }
  .emblem-star { top: 6px; right: 5px; font-size: 12px; }
  .emblem-spark { bottom: 4px; left: 4px; font-size: 12px; }
  .stats-row { gap: 7px; margin: 8px 0 16px; }
  .stat-card { height: 88px; padding: 10px 9px; gap: 7px; border-radius: 10px; }
  .stat-icon { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; font-size: 17px; }
  .stat-label { font-size: 8px; }
  .stat-card strong { font-size: 16px; }
  .stat-card small { font-size: 7px; }
  .stat-decoration { left: 2px; font-size: 48px; }
  .map-toolbar { padding: 14px; gap: 12px; }
  .map-actions { flex-wrap: wrap; gap: 7px; }
  .search-box { width: 100%; flex: 1 1 100%; }
  .add-point-button { flex: 1; padding: 0 8px; }
  .map-container { height: min(58vh, 420px); min-height: 320px; }
  .map-legend { right: 9px; bottom: 9px; gap: 8px; padding: 8px; font-size: 7px; }
  .map-footer { padding: 0 10px; font-size: 7px; }
  .locations-card { padding: 15px 13px 4px; }
  .point-modal { padding: 24px 20px; }
  .login-page { padding: 12px 8px 34px; }
  .login-shell { width: min(560px, 100%); }
  .login-card { padding: 20px 6px 18px; }
  .login-identity { margin-bottom: 13px; }
  .brand-eagle-login { width: 260px; height: 178px; }
  .login-location { font-size: 11px; }
  .login-brand-name { font-size: 20px; }
  .login-card .section-kicker { font-size: 12px; }
  .login-card h2 { font-size: 26px; }
  .login-card > .muted { font-size: 12px; }
  .login-form { gap: 5px; }
  .login-form label { font-size: 12px; }
  .input-wrap { height: 42px; }
  .login-submit { height: 40px; font-size: 13px; }
  .login-footer { bottom: 5px; font-size: 7px; }
}
@media (max-width: 380px) {
  .topbar .brand-copy { display: none; }
}
@media (max-height: 650px) {
  .login-page { padding: 8px 12px 26px; }
  .login-card { padding: 13px 12px 14px; }
  .login-identity { gap: 4px; margin-bottom: 10px; }
  .login-location { font-size: 8px; }
  .brand-eagle-login { width: 240px; height: 164px; }
  .login-location { font-size: 9px; }
  .login-brand-name { font-size: 17px; }
  .login-card .section-kicker { margin-bottom: 3px; font-size: 11px; }
  .login-card h2 { margin-bottom: 3px; font-size: 22px; }
  .login-card > .muted { margin-bottom: 8px; font-size: 10px; }
  .login-form { gap: 3px; }
  .login-form label { margin-top: 1px; font-size: 10px; }
  .input-wrap { height: 34px; }
  .input-wrap input { font-size: 11px; }
  .login-submit { height: 34px; margin-top: 3px; font-size: 11px; }
  .login-footer { bottom: 3px; font-size: 7px; }
}

.dashboard-page { --dashboard-topbar-height: clamp(54px, 4.6vw, 66px); height: 100dvh; min-height: 100vh; overflow: hidden; background: #ffffff; }
.topbar { height: var(--dashboard-topbar-height); position: fixed; inset: 0 0 auto; z-index: 5; padding: 0 0px 0 22px; background:#edebe0; box-shadow: 0 2px 12px #05423920; }
.menu-button, .icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid #428177; border-radius: 10px; background: #edebe0; color: #002623; font-size: 18px; }
.menu-button { position: absolute; z-index: 6; top: 12px; right: 14px; border-color: #4a151e; background: #6b1f2a; color: #ffffff; box-shadow: 0 4px 12px #4a151e40; }
.menu-button:hover { border-color: #6b1f2a; background: #853341; }
.menu-button:focus-visible { outline: 2px solid #b9a779; outline-offset: 2px; }
.brand { order: 1; height: var(--dashboard-topbar-height); margin-left: auto; gap: 8px; padding: 0 8px; border-radius: 11px; background: #edebe0; box-shadow: 0 2px 6px #00262312; }
.topbar .brand-eagle { width: clamp(120px, 15vw, 216px); height: var(--dashboard-topbar-height); border-color: #ffffff; border-radius: 8px; background: #ffffff; }
.brand-copy { min-height: 100%; align-items: center; padding: 0 9px; border-radius: 8px; background: #ffffff; }
.brand-copy strong { color: #054239; font-size: 19px; font-weight: 700; }
.map-style-section { padding: 12px; border: 1px solid #edebe0; border-radius: 10px; background: #ffffff; }
.map-style-section h3 { font-size: 13px; font-weight: 700; }
.map-style-toggle { width: 100%; min-height: 40px; display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 10px; border: 1px solid #edebe0; border-radius: 9px; background: #edebe0; color: #002623; font: inherit; font-size: 13px; font-weight: 700; }
.map-style-current { white-space: nowrap; }
.map-style-track { width: 38px; height: 22px; position: relative; flex: 0 0 38px; border-radius: 20px; background: #b9a779; transition: background .2s ease; }
.map-style-track i { width: 16px; height: 16px; position: absolute; top: 3px; right: 3px; border-radius: 50%; background: #ffffff; transition: transform .2s ease; }
.map-style-toggle.is-satellite { border-color: #054239; background: #054239; color: #ffffff; }
.map-style-toggle.is-satellite .map-style-track { background: #428177; }
.map-style-toggle.is-satellite .map-style-track i { background: #ffffff; transform: translateX(-16px); }
.map-style-toggle:focus-visible { outline: 2px solid #428177; outline-offset: 2px; }
.topbar-right { order: 3; gap: 12px; }
.topbar .user-chip { padding-right: 0; border: 0; }
.topbar .user-chip b, .topbar .admin-link, .topbar .logout-button { font-size: 16px; }
.topbar .user-chip small { font-size: 12px; }
.topbar .user-chip b, .topbar .user-chip small, .topbar .admin-link, .topbar .logout-button { color: #002623; font-weight: 700; }
.map-workspace { position: fixed; inset: var(--dashboard-topbar-height) 0 30px; }
.map-menu-button { cursor: pointer; }
.map-container { height: 100%; min-height: 0; }
.map-legend { z-index: 2; right: 15px; bottom: 16px; }
.side-panel { width: min(360px, calc(100vw - 42px)); height: calc(100dvh - var(--dashboard-topbar-height) - 30px); position: fixed; z-index: 8; top: var(--dashboard-topbar-height); right: 0; bottom: 30px; left: auto; display: flex; flex-direction: column; gap: 20px; padding: 23px; overflow-y: auto; border-right: 0; border-left: 1px solid #edebe0; background: #ffffff; box-shadow: -10px 10px 35px #00262320; transform: translateX(110%); transition: transform .22s ease; }
.side-panel.is-open { transform: translateX(0); }
.side-heading { display: flex; align-items: center; justify-content: space-between; }
.side-heading h2 { margin: 0; font-size: 19px; }
.side-heading .icon-button { font-size: 23px; }
.side-backdrop { position: fixed; inset: var(--dashboard-topbar-height) 0 30px; z-index: 7; display: none; background: #00262366; }
.side-backdrop.is-open { display: block; }
.side-panel .search-box { width: 100%; min-height: 40px; }
.side-panel .search-box input, .side-panel .search-box button { font-size: 13px; }
.sidebar-section { display: grid; gap: 10px; }
.sidebar-section h3 { margin: 0; color: #428177; font-size: 13px; font-weight: 600; }
.style-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.style-choice { min-height: 42px; border: 1px solid #edebe0; border-radius: 8px; background: #ffffff; color: #428177; font-size: 13px; }
.style-choice.is-selected { border-color: #428177; background: #edebe0; color: #428177; font-weight: 600; }
.sidebar-option { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border: 1px solid #edebe0; border-radius: 8px; background: #ffffff; color: #428177; text-align: right; font-size: 13px; }
.sidebar-option.is-active .toggle-track { background: var(--green); }
.sidebar-option.is-active .toggle-track b { transform: translateX(-11px); }
.sidebar-add-button { width: 100%; min-height: 46px; font-size: 13px; }
.sidebar-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.sidebar-summary > div { display: grid; gap: 4px; padding: 11px; border: 1px solid #edebe0; border-radius: 8px; background: #ffffff; }
.sidebar-summary span { color: #b9a779; font-size: 11px; }
.sidebar-summary strong { color: #428177; font-size: 20px; }
.admin-locations { min-height: 0; }
.admin-locations h3 { display: flex; justify-content: space-between; }
.admin-point-list { display: grid; gap: 6px; max-height: 35vh; overflow-y: auto; }
.admin-point-button { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid #edebe0; border-radius: 7px; background: #ffffff; color: #3d3a3b; text-align: right; }
.admin-point-button strong { font-size: 13px; }
.admin-point-button span { color: #b9a779; font-size: 11px; }
.admin-point-empty { margin: 0; color: #b9a779; font-size: 10px; }
.copyright-footer { height: 30px; position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: grid; place-items: center; border-top: 1px solid #edebe0; background: #ffffff; color: #3d3a3b; font-size: 11px; }
.brand-copy small, .user-chip small, .muted, .stat-card small, .map-title p, .search-box input::placeholder, .admin-point-button span, .admin-point-empty, .login-note, .lock-icon, .login-footer { color: #3d3a3b; }
.gathering-marker { --marker-color: #428177; --marker-glow: #42817755; width: 43px; height: 46px; display: grid; grid-template-rows: 22px 12px; align-content: center; justify-items: center; gap: 1px; padding: 0; appearance: none; border: 2px solid #ffffff; border-radius: 50% 50% 50% 7px; background: var(--marker-color); color: #ffffff; box-shadow: 0 2px 10px #05423965; font-size: 9px; font-weight: 700; animation: marker-glow 2.8s ease-in-out infinite; }
.gathering-marker::after { width: 0; height: 0; position: absolute; content: ""; top: auto; left: 15px; bottom: -7px; border: 0; border-top: 8px solid var(--marker-color); border-right: 6px solid transparent; border-left: 6px solid transparent; border-radius: 0; background: transparent; }
@keyframes marker-glow { 0%, 100% { box-shadow: 0 2px 10px #05423965, 0 0 0 0 var(--marker-glow); } 50% { box-shadow: 0 2px 10px #05423965, 0 0 0 7px #42817700; } }
.marker-people-icon { width: 20px; height: 20px; }
.marker-count { max-width: 37px; overflow: hidden; color: #ffffff; direction: ltr; line-height: 12px; text-overflow: ellipsis; white-space: nowrap; }
.gathering-marker.marker-low { background: var(--marker-color); }
.gathering-marker.marker-medium { width: 41px; height: 41px; background: var(--marker-color); }
.gathering-marker.marker-medium::after { left: 14px; }
.gathering-marker.marker-high { width: 45px; height: 45px; background: var(--marker-color); }
.gathering-marker.marker-high::after { left: 16px; }
.gathering-marker.marker-empty { background: var(--marker-color); }
.gathering-marker.marker-empty::after { border-top-color: var(--marker-color); }
.gathering-marker.marker-pending { width: 38px; height: 38px; background: #428177; font-size: 19px; }
.gathering-marker.marker-pending::after { left: 12px; border-top-color: #428177; }
.alert { position: fixed; z-index: 6; top: calc(var(--dashboard-topbar-height, 66px) + 10px); left: 50%; right: auto; max-width: min(440px, calc(100vw - 100px)); margin: 0; transform: translateX(-50%); text-align: center; box-shadow: 0 5px 20px #00262320; }
.map-loading, .map-empty { z-index: 3; }
.map-empty { color: #428177; }
.map-empty h3 { margin: 0; }

.dashboard-page[data-theme="dark"] { background: #002623; color: #edebe0; }
.dashboard-page[data-theme="dark"] .topbar { border-color: #054239; background: #054239; color: #ffffff; }
.dashboard-page[data-theme="dark"] .topbar .brand,
.dashboard-page[data-theme="dark"] .topbar .brand-eagle,
.dashboard-page[data-theme="dark"] .topbar .brand-copy { background: #054239; }
.dashboard-page[data-theme="dark"] .map-menu-button { border-color: #4a151e; background: #6b1f2a; color: #ffffff; }
.dashboard-page[data-theme="dark"] .map-menu-button:hover { background: #853341; }
.dashboard-page[data-theme="dark"] .side-panel { border-color: #3d3a3b; background: #002623; color: #edebe0; }
.dashboard-page[data-theme="dark"] .admin-locations-modal { background: #002623; color: #edebe0; }
.dashboard-page[data-theme="dark"] .admin-locations-modal h2,
.dashboard-page[data-theme="dark"] .admin-locations-modal h3,
.dashboard-page[data-theme="dark"] .governorate-stat > strong { color: #edebe0; }
.dashboard-page[data-theme="dark"] .admin-locations-summary article,
.dashboard-page[data-theme="dark"] .governorate-stat { border-color: #3d3a3b; background: #3d3a3b; }
.dashboard-page[data-theme="dark"] .admin-locations-summary strong,
.dashboard-page[data-theme="dark"] .governorate-stat b { color: #b9a779; }
.dashboard-page[data-theme="dark"] .admin-locations-trigger .table-count { background: #002623; color: #edebe0; }
.dashboard-page[data-theme="dark"] .copyright-footer { border-color: #3d3a3b; background: #002623; color: #edebe0; }
.dashboard-page[data-theme="dark"] .brand-copy strong,
.dashboard-page[data-theme="dark"] .user-chip b,
.dashboard-page[data-theme="dark"] .side-heading h2 { color: #edebe0; }
.dashboard-page[data-theme="dark"] .user-chip small,
.dashboard-page[data-theme="dark"] .sidebar-section h3 { color: #b9a779; }
.dashboard-page[data-theme="dark"] .icon-button,
.dashboard-page[data-theme="dark"] .sidebar-option,
.dashboard-page[data-theme="dark"] .admin-point-button { border-color: #3d3a3b; background: #3d3a3b; color: #edebe0; }
.dashboard-page[data-theme="dark"] .search-box,
.dashboard-page[data-theme="dark"] .style-choice,
.dashboard-page[data-theme="dark"] .sidebar-summary > div { border-color: #3d3a3b; background: #3d3a3b; color: #edebe0; }
.dashboard-page[data-theme="dark"] .icon-button { border-color: #428177; background: #edebe0; color: #002623; }
.dashboard-page[data-theme="dark"] .map-style-section,
.dashboard-page[data-theme="dark"] .map-style-toggle { border-color: #3d3a3b; background: #3d3a3b; color: #edebe0; }
.dashboard-page[data-theme="dark"] .map-style-toggle.is-satellite { background: #054239; color: #ffffff; }
.dashboard-page[data-theme="dark"] .brand-copy strong,
.dashboard-page[data-theme="dark"] .user-chip b,
.dashboard-page[data-theme="dark"] .user-chip small,
.dashboard-page[data-theme="dark"] .topbar .admin-link,
.dashboard-page[data-theme="dark"] .topbar .logout-button { color: #ffffff; }
.dashboard-page[data-theme="dark"] .search-box input { color: #edebe0; }
.dashboard-page[data-theme="dark"] .style-choice.is-selected { border-color: #428177; background: #3d3a3b; color: #edebe0; }
.dashboard-page[data-theme="dark"] .sidebar-summary span,
.dashboard-page[data-theme="dark"] .admin-point-button span { color: #b9a779; }
.dashboard-page[data-theme="dark"] .sidebar-summary strong { color: #b9a779; }
.dashboard-page[data-theme="dark"] .map-legend { border-color: #3d3a3b; background: #002623ed; color: #edebe0; }
.dashboard-page[data-theme="dark"] .map-empty { background: radial-gradient(ellipse at 50% 48%, #3d3a3b 0, #002623 70%, #002623 100%); color: #edebe0; }
.dashboard-page[data-theme="dark"] .map-empty h3 { color: #edebe0; }
.dashboard-page[data-theme="dark"] .map-empty p { color: #b9a779; }
.dashboard-page[data-theme="dark"] .map-empty-symbol,
.dashboard-page[data-theme="dark"] .map-empty code { background: #3d3a3b; color: #b9a779; }
.dashboard-page[data-theme="dark"] .point-modal { background: #002623; color: #edebe0; }
.dashboard-page[data-theme="dark"] .point-modal h2,
.dashboard-page[data-theme="dark"] .form-field label { color: #edebe0; }
.dashboard-page[data-theme="dark"] .point-modal .muted,
.dashboard-page[data-theme="dark"] .governorate-readonly small { color: #b9a779; }
.dashboard-page[data-theme="dark"] .form-field > input,
.dashboard-page[data-theme="dark"] .form-field > select,
.dashboard-page[data-theme="dark"] .number-field,
.dashboard-page[data-theme="dark"] .governorate-readonly,
.dashboard-page[data-theme="dark"] .coordinates-note { border-color: #3d3a3b; background: #3d3a3b; color: #edebe0; }
.dashboard-page[data-theme="dark"] .form-field > input,
.dashboard-page[data-theme="dark"] .form-field > select,
.dashboard-page[data-theme="dark"] .number-field input { color: #edebe0; }
.dashboard-page[data-theme="dark"] .governorate-readonly strong { color: #edebe0; }
.dashboard-page[data-theme="dark"] .toast { border-color: #3d3a3b; background: #002623; color: #edebe0; }

@media (max-width: 680px) {
  .dashboard-page { --dashboard-topbar-height: 60px; }
  .topbar { height: 60px; padding: 0 10px; }
  .topbar-right { gap: 7px; }
  .topbar .brand-eagle { width: 120px; height: 50px; }
  .topbar .brand-copy strong { font-size: 14px; }
  .topbar .user-chip { display: none; }
  .topbar .logout-button { padding: 7px 4px; font-size: 10px; }
  .topbar .admin-link { display: inline-block; font-size: 10px; }
  .menu-button, .icon-button { width: 34px; height: 34px; }
  .map-menu-button { top: 10px; right: 10px; }
  .map-style-toggle { min-height: 38px; font-size: 12px; }
  .map-workspace { inset: 60px 0 30px; }
  .map-legend { right: 8px; bottom: 10px; gap: 8px; padding: 8px; font-size: 7px; }
  .side-panel { top: 60px; bottom: 30px; height: calc(100dvh - 90px); width: min(320px, calc(100vw - 36px)); padding: 18px; }
  .admin-locations-backdrop { padding: 10px; }
  .admin-locations-modal { max-height: calc(100dvh - 20px); padding: 22px 15px 16px; }
  .admin-locations-summary { gap: 6px; margin-top: 16px; }
  .admin-locations-summary article { padding: 10px 8px; }
  .admin-locations-summary span { font-size: 9px; }
  .admin-locations-summary strong { font-size: 18px; }
  .governorate-stats { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }
  .side-backdrop { inset: 60px 0 30px; }
  .copyright-footer { height: 30px; padding: 0 8px; font-size: 9px; }
  .mapboxgl-ctrl-top-left { top: 8px; left: 8px; }
  .mapboxgl-ctrl-bottom-left { bottom: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .side-panel { transform: translateX(110%); }
  .side-panel.is-open { transform: translateX(0); }
  .style-choice { transition: none; }
  .gathering-marker { animation: none; }
}
