:root {
  --cyan: #00e5ff;
  --accent-cyan: #00e5ff;
  --text: #f0f4f8;
  --text-muted: #94a3b8;
  --border: #2b3a4f;
  --bg-primary: #0f141c;
  --bg-secondary: #18202c;
  --bg-card: #1f2a3a;
}

/* Tipografía global profesional y legible */
body, button, input, select, textarea, table {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Barra Superior / Header Branding */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px;
  background-color: #0b1118;
  border-bottom: 1px solid rgba(0, 229, 255, 0.22);
  min-height: 62px;
}

.branding {
  display: flex;
  align-items: center;
  gap: 14px;
}

.branding-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.18) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1.5px solid rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.25);
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.branding-logo:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

.branding-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.branding-title {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.branding-title .poc-tag {
  color: #00e5ff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

.banner-radio-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.18) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1.5px solid rgba(0, 229, 255, 0.55);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.28);
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.banner-radio-icon-box:hover {
  transform: scale(1.06);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.45);
}

/* Estilos para el Panel de Administración Multi-Empresa PoC */
.admin-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text);
}

.admin-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.admin-nav {
  width: 250px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 15px 10px;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  min-height: 0;
  max-height: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.3) rgba(15, 23, 42, 0.4);
}

.admin-nav::-webkit-scrollbar {
  width: 5px;
}

.admin-nav::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
}

.admin-nav::-webkit-scrollbar-thumb {
  background: rgba(0, 229, 255, 0.25);
  border-radius: 4px;
}

.admin-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.5);
}

.nav-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  padding: 12px 16px;
  border-radius: 8px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: var(--bg-card);
  border-color: var(--cyan);
  color: var(--cyan);
}

.nav-dropdown {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.nav-dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
}

.dropdown-chevron {
  font-size: 13px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
  font-weight: bold;
}

.nav-dropdown.open .dropdown-chevron {
  color: var(--cyan);
}

.nav-dropdown-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 0 4px 8px;
  border-left: 2px solid var(--border);
  margin-left: 14px;
  margin-top: 3px;
  margin-bottom: 3px;
  transition: all 0.2s ease-in-out;
}

.nav-dropdown-content.hidden {
  display: none !important;
}

.nav-subtab {
  padding: 8px 12px;
  font-size: 12.5px;
  border-radius: 6px;
}

.badge-available {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-assigned {
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-locked {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-action-danger {
  color: #ff8a80 !important;
  border-color: rgba(255, 23, 68, 0.35) !important;
}
.btn-action-danger:hover {
  background: rgba(255, 23, 68, 0.15) !important;
}

.badge-alert {
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 12px;
}

.badge-alert.hidden {
  display: none;
}

.admin-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.tab-panel {
  display: none;
}

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

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-title-aligned {
  width: min-content;
  max-width: 100%;
}

.panel-title-aligned h2 {
  white-space: nowrap;
}

.panel-title-aligned .section-desc {
  width: 100%;
  line-height: 1.4;
}

.panel-header h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--cyan);
  margin-bottom: 4px;
}

.section-desc {
  font-size: 12px;
  color: #94a3b8;
}

.header-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Botones */
.btn-primary {
  background: var(--cyan, #00e5ff) !important;
  color: #080d14 !important;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 229, 255, 0.25);
  transition: all 0.2s;
}

.btn-primary:hover {
  filter: brightness(1.15);
}

.btn-refresh {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

/* Tablas */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: #151d28;
  padding: 10px 10px;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(0, 229, 255, 0.3);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 10px;
  border-bottom: 1.5px solid rgba(71, 95, 130, 0.85);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* ========================================================
   TABLA DE FLOTA DE RADIOS CON HEADER Y COLUMNAS ESTÁTICAS (STICKY)
   ======================================================== */
#radios-table-wrapper {
  max-height: calc(100vh - 220px);
  min-height: 350px;
  overflow: auto;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 229, 255, 0.35) rgba(15, 23, 42, 0.6);
}

#table-radios-fleet {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

/* Línea divisoria más fuerte entre radios (mismo tono slate, más contrastado) */
#table-radios-fleet td {
  padding: 10px 10px;
  border-bottom: 1.5px solid rgba(71, 95, 130, 0.95);
}

/* Cabecera fija al desplazarse verticalmente (Sticky Top) */
#table-radios-fleet thead th {
  position: sticky;
  top: 0;
  z-index: 15;
  background: #151d28;
  border-bottom: 2px solid rgba(0, 229, 255, 0.5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* Columna 1 fija al desplazarse horizontalmente (ID EMPRESA) */
#table-radios-fleet .col-sticky-1 {
  position: sticky;
  left: 0;
  width: 110px;
  min-width: 110px;
  max-width: 110px;
}

/* Columna 2 fija al desplazarse horizontalmente (ID DEL RADIO) */
#table-radios-fleet .col-sticky-2 {
  position: sticky;
  left: 110px;
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  border-right: 2px solid rgba(0, 229, 255, 0.45);
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.5);
}

/* Intersección Cabecera + Columnas Fijas (Esquinas superiores con mayor prioridad visual) */
#table-radios-fleet thead th.col-sticky-1 {
  z-index: 30;
  background: #151d28;
}

#table-radios-fleet thead th.col-sticky-2 {
  z-index: 30;
  background: #151d28;
}

/* Celdas fijas en el cuerpo: background opaco para bloquear el contenido deslizante */
#table-radios-fleet tbody td.col-sticky-1 {
  z-index: 10;
  background: #1f2a3a;
}

#table-radios-fleet tbody td.col-sticky-2 {
  z-index: 10;
  background: #1f2a3a;
}

/* Efecto hover sobre la fila completa, manteniendo las celdas fijas sincronizadas */
#table-radios-fleet tbody tr:hover td {
  background-color: #28374d !important;
}

.empty-row {
  text-align: center;
  color: #64748b;
  padding: 30px !important;
}

/* Estados */
.status-pill {
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill.active { background: rgba(0, 230, 118, 0.2); color: var(--green); }
.status-pill.pending { background: rgba(255, 145, 0, 0.2); color: var(--orange); }
.status-pill.blocked { background: rgba(255, 23, 68, 0.2); color: var(--red); }

/* Modales */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 15px;
}

.hidden {
  display: none !important;
}

.modal-overlay.hidden {
  display: none !important;
  pointer-events: none !important;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 500px;
  max-width: 95vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  overflow: hidden;
  will-change: transform;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
}

.modal-header:active {
  cursor: grabbing;
}

.modal-header h3 {
  font-size: 15px;
  color: var(--cyan);
}

.btn-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
}

.modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.form-input, .form-select {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--cyan);
}

.form-input:disabled, .form-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
  color: #64748b;
}

.info-box {
  background: #111a24;
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--cyan);
}

/* Interruptores tipo Switch para Funciones de Empresa */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  vertical-align: middle;
}
.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #1e293b;
  border: 1px solid #475569;
  transition: .25s ease;
  border-radius: 24px;
}
.slider-toggle:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #94a3b8;
  transition: .25s ease;
  border-radius: 50%;
}
.switch-toggle input:checked + .slider-toggle {
  background-color: rgba(0, 229, 255, 0.25);
  border-color: #00e5ff;
}
.switch-toggle input:checked + .slider-toggle:before {
  transform: translateX(20px);
  background-color: #00e5ff;
  box-shadow: 0 0 8px #00e5ff;
}

/* ==========================================================================
   Estilos: Módulo de Información de Radio y Distribución OTA
   ========================================================================== */
.radio-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.info-card:hover {
  border-color: rgba(0, 229, 255, 0.35);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.info-card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan);
  margin: 0;
  letter-spacing: 0.3px;
}

.info-card-icon {
  font-size: 20px;
}

.info-card-body {
  flex: 1;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-muted);
  font-weight: 500;
}

.info-value {
  color: #f1f5f9;
  font-weight: 600;
  text-align: right;
}

.code-cyan {
  background: rgba(0, 229, 255, 0.1);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
}

.code-purple {
  background: rgba(167, 139, 250, 0.1);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 600;
}

.badge-wifi {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 700;
}

.battery-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.battery-bar-fill {
  height: 100%;
  transition: width 0.4s ease, background-color 0.4s ease;
}

/* ========================================================
   Estilos para Detección y Reemplazo de ICCID en Radio
   ======================================================== */
.iccid-nuevo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-bottom: 4px;
}

.iccid-nuevo-label {
  font-size: 11px;
  font-weight: 700;
  color: #00e5ff;
  letter-spacing: 0.3px;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.btn-replace-iccid {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #00e5ff, #00b0ff);
  color: #080d14;
  border: none;
  border-radius: 4px;
  width: 22px;
  height: 20px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 229, 255, 0.3);
}

.btn-replace-iccid:hover {
  background: linear-gradient(135deg, #33ebff, #29b6f6);
  transform: translateY(-1px) scale(1.08);
  box-shadow: 0 4px 10px rgba(0, 229, 255, 0.5);
}

/* Banner flotante discreto al pasar el cursor (Tooltip) */
.btn-replace-iccid::after {
  content: "reemplazo de ICCID";
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(15, 23, 42, 0.95);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.5);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  z-index: 9999;
}

.btn-replace-iccid:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.iccid-viejo-label {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
  font-weight: 500;
}

/* Ocultar flechas numéricas de incremento/decremento (steppers / spinners) */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number] {
  -moz-appearance: textfield;
}

@media (max-width: 900px) {
  .homolog-toolbar-sep {
    display: none !important;
  }
}
