* { box-sizing: border-box; }

.score-circle {
  width: 120px; height: 120px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: bold;
  position: relative;
  margin: 0 auto;
}
.score-good { background: conic-gradient(#10b981 var(--pct), #1f2937 0); }
.score-warning { background: conic-gradient(#f59e0b var(--pct), #1f2937 0); }
.score-critical { background: conic-gradient(#ef4444 var(--pct), #1f2937 0); }
.score-circle .inner {
  width: 90px; height: 90px; border-radius: 50%;
  background: #111827; display: flex; align-items: center;
  justify-content: center; flex-direction: column;
}
.score-circle .inner .num { font-size: 1.8rem; line-height: 1; }
.score-circle .inner .label { font-size: 0.6rem; opacity: 0.6; text-transform: uppercase; }

.severity-critical { border-left: 4px solid #ef4444; }
.severity-high { border-left: 4px solid #f97316; }
.severity-medium { border-left: 4px solid #f59e0b; }
.severity-low { border-left: 4px solid #3b82f6; }
.severity-info { border-left: 4px solid #6b7280; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 9999px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.badge-critical { background: #7f1d1d; color: #fca5a5; }
.badge-high { background: #7c2d12; color: #fdba74; }
.badge-medium { background: #78350f; color: #fcd34d; }
.badge-low { background: #1e3a5f; color: #93c5fd; }
.badge-good { background: #064e3b; color: #6ee7b7; }
.badge-info { background: #374151; color: #d1d5db; }

.fade-in { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.card { background: #1f2937; border-radius: 12px; padding: 1.25rem; margin-bottom: 1rem; border: 1px solid #374151; }
.card:hover { border-color: #4b5563; }

.btn { padding: 8px 16px; border-radius: 8px; font-weight: 500; cursor: pointer; transition: all 0.2s; border: none; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.btn-success { background: #059669; color: white; }
.btn-success:hover:not(:disabled) { background: #047857; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-warning { background: #d97706; color: white; }
.btn-warning:hover:not(:disabled) { background: #b45309; }
.btn-sm { padding: 4px 10px; font-size: 0.75rem; }

input, select {
  background: #374151; border: 1px solid #4b5563; border-radius: 8px;
  padding: 8px 12px; color: white; width: 100%; font-size: 0.9rem;
}
input:focus, select:focus { outline: none; border-color: #2563eb; }
input::placeholder { color: #6b7280; }

.client-row { display: grid; grid-template-columns: 120px 1fr 80px 80px 80px 80px; gap: 8px; align-items: center; padding: 8px; border-bottom: 1px solid #374151; font-size: 0.85rem; }
.client-row:hover { background: #1a2332; }

.log-event { padding: 4px 8px; border-radius: 4px; margin: 2px 0; font-size: 0.8rem; font-family: monospace; }

.tab { padding: 8px 16px; cursor: pointer; border-bottom: 2px solid transparent; font-size: 0.9rem; }
.tab.active { border-bottom-color: #2563eb; color: #60a5fa; }
.tab:hover { color: #93c5fd; }

.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid #374151; border-top: 3px solid #2563eb; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; bottom: 20px; right: 20px; padding: 12px 20px; border-radius: 8px;
  font-size: 0.9rem; z-index: 1000; animation: slideIn 0.3s ease;
}
.toast-success { background: #065f46; color: #6ee7b7; }
.toast-error { background: #7f1d1d; color: #fca5a5; }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.cfg-input { background: #111827 !important; border: 1px solid #4b5563 !important; border-radius: 6px !important; padding: 6px 8px !important; font-size: 0.8rem !important; }
.cfg-input:focus { border-color: #3b82f6 !important; box-shadow: 0 0 0 2px rgba(59,130,246,0.2); }
.cfg-input[readonly] { opacity: 0.6; cursor: not-allowed; }
.cfg-input[disabled] { opacity: 0.6; cursor: not-allowed; }

/* Fleet - Semaforo dots */
.fleet-dot {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-block; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid rgba(0,0,0,0.3);
}
.fleet-dot:hover {
  transform: scale(1.5);
  box-shadow: 0 0 8px currentColor;
  z-index: 10;
  position: relative;
}

/* ==================== NAVBAR ==================== */
.hamburger { display: none; }
.nav-buttons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

/* ==================== RESPONSIVE MOBILE ==================== */
@media (max-width: 768px) {
  /* Navbar: hamburger + collapsible */
  .hamburger { display: inline-flex !important; }
  .nav-buttons { display: none; flex-direction: column; width: 100%; gap: 4px; margin-top: 8px; }
  .nav-buttons.open { display: flex; }
  .nav-btn { width: 100%; text-align: left; }

  /* Page containers: less padding */
  .max-w-6xl, .max-w-7xl { padding-left: 8px; padding-right: 8px; }

  /* Client row: 2 columns */
  .client-row { grid-template-columns: 1fr 1fr; gap: 4px; font-size: 0.8rem; }

  /* Score circle smaller */
  .score-circle { width: 90px; height: 90px; }
  .score-circle .inner { width: 65px; height: 65px; }
  .score-circle .inner .num { font-size: 1.3rem; }

  /* Tables: compact */
  table { font-size: 0.7rem; }
  th, td { padding: 3px 4px !important; white-space: nowrap; }

  /* Toast: centered bottom */
  .toast { left: 10px; right: 10px; bottom: 10px; text-align: center; }

  /* Cards: compact */
  .card { padding: 0.75rem; margin-bottom: 0.5rem; }

  /* Buttons: compact */
  .btn { padding: 6px 12px; font-size: 0.8rem; }
  .btn-sm { padding: 3px 8px; font-size: 0.7rem; }

  /* Grids: force 1-2 cols */
  .grid.grid-cols-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid.grid-cols-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .md\:grid-cols-3 { grid-template-columns: repeat(2, 1fr) !important; }
  .md\:grid-cols-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .md\:grid-cols-5 { grid-template-columns: repeat(2, 1fr) !important; }

  /* Modals: full width */
  .fixed.inset-0 > div { max-width: 95vw !important; margin: 8px !important; }

  /* Inputs: slightly smaller */
  input, select { font-size: 0.85rem; padding: 6px 10px; }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .grid.grid-cols-2 { grid-template-columns: 1fr !important; }
  .md\:grid-cols-5 { grid-template-columns: 1fr !important; }
  table { font-size: 0.65rem; }
  .card { padding: 0.5rem; }
}
