/* ============================================================================
   PLANIORA v3.0.1 — MÓDULO FUTURISTA OPS (COMANDO Ctrl+K + KILL-SWITCHES + RADAR)
   Archivo independiente: no modifica ni altera css/styles.css
   ============================================================================ */

/* === BOTÓN FLOTANTE CUÁNTICO (COMANDO RÁPIDO Ctrl+K) === */
#ops-cmd-fab {
  position: fixed;
  right: 18px;
  bottom: 20px;
  z-index: 48;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.55);
  background: linear-gradient(135deg, rgba(11, 17, 32, 0.94) 0%, rgba(15, 34, 68, 0.94) 100%);
  color: #F8FAFC;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(6, 182, 212, 0.28), 0 0 0 1px rgba(16, 185, 129, 0.20) inset;
  transition: transform .15s ease, box-shadow .18s ease, border-color .18s ease;
}
#ops-cmd-fab:hover {
  transform: translateY(-2px);
  border-color: #22D3EE;
  box-shadow: 0 14px 36px rgba(6, 182, 212, 0.42), 0 0 18px rgba(16, 185, 129, 0.28);
}
#ops-cmd-fab .ops-kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.16);
  color: #67E8F9;
  border: 1px solid rgba(34, 211, 238, 0.35);
}
#ops-cmd-fab .ops-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 10px #10B981;
  animation: opsPulse 2.2s infinite;
}
@keyframes opsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

@media (max-width: 860px) {
  #ops-cmd-fab {
    bottom: calc(var(--mobbar-h, 68px) + 12px);
    right: 12px;
    padding: 8px 12px;
  }
  #ops-cmd-fab .ops-kbd { display: none; }
}

/* === PALETA DE COMANDOS HOLOGRÁFICA (Ctrl + K) === */
#ops-cmd-modal {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(5, 9, 20, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 14px 20px;
}
#ops-cmd-modal.hide { display: none !important; }

.ops-cmd-box {
  width: 100%;
  max-width: 580px;
  border-radius: 22px;
  background: var(--surface, #FFFFFF);
  border: 1.5px solid rgba(34, 211, 238, 0.48);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48), 0 0 38px rgba(6, 182, 212, 0.18);
  overflow: hidden;
  animation: opsPop .14s ease-out;
}
@keyframes opsPop {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ops-cmd-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #E2E8F0);
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.08), rgba(16, 185, 129, 0.06));
}
.ops-cmd-head input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 15px;
  font-weight: 600;
  padding: 6px 4px;
  min-height: 36px;
}
.ops-cmd-list {
  max-height: 54vh;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ops-cmd-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg, #0F172A);
  text-align: left;
  cursor: pointer;
  min-height: 44px;
  transition: background .12s ease, border-color .12s ease;
}
.ops-cmd-item:hover, .ops-cmd-item.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(16, 185, 129, 0.10));
  border-color: rgba(6, 182, 212, 0.42);
}
.ops-cmd-item .ops-ci-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ops-cmd-item .ops-ci-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
  font-size: 16px;
  flex-shrink: 0;
}
.ops-cmd-item .ops-ci-sub {
  font-size: 11.5px;
  color: var(--muted, #475569);
  display: block;
}
.ops-cmd-item .ops-ci-cat {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2, #F8FAFC);
  color: var(--muted, #475569);
  border: 1px solid var(--border, #E2E8F0);
  flex-shrink: 0;
}
.ops-cmd-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 14px;
  font-size: 11.5px;
  color: var(--muted, #475569);
  border-top: 1px solid var(--border, #E2E8F0);
  background: var(--surface-2, #F8FAFC);
}

/* === BARRAS DE RADAR DE ACTUALIZACIÓN, MANTENIMIENTO Y CONECTIVIDAD === */
#ops-ver-bar, #ops-maint-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
}
#ops-ver-bar {
  background: linear-gradient(90deg, #042F2E 0%, #0E7490 50%, #064E3B 100%);
  color: #ECFEFF;
  border-bottom: 1px solid #22D3EE;
}
#ops-maint-bar {
  background: linear-gradient(90deg, #451A03 0%, #78350F 100%);
  color: #FEF3C7;
  border-bottom: 1px solid #F59E0B;
}
#ops-net-pill {
  position: fixed;
  left: 16px;
  bottom: 20px;
  z-index: 48;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #450A0A;
  color: #FEE2E2;
  border: 1px solid #EF4444;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
@media (max-width: 860px) {
  #ops-net-pill { bottom: calc(var(--mobbar-h, 68px) + 12px); left: 10px; }
}

/* === PANEL DE INTERRUPTORES DE EMERGENCIA (KILL-SWITCHES EN ADMIN) === */
.ops-flags-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
@media (max-width: 860px) {
  .ops-flags-grid { grid-template-columns: 1fr; }
}
.ops-flag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
}
.ops-flag-row strong { font-size: 13px; display: block; }
.ops-flag-row span { font-size: 11.5px; color: var(--muted, #475569); }

.ops-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.ops-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
}
.ops-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #64748B;
  transition: background .2s ease;
}
.ops-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: transform .2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}
.ops-switch input:checked + .ops-slider {
  background: linear-gradient(135deg, #06B6D4, #10B981);
}
.ops-switch input:checked + .ops-slider::before {
  transform: translateX(22px);
}

.ops-module-off { display: none !important; }
.ops-ai-muted-note {
  margin: 0 0 10px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  font-size: 12px;
  font-weight: 600;
}

@media print {
  #ops-cmd-fab, #ops-cmd-modal, #ops-ver-bar, #ops-maint-bar, #ops-net-pill, #ops-flags-card {
    display: none !important;
  }
}

/* === AGRUPACIÓN FUTURISTA DE PESTAÑAS (CERO MAREO DE BOTONES) === */
#doc-tabs.ops-clean-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface-2, #F8FAFC);
  border: 1px solid var(--border, #E2E8F0);
  overflow: visible;
}
#doc-tabs.ops-clean-tabs .ops-tab-sep {
  width: 1px;
  height: 22px;
  background: var(--border, #CBD5E1);
  margin: 0 2px;
}
.ops-inst-wrap {
  position: relative;
  display: inline-flex;
}
.ops-inst-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(6, 182, 212, 0.45) !important;
}
.ops-inst-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 45;
  min-width: 220px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface, #FFFFFF);
  border: 1.5px solid rgba(34, 211, 238, 0.45);
  box-shadow: 0 18px 42px rgba(5, 9, 20, 0.28);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ops-inst-menu.hide { display: none !important; }
.ops-inst-menu button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border-radius: 9px;
}
@media (max-width: 640px) {
  #doc-tabs.ops-clean-tabs .ops-tab-sep { display: none; }
  .ops-inst-menu { left: 0; right: auto; max-width: calc(100vw - 44px); }
}
