:root {
  --bg-dark: #080c14;
  --bg-card: #0f172a;
  --border-color: #1e293b;
  --accent-cyan: #06b6d4;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
}

.top-nav {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-group { display: flex; align-items: center; gap: 0.75rem; }
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-main);
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.badge-audit {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.35);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  letter-spacing: 0.05em;
}
.nav-controls { display: flex; align-items: center; gap: 1rem; }
.lang-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.lang-btn.active {
  background: rgba(6, 182, 212, 0.25);
  color: #38bdf8;
}
.nav-link-home {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}
.nav-link-home:hover { color: var(--accent-cyan); }

/* Main */
.main-container {
  max-width: 1050px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.hero-section { text-align: center; margin-bottom: 2.5rem; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
}
.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
  line-height: 1.25;
}
.hero-desc {
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Calc Card */
.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.editor-title { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.editor-actions { display: flex; gap: 0.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-sample, .btn-clear {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.code-textarea {
  width: 100%;
  background: #090e1a;
  border: 1px solid var(--border-color);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 1rem;
  border-radius: 10px;
  outline: none;
  line-height: 1.5;
  resize: vertical;
}
.action-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.btn-scan {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, #0284c7 100%);
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
}
.btn-secondary {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
}

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.m-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.m-lbl { font-size: 0.75rem; color: var(--text-muted); }
.m-val { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700; }
.text-danger { color: var(--accent-red); }
.text-green { color: var(--accent-green); }

/* Table */
.results-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
}
.section-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem; }
.table-wrapper { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}
.data-table th {
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  text-transform: uppercase;
}
.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.empty-state { text-align: center; color: var(--text-muted); padding: 2rem 1rem !important; }
.risk-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
