/* ═══════════════════════════════════════════════════════
   SES Map Frontend CSS v2.1
   ═══════════════════════════════════════════════════════ */

.ses-map-wrapper {
  display: flex; width: 100%;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden; border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 24px rgba(0,0,0,.10);
  background: #f8fafc;
}
.ses-map-wrapper * { box-sizing: border-box; margin: 0; padding: 0; }

/* LEFT PANEL */
.ses-left-panel {
  width: 340px; flex-shrink: 0; background: #0f172a;
  display: flex; flex-direction: column; overflow: hidden;
  border-right: 1px solid #1e293b;
}
.ses-panel-head { padding: 14px 14px 10px; background: #0f172a; border-bottom: 1px solid #1e293b; }

.ses-search-wrap { position: relative; }
.ses-search-input {
  width: 100%; background: #1e293b; border: 1.5px solid #334155;
  color: #f1f5f9; font-family: inherit; font-size: 15px;
  padding: 10px 14px 10px 40px; border-radius: 8px; outline: none; transition: border-color .2s;
}
.ses-search-input::placeholder { color: #64748b; }
.ses-search-input:focus { border-color: #f97316; }
.ses-search-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: #64748b; pointer-events: none;
}

.ses-filter-row { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.ses-fbtn {
  background: #1e293b; border: 1px solid #334155; color: #94a3b8;
  font-family: inherit; font-size: 13px; font-weight: 500; padding: 5px 12px;
  border-radius: 99px; cursor: pointer; transition: all .18s; white-space: nowrap; line-height: 1.4;
}
.ses-fbtn:hover, .ses-fbtn.ses-active {
  background: rgba(249,115,22,.15); border-color: #f97316; color: #fb923c;
}

.ses-panel-count {
  padding: 8px 16px; font-size: 13px; color: #64748b;
  background: #0f172a; border-bottom: 1px solid #1e293b;
}
.ses-panel-count span { color: #fb923c; font-weight: 700; }

.ses-school-list { flex: 1; overflow-y: auto; padding: 6px 8px; background: #0f172a; }
.ses-school-list::-webkit-scrollbar { width: 4px; }
.ses-school-list::-webkit-scrollbar-thumb { background: #f97316; border-radius: 9px; }
.ses-loading-msg { padding: 24px 16px; text-align: center; color: #64748b; font-size: 14px; }

.ses-school-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px;
  border-radius: 8px; cursor: pointer; transition: background .15s;
  border: 1px solid transparent; margin-bottom: 2px;
}
.ses-school-item:hover { background: #1e293b; border-color: #334155; }
.ses-school-item.ses-item-active { background: rgba(249,115,22,.1); border-color: rgba(249,115,22,.35); }

.ses-si-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.ses-si-body { flex: 1; min-width: 0; }
.ses-si-name { font-weight: 600; font-size: 14px; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.ses-si-meta { font-size: 12px; color: #64748b; margin-top: 3px; line-height: 1.4; }
.ses-si-badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px; float: right; flex-shrink: 0; margin-left: 6px; line-height: 1.5; }
.ses-bp { background: rgba(109,40,217,.25); color: #c4b5fd; }
.ses-bg { background: rgba(180,83,9,.25);   color: #fcd34d; }
.ses-bs { background: rgba(71,85,105,.25);  color: #94a3b8; }

.ses-panel-footer { padding: 12px 14px; background: #0a1628; border-top: 1px solid #1e293b; }
.ses-missing-btn {
  width: 100%; background: rgba(249,115,22,.1); border: 1.5px dashed rgba(249,115,22,.4);
  color: #fb923c; font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 10px 14px; border-radius: 8px; cursor: pointer; transition: background .2s; text-align: center; line-height: 1.4;
}
.ses-missing-btn:hover { background: rgba(249,115,22,.2); }

/* MAP AREA */
.ses-map-area { flex: 1; position: relative; overflow: hidden; }

#ses-map { width: 100% !important; height: 100% !important; z-index: 1; }

/* CRITICAL: NO filter on tiles - show standard OSM light map */
#ses-map .leaflet-tile-pane { filter: none !important; opacity: 1 !important; }
.leaflet-tile { filter: none !important; opacity: 1 !important; }

/* STATS BAR */
.ses-stats-bar {
  position: absolute; top: 12px; left: 12px; z-index: 500;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.95); border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 7px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); flex-wrap: wrap; font-family: inherit;
}
.ses-stat { font-size: 13px; color: #475569; white-space: nowrap; }
.ses-stat strong { color: #ea580c; font-weight: 700; }
.ses-live-pill {
  display: flex; align-items: center; gap: 5px;
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.25);
  color: #16a34a; padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.ses-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e; animation: ses-blink 2s infinite;
}
@keyframes ses-blink { 0%,100%{opacity:1;} 50%{opacity:.2;} }

/* LEGEND */
.ses-legend {
  position: absolute; bottom: 20px; right: 16px; z-index: 500;
  background: rgba(255,255,255,.95); border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); font-family: inherit;
}
.ses-legend-title { font-size: 11px; font-weight: 700; color: #94a3b8; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 8px; }
.ses-legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #1e293b; margin-bottom: 5px; font-weight: 500; }
.ses-legend-row:last-child { margin-bottom: 0; }
.ses-ld { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* POPUP */
.ses-popup .leaflet-popup-content-wrapper {
  background: #0f172a; border: 1px solid #1e293b; border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5); padding: 0; overflow: hidden;
}
.ses-popup .leaflet-popup-tip { background: #0f172a; }
.ses-popup .leaflet-popup-content { margin: 0; min-width: 270px; color: #f1f5f9; font-family: 'DM Sans', sans-serif; }
.ses-popup-bar { padding: 12px 14px 10px; border-bottom: 1px solid #1e293b; }
.ses-popup-name { font-size: 15px; font-weight: 700; color: #f1f5f9; margin-bottom: 4px; line-height: 1.3; }
.ses-popup-loc  { font-size: 12px; color: #64748b; line-height: 1.4; }
.ses-popup-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; float: right; margin-left: 8px; margin-top: 2px; }
.ses-popup-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: #1e293b; }
.ses-pstat { background: #0f172a; padding: 10px 8px; text-align: center; }
.ses-pstat-v { font-size: 18px; font-weight: 800; color: #fb923c; line-height: 1; display: block; }
.ses-pstat-l { font-size: 11px; color: #64748b; margin-top: 3px; display: block; }
.ses-popup-actions { padding: 10px 14px; display: flex; gap: 8px; }
.ses-pa-primary {
  flex: 1; background: #ea580c; color: #fff; border: none; font-family: inherit;
  font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 6px; cursor: pointer; transition: opacity .2s;
}
.ses-pa-primary:hover { opacity: .85; }
.ses-pa-secondary {
  background: #1e293b; border: 1px solid #334155; color: #94a3b8;
  font-family: inherit; font-size: 13px; padding: 8px 12px; border-radius: 6px; cursor: pointer; transition: all .2s;
}
.ses-pa-secondary:hover { color: #fb923c; border-color: rgba(249,115,22,.4); }

/* MARKERS */
.ses-marker {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.75);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.4);
  cursor: pointer; transition: transform .15s;
}
.ses-marker:hover { transform: scale(1.2); }
.ses-marker-platinum { background: #6d28d9; }
.ses-marker-gold     { background: #b45309; }
.ses-marker-silver   { background: #475569; }

/* MODAL */
.ses-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 999999;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.ses-modal-overlay.ses-open { opacity: 1; pointer-events: all; }
.ses-modal-box {
  background: #0f172a; border: 1px solid #1e293b; border-radius: 14px;
  padding: 28px; width: 90%; max-width: 480px; position: relative;
  color: #f1f5f9; font-family: 'DM Sans', sans-serif;
}
.ses-modal-close {
  position: absolute; top: 14px; right: 14px; background: #1e293b;
  border: 1px solid #334155; color: #94a3b8; width: 30px; height: 30px;
  border-radius: 50%; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.ses-modal-close:hover { color: #f1f5f9; }
.ses-modal-box h2 { font-size: 20px; font-weight: 800; color: #f1f5f9; margin-bottom: 6px; }
.ses-modal-box p  { font-size: 14px; color: #94a3b8; margin-bottom: 18px; line-height: 1.6; }
.ses-mform  { display: flex; flex-direction: column; gap: 10px; }
.ses-minput {
  background: #1e293b; border: 1.5px solid #334155; color: #f1f5f9;
  font-family: inherit; font-size: 15px; padding: 11px 14px;
  border-radius: 8px; outline: none; width: 100%; transition: border-color .2s;
}
.ses-minput::placeholder { color: #475569; }
.ses-minput:focus { border-color: rgba(249,115,22,.5); }
.ses-mrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ses-msubmit {
  background: #ea580c; color: #fff; border: none; font-family: inherit;
  font-weight: 700; font-size: 15px; padding: 12px; border-radius: 8px; cursor: pointer; width: 100%;
}
.ses-msubmit:hover { opacity: .88; }
.ses-mnote { font-size: 12px; color: #64748b; text-align: center; }

/* TOAST */
.ses-toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: #16a34a; color: #fff; padding: 11px 22px;
  border-radius: 8px; font-size: 14px; font-weight: 600;
  z-index: 9999999; transition: transform .3s; white-space: nowrap;
  font-family: 'DM Sans', sans-serif; pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.ses-toast.ses-toast-show { transform: translateX(-50%) translateY(0); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .ses-map-wrapper { flex-direction: column-reverse; }
  .ses-left-panel { width: 100%; height: 44%; }
  .ses-map-area   { height: 56%; }
  .ses-stats-bar  { display: none; }
}
