/* ==========================================================================
   OIIon Security Platform - Layout de Pantalla Completa
   ========================================================================== */

:root {
  --bg-main: #0b0f19;
  --bg-card: #161f30;
  --bg-hover: #1e293b;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  
  --sidebar-width: 260px;
  --header-height: 64px;
  --border-radius: 12px;
}

/* Restablecer y ocupar 100% real del viewport */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

/* Layout Principal de 2 Columnas */
.app-wrapper {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar Fijo */
.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

/* Area Principal (Navbar + Contenido + Footer) */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* Evita desbordamiento de tablas/flexbox */
  background-color: var(--bg-main);
}

/* Navbar de extremo a extremo */
.app-navbar {
  height: var(--header-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  width: 100%;
}

/* Contenido Principal */
.app-content {
  flex: 1;
  padding: 24px;
  width: 100%;
}

/* Footer OIIon */
.app-footer {
  padding: 16px 24px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Estilos de Componentes OIIon */
.card-oiion {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.form-control-oiion {
  background-color: var(--bg-main) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  border-radius: 6px;
}

.form-control-oiion:focus {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.3) !important;
}

.btn-action {
  background-color: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background-color: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

/* ==========================================================================
   OIIon Custom Toasts (Bottom Centered)
   ========================================================================== */

#oiion-toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse; /* El más reciente queda abajo */
  gap: 10px;
  align-items: center;
  pointer-events: none;
}

.oiion-toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 500px;
  padding: 12px 20px;
  border-radius: 8px;
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.oiion-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Tipos de Toast con Neón */
.oiion-toast-success {
  border-color: var(--accent-green);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}
.oiion-toast-success i.toast-icon { color: var(--accent-green); }

.oiion-toast-error {
  border-color: var(--accent-red);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}
.oiion-toast-error i.toast-icon { color: var(--accent-red); }

.oiion-toast-warning {
  border-color: #f59e0b;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.25);
}
.oiion-toast-warning i.toast-icon { color: #f59e0b; }

.oiion-toast-info {
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.25);
}
.oiion-toast-info i.toast-icon { color: var(--accent-cyan); }

/* Botón para cerrar */
.oiion-toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.oiion-toast-close:hover {
  color: var(--text-main);
}

/* ==========================================================================
   Badging & Status Indicators (Punto Parpadeante)
   ========================================================================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

/* Estado Activo (Verde) */
.status-badge.online {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.3);
}

.status-badge.online i {
  color: var(--accent-green);
  animation: pulse-green 1.5s infinite;
}

/* Estado Inactivo (Rojo) */
.status-badge.offline {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.3);
}

.status-badge.offline i {
  color: var(--accent-red);
  animation: pulse-red 1.5s infinite;
}

/* Animaciones del parpadeo */
@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.4;
  }
}

@keyframes pulse-red {
  0% {
    transform: scale(0.95);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.4;
  }
}

.card-radio-input {
    display: none;
  }
  .card-radio-btn {
    background: rgba(10, 15, 29, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .card-radio-btn:hover {
    border-color: rgba(0, 242, 254, 0.4);
    color: #fff;
  }
  .card-radio-input:checked + .card-radio-btn {
    background: rgba(0, 242, 254, 0.15);
    border-color: #00f2fe;
    color: #00f2fe;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
    font-weight: bold;
  }


  .equipment-avatar-container {
      width: 85px;
      height: 85px;
      margin: 0 auto 12px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(0, 242, 254, 0.1) 0%, rgba(10, 15, 29, 0.7) 80%);
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      transition: all 0.3s ease;
    }

    .equipment-icon {
      font-size: 2.2rem;
    }

    .equip-status-dot {
      position: absolute;
      top: 4px;
      right: 4px;
      width: 12px;
      height: 12px;
      border-radius: 50%;
    }

    /* Estilos Radios Modal */
    .card-radio-input {
      display: none;
    }
    .card-radio-btn {
      background: rgba(10, 15, 29, 0.6);
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: #94a3b8;
      font-size: 0.85rem;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .card-radio-btn:hover {
      border-color: rgba(0, 242, 254, 0.4);
      color: #fff;
    }
    .card-radio-input:checked + .card-radio-btn {
      background: rgba(0, 242, 254, 0.15);
      border-color: #00f2fe;
      color: #00f2fe;
      box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
      font-weight: bold;
    }

    /* ==========================================================================
   ESTADOS DE CHAPA - OIION
   ========================================================================== */

/* Badge Abierto (Verde) */
.status-badge.abierto {
    background-color: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

.status-badge.abierto i {
    color: #10b981;
}

.status-badge.abierto .badge-text {
    color: #10b981;
}

/* Badge Cerrado (Rojo) */
.status-badge.cerrado {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.status-badge.cerrado i {
    color: #ef4444;
}

.status-badge.cerrado .badge-text {
    color: #ef4444;
}

/* Badge Sin Estado (Gris) */
.status-badge.sin-estado {
    background-color: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.3);
    color: #94a3b8;
}

.status-badge.sin-estado i {
    color: #94a3b8;
}

.status-badge.sin-estado .badge-text {
    color: #94a3b8;
}