.app-mapa-view {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
  contain: layout style;
}

.app-mapa-status-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%);
}

.app-mapa-status-banner-title {
  font-size: 13px;
  font-weight: 900;
  color: #1e40af;
  letter-spacing: 0.02em;
}

.app-mapa-status-banner-state {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #cbd5e1;
}

.app-mapa-meta-lines {
  width: 100%;
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-mapa-meta-line {
  font-size: 11px;
  color: #475569;
  line-height: 1.35;
}

.app-mapa-meta-line--persist:not([hidden]) {
  color: #047857;
  font-weight: 600;
}

.app-mapa-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.app-mapa-tool-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.app-mapa-tool-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.app-mapa-tool-btn--danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.app-mapa-tool-btn--danger:hover {
  border-color: #f87171;
  background: #fee2e2;
}

.app-mapa-tool-btn--legacy {
  border-color: #2b6954;
  color: #14532d;
  background: #ecfdf5;
}

.app-mapa-tool-btn--legacy:hover {
  border-color: #166534;
  background: #d1fae5;
}

.app-mapa-mini-cta {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  background: #0f172a;
  color: #fff;
  text-decoration: none;
}

.app-mapa-mini-cta:hover {
  opacity: 0.92;
}

.app-mapa-slot.is-cell-query-match {
  outline: 2px solid rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.app-mapa-noresults {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.app-mapa-bucket--orphan {
  border-color: #fecaca;
  background: #fffefe;
}

.app-mapa-bucket--limbo {
  border-color: #fde68a;
}

.app-mapa-bucket--taller {
  border-color: #cbd5e1;
}

.app-mapa-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.app-mapa-head h1 {
  margin: 0;
  font-size: 22px;
  color: #0f172a;
}

.app-mapa-head p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
}

.app-mapa-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border-radius: 999px;
  padding: 5px 10px;
}

.app-mapa-badge-dnd {
  background: #ede9fe;
  color: #5b21b6;
}

.app-mapa-badge-persist {
  background: #ccfbf1;
  color: #0f766e;
}

.app-mapa-badge--official {
  background: #ecfdf5;
  color: #14532d;
  border: 1px solid #bbf7d0;
}

.app-mapa-detail-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

.app-mapa-detail-link {
  font-size: 13px;
  font-weight: 700;
  color: #2b6954;
  text-decoration: none;
}

.app-mapa-detail-link:hover {
  text-decoration: underline;
}

.app-mapa-list-row.is-query-match {
  box-shadow: inset 0 0 0 2px rgba(250, 204, 21, 0.85);
}

.app-mapa-head .app-mapa-badge + .app-mapa-badge-dnd,
.app-mapa-head .app-mapa-badge-dnd + .app-mapa-badge-persist {
  margin-left: 6px;
}

/* Confirmación persistencia DnD (sin alert nativo) */
.app-mapa-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100200;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
}

.app-mapa-modal {
  width: min(420px, 100%);
  border-radius: 14px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

.app-mapa-modal-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.app-mapa-modal-body {
  margin: 0 0 18px;
  font-size: 14px;
  color: #475569;
  line-height: 1.45;
}

.app-mapa-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.app-mapa-modal-btn {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}

.app-mapa-modal-btn--ghost {
  border-color: #cbd5e1;
  background: #fff;
  color: #334155;
}

.app-mapa-modal-btn--primary {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.app-mapa-dnd-hint {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.app-mapa-unit--dnd {
  cursor: grab;
}

.app-mapa-unit.is-drag-origin {
  opacity: 0.35;
  transform: scale(0.88);
  filter: grayscale(0.4);
  transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.app-mapa-drop-zone.app-mapa-drop-hover,
.app-mapa-slot.app-mapa-drop-hover,
.spot.app-mapa-drop-hover {
  outline: 2px dashed rgba(43, 105, 84, 0.55);
  background: rgba(236, 253, 245, 0.65);
}

.app-mapa-drop-zone.app-mapa-drop-invalid,
.app-mapa-slot.app-mapa-drop-invalid,
.spot.app-mapa-drop-invalid {
  outline: 2px dashed rgba(220, 38, 38, 0.45);
  background: rgba(254, 242, 242, 0.55);
}

@keyframes appGhostPopIn {
  0%   { opacity: 0; transform: scale(0.5); }
  65%  { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes appGhostPopOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.55); }
}

.app-mapa-dnd-ghost {
  position: fixed;
  z-index: 12000;
  pointer-events: none;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
  animation: appGhostPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.app-mapa-dnd-ghost.ghost-removing {
  animation: appGhostPopOut 0.15s ease-in forwards;
}

.app-mapa-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #2b6954;
  color: #2b6954;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  background: #fff;
}

.app-mapa-note {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.app-mapa-status {
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.app-mapa-status.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.app-mapa-status.is-loading {
  min-height: 240px;
  display: grid;
  place-items: center;
  color: #334155;
  overflow: hidden;
}

.app-mapa-loading-shell {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.app-mapa-loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid #dbeafe;
  border-top-color: #1d4ed8;
  animation: appMapaSpin .8s linear infinite;
}

.app-mapa-loading-shell strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.app-mapa-loading-shell small {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

@keyframes appMapaSpin {
  to { transform: rotate(360deg); }
}

.app-mapa-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.app-mapa-summary-filter strong {
  color: #2b6954;
}

.app-mapa-summary article {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
}

.app-mapa-summary span {
  display: block;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
}

.app-mapa-summary strong {
  color: #0f172a;
  font-size: 16px;
}

.app-mapa-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 12px;
}

.app-mapa-layout--grid .app-mapa-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-mapa-results-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 8px 12px;
}

.app-mapa-canvas {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
}

.app-mapa-canvas-viewport {
  max-height: min(78vh, 920px);
  overflow: auto;
  border-radius: 12px;
  background-color: #f1f5f9;
  background-image:
    linear-gradient(rgba(43, 105, 84, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 105, 84, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  padding: 10px;
}

.app-mapa-canvas-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}

.app-mapa-row-label {
  grid-column: 1 / -1;
  padding: 8px 10px;
  font-weight: 800;
  font-size: 13px;
  color: #0f172a;
  background: linear-gradient(90deg, #ecfdf5, transparent);
  border-radius: 8px;
}

.app-mapa-row-label small {
  display: block;
  font-weight: 600;
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

.app-mapa-row-decor {
  grid-column: 1 / -1;
  font-size: 11px;
  color: #64748b;
  padding: 4px 8px;
  border-left: 3px solid #cbd5e1;
}

.app-mapa-decor-type {
  font-weight: 800;
  text-transform: uppercase;
  margin-right: 8px;
}

.app-mapa-slot {
  border: 1px solid #cfe8dc;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  min-height: 96px;
  display: flex;
  flex-direction: column;
}

.app-mapa-slot.is-filter-dim {
  opacity: 0.42;
}

.app-mapa-slot.is-blocked {
  border-color: #fca5a5;
  background: #fef2f2;
}

.app-mapa-slot.is-reserved {
  border-color: #fcd34d;
}

.app-mapa-slot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #ecfdf5;
  background: linear-gradient(#fff, #f8fafc);
}

.app-mapa-slot-label {
  font-weight: 900;
  font-size: 13px;
  color: #0f172a;
}

.app-mapa-slot-zone {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

.app-mapa-slot-body {
  flex: 1;
  padding: 8px;
}

.app-mapa-slot-units {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-mapa-slot-empty {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
  padding: 8px;
  text-align: center;
}

.app-mapa-pill {
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 8px;
}

.app-mapa-pill--blocked {
  background: #fee2e2;
  color: #991b1b;
}

.app-mapa-pill--reserved {
  background: #fef3c7;
  color: #92400e;
}

.app-mapa-buckets {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-mapa-bucket {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.app-mapa-bucket-head {
  font-size: 12px;
  font-weight: 800;
  color: #334155;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-mapa-bucket-count {
  font-size: 11px;
  color: #64748b;
}

.app-mapa-bucket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.app-mapa-unit--dim {
  opacity: 0.45;
}

.app-mapa-unit.is-query-match {
  box-shadow: 0 0 0 2px #facc15;
}

.app-mapa-detail-placeholder {
  color: #64748b;
  font-size: 13px;
}

.app-mapa-zones {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-mapa-zone {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.app-mapa-zone-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.app-mapa-zone-head h3 {
  margin: 0;
  font-size: 14px;
  color: #0f172a;
}

.app-mapa-zone-head span {
  color: #64748b;
  font-size: 12px;
}

.app-mapa-zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.app-mapa-unit {
  border: 1px solid #dbeafe;
  background: #f8fafc;
  border-radius: 9px;
  padding: 7px 8px;
  text-align: left;
  cursor: pointer;
}

.app-mapa-unit.is-selected {
  border-color: #2b6954;
  background: #ecfdf5;
}

.app-mapa-unit-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.app-mapa-unit-top .app-mapa-unit-state {
  margin-left: auto;
}

.app-mapa-unit-inc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.app-mapa-inc-crit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #b91c1c;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.app-mapa-inc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 0 5px;
  height: 18px;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.app-mapa-inc-summary {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #f8fafc;
}

.app-mapa-inc-summary--pending {
  background: #fffbeb;
  border-color: #fde68a;
}

.app-mapa-inc-summary-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.app-mapa-inc-stats {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.app-mapa-inc-stats li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #475569;
}

.app-mapa-inc-stats li strong {
  color: #0f172a;
}

.app-mapa-inc-last {
  flex-direction: column;
  align-items: flex-start;
}

.app-mapa-inc-last span:last-child {
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.app-mapa-inc-muted {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.app-mapa-mini-cta--block {
  display: block;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.app-mapa-unit-meta,
.app-mapa-unit-zona {
  font-size: 11px;
  color: #475569;
  margin-top: 3px;
  line-height: 1.3;
}

.app-mapa-unit-state {
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 6px;
  background: #e2e8f0;
  color: #334155;
}

.app-mapa-unit-state.is-listo { background: #dcfce7; color: #166534; }
.app-mapa-unit-state.is-sucio { background: #fef3c7; color: #92400e; }
.app-mapa-unit-state.is-mantenimiento { background: #fee2e2; color: #991b1b; }
.app-mapa-unit-state.is-traslado { background: #ede9fe; color: #5b21b6; }

.app-mapa-detail {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  height: fit-content;
  position: sticky;
  top: 8px;
}

.app-mapa-detail-hero {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.app-mapa-detail-mva-title {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #0f172a;
  word-break: break-word;
}

.app-mapa-detail-posline,
.app-mapa-detail-subline {
  margin: 0 0 4px;
  font-size: 13px;
  color: #334155;
  line-height: 1.4;
}

.app-mapa-detail-k {
  font-weight: 700;
  color: #64748b;
  margin-right: 6px;
}

.app-mapa-detail-v {
  font-weight: 800;
  color: #0f172a;
}

.app-mapa-detail-fields {
  margin-top: 4px;
}

.app-mapa-detail h3 {
  margin: 0 0 10px;
  color: #0f172a;
}

.app-mapa-detail p {
  margin: 0 0 8px;
  font-size: 13px;
  color: #334155;
}

.app-mapa-state {
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
}

.app-mapa-state-empty {
  background: #f8fafc;
  color: #475569;
}

.app-mapa-state-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.app-mapa-state-error-msg {
  margin: 0;
  font-weight: 600;
  line-height: 1.45;
}

.app-mapa-legacy-fallback {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid #fecaca;
  font-size: 12px;
  color: #7f1d1d;
  line-height: 1.4;
}

.app-mapa-legacy-fallback-link {
  font-weight: 800;
  color: #991b1b;
}

.app-mapa-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
}

.app-mapa-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  max-width: 100%;
}

@media (max-width: 900px) {
  .app-mapa-quick {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scrollbar-width: thin;
    gap: 8px;
  }
  .app-mapa-quick-label {
    flex: 0 0 auto;
  }
  .app-mapa-qf {
    flex: 0 0 auto;
  }
}

.app-mapa-quick-label {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  margin-right: 4px;
}

.app-mapa-qf,
button.app-mapa-view {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.app-mapa-qf.is-active,
button.app-mapa-view.is-active {
  border-color: #2b6954;
  background: #ecfdf5;
  color: #14532d;
}

.app-mapa-view-toggle {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.app-mapa-layout--list {
  grid-template-columns: minmax(0, 1fr) 300px !important;
}

.app-mapa-list-scroll {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  max-height: min(70vh, 720px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.app-mapa-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.app-mapa-list-table th,
.app-mapa-list-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
}

.app-mapa-list-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  font-size: 10px;
  text-transform: uppercase;
  color: #64748b;
  z-index: 1;
}

.app-mapa-list-row {
  cursor: pointer;
}

.app-mapa-list-row:hover {
  background: #f8fafc;
}

.app-mapa-list-row.is-selected {
  background: #ecfdf5;
}

.app-mapa-list-actions {
  min-width: 210px;
}

.app-mapa-list-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 2px 3px 2px 0;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.app-mapa-list-action:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.app-mapa-list-empty {
  padding: 24px;
  text-align: center;
  color: #94a3b8;
}

.app-mapa-copy-mva {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  color: #0f172a;
}

.app-mapa-copy-mva:hover {
  border-color: #94a3b8;
}

.app-mapa-detail-actions-top {
  margin: 0 0 10px;
}

.app-mapa-actions {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.app-mapa-actions h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.app-mapa-actions-group {
  margin-top: 10px;
}

.app-mapa-actions-title {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 800;
  color: #64748b;
}

.app-mapa-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.app-mapa-actions-grid--quick .app-mapa-detail-link,
.app-mapa-actions-grid--quick .app-mapa-copy-mva {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 34px;
}

.app-mapa-action-btn {
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.app-mapa-action-btn--primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
}

.app-mapa-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-mapa-actions-legacy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.app-mapa-actions-legacy-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  color: #334155;
}

.app-mapa-actions-legacy-list small,
.app-mapa-actions-muted {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

.app-mapa-modal--unit-action {
  width: min(460px, 100%);
}

.app-mapa-form-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.app-mapa-form-field {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #334155;
}

.app-mapa-form-field span {
  font-weight: 700;
}

.app-mapa-form-field input,
.app-mapa-form-field select,
.app-mapa-form-field textarea {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 9px;
  font-size: 12px;
  font-family: inherit;
  color: #0f172a;
  background: #fff;
}

.app-mapa-form-field--check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-mapa-form-msg {
  min-height: 16px;
  margin: 0 0 8px;
  font-size: 12px;
  color: #b45309;
}

.app-mapa-mini-history {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 0;
  list-style: none;
}

.app-mapa-mini-history li {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  padding: 8px;
}

.app-mapa-quick-history {
  border-color: rgba(14, 165, 233, .28);
  background: linear-gradient(180deg, rgba(14, 165, 233, .10), rgba(15, 23, 42, .02));
}

.app-mapa-mini-history strong,
.app-mapa-mini-history span,
.app-mapa-mini-history small {
  display: block;
}

.app-mapa-mini-history strong {
  font-size: 12px;
  color: #0f172a;
}

.app-mapa-mini-history span {
  margin-top: 2px;
  font-size: 11px;
  color: #0f766e;
  font-weight: 800;
}

.app-mapa-mini-history small {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}

.app-mapa-detail-foot {
  display: block;
  margin-top: 10px;
  color: #94a3b8;
}

@media (max-width: 1024px) {
  .app-mapa-summary {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .app-mapa-layout {
    grid-template-columns: 1fr;
  }
  .app-mapa-layout--list {
    grid-template-columns: 1fr !important;
  }
  .app-mapa-detail {
    position: static;
  }
}

@media (max-width: 640px) {
  .app-mapa-view { padding: 12px; }
  .app-mapa-zone-grid {
    grid-template-columns: 1fr;
  }
  .app-mapa-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: 6px;
  }
  .app-mapa-tool-btn {
    flex: 0 0 auto;
  }
  .app-mapa-head .app-mapa-cta {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }
  .app-mapa-canvas-viewport {
    max-height: min(62vh, 720px);
  }
}

@media (max-width: 390px) {
  .app-mapa-actions-grid {
    grid-template-columns: 1fr;
  }
  .app-mapa-actions-legacy-list li {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 14G — 15G: sin fondo claro en section (ganaba especificidad y “lavaba” el patio oscuro). */
section.app-mapa-view.app-mapa-operativo {
  background: #0b1220;
}

.app-mapa-status-banner {
  border-color: rgba(148, 163, 184, 0.22);
  background: #111827;
  box-shadow: none;
}

.app-mapa-toolbar,
.app-mapa-controls {
  padding: 7px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0;
  background: #111827;
  box-shadow: none;
}

.app-mapa-tool-btn,
.app-mapa-qf,
button.app-mapa-view,
.app-mapa-copy-mva,
.app-mapa-detail-link,
.app-mapa-action-btn {
  min-height: 34px;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.app-mapa-tool-btn--legacy,
.app-mapa-action-btn--primary {
  border-color: #0f766e;
  background: linear-gradient(160deg, #0f766e 0%, #115e59 100%);
  color: #fff;
}

.app-mapa-layout {
  align-items: start;
}

.app-mapa-canvas {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.app-mapa-canvas-viewport {
  max-height: min(78vh, 920px);
  min-height: clamp(420px, 62vh, 760px);
  padding: clamp(12px, 2vw, 22px);
  border-radius: 0;
  background-color: #1e293b;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
}

.app-mapa-canvas-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 28px 15px;
  min-width: min(980px, max-content);
}

.app-mapa-row-label {
  align-self: end;
  padding: 7px 14px;
  border-radius: 6px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.28);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.app-mapa-row-label small {
  color: #94a3b8;
}

.app-mapa-row-decor {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(148, 163, 184, 0.6);
  border-radius: 14px;
  color: #cbd5e1;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.05), rgba(255,255,255,.05) 10px, rgba(0,0,0,.12) 10px, rgba(0,0,0,.12) 20px);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-mapa-slot {
  position: relative;
  min-height: 112px;
  overflow: visible;
  border: 0;
  border-left: 2px solid rgba(255, 255, 255, 0.16);
  border-right: 2px solid rgba(255, 255, 255, 0.16);
  border-top: 2px solid rgba(255, 255, 255, 0.16);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.app-mapa-slot::after {
  content: none;
  display: none;
}

.app-mapa-slot-head {
  min-height: 20px;
  justify-content: center;
  padding: 0 4px;
  border: 0;
  background: transparent;
  transform: translateY(-22px);
}

.app-mapa-slot-label {
  color: rgba(226, 232, 240, 0.82);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.app-mapa-slot-zone,
.app-mapa-pill {
  display: none;
}

.app-mapa-slot-body {
  min-height: 96px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 4px;
}

.app-mapa-slot-units,
.app-mapa-slot-units .app-mapa-unit {
  width: 100%;
  min-height: 96px;
}

.app-mapa-slot-empty {
  align-self: center;
  color: rgba(203, 213, 225, 0.56);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.app-mapa-slot.is-blocked {
  background: rgba(127, 29, 29, 0.38);
  border-color: rgba(248, 113, 113, 0.65);
}

.app-mapa-slot.is-reserved {
  background: rgba(120, 53, 15, 0.34);
  border-color: rgba(251, 191, 36, 0.62);
}

.app-mapa-drop-zone.app-mapa-drop-hover,
.app-mapa-slot.app-mapa-drop-hover,
.spot.app-mapa-drop-hover {
  outline: 4px solid rgba(34, 197, 94, 0.88);
  outline-offset: 3px;
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.36);
}

.app-mapa-drop-zone.app-mapa-drop-invalid,
.app-mapa-slot.app-mapa-drop-invalid,
.spot.app-mapa-drop-invalid {
  outline: 4px solid rgba(239, 68, 68, 0.9);
  outline-offset: 3px;
  box-shadow: 0 0 22px rgba(239, 68, 68, 0.34);
}

.app-mapa-unit {
  position: relative;
  overflow: hidden;
  min-height: 82px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 16px 16px 10px 10px;
  padding: 8px;
  color: #fff;
  background: linear-gradient(160deg, #475569 0%, #334155 100%);
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  box-shadow:
    0 8px 24px -4px rgba(0, 0, 0, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s ease, opacity 0.18s ease;
}

.app-mapa-unit:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 14px 32px -4px rgba(0, 0, 0, 0.6),
    0 3px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.app-mapa-unit.is-selected {
  outline: 4px solid #fbbf24;
  outline-offset: 2px;
  border-color: rgba(251, 191, 36, 0.9);
  background: linear-gradient(160deg, #0f766e 0%, #115e59 100%);
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.62), 0 14px 32px rgba(0,0,0,.42);
}

.app-mapa-unit.is-listo {
  background: linear-gradient(160deg, #0d9488 0%, #0f766e 100%);
}

.app-mapa-unit.is-sucio {
  background: linear-gradient(160deg, #d97706 0%, #b45309 100%);
}

.app-mapa-unit.is-mantenimiento,
.app-mapa-unit.is-taller {
  background: linear-gradient(160deg, #dc2626 0%, #991b1b 100%);
}

.app-mapa-unit.is-traslado {
  background: linear-gradient(160deg, #7c3aed 0%, #5b21b6 100%);
}

.app-mapa-unit.is-no-arrendable,
.app-mapa-unit.is-retenida,
.app-mapa-unit.is-venta {
  background: linear-gradient(160deg, #475569 0%, #1e293b 100%);
}

.app-mapa-unit-top {
  justify-content: center;
  min-height: 26px;
}

.app-mapa-unit-top strong {
  width: 100%;
  display: block;
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.app-mapa-unit-top .app-mapa-unit-state {
  position: absolute;
  right: 7px;
  top: 7px;
  margin-left: 0;
}

.app-mapa-unit-state {
  background: rgba(15, 23, 42, 0.42) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.18);
  max-width: 48%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.app-mapa-unit-inc {
  position: absolute;
  left: 7px;
  top: 7px;
}

.app-mapa-inc-crit {
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(255,255,255,.22);
}

.app-mapa-inc-badge {
  background: #2563eb;
  box-shadow: 0 0 0 2px rgba(255,255,255,.2);
}

.app-mapa-unit-meta,
.app-mapa-unit-zona {
  color: rgba(255,255,255,.78);
  text-shadow: none;
  text-align: center;
}

.app-mapa-unit-zona {
  display: none;
}

.app-mapa-gas {
  position: relative;
  width: min(72px, 82%);
  height: 14px;
  margin: 8px auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(255,255,255,.24);
}

.app-mapa-gas-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: #22c55e;
}

.app-mapa-gas.is-mid .app-mapa-gas-fill {
  background: #f59e0b;
}

.app-mapa-gas.is-low .app-mapa-gas-fill,
.app-mapa-gas.is-empty .app-mapa-gas-fill {
  background: #ef4444;
}

.app-mapa-gas-text {
  position: relative;
  z-index: 1;
  display: block;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 13px;
  text-align: center;
}

.app-mapa-buckets {
  margin-top: 14px;
}

.app-mapa-bucket {
  border-radius: 0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.55);
  box-shadow: none;
}

.app-mapa-bucket--taller {
  background: rgba(30, 27, 10, 0.45);
  border-color: rgba(253, 224, 71, 0.35);
}

.app-mapa-bucket-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.app-mapa-bucket-grid .app-mapa-unit {
  min-height: 0;
  color: #e2e8f0;
  text-align: left;
  text-shadow: none;
  background: rgba(30, 41, 59, 0.9);
  border-left: 3px solid #38bdf8;
  border-radius: 6px;
  box-shadow: none;
}

.app-mapa-bucket--taller .app-mapa-unit {
  border-left-color: #f59e0b;
}

.app-mapa-bucket-grid .app-mapa-unit-top strong,
.app-mapa-bucket-grid .app-mapa-unit-meta,
.app-mapa-bucket-grid .app-mapa-unit-zona {
  color: #e2e8f0;
  text-align: left;
}

.app-mapa-bucket-grid .app-mapa-unit-state {
  color: #e2e8f0 !important;
  background: rgba(15, 23, 42, 0.55) !important;
  border-color: rgba(148, 163, 184, 0.35);
}

.app-mapa-bucket-grid .app-mapa-gas {
  margin-left: 0;
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.35);
}

.app-mapa-detail {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  box-shadow: none;
}

.app-mapa-detail-hero {
  margin: -12px -12px 12px;
  padding: 16px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(160deg, #0f172a 0%, #1f2937 52%, #0f766e 100%);
  color: #fff;
}

.app-mapa-detail-mva-title,
.app-mapa-detail-posline,
.app-mapa-detail-subline,
.app-mapa-detail-k,
.app-mapa-detail-v {
  color: inherit;
}

.app-mapa-detail-k {
  opacity: .72;
}

.app-mapa-actions {
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.app-mapa-actions-legacy-list li {
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
}

/* 15C visual correction: real legacy-style operational map */
.app-mapa-view {
  min-height: calc(100vh - 74px);
  gap: 8px;
  padding: 10px 12px 14px;
  overflow-x: hidden;
  background: #0b1220 !important;
  color: #e5eefb;
}

.app-mapa-view::before,
.app-mapa-view::after,
.app-mapa-canvas::before,
.app-mapa-canvas::after,
.app-mapa-canvas-viewport::before,
.app-mapa-canvas-viewport::after {
  content: none !important;
  display: none !important;
}

.app-mapa-status-banner {
  padding: 8px 10px;
  border-radius: 0;
  border: 1px solid rgba(148, 163, 184, .2);
  background: #111827 !important;
  box-shadow: none;
}

.app-mapa-status-banner-title {
  color: #38bdf8;
}

.app-mapa-status-banner-state {
  border-radius: 5px;
  border-color: rgba(56, 189, 248, .32);
  background: rgba(56, 189, 248, .14);
  color: #dff6ff;
}

.app-mapa-meta-lines {
  width: auto;
  flex-basis: auto;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.app-mapa-meta-line {
  color: #9aa8bc;
}

.app-mapa-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, .2);
  background: #101a2c;
}

.app-mapa-head h1 {
  margin: 3px 0 0;
  color: #f8fafc;
  font-size: clamp(24px, 2.5vw, 36px);
  line-height: 1;
}

.app-mapa-head p,
.app-mapa-note,
.app-mapa-detail p {
  color: #9aa8bc;
}

.app-mapa-badge {
  border-radius: 4px;
}

.app-mapa-badge--official {
  background: rgba(20, 184, 166, .16);
  color: #99f6e4;
  border: 1px solid rgba(45, 212, 191, .24);
}

.app-mapa-head .app-mapa-cta {
  border-radius: 6px;
  border-color: #38bdf8;
  background: #0f172a;
  color: #e0f2fe;
}

.app-mapa-toolbar,
.app-mapa-controls {
  padding: 7px;
  border-radius: 0;
  border: 1px solid rgba(148, 163, 184, .2);
  background: #111827 !important;
  box-shadow: none;
}

.app-mapa-tool-btn,
.app-mapa-qf,
button.app-mapa-view,
.app-mapa-copy-mva,
.app-mapa-detail-link,
.app-mapa-action-btn {
  min-height: 28px;
  border-radius: 5px;
  border-color: rgba(148, 163, 184, .28);
  background: #1f2937;
  color: #dbeafe;
  padding: 6px 9px;
  font-size: 11px;
  box-shadow: none;
}

.app-mapa-tool-btn:hover,
.app-mapa-qf:hover,
.app-mapa-copy-mva:hover,
.app-mapa-detail-link:hover,
.app-mapa-action-btn:hover {
  border-color: #38bdf8;
  background: #24344d;
}

.app-mapa-tool-btn--legacy,
.app-mapa-action-btn--primary {
  border-color: #14b8a6;
  background: #0f766e !important;
  color: #ecfeff;
}

.app-mapa-qf.is-active,
button.app-mapa-view.is-active {
  border-color: #7dd3fc;
  background: #38bdf8;
  color: #082f49;
}

.app-mapa-note {
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, .18);
  background: #0f172a;
  border-radius: 0;
}

.app-mapa-summary {
  grid-template-columns: repeat(5, minmax(116px, 1fr));
  gap: 6px;
}

.app-mapa-summary article {
  border-radius: 0;
  border-color: rgba(148, 163, 184, .2);
  background: #111827;
  padding: 8px 10px;
}

.app-mapa-summary span {
  color: #9aa8bc;
  font-size: 10px;
}

.app-mapa-summary strong {
  color: #f8fafc;
  font-size: 18px;
}

.app-mapa-layout {
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 8px;
}

.app-mapa-layout--grid .app-mapa-main {
  gap: 8px;
  min-width: 0;
}

.app-mapa-canvas {
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 0;
  padding: 8px;
  background: #050b14 !important;
  box-shadow: none;
}

.app-mapa-canvas-viewport {
  min-height: clamp(520px, 72vh, 860px);
  max-height: calc(100vh - 270px);
  padding: 20px 18px 14px;
  border-radius: 0;
  border: 1px solid rgba(148, 163, 184, .12);
  background-color: #182231;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 22px 22px;
}

.app-mapa-canvas-inner {
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 20px 8px;
  min-width: 980px;
}

.app-mapa-row-label {
  padding: 5px 8px;
  border-radius: 0;
  border: 1px solid rgba(148, 163, 184, .2);
  background: #0f172a;
  color: #dbeafe;
  font-size: 10px;
  letter-spacing: .08em;
}

.app-mapa-row-decor {
  min-height: 42px;
  border-radius: 0;
  border-color: rgba(148, 163, 184, .34);
  background: rgba(15, 23, 42, .72);
}

.app-mapa-slot {
  min-height: 92px;
  border-left: 1px solid rgba(226, 232, 240, .28);
  border-right: 1px solid rgba(226, 232, 240, .28);
  border-top: 1px solid rgba(226, 232, 240, .28);
  border-radius: 3px 3px 0 0;
  background: rgba(255, 255, 255, .028);
}

.app-mapa-slot-head {
  min-height: 16px;
  transform: translateY(-18px);
}

.app-mapa-slot-label {
  font-size: 9px;
  color: rgba(226, 232, 240, .78);
}

.app-mapa-slot-body {
  min-height: 78px;
  padding: 3px;
}

.app-mapa-slot-units,
.app-mapa-slot-units .app-mapa-unit {
  min-height: 78px;
}

.app-mapa-slot-empty {
  font-size: 9px;
  color: rgba(203, 213, 225, .38);
}

.app-mapa-unit {
  min-height: 64px;
  border-radius: 7px;
  padding: 5px 5px 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.18);
}

.app-mapa-unit:hover {
  transform: translateY(-1px);
}

.app-mapa-unit.is-selected {
  outline: 2px solid #fbbf24;
  outline-offset: 1px;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, .18), 0 6px 16px rgba(0,0,0,.4);
}

.app-mapa-unit-top strong {
  font-size: clamp(13px, 1vw, 16px);
}

.app-mapa-unit-top .app-mapa-unit-state {
  right: 4px;
  top: 4px;
}

.app-mapa-unit-state {
  max-width: 42%;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 8px;
}

.app-mapa-unit-inc {
  left: 4px;
  top: 4px;
}

.app-mapa-unit-meta {
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.2;
}

.app-mapa-gas {
  width: min(56px, 74%);
  height: 10px;
  margin-top: 5px;
}

.app-mapa-gas-text {
  font-size: 8px;
  line-height: 9px;
}

.app-mapa-buckets {
  margin-top: 8px;
}

.app-mapa-bucket {
  border-radius: 0;
  border-color: rgba(148, 163, 184, .22);
  background: #111827;
  box-shadow: none;
}

.app-mapa-bucket-head {
  background: #0f172a;
  color: #dbeafe;
}

.app-mapa-bucket-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.app-mapa-detail {
  top: 8px;
  border-radius: 0;
  border-color: rgba(148, 163, 184, .22);
  background: #101a2c;
  color: #dbeafe;
  box-shadow: none;
}

.app-mapa-detail-hero {
  margin: -12px -12px 10px;
  border-radius: 0;
  background: #0f172a !important;
  border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.app-mapa-detail-fields,
.app-mapa-inc-summary,
.app-mapa-actions {
  border-color: rgba(148, 163, 184, .2);
  background: #0f172a;
  color: #dbeafe;
}

.app-mapa-actions {
  border-radius: 0;
}

.app-mapa-actions h3,
.app-mapa-inc-summary-title,
.app-mapa-detail h3,
.app-mapa-detail-mva-title,
.app-mapa-detail-v {
  color: #f8fafc;
}

.app-mapa-actions-title,
.app-mapa-actions-muted,
.app-mapa-inc-muted,
.app-mapa-detail-k,
.app-mapa-detail-foot {
  color: #9aa8bc;
}

.app-mapa-actions-legacy-list li,
.app-mapa-mini-history li {
  border-color: rgba(148, 163, 184, .2);
  background: #111827;
  color: #dbeafe;
}

.app-mapa-list-scroll,
.app-mapa-list-table th {
  border-color: rgba(148, 163, 184, .2);
  background: #0f172a;
}

.app-mapa-list-table td,
.app-mapa-list-table th {
  border-bottom-color: rgba(148, 163, 184, .12);
  color: #dbeafe;
}

.app-mapa-list-row:hover,
.app-mapa-list-row.is-selected {
  background: rgba(56, 189, 248, .1);
}

@media (max-width: 1180px) {
  .app-mapa-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .app-mapa-detail {
    position: static;
  }
  .app-mapa-canvas-viewport {
    max-height: 68vh;
  }
}

@media (max-width: 768px) {
  .app-mapa-canvas-inner {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 24px 12px;
    min-width: 720px;
  }
  .app-mapa-canvas-viewport {
    min-height: 390px;
  }
}

@media (max-width: 430px) {
  .app-mapa-toolbar,
  .app-mapa-controls {
    border-radius: 12px;
  }
  .app-mapa-canvas {
    padding: 8px;
    border-radius: 18px;
  }
  .app-mapa-canvas-viewport {
    padding: 18px 14px;
  }
  .app-mapa-unit-top strong {
    font-size: 15px;
  }
}

/* 15E-B official real-view refinement */
.app-mapa-view::before,
.app-mapa-view::after,
.app-mapa-canvas::before,
.app-mapa-canvas::after,
.app-mapa-canvas-viewport::before,
.app-mapa-canvas-viewport::after {
  content: none !important;
  display: none !important;
}

.app-mapa-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.app-mapa-layout--grid .app-mapa-main {
  min-width: 0;
}

.app-mapa-canvas-viewport {
  min-height: clamp(560px, 76vh, 940px);
  max-height: calc(100vh - 230px);
}

.app-mapa-summary {
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
}

.app-mapa-toolbar {
  padding: 8px;
}

.app-mapa-controls {
  align-items: center;
  gap: 10px;
}

.app-mapa-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: min(100%, 480px);
  flex: 1 1 340px;
  border: 1px solid rgba(148, 163, 184, .26);
  background: #0f172a;
  border-radius: 6px;
  padding: 0 8px;
}

.app-mapa-search-ic {
  font-family: 'Material Icons', sans-serif;
  font-size: 16px;
  color: #94a3b8;
  user-select: none;
}

.app-mapa-search-input {
  flex: 1;
  min-width: 140px;
  height: 34px;
  border: 0;
  outline: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
}

.app-mapa-search-input::placeholder {
  color: #64748b;
  font-weight: 600;
}

.app-mapa-search-clear {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: #1f2937;
  color: #cbd5e1;
  font-size: 14px;
  cursor: pointer;
  line-height: 22px;
  padding: 0;
}

.app-mapa-detail {
  border-left-width: 3px;
}

@media (max-width: 980px) {
  .app-mapa-layout {
    grid-template-columns: 1fr;
  }
  .app-mapa-search-wrap {
    flex: 1 1 100%;
    min-width: 100%;
  }
}

/* ── FASE 15F: port visual legacy /mapa → /app/mapa (scoped, sin pseudo decorativos tipo óvalo) ── */
.app-mapa-slot::before,
.app-mapa-slot::after {
  content: none !important;
  display: none !important;
}

.app-mapa-legacy-port .content.app-mapa-legacy-content {
  position: relative;
  box-sizing: border-box;
  min-height: min(640px, calc(100vh - 200px));
  padding: 86px 6px 14px;
  background: #475569;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.app-mapa-legacy-port .kpi-container {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 10px 22px;
  gap: 18px;
  z-index: 6;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.app-mapa-legacy-port .kpi-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.app-mapa-legacy-port .kpi-value {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.app-mapa-legacy-port .kpi-label {
  font-size: 9px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 5px;
  letter-spacing: 0.5px;
}

.app-mapa-legacy-port .kpi-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 1px;
}

.app-mapa-legacy-port .text-green {
  color: #34d399;
  text-shadow: 0 0 12px rgba(52, 211, 153, 0.4);
}

.app-mapa-legacy-port .text-yellow {
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.app-mapa-legacy-port .text-red {
  color: #f87171;
  text-shadow: 0 0 12px rgba(248, 113, 113, 0.4);
}

.app-mapa-legacy-port .text-blue {
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.app-mapa-legacy-port .text-orange {
  color: #fdba74;
  text-shadow: 0 0 12px rgba(253, 186, 116, 0.4);
}

.app-mapa-units-menu {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 18;
}

.app-mapa-units-menu-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  user-select: none;
}

.app-mapa-units-menu-toggle::-webkit-details-marker {
  display: none;
}

.app-mapa-units-menu-toggle .material-icons {
  font-size: 20px;
}

.app-mapa-units-menu-toggle span:not(.material-icons) {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.app-mapa-units-menu-toggle strong {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #facc15;
  color: #713f12;
  font-size: 11px;
  font-weight: 900;
}

.app-mapa-units-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(340px, calc(100vw - 34px));
  max-height: min(72vh, 680px);
  overflow: auto;
  border-radius: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: -8px 18px 42px rgba(0, 0, 0, 0.25);
  color: #1e293b;
}

.app-mapa-units-menu-head {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px 18px;
  background: linear-gradient(135deg, #0d2a54 0%, #0f3460 100%);
  color: #fff;
}

.app-mapa-units-menu-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.app-mapa-units-menu-head span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 700;
}

.app-mapa-units-menu-section {
  padding: 14px 16px 0;
  background: #f8fafc;
}

.app-mapa-units-menu-section:last-child {
  padding-bottom: 16px;
}

.app-mapa-units-menu-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  color: #0369a1;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-mapa-units-menu-section--taller .app-mapa-units-menu-label {
  color: #b45309;
}

.app-mapa-units-menu-section--orphan .app-mapa-units-menu-label {
  color: #b91c1c;
}

.app-mapa-units-menu-label .material-icons {
  font-size: 14px;
}

.app-mapa-units-menu-label strong {
  margin-left: auto;
  color: currentColor;
}

.app-mapa-units-menu-list {
  display: grid;
  gap: 8px;
}

.app-mapa-units-menu-section--taller .app-mapa-units-menu-list {
  padding: 12px;
  border: 1.5px dashed #fcd34d;
  border-radius: 12px;
  background: #fffbeb;
}

.app-mapa-units-drawer-panel .app-mapa-unit {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #3b82f6;
  background: #fff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
  text-align: left;
  text-shadow: none;
}

.app-mapa-units-menu-section--taller .app-mapa-unit {
  border-left-color: #f59e0b;
}

.app-mapa-units-menu-section--orphan .app-mapa-unit {
  border-left-color: #ef4444;
}

.app-mapa-units-drawer-panel .app-mapa-unit:hover {
  background: #f8fafc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.app-mapa-units-drawer-panel .app-mapa-unit-top {
  margin-bottom: 5px;
}

.app-mapa-units-drawer-panel .app-mapa-unit-top strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.app-mapa-units-menu-panel .app-mapa-unit-meta,
.app-mapa-units-menu-panel .app-mapa-unit-zona {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
}

.app-mapa-units-menu-panel .app-mapa-unit-state {
  color: #475569;
  background: #e2e8f0;
}

.app-mapa-units-menu-panel .app-mapa-gas {
  width: 72px;
  height: 12px;
  margin: 7px 0 0;
  border-color: rgba(15, 23, 42, 0.12);
  background: #e2e8f0;
}

.app-mapa-units-menu-panel .app-mapa-gas-text {
  font-size: 8px;
  line-height: 11px;
}

.app-mapa-units-menu-empty {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  color: #94a3b8;
  background: #fff;
  border: 1px dashed #cbd5e1;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.app-mapa-legacy-filter-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
}

.app-mapa-legacy-filter-strip__label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  color: #94a3b8;
}

.app-mapa-legacy-filter-strip__meta strong {
  color: #f8fafc;
}

.app-mapa-legacy-filter-strip__clear {
  margin-left: auto;
  border: 1px solid rgba(248, 250, 252, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: #f8fafc;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.app-mapa-legacy-results-hint {
  margin: 0 0 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #fde68a;
  background: rgba(30, 27, 10, 0.55);
  border: 1px solid rgba(253, 224, 71, 0.35);
  border-radius: 8px;
}

.app-mapa-legacy-mapdetail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 10px;
  align-items: start;
}

.app-mapa-legacy-mapdetail-row--list {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
}

.app-mapa-legacy-main-column {
  min-width: 0;
}

.app-mapa-legacy-port .map-stage.app-mapa-map-stage {
  position: relative;
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 8px auto 28px;
  overflow: visible;
}

.app-mapa-legacy-port .map-zoom-container.app-mapa-canvas-viewport {
  --map-outer-pad: clamp(12px, 2vw, 28px);
  transform-origin: 0 0;
  padding: var(--map-outer-pad);
  display: block;
  width: max-content;
  min-width: max-content;
  max-width: 100%;
  overflow: auto;
  box-sizing: border-box;
  border-radius: 0;
  border: 1px solid rgba(15, 23, 42, 0.45);
  background-color: #1e293b;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 22px 22px;
  min-height: clamp(480px, 68vh, 820px);
  max-height: calc(100vh - 240px);
}

.app-mapa-legacy-port .app-mapa-canvas-inner.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 22px 12px;
  background: #2a3441;
  padding: clamp(22px, 3.5vw, 48px);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  width: max-content;
  min-width: min(1020px, max-content);
  background-image: radial-gradient(#3f4d5e 1px, transparent 1px);
  background-size: 20px 20px;
  box-sizing: border-box;
}

.app-mapa-legacy-port .app-mapa-canvas-inner.map-grid.mapa-canvas-libre,
.app-mapa-legacy-port .app-mapa-canvas-inner.map-grid.app-mapa-canvas-inner--absolute {
  position: relative;
  display: block;
  grid-template-columns: none;
  gap: 0;
  min-width: 0;
  max-width: none;
}

.app-mapa-legacy-port .mapa-celda-libre {
  position: absolute;
  box-sizing: border-box;
  overflow: visible;
  transform-origin: center center;
}

.app-mapa-legacy-port .app-mapa-slot--absolute {
  min-height: 0;
  display: block;
}

.app-mapa-legacy-port .app-mapa-slot--absolute .app-mapa-slot-head {
  position: absolute;
  top: -22px;
  left: 0;
  right: 0;
  min-height: 18px;
  transform: none;
  z-index: 10;
}

.app-mapa-legacy-port .app-mapa-slot--absolute .app-mapa-slot-body {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.app-mapa-legacy-port .app-mapa-slot--absolute .app-mapa-slot-units,
.app-mapa-legacy-port .app-mapa-slot--absolute .app-mapa-slot-units .app-mapa-unit {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.app-mapa-legacy-port .app-mapa-row-label--absolute,
.app-mapa-legacy-port .app-mapa-row-decor--absolute {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-transform: uppercase;
}

.app-mapa-legacy-port .app-mapa-row-label--absolute {
  border: 0;
  background: #0f172a;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.app-mapa-legacy-port .app-mapa-row-decor--absolute {
  border: 2px dashed #64748b;
  border-radius: 12px;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05) 10px, rgba(0, 0, 0, 0.1) 10px, rgba(0, 0, 0, 0.1) 20px);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.app-mapa-legacy-port .app-mapa-row-decor--absolute .app-mapa-decor-type {
  display: none;
}

.app-mapa-legacy-port .info-sidebar.app-mapa-info-aside {
  position: sticky;
  top: 6px;
  align-self: start;
  max-height: calc(100vh - 200px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.92);
  color: #e2e8f0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  padding: 12px;
  z-index: 4;
}

.app-mapa-legacy-port .app-mapa-detail-hero {
  background: linear-gradient(160deg, #0f172a 0%, #1f2937 55%, #0f766e 100%);
  margin: -12px -12px 12px;
  padding: 14px;
  border-radius: 16px 16px 0 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.app-mapa-legacy-port .app-mapa-detail-mva-title,
.app-mapa-legacy-port .app-mapa-detail-posline,
.app-mapa-legacy-port .app-mapa-detail-subline {
  color: #f8fafc;
}

.app-mapa-legacy-port .app-mapa-detail-fields p,
.app-mapa-legacy-port .app-mapa-detail p {
  color: #cbd5e1;
}

.app-mapa-legacy-port .app-mapa-actions {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.app-mapa-legacy-port .app-mapa-actions-title,
.app-mapa-legacy-port .app-mapa-actions h3 {
  color: #e2e8f0;
}

.app-mapa-legacy-panel-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.app-mapa-legacy-panel-btn,
.app-mapa-legacy-actions-dropdown summary {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  text-align: center;
}

.app-mapa-legacy-panel-btn--danger {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.82);
}

.app-mapa-legacy-actions-dropdown {
  position: relative;
}

.app-mapa-legacy-actions-dropdown summary {
  width: 100%;
  list-style: none;
}

.app-mapa-legacy-actions-dropdown summary::-webkit-details-marker {
  display: none;
}

.app-mapa-legacy-actions-dropdown__body {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 180px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
}

.app-mapa-legacy-actions-dropdown__body button,
.app-mapa-legacy-actions-dropdown__body .app-mapa-action-btn {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

.app-mapa-slot.spot-available-hint,
.app-mapa-slot.app-mapa-drop-available,
.spot.spot-available-hint,
.spot.app-mapa-drop-available {
  box-shadow: inset 0 0 0 2px rgba(250, 204, 21, 0.58);
}

.app-mapa-legacy-port .app-mapa-inc-summary {
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(148, 163, 184, 0.25);
}

.app-mapa-legacy-port .app-mapa-bucket {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
}

.app-mapa-legacy-port .app-mapa-bucket-head {
  color: #cbd5e1;
}

.app-mapa-legacy-port .app-mapa-bucket-grid .app-mapa-unit {
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
}

.app-mapa-legacy-port .app-mapa-unit.car.listo {
  background: linear-gradient(160deg, #0d9488 0%, #0f766e 100%) !important;
}

.app-mapa-legacy-port .app-mapa-unit.car.sucio {
  background: linear-gradient(160deg, #d97706 0%, #b45309 100%) !important;
}

.app-mapa-legacy-port .app-mapa-unit.car.mantenimiento {
  background: linear-gradient(160deg, #dc2626 0%, #991b1b 100%) !important;
}

.app-mapa-legacy-port .app-mapa-unit.car.traslado {
  background: linear-gradient(160deg, #7c3aed 0%, #5b21b6 100%) !important;
}

.app-mapa-legacy-port .app-mapa-unit.car.venta {
  background: linear-gradient(160deg, #f59e0b 0%, #d97706 100%) !important;
}

.app-mapa-legacy-port .app-mapa-unit.car.no-arrendable {
  background: linear-gradient(160deg, #0891b2 0%, #0e7490 100%) !important;
}

.app-mapa-legacy-port .app-mapa-unit.car.resguardo {
  background: linear-gradient(160deg, #92400e 0%, #78350f 100%) !important;
}

.app-mapa-legacy-port .app-mapa-unit.car.externo {
  background: linear-gradient(160deg, #475569 0%, #334155 100%) !important;
  border: 2px dashed rgba(255, 255, 255, 0.35) !important;
}

.app-mapa-legacy-port .app-mapa-unit.car.retenida {
  background: linear-gradient(160deg, #1d4ed8 0%, #1e3a8a 100%) !important;
  border: 2px dashed rgba(255, 255, 255, 0.28) !important;
}

.app-mapa-legacy-port .app-mapa-noresults {
  background: rgba(30, 27, 10, 0.65);
  color: #fde68a;
  border-color: rgba(253, 224, 71, 0.4);
}

.app-mapa-legacy-list-stage .app-mapa-list-table {
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
}

.app-mapa-legacy-list-stage .app-mapa-list-table th {
  background: rgba(2, 6, 23, 0.55);
  color: #94a3b8;
}

.app-mapa-legacy-list-stage .app-mapa-list-table td {
  border-color: rgba(148, 163, 184, 0.2);
}

@media (max-width: 1100px) {
  .app-mapa-legacy-mapdetail-row,
  .app-mapa-legacy-mapdetail-row--list {
    grid-template-columns: 1fr;
  }
  .app-mapa-legacy-port .info-sidebar.app-mapa-info-aside {
    position: relative;
    top: 0;
    max-height: none;
  }
}

/* ── 15G: chrome compacto tipo barra operativa (sin card hero); patio sin pseudo decorativos ── */
.app-mapa-chrome-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 6px 0 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
}

.app-mapa-chrome-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  min-width: 0;
}

.app-mapa-chrome-main strong {
  color: #f8fafc;
  font-weight: 900;
}

.app-mapa-chrome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.app-mapa-chrome-sub {
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.app-mapa-tech {
  margin: 4px 0 6px;
  padding: 4px 8px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font-size: 11px;
}

.app-mapa-tech summary {
  cursor: pointer;
  font-weight: 800;
  color: #94a3b8;
}

.app-mapa-tech-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 6px;
  align-items: center;
}

.app-mapa-legacy-port .app-mapa-slot::before,
.app-mapa-legacy-port .app-mapa-slot::after {
  content: none !important;
  display: none !important;
}

.app-mapa-chrome-sync {
  font-weight: 600;
  color: #94a3b8;
  font-size: 11px;
}

.app-mapa-actions-classic {
  margin-top: 6px;
}

.app-mapa-actions-classic summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
}

/* ── 15I: migración visual fuerte. El Shell contiene; el patio manda. ── */
body.app-map-legacy-shell {
  --app-map-rail-w: 84px;
  --app-map-header-h: 66px;
}

body.app-map-legacy-shell .mex-sidebar {
  width: var(--app-map-rail-w) !important;
  background: #11142c;
}

body.app-map-legacy-shell .mex-header {
  left: var(--app-map-rail-w) !important;
  height: var(--app-map-header-h);
  padding: 0 18px 0 24px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: none;
}

body.app-map-legacy-shell .mex-main {
  margin-left: var(--app-map-rail-w) !important;
  margin-top: var(--app-map-header-h);
  height: calc(100vh - var(--app-map-header-h));
}

body.app-map-legacy-shell .mex-sidebar-logo {
  justify-content: center;
  min-height: 86px;
  padding: 14px 0 18px;
}

body.app-map-legacy-shell .mex-sidebar-logo-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.32);
}

body.app-map-legacy-shell .mex-sidebar-logo-text,
body.app-map-legacy-shell .mex-nav-group-label,
body.app-map-legacy-shell .mex-nav-item-label,
body.app-map-legacy-shell .mex-nav-item-arrow,
body.app-map-legacy-shell .mex-profile-info,
body.app-map-legacy-shell .mex-logout-label {
  display: none !important;
}

body.app-map-legacy-shell .mex-nav-group {
  padding: 10px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

body.app-map-legacy-shell .mex-nav-item {
  width: 62px;
  height: 48px;
  justify-content: center;
  margin: 6px auto;
  padding: 0;
  border-radius: 5px;
}

body.app-map-legacy-shell .mex-nav-item.active {
  background: rgba(16, 185, 129, 0.12);
  box-shadow: inset 3px 0 0 #10e08a;
}

body.app-map-legacy-shell .mex-nav-item.active::before {
  display: none;
}

body.app-map-legacy-shell .mex-nav-item-icon {
  width: 24px;
  height: 24px;
  font-size: 23px !important;
}

body.app-map-legacy-shell .mex-sidebar-footer {
  padding: 10px 0 16px;
}

body.app-map-legacy-shell .mex-profile-item,
body.app-map-legacy-shell .mex-logout-item {
  justify-content: center;
  margin: 8px auto;
  padding: 0;
  width: 52px;
  height: 42px;
}

body.app-map-legacy-shell .mex-header-title {
  display: none !important;
}

body.app-map-legacy-shell .mex-header-left {
  flex: 1 1 auto;
  gap: 12px;
}

body.app-map-legacy-shell .mex-header-menu-btn {
  width: 40px;
  height: 40px;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  background: #fff;
}

body.app-map-legacy-shell .mex-header-search {
  max-width: 520px;
  min-width: 320px;
  border-radius: 999px;
  background: #ecfdf5;
  border-color: #d7f5e6;
}

body.app-map-legacy-shell .mex-header-search-input {
  font-size: 14px;
  font-weight: 600;
}

body.app-map-legacy-shell .mex-header-icon-btn,
body.app-map-legacy-shell .mex-header-user,
body.app-map-legacy-shell .mex-header-plaza-badge,
body.app-map-legacy-shell .mex-header-plaza-select-wrap {
  border-radius: 999px;
}

.app-mapa-view.app-mapa-operativo {
  position: relative;
  min-height: calc(100vh - var(--app-map-header-h, 64px));
  padding: 0;
  gap: 0;
  overflow: hidden;
  background: #475569 !important;
  color: #e2e8f0;
}

.app-mapa-view.app-mapa-operativo > .app-mapa-chrome-bar,
.app-mapa-view.app-mapa-operativo > .app-mapa-controls,
.app-mapa-view.app-mapa-operativo > .app-mapa-dnd-hint {
  position: absolute;
  z-index: 30;
}

.app-mapa-view.app-mapa-operativo > .app-mapa-chrome-bar,
.app-mapa-view.app-mapa-operativo > .app-mapa-controls {
  display: none !important;
}

.app-mapa-view.app-mapa-operativo > .app-mapa-chrome-bar {
  top: 14px;
  left: 14px;
  width: auto;
  max-width: min(360px, calc(100vw - 96px));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e2e8f0;
}

.app-mapa-chrome-main {
  min-height: 42px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.app-mapa-plaza-label {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-mapa-plaza-label strong {
  color: #f8fafc;
  font-size: 12px;
}

.app-mapa-chrome-sync {
  max-width: 155px;
  overflow: hidden;
  color: #cbd5e1;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.app-mapa-tools-menu {
  position: relative;
}

.app-mapa-tools-menu summary {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  list-style: none;
}

.app-mapa-tools-menu summary::-webkit-details-marker {
  display: none;
}

.app-mapa-tools-menu summary .material-icons {
  font-size: 20px;
}

.app-mapa-chrome-actions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 190px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
}

.app-mapa-tools-menu:not([open]) .app-mapa-chrome-actions {
  display: none;
}

.app-mapa-tool-btn {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.9);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 900;
  text-align: left;
}

.app-mapa-tool-btn:hover {
  background: rgba(51, 65, 85, 0.96);
  border-color: rgba(203, 213, 225, 0.36);
}

.app-mapa-chrome-sub {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: max-content;
  max-width: 330px;
  color: #dcfce7;
  font-size: 10px;
}

.app-mapa-view.app-mapa-operativo > .app-mapa-controls {
  top: 66px;
  left: 14px;
  max-width: min(340px, calc(100vw - 28px));
}

.app-mapa-search-wrap {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.app-mapa-search-input {
  height: 40px;
  color: #f8fafc;
  font-size: 12px;
}

.app-mapa-search-clear {
  background: rgba(51, 65, 85, 0.9);
}

.app-mapa-view.app-mapa-operativo > .app-mapa-dnd-hint:not([hidden]) {
  left: 14px;
  bottom: 14px;
  max-width: min(420px, calc(100vw - 28px));
  padding: 8px 12px;
  border: 1px solid rgba(253, 224, 71, 0.36);
  border-radius: 8px;
  background: rgba(30, 27, 10, 0.82);
  color: #fde68a;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
}

.app-mapa-content {
  height: calc(100vh - var(--app-map-header-h, 64px));
  min-height: 560px;
}

.app-mapa-legacy-port,
.app-mapa-legacy-port .content.app-mapa-legacy-content {
  height: 100%;
  min-height: 100%;
}

.app-mapa-legacy-port .content.app-mapa-legacy-content {
  padding: 0;
  background: #4c5870;
  overflow: hidden;
}

.app-mapa-legacy-port .kpi-container {
  top: 24px;
  max-width: min(580px, calc(100vw - 420px));
  border-radius: 17px;
  background: rgba(24, 24, 57, 0.94);
  padding: 14px 28px;
  gap: 22px;
}

.app-mapa-units-menu {
  top: 24px;
  right: 28px;
}

.app-mapa-units-menu-toggle {
  min-height: 42px;
  border-radius: 9px;
  background: rgba(24, 24, 57, 0.94);
}

.app-mapa-legacy-mapdetail-row {
  height: 100%;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 0;
}

.app-mapa-legacy-mapdetail-row--no-detail {
  grid-template-columns: minmax(0, 1fr);
}

.app-mapa-legacy-main-column {
  height: 100%;
  min-height: 0;
}

.app-mapa-legacy-port .map-stage.app-mapa-map-stage {
  height: 100%;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

.app-mapa-legacy-port .map-zoom-container.app-mapa-canvas-viewport {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  padding: 102px 20px 28px;
  border: 0;
  background-color: #4c5870;
  background-image: none;
}

.app-mapa-legacy-port .app-mapa-canvas-inner.map-grid {
  border-radius: 9px;
  background-color: #273241;
  background-image: radial-gradient(rgba(120, 139, 166, 0.42) 1px, transparent 1px);
  background-size: 20px 20px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.24), 0 12px 30px rgba(0, 0, 0, 0.22);
}

.app-mapa-legacy-port .app-mapa-slot {
  border-radius: 6px 6px 0 0;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
  border-right: 2px solid rgba(255, 255, 255, 0.12);
  border-top: 2px solid rgba(255, 255, 255, 0.12);
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.015);
  box-shadow: none;
}

.app-mapa-legacy-port .app-mapa-slot-head {
  top: -19px;
}

.app-mapa-legacy-port .app-mapa-slot-label {
  color: #f8fafc;
  font-size: 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.app-mapa-legacy-port .app-mapa-unit {
  border-radius: 9px;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.app-mapa-legacy-port .info-sidebar.app-mapa-info-aside {
  top: 8px;
  max-height: calc(100vh - 86px);
  border-radius: 0;
  background: rgba(15, 23, 42, 0.94);
}

.app-mapa-legacy-port .app-mapa-detail-hero {
  border-radius: 0;
  background: #0d2a54;
}

.app-mapa-zoom-controls {
  position: absolute;
  right: 16px;
  bottom: 42px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.app-mapa-zoom-controls .btn-zoom {
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  color: #111a60;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  font-size: 28px;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .app-mapa-legacy-port .kpi-container {
    top: 118px;
    left: 14px;
    max-width: min(520px, calc(100vw - 28px));
    transform: none;
  }
  .app-mapa-legacy-port .map-zoom-container.app-mapa-canvas-viewport {
    padding-top: 170px;
  }
}

@media (max-width: 980px) {
  .app-mapa-content {
    height: auto;
    min-height: calc(100vh - 64px);
  }
  .app-mapa-legacy-mapdetail-row {
    height: auto;
    grid-template-columns: 1fr;
  }
  .app-mapa-legacy-port .info-sidebar.app-mapa-info-aside {
    max-height: none;
  }
}

/* 15H: herramientas operativas portadas al App Shell */
.app-mapa-modal--official {
  width: min(820px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.app-mapa-form-field--wide {
  grid-column: 1 / -1;
}

.app-mapa-form-field input[readonly] {
  background: #e5e7eb;
  color: #475569;
  cursor: not-allowed;
}

.app-mapa-bulk-preview {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 12px;
  color: #334155;
}

.app-mapa-radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}

.app-mapa-radar-grid > div {
  min-height: 74px;
  padding: 10px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #f8fafc;
}

.app-mapa-radar-grid span {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.app-mapa-radar-grid strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
}

.app-mapa-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

/* ── Editor visual mapa (workspace por vista) ───────────────── */
.mapviz {
  position: fixed;
  inset: 0;
  z-index: 120000;
  background: #0b1220;
  color: #e2e8f0;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 13px;
  box-sizing: border-box;
}
.mapviz--mobile-block {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.mapviz-mobile-card {
  max-width: 420px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 22px;
  text-align: center;
}
.mapviz-mobile-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
}
.mapviz-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
.mapviz-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.mapviz-inner--focus .mapviz-body {
  height: calc(100vh - 56px - 36px);
}
.mapviz-topbar {
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid #1e293b;
  background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
}
.mapviz-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.mapviz-status {
  margin-left: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #1e293b;
  color: #94a3b8;
}
.mapviz-status--ok {
  color: #6ee7b7;
  background: #064e3b;
}
.mapviz-status--dirty {
  color: #fde68a;
  background: #713f12;
}
.mapviz-status--saving {
  color: #93c5fd;
  background: #1e3a8a;
}
.mapviz-status--err {
  color: #fecaca;
  background: #7f1d1d;
}
.mapviz-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
}
.mapviz-tab {
  border: 1px solid #334155;
  background: #0f172a;
  color: #cbd5e1;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.mapviz-tab--active {
  border-color: transparent;
  color: #0f172a;
}
.mapviz-tab--neutral.mapviz-tab--active {
  background: #e2e8f0;
}
.mapviz-tab--green.mapviz-tab--active {
  background: #22c55e;
}
.mapviz-tab--yellow.mapviz-tab--active {
  background: #facc15;
  color: #422006;
}
.mapviz-tab--blue.mapviz-tab--active {
  background: #38bdf8;
}
.mapviz-topbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.mapviz-btn {
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mapviz-btn:hover {
  background: #334155;
}
.mapviz-btn--primary {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
}
.mapviz-btn--ghost {
  background: transparent;
}
.mapviz-body {
  flex: 1;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  min-height: 0;
}
@media (max-width: 1200px) {
  .mapviz-body {
    grid-template-columns: 200px minmax(0, 1fr) 240px;
  }
}
.mapviz-sidebar {
  border-right: 1px solid #1e293b;
  overflow: auto;
  padding: 10px;
  background: #0f172a;
}
.mapviz-side-section h4 {
  margin: 12px 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}
.mapviz-tool {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.mapviz-tool:hover {
  border-color: #64748b;
}
.mapviz-main {
  position: relative;
  min-height: 0;
  background: #020617;
}
.mapviz-canvas-wrap {
  position: relative;
  height: 100%;
}
.mapviz-canvas-scroll {
  position: absolute;
  inset: 0;
  overflow: auto;
}
.mapviz-zoombar {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}
.mapviz-zoombar button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #e2e8f0;
  cursor: pointer;
}
.mapviz-canvas {
  min-height: 100%;
  padding: 16px;
  box-sizing: border-box;
}
.mapviz-canvas-inner {
  position: relative;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.mapviz-bg {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}
.mapviz-grid {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  z-index: 1;
  background-image: linear-gradient(rgba(148, 163, 184, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.09) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.mapviz-cell {
  position: absolute;
  z-index: 2;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #f8fafc;
  cursor: grab;
  box-sizing: border-box;
  overflow: hidden;
}
.mapviz-cell--sel {
  outline: 2px solid #a855f7;
  outline-offset: 1px;
}
.mapviz-cell--locked {
  opacity: 0.55;
  cursor: not-allowed;
}
.mapviz-cell-lbl {
  padding: 2px 4px;
  pointer-events: none;
  text-align: center;
  line-height: 1.15;
}
.mapviz-inspector {
  border-left: 1px solid #1e293b;
  overflow: auto;
  padding: 12px;
  background: #0f172a;
}
.mapviz-inspector h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.mapviz-muted {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.4;
}
.mapviz-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
}
.mapviz-field input,
.mapviz-field select,
.mapviz-field textarea {
  font: inherit;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #020617;
  color: #e2e8f0;
}
.mapviz-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
}
.mapviz-visibility {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.mapviz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mapviz-hr {
  border: 0;
  border-top: 1px solid #1e293b;
  margin: 12px 0;
}
.mapviz-footer {
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-top: 1px solid #1e293b;
  font-size: 11px;
  color: #94a3b8;
}
.mapviz-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.mapviz-file {
  width: 100%;
  margin: 8px 0;
}
.mapviz-tech pre {
  max-height: 120px;
  overflow: auto;
  font-size: 10px;
  background: #020617;
  padding: 8px;
  border-radius: 8px;
}
.mapviz-modal {
  position: fixed;
  inset: 0;
  z-index: 130000;
  background: rgba(2, 6, 23, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.mapviz-modal-card {
  max-width: 480px;
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 16px;
}
.mapviz-modal-card h3 {
  margin: 0 0 10px;
}
.mapviz-modal-block ul {
  margin: 6px 0 0 18px;
  padding: 0;
  font-size: 12px;
  color: #cbd5e1;
}
.mapviz-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* ───────────────────────────────────────────────────────── */
/* Limbo Units in App Shell Header + Drawer
/* ───────────────────────────────────────────────────────── */

.mex-hdr-limbo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  border-radius: 999px;
  padding: 4px 10px 4px 6px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 32px;
}

.mex-hdr-limbo-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.mex-hdr-limbo-btn .material-icons {
  font-size: 16px;
  color: #64748b;
}

.mex-hdr-limbo-count {
  background: #e2e8f0;
  color: #334155;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 11px;
}

/* Drawer */
.app-mapa-units-drawer {
  position: fixed;
  inset: 0;
  z-index: 120000;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.app-mapa-units-drawer[hidden] {
  display: none !important;
}

.app-mapa-units-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
}

.app-mapa-units-drawer.open .app-mapa-units-drawer-overlay {
  opacity: 1;
}

.app-mapa-units-drawer-panel {
  position: relative;
  width: min(400px, 100vw);
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.1);
}

.app-mapa-units-drawer.open .app-mapa-units-drawer-panel {
  transform: translateX(0);
}

.app-mapa-units-drawer-head {
  padding: 18px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #1e2a63;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.app-mapa-units-drawer-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
}

.app-mapa-units-drawer-head span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 800;
}

.app-mapa-units-drawer-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
}

.app-mapa-units-drawer-close .material-icons {
  font-size: 20px;
}

.app-mapa-units-drawer-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.app-mapa-units-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: #f8fafc;
}

/* Performance: el mapa cambia mucho; limitamos repaints al stage activo. */
.app-mapa-content,
.app-mapa-legacy-content,
.app-mapa-map-stage,
.app-mapa-canvas-viewport,
.app-mapa-canvas-inner,
.app-mapa-detail {
  contain: layout paint style;
}

.app-mapa-canvas-viewport,
.app-mapa-canvas-inner,
.app-mapa-units-drawer-panel {
  will-change: transform;
  backface-visibility: hidden;
}

.app-mapa-unit,
.app-mapa-slot,
.app-mapa-list-row,
.app-mapa-units-menu-section {
  contain: layout paint style;
}

@supports (content-visibility: auto) {
  .app-mapa-detail,
  .app-mapa-units-menu-section {
    content-visibility: auto;
    contain-intrinsic-size: 280px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-mapa-loading-spinner,
  .app-mapa-units-drawer-panel,
  .app-mapa-units-drawer-overlay {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   FASE FINAL — Diseño idéntico al mapa legacy en el App Shell.
   Anula todas las fases anteriores dentro de .app-mapa-legacy-port.
   ══════════════════════════════════════════════════════════════ */

@keyframes popInCar {
  0%   { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── Grid: celdas fijas 95×95 igual al legacy ──────────────── */
.app-mapa-legacy-port .app-mapa-canvas-inner.map-grid {
  --map-cols: 12;
  --map-cell-size: 95px;
  --map-row-size: 95px;
  display: grid;
  grid-template-columns: repeat(var(--map-cols), var(--map-cell-size));
  grid-auto-rows: var(--map-row-size);
  gap: 28px 15px;
  padding: clamp(28px, 4vw, 56px);
  border-radius: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  background: #2a3441;
  background-image: radial-gradient(#3f4d5e 1px, transparent 1px);
  background-size: 20px 20px;
  width: max-content;
  height: max-content;
}

/* ── Slot — llena la celda del grid ────────────────────────── */
.app-mapa-legacy-port .app-mapa-slot.spot {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.02);
  border-left: 2px solid rgba(255, 255, 255, 0.10);
  border-right: 2px solid rgba(255, 255, 255, 0.10);
  border-top: 2px solid rgba(255, 255, 255, 0.10);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.app-mapa-legacy-port .app-mapa-slot-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
  padding: 3px;
}

.app-mapa-legacy-port .app-mapa-slot-units {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  flex: 1;
  gap: 0;
}

/* ── Tarjeta: hereda width/height de la celda ──────────────── */
.app-mapa-legacy-port .app-mapa-unit,
.app-mapa-legacy-port .car {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  border-radius: 16px 16px 10px 10px;
  padding: 8px;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow:
    0 8px 24px -4px rgba(0, 0, 0, 0.55),
    0 2px 6px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  animation: popInCar 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.18s ease;
}

.app-mapa-legacy-port .app-mapa-unit:hover,
.app-mapa-legacy-port .car:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 14px 32px -4px rgba(0, 0, 0, 0.6),
    0 3px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.app-mapa-legacy-port .app-mapa-unit.is-selected,
.app-mapa-legacy-port .car.selected {
  outline: 4px solid #fbbf24;
  outline-offset: 2px;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.6), 0 14px 32px rgba(0, 0, 0, 0.42);
  transform: scale(1.08);
  z-index: 50;
}

.app-mapa-legacy-port .app-mapa-unit.app-mapa-unit--dim,
.app-mapa-legacy-port .car.fade {
  opacity: 0.15 !important;
  filter: grayscale(1);
}

/* ── Layout de la tarjeta: flex centrado igual al legacy ───── */
.app-mapa-legacy-port .app-mapa-unit,
.app-mapa-legacy-port .car {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── MVA: grande y centrado — único protagonista ────────────── */
.app-mapa-legacy-port .app-mapa-unit-top {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

.app-mapa-legacy-port .app-mapa-unit-top strong {
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: center;
}

/* ── Ocultar info extra: el estado se ve por el color del card ─ */
.app-mapa-legacy-port .app-mapa-unit-state,
.app-mapa-legacy-port .app-mapa-unit-meta,
.app-mapa-legacy-port .app-mapa-unit-zona {
  display: none;
}

/* ── Badge de incidencias: esquina sup-izq, pequeño ────────── */
.app-mapa-legacy-port .app-mapa-unit-inc {
  position: absolute;
  left: 5px;
  top: 5px;
}

/* ── Barra de gasolina: compacta en la base de la tarjeta ──── */
.app-mapa-legacy-port .app-mapa-gas {
  width: min(60px, 72%);
  height: 10px;
  margin-top: 0;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.app-mapa-legacy-port .app-mapa-gas-text {
  font-size: 8px;
  line-height: 9px;
}

@media (prefers-reduced-motion: reduce) {
  .app-mapa-legacy-port .app-mapa-unit,
  .app-mapa-legacy-port .car {
    animation: none;
  }
}

/* ══════════════════════════════════════════════════════════════
   TARJETA LEGACY — estructura car-map-content + car-sidebar-body
   ══════════════════════════════════════════════════════════════ */

/* car-map-content: visible en el mapa (default) */
.app-mapa-legacy-port .car-map-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
  min-height: 0;
}

.app-mapa-legacy-port .car-mva-label {
  font-size: 19px;
  font-weight: 900;
  flex: 1;
  display: flex;
  align-items: center;
  line-height: 1;
}

/* car-sidebar-body: oculto en mapa, visible en cajones laterales */
.app-mapa-legacy-port .car-sidebar-body {
  display: none;
}

/* Barra de gasolina (legacy) dentro del App Shell */
.app-mapa-legacy-port .gas-container {
  width: 75%;
  height: 14px;
  background: rgba(0,0,0,0.5);
  border-radius: 6px;
  margin-bottom: 6px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.6), inset 0 -1px 0 rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  z-index: 2;
  flex-shrink: 0;
}

.app-mapa-legacy-port .gas-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  border-radius: 5px;
  transition: width 0.3s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

.app-mapa-legacy-port .gas-text {
  position: relative;
  z-index: 2;
  font-size: 8px;
  font-weight: 900;
  color: white;
  text-shadow: 0px 1px 3px rgba(0,0,0,0.9);
  letter-spacing: 0.5px;
}

/* ── Badges de notas ─────────────────────────────────────────── */
.app-mapa-legacy-port .lock-badge {
  position: absolute !important;
  top: -8px !important;
  left: -8px !important;
  background: #ffffff !important;
  border: 2px solid #f59e0b !important;
  border-radius: 50% !important;
  width: 24px !important;
  height: 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4) !important;
  z-index: 500 !important;
}

.app-mapa-legacy-port .traslado-badge {
  position: absolute !important;
  top: -8px !important;
  right: -8px !important;
  background: #7c3aed !important;
  border: 2px solid white !important;
  border-radius: 12px !important;
  padding: 2px 5px !important;
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  font-size: 12px !important;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4) !important;
  z-index: 500 !important;
  color: white !important;
}

.app-mapa-legacy-port .traslado-badge .traslado-dest {
  font-size: 8px;
  font-weight: 700;
  max-width: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Cajones laterales: ocultar mapa-content, mostrar sidebar ── */
.app-mapa-legacy-port .app-mapa-bucket-grid .app-mapa-unit,
.app-mapa-legacy-port .app-mapa-units-menu-list .app-mapa-unit {
  height: auto;
  min-height: 60px;
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  text-shadow: none;
  padding: 10px 12px;
  overflow: hidden;
}

.app-mapa-legacy-port .app-mapa-bucket-grid .car-map-content,
.app-mapa-legacy-port .app-mapa-units-menu-list .car-map-content {
  display: none !important;
}

.app-mapa-legacy-port .app-mapa-bucket-grid .car-sidebar-body,
.app-mapa-legacy-port .app-mapa-units-menu-list .car-sidebar-body {
  display: block !important;
}

.app-mapa-legacy-port .car-sb-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.app-mapa-legacy-port .car-sb-mva {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.3px;
}

.app-mapa-legacy-port .car-sb-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: #e2e8f0;
  color: #475569;
}

.app-mapa-legacy-port .car-sb-badge--listo       { background: #dcfce7; color: #166534; }
.app-mapa-legacy-port .car-sb-badge--sucio        { background: #fff7ed; color: #9a3412; }
.app-mapa-legacy-port .car-sb-badge--mantenimiento,
.app-mapa-legacy-port .car-sb-badge--taller       { background: #fef3c7; color: #92400e; }
.app-mapa-legacy-port .car-sb-badge--en-traslado  { background: #ede9fe; color: #5b21b6; }
.app-mapa-legacy-port .car-sb-badge--traslado     { background: #ede9fe; color: #5b21b6; }
.app-mapa-legacy-port .car-sb-badge--resguardo    { background: #fef3c7; color: #78350f; }
.app-mapa-legacy-port .car-sb-badge--retenida     { background: #dbeafe; color: #1e3a8a; }
.app-mapa-legacy-port .car-sb-badge--externo      { background: #f1f5f9; color: #334155; }

.app-mapa-legacy-port .car-sb-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.app-mapa-legacy-port .car-sb-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}

/* Ocultar badges en cajones para no saturar */
.app-mapa-legacy-port .app-mapa-bucket-grid .lock-badge,
.app-mapa-legacy-port .app-mapa-bucket-grid .doc-badge,
.app-mapa-legacy-port .app-mapa-bucket-grid .manto-badge,
.app-mapa-legacy-port .app-mapa-bucket-grid .traslado-badge,
.app-mapa-legacy-port .app-mapa-bucket-grid .urgent-badge,
.app-mapa-legacy-port .app-mapa-bucket-grid .badge-calor,
.app-mapa-legacy-port .app-mapa-units-menu-list .lock-badge,
.app-mapa-legacy-port .app-mapa-units-menu-list .doc-badge,
.app-mapa-legacy-port .app-mapa-units-menu-list .manto-badge,
.app-mapa-legacy-port .app-mapa-units-menu-list .traslado-badge,
.app-mapa-legacy-port .app-mapa-units-menu-list .urgent-badge,
.app-mapa-legacy-port .app-mapa-units-menu-list .badge-calor {
  display: none !important;
}

/* ── Incidencias badge: posicionado en el mapa ──────────────── */
.app-mapa-legacy-port .app-mapa-unit-inc {
  position: absolute;
  top: 4px;
  right: 4px;
  left: auto;
}
