/* ═══════════════════════════════════════════════════════
   YAA GIS — Design System v2
   Corporativo · Minimalista · Profesional
   ═══════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────── */
:root {
  /* Acento de marca */
  --accent:       #1D4ED8;
  --accent-hover: #1E40AF;
  --accent-muted: #EFF6FF;
  --accent-text:  #1D4ED8;

  /* Paleta de superficie */
  --bg:       #F9FAFB;
  --surface:  #FFFFFF;
  --surface2: #F3F4F6;
  --surface3: #E5E7EB;

  /* Tipografía */
  --text:       #111827;
  --text-muted: #6B7280;
  --text-faint: #9CA3AF;

  /* Bordes */
  --border:     #E5E7EB;
  --border-strong: #D1D5DB;

  /* Estados */
  --red:    #DC2626;
  --red-bg: #FEF2F2;
  --orange: #D97706;
  --orange-bg: #FFFBEB;
  --green:  #16A34A;
  --green-bg: #F0FDF4;
  --blue:   #2563EB;
  --blue-bg: #EFF6FF;

  /* Sombras muy sutiles */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);

  /* Geometría */
  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Layout */
  --nav-w:    220px;
  --header-h:  56px;

  /* Header */
  --header-bg:          #FFFFFF;
  --header-color:       #111827;
  --header-border:      #E5E7EB;
  --header-logo-filter: none;
}

[data-theme="dark"] {
  --accent:       #3B82F6;
  --accent-hover: #60A5FA;
  --accent-muted: #1E3A5F;
  --accent-text:  #93C5FD;

  --bg:       #030712;
  --surface:  #111827;
  --surface2: #1F2937;
  --surface3: #374151;

  --text:       #F9FAFB;
  --text-muted: #9CA3AF;
  --text-faint: #6B7280;

  --border:        #1F2937;
  --border-strong: #374151;

  --red:       #F87171;  --red-bg:    #2D1515;
  --orange:    #FBBF24;  --orange-bg: #2D2008;
  --green:     #4ADE80;  --green-bg:  #0D2D1A;
  --blue:      #60A5FA;  --blue-bg:   #0F1E3D;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.4);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.5);
  --shadow:    0 4px 6px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 20px rgba(0,0,0,.5);

  --header-bg:          #111827;
  --header-color:       #F9FAFB;
  --header-border:      #1F2937;
  --header-logo-filter: brightness(0) invert(1) opacity(.9);
}

/* ── Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── App shell ──────────────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; }

/* ── Header ─────────────────────────────────────────── */
#header {
  height: var(--header-h);
  background: var(--header-bg);
  color: var(--header-color);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 200;
  transition: background .2s, border-color .2s;
}

#header img {
  height: 28px;
  width: 28px;
  object-fit: contain;
  filter: var(--header-logo-filter);
  transition: filter .2s;
}

#header h1 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.3px;
  color: var(--text);
  flex: 1;
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.header-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

#badge-criticas {
  background: var(--red);
  color: #fff;
  border-radius: 9999px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  display: none;
}

#btn-theme {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius);
  width: 28px; height: 28px;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, color .15s;
}
#btn-theme:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border-strong);
}

/* ── Body area ──────────────────────────────────────── */
.body-area { flex: 1; display: flex; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────── */
#side-nav {
  width: var(--nav-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 8px 0;
  overflow: hidden;
  transition: background .2s, border-color .2s;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-faint);
  padding: 12px 16px 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px 7px 14px;
  margin: 1px 8px;
  border-radius: var(--radius);
  transition: color .12s, background .12s;
  position: relative;
  width: calc(100% - 16px);
  text-align: left;
  white-space: nowrap;
}
.nav-btn:hover {
  background: var(--surface2);
  color: var(--text);
}
.nav-btn.active {
  background: var(--accent-muted);
  color: var(--accent-text);
  font-weight: 600;
}
[data-theme="dark"] .nav-btn.active {
  background: var(--accent-muted);
  color: var(--accent-hover);
}

.nav-btn .icon {
  flex-shrink: 0;
  opacity: .75;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-btn .icon svg { display: block; }
.nav-btn.active .icon { opacity: 1; }

.nav-badge {
  background: var(--red);
  color: #fff;
  border-radius: 9999px;
  min-width: 17px; height: 17px;
  font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  margin-left: auto;
}

.nav-bottom {
  margin-top: auto;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

/* ── Content ─────────────────────────────────────────── */
#content { flex: 1; overflow: hidden; position: relative; }

.tab-panel { position: absolute; inset: 0; display: none; flex-direction: column; }
.tab-panel.active { display: flex; }

/* ── Map ─────────────────────────────────────────────── */
#panel-mapa { overflow: hidden; }
#map { flex: 1; }

.map-controls {
  position: absolute;
  bottom: 24px; right: 16px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 500;
}

.fab {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.fab:hover { background: var(--surface2); color: var(--text); box-shadow: var(--shadow); }
.fab.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}
.fab.primary:hover { background: var(--accent-hover); box-shadow: var(--shadow); }

.map-layer-toggle {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 500;
  display: flex; gap: 4px; flex-wrap: wrap;
}

.tile-selector {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 500;
  display: flex; gap: 4px;
}

.layer-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
  color: var(--text-muted);
  transition: all .12s;
  user-select: none;
}
.layer-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--border-strong); }
.layer-btn.active { background: var(--accent); color: #fff; border-color: transparent; box-shadow: var(--shadow-xs); }

/* ── Panel headers ───────────────────────────────────── */
.panel-header {
  padding: 0 20px;
  height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.panel-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  letter-spacing: -.2px;
}
.btn-add {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
  letter-spacing: -.1px;
}
.btn-add:hover { background: var(--accent-hover); }

/* ── Filter bar ──────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 4px;
  padding: 8px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .12s;
}
.filter-chip:hover { background: var(--surface2); color: var(--text); }
.filter-chip.active { background: var(--surface2); color: var(--text); border-color: var(--border); font-weight: 600; }

/* ── List container ──────────────────────────────────── */
.list-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
  border-left: 3px solid transparent;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.card.prioridad-critica { border-left-color: var(--red); }
.card.prioridad-alta    { border-left-color: var(--orange); }
.card.prioridad-media   { border-left-color: #FBBF24; }
.card.prioridad-baja    { border-left-color: var(--green); }
.card-proyecto.fo         { border-left-color: var(--accent); }
.card-proyecto.microondas { border-left-color: #0891B2; }

.card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.card-folio { font-weight: 700; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.card-badge {
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-abierta         { background: var(--orange-bg); color: var(--orange); }
.badge-en_atención,
.badge-en_atencion     { background: var(--blue-bg);   color: var(--blue); }
.badge-resuelta        { background: var(--green-bg);  color: var(--green); }
.badge-cerrada         { background: var(--surface2);  color: var(--text-muted); }
.badge-critica         { background: var(--red-bg);    color: var(--red); }
.badge-alta            { background: var(--orange-bg); color: var(--orange); }
.badge-media           { background: var(--orange-bg); color: #B45309; }
.badge-baja            { background: var(--green-bg);  color: var(--green); }
.badge-diseño          { background: var(--blue-bg);   color: var(--blue); }
.badge-en_construccion { background: var(--orange-bg); color: var(--orange); }
.badge-en_pruebas      { background: var(--blue-bg);   color: var(--blue); }
.badge-en_operacion    { background: var(--green-bg);  color: var(--green); }
.badge-suspendido      { background: var(--orange-bg); color: var(--orange); }
.badge-cancelado       { background: var(--red-bg);    color: var(--red); }

.card-desc { color: var(--text-muted); font-size: 12px; margin-bottom: 6px; line-height: 1.45; }
.card-meta { display: flex; gap: 14px; font-size: 11px; color: var(--text-faint); align-items: center; flex-wrap: wrap; }
.card-meta span { display: flex; align-items: center; gap: 3px; }

/* ── Detail panel (lateral derecho) ─────────────────── */
#bottom-sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.25);
  z-index: 800;
  display: none; opacity: 0;
  transition: opacity .2s;
  backdrop-filter: blur(2px);
}
#bottom-sheet-overlay.visible { display: block; }
#bottom-sheet-overlay.shown   { opacity: 1; }

#bottom-sheet {
  position: fixed;
  top: var(--header-h); right: 0; bottom: 0;
  width: 360px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  z-index: 900;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
#bottom-sheet.shown { transform: translateX(0); }
.sheet-handle { display: none; }

.sheet-content { padding: 20px; }
.sheet-title { font-size: 15px; font-weight: 700; margin-bottom: 2px; letter-spacing: -.3px; }
.sheet-subtitle { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.sheet-section { margin-top: 16px; }
.sheet-section h4 {
  font-size: 10px; font-weight: 600; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px;
}

.detail-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.detail-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.detail-item .label { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }
.detail-item .value { font-size: 13px; font-weight: 600; margin-top: 2px; color: var(--text); }

.sheet-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ── Modal (diálogo centrado) ────────────────────────── */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(3px);
}
#modal-overlay.visible { display: flex; }

#modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 0;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.modal-title { font-size: 14px; font-weight: 700; flex: 1; letter-spacing: -.2px; }
.btn-close {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 26px; height: 26px;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all .12s;
}
.btn-close:hover { background: var(--surface3); color: var(--text); }

/* Contenido del modal con padding */
#modal > *:not(.modal-header) { padding: 0 20px 20px; }
#modal > .modal-header + * { padding-top: 16px; }

/* Modal de dictamen — ancho carta, sin scroll horizontal */
#modal.modal--dictamen {
  max-width: min(920px, calc(100vw - 40px));
  width:     min(920px, calc(100vw - 40px));
  overflow: hidden;
}
/* El iframe no hereda el padding interno del modal */
#modal > iframe { padding: 0; }

/* ── Formularios ─────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.form-control {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.form-control::placeholder { color: var(--text-faint); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Botones ─────────────────────────────── */
.btn-primary {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
  font-family: inherit;
  letter-spacing: -.1px;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

.btn-secondary {
  flex: 1;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  font-family: inherit;
}
.btn-secondary:hover { background: var(--surface2); border-color: var(--border-strong); }

.btn-danger {
  flex: 1;
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
  font-family: inherit;
}
.btn-danger:hover { background: #FEE2E2; }

/* ── Import panel ────────────────────────────────────── */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--surface2);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-muted);
}
.dropzone-icon { font-size: 28px; margin-bottom: 8px; opacity: .7; }
.dropzone-text { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.dropzone-hint { font-size: 11px; color: var(--text-muted); }

.dropzone-sm { padding: 16px 8px; }
.dropzone-sm .dropzone-icon { font-size: 22px; margin-bottom: 4px; }
.dropzone-sm .dropzone-text { font-size: 12px; margin-bottom: 2px; }
.dropzone-sm .dropzone-hint { font-size: 10px; }

.import-file-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  margin-bottom: 5px; text-transform: uppercase; letter-spacing: .06em;
}

.import-result {
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-top: 8px;
  font-size: 12px;
  border: 1px solid transparent;
}
.import-result.success { background: var(--green-bg);  border-color: #86EFAC; }
.import-result.error   { background: var(--red-bg);    border-color: #FECACA; }
.import-result.warning { background: var(--orange-bg); border-color: #FDE68A; }

.result-stat { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; font-size: 12px; }
.result-stat strong { font-weight: 700; }
.error-list { margin-top: 8px; max-height: 100px; overflow-y: auto; }
.error-item { font-size: 11px; color: var(--red); padding: 2px 0; border-bottom: 1px solid #FECACA; }

/* ── Dashboard ───────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px 20px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: box-shadow .12s;
}
.kpi-card:hover { box-shadow: var(--shadow-sm); }
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  margin-bottom: 4px;
}
.kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.kpi-card.red    .kpi-value { color: var(--red); }
.kpi-card.orange .kpi-value { color: var(--orange); }
.kpi-card.blue   .kpi-value { color: var(--accent); }
.kpi-card.green  .kpi-value { color: var(--green); }

/* ── Misc ────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex: 1; gap: 10px;
  color: var(--text-muted);
  padding: 60px 40px;
  text-align: center;
}
.empty-icon { font-size: 40px; opacity: .2; }
.empty-text { font-size: 14px; font-weight: 600; color: var(--text); }
.empty-hint { font-size: 12px; color: var(--text-muted); max-width: 280px; line-height: 1.5; }

.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--text);
  color: var(--surface);
  border-radius: var(--radius-lg);
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  transition: opacity .18s, transform .18s;
  white-space: nowrap;
  max-width: 88vw;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.toast.show    { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--green); color: #fff; }
.toast.error   { background: var(--red);   color: #fff; }

.divider { height: 1px; background: var(--border); margin: 12px 0; }

/* Leyenda */
.leyenda-item {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 0; color: #111827; font-size: 11px;
}
#mapa-leyenda, #mapa-leyenda * { color: #111827 !important; }
.leyenda-item svg { flex-shrink: 0; overflow: visible; }

/* Timeline */
.timeline { list-style: none; }
.timeline-item { display: flex; gap: 10px; padding-bottom: 14px; position: relative; }
.timeline-item:not(:last-child)::before {
  content: ''; position: absolute;
  left: 12px; top: 24px; bottom: 0;
  width: 1px; background: var(--border);
}
.timeline-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 10px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.timeline-content { flex: 1; }
.timeline-date  { font-size: 10px; color: var(--text-faint); }
.timeline-title { font-size: 13px; font-weight: 600; margin: 2px 0; }
.timeline-body  { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ── Tablet ──────────────────────────────────────────── */
@media (max-width: 1023px) {
  :root { --nav-w: 56px; }

  .nav-btn { flex-direction: column; gap: 2px; padding: 10px 4px; font-size: 9px;
             justify-content: center; margin: 1px 4px; width: calc(100% - 8px); }
  .nav-btn .icon { width: 20px; height: 20px; }
  .nav-btn .icon svg { width: 20px; height: 20px; }
  .nav-btn span:last-child { font-size: 9px; }
  .nav-section-label { display: none; }
  .nav-badge { position: absolute; top: 4px; right: 2px; margin-left: 0; min-width: 14px; height: 14px; font-size: 9px; }
  .nav-bottom { border-top: none; }

  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }

  #bottom-sheet {
    top: auto; right: 0; left: 0; bottom: 0; width: 100%;
    border-left: none; border-top: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(100%); max-height: 80vh;
  }
  #bottom-sheet.shown { transform: translateY(0); }
  .sheet-handle { display: block; width: 32px; height: 3px; background: var(--border); border-radius: 9999px; margin: 10px auto 6px; }
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 639px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
  .kpi-value { font-size: 22px; }
  .list-container { padding: 12px; }
  .panel-header { padding: 0 14px; }
  .filter-bar { padding: 6px 14px; }
  #modal-overlay { padding: 0; align-items: flex-end; }
  #modal { border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-width: 100%; max-height: 92vh; }
}

/* ── Dashboard v2 ────────────────────────────────────── */
.dash-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* KPI row */
.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.dash-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  border-left: 4px solid transparent;
  transition: box-shadow .12s;
}
.dash-kpi:hover { box-shadow: var(--shadow); }
.dash-kpi.red    { border-left-color: var(--red); }
.dash-kpi.orange { border-left-color: var(--orange); }
.dash-kpi.green  { border-left-color: var(--green); }
.dash-kpi.blue   { border-left-color: var(--accent); }
.dash-kpi-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1.5px;
  margin-bottom: 4px;
}
.dash-kpi.red    .dash-kpi-value { color: var(--red); }
.dash-kpi.orange .dash-kpi-value { color: var(--orange); }
.dash-kpi.green  .dash-kpi-value { color: var(--green); }
.dash-kpi.blue   .dash-kpi-value { color: var(--accent); }
.dash-kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.dash-kpi-sub   { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

/* Chart cards */
.dash-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: box-shadow .12s;
}
.dash-card:hover { box-shadow: var(--shadow-sm); }
.dash-card.full  { grid-column: 1 / -1; }
.dash-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -.1px;
}
.dash-badge {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-faint);
  background: var(--surface2);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
}
.dash-chart-wrap {
  height: 140px;
  position: relative;
  margin-bottom: 10px;
}
.dash-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
}
.dash-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.dash-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

@media (max-width: 1023px) {
  .dash-kpi-row { grid-template-columns: 1fr 1fr; }
  .dash-section  { grid-template-columns: 1fr; }
  .dash-card.full { grid-column: 1; }
}
@media (max-width: 639px) {
  .dash-kpi-row { grid-template-columns: 1fr 1fr; }
  .dash-scroll  { padding: 12px; gap: 10px; }
}

/* ── Formulario de intervención ──────────────────────── */
.int-section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
  border-bottom: 2px solid var(--accent-muted);
  padding-bottom: 5px;
  margin: 18px 0 10px;
}
.int-section-header:first-of-type { margin-top: 0; }

/* Zona de evidencias */
.ev-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: border-color .15s, background .15s;
}
.ev-zone.ev-drag {
  border-color: var(--accent);
  background: var(--accent-muted);
}
.ev-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.ev-add-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: background .12s;
}
.ev-add-btn:hover { background: var(--accent-muted); }

.ev-files { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text);
  max-width: 220px;
}
.ev-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.ev-size { color: var(--text-faint); flex-shrink: 0; }
.ev-chip button {
  background: none; border: none; cursor: pointer;
  color: var(--text-faint); font-size: 11px; padding: 0 2px;
  flex-shrink: 0;
}
.ev-chip button:hover { color: var(--red); }

/* ── Botón GPS ───────────────────────────────────────── */
.btn-gps {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-muted);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background .12s, border-color .12s;
  margin-bottom: 8px;
  font-family: inherit;
}
.btn-gps:hover:not(:disabled) { background: #DBEAFE; border-color: var(--accent-hover); }
.btn-gps:disabled { opacity: .65; cursor: not-allowed; }
.btn-gps.btn-gps-ok {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}

.gps-spin {
  display: inline-block;
  animation: spin .8s linear infinite;
}

.gps-status {
  font-size: 12px;
  border-radius: var(--radius);
  padding: 7px 10px;
  line-height: 1.5;
}
.gps-waiting { background: var(--blue-bg);   color: var(--blue);   border: 1px solid #BFDBFE; }
.gps-ok      { background: var(--green-bg);  color: var(--green);  border: 1px solid #86EFAC; }
.gps-error   { background: var(--red-bg);    color: var(--red);    border: 1px solid #FECACA; }

/* ── Panel SLA ───────────────────────────────────────── */
.sla-panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin: 10px 0;
}
.sla-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sla-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.sla-badge {
  font-size: 10px;
  font-weight: 700;
  border-radius: 9999px;
  padding: 2px 8px;
  letter-spacing: .04em;
}
.sla-bar-wrap {
  height: 5px;
  background: var(--surface3);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.sla-bar {
  height: 100%;
  border-radius: 9999px;
  transition: width .5s, background .3s;
}
.sla-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 10px;
}
.sla-stat { text-align: center; }
.sla-stat-val {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.3px;
  color: var(--text);
}
.sla-stat-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
  margin-top: 1px;
}
.sla-espera-motivo {
  margin-top: 8px;
  font-size: 11px;
  color: var(--orange);
  background: var(--orange-bg);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

/* Badge en espera */
.badge-en_espera { background: #FEF3C7; color: #92400E; }

/* ── Módulo Reportes ─────────────────────────────────── */
.rep-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.rep-bar-label { width: 100px; color: var(--text-muted); flex-shrink: 0; }
.rep-bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface2);
  border-radius: 9999px;
  overflow: hidden;
}
.rep-bar-fill { height: 100%; border-radius: 9999px; transition: width .4s; }
.rep-bar-val { width: 28px; text-align: right; font-weight: 700; color: var(--text); }

.rep-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  transition: box-shadow .12s;
}
.rep-card:hover { box-shadow: var(--shadow-sm); }
.rep-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.rep-folio { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.rep-card-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; line-height: 1.4; }
.rep-card-footer {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text-faint);
  flex-wrap: wrap;
}
.rep-sla-bar-mini {
  height: 3px;
  background: var(--surface2);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 8px;
}
.rep-dictamen-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  background: var(--accent-muted);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  transition: background .12s;
}
.rep-dictamen-btn:hover { background: #DBEAFE; }

/* ── Configuración SLA ──────────────────────────────────*/
.cfg-section { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:20px; }
.cfg-section-title { font-size:13px; font-weight:700; margin-bottom:6px; }
.cfg-section-desc  { font-size:12px; color:var(--text-muted); margin-bottom:16px; line-height:1.5; }
.cfg-grid { display:flex; flex-direction:column; gap:10px; }
.cfg-row {
  display:grid; grid-template-columns:110px 1fr 80px;
  align-items:center; gap:12px;
  padding:10px 14px; background:var(--surface2);
  border-radius:var(--radius); border:1px solid var(--border);
}
.cfg-label { font-size:12px; font-weight:700; }
.cfg-critica { color:var(--red); }
.cfg-alta    { color:var(--orange); }
.cfg-media   { color:var(--yellow); }
.cfg-baja    { color:var(--green); }
.cfg-inputs  { display:flex; gap:8px; align-items:center; }
.cfg-field   { display:flex; align-items:center; gap:4px; }
.cfg-field input { width:64px; text-align:center; }
.cfg-unit    { font-size:11px; color:var(--text-faint); }
.cfg-total   { font-size:12px; font-weight:700; color:var(--text-muted); text-align:right; }

/* ── Panel de firmas en dictamen ─────────────────────── */
.firma-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
}
.firma-panel-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.firma-canvas-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

/* ── Bitácora ────────────────────────────────────────── */
.bit-filters {
  display: flex;
  gap: 12px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: flex-end;
  flex-shrink: 0;
}
.bit-filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 120px;
}
.bit-filter-group .form-control {
  padding: 5px 8px;
  font-size: 12px;
}

/* Grupo de proyecto */
.bit-grupo { margin-bottom: 16px; }
.bit-grupo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: 2px solid var(--accent);
}
.bit-grupo-codigo {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
}
.bit-grupo-nombre {
  font-size: 12px;
  color: var(--text-muted);
}
.bit-grupo-stats {
  display: flex;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
}
.bit-grupo-items {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

/* Card de incidencia en bitácora */
.bit-card {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  background: var(--surface);
}
.bit-card:last-child { border-bottom: none; }
.bit-card:hover { background: var(--surface2); }
.bit-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.bit-folio {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.bit-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 5px;
}
.bit-sla-bar {
  height: 3px;
  background: var(--surface3);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 5px;
}
.bit-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-faint);
  flex-wrap: wrap;
}

/* ── Respaldos ───────────────────────────────────────── */
.backup-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow .12s;
}
.backup-row:hover { box-shadow: var(--shadow-sm); }
.backup-info { flex: 1; min-width: 0; }
.backup-nombre {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.backup-meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.backup-actions { display: flex; gap: 6px; flex-shrink: 0; }
.backup-btn {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: all .12s;
  font-family: inherit;
  white-space: nowrap;
}
.backup-btn:hover { background: var(--surface3); color: var(--text); }
.backup-btn-rest { color: var(--accent); border-color: var(--accent); }
.backup-btn-rest:hover { background: var(--accent-muted); }
.backup-btn-del:hover  { color: var(--red); border-color: var(--red); background: var(--red-bg); }

.backup-alerta {
  background: var(--red-bg);
  border: 1px solid #FECACA;
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}

/* ── Red de Fibra ──────────────────────────────────────────────────────────── */

.cierre-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
  margin-bottom: 8px;
  transition: box-shadow .15s;
}
.cierre-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.cierre-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cierre-card-stats { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--text-muted); }

.cable-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  background: var(--surface);
  margin-bottom: 7px;
  transition: box-shadow .15s;
}
.cable-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }

.hilo-card { transition: box-shadow .12s, transform .1s; }
.hilo-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,.1); transform: translateY(-1px); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.chip-sm { padding: 1px 6px; font-size: 10px; }

.icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .12s;
  font-family: inherit;
}
.icon-btn:hover { background: var(--surface3); color: var(--text); }
.icon-btn.danger:hover { background: var(--red-bg, #FEE2E2); color: var(--red, #DC2626); border-color: var(--red, #DC2626); }



/* ═══════════════════════════════════════════════════════
   M3 — Árbol de Distribución FO  (Network Diagram)
   ═══════════════════════════════════════════════════════ */

/* Toolbar compartida (botones +/−/⊡/⊙) */
.hn-tbtn {
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  color: #e2e8f0;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.hn-tbtn:hover { background: rgba(255,255,255,.14); }

.hn-tzoom {
  font-size: 12px;
  color: #94a3b8;
  min-width: 42px;
  text-align: center;
}

.hn-hint {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 10px;
  color: rgba(255,255,255,.25);
  pointer-events: none;
}

/* ── Contenedor principal ── */
.hn2-wrap {
  position: relative;
  width: 100%;
  height: 540px;
  background: #161b27;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.07);
}

/* Barra de herramientas */
.hn2-toolbar {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 5px 8px;
}

/* Viewport (zona de pan) */
.hn2-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
}
.hn2-viewport:active { cursor: grabbing; }

/* Canvas posicionado — contiene SVG + nodos */
.hn2-canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

/* SVG de conexiones */
.hn2-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* ── Nodo ── */
.hn2-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  overflow: visible;
}

/* Columna de puertos (izquierda o derecha) */
.hn2-ports-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Bloque de puerto individual */
.hn2-port {
  width: 100%;
  border-radius: 3px;
  flex-shrink: 0;
  opacity: .92;
  transition: opacity .15s;
  cursor: default;
}
.hn2-port:hover { opacity: 1; }

/* Cuerpo central del nodo */
.hn2-body {
  flex: 1;
  min-width: 0;
  background: #1e2535;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header del nodo */
.hn2-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  height: 46px;
  background: #141926;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.hn2-name {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hn2-edit-btn {
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  flex-shrink: 0;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.hn2-edit-btn:hover { color: #06B6D4; background: rgba(6,182,212,.1); }

.hn2-mun {
  font-size: 10px;
  color: #64748b;
  padding: 4px 10px 2px;
  flex-shrink: 0;
}

/* Barra de capacidad de charolas */
.hn2-caprow {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
}
.hn2-capbar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
  overflow: hidden;
}
.hn2-capbar > div {
  height: 100%;
  border-radius: 2px;
  transition: width .3s;
}
.hn2-caplbl {
  font-size: 9px;
  color: #475569;
  white-space: nowrap;
}

/* Elementos vinculados al cierre */
.hn2-elems {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 4px 8px 6px;
}
.hn2-elem-pill {
  font-size: 9px;
  font-weight: 600;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 20px;
  padding: 1px 6px;
  cursor: default;
  white-space: nowrap;
}

/* ── Chips genéricos (usados fuera del árbol) ── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.chip-sm {
  font-size: 11px;
  padding: 1px 6px;
}

/* ── Cable group (stack de hilos en puerto) ── */
.hn2-cable-grp {
  width: 100%;
  overflow: hidden;
  border-radius: 2px;
  cursor: default;
}

/* ── Detalles extra de nodo ── */
.hn2-tipo-chip {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: rgba(6,182,212,.18);
  color: #06B6D4;
  border: 1px solid rgba(6,182,212,.3);
  border-radius: 10px;
  padding: 1px 5px;
  flex-shrink: 0;
}
.hn2-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px 8px 3px;
}
.hn2-meta-tag {
  font-size: 9px;
  color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 1px 5px;
  white-space: nowrap;
}
.hn2-proy {
  font-size: 9px;
  color: rgba(255,255,255,.38);
  padding: 1px 8px 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hn2-fiber-stats {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 4px;
  font-size: 9px;
  font-weight: 600;
}
.hn2-fs-act  { color: #22C55E; }
.hn2-fs-dsp  { color: #06B6D4; }
.hn2-fs-dan  { color: #EF4444; }
.hn2-fs-tot  { color: rgba(255,255,255,.3); margin-left: auto; font-weight: 400; }
.hn2-notas {
  font-size: 9px;
  color: rgba(255,255,255,.35);
  font-style: italic;
  padding: 2px 8px 3px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Leyenda de estados en toolbar ── */
.hn2-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid rgba(255,255,255,.1);
}
.hn2-leg-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: rgba(255,255,255,.5);
  white-space: nowrap;
}
.hn2-leg-item span {
  width: 16px;
  height: 4px;
  border-radius: 2px;
  display: inline-block;
}

/* ── Antenas Microondas ─────────────────────────────────────────────────────── */
.am-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 11px 14px;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.am-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.am-card-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.am-card-name {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.am-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.am-card-proy {
  font-size: 10px;
  color: var(--text-faint);
}
.am-card-notas {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.am-ant-specs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 0;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.am-spec-item {
  display: flex;
  align-items: center;
  gap: 3px;
}
.am-enl-sites {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 0;
}
.am-enl-site {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.am-enl-arrow {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.am-thr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.am-thr-bar {
  flex: 1;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
}
.am-thr-bar > div {
  height: 100%;
  border-radius: 2px;
  transition: width .3s;
}
.am-thr-lbl {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
