/* ===== OSPrimeApp - Central de Diagnóstico & Bancada Avançada ===== */

.bench-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.bench-header h2 {
  font-size: 19px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bench-header p {
  color: #94a3b8;
  font-size: 13px;
  margin: 0;
}

/* Abas de Navegação Interna */
.bench-tabs {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.bench-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 7px;
}
.bench-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}
.bench-tab-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.15);
}

/* Toolbar da Bancada */
.bench-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(13, 25, 41, 0.8);
  border: 1px solid #1e3a5f;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.bench-tool-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bench-select, .bench-input {
  background: #091322;
  border: 1px solid #234168;
  color: #f1f5f9;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.bench-select:focus, .bench-input:focus {
  border-color: #38bdf8;
}

/* Terminal Serial UART */
.uart-terminal-container {
  background: #060b13;
  border: 1px solid #1a2d47;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.uart-terminal-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f1c2d;
  padding: 8px 14px;
  border-bottom: 1px solid #1a2d47;
  font-size: 12px;
}
.uart-terminal-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #94a3b8;
}
.uart-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
  transition: all 0.3s;
}
.uart-dot.connected {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}
.uart-dot.streaming {
  animation: pulse-uart 0.8s infinite alternate;
}
@keyframes pulse-uart {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.uart-terminal-view {
  min-height: 280px;
  max-height: 440px;
  overflow-y: auto;
  padding: 14px 16px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.5;
  color: #38bdf8;
  background: #060b13;
  white-space: pre-wrap;
  word-break: break-all;
}
.uart-terminal-view .ts { color: #64748b; font-size: 11px; margin-right: 6px; }
.uart-terminal-view .warn { color: #f59e0b; }
.uart-terminal-view .err { color: #ef4444; font-weight: bold; background: rgba(239, 68, 68, 0.1); padding: 1px 4px; border-radius: 3px; }
.uart-terminal-view .stage { color: #a855f7; font-weight: bold; }
.uart-terminal-view .ok { color: #10b981; }

/* Cartão de Resultado da Análise de Boot */
.uart-verdict-card {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 28, 48, 0.95), rgba(9, 18, 33, 0.98));
  border: 1px solid #234571;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.uart-verdict-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}
.uart-verdict-badge {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.uart-verdict-badge.approved { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid #10b981; }
.uart-verdict-badge.attention { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid #f59e0b; }
.uart-verdict-badge.rejected { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid #ef4444; }

.uart-client-box {
  background: rgba(56, 189, 248, 0.08);
  border-left: 4px solid #38bdf8;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #e0f2fe;
}
.uart-client-box b {
  display: block;
  color: #38bdf8;
  font-size: 12px;
  margin-bottom: 4px;
}

/* ==========================================================================
   MÓDULO: REMOVEDOR DE VÍRUS ANDROID
   ========================================================================== */
.av-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: center;
  background: linear-gradient(145deg, #091813, #050d0a);
  border: 1px solid #164e3f;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
}
@media (max-width: 768px) {
  .av-hero { grid-template-columns: 1fr; }
}
.av-gauge-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.av-gauge {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #051610 60%, transparent 61%), conic-gradient(#10b981 0%, #10b981 100%);
  border: 3px solid #10b981;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.25);
  transition: all 0.5s ease;
}
.av-gauge.warning {
  border-color: #f59e0b;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.3);
}
.av-gauge.danger {
  border-color: #ef4444;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}
.av-gauge-score {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
}
.av-gauge-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  margin-top: 4px;
}

.av-threat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 8px;
  gap: 12px;
}
.av-threat-item.danger {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
}
.av-threat-item.warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
}

@media (max-width: 640px) {
  .av-hero-action-panel {
    padding: 14px !important;
  }
  .av-threat-item {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }
  .av-threat-item > div:last-child {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 6px;
  }
  .av-scenario-card {
    padding: 10px 12px !important;
  }
}

/* ==========================================================================
   MÓDULO: CENTRAL DE TESTE ANDROID (BANCADA)
   ========================================================================== */
.bench-grid-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.bench-stat-card {
  background: rgba(13, 25, 41, 0.7);
  border: 1px solid #1e3a5f;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bench-stat-card span {
  font-size: 11px;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
}
.bench-stat-card b {
  font-size: 18px;
  color: #f8fafc;
}

.bench-checklist-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.bench-check-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #0b1524;
  border: 1px solid #1a304d;
  border-radius: 10px;
  gap: 10px;
}
.bench-check-card .btn-group {
  display: flex;
  gap: 4px;
}
.bench-btn-state {
  border: 1px solid #234168;
  background: #060e1a;
  color: #94a3b8;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.bench-btn-state.active-ok {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}
.bench-btn-state.active-fail {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}
.bench-btn-state.active-na {
  background: #475569;
  color: #fff;
  border-color: #475569;
}

/* Modais Especiais de Teste Interativo */
.touch-grid-modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(12, 1fr);
  gap: 2px;
  padding: 8px;
  user-select: none;
  touch-action: none;
}
.touch-cell {
  background: #1e293b;
  border-radius: 3px;
  transition: background 0.05s;
}
.touch-cell.touched {
  background: #10b981 !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}
.touch-exit-btn {
  position: fixed;
  top: 12px;
  right: 12px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: bold;
  z-index: 100000;
  cursor: pointer;
}

.color-test-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.color-test-hint {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
}

/* ==========================================================================
   MÓDULO: CENTRAL DE DIAGNÓSTICO GUIADO & BASE DE FALHAS
   ========================================================================== */
.diag-tree-step {
  padding: 16px 20px;
  background: rgba(13, 25, 41, 0.85);
  border: 1px solid #234571;
  border-radius: 14px;
  margin-bottom: 14px;
}
.diag-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.diag-option-btn {
  background: #081424;
  border: 1px solid #1d395d;
  border-radius: 10px;
  padding: 12px 14px;
  color: #e2e8f0;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.diag-option-btn:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.faults-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.fault-card {
  background: #091424;
  border: 1px solid #1a304e;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.fault-card:hover {
  border-color: #2b5182;
}
.fault-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.fault-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   MÓDULO: CENTRAL TÉCNICA (DOWNLOADS & GUIAS)
   ========================================================================== */
.tech-downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.tech-dl-card {
  background: linear-gradient(145deg, #0d1b2d, #08111e);
  border: 1px solid #1e395b;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.tech-dl-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.tech-dl-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  flex-shrink: 0;
}
.tech-dl-info b {
  font-size: 15px;
  color: #f8fafc;
  display: block;
}
.tech-dl-info span {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
  display: block;
  margin-top: 2px;
}
