/* Tunnel Watch map dashboard. Ported from the approved v3 mockup; palette comes from shared/style.css. */
body { overflow-x: hidden; }
header { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
header h1 { font-size: 18px; margin: 0 12px 0 0; }
.kpi { border-radius: 8px; padding: 6px 14px; font-weight: 700; font-size: 13px; transition: opacity .2s; }
.kpi b { font-size: 20px; margin-right: 6px; }
.k-r { background: #fde4e4; color: #9b1414; }
.k-a { background: #fff1d6; color: #8a5a00; }
.k-g { background: #e3f6e8; color: #11612b; }
.upd { margin-left: auto; color: var(--muted); font-size: 12px; }
.signin { min-height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; }
.stale-banner { width: 100%; background: var(--red); color: #fff; font-weight: 700; padding: 10px 16px; }
.auth-banner { width: 100%; background: #fff1d6; color: #5c3b00; font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line); }
main { display: flex; height: calc(100vh - 58px); }
#map, #map.leaflet-container { flex: 1; background: #d5e6f2; min-height: 200px; } /* water tone beats Leaflet's gray; tile edges read as ocean */
aside { width: 340px; background: var(--panel); border-left: 1px solid var(--line); overflow: auto; padding: 12px; }
aside h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 8px; }
aside h2.gap { margin-top: 18px; }
.item { border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; border-left: 5px solid; }
.item.r { background: #fde4e4; border-color: var(--red); }
.item.a { background: #fff1d6; border-color: var(--amber); }
.item .n { font-weight: 700; }
.item .d { font-size: 12px; color: #333; margin-top: 3px; }
.hist { font-size: 12px; color: var(--muted); padding: 5px 0; border-bottom: 1px solid var(--line); }
.empty { font-size: 12px; color: var(--muted); }
.pin { border-radius: 50%; background: var(--red); border: 2px solid #fff; box-shadow: 0 0 0 0 rgba(214, 40, 40, .6); animation: p 1.6s infinite; }
.pin.a { background: var(--amber); box-shadow: 0 0 0 0 rgba(230, 149, 0, .6); }
.pin.d { background: #2563eb; box-shadow: 0 0 0 0 rgba(37, 99, 235, .6); animation-name: pd; }
.pin-wrap { position: relative; }
.pin-label { position: absolute; left: 22px; top: -1px; font-size: 10px; font-weight: 800; color: #1d4ed8; background: #fff; border: 1px solid #1d4ed8; border-radius: 3px; padding: 0 3px; line-height: 14px; }
@keyframes p { 70% { box-shadow: 0 0 0 14px rgba(214, 40, 40, 0); } 100% { box-shadow: 0 0 0 0 rgba(214, 40, 40, 0); } }
@keyframes pd { 70% { box-shadow: 0 0 0 14px rgba(37, 99, 235, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); } }
.is-stale .pin-running { opacity: .3; }
.is-stale #kgbox { opacity: .4; }
.pop-state { font-weight: 700; }
.pop-down { color: #d62828; }
.pop-overdue { color: #8a5a00; }
.pop-drill { color: #1d4ed8; }
.pop-running { color: #11612b; }
@media (max-width: 760px) {
  main { flex-direction: column; height: auto; }
  #map { flex: none; height: 60vh; }
  aside { width: auto; border-left: 0; }
  .upd { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .pin { animation: none; } }
