/* ================================================================
 * Internet Rural — panel del backoffice (layout map-first)
 * Mapa a pantalla completa con chrome flotante tipo glass.
 * ================================================================ */

:root {
  --ru-bg: #0B0D10;
  --ru-bg-2: #111418;
  --ru-panel: #191D23;
  --ru-border: rgba(255, 255, 255, 0.08);
  --ru-border-strong: rgba(255, 255, 255, 0.16);
  --ru-text: #F4F4F2;
  --ru-text-dim: rgba(244, 244, 242, 0.72);
  --ru-text-muted: rgba(244, 244, 242, 0.45);
  --ru-accent: #E4B900;
  --ru-accent-glow: rgba(228, 185, 0, 0.35);
  /* Paleta de niveles unificada con SignalScoring (frontend) y
     SignalHealthEvaluator (backend): mismo verde/naranja/rojo en TODA la app. */
  --ru-success: #16A34A;
  --ru-warning: #F97316;
  --ru-danger: #DC2626;
  --ru-info: #6FB1FF;
  --ru-aire: #6A9DE0;
  --ru-finetwork: #E4476B;
  --ru-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  --ru-shadow-lift: 0 18px 50px rgba(0, 0, 0, 0.5);
  --ru-glass: rgba(11, 13, 16, 0.62);
  --ru-glass-strong: rgba(11, 13, 16, 0.86);
}

/* ================================================================
 * Rural section: two layouts depending on active view
 *   - map view: full-bleed, escapes admin-main padding
 *   - admin views (installed / stock / manual): stay inside admin-main,
 *     use white bg matching the rest of the backoffice
 * ================================================================ */
.rural-section[data-rural-active="map"] {
  margin: -24px -32px -48px;
}
@media (max-width: 768px) {
  .rural-section[data-rural-active="map"] { margin: -16px; }
}

.rural-app {
  position: relative;
  height: calc(100vh - 56px);
  min-height: 640px;
  background: #05070A;
  overflow: hidden;
  isolation: isolate;
}
.rural-app[hidden] { display: none; }

/* ================================================================
 * Map canvas (full bleed inside .rural-app)
 * ================================================================ */
.rural-app__map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.rural-app__map canvas { outline: none; }
.rural-app__map .maplibregl-ctrl-attrib {
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
}
.rural-app__map .maplibregl-ctrl-attrib a { color: rgba(255, 255, 255, 0.85); }
.rural-app__map .maplibregl-ctrl-group {
  background: rgba(20, 22, 27, 0.92);
  border: 1px solid var(--ru-border);
  box-shadow: var(--ru-shadow-soft);
}
.rural-app__map .maplibregl-ctrl-group button {
  background: transparent;
  filter: invert(1) brightness(1.1);
}
.rural-app__map .maplibregl-ctrl-scale {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  font-size: 10px;
}

/* ================================================================
 * Refresh indicator — barra indeterminada arriba del panel rural
 * mientras loadAllData() esta en curso. Sutil: 2px de alto, color
 * de marca, animacion lineal. NO bloquea interaccion ni desplaza
 * contenido (position:absolute). Aparece tanto en sub-tabs (al
 * stale-while-revalidate) como en la primera carga.
 * ================================================================ */
[data-admin-panel="rural"] {
  position: relative;
}
[data-admin-panel="rural"].is-refreshing::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent, #E4B900) 50%,
    transparent 100%
  );
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: ruralRefreshBar 1.2s linear infinite;
  z-index: 20;
  pointer-events: none;
}
@keyframes ruralRefreshBar {
  0%   { background-position: -50% 0; }
  100% { background-position: 150% 0; }
}

/* ================================================================
 * Topbar (floating glass chrome)
 * ================================================================ */
.rural-app__topbar {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--ru-glass);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--ru-border);
  border-radius: 14px;
}
.rural-app__topbar--right {
  left: auto;
  width: auto;
  padding: 6px 8px;
  box-shadow: var(--ru-shadow-lift);
  color: var(--ru-text);
  pointer-events: auto;
}
.rural-app__topbar--left {
  right: auto;
  width: auto;
  max-width: 380px;
  padding: 6px 8px;
  box-shadow: var(--ru-shadow-lift);
  color: var(--ru-text);
  pointer-events: auto;
}

/* Buscador de direccion (top-left del mapa) */
.rural-search {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 280px;
}
.rural-search__icon {
  flex: 0 0 auto;
  color: var(--ru-text-dim);
}
.rural-search__input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--ru-text);
  font-size: 14px;
  padding: 6px 4px;
  font-family: inherit;
}
.rural-search__input::placeholder {
  color: var(--ru-text-dim);
}
.rural-search__input::-webkit-search-cancel-button {
  display: none;
}
.rural-search__clear {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  color: var(--ru-text-dim);
  font-size: 20px;
  line-height: 1;
  padding: 2px 8px;
  cursor: pointer;
  border-radius: 6px;
}
.rural-search__clear:hover {
  background: rgba(255, 255, 255, 0.10);
  color: var(--ru-text);
}

/* Modal detalle adjunto — 2 columnas cuando es imagen (preview izda, form dcha).
   Si no es imagen, cae a una columna porque el preview es un placeholder pequeño. */
.rural-att-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rural-att-detail--wide {
  flex-direction: row;
  align-items: stretch;
}
.rural-att-detail__preview {
  flex: 1 1 60%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rural-att-detail__form {
  flex: 1 1 40%;
  min-width: 280px;
  max-width: 420px;
  display: flex;
  flex-direction: column;
}
@media (max-width: 800px) {
  .rural-att-detail--wide {
    flex-direction: column;
  }
  .rural-att-detail__form {
    max-width: none;
  }
}

/* Marker del resultado de busqueda — azul con anillo para distinguir
   de los pines amarillos de site y rojos de device. */
.rural-marker-search {
  width: 22px;
  height: 22px;
  background: #1e88e5;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #1e88e5, 0 4px 10px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.rural-nav {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--ru-border);
  border-radius: 12px;
}
.rural-pill {
  background: transparent;
  border: none;
  color: var(--ru-text-dim);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 7px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.rural-pill:hover { color: var(--ru-text); background: rgba(255, 255, 255, 0.05); }
.rural-pill.is-active {
  background: var(--ru-accent);
  color: #0B0D10;
  box-shadow: 0 2px 12px rgba(228, 185, 0, 0.32);
}

/* ================================================================
 * Bottombar (layer toggles + action buttons)
 * ================================================================ */
.rural-app__bottombar {
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  background: var(--ru-glass);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--ru-border);
  border-radius: 14px;
  box-shadow: var(--ru-shadow-soft);
  pointer-events: auto;
}
.rural-layers {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.rural-layer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ru-text-dim);
  cursor: pointer;
  user-select: none;
}
.rural-layer input[type="checkbox"] {
  accent-color: var(--ru-accent);
  width: 16px; height: 16px;
}
.rural-layer:has(input:checked) { color: var(--ru-text); }

.rural-acts {
  display: flex;
  gap: 6px;
  align-items: center;
}
.rural-ghostbtn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ru-border);
  color: var(--ru-text);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.rural-ghostbtn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--ru-border-strong);
}
.rural-ghostbtn:active { transform: translateY(1px); }
.rural-ghostbtn--accent {
  background: var(--ru-accent);
  color: #0B0D10;
  border-color: transparent;
}
.rural-ghostbtn--accent:hover {
  background: #f0c319;
  border-color: transparent;
}

/* ================================================================
 * Style switcher (right side of topbar, segmented control)
 * ================================================================ */
.rural-styleswitch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ru-border);
  border-radius: 10px;
  pointer-events: auto;
}
.rural-styleswitch__btn {
  background: transparent;
  border: 0;
  color: var(--ru-text-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.rural-styleswitch__btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ru-text);
}
.rural-styleswitch__btn.is-active {
  background: var(--ru-accent);
  color: #0B0D10;
  box-shadow: 0 1px 6px rgba(228, 185, 0, 0.28);
}

/* ================================================================
 * Proximity cells badge (top-center, floating indicator)
 * ================================================================ */
.rural-cells-badge {
  position: absolute;
  top: auto;
  bottom: 82px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--ru-glass-strong);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--ru-border);
  border-radius: 999px;
  color: var(--ru-text);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--ru-shadow-soft);
  pointer-events: none;
  animation: ruralBadgeIn .24s ease-out;
}
.rural-cells-badge strong {
  color: var(--ru-accent);
  font-weight: 700;
}
.rural-cells-badge__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ru-accent);
  box-shadow: 0 0 8px var(--ru-accent-glow);
}
@keyframes ruralBadgeIn {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ================================================================
 * Legend (bottom-left floating) — colores de antenas por operador
 * y explicacion del tamano (RSRP medido) / opacidad (sin medicion).
 * ================================================================ */
.rural-legend {
  position: absolute;
  left: 12px;
  bottom: 82px;
  z-index: 11;
  padding: 10px 12px;
  background: var(--ru-glass-strong);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--ru-border);
  border-radius: 12px;
  color: var(--ru-text);
  font-size: 12px;
  box-shadow: var(--ru-shadow-soft);
  min-width: 180px;
}
.rural-legend__title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 12.5px;
}
.rural-legend__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  line-height: 1.35;
}
.rural-legend__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.rural-legend__dot--lg { width: 16px; height: 16px; }
.rural-legend__dot--faded { opacity: 0.55; outline: 1px dashed rgba(255,255,255,0.45); }
.rural-legend__dot--dashed { opacity: 0.6; outline: 2px dashed #E60000; outline-offset: 1px; }
.rural-legend__dot--movistar { background: #019DF4; }
.rural-legend__dot--vodafone { background: #E60000; }
.rural-legend__dot--orange   { background: #FF7900; }
.rural-legend__dot--other    { background: #9AA0A6; }
.rural-legend__sep {
  height: 1px;
  background: var(--ru-border);
  margin: 6px 0;
}

/* ================================================================
 * Coverage prediction panel (bottom-right floating)
 * Aparece al escanear antenas: predice cobertura por operador host
 * (Movistar / Vodafone / Orange) basada en torres conocidas cercanas.
 * ================================================================ */
.rural-coverage {
  position: absolute;
  right: 12px;
  bottom: 82px;
  z-index: 11;
  width: 260px;
  padding: 12px 14px;
  background: var(--ru-glass-strong);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--ru-border);
  border-radius: 12px;
  color: var(--ru-text);
  font-size: 12.5px;
  box-shadow: var(--ru-shadow-soft);
  animation: ruralBadgeIn .24s ease-out;
}
.rural-coverage__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ru-muted, #8a8f99);
  margin: 0 0 8px 0;
}
.rural-coverage__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.rural-coverage__row:first-of-type { border-top: 0; }
.rural-coverage__op {
  flex: 0 0 64px;
  font-weight: 600;
}
.rural-coverage__bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.rural-coverage__fill {
  height: 100%;
  border-radius: 3px;
  transition: width .24s ease;
}
.rural-coverage__fill--excellent { background: #19c37d; }
.rural-coverage__fill--good      { background: #87c93b; }
.rural-coverage__fill--fair      { background: #e4b900; }
.rural-coverage__fill--poor      { background: #f0883e; }
.rural-coverage__fill--none      { background: #d44a4a; }
.rural-coverage__fill--sin_cobertura { background: #555; }
.rural-coverage__score {
  flex: 0 0 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.rural-coverage__conf {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: help;
}
.rural-coverage__conf--high   { background: rgba(25, 195, 125, 0.18); color: #19c37d; }
.rural-coverage__conf--medium { background: rgba(228, 185, 0, 0.18);  color: #e4b900; }
.rural-coverage__conf--low    { background: rgba(212, 74, 74, 0.18);  color: #d44a4a; }
.rural-coverage__conf--none   { display: none; }
.rural-coverage__meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ru-muted, #8a8f99);
  padding-left: 64px;
}
.rural-coverage__note {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255,255,255,0.08);
  font-size: 10.5px;
  color: var(--ru-muted, #8a8f99);
  line-height: 1.4;
}

/* ================================================================
 * Unlinked devices alert (ACS-detected routers sin site asignado)
 * Pill flotante centrada debajo del topbar, clickable, color danger.
 * ================================================================ */
.rural-unlinked-banner {
  position: absolute;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 14px;
  background: #24101A;
  border: 1.5px solid rgba(220, 38, 38, 0.75);
  border-radius: 10px;
  color: var(--ru-text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.25), 0 6px 18px rgba(0, 0, 0, 0.45);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.rural-unlinked-banner:hover {
  background: #321624;
  border-color: rgba(220, 38, 38, 0.95);
  transform: translateX(-50%) translateY(-1px);
}
.rural-unlinked-banner__icon {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  color: var(--ru-danger);
}
.rural-unlinked-banner strong {
  color: var(--ru-danger);
  font-weight: 700;
}
.rural-unlinked-banner small {
  display: block;
  color: var(--ru-text-dim);
  font-size: 11px;
  font-weight: 400;
  margin-top: 2px;
}

/* Installed table: subsección "Sin vincular" */
.rural-unlinked-section {
  margin-bottom: 24px;
  border: 1px solid rgba(220, 38, 38, 0.4);
  border-radius: 10px;
  overflow: hidden;
}
.rural-unlinked-section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(220, 38, 38, 0.12);
  color: #8a2020;
  font-size: 13px;
  font-weight: 600;
}
.rural-unlinked-section__head .rural-unlinked-banner__icon {
  color: var(--ru-danger);
}
/* Variant mas llamativa: usada cuando hay dispositivos sin vincular para que
   el operador no se le pase el aviso entre la lista de dispositivos activos. */
.rural-unlinked-section__head--prominent {
  padding: 14px 18px;
  background: rgba(220, 38, 38, 0.18);
  font-size: 14px;
}
.rural-unlinked-banner__icon--pulse {
  display: inline-flex;
  animation: ruralUnlinkedPulse 2s ease-in-out infinite;
}
@keyframes ruralUnlinkedPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.15); }
}

/* ================================================================
 * Probe marker (sonar / radar pulse) + right-click context menu
 * ================================================================ */
.rural-probe {
  position: relative;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.rural-probe__dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--ru-accent);
  box-shadow: 0 0 12px var(--ru-accent-glow), 0 0 0 3px rgba(11, 13, 16, 0.85);
  transform: translate(-50%, -50%);
  z-index: 2;
}
.rural-probe__ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--ru-accent);
  transform: translate(-50%, -50%) scale(0.25);
  opacity: 0.9;
  animation: ruralSonar 2.4s cubic-bezier(0, 0.55, 0.45, 1) infinite;
}
.rural-probe__ring--2 { animation-delay: 0.8s; }
.rural-probe__ring--3 { animation-delay: 1.6s; }
@keyframes ruralSonar {
  0%   { transform: translate(-50%, -50%) scale(0.25); opacity: 0.9; border-width: 2px; }
  70%  { opacity: 0.15; border-width: 1px; }
  100% { transform: translate(-50%, -50%) scale(6.5); opacity: 0; border-width: 1px; }
}

.rural-ctxmenu {
  position: fixed;
  z-index: 50;
  min-width: 220px;
  padding: 6px;
  background: var(--ru-glass-strong);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--ru-border);
  border-radius: 12px;
  box-shadow: var(--ru-shadow-lift);
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition: opacity .14s ease, transform .14s ease;
  pointer-events: auto;
}
.rural-ctxmenu.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.rural-ctxmenu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ru-text);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.rural-ctxmenu__item:hover,
.rural-ctxmenu__item:focus-visible {
  background: rgba(228, 185, 0, 0.14);
  color: var(--ru-accent);
  outline: none;
}
.rural-ctxmenu__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  color: var(--ru-text-dim);
}
.rural-ctxmenu__item:hover .rural-ctxmenu__icon,
.rural-ctxmenu__item:focus-visible .rural-ctxmenu__icon {
  color: var(--ru-accent);
}

/* ================================================================
 * Sidepanel (site/device detail, right drawer)
 * ================================================================ */
.rural-sidepanel {
  position: absolute;
  top: 76px;
  right: 16px;
  bottom: 74px;
  width: 420px;
  max-width: calc(100vw - 32px);
  background: var(--ru-glass-strong);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--ru-border);
  border-radius: 16px;
  box-shadow: var(--ru-shadow-lift);
  color: var(--ru-text);
  z-index: 13;
  overflow: hidden;
  transform: translateX(calc(100% + 24px));
  transition: transform 0.34s cubic-bezier(0.22, 0.81, 0.36, 1);
}
.rural-sidepanel[aria-hidden="false"] { transform: translateX(0); }
.rural-sidepanel__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ru-border);
  color: var(--ru-text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.rural-sidepanel__close:hover { background: rgba(255, 255, 255, 0.12); }
.rural-sidepanel__body {
  height: 100%;
  overflow-y: auto;
  padding: 20px 22px 22px;
}

.rural-sp-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.2px;
  padding-right: 32px;
}
.rural-sp-subtitle {
  font-size: 13px;
  color: var(--ru-text-dim);
  margin: 0 0 14px;
}
.rural-sp-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.rural-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ru-text);
  border: 1px solid var(--ru-border);
}
.rural-chip--success { background: rgba(22, 163, 74, 0.16); color: var(--ru-success); border-color: transparent; }
.rural-chip--warn { background: rgba(249, 115, 22, 0.16); color: var(--ru-warning); border-color: transparent; }
.rural-chip--danger { background: rgba(220, 38, 38, 0.18); color: var(--ru-danger); border-color: transparent; }
.rural-chip--info { background: rgba(111, 177, 255, 0.16); color: var(--ru-info); border-color: transparent; }
.rural-chip--aire { background: rgba(106, 157, 224, 0.22); color: var(--ru-aire); border-color: transparent; }
.rural-chip--finetwork { background: rgba(228, 71, 107, 0.22); color: var(--ru-finetwork); border-color: transparent; }
.rural-chip--accent { background: rgba(228, 185, 0, 0.2); color: var(--ru-accent); border-color: transparent; }

.rural-kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}
.rural-kv dt {
  color: var(--ru-text-muted);
  font-weight: 600;
}
.rural-kv dd {
  margin: 0;
  color: var(--ru-text);
  word-break: break-word;
}

.rural-sp-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.rural-sp-actions .btn {
  flex: 1;
  min-width: 120px;
}

.rural-device-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.rural-device-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ru-border);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.rural-device-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--ru-border-strong);
}
.rural-device-row__icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: rgba(228, 185, 0, 0.12);
  color: var(--ru-accent);
  border-radius: 8px;
  font-size: 16px;
}
.rural-device-row__name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
}
.rural-device-row__meta {
  font-size: 11.5px;
  color: var(--ru-text-muted);
}

/* Signal bars */
.rural-signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.rural-signal span {
  width: 3px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 1px;
}
.rural-signal span:nth-child(1) { height: 4px; }
.rural-signal span:nth-child(2) { height: 7px; }
.rural-signal span:nth-child(3) { height: 10px; }
.rural-signal span:nth-child(4) { height: 13px; }
.rural-signal.is-1 span:nth-child(-n+1),
.rural-signal.is-2 span:nth-child(-n+2),
.rural-signal.is-3 span:nth-child(-n+3),
.rural-signal.is-4 span:nth-child(-n+4) { background: var(--ru-success); }
.rural-signal.is-weak span:nth-child(-n+1) { background: var(--ru-warning); }
.rural-signal.is-bad span:nth-child(-n+1) { background: var(--ru-danger); }

/* ================================================================
 * Admin-style rural views (Installed / Stock / Manual)
 * Light background matching the rest of the backoffice. Persistent
 * slim topbar with nav pills so the user can return to the map.
 * ================================================================ */
.rural-admin[hidden] { display: none; }
.rural-admin {
  display: flex;
  flex-direction: column;
}
.rural-admin__body {
  flex: 1;
  min-height: 0;
}

/* ================================================================
 * Stock legend (color key above table)
 * ================================================================ */
.rural-stock-legend {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0 14px;
  font-size: 12px;
  color: #6b7280;
}
.rural-stock-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rural-stock-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rural-stock-dot--ok { background: #16a34a; }
.rural-stock-dot--low { background: #f59e0b; }
.rural-stock-dot--out { background: #dc2626; }
.rural-stock-dot--ondemand { background: #9ca3af; }
.rural-stock-dot--legacy { background: #7c3aed; }

/* Stock row color coding (left border indicator) */
.rural-stock-row--ok td:first-child { box-shadow: inset 4px 0 0 #16a34a; }
.rural-stock-row--low td:first-child { box-shadow: inset 4px 0 0 #f59e0b; }
.rural-stock-row--out td:first-child { box-shadow: inset 4px 0 0 #dc2626; }
.rural-stock-row--ondemand td:first-child { box-shadow: inset 4px 0 0 #9ca3af; }
.rural-stock-row--legacy td:first-child { box-shadow: inset 4px 0 0 #7c3aed; }
.rural-stock-row { cursor: pointer; }
.rural-stock-row:hover td { background: #fafafa; }
.rural-stock-row.is-expanded td { background: #f8fafc; }
.rural-stock-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 12px;
}
.rural-stock-count--ok { background: #dcfce7; color: #166534; }
.rural-stock-count--low { background: #fef3c7; color: #92400e; }
.rural-stock-count--out { background: #fee2e2; color: #991b1b; }
.rural-stock-count--ondemand { background: #f3f4f6; color: #4b5563; }
.rural-stock-count--legacy { background: #ede9fe; color: #5b21b6; }

/* Stock cell with +/- adjust controls */
.rural-stock-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.rural-stock-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, border-color .12s, color .12s, transform .08s;
  user-select: none;
}
.rural-stock-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #9ca3af;
}
.rural-stock-btn:active:not(:disabled) { transform: scale(0.92); }
.rural-stock-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.rural-stock-btn--add:hover:not(:disabled) {
  background: #dcfce7;
  border-color: #16a34a;
  color: #166534;
}
.rural-stock-btn--sub:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}

/* Section header rows that group models by deviceType */
.rural-stock-section th {
  background: #f3f4f6;
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  border-top: 2px solid #e5e7eb;
  text-align: left;
}
.rural-stock-section__label { margin-right: 12px; }
.rural-stock-section__count {
  font-weight: 500;
  color: #6b7280;
  text-transform: none;
  letter-spacing: normal;
  font-size: 11px;
}

/* LTE category + legacy badges (inline next to type) */
.rural-cat-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.rural-cat-badge--cat4 { background: #fef3c7; color: #92400e; }
.rural-cat-badge--cat6 { background: #dbeafe; color: #1e40af; }
.rural-cat-badge--cat12 { background: #cffafe; color: #155e75; }
.rural-cat-badge--cat18 { background: #d1fae5; color: #065f46; }
.rural-cat-badge--cat19 { background: #d1fae5; color: #065f46; }
.rural-cat-badge--5g { background: #fce7f3; color: #9d174d; }
.rural-legacy-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: #ede9fe;
  color: #5b21b6;
}

/* Inline unit list shown when a stock row is expanded */
.rural-stock-units {
  background: #fafafa;
}
.rural-stock-units > td { padding: 0; }
.rural-stock-units__inner {
  padding: 8px 16px 12px 28px;
  border-top: 1px dashed #e5e7eb;
}
.rural-stock-units__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #6b7280;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.rural-stock-unit {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.rural-stock-unit:hover { background: #fff; }
.rural-stock-unit__serial {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #111827;
}
.rural-stock-unit__serial--missing { color: #9ca3af; font-style: italic; }
.rural-stock-unit__notes {
  flex: 1;
  color: #6b7280;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rural-stock-unit__status {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
}
.rural-stock-unit__status--stock { background: #dcfce7; color: #166534; }
.rural-stock-unit__status--installed { background: #dbeafe; color: #1e40af; }
.rural-stock-unit__status--reserved { background: #fef3c7; color: #92400e; }
.rural-stock-unit__status--retired { background: #fee2e2; color: #991b1b; }
.rural-stock-unit__status--rma { background: #fde68a; color: #78350f; }
.rural-stock-unit__status--lost { background: #f3f4f6; color: #4b5563; }

/* Subgrupos por estado dentro de la lista expandida */
.rural-stock-units__group {
  margin-top: 10px;
  padding-left: 8px;
  border-left: 3px solid #e5e7eb;
}
.rural-stock-units__group:first-child { margin-top: 0; }
.rural-stock-units__group--stock     { border-left-color: #16a34a; }
.rural-stock-units__group--reserved  { border-left-color: #f59e0b; }
.rural-stock-units__group--installed { border-left-color: #3b82f6; }
.rural-stock-units__group--other     { border-left-color: #9ca3af; }
.rural-stock-units__group--orphan {
  border-left-color: #ea580c;
  background: #fff7ed;
  border-radius: 6px;
  padding: 6px 8px;
  margin-top: 12px;
}
.rural-stock-units__group--orphan .rural-stock-units__group-label { color: #9a3412; }
.rural-stock-unit--orphan { background: #fff; }
.rural-stock-unit--orphan:hover { background: #fffbeb; }
.rural-stock-units__group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding: 0 4px;
}
.rural-stock-units__group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #374151;
}
.rural-stock-units__group-count {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  background: #fff;
  padding: 1px 7px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

/* ================================================================
 * Map markers
 * ================================================================ */
.rural-marker {
  position: relative;
  width: 30px;
  height: 38px;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
  transition: transform .15s ease;
}
.rural-marker:hover { transform: translateY(-2px) scale(1.08); }
.rural-marker__pin {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 28px;
  height: 34px;
  background: var(--ru-accent);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 34'><path d='M14 0C6.3 0 0 6.3 0 14c0 10.5 14 20 14 20s14-9.5 14-20C28 6.3 21.7 0 14 0z'/></svg>") no-repeat center/contain;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 34'><path d='M14 0C6.3 0 0 6.3 0 14c0 10.5 14 20 14 20s14-9.5 14-20C28 6.3 21.7 0 14 0z'/></svg>") no-repeat center/contain;
}
.rural-marker__icon {
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: #0B0D10;
  border-radius: 50%;
  font-size: 11px;
  color: var(--ru-accent);
  font-weight: 700;
  line-height: 1;
}
/* Site markers: sin icono, coloreados por salud de dispositivos.
 * 4 niveles + neutral. Hex directo para garantizar contraste consistente
 * en el satelite oscuro (las variables --ru-* se pensaron para chips
 * sobre fondo claro). */
.rural-marker--site .rural-marker__pin { background: var(--ru-text-muted); }
.rural-marker--health-green   .rural-marker__pin { background: #16a34a; }
.rural-marker--health-yellow  .rural-marker__pin { background: #eab308; }
.rural-marker--health-orange  .rural-marker__pin { background: #f97316; }
.rural-marker--health-red     .rural-marker__pin { background: #dc2626; }
.rural-marker--health-neutral .rural-marker__pin { background: var(--ru-text-muted); }

/* Puntitos encima del pin: uno por dispositivo del site */
.rural-marker__dots {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  padding: 3px 5px;
  background: rgba(11, 13, 16, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
.rural-marker__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ru-text-muted);
  flex: 0 0 auto;
}
.rural-marker__dot--ok { background: var(--ru-success); }
.rural-marker__dot--warn { background: var(--ru-warning); }
.rural-marker__dot--bad { background: var(--ru-danger); }

/* Mini triangulo de estudio: si el site tiene survey vinculado, se
 * pinta encima del pin coloreado por la calidad del survey mas reciente.
 * Sustituye al puntito por device (que era redundante con el color del
 * pin) cuando hay estudio; sin estudio no se pinta nada. */
.rural-marker__survey-badge {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
  z-index: 2;
}
.rural-marker__survey-badge:hover { transform: translateX(-50%) scale(1.18); }

/* Cluster de circulitos de cobertura mobile (Movistar/Orange/Vodafone)
 * encima del pin del site, a la derecha del triangulo del survey badge.
 * Cada dot 10px con borde blanco para que se vea sobre satelite oscuro. */
.rural-marker__network-dots {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateX(18px);
  display: flex;
  gap: 3px;
  z-index: 2;
  pointer-events: auto;
}
/* Cuando NO hay survey badge, los dots se centran sobre el pin sin
 * desplazamiento. Se aplica desde JS comprobando si hay badge. Sin
 * esa logica, mantenemos el offset por defecto (asume que casi siempre
 * hay badge). */
.rural-marker:not(:has(.rural-marker__survey-badge)) .rural-marker__network-dots {
  transform: translateX(-50%);
}
.rural-marker__network-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  flex: 0 0 auto;
}

/* Etiqueta sobre el pin del site: alias + senal/Mbps del peor dispositivo */
.rural-marker__label {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: rgba(11, 13, 16, 0.88);
  border: 1px solid var(--ru-border);
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  text-align: center;
  line-height: 1.15;
}
.rural-marker__label-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ru-text);
  letter-spacing: 0.1px;
}
.rural-marker__label-sub {
  font-size: 10.5px;
  color: var(--ru-text-dim);
  margin-top: 1px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.rural-marker__label--green   { border-color: rgba(22, 163, 74, 0.55); }
.rural-marker__label--yellow  { border-color: rgba(234, 179, 8, 0.55); }
.rural-marker__label--orange  { border-color: rgba(249, 115, 22, 0.55); }
.rural-marker__label--red     { border-color: rgba(220, 38, 38, 0.60); }
.rural-marker__label--neutral { border-color: rgba(148, 163, 184, 0.45); }
.rural-marker--site .rural-marker__dots { bottom: 90px; }

/* ================================================================
 * Antenas (cell towers) — color por operador host, tamano por RSRP
 * medido, opacidad reducida si solo tenemos posicion crowdsourced.
 *   Movistar  #019DF4  (azul)
 *   Vodafone  #E60000  (rojo)
 *   Orange    #FF7900  (naranja)
 *   Otras     #9AA0A6  (gris: Digi, MasMovil, desconocido)
 * ================================================================ */
.rural-marker--cell {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rural-marker--cell .rural-marker__pin {
  position: static;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  mask: none; -webkit-mask: none;
  background: #9AA0A6;
  /* Anillo blanco interior (2px) + halo de color (3px). El blanco da
   * contraste sobre satelite/cultivos/asfalto donde los colores puros
   * desaparecen. */
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(154, 160, 166, 0.28);
  transition: transform 0.15s ease;
}
.rural-marker--cell:hover .rural-marker__pin {
  transform: scale(1.15);
}

/* Operador host */
.rural-marker--op-movistar .rural-marker__pin {
  background: #019DF4;
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(1, 157, 244, 0.32);
}
.rural-marker--op-vodafone .rural-marker__pin {
  background: #E60000;
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(230, 0, 0, 0.32);
}
.rural-marker--op-orange .rural-marker__pin {
  background: #FF7900;
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(255, 121, 0, 0.32);
}
.rural-marker--op-other .rural-marker__pin {
  background: #9AA0A6;
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(154, 160, 166, 0.32);
}

/* Tamano por RSRP medido (umbrales 3GPP).
 * Unmeasured = solo posicion crowdsourced, semi-transparente.
 * Bumpeados ~40% (apr-2026) para que se vean sobre satelite. */
.rural-marker--cell-sz-excellent .rural-marker__pin { width: 28px; height: 28px; }
.rural-marker--cell-sz-good      .rural-marker__pin { width: 22px; height: 22px; }
.rural-marker--cell-sz-fair      .rural-marker__pin { width: 18px; height: 18px; }
.rural-marker--cell-sz-poor      .rural-marker__pin { width: 14px; height: 14px; }
.rural-marker--cell-sz-unmeasured .rural-marker__pin {
  width: 13px;
  height: 13px;
  opacity: 0.7;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
  outline: 1px dashed rgba(0, 0, 0, 0.35);
}

/* Torre garantizada fuera del radio: la senal no llega al punto pero la
 * mostramos para indicar "esta es la mas cercana de ese operador". Se pinta
 * pequena, semi-transparente y con anillo punteado rojo. Domina al tamano
 * por RSRP porque a esta distancia la medicion no aplica al punto. */
.rural-marker--cell-faraway .rural-marker__pin {
  width: 15px !important;
  height: 15px !important;
  opacity: 0.65;
  box-shadow: 0 0 0 2px #fff;
  outline: 2px dashed #E60000;
  outline-offset: 2px;
}

/* ================================================================
 * Markers de cobertura del device
 *   --cov-connected-exact  verde  (conectado, posicion exacta)
 *   --cov-connected-approx naranja (conectado, posicion inferida)
 *   --cov-nearest          azul   (mejor torre cercana del SIM)
 *   --cov-optimal          verde  (coincide conectado == mejor)
 * ================================================================ */
.rural-marker--cov {
  width: 0;
  height: 0;
  position: relative;
}
.rural-marker__cov-pin {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
}
.rural-marker--cov-connected-exact .rural-marker__cov-pin,
.rural-marker--cov-optimal .rural-marker__cov-pin {
  background: #0CA678;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35), 0 0 0 4px rgba(12, 166, 120, 0.22);
}
.rural-marker--cov-connected-approx .rural-marker__cov-pin {
  background: #F08C00;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35), 0 0 0 4px rgba(240, 140, 0, 0.22);
}
.rural-marker--cov-nearest .rural-marker__cov-pin {
  background: #1971C2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35), 0 0 0 4px rgba(25, 113, 194, 0.22);
}
.rural-marker__cov-label {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 18, 22, 0.92);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.15);
}
.rural-marker--cov-connected-exact .rural-marker__cov-label,
.rural-marker--cov-optimal .rural-marker__cov-label {
  border-color: rgba(12, 166, 120, 0.6);
}
.rural-marker--cov-connected-approx .rural-marker__cov-label {
  border-color: rgba(240, 140, 0, 0.6);
}
.rural-marker--cov-nearest .rural-marker__cov-label {
  border-color: rgba(25, 113, 194, 0.6);
}
.rural-marker__cov-tag {
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}
.rural-marker__cov-title { font-weight: 600; }
.rural-marker__cov-sub { opacity: 0.75; font-family: monospace; font-size: 10px; }

/* ================================================================
 * Bloque "Cobertura" en el panel de dispositivo
 * ================================================================ */
.rural-cov {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rural-cov__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--ru-border);
}
.rural-cov__row--connected-exact,
.rural-cov__row--optimal {
  border-left: 3px solid #0CA678;
}
.rural-cov__row--connected-approx {
  border-left: 3px solid #F08C00;
}
.rural-cov__row--nearest {
  border-left: 3px solid #1971C2;
}
.rural-cov__row--miss {
  border-left: 3px solid #868E96;
  opacity: 0.8;
}
.rural-cov__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}
.rural-cov__dot--connected-exact,
.rural-cov__dot--optimal { background: #0CA678; }
.rural-cov__dot--connected-approx { background: #F08C00; }
.rural-cov__dot--nearest { background: #1971C2; }
.rural-cov__dot--miss { background: #868E96; }
.rural-cov__body { flex: 1; min-width: 0; }
.rural-cov__tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--ru-text-dim);
  margin-bottom: 2px;
}
.rural-cov__title {
  font-weight: 600;
  font-size: 13px;
}
.rural-cov__meta {
  font-family: monospace;
  font-size: 11px;
  opacity: 0.8;
  margin-top: 2px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rural-cov__verdict {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  margin-top: 2px;
  line-height: 1.4;
}
.rural-cov__verdict--ok {
  background: rgba(12, 166, 120, 0.12);
  border: 1px solid rgba(12, 166, 120, 0.35);
  color: #3ac296;
}
.rural-cov__verdict--warn {
  background: rgba(240, 140, 0, 0.12);
  border: 1px solid rgba(240, 140, 0, 0.35);
  color: #f0ad4e;
}
.rural-cov__verdict--info {
  background: rgba(25, 113, 194, 0.12);
  border: 1px solid rgba(25, 113, 194, 0.35);
  color: #4ea1db;
}

/* ================================================================
 * Form styles inside sidepanel
 * ================================================================ */
.rural-sidepanel .form .field { margin-bottom: 12px; }
.rural-sidepanel .label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ru-text-muted);
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}
.rural-sidepanel .input,
.rural-sidepanel .select,
.rural-sidepanel .textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ru-border);
  color: var(--ru-text);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13px;
  box-sizing: border-box;
}
.rural-sidepanel .input:focus,
.rural-sidepanel .select:focus,
.rural-sidepanel .textarea:focus {
  outline: none;
  border-color: var(--ru-accent);
  box-shadow: 0 0 0 3px rgba(228, 185, 0, 0.15);
}

/* ================================================================
 * Empty state
 * ================================================================ */
.rural-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--ru-text-muted);
  font-size: 13px;
  text-align: center;
}

/* ================================================================
 * Intro curtain (fade-out over map while we flyTo Villena)
 * ================================================================ */
.rural-app.is-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(5, 7, 10, 0.9) 80%);
  pointer-events: none;
  z-index: 11;
  animation: ruralFadeOut 2.8s ease-out forwards;
}
@keyframes ruralFadeOut {
  0%   { opacity: 1; }
  60%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ================================================================
 * Responsive
 * ================================================================ */
@media (max-width: 900px) {
  .rural-app { height: calc(100vh - 56px); min-height: 520px; }
  .rural-app__topbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
  }
  .rural-nav { flex: 1 1 auto; justify-content: center; }
  .rural-styleswitch { flex: 0 0 auto; }
  /* En mobile el buscador ocupa todo el ancho y el switcher se baja en
     otra fila — evita que se solapen. */
  .rural-app__topbar--left {
    max-width: none;
    right: 16px;
  }
  .rural-app__topbar--right {
    top: 70px;
  }
  .rural-search { min-width: 0; }
  .rural-app__bottombar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .rural-sidepanel {
    width: calc(100vw - 32px);
    top: auto;
    right: 16px;
    left: 16px;
    bottom: 90px;
    height: 60vh;
  }
  .rural-drawer { left: 8px; right: 8px; bottom: 8px; }
  .rural-cells-badge { top: auto; bottom: 180px; font-size: 11.5px; }
}

/* ============================================================
   Combobox (site form: buscador de cliente) — dark theme
   ============================================================ */
.rural-combobox {
  position: relative;
}
.rural-combobox__input {
  width: 100%;
  padding-right: 32px;
}
.rural-combobox__clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--ru-text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}
.rural-combobox__clear:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ru-danger);
}
.rural-combobox__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 260px;
  overflow-y: auto;
  background: #14181E;
  border: 1px solid var(--ru-border-strong);
  border-radius: 10px;
  box-shadow: var(--ru-shadow-lift);
  z-index: 50;
}
.rural-combobox__item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--ru-border);
  font-size: 13.5px;
  color: var(--ru-text);
  transition: background .12s ease;
}
.rural-combobox__item:last-child {
  border-bottom: none;
}
.rural-combobox__item:hover {
  background: rgba(228, 185, 0, 0.12);
}
.rural-combobox__sub {
  color: var(--ru-text-dim);
  font-size: 11.5px;
  margin-top: 3px;
  letter-spacing: 0.1px;
}
.rural-combobox__empty {
  padding: 12px;
  color: var(--ru-text-dim);
  font-size: 13px;
  text-align: center;
}

/* ============================================================
   Sidepanel action rows (compactas, jerarquicas)
   ============================================================ */
.rural-actions--primary {
  margin-top: 14px;
}
.rural-btn-block {
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 10px;
}
.rural-actions--secondary {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.rural-btn-secondary {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ru-border);
  color: var(--ru-text);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.rural-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--ru-border-strong);
}
.rural-btn-secondary--warning {
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(249, 115, 22, 0.40);
  color: var(--ru-warning);
}
.rural-btn-secondary--warning:hover {
  background: rgba(249, 115, 22, 0.22);
  border-color: rgba(249, 115, 22, 0.60);
}
.rural-btn-secondary--danger {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--ru-danger);
}
.rural-btn-secondary--danger:hover {
  background: rgba(220, 38, 38, 0.20);
  border-color: rgba(220, 38, 38, 0.55);
}

/* Tarjetas de dispositivo dentro del panel de site */
.rural-devcards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.rural-devcard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ru-border);
  border-radius: 10px;
  color: var(--ru-text);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.rural-devcard:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--ru-border-strong);
}
.rural-devcard:active { transform: scale(0.99); }
.rural-devcard__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.rural-devcard__name {
  font-weight: 600;
  font-size: 13.5px;
}
.rural-devcard__meta {
  font-size: 12px;
  color: var(--ru-text-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.rural-devcard__metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ru-text-dim);
}
.rural-signal-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ru-text-muted);
}
.rural-signal-dot--ok { background: var(--ru-success); }
.rural-signal-dot--warn { background: var(--ru-warning); }
.rural-signal-dot--bad { background: var(--ru-danger); }

.rural-actions--danger {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--ru-border);
  text-align: right;
}
.rural-btn-link-danger {
  background: transparent;
  border: none;
  color: var(--ru-text-muted);
  font-size: 11.5px;
  cursor: pointer;
  padding: 4px 6px;
  letter-spacing: 0.2px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rural-btn-link-danger:hover {
  color: var(--ru-danger);
}

