@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;700&family=Playfair+Display:ital,wght@1,700&display=swap');

:root {
  --deep-space: #050505;
  --neon-green: #39FF14;
  --neon-cyan: #39FF14;
  --neon-crimson: #FF3131;
  --neon-amber: #FFD700;
  --gothic-grey: #111111;
  --glass-bg: rgba(20, 20, 20, 0.7);
  --glass-border: rgba(57, 255, 20, 0.2);
  --glow-cyan: 0 0 10px rgba(57, 255, 20, 0.4);
  --glow-crimson: 0 0 10px rgba(255, 49, 49, 0.4);
  --font-main: 'Roboto Mono', 'Courier New', monospace;
  --font-accent: 'Roboto Mono', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--deep-space);
  background-image: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 2px, 3px 100%;
  color: var(--neon-green);
  font-family: var(--font-main);
  overflow-x: hidden;
  min-height: 100vh;
  scroll-behavior: smooth;
}

.antigravity-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .antigravity-container {
    padding: 2rem;
  }
}

header {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(20, 20, 20, 0.95);
  border-bottom: 1px solid var(--glass-border);
  border-radius: 15px;
  gap: 1.5rem;
  z-index: 2000;
  position: sticky;
  top: 1rem;
}

.header-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  header {
    flex-direction: row;
    margin-bottom: 3rem;
    padding: 1rem 2rem;
    gap: 0;
  }
}

.logo {
  font-family: var(--font-main);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--neon-cyan);
  letter-spacing: 1px;
}

@media (min-width: 768px) {
  .logo {
    font-size: 2.5rem;
  }
}

.mode-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-badge {
  padding: 0.5rem 1.25rem;
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  background: rgba(0, 243, 255, 0.05);
  animation: pulse 2.5s infinite ease-in-out;
  letter-spacing: 1px;
}

@keyframes pulse {
  0% { opacity: 0.7; box-shadow: 0 0 5px rgba(0, 243, 255, 0.3); transform: scale(1); }
  50% { opacity: 1; box-shadow: 0 0 20px rgba(0, 243, 255, 0.6); transform: scale(1.02); }
  100% { opacity: 0.7; box-shadow: 0 0 5px rgba(0, 243, 255, 0.3); transform: scale(1); }
}

.grid-maintenance {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
}

@media (min-width: 700px) {
  .grid-maintenance {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
  }
}

.card {
  background: var(--gothic-grey);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--neon-cyan), transparent);
  opacity: 0.6;
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--neon-cyan);
  box-shadow: 0 10px 30px rgba(57, 255, 20, 0.15), 0 0 15px rgba(57, 255, 20, 0.05);
}

.card.active-category {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 25px rgba(57, 255, 20, 0.2);
}

.card h3 {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.4rem;
  letter-spacing: 0.5px;
  color: #fff;
}

.card h3 i {
  color: var(--neon-cyan);
  filter: drop-shadow(var(--glow-cyan));
}

.card p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  border-left: 2px solid var(--neon-cyan);
  padding-left: 10px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}

.btn {
  padding: 0.85rem;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.85rem;
  text-transform: uppercase;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.9);
}

.btn:hover {
  background: var(--neon-cyan);
  color: var(--deep-space);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

.btn-danger {
  grid-column: span 2;
  border-color: rgba(255, 26, 26, 0.4);
  color: var(--neon-crimson);
  background: rgba(255, 26, 26, 0.05);
}

.btn-danger:hover {
  background: var(--neon-crimson);
  color: #fff;
  box-shadow: var(--glow-crimson);
  border-color: var(--neon-crimson);
}

.karma-iso {
  background: rgba(10, 10, 10, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 170, 0, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.8rem;
}

.karma-iso i {
  color: var(--neon-amber);
  font-size: 1.2rem;
}

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

.scanner-tesla {
  margin-top: 3rem;
  width: 100%;
  padding: 2rem;
  background: var(--gothic-grey);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  position: relative;
}

.scanner-tesla::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 243, 255, 0.03) 0px,
    rgba(0, 243, 255, 0.03) 1px,
    transparent 1px,
    transparent 4px
  );
  pointer-events: none;
}

.scanner-tesla h2 {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--neon-cyan);
}

#tesla-output {
  font-family: 'Courier New', Courier, monospace;
  color: var(--neon-cyan);
  font-size: 1.1rem;
  opacity: 0.9;
  text-shadow: 0 0 5px rgba(0, 243, 255, 0.2);
}

/* Detalle de Cristal Superior */
  background: linear-gradient(180deg, rgba(5,5,5,0.4) 0%, transparent 15%, transparent 85%, rgba(5,5,5,0.4) 100%);
  z-index: 999;
  box-shadow: inset 0 0 100px rgba(0,0,0,0.5);
}

/* --- ESTILOS FASE 2: MODO GRAVITÓN --- */

body.graviton-mode {
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(0, 243, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 90% 90%, rgba(255, 26, 26, 0.1) 0%, transparent 50%),
    url("https://www.transparenttextures.com/patterns/carbon-fibre.png");
}

.graviton-mode .status-badge {
  border-color: #fff;
  color: #fff;
  background: linear-gradient(45deg, var(--neon-cyan), var(--neon-crimson));
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.graviton-mode .card {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 15px 40px rgba(0,0,0,0.7);
}

.graviton-mode .btn:hover {
  transform: translateY(-3px) scale(1.05);
  filter: brightness(1.2);
}

/* Alertas Flotantes (Modo Hardcore) */
.floating-alert {
  position: absolute;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 26, 26, 0.8);
  backdrop-filter: blur(5px);
  border: 1px solid var(--neon-crimson);
  border-radius: 8px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: bold;
  pointer-events: auto;
  cursor: crosshair;
  animation: float-around 10s infinite ease-in-out;
  z-index: 500;
  box-shadow: var(--glow-crimson);
}

@keyframes float-around {
  0% { transform: translate(0, 0); }
  25% { transform: translate(20px, -30px); }
  50% { transform: translate(-15px, 25px); }
  75% { transform: translate(30px, 10px); }
  100% { transform: translate(0, 0); }
}

/* Sección Snowden-Lister */
.security-status {
  grid-column: 1 / -1;
  background: linear-gradient(90deg, rgba(0, 243, 255, 0.05), transparent);
  border: 1px solid rgba(0, 243, 255, 0.2);
  padding: 1.5rem;
  border-radius: 15px;
  margin-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.autoclaved-badge {
  color: var(--neon-cyan);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.autoclaved-badge i {
  animation: spin-slow 4s infinite linear;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Transición de Modo */
.mode-toggle-btn {
  background: var(--glass-bg);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}


.mode-toggle-btn:hover {
  background: var(--neon-cyan);
  color: var(--deep-space);
}

/* --- ESTILOS PANEL ACTIVIDAD --- */
.activity-log-panel {
  width: 100%;
  margin-top: 3rem;
  padding: 2.5rem;
  background: var(--gothic-grey);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  backdrop-filter: blur(15px);
}

.activity-log-panel h2 {
  font-family: var(--font-accent);
  color: var(--neon-cyan);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

#session-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid var(--neon-cyan);
  border-radius: 8px;
  animation: slide-in-left 0.4s ease-out forwards;
  transition: all 0.3s ease;
  cursor: pointer;
}

.history-item:hover {
  background: rgba(57, 255, 20, 0.05);
  transform: translateX(5px);
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.history-item .timestamp {
  font-size: 0.75rem;
  opacity: 0.5;
  font-family: 'Courier New', Courier, monospace;
}

.telemetry-log-line {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  border-left: 2px solid rgba(0, 243, 255, 0.3);
  padding-left: 10px;
  animation: ghost-fade 0.5s ease-out;
}

@keyframes ghost-fade {
  from { opacity: 0; filter: blur(5px); }
  to { opacity: 1; filter: blur(0); }
}

/* --- ESTILOS MÓVIL Y ESCÁNER --- */

.fab-scanner {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 65px;
  height: 65px;
  background: var(--neon-cyan);
  color: var(--deep-space);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8rem;
  box-shadow: var(--glow-cyan);
  z-index: 1000;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-scanner:active {
  transform: scale(0.9);
}

/* Modal de Escaneo */
.scanner-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 5000;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
}

.scanner-modal.active {
  display: flex;
}

#reader {
  width: 320px;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  background: #000;
}

.close-scanner {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
}

.scanner-ui-overlay {
  position: absolute;
  width: 320px;
  height: 320px;
  border: 2px solid rgba(0, 243, 255, 0.3);
  pointer-events: none;
}

.scanner-ui-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  animation: scan-line 2s infinite linear;
}

@keyframes scan-line {
  0% { top: 0; }
  100% { top: 100%; }
}

.detection-box {
  position: absolute;
  border: 2px solid var(--neon-cyan);
  background: rgba(0, 136, 204, 0.1);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 5px;
  box-sizing: border-box;
  animation: box-appear 0.3s ease-out;
}

.detection-label {
  background: var(--neon-cyan);
  color: #fff;
  font-size: 0.6rem;
  font-weight: bold;
  padding: 2px 4px;
  position: absolute;
  top: -20px;
  left: -2px;
  white-space: nowrap;
}

@keyframes box-appear {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* Highlighting searched element */
.highlight-scan {
  animation: highlight-pulse 2s infinite alternate;
  border-color: var(--neon-cyan) !important;
  box-shadow: 0 0 50px rgba(0, 243, 255, 0.8) !important;
  transform: scale(1.05) !important;
}

@keyframes highlight-pulse {
  from { box-shadow: 0 0 20px rgba(0, 243, 255, 0.4); }
  to { box-shadow: 0 0 50px rgba(0, 243, 255, 0.8); }
}

/* --- ESTILOS CIERRE DE JORNADA --- */
.end-shift-btn {
  background: rgba(255, 26, 26, 0.1);
  border-color: var(--neon-amber);
  color: #fff;
  padding: 0.8rem 1.5rem;
  font-family: var(--font-accent);
  box-shadow: 0 0 10px rgba(230, 153, 0, 0.3);
}

.end-shift-btn:hover {
  background: var(--neon-amber);
  color: var(--deep-space);
  box-shadow: 0 0 20px rgba(230, 153, 0, 0.8);
  transform: scale(1.05);
}

/* --- ASISTENTE SHIVA (MODAL Y DINÁMICA) --- */

.shiva-panel {
  position: fixed;
  top: 10%;
  left: 5%;
  width: 90%;
  height: 80%;
  background: rgba(5, 5, 5, 0.98);
  border: 1px solid var(--neon-cyan);
  border-radius: 40px;
  z-index: 6000;
  display: none;
  flex-direction: column;
  padding: 3rem;
  box-shadow: 0 0 150px rgba(0, 243, 255, 0.15), inset 0 0 20px rgba(255, 255, 255, 0.05);
  overflow-y: auto;
  animation: modalSlideIn 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.9) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (min-width: 1000px) {
  .shiva-panel {
    width: 60%;
    left: 20%;
  }
}

.shiva-panel.active {
  display: flex;
}

.shiva-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.shiva-search-box {
  position: relative;
  width: 100%;
  margin-bottom: 2rem;
}

.shiva-search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 1rem 1rem 1rem 3rem;
  color: #fff;
  font-family: var(--font-main);
  outline: none;
  transition: all 0.3s ease;
}

.shiva-search-box input:focus {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.shiva-search-box i {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--neon-cyan);
}

.shiva-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .shiva-grid {
    grid-template-columns: 1.5fr 1fr;
  }
}

.diagram-container {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 20px;
  padding: 1rem;
  border: 1px dashed var(--glass-border);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.diagram-container svg.tech-svg {
  width: 100%;
  max-width: 450px;
  height: auto;
  filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.3));
}

.tech-svg rect, .tech-svg circle, .tech-svg path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawSvg 3s forwards ease-in-out;
}

@keyframes drawSvg {
  to { stroke-dashoffset: 0; }
}

.knowledge-pack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.expert-advice {
  background: linear-gradient(90deg, rgba(0, 243, 255, 0.1), transparent);
  border-left: 4px solid var(--neon-cyan);
  padding: 1.5rem;
  border-radius: 0 15px 15px 0;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
}

.voice-input-area {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: 20px;
}

.mic-btn {
  width: 60px;
  height: 60px;
  background: var(--neon-crimson);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mic-btn.recording {
  animation: pulse-red 1.5s infinite;
  background: #ff0000;
  box-shadow: 0 0 20px #ff0000;
}

@keyframes pulse-red {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1.0); }
}

.pdf-export-btn {
  background: var(--neon-amber);
  color: var(--deep-space);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pdf-export-btn:active {
  transform: scale(0.95);
}

/* --- ERGONOMÍA MÓVIL Y ROTACIÓN --- */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    padding: 1rem;
    position: relative;
    top: 0;
  }
  
  .header-actions, .karma-iso, .mode-status {
    width: 100%;
    justify-content: center;
  }

  .shiva-panel {
    top: 5%;
    height: 90%;
    width: 96%;
    left: 2%;
    padding: 1.5rem;
  }

  /* One-handed adjustments */
  .shiva-actions {
    position: sticky;
    bottom: 0;
    background: var(--deep-space);
    padding-top: 1rem;
    margin-top: auto;
  }

  .shiva-grid {
    gap: 1rem;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .shiva-panel {
    top: 2%;
    height: 96%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: start;
  }

  .shiva-header {
    width: 100%;
  }

  .shiva-grid {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .diagram-container {
    min-height: 150px;
  }

  .voice-input-area {
    width: 100%;
  }
}

.shiva-panel input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--neon-cyan);
}

.tech-svg [data-part] {
  transition: all 0.3s ease;
}

.tech-svg .highlighted-part {
  stroke-width: 3;
  filter: drop-shadow(0 0 10px var(--neon-cyan));
  animation: pulse-part 1s infinite alternate;
}

@keyframes pulse-part {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* --- FASE 3: CONTROL CENTER (ANALYTICS & LOGISTICS) --- */

.phase3-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.nightingale-panel, .logistic-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  border-radius: 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.nightingale-panel h2, .logistic-panel h2 {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-accent);
}

.prediction-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100px;
  margin-bottom: 1rem;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-bar {
  flex-grow: 1;
  background: var(--neon-cyan);
  transition: height 0.3s ease;
}

.chart-bar.warning {
  background: var(--neon-crimson);
}

.inventory-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  padding: 0.8rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
}

.inventory-item:hover {
  background: rgba(0, 136, 204, 0.05);
  transform: translateX(5px);
}

.stock-meter {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.stock-fill {
  height: 100%;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
  transition: width 0.5s ease-in-out;
}

.stock-fill.low {
  background: var(--neon-crimson);
  box-shadow: 0 0 10px var(--neon-crimson);
}

@media (max-width: 900px) {
  .phase3-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   MÓDULO AR: CÁMARA EN TIEMPO REAL (VISOR TÉCNICO)
   ===================================================== */

/* Botón de toggle AR en la cabecera Shiva */
.btn-ar-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 136, 204, 0.15);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-main);
}

.btn-ar-toggle:hover,
.btn-ar-toggle.active {
  background: var(--neon-cyan);
  color: var(--deep-space);
  box-shadow: 0 0 20px rgba(0, 136, 204, 0.5);
}

.btn-ar-toggle.active {
  animation: ar-btn-pulse 2s infinite;
}

@keyframes ar-btn-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(0,136,204,0.4); }
  50%       { box-shadow: 0 0 25px rgba(0,136,204,0.9); }
}

/* Contenedor AR (dentro del panel Shiva) */
.ar-container-hidden {
  display: none;
}

.ar-container-active {
  display: block;
  position: relative;
  width: 100%;
  /* Proporción 16:9 en móvil, altura fija en escritorio */
  height: clamp(240px, 45vw, 420px);
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 30px rgba(0, 136, 204, 0.4),
              inset 0 0 40px rgba(0, 0, 0, 0.8);
  margin-bottom: 1.5rem;
  animation: ar-container-appear 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes ar-container-appear {
  from { opacity: 0; transform: scaleY(0.6); }
  to   { opacity: 1; transform: scaleY(1); }
}

/* El stream de vídeo ocupa todo el contenedor */
#ar-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#ar-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ---- HUD overlay (encima del vídeo) ---- */
.ar-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;   /* solo los botones tendrán pointer-events:auto */
}

/* Línea de escaneo */
.ar-scan-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 200, 255, 0.0) 10%,
    rgba(0, 200, 255, 0.8) 50%,
    rgba(0, 200, 255, 0.0) 90%,
    transparent 100%);
  box-shadow: 0 0 8px rgba(0, 200, 255, 0.6);
  animation: ar-scanline 3s linear infinite;
  top: 0;
}

@keyframes ar-scanline {
  0%   { top: 0;    opacity: 1; }
  95%  { top: 100%; opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Esquinas de encuadre */
.ar-corners {
  position: absolute;
  inset: 12px;
}

.arc {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--neon-cyan);
  border-style: solid;
  opacity: 0.9;
}

.arc.tl { top: 0;   left: 0;  border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.arc.tr { top: 0;   right: 0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.arc.bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.arc.br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }

/* Barra HUD superior */
.ar-hud-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,0.75) 0%, transparent 100%);
}

.ar-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  text-transform: uppercase;
}

.ar-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3333;
  box-shadow: 0 0 6px #ff3333;
  animation: ar-dot-blink 1.2s infinite;
}

@keyframes ar-dot-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

.ar-hud-category {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(0,136,204,0.8);
  max-width: 40%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ar-hud-time {
  font-family: 'Courier New', monospace;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 1px;
}

/* Checklist flotante (lado derecho) */
.ar-float-checklist {
  position: absolute;
  top: 50px;
  right: 10px;
  width: clamp(130px, 30%, 180px);
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(0, 136, 204, 0.5);
  border-radius: 10px;
  padding: 8px 10px;
  backdrop-filter: blur(8px);
}

.ar-float-title {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--neon-cyan);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ar-float-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.62rem;
  color: rgba(255,255,255,0.85);
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  line-height: 1.3;
}

.ar-float-item:last-child { border-bottom: none; }

.ar-float-item.done {
  color: var(--neon-cyan);
  text-decoration: line-through;
  opacity: 0.6;
}

.ar-float-item .ar-item-dot {
  width: 6px;
  height: 6px;
  min-width: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  margin-top: 3px;
}

.ar-float-item.done .ar-item-dot {
  background: var(--neon-cyan);
  box-shadow: 0 0 4px var(--neon-cyan);
}

/* Hint Shiva flotante (abajo) */
.ar-float-hint {
  position: absolute;
  bottom: 60px;
  left: 10px;
  right: calc(clamp(130px, 30%, 180px) + 20px);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(0, 0, 0, 0.72);
  border-left: 3px solid var(--neon-cyan);
  border-radius: 0 10px 10px 0;
  padding: 8px 12px;
  backdrop-filter: blur(8px);
}

.ar-float-hint i {
  color: var(--neon-cyan);
  font-size: 0.9rem;
  margin-top: 2px;
  flex-shrink: 0;
}

#ar-hint-text {
  font-size: 0.63rem;
  color: rgba(255,255,255,0.85);
  font-style: italic;
  line-height: 1.4;
  margin: 0;
}

/* Barra de controles AR (inferior) */
.ar-ctrl-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 10px 0 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 100%);
  pointer-events: auto;
}

.ar-ctrl {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(6px);
}

.ar-ctrl:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0,136,204,0.5);
  transform: scale(1.1);
}

.ar-ctrl-main {
  width: 58px;
  height: 58px;
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
  color: var(--deep-space);
  font-size: 1.3rem;
  box-shadow: 0 0 20px rgba(0,136,204,0.6);
}

.ar-ctrl-main:hover {
  transform: scale(1.15);
  color: var(--deep-space);
  box-shadow: 0 0 35px rgba(0,136,204,0.9);
}

.ar-ctrl.torch-on {
  background: rgba(255, 220, 0, 0.3);
  border-color: #ffdc00;
  color: #ffdc00;
  box-shadow: 0 0 15px rgba(255,220,0,0.5);
}

/* Flash de captura */
#ar-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  border-radius: inherit;
  transition: opacity 0.05s ease;
}

#ar-flash.flashing {
  animation: ar-flash-anim 0.4s ease-out forwards;
}

@keyframes ar-flash-anim {
  0%   { opacity: 0.9; }
  100% { opacity: 0; }
}

/* Aviso cámara bloqueada por HTTP */
.ar-https-notice {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: inherit;
  color: #fff;
  text-align: left;
  z-index: 10;
  backdrop-filter: blur(6px);
}

.ar-https-notice i {
  font-size: 2.5rem;
  color: var(--neon-amber);
  flex-shrink: 0;
}

.ar-https-notice strong {
  color: var(--neon-amber);
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.ar-https-notice p {
  font-size: 0.72rem;
  opacity: 0.85;
  line-height: 1.5;
  border: none;
  margin: 0;
  padding: 0;
}

.ar-https-notice ol li {
  margin-bottom: 0.2rem;
}

.ar-https-notice code {
  background: rgba(0,136,204,0.2);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
}

/* --- HUD DE INTERVENCIÓN (OT OVERLAY) --- */
.ot-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 15000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(20px);
  padding: 1rem;
}

.ot-modal {
  width: 100%;
  max-width: 500px;
  background: var(--gothic-grey);
  border: 1px solid var(--neon-cyan);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 0 50px rgba(0, 136, 204, 0.2);
  display: flex;
  flex-direction: column;
}

.ot-header {
  background: rgba(0, 136, 204, 0.1);
  padding: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  text-align: center;
}

.ot-header h2 {
  font-family: var(--font-accent);
  color: var(--neon-cyan);
  font-size: 1.1rem;
  letter-spacing: 2px;
}

.ot-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
}

.ot-tab-btn {
  flex: 1;
  padding: 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s;
}

.ot-tab-btn.active {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
  background: rgba(0, 136, 204, 0.05);
}

.ot-panel {
  display: none;
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.ot-panel.active {
  display: block;
}

.ot-form-group {
  margin-bottom: 1rem;
}

.ot-form-group label {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--neon-cyan);
  margin-bottom: 0.4rem;
  letter-spacing: 1px;
}

.ot-form input, .ot-form select, .ot-form textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 0.8rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
}

.ot-form textarea {
  height: 80px;
  resize: none;
}

.ot-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.ot-card-icon {
  font-size: 1.5rem;
  background: rgba(0, 136, 204, 0.1);
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
}

.ot-card-id {
  font-weight: 800;
  color: var(--neon-cyan);
  font-size: 0.9rem;
}

.ot-card-meta {
  font-size: 0.75rem;
  opacity: 0.7;
}

.ot-card-btn {
  background: var(--neon-cyan);
  border: none;
  color: var(--deep-space);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.7rem;
  cursor: pointer;
}

.ot-overlay-exit {
  animation: ot-exit-anim 0.6s forwards cubic-bezier(1, 0, 0, 1);
}

@keyframes ot-exit-anim {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; filter: blur(20px); }
}

.hidden {
  display: none !important;
}

.shiva-card {
  background: var(--gothic-grey);
  border: 1px solid var(--neon-cyan);
  border-left: 5px solid var(--neon-cyan);
  border-radius: 15px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--glow-cyan);
  animation: slide-in-bottom 0.5s ease-out;
}

@keyframes slide-in-bottom {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.shiva-card .shiva-header {
  color: var(--neon-cyan);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 136, 204, 0.2);
  padding-bottom: 0.5rem;
}

.shiva-card .shiva-body {
  color: #fff;
  font-size: 1rem;
  line-height: 1.4;
  margin-bottom: 1.25rem;
}

.shiva-card .shiva-footer {
  display: flex;
  gap: 1rem;
}

.shiva-card .shiva-footer button {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid var(--neon-cyan);
  background: rgba(0, 136, 204, 0.1);
  color: var(--neon-cyan);
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.shiva-card .shiva-footer button:hover {
  background: var(--neon-cyan);
  color: var(--deep-space);
}

/* BOTÓN DE VOLVER (Mobile Ergo) — icono compacto en esquina */
.nav-back-btn {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  backdrop-filter: blur(6px);
}

.nav-back-btn:hover {
  background: rgba(0, 243, 255, 0.15);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
  transform: scale(1.1);
}

.nav-back-btn:active {
  background: var(--neon-cyan);
  color: var(--deep-space);
  box-shadow: 0 0 15px var(--neon-cyan);
}

.drag-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 10px;
}

/* NAVEGACIÓN INFERIOR CORE (Mobile Agile) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: rgba(0, 0, 0, 0.98);
  border-top: 1px solid var(--neon-green);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 900;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--neon-green);
  opacity: 0.5;
  font-size: 0.65rem;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  flex: 1;
  height: 100%;
  gap: 5px;
}

.nav-item i {
  font-size: 1.5rem;
}

.nav-item:active, .nav-item.active {
  opacity: 1;
  background: rgba(57, 255, 20, 0.1);
  color: #fff;
  text-shadow: 0 0 15px var(--neon-green);
  border-top: 3px solid var(--neon-green);
  margin-top: -3px; /* Compensar borde */
}

/* Simplificación de Efectos para mayor agilidad */
.card {
  transition: transform 0.2s; /* Más rápido */
  border: 1px solid var(--glass-border);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

/* Ocultar elementos obsoletos */
.fab-scanner { display: none !important; }
.scanner-ui-overlay { display: none !important; }

/* --- DEBUG HUD & TELEMETRÍA --- */
.debug-overlay {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 240px;
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid var(--neon-cyan);
  border-radius: 8px;
  padding: 10px;
  font-family: var(--font-accent);
  font-size: 0.7rem;
  z-index: 9999;
  display: none;
  pointer-events: none;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.debug-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.debug-row span.warn {
  color: var(--neon-amber);
  animation: blink 1s infinite;
}

.debug-checklist {
  display: flex;
  justify-content: space-around;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-checklist span {
  opacity: 0.4;
}

.debug-checklist span.success {
  opacity: 1;
  color: var(--neon-green);
  text-shadow: 0 0 5px var(--neon-green);
}

.debug-logs {
  margin-top: 10px;
  max-height: 100px;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 5px;
}

.debug-log-line {
  font-size: 0.6rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.debug-log-line.error { color: var(--neon-crimson); }
.debug-log-line.warn { color: var(--neon-amber); }
.debug-log-line.info { color: var(--neon-cyan); }

/* --- UTILIDADES DE VISIBILIDAD --- */
.hidden:not(.ot-overlay):not(.shiva-overlay) { display: none !important; }
.visible { display: block !important; }

/* --- GESTIÓN DE INTERVENCIONES (OT) --- */
.ot-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 5, 0.95);
  backdrop-filter: blur(15px);
  z-index: 5000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ot-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.05);
}

.ot-modal {
  width: 90%;
  max-width: 800px;
  background: var(--deep-space);
  border: 1px solid var(--neon-cyan);
  border-radius: 20px;
  box-shadow: 0 0 50px rgba(0, 243, 255, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
}

.ot-header {
  padding: 1rem 1.25rem;
  background: rgba(0, 243, 255, 0.05);
  border-bottom: 1px solid rgba(0, 243, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ot-header h2 {
  flex: 1;
  text-align: center;
  margin: 0;
  font-family: var(--font-accent);
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 1rem;
}

.ot-tabs {
  display: flex;
  gap: 1rem;
}

.ot-tab-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: bold;
  transition: all 0.3s;
}

.ot-tab-btn.active {
  background: var(--neon-cyan);
  color: var(--deep-space);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

.ot-panel {
  display: none;
  padding: 1.5rem;
  overflow-y: auto;
}

.ot-panel.active {
  display: block;
}

.ot-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.ot-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  gap: 1rem;
  transition: all 0.3s;
}

.ot-card:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 243, 255, 0.05);
}

.ot-card-icon {
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
}

.ot-card-body {
  flex-grow: 1;
}

.ot-card-id {
  color: var(--neon-cyan);
  font-family: var(--font-accent);
  font-weight: bold;
  font-size: 1rem;
}

.ot-card-meta {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-bottom: 0.5rem;
}

.ot-card-desc {
  font-size: 0.85rem;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.ot-card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  opacity: 0.5;
}

.ot-card-btn {
  background: var(--neon-cyan);
  color: var(--deep-space);
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-weight: bold;
  cursor: pointer;
  align-self: flex-start;
}

/* Formularios OT */
.ot-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ot-form-group label {
  display: block;
  font-size: 0.7rem;
  color: var(--neon-cyan);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.ot-form-group input, .ot-form-group select, .ot-form-group textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.ot-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.ot-input-error {
  border-color: var(--neon-crimson) !important;
  box-shadow: 0 0 10px rgba(255, 26, 26, 0.3);
}

/* Animaciones */
.ot-overlay-exit {
  opacity: 0;
  transform: scale(0.95);
}

@keyframes blink {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* --- MODALES TÉCNICOS (Report & Inventory) --- */
.report-modal, .inventory-modal {
  max-width: 450px;
}

.report-body {
  padding: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.report-section {
  margin-bottom: 1rem;
}

.report-label {
  font-size: 0.6rem;
  color: var(--neon-cyan);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.report-value {
  font-family: var(--font-accent);
  color: white;
}

.report-id {
  font-size: 1.2rem;
  color: var(--neon-green);
}

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.report-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.check-item {
  font-size: 0.7rem;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.check-item.ok { border: 1px solid var(--neon-green); color: var(--neon-green); }
.check-item.fail { border: 1px solid var(--neon-crimson); color: var(--neon-crimson); opacity: 0.6; }

.report-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 1rem;
}

/* El botón de cierre definitivo ocupa toda la fila */
.report-actions .btn-danger {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.report-actions .btn-expert {
  font-size: 0.7rem;
  padding: 0.6rem 0.5rem;
}

/* --- INVENTORY STYLES --- */
.inventory-search { padding: 1rem; }
.inventory-search input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 10px;
  border-radius: 4px;
}

.inventory-list {
  max-height: 250px;
  overflow-y: auto;
  padding: 0 1rem;
}

.inv-item {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.2s;
}

.inv-item:hover, .inv-item.selected {
  background: rgba(57, 255, 20, 0.1);
  border-left: 3px solid var(--neon-green);
}

.inv-item-name { font-weight: bold; }
.inv-item-meta { font-size: 0.7rem; opacity: 0.6; }

.inventory-selection {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
}

.sel-info { margin-bottom: 10px; }
.sel-qty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 1rem;
}

.sel-qty button {
  width: 40px;
  height: 40px;
  background: var(--neon-cyan);
  color: black;
  border: none;
  font-size: 1.5rem;
  font-weight: bold;
  border-radius: 50%;
}

.sel-qty #inv-qty { font-size: 1.5rem; font-family: var(--font-accent); }

/* --- QR COMMUNICATION STYLES --- */
.qr-transfer-modal {
  max-width: 400px;
  text-align: center;
}

.qr-transfer-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.qr-transfer-body p {
  font-size: 0.9rem;
  opacity: 0.8;
  line-height: 1.4;
}

.qr-code-display {
  background: white; /* El QR necesita fondo claro para legibilidad extrema */
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.4);
  border: 4px solid var(--neon-cyan);
}

.qr-code-display canvas, .qr-code-display img {
  display: block;
}

.qr-meta-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#qr-ot-id {
  font-family: var(--font-accent);
  color: var(--neon-cyan);
  font-size: 1.2rem;
  letter-spacing: 2px;
}

#qr-status {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--neon-green);
  animation: blink 2s infinite;
}

/* --- NAVEGACIÓN INFERIOR (ESTRICTA) --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 75px;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(15px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 9000;
  padding: 0 5%;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 10px;
  border-radius: 12px;
  min-width: 60px;
}

.nav-item i {
  font-size: 1.4rem;
  transition: transform 0.3s;
}

.nav-item:hover, .nav-item.active {
  color: var(--neon-cyan);
}

.nav-item.active {
  background: rgba(0, 243, 255, 0.05);
  box-shadow: inset 0 0 15px rgba(0, 243, 255, 0.1);
}

.nav-item.active i {
  transform: translateY(-3px);
  filter: drop-shadow(var(--glow-cyan));
}

.nav-item span {
  font-weight: bold;
}

/* Ajuste para que el contenido no quede tapado por la nav */
body {
  padding-bottom: 90px;
}

@media (min-width: 1000px) {
  .bottom-nav {
    width: 400px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 20px;
    border-radius: 40px;
    border: 1px solid var(--glass-border);
  }
}
