:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #101622;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 54, 0.85);
  --border-subtle: rgba(70, 95, 135, 0.2);
  --border-glow: rgba(0, 230, 153, 0.4);
  --border-danger: rgba(255, 75, 75, 0.4);
  
  --accent-cyan: #00d2ff;
  --accent-emerald: #00e699;
  --accent-purple: #9d4edd;
  --accent-danger: #ff4757;
  --accent-warning: #ffa502;
  
  --text-primary: #f0f4f8;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --glow-emerald: 0 0 25px rgba(0, 230, 153, 0.25);
  --glow-cyan: 0 0 25px rgba(0, 210, 255, 0.25);
  --glow-danger: 0 0 25px rgba(255, 71, 87, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 210, 255, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(0, 230, 153, 0.04) 0%, transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Header & Navbar */
.escudo-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 36px;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #00e699, #00d2ff);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-emerald);
}

.brand-icon svg {
  width: 26px;
  height: 26px;
  fill: #061118;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(0, 230, 153, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(0, 230, 153, 0.3);
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 30px;
  background: rgba(16, 22, 34, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Layout */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Stats Overview */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 210, 255, 0.3);
  background: var(--bg-card-hover);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-emerald));
}

.stat-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--accent-emerald);
  margin-top: 4px;
}

/* Two-column layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
}

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

/* Panels */
.cyber-panel {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 28px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
  position: relative;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title svg {
  width: 20px;
  height: 20px;
  fill: var(--accent-cyan);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-full {
  grid-column: span 2;
}

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

.input-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.input-control {
  background: rgba(13, 17, 26, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: all 0.2s ease;
  width: 100%;
}

.input-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.15);
  background: rgba(16, 22, 34, 0.95);
}

.input-control::placeholder {
  color: #475569;
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-emerald), #00b87a);
  color: #051410;
  box-shadow: var(--glow-emerald);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 230, 153, 0.4);
}

.btn-cyan {
  background: linear-gradient(135deg, var(--accent-cyan), #0099cc);
  color: #031520;
  box-shadow: var(--glow-cyan);
}

.btn-cyan:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 210, 255, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-danger), #d63031);
  color: #fff;
  box-shadow: var(--glow-danger);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-muted);
}

.btn-group {
  display: flex;
  gap: 14px;
  margin-top: 20px;
}

/* Terminal & Log Viewer */
.terminal-window {
  background: #080a0f;
  border: 1px solid #1a2233;
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 18px;
}

.terminal-header {
  background: #0d121c;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1a2233;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.tdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.tdot-red { background: #ff5f56; }
.tdot-yellow { background: #ffbd2e; }
.tdot-green { background: #27c93f; }

.terminal-body {
  padding: 16px;
  max-height: 240px;
  overflow-y: auto;
  color: #a0aec0;
  line-height: 1.6;
}

.log-entry {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}

.log-time {
  color: #4a5568;
}

.log-info { color: #63b3ed; }
.log-success { color: #48bb78; }
.log-warn { color: #ecc94b; }
.log-danger { color: #f56565; }

/* Radar Scanner Animation */
.radar-container {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  position: relative;
}

.radar-sweep {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid rgba(0, 230, 153, 0.3);
  position: relative;
  background: radial-gradient(circle, rgba(0, 230, 153, 0.05) 0%, transparent 70%);
}

.radar-sweep::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(0, 230, 153, 0.35) 60deg, transparent 61deg);
  animation: radar-spin 2s linear infinite;
}

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

/* Results & Health Badge */
.results-card {
  display: none;
  background: rgba(16, 22, 34, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 22px;
}

.score-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
}

.score-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  border: 4px solid var(--accent-emerald);
  box-shadow: var(--glow-emerald);
}

.score-danger {
  border-color: var(--accent-danger);
  box-shadow: var(--glow-danger);
  color: var(--accent-danger);
}

/* Hardening 4-Layers List */
.layers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.layer-item {
  background: rgba(10, 14, 22, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.layer-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 230, 153, 0.15);
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.layer-text h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}

.layer-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* AI Report (Gemini) */
.laudo-box {
  background: #090d16;
  border: 1px solid rgba(157, 78, 221, 0.3);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 0 25px rgba(157, 78, 221, 0.1);
}

.laudo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #c77dff;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.laudo-body {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #d1d5db;
  white-space: pre-wrap;
}

/* Sites Table */
.sites-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.sites-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}

.sites-table td {
  padding: 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.site-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-clean {
  background: rgba(0, 230, 153, 0.15);
  color: var(--accent-emerald);
}

.badge-danger {
  background: rgba(255, 71, 87, 0.15);
  color: var(--accent-danger);
}

/* Copilot Floating Button & Chat Drawer */
.copilot-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), #5a189a);
  border: none;
  box-shadow: 0 0 30px rgba(157, 78, 221, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.copilot-btn:hover {
  transform: scale(1.1) rotate(5deg);
}

.copilot-btn svg {
  width: 32px;
  height: 32px;
  fill: #fff;
}

/* Dialog / Modal */
dialog {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: rgba(14, 19, 29, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  padding: 28px;
  max-width: 580px;
  width: 90%;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

/* Copilot Drawer Dialog */
#copilot-drawer {
  max-width: 480px;
  height: 82vh;
  margin-right: 28px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  max-width: 85%;
  line-height: 1.5;
}

.chat-copilot {
  background: rgba(157, 78, 221, 0.15);
  border: 1px solid rgba(157, 78, 221, 0.3);
  align-self: flex-start;
  color: #e2e8f0;
}

.chat-user {
  background: linear-gradient(135deg, #00d2ff, #0077b6);
  color: #031520;
  font-weight: 600;
  align-self: flex-end;
}
