/* maps.css — styles for the Maps module (R/modules/maps.R). App-wide tokens live in base.css. */

.ik-maps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 0;
}

/* Controls row: device · measure · group. */
.ik-maps-controls {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.ik-maps-controls .form-group,
.ik-maps-controls .shiny-input-container { margin-bottom: 0; }
.ik-maps-controls .shiny-input-container { min-width: 12rem; }
/* Only an OPEN selectize dropdown is elevated above the leaflet (panes ~400, controls ~1000) — NOT
   the whole toolbar, which would otherwise create a stacking context that blocks the navbar menus. */
.ik-maps-controls .selectize-control.single .selectize-dropdown,
.ik-maps-controls .selectize-control.multi  .selectize-dropdown { z-index: 1050; }

/* The map frame — theme-matched backdrop (no hardcoded grey), app font. */
.ik-maps .leaflet-container {
  border: 1px solid var(--bs-border-color, #ddd);
  border-radius: 0.5rem;
  background: var(--bs-tertiary-bg, var(--bs-body-bg, #ececec));
  font-family: inherit;
}

/* Themed chrome: the legend and layers control read as cards in the active theme,
   instead of the default white boxes that look pasted-on in dark mode. */
.ik-maps .leaflet-control-layers,
.ik-maps .leaflet-bar,
.ik-maps .info.legend {
  background: var(--bs-body-bg, #fff);
  color: var(--bs-body-color, #222);
  border: 1px solid var(--bs-border-color, #ccc);
  border-radius: 0.4rem;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
}
.ik-maps .info.legend {
  padding: 0.5rem 0.65rem;
  line-height: 1.45;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.ik-maps .info.legend small { opacity: 0.75; }
.ik-maps .leaflet-control-layers-expanded { padding: 0.5rem 0.75rem; }
.ik-maps .leaflet-control-layers label { margin-bottom: 0.15rem; font-weight: 400; }

/* Coordless-trap notice — surfaces data that can't be mapped, so totals reconcile. */
.ik-maps-unplaced {
  align-self: flex-start;
  font-size: 0.85rem;
  color: var(--bs-warning-text-emphasis, #8a6d3b);
  background: var(--bs-warning-bg-subtle, #fff3cd);
  border: 1px solid var(--bs-warning-border-subtle, #ffe69c);
  border-radius: 0.4rem;
  padding: 0.35rem 0.6rem;
}

/* Records / servicing table. */
/* Reserve a stable height for the records area so drilling to a sparse location (few rows) doesn't
   shrink the page. Without this, the page can get shorter than the marker-click scroll target, and
   the browser clamps the scroll back up — the "jumps back up" bounce (most visible on a slow CPU,
   where the filtered table re-renders after the scroll has already settled). */
.ik-maps-records { margin-top: 0.5rem; min-height: 30rem; }
.ik-maps-records-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.ik-maps-records-header small { color: var(--bs-secondary-color, #666); }

/* Hint text inside the priority/timing drill modal. */
.ik-maps-hint { color: var(--bs-secondary-color, #6c757d); }

/* Measure control wrapper + inline hint. */
.ik-maps-measure { display: flex; flex-direction: column; }
.ik-maps-hint { color: var(--bs-secondary-color, #6c757d); font-weight: 400; font-size: 0.85em; }
