.gender-marker {
  background: transparent;
  border: none;
}

.symbol {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  line-height: 28px;
  text-align: center;
  color: #fff;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

.symbol.female {
  background-color: #e91e63; /* pink */
}

.symbol.male {
  background-color: #2196f3; /* blue */
}
.symbol {
  position: relative;
}

.symbol .age {
  font-size: 11px;
  margin-left: 2px;
}
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--card-bg, #f5f5f5);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #ccc;
  z-index: 1000;
}

.bottom-nav a {
  text-decoration: none;
  font-size: 14px;
  color: var(--text-color, #222);
}
:root {
  --bg: #ffffff;
  --text-color: #222;
  --card-bg: #f4f4f4;
}

[data-theme="dark"] {
  --bg: #121212;
  --text-color: #eaeaea;
  --card-bg: #1e1e1e;
}

body {
  background: var(--bg);
  color: var(--text-color);
  padding-bottom: 64px;
}
.theme-toggle {
  position: fixed;
  top: 10px;
  right: 10px;
  border: none;
  background: var(--card-bg);
  padding: 6px 10px;
  border-radius: 20px;
}
.card {
  background: var(--card-bg);
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-bottom: 16px;
}
/* Floating Action Button */
.fab-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
}

.fab-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  font-size: 24px;
  cursor: pointer;
  background: var(--card-bg, #333);
  color: var(--text-color, #fff);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Hidden menu */
.fab-menu {
  position: absolute;
  bottom: 70px;
  right: 0;
  display: none;
  flex-direction: column;
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  overflow: hidden;
}

/* Menu links */
.fab-menu a {
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text-color, #222);
  font-size: 14px;
  white-space: nowrap;
}

.fab-menu a:hover {
  background: rgba(0,0,0,0.05);
}

/* Show menu */
.fab-menu.show {
  display: flex;
}
/* Web-app style floating navigation */
.app-nav {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 3000;
}

.app-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--card-bg);
  color: var(--text-color);
  text-decoration: none;
  border-radius: 18px;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.app-btn span {
  font-size: 11px;
  margin-top: 4px;
}

.app-btn:hover {
  transform: translateY(-2px);
}

.app-btn.danger {
  background: #c0392b;
  color: #fff;
}
/* App-style bottom tab bar */
.tab-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--card-bg);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid rgba(0,0,0,0.1);
  z-index: 4000;
}

/* Individual tabs */
.tab-item {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--text-color);
  font-size: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tab-item span {
  font-size: 11px;
  margin-top: 2px;
}

/* Tap feedback */
.tab-item:active {
  background: rgba(0,0,0,0.05);
}

/* Dark mode border */
[data-theme="dark"] .tab-nav {
  border-top: 1px solid rgba(255,255,255,0.1);
}
.map-page {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 80px); /* bottom nav safe */
}

#map {
  flex: 1;
  width: 100%;
  border-radius: 14px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: var(--card-bg);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

[data-theme="dark"] .app-header {
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
}

.header-icon {
  font-size: 20px;
}
.header-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge {
  background: var(--card-bg);
  color: var(--text-color);
  border-radius: 14px;
  padding: 4px 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.badge strong {
  font-weight: 600;
}

.badge.safety {
  text-decoration: none;
}

/* Low remaining warning */
.badge.low {
  background: #f39c12;
  color: #fff;
}

.badge.zero {
  background: #c0392b;
  color: #fff;
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 2000;
  background: var(--card-bg);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* Dark mode border */
[data-theme="dark"] .app-header {
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

/* LEFT */
.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* CENTER */
.header-center {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

/* RIGHT */
.header-right {
  display: flex;
  align-items: center;
}

/* Badges (already defined, just reinforcing center alignment) */
.header-badges {
  justify-self: center;
}
@media (max-width: 600px) {
  .badge span {
    display: none;
  }

  .badge {
    padding: 4px 6px;
    font-size: 11px;
  }
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-btn {
  padding: 10px 14px;
  background: var(--card-bg);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-color);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  font-weight: 500;
}

.admin-btn:hover {
  background: rgba(0,0,0,0.05);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  border: 1px solid rgba(0,0,0,0.1);
  padding: 8px 10px;
  vertical-align: top;
}

.admin-table th {
  background: rgba(0,0,0,0.05);
  text-align: left;
  font-weight: 600;
}

.admin-table tr:nth-child(even) {
  background: rgba(0,0,0,0.03);
}

.admin-table td {
  word-break: break-word;
  max-width: 320px;
}
.dashboard-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 24px 16px 120px; /* bottom space for nav buttons */
  box-sizing: border-box;
}
.dashboard-content {
  width: 100%;
  max-width: 900px;   /* sweet spot for dashboards */
}
.dashboard-content .card {
  margin-bottom: 20px;
}
@media (max-width: 600px) {
  .dashboard-wrapper {
    padding: 16px 12px 110px;
  }
}
/* ============================= */
/* Mobile friendliness additions */
/* Append at END of CSS file     */
/* ============================= */

@media (max-width: 600px) {

  /* --- Better tap targets --- */
  a,
  button {
    min-height: 44px;
    min-width: 44px;
  }

  /* --- Header compression --- */
  .header-title {
    font-size: 16px;
  }

  .header-center {
    gap: 4px;
  }

  .header-badges {
    gap: 6px;
  }

  /* --- Cards: lighter on mobile --- */
  .card {
    padding: 12px;
    border-radius: 10px;
  }



  /* --- Prevent bottom nav overlap --- */
  body {
    padding-bottom: 80px;
  }

  /* --- Floating Action Button thumb-safe --- */
  .fab-container {
    bottom: 90px;
    right: 16px;
  }

  /* --- Admin tables scroll instead of breaking layout --- */
  .admin-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* --- Bottom tabs & app buttons slightly bigger --- */
  .tab-item,
  .app-btn {
    font-size: 22px;
  }
}

/* --- Disable hover effects on touch devices --- */
@media (hover: none) {
  .app-btn:hover,
  .admin-btn:hover {
    transform: none;
    background: inherit;
  }
}
/* ============================= */
/* MOBILE FIXES AFTER LOGIN     */
/* ============================= */

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* --- Dashboard stats --- */
@media (max-width: 768px) {
  .dashboard-stats {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
  }

  .dashboard-stats::-webkit-scrollbar {
    display: none;
  }

  .dashboard-stats .stat-card {
    min-width: 180px;
    flex-shrink: 0;
  }
}

/* --- Bottom navigation --- */
@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    justify-content: space-around;
    padding: 10px 8px;
    gap: 0;
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav .nav-btn {
    flex: 1;
    min-width: 0;
    padding: 8px 4px;
    font-size: 12px;
  }

  .bottom-nav .nav-btn span {
    display: block;
    font-size: 11px;
    margin-top: 2px;
  }
}
/* ============================= */
/* Mobile: Icon-only header row */
/* ============================= */

@media (max-width: 768px) {

.header-badges {
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
  padding: 4px 0;
}

/* Hide scrollbar (nice touch) */
.header-badges::-webkit-scrollbar {
  display: none;
}


  .header-badges .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 10px;
    text-align: center;
  }

  /* Hide text but keep emoji */
  .header-badges .badge b {
    font-size: 0; /* hides text */
  }

  .header-badges .badge b::first-letter {
    font-size: 20px; /* emoji comes back */
  }

  /* Count styling */
  .header-badges .badge strong {
    font-size: 14px;
    margin-left: 4px;
  }
}
/* ============================= */
/* Mobile: Icon-only page title */
/* ============================= */

@media (max-width: 768px) {

  .page-title {
    text-align: center;
    font-size: 0; /* hide text */
    margin: 12px 0;
  }

  .page-title::first-letter {
    font-size: 26px; /* show emoji */
  }
}
.gender-marker {
  background: none !important;
  border: none !important;
}

/* Marker ring */
.gender-marker .symbol {
  width: 36px;
  height: 36px;
  border-radius: 50%;

  background: transparent;        /* ✅ TRANSPARENT CENTER */
  border: 3px solid currentColor; /* ring only */

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 20px;
  line-height: 1;
  color: #000;

  font-family: system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", "Apple Color Emoji",
               "Segoe UI Emoji", "Noto Color Emoji";

  position: relative;
}

/* Emoji visible by default */
.gender-marker .emoji {
  display: inline;
}

/* SVG hidden by default */
.gender-marker .svg-fallback {
  display: none;
}

/* SVG styling */
.gender-marker .svg-fallback svg {
  width: 18px;
  height: 18px;
}

/* Age badge */
.gender-marker .age {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: #000;
  color: #fff;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 8px;
  line-height: 1;
}

/* Color themes */
.symbol.male {
  color: #3b82f6;
}
.symbol.female {
  color: #ec4899;
}
.symbol.trans {
  color: #a855f7;
}
.symbol.other {
  color: #6b7280;
}
/* Emoji fallback for older browsers */
@supports not (font-family: "Apple Color Emoji") {
  .gender-marker .emoji {
    display: none;
  }
  .gender-marker .svg-fallback {
    display: inline;
  }
}
.pinged {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,165,0,0.7); }
  70% { box-shadow: 0 0 0 10px rgba(255,165,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,165,0,0); }
}
.symbol.inactive {
  opacity: 0.5;
  filter: grayscale(1);
}
/* 🔔 Marker ping badge */
.symbol {
  position: relative;
}

.ping-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #f59e0b;
  color: #000;
  border-radius: 50%;
  font-size: 12px;
  padding: 2px;
  line-height: 1;
}

/* 🔔 Cluster styling */
.marker-cluster-custom {
  background: transparent;
}

.cluster-icon {
  position: relative;
  width: 40px;
  height: 40px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.cluster-ping {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #f59e0b;
  color: #000;
  border-radius: 50%;
  font-size: 12px;
  padding: 2px;
}
.box {
  display: flex;
  justify-content: center;
}
/* ============================= */
/* 📱 DASHBOARD MOBILE STACK FIX */
/* ============================= */

/* 📱 Stack dashboard cards nicely on mobile */
@media (max-width: 768px) {

  .dashboard-wrapper {
    display: block;
    padding: 12px;
  }

  .dashboard-content {
    width: 100%;
    max-width: 100%;
  }

  .dashboard-content .card,
  .dashboard-wrapper .card {
    width: 100%;
    margin-bottom: 16px;
  }

  .box {
    width: 100%;
  }
}
/* ============================= */
/* Header badges mobile layout   */
/* ============================= */

.header-badges-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Desktop = keep inline */
@media (min-width: 769px) {
  .header-badges-wrapper {
    grid-column: 2;
    justify-content: center;
  }

  .header-badges {
    display: flex;
    gap: 10px;
    align-items: center;
  }
}
/* Make badge links feel clickable */
.header-badges a.badge {
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

/* Hover effect (desktop) */
.header-badges a.badge:hover {
  background: #2563eb;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

/* Active press effect (mobile touch) */
.header-badges a.badge:active {
  transform: scale(0.96);
  background: #1d4ed8;
  color: #fff;
}

/* Optional: subtle ripple-style highlight */
.header-badges a.badge::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity 0.2s;
}

.header-badges a.badge:active::after {
  opacity: 1;
}
/* Non-clickable badges */
.header-badges span.badge {
  cursor: default;
}
[data-theme="dark"] .header-badges a.badge:hover {
  background: #3b82f6;
}

[data-theme="dark"] .header-badges a.badge:active {
  background: #2563eb;
}

/* 📱 Mobile = move below header */
@media (max-width: 768px) {

  .app-header {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .header-left {
    grid-column: 1 / 2;
  }

  .header-right {
    grid-column: 2 / 3;
    justify-self: end;
  }

  /* Badges become full-width row */
  .header-badges-wrapper {
    grid-column: 1 / 3;
    grid-row: 2;
    margin-top: 8px;
  }

  .header-badges {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 6px 4px;
  }

  /* Hide scrollbar */
  .header-badges::-webkit-scrollbar {
    display: none;
  }

  .badge {
    flex: 0 0 auto;
    font-size: 12px;
    padding: 6px 8px;
    white-space: nowrap;
  }
}
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 16px;
  z-index: 9999;
  display: flex;
  justify-content: center;
}

.cookie-box {
  max-width: 520px;
  text-align: center;
}

.cookie-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.cookie-actions button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.cookie-actions button:first-child {
  background: #22c55e;
  color: white;
}

.cookie-actions button:last-child {
  background: #ef4444;
  color: white;
}
.image-placeholder {
  margin-top: 14px;
  padding: 18px;
  border: 2px dashed rgba(0,0,0,0.2);
  border-radius: 12px;
  background: rgba(0,0,0,0.02);
}
[data-theme="dark"] .image-placeholder {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
}
.badge-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
}

.badge-popup.hidden {
  display: none;
}

.badge-popup-content {
  background: var(--card-bg);
  color: var(--text-color);
  padding: 20px;
  border-radius: 14px;
  width: 85%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: popupFade 0.2s ease-out;
}

.badge-popup-content h4 {
  margin-bottom: 8px;
}

.badge-popup-content button {
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  background: #6d4aff;
  color: #fff;
  font-weight: 600;
}

@keyframes popupFade {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

