/* SIGER Map Tools — paneles tácticos (patrón SIGEMIN, motor Leaflet) */
.siger-mt-panel {
  position: absolute;
  z-index: 1200;
  width: 320px;
  max-height: min(70vh, 520px);
  background: rgba(18, 18, 18, 0.96);
  border: 1px solid #333;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
  color: #e2e8f0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Roboto', sans-serif;
}
.siger-mt-panel.open { display: flex; }
.siger-mt-panel.dock-right {
  position: fixed;
  right: 72px;
  top: 75px;
}
.siger-mt-panel.dock-dashboard {
  position: fixed;
  /* se ajusta vía JS en dashboard */
}
.siger-mt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #111;
  border-bottom: 1px solid #333;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #94a3b8;
}
.siger-mt-header button {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
}
.siger-mt-header button:hover { color: #fff; }
.siger-mt-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}
.siger-mt-body::-webkit-scrollbar { width: 4px; }
.siger-mt-body::-webkit-scrollbar-thumb { background: #333; }

.siger-mt-basemap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.siger-mt-basemap button {
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: #e2e8f0;
  transition: border-color 0.15s;
}
.siger-mt-basemap button:hover,
.siger-mt-basemap button.active {
  border-color: #38bdf8;
}
.siger-mt-basemap .preview {
  height: 72px;
  background: #111;
  overflow: hidden;
  position: relative;
}
.siger-mt-basemap .preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.siger-mt-basemap .label {
  display: block;
  padding: 6px 8px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
}

.siger-mt-layer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 3px;
  margin-bottom: 6px;
}
.siger-mt-layer-row .meta { flex: 1; min-width: 0; }
.siger-mt-layer-row .name {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.siger-mt-layer-row .type {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.siger-mt-layer-row .del {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
}
.siger-mt-layer-row .del:hover { color: #ff003c; }

.siger-mt-toggle {
  position: relative;
  width: 28px;
  height: 16px;
  flex-shrink: 0;
}
.siger-mt-toggle input { opacity: 0; width: 0; height: 0; }
.siger-mt-toggle span {
  position: absolute;
  inset: 0;
  background: #333;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}
.siger-mt-toggle span::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.siger-mt-toggle input:checked + span { background: #38bdf8; }
.siger-mt-toggle input:checked + span::after { transform: translateX(12px); }

.siger-mt-field { margin-bottom: 10px; }
.siger-mt-field label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
}
.siger-mt-field input,
.siger-mt-field select,
.siger-mt-field textarea {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 3px;
  color: #fff;
  padding: 8px 10px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
  box-sizing: border-box;
}
.siger-mt-field input:focus,
.siger-mt-field select:focus,
.siger-mt-field textarea:focus { border-color: #38bdf8; }
.siger-mt-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
.siger-mt-tabs button {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid #333;
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 4px;
  cursor: pointer;
  border-radius: 3px;
}
.siger-mt-tabs button.active {
  color: #38bdf8;
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}
.siger-mt-tabs-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 4px;
}
.siger-mt-tabs-4 button {
  padding: 8px 2px;
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.siger-mt-tabs-4 button.active {
  color: #fff;
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
}
.siger-mt-panel[data-panel="add"] {
  width: 360px;
  border-top: 2px solid #fbbf24;
}
.siger-mt-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.siger-mt-actions button {
  flex: 1;
  border: none;
  border-radius: 3px;
  padding: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.siger-mt-btn-primary {
  background: #2563eb;
  color: #fff;
}
.siger-mt-btn-primary:hover { background: #1d4ed8; }
.siger-mt-btn-ghost {
  background: #111;
  color: #94a3b8;
  border: 1px solid #333 !important;
}
.siger-mt-hint {
  font-size: 10px;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 10px;
}
.siger-mt-empty {
  text-align: center;
  padding: 24px 12px;
  color: #64748b;
  font-size: 11px;
}

.siger-mt-measure-modes {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.siger-mt-measure-modes button {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid #333;
  color: #94a3b8;
  border-radius: 3px;
  padding: 10px 6px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.siger-mt-measure-modes button.active {
  border-color: #38bdf8;
  color: #38bdf8;
}
.siger-mt-measure-result {
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 3px;
  padding: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #38bdf8;
  text-align: center;
  margin-bottom: 10px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.siger-mt-measure-result .unit { color: #64748b; font-size: 10px; margin-left: 6px; }

.tool-btn.siger-mt-active {
  background: #1e293b !important;
  color: #38bdf8 !important;
  border-color: #38bdf8 !important;
}

.leaflet-container.siger-mt-crosshair { cursor: crosshair !important; }

.siger-mt-draw-tools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.siger-mt-draw-tools button {
  background: #0a0a0a;
  border: 1px solid #333;
  color: #94a3b8;
  border-radius: 3px;
  padding: 8px 4px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.siger-mt-draw-tools button i { font-size: 14px; }
.siger-mt-draw-tools button:hover,
.siger-mt-draw-tools button.active {
  border-color: #38bdf8;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}
.siger-mt-check {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
  cursor: pointer;
}
.siger-mt-field input[type="color"] {
  height: 34px;
  padding: 2px 4px;
  cursor: pointer;
}
.siger-map-label {
  background: transparent !important;
  border: none !important;
}
.siger-map-label span {
  pointer-events: none;
}

.siger-mt-views-list { display: flex; flex-direction: column; gap: 6px; }
.siger-mt-view-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 3px;
}
.siger-mt-view-go {
  width: 28px; height: 28px;
  border: 1px solid #333;
  border-radius: 3px;
  background: #111;
  color: #38bdf8;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.siger-mt-view-go:hover { border-color: #38bdf8; background: #1e293b; }
.siger-mt-view-row .meta { flex: 1; min-width: 0; }
.siger-mt-view-name {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 4px;
  outline: none;
  box-sizing: border-box;
}
.siger-mt-view-name:focus { border-color: #38bdf8; background: #111; }
.siger-mt-view-row .type {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  color: #64748b;
  margin-top: 2px;
  padding-left: 4px;
}
