﻿/* === containers_map.css === */
/* Extracted from containers_map.html */

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --secondary: #3b82f6;
  --purple: #8b5cf6;
  --dark: #1e293b;
  --light-bg: #f1f4f8;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --border-l: #f1f5f9;
  --text: #334155;
  --muted: #64748b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,.09);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

body.dark-mode {
  --light-bg: #0f172a;
  --card-bg: #1e293b;
  --dark: #f1f5f9;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --border-l: #1e293b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Cairo", system-ui, sans-serif;
  background: var(--light-bg);
  color: var(--text);
  min-height: 100vh;
  transition: background .3s, color .3s;
}

.app-wrapper { display: flex; min-height: 100vh; }

.main-content {
  flex: 1;
  margin-right: 280px;
  display: flex;
  flex-direction: column;
  transition: margin-right .3s;
  min-width: 0;
}

.main-content.sidebar-collapsed { margin-right: 70px; }

.page-content { flex: 1; padding: 20px; margin-top: 64px; }

.map-wrapper {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .3s;
}
.map-wrapper:hover { box-shadow: var(--shadow-lg); }

.map-wrapper.fullscreen { position: fixed; inset: 0; z-index: 9990; border-radius: 0; }
.map-wrapper.fullscreen #map { flex: 1 !important; height: 0 !important; min-height: 0 !important; }
body.map-fullscreen .page-content { padding: 0; margin: 0; }
body.map-fullscreen .main-content { margin: 0; }
body.map-fullscreen #sidebarContainer, body.map-fullscreen #headerContainer, body.map-fullscreen #footerContainer { display: none !important; }

.map-toolbar {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  flex-shrink: 0;
  position: relative;
}

.map-toolbar::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--warning), var(--success), var(--secondary));
  margin: -12px -18px 12px;
}

.toolbar-row1, .toolbar-row2, .toolbar-row3 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-row1 { margin-bottom: 10px; }
.toolbar-row2, .toolbar-row3 { padding-top: 10px; border-top: 1px solid var(--border-l); }
.toolbar-row3 { margin-top: 0; }

.toolbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: var(--shadow-sm);
}

.toolbar-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-right: auto; }

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--light-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

body.dark-mode .stat-chip { background: var(--border-l); }
.stat-chip strong { font-size: 14px; font-weight: 800; color: var(--dark); transition: transform .2s; }
.stat-chip:hover strong { transform: scale(1.1); }
.stat-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stat-chip .dot.pulse { animation: dotPulse 1.5s ease-in-out infinite; }
@keyframes dotPulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.4);opacity:.6} }
.dot-green { background: var(--success); }
.dot-red { background: var(--danger); }
.dot-orange { background: var(--warning); }
.dot-blue { background: var(--secondary); }

.toolbar-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.type-filter-group, .expiry-filter-group {
  display: flex;
  background: var(--light-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

body.dark-mode .type-filter-group, body.dark-mode .expiry-filter-group { background: var(--border-l); }

.type-pill, .expiry-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  border: none;
  background: transparent;
  font-family: "Cairo", inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  transition: .15s;
  user-select: none;
}

.type-pill.active, .expiry-pill.active {
  background: var(--card-bg);
  color: var(--dark);
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

body.dark-mode .type-pill.active, body.dark-mode .expiry-pill.active { background: #2d333b; }

.type-pill.active.pill-green { color: var(--success); }
.type-pill.active.pill-red { color: var(--danger); }
.type-pill.active.pill-orange { color: var(--warning); }
.expiry-pill.active.pill-expired { color: var(--danger); }
.expiry-pill.active.pill-soon { color: var(--warning); }
.expiry-pill.active.pill-valid { color: var(--success); }

.cluster-label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--light-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

body.dark-mode .cluster-label { background: var(--border-l); }
.cluster-label input { cursor: pointer; width: 14px; height: 14px; }

.filter-wrap { display: flex; align-items: center; gap: 5px; }
.filter-wrap label { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }

.filter-wrap select, .filter-wrap input[type="text"], .filter-wrap input[type="date"] {
  padding: 7px 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: "Cairo", inherit;
  font-size: 12px;
  font-weight: 600;
  background: var(--card-bg);
  color: var(--text);
  transition: .15s;
  outline: none;
}

body.dark-mode .filter-wrap select, body.dark-mode .filter-wrap input { background: #21262d; border-color: #30363d; color: var(--text); }
.filter-wrap select:focus, .filter-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.filter-wrap select { min-width: 120px; }
.filter-wrap input[type="text"] { min-width: 150px; }
.filter-wrap input[type="date"] { min-width: 130px; }

.btn-clear-filters {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--muted);
  font-family: "Cairo", inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: .18s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-clear-filters:hover { border-color: var(--danger); color: var(--danger); background: rgba(239,68,68,.05); }

.ibtn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .15s;
  color: var(--text);
}

body.dark-mode .ibtn { background: #21262d; }
.ibtn:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(99,102,241,.15); }
.ibtn:active { transform: translateY(0); }
.ibtn.active { background: var(--dark); color: #fff; border-color: var(--dark); }

.btn {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-family: "Cairo", inherit;
  font-size: 12px;
  font-weight: 700;
  transition: .18s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }
.btn-success { background: linear-gradient(135deg, var(--success), #34d399); color: #fff; }
.btn-info { background: linear-gradient(135deg, var(--secondary), #2563eb); color: #fff; }
.btn-ghost { background: var(--card-bg); color: var(--text); border: 1.5px solid var(--border); }
body.dark-mode .btn-ghost { background: #21262d; border-color: #30363d; }

#map { width: 100%; height: calc(100vh - 340px); min-height: 380px; flex-shrink: 0; }

body.dark-mode .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.85); }
body.dark-mode.satellite-mode .leaflet-tile-pane { filter: none; }
.leaflet-control-zoom { direction: ltr; }

.marker-cluster-small { background-color: rgba(16,185,129,.55); }
.marker-cluster-small div { background-color: rgba(16,185,129,.80); }
.marker-cluster-medium { background-color: rgba(99,102,241,.55); }
.marker-cluster-medium div { background-color: rgba(99,102,241,.80); }
.marker-cluster-large { background-color: rgba(239,68,68,.55); }
.marker-cluster-large div { background-color: rgba(239,68,68,.80); }

.marker-cluster { background-clip: padding-box; border-radius: 50%; }
.marker-cluster div {
  width: 36px; height: 36px; margin: 4px; text-align: center; border-radius: 50%;
  font: bold 13px "Cairo", sans-serif; color: white; display: flex; align-items: center; justify-content: center;
}

.status-bar {
  padding: 7px 16px;
  background: var(--light-bg);
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  transition: .2s;
}

body.dark-mode .status-bar { background: var(--border-l); }
.status-bar.loading { background: #fffbeb; color: #92400e; }
body.dark-mode .status-bar.loading { background: #422006; color: #fbbf24; }
.status-bar.error { background: #eef2ff; color: #991b1b; }
body.dark-mode .status-bar.error { background: #450a0a; color: #fca5a5; }
.status-bar.ok { background: #f0fdf4; color: #166534; }
body.dark-mode .status-bar.ok { background: #052e16; color: #86efac; }

.load-progress { height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; width: 100px; display: none; }
.load-progress.active { display: block; }
.load-progress::after { content: ''; display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--warning)); animation: progressSweep 1.2s ease-in-out infinite; }
@keyframes progressSweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.toast-container { position: fixed; top: 18px; left: 18px; z-index: 999999; display: flex; flex-direction: column; gap: 6px; }
.toast { padding: 10px 16px; border-radius: var(--radius-md); color: #fff; font-size: 13px; font-weight: 600; max-width: 300px; box-shadow: var(--shadow-lg); animation: toastIn .28s cubic-bezier(.34,1.56,.64,1); }
@keyframes toastIn { from { transform: translateX(-120%); opacity: 0; } to { transform: none; opacity: 1; } }
.toast-success { background: linear-gradient(135deg, #059669, #10b981); }
.toast-error { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.toast-info { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.toast-warning { background: linear-gradient(135deg, #d97706, #f59e0b); }

.leaflet-popup-content-wrapper { border-radius: 14px !important; box-shadow: 0 8px 32px rgba(0,0,0,.18) !important; border: none !important; padding: 0 !important; overflow: hidden !important; background: #fff !important; }
.leaflet-popup-content { margin: 0 !important; font-family: "Cairo", sans-serif; font-size: 12px; line-height: 1.6; min-width: 230px; max-width: 300px; }
.leaflet-popup-tip-container .leaflet-popup-tip { background: #fff !important; box-shadow: none !important; }
.leaflet-popup-close-button { color: #94a3b8 !important; font-size: 18px !important; top: 8px !important; right: 8px !important; padding: 0 !important; width: 24px !important; height: 24px !important; line-height: 24px !important; text-align: center !important; border-radius: 50% !important; background: rgba(0,0,0,.06) !important; z-index: 10 !important; }
.leaflet-popup-close-button:hover { background: rgba(0,0,0,.12) !important; color: #334155 !important; }
.leaflet-popup { touch-action: auto; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { touch-action: auto; pointer-events: auto; }

.popup-head { padding: 9px 13px; display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--border-l); }
.popup-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; color: #fff; }
.pbg-green { background: var(--success); }
.pbg-red { background: var(--danger); }
.pbg-orange { background: var(--warning); }
.popup-body { padding: 9px 13px; background: #f8fafc; }
body.dark-mode .popup-body { background: #0d1117; }
.popup-row { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; padding: 2px 0; font-size: 11.5px; }
.popup-key { color: var(--muted); font-weight: 700; white-space: nowrap; }
.popup-val { color: var(--dark); font-weight: 600; word-break: break-word; }
.popup-val.expired { color: var(--danger); }
.popup-val.expiring-soon { color: var(--warning); }
.popup-val.valid { color: var(--success); }
.popup-notes { padding: 5px 13px; font-size: 11px; color: var(--muted); font-style: italic; border-top: 1px solid var(--border-l); }
.popup-actions { padding: 7px 13px 9px; display: flex; gap: 5px; flex-wrap: wrap; border-top: 1px solid var(--border-l); }
.popup-btn { padding: 5px 9px; border-radius: var(--radius-sm); font-family: "Cairo", sans-serif; font-size: 11px; font-weight: 700; border: none; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 3px; transition: all .2s cubic-bezier(.4,0,.2,1); -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; }
.popup-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.popup-btn:active { transform: translateY(0); }
.popup-btn-maps { background: #f1f5f9; color: #374151; }
.popup-btn-maps:hover { background: #e2e8f0; }
.popup-btn-share { background: var(--secondary); color: #fff; }
.popup-btn-file { background: var(--success); color: #fff; }
.popup-btn-img { background: var(--purple); color: #fff; }

.side-panel { position: fixed; top: 0; left: -440px; width: 420px; height: 100vh; background: var(--card-bg); box-shadow: var(--shadow-lg); z-index: 9999; transition: left .35s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; }
body.dark-mode .side-panel { background: var(--card-bg); }
.side-panel.open { left: 0; }
.panel-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 9998; display: none; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); transition: opacity .3s; }
.side-panel.open ~ .panel-overlay { display: block; }
.panel-header { padding: 14px 18px; flex-shrink: 0; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; display: flex; align-items: center; justify-content: space-between; }
.panel-header h3 { margin: 0; font-size: 16px; font-weight: 800; }
.panel-close { width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,.2); color: #fff; cursor: pointer; font-size: 20px; transition: .2s; display: flex; align-items: center; justify-content: center; }
.panel-close:hover { background: rgba(255,255,255,.35); }
.panel-body { flex: 1; padding: 16px; overflow-y: auto; scroll-behavior: smooth; }
.panel-body::-webkit-scrollbar { width: 5px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.panel-body::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 16px; }
.stat-card { border-radius: var(--radius-md); padding: 12px; text-align: center; border: 1px solid var(--border); transition: transform .2s, box-shadow .2s; cursor: default; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.blue { background: linear-gradient(135deg, #eff6ff, #dbeafe); }
.stat-card.green { background: linear-gradient(135deg, #ecfdf5, #d1fae5); }
.stat-card.red { background: linear-gradient(135deg, #eef2ff, #fee2e2); }
.stat-card.orange { background: linear-gradient(135deg, #fffbeb, #fef3c7); }
body.dark-mode .stat-card { background: linear-gradient(135deg, #1a2535, #1e293b); }
.stat-value { font-size: 22px; font-weight: 800; }
.stat-card.blue .stat-value { color: var(--secondary); }
.stat-card.green .stat-value { color: var(--success); }
.stat-card.red .stat-value { color: var(--danger); }
.stat-card.orange .stat-value { color: var(--warning); }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 3px; }
.panel-section { margin-bottom: 20px; }
.panel-section h4 { font-size: 12px; font-weight: 800; margin-bottom: 8px; color: var(--primary); display: flex; align-items: center; gap: 5px; }
.chart-box { background: var(--light-bg); border-radius: var(--radius-md); padding: 10px; margin-bottom: 10px; border: 1px solid var(--border); }
body.dark-mode .chart-box { background: var(--border-l); }
.chart-box canvas { max-height: 200px !important; }
.sizes-table { width: 100%; background: var(--card-bg); border-radius: var(--radius-sm); overflow: hidden; font-size: 12.5px; border: 1px solid var(--border); margin-top: 6px; }
body.dark-mode .sizes-table { background: #21262d; }
.sizes-table tr { border-bottom: 1px solid var(--border); }
.sizes-table tr:last-child { border-bottom: none; }
.sizes-table td { padding: 8px 10px; }
.sizes-table td:first-child { font-weight: 700; color: var(--primary); }
.sizes-table td:last-child { text-align: left; font-weight: 800; color: var(--danger); }

.btn-zones-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 8px 14px; border-radius: var(--radius-md); border: 1.5px solid var(--border); background: var(--card-bg); color: var(--text); font-family: "Cairo", inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: .18s; white-space: nowrap; }
.btn-zones-toggle:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-zones-toggle.zones-on { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; border-color: #7c3aed; }

.zones-panel { position: fixed; top: 0; left: -380px; width: 360px; height: 100vh; background: var(--card-bg); box-shadow: var(--shadow-lg); z-index: 9997; transition: left .32s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; }
body.dark-mode .zones-panel { background: var(--card-bg); }
.zones-panel.open { left: 0; }
.zones-panel-head { padding: 14px 18px; flex-shrink: 0; background: linear-gradient(135deg, #7c3aed, #8b5cf6); color: #fff; display: flex; align-items: center; justify-content: space-between; }
.zones-panel-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.zp-x { width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(255,255,255,.2); color: #fff; cursor: pointer; font-size: 20px; transition: .2s; display: flex; align-items: center; justify-content: center; }
.zp-x:hover { background: rgba(255,255,255,.35); }
.zones-panel-body { flex: 1; overflow-y: auto; padding: 14px; }
.zones-panel-body::-webkit-scrollbar { width: 4px; }
.zones-panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.zones-vis-header { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; background: var(--light-bg); border-radius: var(--radius-md); border: 1px solid var(--border); margin-bottom: 10px; }
body.dark-mode .zones-vis-header { background: var(--border-l); }
.zones-vis-title { font-size: 12px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 6px; }
.toggle-sw { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-sw input { opacity: 0; width: 0; height: 0; }
.toggle-sw .slider { position: absolute; inset: 0; background: var(--border); border-radius: 24px; cursor: pointer; transition: .25s; }
.toggle-sw .slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .25s; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.toggle-sw input:checked + .slider { background: #7c3aed; }
.toggle-sw input:checked + .slider::before { transform: translateX(20px); }
.zone-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.zone-item { display: flex; align-items: center; gap: 9px; padding: 9px 12px; background: var(--card-bg); border: 1.5px solid var(--border); border-radius: var(--radius-md); cursor: pointer; transition: all .2s cubic-bezier(.4,0,.2,1); font-size: 12px; font-weight: 700; }
.zone-item:hover { border-color: #8b5cf6; background: #faf5ff; transform: translateX(-3px); box-shadow: 0 2px 8px rgba(139,92,246,.12); }
body.dark-mode .zone-item:hover { background: #1a1235; }
.zone-item.active { border-color: #7c3aed; background: #faf5ff; }
body.dark-mode .zone-item.active { background: #1a1235; }
.zone-swatch { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; border: 1px solid rgba(0,0,0,.1); }
.zone-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone-count { font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--light-bg); padding: 2px 7px; border-radius: 20px; flex-shrink: 0; }
body.dark-mode .zone-count { background: var(--border-l); }
.zone-eye { width: 26px; height: 26px; border-radius: var(--radius-sm); border: none; background: transparent; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: .15s; flex-shrink: 0; opacity: .7; }
.zone-eye:hover { background: var(--light-bg); opacity: 1; }
.zone-eye.hidden { opacity: .3; }
.zone-zoom { width: 26px; height: 26px; border-radius: var(--radius-sm); border: none; background: transparent; cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; transition: .15s; flex-shrink: 0; opacity: .6; color: var(--text); }
.zone-zoom:hover { background: var(--light-bg); opacity: 1; }
.zones-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.zs-card { background: linear-gradient(135deg, #faf5ff, #ede9fe); border-radius: var(--radius-md); padding: 10px; text-align: center; border: 1px solid #ddd6fe; }
body.dark-mode .zs-card { background: linear-gradient(135deg, #1a1235, #1e293b); border-color: #30363d; }
.zs-card .zs-val { font-size: 20px; font-weight: 800; color: #7c3aed; }
.zs-card .zs-lbl { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.zones-note { background: var(--light-bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; font-size: 11.5px; color: var(--muted); line-height: 2; margin-top: 8px; }
body.dark-mode .zones-note { background: var(--border-l); }

.leaflet-control-layers { border-radius: var(--radius-md) !important; box-shadow: var(--shadow-md) !important; border: 1px solid var(--border) !important; font-family: "Cairo", sans-serif !important; direction: rtl; }
.leaflet-control-layers-expanded { padding: 8px 10px !important; min-width: 140px; }
.leaflet-control-layers label { font-size: 13px !important; font-weight: 600 !important; color: var(--text) !important; display: flex !important; align-items: center !important; gap: 5px !important; padding: 4px 2px !important; cursor: pointer; }
.leaflet-control-layers-selector { margin-left: 5px !important; margin-right: 0 !important; width: 15px !important; height: 15px !important; cursor: pointer !important; }

@media (max-width: 1100px) {
  .main-content { margin-right: 0; }
  .toolbar-row2, .toolbar-row3 { flex-wrap: wrap; }
}

@media (max-width: 768px) {
  .page-content { padding: 12px; }
  #map { height: 48vh; min-height: 300px; }
  .toolbar-chips { display: none; }
  .side-panel { width: 100%; left: -100%; }
  .side-panel.open { left: 0; }
  .zones-panel { width: 100%; left: -100%; }
  .zones-panel.open { left: 0; }
  .leaflet-popup-content { min-width: 200px; max-width: 250px; font-size: 11px; }
  .toolbar-row3 { gap: 6px; }
  .filter-wrap select, .filter-wrap input { min-width: 100px !important; font-size: 11px; }
  .kpi-bar { flex-wrap: wrap; }
  .kpi-item { min-width: 80px; }
  .results-panel { width: 100%; right: -100%; }
  .results-panel.open { right: 0; }
}

/* ═══ KPI DASHBOARD BAR ═══ */
.kpi-bar { display: flex; gap: 6px; padding: 8px 18px; background: var(--card-bg); border-bottom: 1px solid var(--border); flex-shrink: 0; overflow-x: auto; }
.kpi-item { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--light-bg); border-radius: var(--radius-md); border: 1px solid var(--border); min-width: 100px; flex-shrink: 0; }
body.dark-mode .kpi-item { background: var(--border-l); }
.kpi-icon { font-size: 16px; }
.kpi-info { display: flex; flex-direction: column; }
.kpi-val { font-size: 15px; font-weight: 800; color: var(--dark); }
.kpi-lbl { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.kpi-item.kpi-danger .kpi-val { color: var(--danger); }
.kpi-item.kpi-warning .kpi-val { color: var(--warning); }
.kpi-item.kpi-success .kpi-val { color: var(--success); }

/* ═══ ALERTS BANNER ═══ */
.alerts-banner { padding: 0 18px; max-height: 0; overflow: hidden; transition: max-height .4s, padding .4s; }
.alerts-banner.show { max-height: 200px; padding: 8px 18px; }
.alert-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; margin-bottom: 4px; animation: alertSlide .3s ease; }
.alert-item.alert-danger { background: #eef2ff; color: #991b1b; border-right: 3px solid var(--danger); }
.alert-item.alert-warning { background: #fffbeb; color: #92400e; border-right: 3px solid var(--warning); }
.alert-item.alert-info { background: #eff6ff; color: #1e40af; border-right: 3px solid var(--secondary); }
body.dark-mode .alert-item.alert-danger { background: #450a0a; color: #fca5a5; }
body.dark-mode .alert-item.alert-warning { background: #422006; color: #fbbf24; }
body.dark-mode .alert-item.alert-info { background: #172554; color: #93c5fd; }
.alert-close { margin-right: auto; cursor: pointer; opacity: .5; font-size: 14px; padding: 2px 6px; border: none; background: none; color: inherit; }
.alert-close:hover { opacity: 1; }
@keyframes alertSlide { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ═══ RESULTS SIDE LIST ═══ */
.results-panel { position: fixed; top: 0; right: -400px; width: 380px; height: 100vh; background: var(--card-bg); box-shadow: var(--shadow-lg); z-index: 9996; transition: right .35s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; }
.results-panel.open { right: 0; }
.results-head { padding: 12px 16px; background: linear-gradient(135deg, #0f766e, #14b8a6); color: #fff; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.results-head h3 { font-size: 15px; font-weight: 800; margin: 0; }
.results-search { padding: 10px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.results-search input { width: 100%; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-md); font-family: "Cairo"; font-size: 12px; background: var(--light-bg); color: var(--text); outline: none; }
.results-search input:focus { border-color: var(--primary); }
.results-list { flex: 1; overflow-y: auto; padding: 8px; }
.results-list::-webkit-scrollbar { width: 4px; }
.results-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.result-card { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 6px; cursor: pointer; transition: all .2s; font-size: 12px; }
.result-card:hover { border-color: var(--primary); transform: translateX(4px); background: var(--light-bg); }
.result-card .rc-type { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; color: #fff; display: inline-block; margin-bottom: 4px; }
.rc-green { background: var(--success); }
.rc-red { background: var(--danger); }
.rc-orange { background: var(--warning); }
.result-card .rc-title { font-weight: 700; color: var(--dark); }
.result-card .rc-sub { color: var(--muted); font-size: 11px; }
.results-count { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); text-align: center; flex-shrink: 0; font-weight: 600; }

/* ═══ SAVED FILTERS ═══ */
.saved-filters-wrap { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.saved-filter-chip { display: inline-flex; align-items: center; gap: 3px; padding: 4px 10px; border-radius: 20px; background: var(--purple); color: #fff; font-size: 10.5px; font-weight: 700; cursor: pointer; transition: .15s; border: none; font-family: "Cairo"; }
.saved-filter-chip:hover { opacity: .85; }
.saved-filter-chip .sf-del { opacity: .6; margin-right: 2px; }
.saved-filter-chip .sf-del:hover { opacity: 1; }

/* ═══ AUTO-REFRESH ═══ */
.auto-refresh-wrap { display: flex; align-items: center; gap: 6px; }
.auto-refresh-wrap select { padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: "Cairo"; font-size: 11px; background: var(--card-bg); color: var(--text); }
.countdown-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--light-bg); color: var(--muted); border: 1px solid var(--border); }

/* ═══ MEASURE TOOL ═══ */
.measure-result { position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%); background: var(--card-bg); border: 1.5px solid var(--primary); border-radius: var(--radius-md); padding: 8px 16px; font-size: 13px; font-weight: 700; color: var(--primary); box-shadow: var(--shadow-lg); z-index: 9000; white-space: nowrap; display: none; }
.measure-result.show { display: block; animation: alertSlide .3s ease; }

/* ═══ OFFLINE INDICATOR ═══ */
.offline-bar { display: none; padding: 6px 16px; background: linear-gradient(135deg, #92400e, #d97706); color: #fff; font-size: 12px; font-weight: 700; text-align: center; flex-shrink: 0; }
.offline-bar.show { display: block; animation: alertSlide .3s ease; }

/* ═══ PRESENTATION MODE ═══ */
body.presentation-mode .map-toolbar { display: none !important; }
body.presentation-mode .status-bar { display: none !important; }
body.presentation-mode .kpi-bar { display: none !important; }
body.presentation-mode .alerts-banner { display: none !important; }
body.presentation-mode #map { height: calc(100vh - 0px) !important; }
body.presentation-mode .map-wrapper { border-radius: 0; }
.pres-overlay { display: none; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9500; background: rgba(0,0,0,.55); backdrop-filter: blur(8px); border-radius: var(--radius-lg); padding: 14px 24px; color: #fff; }
body.presentation-mode .pres-overlay { display: flex; gap: 20px; align-items: center; }
.pres-stat { text-align: center; }
.pres-stat .pv { font-size: 26px; font-weight: 800; }
.pres-stat .pl { font-size: 10px; opacity: .7; }
.pres-exit { position: absolute; top: 10px; right: 10px; z-index: 9501; background: rgba(255,255,255,.2); border: none; color: #fff; border-radius: 50%; width: 32px; height: 32px; font-size: 16px; cursor: pointer; display: none; }
body.presentation-mode .pres-exit { display: flex; align-items: center; justify-content: center; }

/* ═══ EXPORT DROPDOWN ═══ */
.export-dropdown { position: relative; display: inline-flex; }
.export-menu { display: none; position: absolute; top: 100%; right: 0; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 100; min-width: 160px; overflow: hidden; margin-top: 4px; }
.export-menu.show { display: block; animation: alertSlide .2s ease; }
.export-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 14px; border: none; background: none; font-family: "Cairo"; font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer; transition: .15s; }
.export-menu button:hover { background: var(--light-bg); }

/* ═══ GPS TRACKING ═══ */
.gps-tracking-btn.active { background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important; color: #fff !important; border-color: #1d4ed8 !important; animation: gpsPulse 2s ease infinite; }
@keyframes gpsPulse { 0%,100%{box-shadow:0 0 0 0 rgba(59,130,246,.4)} 50%{box-shadow:0 0 0 8px rgba(59,130,246,0)} }

/* ═══ LEAFLET MINIMAP ═══ */
.leaflet-control-minimap { border-radius: var(--radius-md) !important; border: 2px solid var(--border) !important; box-shadow: var(--shadow-md) !important; }

/* ═══ STREET VIEW PANEL ═══ */
.streetview-panel { position: fixed; bottom: 0; left: 0; right: 0; height: 0; background: var(--card-bg); box-shadow: 0 -8px 32px rgba(0,0,0,.2); z-index: 9995; transition: height .4s cubic-bezier(.4,0,.2,1); overflow: hidden; display: flex; flex-direction: column; }
.streetview-panel.open { height: 45vh; }
.sv-header { padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, #1d4ed8, #3b82f6); color: #fff; flex-shrink: 0; }
.sv-header h4 { margin: 0; font-size: 13px; font-weight: 700; }
.sv-close { width: 28px; height: 28px; border-radius: 50%; border: none; background: rgba(255,255,255,.2); color: #fff; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.sv-close:hover { background: rgba(255,255,255,.35); }
.sv-body { flex: 1; position: relative; }
.sv-body iframe { width: 100%; height: 100%; border: none; }
.sv-resize { position: absolute; top: -4px; left: 0; right: 0; height: 8px; cursor: ns-resize; background: transparent; }
.sv-resize:hover { background: rgba(0,0,0,.1); }

/* ═══ PDF EXPORT BUTTON ═══ */
.btn-pdf { background: linear-gradient(135deg, #7c3aed, #8b5cf6); color: #fff; }
.pdf-progress { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--card-bg); border-radius: var(--radius-lg); padding: 30px 40px; text-align: center; z-index: 99999; box-shadow: var(--shadow-lg); border: 1px solid var(--border); display: none; }
.pdf-progress.show { display: block; }
.pdf-progress .pdf-spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pdf-progress .pdf-msg { font-size: 14px; font-weight: 700; color: var(--text); }
.pdf-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99998; display: none; backdrop-filter: blur(3px); }
.pdf-overlay.show { display: block; }

/* ═══ ENHANCED UI — TOOLBAR GRADIENT ACCENT ═══ */
.toolbar-brand .brand-icon { position: relative; overflow: hidden; }
.toolbar-brand .brand-icon::after { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: conic-gradient(from 0deg, transparent, rgba(255,255,255,.3), transparent); animation: iconShimmer 3s linear infinite; }
@keyframes iconShimmer { to { transform: rotate(360deg); } }

/* ═══ ENHANCED UI — STAT CHIPS MICRO-INTERACTIONS ═══ */
.stat-chip { position: relative; overflow: hidden; }
.stat-chip::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.15) 50%, transparent 60%); transform: translateX(-100%); transition: transform .6s; }
.stat-chip:hover::after { transform: translateX(100%); }

/* ═══ ENHANCED UI — TOOLBAR ROW DIVIDERS ═══ */
.toolbar-row2::before { content: ''; display: block; width: 100%; height: 0; }
.toolbar-row3 { position: relative; }

/* ═══ ENHANCED UI — BUTTONS RIPPLE ═══ */
.btn, .ibtn { position: relative; overflow: hidden; }
.btn::after, .ibtn::after { content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0; border-radius: 50%; background: rgba(255,255,255,.3); transform: translate(-50%, -50%); transition: width .4s, height .4s; }
.btn:active::after, .ibtn:active::after { width: 200px; height: 200px; }

/* ═══ ENHANCED UI — POPUP ENTRANCE ═══ */
.leaflet-popup { animation: popupEntrance .25s cubic-bezier(.34,1.56,.64,1); }
@keyframes popupEntrance { from { transform: scale(.8) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ═══ ENHANCED UI — SIDE PANEL SECTIONS STAGGER ═══ */
.panel-section { animation: sectionFade .4s ease both; }
.panel-section:nth-child(1) { animation-delay: .05s; }
.panel-section:nth-child(2) { animation-delay: .1s; }
.panel-section:nth-child(3) { animation-delay: .15s; }
.panel-section:nth-child(4) { animation-delay: .2s; }
.panel-section:nth-child(5) { animation-delay: .25s; }
.panel-section:nth-child(6) { animation-delay: .3s; }
.panel-section:nth-child(7) { animation-delay: .35s; }
@keyframes sectionFade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ═══ ENHANCED UI — STAT CARDS GRADIENT HOVER ═══ */
.stat-card { position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: -80px; right: -80px; width: 160px; height: 160px; border-radius: 50%; opacity: 0; transition: opacity .3s; }
.stat-card.blue::before { background: radial-gradient(circle, rgba(52,152,219,.15), transparent 70%); }
.stat-card.green::before { background: radial-gradient(circle, rgba(16,185,129,.15), transparent 70%); }
.stat-card.red::before { background: radial-gradient(circle, rgba(239,68,68,.15), transparent 70%); }
.stat-card.orange::before { background: radial-gradient(circle, rgba(245,158,11,.15), transparent 70%); }
.stat-card:hover::before { opacity: 1; }

/* ═══ ENHANCED UI — FILTER FOCUS GLOW ═══ */
.filter-wrap select:focus, .filter-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12), 0 2px 8px rgba(99,102,241,.08); }

/* ═══ ENHANCED UI — MAP LOADING SKELETON ═══ */
#map.loading-skeleton { background: linear-gradient(90deg, var(--light-bg) 25%, var(--border-l) 50%, var(--light-bg) 75%); background-size: 200% 100%; animation: skeleton 1.5s infinite; }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ═══ ENHANCED UI — RESULT CARD STAGGER ═══ */
.result-card { animation: cardSlide .3s ease both; }
@keyframes cardSlide { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ═══ ENHANCED UI — TOAST ICONS ═══ */
.toast { display: flex; align-items: center; gap: 8px; }
.toast::before { font-size: 16px; flex-shrink: 0; }
.toast-success::before { content: '✅'; }
.toast-error::before { content: '❌'; }
.toast-info::before { content: 'ℹ️'; }
.toast-warning::before { content: '⚠️'; }

/* ═══ ENHANCED UI — SCROLLBAR GLOBAL ═══ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ═══ RESPONSIVE STREETVIEW ═══ */
@media (max-width: 768px) {
  .streetview-panel.open { height: 35vh; }
}