/* ---------- COMPONENTS: MODALS, BANNERS, POPUPS, TOASTS ---------- */

/* Banner de Desenho Ativo */
#draw-banner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  background: rgba(20, 26, 31, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 12px;
  display: none;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-lg);
}

#draw-banner.show {
  display: flex;
}

#draw-banner .pts {
  color: var(--accent);
  font-weight: 700;
}

/* Painel de Configuração e Confirmação de Quadrante */
#confirm-panel {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1350;
  background: var(--panel);
  border: 1px solid var(--line-highlight);
  border-radius: var(--radius-md);
  padding: 18px;
  width: 360px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: none;
}

#confirm-panel.show {
  display: block;
}

#confirm-panel h3 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

#poly-info-box {
  background: var(--bg-deep);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 11px;
  line-height: 1.5;
}

/* Popup de Marcação de Endereço em Célula */
.mark-popup {
  font-family: var(--mono);
  color: #1a1a1a;
  width: 220px;
  padding: 4px;
}

.mark-popup h4 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
}

.mark-popup input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 8px;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-family: var(--mono);
  background: #ffffff;
  color: #000000;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast);
}

.swatch:hover {
  transform: scale(1.15);
}

.swatch.sel {
  border-color: #1a1a1a;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
}

.mp-actions {
  display: flex;
  gap: 6px;
}

.mp-actions button {
  flex: 1;
  padding: 7px 6px;
  font-size: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid #ccc;
  background: #f2f2f2;
  cursor: pointer;
  font-family: var(--mono);
  font-weight: 600;
}

.mp-actions .apply {
  background: #141a1f;
  color: #ffffff;
  border-color: #141a1f;
}

.mp-actions .remove {
  color: var(--danger);
  border-color: var(--danger);
  background: #fff;
}

/* Toast Notifications */
.tactical-toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 26, 31, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 12px;
  z-index: 2000;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-fade 0.3s ease-out;
}

@keyframes toast-fade {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Modal Tático de Coordenadas, GPS & QR Code */
.tactical-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.2s ease-out;
  padding: 16px;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tactical-modal-card {
  background: var(--panel);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
  width: 440px;
  max-width: 95vw;
  box-shadow: var(--shadow-lg), 0 0 25px var(--accent-glow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 14px 18px;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-eyebrow {
  font-size: 9.5px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.modal-title {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.step-tag {
  font-size: 11px;
  background: var(--accent);
  color: #000;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
}

.modal-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--danger);
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
}

.coord-display-box {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
}

.coord-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
}

.coord-label {
  color: var(--text-dim);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.coord-val {
  color: var(--teal);
  font-weight: 700;
  font-size: 12.5px;
}

.coord-val-dms {
  color: var(--text);
  font-size: 11.5px;
}

.nav-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.nav-btn {
  padding: 9px 10px;
  font-size: 11.5px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.qrcode-section {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--panel-alt);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.qrcode-box {
  background: #ffffff;
  padding: 6px;
  border-radius: var(--radius-sm);
  flex: 0 0 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qrcode-info {
  flex: 1;
}

.qrcode-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.qrcode-desc {
  font-size: 10.5px;
  color: var(--text-dim);
  line-height: 1.45;
}

.modal-footer {
  padding: 10px 18px 14px;
  background: var(--panel);
  border-top: 1px solid var(--line-soft);
}

/* ================= MARCADORES TÁTICOS DE VIATURAS / EQUIPES ================= */
.tactical-unit-container {
  background: transparent !important;
  border: none !important;
}

.tactical-unit-marker {
  position: relative;
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.unit-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(30, 215, 96, 0.4);
  animation: unit-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes unit-ping {
  0% { transform: scale(0.9); opacity: 0.8; }
  75%, 100% { transform: scale(1.8); opacity: 0; }
}

.unit-body {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 28px;
  background: #141a1f;
  border: 2px solid #1ed760;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(30, 215, 96, 0.6), 0 2px 6px rgba(0, 0, 0, 0.8);
  transition: transform var(--transition-fast);
}

.tactical-unit-marker:hover .unit-body {
  transform: scale(1.18);
  border-color: #ffffff;
}

.tactical-unit-selected .unit-body {
  transform: scale(1.25);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent), 0 0 8px rgba(255, 255, 255, 0.9);
}

.tactical-unit-selected .unit-tag {
  background: var(--accent);
  color: #000000;
  border-color: #ffffff;
  font-weight: 800;
}

.unit-icon {
  font-size: 14px;
  line-height: 1;
}

.unit-tag {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 18, 22, 0.92);
  border: 1px solid #1ed760;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}

/* Badge de Distância na Linha de Vetor de Apoio */
.unit-distance-badge {
  background: rgba(20, 26, 31, 0.92) !important;
  border: 1px solid #1ed760 !important;
  color: #1ed760 !important;
  font-family: var(--mono) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7) !important;
}

/* ================= MINI-PLAYER PIP DE VÍDEO NO OPERADOR ================= */
.operator-video-pip {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 220px;
  z-index: 1200;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85);
  border: 2px solid var(--accent);
  background: #000000;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
  display: block;
}

.operator-video-pip.hidden {
  display: none !important;
}

.operator-video-pip iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #050709;
}

.op-pip-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1250;
  display: flex;
  gap: 4px;
}

.op-pip-btn {
  background: rgba(14, 18, 22, 0.85);
  border: 1px solid var(--line);
  color: #ffffff;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.op-pip-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* MODO TELA DIVIDIDA NO OPERADOR (MAPA 50% / VÍDEO 50%) */
#app.split-view #map-wrap {
  display: flex !important;
  flex-direction: row !important;
  position: relative !important;
  width: calc(100vw - var(--sidebar-w, 320px)) !important;
}

#app.split-view #map {
  flex: 1 1 50% !important;
  width: 50% !important;
  height: 100% !important;
  border-right: 2px solid var(--accent) !important;
}

#app.split-view .operator-video-pip {
  flex: 1 1 50% !important;
  width: 50% !important;
  height: 100% !important;
  position: relative !important;
  top: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  left: auto !important;
  border-radius: 0 !important;
  border: none !important;
  border-left: 2px solid var(--accent) !important;
  box-shadow: none !important;
  z-index: 500 !important;
  display: block !important;
}

/* BARRA DE CONTROLE RÁPIDO SUPERIOR DO OPERADOR (LPR, FOTO, GRAVAR, SPLIT, PIP) */
#operator-top-controls {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(14, 18, 22, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

#operator-top-controls .btn-sm {
  font-size: 11px;
  padding: 4px 9px;
  font-weight: 600;
  white-space: nowrap;
}

#app.split-view .operator-video-pip .op-pip-actions {
  display: none !important;
}

@media (max-width: 900px) {
  #app.split-view #map-wrap {
    flex-direction: column !important;
    width: 100vw !important;
  }
  #app.split-view #map {
    flex: 1 1 50% !important;
    width: 100% !important;
    height: 50vh !important;
    border-right: none !important;
    border-bottom: 2px solid var(--accent) !important;
  }
  #app.split-view .operator-video-pip {
    flex: 1 1 50% !important;
    width: 100% !important;
    height: 50vh !important;
    border-left: none !important;
  }

  .operator-video-pip {
    width: 180px !important;
    height: 115px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 26px) !important;
    right: calc(env(safe-area-inset-right, 0px) + 14px) !important;
    z-index: 2500 !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.95), 0 0 16px rgba(255, 140, 70, 0.35) !important;
  }
}

@media (max-width: 540px) {
  .operator-video-pip {
    width: 160px !important;
    height: 100px !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 32px) !important;
    right: calc(env(safe-area-inset-right, 0px) + 12px) !important;
    z-index: 2500 !important;
    border-width: 1.5px !important;
  }
}

/* =========================================================================
   MODO MOSAICO MULTI-CÂMERAS NO OPERADOR
   ========================================================================= */

#app.mosaic #map {
  display: none !important;
}

#app.mosaic #operator-video-pip {
  display: none !important;
}

#app.mosaic .op-mosaic-stage-wrap {
  display: flex !important;
}

.op-mosaic-stage-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #03070d;
  z-index: 900;
  padding-top: 56px;
  box-sizing: border-box;
  overflow: hidden;
}

.mosaic-grid {
  flex: 1;
  width: 100%;
  height: 100%;
  display: grid;
  gap: 8px;
  padding: 8px;
  box-sizing: border-box;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.mosaic-grid[data-count="1"] {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.mosaic-grid[data-count="2"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

.mosaic-grid[data-count="3"] {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr;
}

.mosaic-grid[data-count="4"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.mosaic-grid[data-count="5"],
.mosaic-grid[data-count="6"] {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
}

.mosaic-grid[data-count="7"],
.mosaic-grid[data-count="8"] {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 1fr 1fr;
}

.mosaic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.75);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  min-height: 0;
  min-width: 0;
}

.mosaic-card:hover {
  border-color: rgba(255, 140, 70, 0.5);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.9), 0 0 12px rgba(255, 140, 70, 0.25);
}

.mosaic-card.is-dragging {
  opacity: 0.35;
  border: 2px dashed var(--accent, #ff8c46);
  transform: scale(0.98);
}

.mosaic-card.drag-over {
  border: 2px solid var(--accent, #ff8c46) !important;
  box-shadow: 0 0 25px rgba(255, 140, 70, 0.6) !important;
  transform: scale(1.02);
}

.mosaic-grid.dragging-active iframe {
  pointer-events: none !important;
}

.mosaic-card-header {
  height: 32px;
  min-height: 32px;
  background: rgba(15, 20, 26, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  user-select: none;
  cursor: grab;
}

.mosaic-card-header:active {
  cursor: grabbing;
}

.mosaic-card-info {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mosaic-drag-handle {
  color: var(--text-dim, #8ba2b5);
  font-size: 13px;
  letter-spacing: -2px;
  cursor: grab;
  padding: 0 2px;
}

.mosaic-cam-badge {
  background: rgba(255, 140, 70, 0.2);
  border: 1px solid rgba(255, 140, 70, 0.5);
  color: #ff8c46;
  font-family: var(--mono, monospace);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}

.mosaic-cam-name {
  color: #ffffff;
  font-family: var(--display, sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mosaic-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mosaic-card-btn {
  background: transparent;
  border: none;
  color: var(--text-dim, #8ba2b5);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.mosaic-card-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.mosaic-card-close-btn:hover {
  color: #ff4757 !important;
  background: rgba(255, 71, 87, 0.2) !important;
}

.mosaic-card-body {
  flex: 1;
  width: 100%;
  height: calc(100% - 32px);
  position: relative;
  background: #000000;
  overflow: hidden;
}

.mosaic-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #000000;
}

.mosaic-card.card-fullscreen {
  position: absolute !important;
  top: 56px !important;
  left: 0 !important;
  width: 100% !important;
  height: calc(100% - 56px) !important;
  z-index: 950 !important;
  border-radius: 0 !important;
  border: none !important;
}

/* Menu Lateral Retrátil de Câmeras no Operador */
.mosaic-sidebar {
  position: absolute;
  top: 58px;
  right: 16px;
  width: 250px;
  max-height: calc(100% - 76px);
  background: rgba(13, 18, 24, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.85), 0 0 15px rgba(0, 229, 255, 0.15);
  z-index: 980;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), opacity 0.3s ease;
}

.mosaic-sidebar.collapsed {
  transform: translateX(120%);
  opacity: 0;
  pointer-events: none;
}

.mosaic-sidebar-header {
  padding: 10px 12px;
  background: rgba(20, 26, 34, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mosaic-sidebar-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ffffff;
  font-family: var(--display, sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.mosaic-count-badge {
  background: rgba(0, 229, 255, 0.2);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.4);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  margin-left: 3px;
}

.mosaic-sidebar-toggle-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim, #8ba2b5);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  transition: all 0.2s;
}

.mosaic-sidebar-toggle-btn:hover {
  color: #ffffff;
  border-color: var(--accent);
  background: rgba(255, 140, 70, 0.15);
}

.mosaic-sidebar-actions {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: flex-end;
}

.mosaic-sidebar-actions .btn {
  font-size: 10px;
  padding: 3px 8px;
  color: var(--accent, #ff8c46);
  border-color: rgba(255, 140, 70, 0.4);
}

.mosaic-sidebar-list {
  padding: 6px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mosaic-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  transition: background 0.15s;
}

.mosaic-sidebar-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.mosaic-sidebar-item-info {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.mosaic-sidebar-item-name {
  color: #e0e6ed;
  font-size: 10.5px;
  font-family: var(--display, sans-serif);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

.mosaic-sidebar-item-btn {
  border: none;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s;
}

.mosaic-sidebar-item-btn.btn-remove {
  background: rgba(255, 71, 87, 0.15);
  color: #ff6b81;
  border: 1px solid rgba(255, 71, 87, 0.3);
}

.mosaic-sidebar-item-btn.btn-remove:hover {
  background: rgba(255, 71, 87, 0.3);
  color: #ffffff;
}

.mosaic-sidebar-item-btn.btn-add {
  background: rgba(0, 229, 255, 0.15);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.35);
}

.mosaic-sidebar-item-btn.btn-add:hover {
  background: rgba(0, 229, 255, 0.3);
  color: #ffffff;
}

@media (max-width: 900px) {
  .op-mosaic-stage-wrap {
    padding-top: 52px;
  }
  .mosaic-grid {
    gap: 4px;
    padding: 4px;
    overflow-y: auto;
  }
  .mosaic-grid[data-count="1"] {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }
  .mosaic-grid[data-count="2"] {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  .mosaic-grid[data-count="3"] {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 1fr);
  }
  .mosaic-grid[data-count="4"],
  .mosaic-grid[data-count="5"],
  .mosaic-grid[data-count="6"],
  .mosaic-grid[data-count="7"],
  .mosaic-grid[data-count="8"] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }
  .mosaic-sidebar {
    width: 220px;
    right: 8px;
    top: 54px;
  }
}

/* =========================================================================
   PORTAL DE AUTENTICAÇÃO DO OPERADOR (SOMENTE SENHA)
   ========================================================================= */
.tactical-auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 10, 12, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tactical-auth-card {
  background: var(--panel);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
  width: 380px;
  max-width: 95vw;
  padding: 24px 22px;
  box-shadow: var(--shadow-lg), 0 0 35px var(--accent-glow);
  position: relative;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.auth-brand h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
}

.auth-brand span {
  font-size: 9.5px;
  color: var(--accent);
  display: block;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-top: 2px;
}

.auth-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 16px;
}

.auth-error-msg {
  font-size: 11px;
  color: var(--danger);
  margin-top: 8px;
  min-height: 14px;
  font-weight: 600;
}

/* Tag discreta no canto inferior esquerdo do vídeo (PiP / Split / Mosaico) */
.video-drone-bottom-tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 1230;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(10, 14, 18, 0.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 140, 70, 0.45);
  border-radius: 4px;
  padding: 2px 7px;
  font-family: var(--mono, monospace);
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}


