/* =========================================================
   Datacenters del Mundo · Estilos
   ========================================================= */
:root {
  --bg: #05070f;
  --bg-panel: rgba(11, 16, 30, 0.92);
  --bg-card: rgba(20, 28, 48, 0.85);
  --border: rgba(86, 128, 220, 0.25);
  --accent: #2d7ff9;
  --accent-2: #00e0ff;
  --text: #e8eefc;
  --text-dim: #8a99b8;
  --green: #2ecc71;
  --yellow: #f1c40f;
  --red: #e74c3c;
  --sidebar-w: 340px;
  --topbar-h: 70px;
  --shadow: 0 10px 40px rgba(0,0,0,0.5);
  font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  position: relative;
}

/* Fondo estrellado sutil */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(45,127,249,0.08), transparent 50%),
    radial-gradient(ellipse at 80% 60%, rgba(0,224,255,0.05), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ===================== GLOBO ===================== */
#globe {
  position: absolute;
  inset: 0;
  z-index: 1;
}
#globe canvas { display: block; }

#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  gap: 16px;
  color: var(--text-dim);
  transition: opacity .6s;
}
#loader.hidden { opacity: 0; pointer-events: none; }
.spinner {
  width: 56px; height: 56px;
  border: 4px solid rgba(45,127,249,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== TOPBAR ===================== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { font-size: 30px; filter: drop-shadow(0 0 8px rgba(45,127,249,.6)); }
.brand h1 { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.subtitle { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

.topbar-stats { display: flex; gap: 22px; }
.stat { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.stat-num {
  font-size: 20px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-2);
}
.stat-active { color: var(--green); }
.stat-maint { color: var(--yellow); }
.stat-offline { color: var(--red); }
.stat-lbl { font-size: 10px; color: var(--text-dim); text-transform: uppercase; margin-top: 4px; letter-spacing: .5px; }

.topbar-actions { display: flex; align-items: center; gap: 14px; }
.live-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--green);
  letter-spacing: 1px;
}
.live-indicator .pulse {
  width: 8px; height: 8px; background: var(--green); border-radius: 50%;
  box-shadow: 0 0 0 rgba(46,204,113,.6);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46,204,113,.7); }
  70% { box-shadow: 0 0 0 8px rgba(46,204,113,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}
.btn-admin {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; padding: 9px 16px; border-radius: 8px;
  text-decoration: none; font-size: 13px; font-weight: 600;
  transition: transform .15s, box-shadow .15s;
}
.btn-admin:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(45,127,249,.5); }

/* ===================== SIDEBAR ===================== */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 9;
}
.search-box { padding: 14px 16px; border-bottom: 1px solid var(--border); }
#search {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
}
#search:focus { border-color: var(--accent); }
#search::placeholder { color: var(--text-dim); }

.filters { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.filter-group label {
  display: block; font-size: 10px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-dim); margin-bottom: 6px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 5px 10px; border-radius: 999px;
  font-size: 11px; cursor: pointer;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px; border-radius: 6px; font-size: 12px; outline: none;
}
select option { background: #0c1224; }

.list-header {
  padding: 14px 16px 8px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.list-header h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.badge {
  display: inline-block; min-width: 22px;
  background: var(--accent); color: #fff;
  padding: 1px 7px; border-radius: 999px; font-size: 11px;
  margin-left: 6px;
}
.hint { font-size: 10px; color: var(--text-dim); }

.dc-list { flex: 1; overflow-y: auto; padding: 0 10px 12px; }
.dc-list::-webkit-scrollbar { width: 6px; }
.dc-list::-webkit-scrollbar-thumb { background: rgba(45,127,249,.3); border-radius: 3px; }

.dc-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: transform .12s, background .15s;
}
.dc-item:hover { transform: translateX(2px); background: rgba(45,127,249,.12); }
.dc-item.is-active { border-left-color: var(--green); }
.dc-item.is-maintenance { border-left-color: var(--yellow); opacity: .85; }
.dc-item.is-offline { border-left-color: var(--red); opacity: .55; }
.dc-item-head { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.dc-item-name { font-size: 12px; font-weight: 600; line-height: 1.3; }
.dc-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dc-status-dot.active { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dc-status-dot.maintenance { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.dc-status-dot.offline { background: var(--red); }
.dc-item-meta { font-size: 10px; color: var(--text-dim); margin-top: 4px; }

.sidebar-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 10px; color: var(--text-dim);
}

/* ===================== DETALLE FLOTANTE ===================== */
.detail-panel {
  position: fixed;
  right: 20px; top: calc(var(--topbar-h) + 20px);
  width: 360px;
  max-height: calc(100vh - var(--topbar-h) - 60px);
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 20;
  overflow-y: auto;
  animation: slideIn .25s ease;
}
.detail-panel[hidden] { display: none; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.close-btn {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,.08); border: none; color: var(--text);
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  font-size: 14px;
}
.close-btn:hover { background: rgba(231,76,60,.3); }

.detail-panel .dp-header {
  padding: 22px 20px 16px;
  background: linear-gradient(135deg, rgba(45,127,249,.18), rgba(0,224,255,.05));
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
}
.detail-panel .dp-name { font-size: 17px; font-weight: 700; padding-right: 30px; }
.detail-panel .dp-operator { font-size: 12px; color: var(--accent-2); margin-top: 4px; }
.detail-panel .dp-status {
  display: inline-block; margin-top: 10px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px; letter-spacing: .5px;
}
.detail-panel .dp-status.active { background: rgba(46,204,113,.2); color: var(--green); }
.detail-panel .dp-status.maintenance { background: rgba(241,196,15,.2); color: var(--yellow); }
.detail-panel .dp-status.offline { background: rgba(231,76,60,.2); color: var(--red); }

.detail-panel .dp-body { padding: 16px 20px; }
.detail-panel .dp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 14px;
}
.detail-panel .dp-cell { background: var(--bg-card); padding: 8px 10px; border-radius: 6px; border: 1px solid var(--border); }
.detail-panel .dp-cell-label { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); }
.detail-panel .dp-cell-val { font-size: 13px; font-weight: 600; margin-top: 2px; }
.detail-panel .dp-desc { font-size: 12px; line-height: 1.55; color: var(--text-dim); margin-top: 6px; }
.detail-panel .dp-coords { font-size: 10px; color: var(--text-dim); font-family: monospace; }

/* ===================== CONTROLES HELP ===================== */
.controls-help {
  position: fixed;
  bottom: 16px; left: calc(var(--sidebar-w) + 20px);
  background: rgba(11,16,30,.7);
  backdrop-filter: blur(8px);
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 11px; color: var(--text-dim);
  z-index: 8;
}
kbd {
  background: var(--bg-card); padding: 1px 6px; border-radius: 4px;
  font-family: monospace; color: var(--text); border: 1px solid var(--border);
  font-size: 10px;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .topbar-stats { display: none; }
  .sidebar { width: 280px; }
  .detail-panel { width: calc(100% - 40px); }
  .controls-help { display: none; }
}

/* =========================================================
   TABS DE NAVEGACIÓN (sidebar)
   ========================================================= */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: rgba(20, 28, 48, 0.5);
}
.tab-btn {
  flex: 1;
  padding: 12px 10px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  border-bottom: 2px solid transparent;
}
.tab-btn:hover { color: var(--text); background: rgba(45,127,249,.08); }
.tab-btn.active {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
  background: rgba(0,224,255,.05);
}

.tab-content { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.tab-content.active { display: flex; }

/* =========================================================
   FILTRO POR TIPO DC (type chips)
   ========================================================= */
#type-chips .chip[data-type="primary"].active { background: #00aaff; border-color: #00aaff; }
#type-chips .chip[data-type="secondary"].active { background: #aa55ff; border-color: #aa55ff; }
#type-chips .chip[data-type="dr_site"].active { background: #ff8800; border-color: #ff8800; }

/* =========================================================
   TYPE BADGES (en panel de detalle)
   ========================================================= */
.dp-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.dp-type-primary { background: rgba(0,170,255,.2); color: #00aaff; }
.dp-type-secondary { background: rgba(170,85,255,.2); color: #aa55ff; }
.dp-type-dr_site { background: rgba(255,136,0,.2); color: #ff8800; }

/* =========================================================
   RELACIONES (primario/secundario en detalle)
   ========================================================= */
.dp-relations {
  margin-top: 14px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.dp-relations h4 {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.dp-relation-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: background .15s;
}
.dp-relation-item:hover { background: rgba(45,127,249,.12); }

/* =========================================================
   WEB SERVERS TAB
   ========================================================= */
.ws-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.ws-header h3 {
  font-size: 14px;
  font-weight: 700;
}
.ws-source {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
}
.ws-source a {
  color: var(--accent-2);
  text-decoration: none;
}
.ws-source a:hover { text-decoration: underline; }

.ws-chart-container {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
#ws-chart {
  width: 100%;
  height: 240px;
  display: block;
}

.ws-metric-selector {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ws-metric-selector label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.ws-metric-selector select {
  flex: 1;
}

.ws-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}
.ws-list::-webkit-scrollbar { width: 6px; }
.ws-list::-webkit-scrollbar-thumb { background: rgba(45,127,249,.3); border-radius: 3px; }

.ws-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  margin-bottom: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: transform .12s, background .15s;
}
.ws-item:hover { transform: translateX(2px); background: rgba(45,127,249,.12); }

.ws-item-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  min-width: 24px;
  text-align: center;
}
.ws-item-info { flex: 1; min-width: 0; }
.ws-item-name {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-item-vendor {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-item-share {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}
.ws-bar-bg {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  overflow: hidden;
}
.ws-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .3s ease;
}
.ws-share-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  min-width: 38px;
  text-align: right;
}

.ws-survey-info {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-dim);
}
.ws-survey-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* =========================================================
   WEB SERVER DETALLE PANEL
   ========================================================= */
.ws-detail-panel {
  position: fixed;
  right: 20px;
  top: calc(var(--topbar-h) + 20px);
  width: 380px;
  max-height: calc(100vh - var(--topbar-h) - 60px);
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 21;
  overflow-y: auto;
  animation: slideIn .25s ease;
}
.ws-detail-panel[hidden] { display: none; }

.ws-dp-header {
  padding: 20px 20px 14px;
  background: linear-gradient(135deg, rgba(45,127,249,.1), rgba(0,224,255,.05));
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
}
.ws-dp-name {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.ws-dp-vendor {
  font-size: 12px;
  color: var(--accent-2);
  margin-top: 4px;
}
.ws-dp-body { padding: 16px 20px; }
.ws-dp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.ws-dp-cell {
  background: var(--bg-card);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.ws-dp-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.ws-dp-val {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
  word-break: break-word;
}

.ws-dp-shares { margin-top: 14px; }
.ws-dp-shares h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.ws-dp-share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ws-dp-share-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}
.ws-dp-share-val {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-2);
}
.ws-dp-share-label {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dim);
  margin-top: 4px;
}
.ws-dp-desc {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
  margin-top: 12px;
}

.ws-dp-features, .ws-dp-usedby { margin-top: 12px; }
.ws-dp-features h4, .ws-dp-usedby h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.ws-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ws-feature-tag {
  background: rgba(45,127,249,.15);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}
.ws-usedby-tag {
  background: rgba(0,224,255,.1);
  color: var(--accent-2);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}
.ws-dp-link {
  display: block;
  margin-top: 14px;
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
}
.ws-dp-link:hover { text-decoration: underline; }

/* ===================== DC ITEM: selected ===================== */
.dc-item.selected {
  background: rgba(45,127,249,.18);
  border-color: var(--accent);
  transform: translateX(3px);
}

/* ===================== GALLERY ===================== */
.dp-gallery {
  padding: 12px 20px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.dp-photo {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* =========================================================
   CABLES SUBMARINOS · Toggle Button
   ========================================================= */
.cables-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.cables-toggle:hover {
  border-color: var(--accent-2);
  color: var(--text);
}
.cables-toggle.active {
  background: rgba(0, 224, 255, .12);
  border-color: var(--accent-2);
  color: var(--accent-2);
  box-shadow: 0 0 12px rgba(0, 224, 255, .2);
}
.cables-toggle-icon { font-size: 14px; }
.cables-toggle-label { letter-spacing: .3px; }

/* =========================================================
   CABLES SUBMARINOS · Leyenda (esquina inferior derecha)
   ========================================================= */
.cables-legend {
  position: fixed;
  bottom: 16px;
  right: 20px;
  width: 280px;
  max-height: 320px;
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 15;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideIn .25s ease;
}
.cables-legend.hidden { display: none; }

.cables-legend-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cables-legend-header h4 {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.cables-legend-header select {
  width: 100%;
  font-size: 11px;
  padding: 5px 8px;
}

.cables-legend-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
}
.cables-legend-list::-webkit-scrollbar { width: 5px; }
.cables-legend-list::-webkit-scrollbar-thumb { background: rgba(0,224,255,.2); border-radius: 3px; }

.cable-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s;
}
.cable-legend-item:hover { background: rgba(0, 224, 255, .08); }

.cable-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}
.cable-legend-info { flex: 1; min-width: 0; }
.cable-legend-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cable-legend-meta {
  font-size: 9px;
  color: var(--text-dim);
}

/* =========================================================
   CABLES SUBMARINOS · Panel de Detalle
   ========================================================= */
.cable-detail-panel {
  position: fixed;
  right: 20px;
  top: calc(var(--topbar-h) + 20px);
  width: 360px;
  max-height: calc(100vh - var(--topbar-h) - 60px);
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 22;
  overflow-y: auto;
  animation: slideIn .25s ease;
}
.cable-detail-panel[hidden] { display: none; }

.cable-dp-header {
  padding: 20px 20px 14px;
  background: linear-gradient(135deg, rgba(0,224,255,.08), rgba(45,127,249,.05));
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
}
.cable-dp-name {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}
.cable-dp-type {
  font-size: 11px;
  color: var(--accent-2);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.cable-dp-body { padding: 16px 20px; }

.cable-dp-owners { margin-top: 14px; }
.cable-dp-owners h4,
.cable-dp-points h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.cable-dp-points { margin-top: 14px; }
.cable-points-list {
  list-style: decimal;
  padding-left: 20px;
  font-size: 11px;
  color: var(--text);
  line-height: 1.8;
}
.cable-points-list li::marker { color: var(--accent-2); }

/* =========================================================
   RESPONSIVE: cables legend
   ========================================================= */
@media (max-width: 900px) {
  .cables-legend {
    width: 220px;
    max-height: 240px;
    bottom: 10px;
    right: 10px;
  }
  .cables-toggle-label { display: none; }
  .cable-detail-panel { width: calc(100% - 40px); right: 20px; }
}

/* =========================================================
   SATÉLITES DE INTERNET · Toggle Button
   ========================================================= */
.satellites-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.satellites-toggle:hover {
  border-color: #ab47bc;
  color: var(--text);
}
.satellites-toggle.active {
  background: rgba(171, 71, 188, .12);
  border-color: #ab47bc;
  color: #ce93d8;
  box-shadow: 0 0 12px rgba(171, 71, 188, .2);
}

/* =========================================================
   SATÉLITES · Leyenda (esquina inferior izquierda, junto al sidebar)
   ========================================================= */
.sat-legend {
  position: fixed;
  bottom: 16px;
  left: calc(var(--sidebar-w) + 20px);
  width: 260px;
  max-height: 300px;
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 15;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideIn .25s ease;
}
.sat-legend.hidden { display: none; }

.sat-legend-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sat-legend-header h4 {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.sat-legend-header select {
  width: 100%;
  font-size: 11px;
  padding: 5px 8px;
}

.sat-legend-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
}
.sat-legend-list::-webkit-scrollbar { width: 5px; }
.sat-legend-list::-webkit-scrollbar-thumb { background: rgba(171, 71, 188, .25); border-radius: 3px; }

.sat-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s;
}
.sat-legend-item:hover { background: rgba(171, 71, 188, .1); }

/* =========================================================
   SATÉLITES · Panel de Detalle
   ========================================================= */
.sat-detail-panel {
  position: fixed;
  right: 20px;
  top: calc(var(--topbar-h) + 20px);
  width: 370px;
  max-height: calc(100vh - var(--topbar-h) - 60px);
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 23;
  overflow-y: auto;
  animation: slideIn .25s ease;
}
.sat-detail-panel[hidden] { display: none; }

.sat-status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

/* =========================================================
   RESPONSIVE: satélites
   ========================================================= */
@media (max-width: 900px) {
  .sat-legend {
    left: 10px;
    width: 200px;
    max-height: 220px;
    bottom: 10px;
  }
  .satellites-toggle .cables-toggle-label { display: none; }
  .sat-detail-panel { width: calc(100% - 40px); right: 20px; }
}

/* =========================================================
   CONTADOR DE VISITAS
   ========================================================= */
.stat-visits .stat-num {
  color: #e0e0e0;
  font-size: 16px;
}

/* =========================================================
   BANNER DE ANUNCIO (Ads) - Ventana inferior central
   ========================================================= */
.ad-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 580px;
  max-width: calc(100% - 40px);
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 50;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: slideUp .35s ease;
}
.ad-banner[hidden] { display: none; }

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(30px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.ad-banner-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: rgba(255,255,255,.08);
  border: none;
  color: var(--text-dim);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-banner-close:hover { background: rgba(231,76,60,.3); color: #fff; }

.ad-banner-img {
  width: 60px;
  height: 82px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  flex-shrink: 0;
}

.ad-banner-info {
  flex: 1;
  min-width: 0;
}
.ad-banner-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--accent-2);
  margin-bottom: 3px;
}
.ad-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-banner-author {
  font-size: 11px;
  color: var(--text-dim);
}
.ad-banner-desc {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.4;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-banner-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ad-banner-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
}
.ad-banner-cta {
  display: inline-block;
  padding: 7px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s, box-shadow .15s;
}
.ad-banner-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(45,127,249,.4);
}

@media (max-width: 640px) {
  .ad-banner {
    flex-wrap: wrap;
    width: calc(100% - 20px);
    padding: 12px 14px;
    gap: 10px;
  }
  .ad-banner-img { width: 48px; height: 66px; }
  .ad-banner-desc { display: none; }
}
