:root {
  --bg: #0b1416; --panel: #111d20; --panel2: #16262a; --line: #23383d; --text: #e6efef; --muted: #8aa3a6;
  --accent: #14b8a6; --accent2: #0f766e; --danger: #ef4444; --ok: #22c55e; --warn: #f59e0b;
  --radius: 10px; --top: 56px; --side: 400px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; }
h4 { margin: 18px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- Barra superior ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 12px;
  background: linear-gradient(180deg, #0e1b1e, #0b1416); border-bottom: 1px solid var(--line); z-index: 1000; }
.brand { display: flex; align-items: center; gap: 8px; min-width: max-content; }
.brand img { width: 30px; height: 30px; }
.brand strong { display: block; font-size: 15px; letter-spacing: .12em; }
.brand span { display: block; font-size: 11px; color: var(--muted); }
.brand.big img { width: 44px; height: 44px; } .brand.big strong { font-size: 20px; }
.project { display: flex; gap: 4px; }
.project select { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; max-width: 220px; }
.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; outline: none; }
.search input:focus { border-color: var(--accent); }
.right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.online { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px #22c55e33; animation: pulse 2s infinite; }
.live.off { background: var(--danger); animation: none; box-shadow: none; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px #22c55e00; } }
.menu { position: relative; }
.user-btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; white-space: nowrap; }
.dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; list-style: none; margin: 0; padding: 4px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 30px #0008; max-height: 60vh; overflow: auto; z-index: 1200; }
.menu .dropdown { left: auto; min-width: 230px; }
.dropdown li { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dropdown li:hover { background: var(--panel2); }
body:not(.is-admin) .admin-only, body:not(.can-edit) .edit-only { display: none !important; }

/* ---------- Layout ---------- */
.layout { position: fixed; inset: var(--top) 0 0 0; }
#map { position: absolute; inset: 0; background: #0a0f10; }
body.panel-open #map { right: var(--side); }
body.mode-add #map { cursor: crosshair; }
body.mode-add .leaflet-interactive, body.mode-add .leaflet-grab { cursor: crosshair; }
body.mode-draw .ftth-node, body.mode-draw path.ftth-cable { pointer-events: none; }
.hint .btn { margin-top: 6px; }

.sidebar { position: absolute; top: 0; right: 0; bottom: 0; width: var(--side); background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .2s; z-index: 900; }
body.panel-open .sidebar { transform: none; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.side-head h2 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.side-body { padding: 14px; overflow: auto; flex: 1; }

/* ---------- Caja de herramientas ---------- */
.toolbox { position: absolute; top: 12px; left: 12px; z-index: 800; width: 214px; background: #111d20ee; backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: 0 8px 24px #0007; }
.tool-title { background: none; border: none; padding: 0; cursor: pointer; width: 100%; text-align: left; display: flex; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.tool { display: flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid transparent; border-radius: 7px; padding: 5px 6px; cursor: pointer; font-size: 12px; text-align: left; }
.tool:hover { border-color: var(--line); }
.tool.active { border-color: var(--accent); background: #134e4a; }
.tool.wide { width: 100%; margin-top: 6px; justify-content: center; padding: 8px; font-weight: 600; }
.cable-ico { width: 22px; height: 4px; border-radius: 2px; background: #facc15; display: inline-block; }
.toolbox.collapsed .type-grid, .toolbox.collapsed #btnDrawCable { display: none; }
.toolbox.collapsed .tool-title { margin-bottom: 0; }
.toolbox.collapsed .tool-title span { transform: rotate(-90deg); }
.hint { margin: 8px 0 0; font-size: 12px; color: #fde68a; line-height: 1.4; }

.fab { position: absolute; z-index: 800; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 18px; box-shadow: 0 6px 18px #0007; }
.fab.locate { right: 12px; bottom: 120px; } body.panel-open .fab.locate { right: calc(var(--side) + 12px); }
.fab.locate.active { background: #0369a1; border-color: #38bdf8; }
.fab.panel-toggle { right: 12px; top: 60px; } body.panel-open .fab.panel-toggle { display: none; }

/* ---------- Iconos de mapa ---------- */
.node-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 700; font-size: 10px;
  border: 2px solid #fff; box-shadow: 0 2px 6px #000a; letter-spacing: -.02em; }
.node-ico.small { width: 22px; height: 22px; font-size: 9px; border-width: 2px; }
.node-ico.mini { width: 22px; height: 22px; font-size: 8px; border-width: 1.5px; flex: none; }
.node-ico.sel { outline: 3px solid #facc15; outline-offset: 2px; }
.node-ico.st-planificado { border-style: dashed; opacity: .85; }
.node-ico.st-dañado { border-color: #ef4444; }
.node-ico.st-retirado { filter: grayscale(1); opacity: .6; }
.photo-ico { font-size: 16px; filter: drop-shadow(0 1px 3px #000); }
.gps-dot { width: 18px; height: 18px; border-radius: 50%; background: #0ea5e9; border: 3px solid #fff; box-shadow: 0 0 0 6px #0ea5e955; }
.cable-sel { filter: drop-shadow(0 0 4px #fff); }
.coord-box { background: #0b1416cc; color: var(--text); padding: 2px 8px; border-radius: 4px; font: 11px ui-monospace, monospace; }
.leaflet-tooltip { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.leaflet-tooltip-top:before { border-top-color: var(--panel); }
.leaflet-control-layers { background: var(--panel); color: var(--text); border: 1px solid var(--line) !important; }
.leaflet-control-layers-expanded { padding: 10px 12px; }
.leaflet-bar a { background: var(--panel); color: var(--text); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--panel2); }

/* ---------- Captura en campo (teléfono) ---------- */
.crosshair { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; transform: translate(-50%, -50%); z-index: 650; pointer-events: none; }
.crosshair::before, .crosshair::after { content: ''; position: absolute; background: #fff; box-shadow: 0 0 0 1px #000c; }
.crosshair::before { left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; }
.crosshair::after { top: 50%; left: 0; right: 0; height: 2px; margin-top: -1px; }
.crosshair .ring { position: absolute; inset: 16px; border: 2px solid #facc15; border-radius: 50%; box-shadow: 0 0 0 1px #000a; }
.crosshair.snap::before, .crosshair.snap::after { background: #4ade80; }
.crosshair.snap .ring { border-color: #4ade80; inset: 12px; }
.field-bar { position: absolute; left: 8px; right: 8px; bottom: 12px; z-index: 950; background: #111d20f2; backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 14px; padding: 10px; box-shadow: 0 10px 30px #000a; }
body.panel-open .field-bar { right: calc(var(--side) + 8px); }
.fb-info { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fb-near { font-size: 12px; color: var(--muted); margin: 4px 0 8px; min-height: 16px; }
.fb-near .snap-txt { color: #4ade80; }
.fb-actions { display: flex; gap: 6px; }
.fb-actions .btn { flex: 1; justify-content: center; padding: 12px 6px; font-size: 14px; min-height: 46px; }
.fb-actions .btn[data-fa=undo], .fb-actions .btn[data-fa=exit] { flex: 0 0 48px; }
.btn.ok { background: #166534; border-color: var(--ok); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; }
.gps-acc { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.gps-acc.good { color: #4ade80; border-color: #166534; } .gps-acc.mid { color: #fbbf24; border-color: #92400e; }
.gps-acc.bad { color: #f87171; border-color: #7f1d1d; } .gps-acc.wait, .gps-acc.off { color: var(--muted); }
body.field-on .leaflet-bottom { bottom: var(--fb-h, 120px); }
body.field-on .fab.locate { display: none; }
.coord-form { display: flex; gap: 6px; margin-top: 8px; }
.coord-form input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-size: 12px; color: var(--text); }

/* ---------- Componentes ---------- */
.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent2); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.danger { background: #7f1d1d; border-color: var(--danger); color: #fff; }
.btn.danger.ghost { background: transparent; color: #fca5a5; border-color: #7f1d1d; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.icon-btn { background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 4px 8px; cursor: pointer; color: var(--muted); font-size: 16px; }
.icon-btn:hover { background: var(--panel2); color: var(--text); }
.icon-btn.sm { font-size: 12px; padding: 2px 6px; }
.link { background: none; border: none; color: #5eead4; cursor: pointer; padding: 0; text-align: left; }
a { color: #5eead4; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; margin-right: 6px; flex: none; border: 1px solid #fff6; }
.line-swatch { width: 18px; height: 4px; border-radius: 2px; background: var(--c); display: inline-block; margin-right: 6px; vertical-align: middle; }
.line-swatch.dashed { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px); }
.tag { font-size: 10px; background: var(--panel2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--muted); }

.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.form input, .form select, .form textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; color: var(--text); width: 100%; min-width: 0; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form input:disabled, .form select:disabled, .form textarea:disabled { opacity: .8; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid2 .full, .form .full { grid-column: 1 / -1; }
.grid2.extra { padding-top: 8px; border-top: 1px dashed var(--line); }
.grid4 { display: grid; grid-template-columns: 1.4fr .6fr; gap: 0 8px; }
.grid4 .span2 { grid-column: 1 / -1; }
.actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.actions .chk { margin-right: auto; }
.chk { display: flex !important; flex-direction: row !important; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.chk input { width: auto !important; }
.color-row { display: flex; align-items: center; gap: 8px; }
.color-row input[type=color] { width: 44px; height: 32px; padding: 2px; }

.card { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.proj-name { font-size: 17px; font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.kpis > div { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; }
.kpis b { display: block; font-size: 16px; } .kpis span { font-size: 11px; color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 500; font-size: 11px; text-transform: uppercase; }
.tbl.splice td, .tbl.splice th { padding: 4px; font-size: 12px; }
.tbl tr.sub td { color: var(--muted); font-size: 11px; padding-top: 0; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 12px; }
.legend > span { display: flex; align-items: center; }
.meta { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; padding: 10px; background: var(--panel2); border-radius: 8px; }
.ends { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.ends > div { display: flex; flex-direction: column; background: var(--panel2); padding: 8px; border-radius: 8px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 7px 8px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.list li:hover { background: var(--panel2); }
.occ { position: relative; height: 22px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin: 6px 0; }
.occ > div { height: 100%; background: var(--c); opacity: .5; }
.occ span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; }
.fiber { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #000; font-size: 10px; font-weight: 700; border: 1px solid #fff5; text-shadow: 0 0 2px #fff; }
.fibers { display: flex; flex-wrap: wrap; gap: 4px; }
.splice-form { margin-top: 10px; padding: 10px; background: var(--panel2); border-radius: 8px; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.thumb { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 1; background: var(--bg); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-form { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.photo-form input { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; min-width: 0; }
.file-btn { cursor: pointer; white-space: nowrap; }

/* ---------- Modal / lightbox / toasts ---------- */
.modal { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 2000; padding: 16px; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: min(760px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px #000c; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px; overflow: auto; }
.modal-body .tbl select { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px; }
.scroll { max-height: 65vh; overflow: auto; }
.lightbox { position: fixed; inset: 0; background: #000e; z-index: 2100; display: grid; place-items: center; }
.lightbox figure { margin: 0; max-width: 94vw; max-height: 94vh; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lightbox img { max-width: 94vw; max-height: 78vh; object-fit: contain; border-radius: 6px; }
.lightbox figcaption { text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.lb-actions { display: flex; gap: 6px; }
.lb-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: #fff; font-size: 26px; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: #0008; border: none; color: #fff; font-size: 40px; width: 52px; height: 72px; cursor: pointer; border-radius: 8px; }
.lb-nav.prev { left: 10px; } .lb-nav.next { right: 10px; }
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 3000; align-items: center; pointer-events: none; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 9px 14px; border-radius: 8px; box-shadow: 0 8px 24px #0008; transition: opacity .4s; max-width: 90vw; }
.toast.ok { border-left-color: var(--ok); } .toast.error { border-left-color: var(--danger); } .toast.out { opacity: 0; }
.error { color: #fca5a5; margin: 0; }

/* ---------- Login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 16px;
  background: radial-gradient(1200px 600px at 20% 10%, #134e4a55, transparent), radial-gradient(800px 500px at 90% 90%, #1e3a8a44, transparent), var(--bg); }
.login-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px #0009; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card .btn { justify-content: center; padding: 11px; }

/* ---------- Móvil ---------- */
@media (max-width: 900px) {
  :root { --side: 100vw; }
  .brand div, .online { display: none; }
  .topbar { gap: 6px; padding: 0 8px; }
  .project select { max-width: 120px; }
  .user-btn { padding: 7px 12px; }
  .toolbox.collapsed { right: auto; }
  body { --sheet: 55vh; }
  body.field-on { --sheet: 40vh; }
  body.panel-open #map { right: 0; bottom: var(--sheet); }
  body.panel-open .field-bar { right: 8px; bottom: calc(var(--sheet) + 8px); }
  .sidebar { top: auto; height: var(--sheet); width: 100%; border-left: none; border-top: 1px solid var(--line); transform: translateY(100%); border-radius: 14px 14px 0 0; }
  body.panel-open .sidebar { transform: none; }
  body.panel-open .fab.locate { right: 64px; bottom: calc(var(--sheet) + 12px); }
  .toolbox { width: auto; right: 64px; padding: 6px; }
  .type-grid { grid-template-columns: repeat(5, 1fr); }
  .type-grid .tool { flex-direction: column; padding: 4px 2px; font-size: 10px; gap: 2px; text-align: center; }
  .type-grid .tool span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}

/* En captura de campo los avisos van arriba para no tapar los botones */
body.field-on .toasts { top: calc(var(--top) + 60px); bottom: auto; }

/* Fotos: botones grandes en teléfono */
.photo-form.touch { flex-direction: column; align-items: stretch; }
.photo-btns { display: flex; gap: 6px; }
.photo-form.touch .photo-btns .btn { flex: 1; justify-content: center; padding: 12px; font-size: 15px; min-height: 46px; }
.cam-quick { width: 100%; justify-content: center; padding: 12px; font-size: 15px; margin-bottom: 12px; }
#photoStatus { margin-top: 6px; min-height: 16px; }

/* Mover elemento / ubicaciones anteriores */
.move-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pos-list li { justify-content: space-between; gap: 8px; cursor: default; border-bottom: 1px solid var(--line); }
.pos-list li > span:first-child { flex: 1; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.leaflet-marker-draggable .node-ico { animation: wiggle 1.2s ease-in-out infinite; outline: 3px solid #38bdf8; outline-offset: 3px; }
@keyframes wiggle { 50% { transform: scale(1.12); } }

/* Árbol de carpetas */
.tree-filter { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; color: var(--text); margin-bottom: 6px; }
.ftree { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: var(--panel2); }
.frow { display: flex; align-items: center; gap: 4px; padding: 3px 2px; border-radius: 6px; }
.frow:hover { background: #ffffff0a; }
.fcaret { background: none; border: none; color: var(--muted); width: 18px; cursor: pointer; padding: 0; }
.frow input[type=checkbox] { margin: 0 2px; }
.fname { flex: 1; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcount { font-size: 11px; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 0 7px; }
.fchildren { padding-left: 16px; border-left: 1px dashed var(--line); margin-left: 9px; }
.fitem { display: flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; white-space: nowrap; overflow: hidden; }
.fitem:hover { background: #ffffff0f; }
.fitem .muted { overflow: hidden; text-overflow: ellipsis; }
.fmore { padding: 4px 6px; }
@media (max-width: 900px) { .frow { padding: 6px 2px; } .fitem { padding: 7px 6px; } }

/* Menú contextual propio */
.ctx-menu { position: fixed; z-index: 2500; min-width: 240px; max-width: 320px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px #000c; padding: 6px; font-size: 13px; }
.ctx-head { padding: 6px 8px 8px; font-weight: 600; display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 12px; }
.ctx-title { padding: 6px 8px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ctx-item { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: none; text-align: left; padding: 7px 8px; border-radius: 7px; cursor: pointer; color: var(--text); }
.ctx-item:hover { background: var(--panel2); }
.ctx-item.danger { color: #fca5a5; }
.ctx-ico { width: 18px; text-align: center; }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.ctx-types { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; padding: 4px 4px 6px; }
.ctx-types button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--panel2); border: 1px solid transparent; border-radius: 7px; padding: 5px 2px; cursor: pointer; font-size: 10px; color: var(--text); }
.ctx-types button:hover { border-color: var(--accent); }
@media (max-width: 900px) { .ctx-item { padding: 11px 8px; font-size: 14px; } }

/* Cable automático */
.tool.wide.auto { background: #134e4a; border-color: #0f766e; color: #ccfbf1; }
.tool.wide.auto.active { background: #0f766e; border-color: #5eead4; }
.span-sel { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.span-sel select { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; color: var(--text); padding: 2px 4px; }
.bad-txt { color: #fca5a5; }
.toolbox.collapsed #btnAutoCable { display: none; }

/* Barra inferior: no tapar zoom/escala; en PC más compacta */
body.bar-on .leaflet-bottom { bottom: var(--fb-h, 120px); }
@media (min-width: 901px) {
  .field-bar { right: auto; width: min(640px, calc(100% - var(--side) - 40px)); }
  body:not(.panel-open) .field-bar { width: min(640px, calc(100% - 90px)); }
  .fb-actions .btn { padding: 9px 6px; min-height: 40px; }
}
body.bar-on .fab.locate { display: none; }

/* Íconos de red dentro de los marcadores */
.node-ico svg { width: 64%; height: 64%; color: #fff; display: block; filter: drop-shadow(0 0 .5px #0006); }
.node-ico.small svg { width: 70%; height: 70%; }
.node-ico.mini svg { width: 68%; height: 68%; }
.node-ico.mini { margin-right: 6px; vertical-align: middle; display: inline-grid; }
.side-head h2 .node-ico.mini, .ctx-head .node-ico.mini, .fitem .node-ico.mini { width: 20px; height: 20px; }
.ico-cell { display: flex; align-items: center; }
.legend .node-ico.mini { width: 18px; height: 18px; }

.node-ico:not(.mini) { width: 34px; height: 34px; }
.node-ico.small:not(.mini) { width: 25px; height: 25px; }
.node-ico svg { stroke-width: 2.2; }
