.map-page { height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: #0f0a0b; }
.map-page > nav { flex: 0 0 auto; }
.map-shell { position: relative; flex: 1 1 auto; min-height: 0; }
#map { position: absolute; inset: 0; background: #0e3a57; }
.leaflet-container { font-family: inherit; }

.map-panel {
  position: absolute; top: 16px; left: 16px; bottom: 16px; width: 330px; z-index: 1000;
  display: flex; flex-direction: column; color: #f1e9ea;
  background: rgba(26, 16, 18, .94); border: 1px solid rgba(229, 56, 59, .25);
  border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); overflow: hidden;
  transition: transform .2s ease;
}
.map-panel.collapsed { transform: translateX(calc(-100% + 44px)); }
.map-panel.collapsed .panel-toggle { transform: rotate(180deg); }

.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px; }
.panel-title { display: flex; align-items: center; gap: 10px; font-family: "Oswald", sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.panel-title .bar { width: 4px; height: 18px; border-radius: 2px; background: var(--sa-red-bright, #e5383b); }
.panel-toggle {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06); color: #fff; font-size: 20px; line-height: 1; transition: transform .2s ease;
}

.mode-badge { margin: 0 14px 10px; padding: 6px 10px; border-radius: 8px; font-size: .8rem; font-weight: 600; text-align: center; }
.mode-live { background: rgba(229, 56, 59, .18); color: #ff8a8c; border: 1px solid rgba(229, 56, 59, .45); }
.mode-public { background: rgba(255, 255, 255, .06); color: #cdbfc1; border: 1px solid rgba(255, 255, 255, .12); }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0 14px; padding: 4px; background: rgba(255,255,255,.05); border-radius: 10px; }
.tab { border: 0; background: transparent; color: #cdbfc1; font-size: .78rem; font-weight: 600; padding: 7px 4px; border-radius: 7px; }
.tab span { opacity: .7; margin-left: 2px; }
.tab.active { background: var(--sa-red, #c1121f); color: #fff; }

.search { padding: 10px 14px; }
.search input {
  width: 100%; padding: 8px 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.35); color: #fff; font-size: .88rem; outline: none;
}
.search input:focus { border-color: var(--sa-red-bright, #e5383b); }

.list { flex: 1 1 auto; overflow-y: auto; padding: 0 8px 8px; }
.list::-webkit-scrollbar { width: 8px; }
.list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.row-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 9px; cursor: pointer; }
.row-item:hover, .row-item.following { background: rgba(255,255,255,.07); }
.row-item.following { outline: 1px solid rgba(229,56,59,.6); }
.dot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(0,0,0,.5); }
.row-main { min-width: 0; flex: 1 1 auto; }
.row-name { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: .75rem; color: #a99a9c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-job { font-size: .68rem; font-weight: 700; padding: 2px 6px; border-radius: 5px; margin-left: 6px; color: #111; vertical-align: 1px; }
.badge-flag { font-size: .66rem; font-weight: 700; padding: 1px 5px; border-radius: 5px; margin-left: 4px; vertical-align: 1px; }
.flag-wanted { background: #e5383b; color: #fff; }
.flag-duty { background: #ff69b4; color: #fff; }
.flag-jailed { background: #6b7280; color: #fff; }
.flag-owned { background: rgba(229,56,59,.25); color: #ff8a8c; }
.flag-sale { background: rgba(67,209,122,.2); color: #6ee7a0; }
.empty { padding: 24px 12px; text-align: center; color: #a99a9c; font-size: .85rem; }
.group-title { margin: 10px 8px 4px; font-size: .7rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #a99a9c; }

.panel-foot { padding: 10px 14px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.styles { display: flex; gap: 6px; margin-bottom: 6px; }
.style-btn { flex: 1; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: #cdbfc1; font-size: .78rem; font-weight: 600; border-radius: 8px; padding: 5px; }
.style-btn.active { border-color: var(--sa-red-bright, #e5383b); color: #fff; background: rgba(229,56,59,.2); }
.updated { font-size: .72rem; color: #8f8083; text-align: center; }

.player-marker { position: relative; }
.player-arrow {
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.8));
}
.player-arrow svg { width: 22px; height: 22px; }
.player-label {
  position: absolute; left: 50%; top: 22px; transform: translateX(-50%); white-space: nowrap;
  font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; pointer-events: none;
}
.place-marker {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; border: 2px solid rgba(0,0,0,.55); box-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #1a1012; color: #f1e9ea; }
.leaflet-popup-content { margin: 10px 14px; font-size: .85rem; }
.leaflet-popup-content b { color: #fff; }
.leaflet-container a.leaflet-popup-close-button { color: #cdbfc1; }

@media (max-width: 640px) {
  .map-panel { top: 10px; left: 10px; bottom: auto; max-height: 60vh; width: calc(100% - 20px); }
  .map-panel.collapsed { transform: translateY(calc(-100% + 46px)); }
}
