/* Copperbelt map — Magarini Mining brand */
:root {
  --brand-blue: #2c5282;
  --brand-blue-dark: #1a365d;
  --brand-orange: #dd6b20;
  --brand-green: #38a169;
  --brand-red: #e53e3e;
  --brand-purple: #9f7aea;
  --bg: #fafafa;
  --panel: #ffffff;
  --ink: #1a202c;
  --ink-soft: #4a5568;
  --line: #e2e8f0;
  --sidebar-w: 340px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  background: var(--brand-blue);
  color: #fff;
  padding: 12px 24px;
  border-bottom: 3px solid var(--brand-blue-dark);
}
header h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: 0.2px; }
header .sub { margin: 2px 0 0; font-size: 12px; opacity: 0.85; }

main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  min-height: 0;
}

#map { width: 100%; height: 100%; background: #c8d4e3; }

#sidebar {
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 18px 18px 14px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.45;
}

#sidebar h2 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
}

#filters label, .status-only {
  display: block;
  padding: 5px 0;
  cursor: pointer;
}
#filters input { margin-right: 8px; vertical-align: middle; }
.status-only { margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }

#legend { margin-top: 22px; }
#legend .row {
  display: flex;
  align-items: center;
  padding: 4px 0;
  color: var(--ink-soft);
}
.swatch {
  display: inline-block;
  width: 16px;
  height: 12px;
  margin-right: 10px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 2px;
}
.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
}

#stats { margin-top: 22px; }
#stats-body {
  font-size: 12px;
  color: var(--ink-soft);
}
#stats-body .stat {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px dotted var(--line);
}
#stats-body .stat strong { color: var(--ink); }

.footer {
  font-size: 10.5px;
  color: var(--ink-soft);
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  line-height: 1.6;
}
.credit {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--brand-blue);
  letter-spacing: 0.3px;
  text-align: center;
  padding: 8px 0;
  border-top: 1px dashed var(--line);
}
.credit strong {
  color: var(--brand-blue-dark);
  letter-spacing: 0.5px;
}

/* Leaflet popup */
.leaflet-popup-content-wrapper {
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.leaflet-popup-content {
  font-family: "Segoe UI", -apple-system, sans-serif;
  font-size: 12.5px;
  line-height: 1.5;
  margin: 12px 14px;
  min-width: 240px;
}
.popup h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--brand-blue);
  border-bottom: 2px solid var(--brand-blue);
  padding-bottom: 4px;
}
.popup table { width: 100%; border-collapse: collapse; }
.popup td {
  padding: 2px 4px;
  vertical-align: top;
}
.popup td:first-child {
  color: var(--ink-soft);
  font-size: 11px;
  white-space: nowrap;
  width: 80px;
}
.popup td:last-child { font-weight: 500; }
.popup .badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.badge.active   { background: #c6f6d5; color: #22543d; }
.badge.inactive { background: #fed7d7; color: #742a2a; }
.badge.maint    { background: #feebc8; color: #7b341e; }
