:root {
  --brand-primary: #FF002B;
  --brand-secondary: #BBD4EC;
  --brand-accent: #FFEA52;
  --ink: #060E16;
  --ink-soft: #3a4a5a;
  --bg-gradient: linear-gradient(135deg, #FFFFFF 0%, #BBD4EC 100%);
  --red-gradient: linear-gradient(52deg, #FF002B 0%, #FFC3C0 100%);
  --radius: 10px;
  --radius-pill: 999px;
  --font: 'Graphik', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg-gradient);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── NAV ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 1px solid rgba(187,212,236,0.5);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  box-shadow: 0 2px 12px rgba(6,14,22,0.07);
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  padding: 6px 10px;
  border-radius: 8px;
}
.nav-logo img { height: 36px; object-fit: contain; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links button {
  background: none; border: none; cursor: pointer;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  color: var(--ink-soft);
  padding: 8px 16px; border-radius: var(--radius-pill);
  transition: background 0.18s, color 0.18s;
}
.nav-links button:hover { background: rgba(255,0,43,0.07); color: var(--brand-primary); }
.nav-links button.active { background: var(--brand-primary); color: #fff; }

.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-accent); color: var(--ink);
  font-size: 11px; font-weight: 600;
  width: 18px; height: 18px; border-radius: 50%;
  margin-left: 4px; vertical-align: middle;
}

/* ── SECTIONS ── */
section { display: none; }
section.active { display: block; }

.page-wrap { max-width: 1100px; margin: 0 auto; padding: 48px 24px; }

/* ── HERO ── */
.hero {
  background: var(--red-gradient);
  color: #fff;
  padding: 80px 32px 64px;
  text-align: left;
}
.hero-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero p { font-size: 17px; opacity: 0.9; margin-bottom: 32px; max-width: 480px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-primary {
  background: #fff; color: var(--brand-primary);
  border: none; border-radius: var(--radius-pill);
  padding: 13px 28px; font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }

.btn-secondary {
  background: rgba(255,255,255,0.15); color: #fff;
  border: 1.5px solid rgba(255,255,255,0.5); border-radius: var(--radius-pill);
  padding: 13px 28px; font-family: var(--font); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.25); }

/* Hero visual */
.hero-visual { display: flex; align-items: center; justify-content: center; }
.hero-diagram { width: 340px; height: 280px; position: relative; }
.hd-ring { position: absolute; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); }
.hd-ring-1 { width: 280px; height: 280px; top: 0; left: 30px; }
.hd-ring-2 { width: 180px; height: 180px; top: 50px; left: 80px; border-color: rgba(255,234,82,0.5); }
.hd-center {
  position: absolute; top: 90px; left: 120px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff; text-align: center; line-height: 1.3;
}
.hd-node {
  position: absolute; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: 1.5px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: #fff; font-weight: 600; text-align: center; line-height: 1.2;
}
.hd-node-1 { top: 8px; left: 145px; }
.hd-node-2 { top: 100px; left: 10px; }
.hd-node-3 { top: 100px; left: 280px; }
.hd-node-4 { top: 210px; left: 80px; }
.hd-node-5 { top: 210px; left: 210px; }

/* ── SKELETON LOADING ── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton-card {
  height: 200px; border-radius: var(--radius);
  background: linear-gradient(90deg, #f0f4f8 25%, #e2eaf2 50%, #f0f4f8 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-line {
  height: 18px; border-radius: 4px; margin-bottom: 10px;
  background: linear-gradient(90deg, #f0f4f8 25%, #e2eaf2 50%, #f0f4f8 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
}

/* ── CARDS ── */
.section-title {
  font-size: 28px; font-weight: 600;
  background: var(--red-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 8px;
}
.section-sub { color: var(--ink-soft); margin-bottom: 36px; font-size: 15px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid rgba(187,212,236,0.6);
  padding: 24px;
  transition: box-shadow 0.18s, transform 0.18s;
}
.card:hover { box-shadow: 0 8px 28px rgba(6,14,22,0.1); transform: translateY(-2px); }
.card-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--red-gradient);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; color: #fff;
}
.card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.card p { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }

/* ── COMPLIANCE PAGE ── */
.compliance-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.policy-list { background: #fff; border-radius: var(--radius); border: 1px solid rgba(187,212,236,0.6); overflow: hidden; }
.policy-item {
  padding: 14px 18px; cursor: pointer; border-bottom: 1px solid rgba(187,212,236,0.3);
  display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500;
  transition: background 0.15s;
}
.policy-item:last-child { border-bottom: none; }
.policy-item:hover { background: rgba(255,0,43,0.04); }
.policy-item.selected { background: rgba(255,0,43,0.08); color: var(--brand-primary); }
.policy-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-pass { background: #22c55e; }
.dot-warn { background: var(--brand-accent); }
.dot-fail { background: var(--brand-primary); }

.scan-panel { background: #fff; border-radius: var(--radius); border: 1px solid rgba(187,212,236,0.6); padding: 28px; }
.scan-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.scan-title { font-size: 18px; font-weight: 600; }
.btn-scan {
  background: var(--brand-primary); color: #fff;
  border: none; border-radius: var(--radius-pill);
  padding: 10px 22px; font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: opacity 0.15s;
}
.btn-scan:hover { opacity: 0.88; }

.upload-zone {
  border: 2px dashed rgba(187,212,236,0.8); border-radius: var(--radius);
  padding: 36px; text-align: center; margin-bottom: 24px; cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
}
.upload-zone:hover { border-color: var(--brand-primary); background: rgba(255,0,43,0.02); }
.upload-zone p { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }

.result-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid rgba(187,212,236,0.3);
}
.result-row:last-child { border-bottom: none; }
.result-badge {
  padding: 3px 10px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.badge-pass { background: #dcfce7; color: #15803d; }
.badge-warn { background: #fef9c3; color: #854d0e; }
.badge-fail { background: #fee2e2; color: #991b1b; }
.result-text { flex: 1; font-size: 13px; }
.result-detail { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

/* ── ASSETS PAGE ── */
.filter-bar { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.filter-btn {
  padding: 7px 16px; border-radius: var(--radius-pill); border: 1.5px solid rgba(187,212,236,0.7);
  background: #fff; font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover, .filter-btn.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.asset-card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid rgba(187,212,236,0.6);
  overflow: hidden; cursor: pointer;
  transition: box-shadow 0.18s, transform 0.18s;
}
.asset-card:hover { box-shadow: 0 8px 28px rgba(6,14,22,0.1); transform: translateY(-2px); }
.asset-thumb {
  height: 140px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
}
.asset-info { padding: 14px 16px; }
.asset-info h4 { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.asset-meta { display: flex; justify-content: space-between; align-items: center; }
.asset-type { font-size: 11px; color: var(--ink-soft); }
.asset-status { padding: 2px 8px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 600; }

/* ── SETTINGS PAGE ── */
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.settings-nav { background: #fff; border-radius: var(--radius); border: 1px solid rgba(187,212,236,0.6); overflow: hidden; }
.settings-nav-item {
  padding: 13px 18px; cursor: pointer; border-bottom: 1px solid rgba(187,212,236,0.2);
  font-size: 14px; font-weight: 500; transition: background 0.15s; display: flex; align-items: center; gap: 10px;
}
.settings-nav-item:last-child { border-bottom: none; }
.settings-nav-item:hover { background: rgba(255,0,43,0.04); }
.settings-nav-item.active { background: rgba(255,0,43,0.08); color: var(--brand-primary); }

.settings-panel { background: #fff; border-radius: var(--radius); border: 1px solid rgba(187,212,236,0.6); padding: 28px; }
.settings-section { margin-bottom: 32px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid rgba(187,212,236,0.3); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
.form-group input, .form-group select, .form-group textarea {
  padding: 10px 14px; border-radius: var(--radius); border: 1.5px solid rgba(187,212,236,0.7);
  font-family: var(--font); font-size: 14px; color: var(--ink);
  background: #fff; transition: border-color 0.15s;
  outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--brand-primary);
}
.form-group textarea { resize: vertical; min-height: 80px; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid rgba(187,212,236,0.2);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-info h4 { font-size: 14px; font-weight: 500; }
.toggle-info p { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.toggle {
  width: 44px; height: 24px; border-radius: 12px; background: rgba(187,212,236,0.5);
  position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0;
  border: none;
}
.toggle.on { background: var(--brand-primary); }
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: transform 0.2s; box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle.on::after { transform: translateX(20px); }

.btn-save {
  background: var(--brand-primary); color: #fff;
  border: none; border-radius: var(--radius-pill);
  padding: 12px 28px; font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.btn-save:hover { opacity: 0.88; }

/* ── PROGRESS BARS ── */
.progress-track { height: 8px; background: rgba(187,212,236,0.4); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.progress-fill { height: 100%; border-radius: 4px; background: var(--red-gradient); transition: width 0.6s ease; }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(6,14,22,0.5); align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 14px; padding: 32px;
  max-width: 520px; width: 90%; box-shadow: 0 24px 64px rgba(6,14,22,0.2);
}
.modal h2 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.modal p { color: var(--ink-soft); font-size: 14px; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }
.btn-outline {
  background: none; color: var(--brand-primary); border: 1.5px solid var(--brand-primary);
  border-radius: var(--radius-pill); padding: 10px 22px; font-family: var(--font); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
}
.btn-outline:hover { background: rgba(255,0,43,0.06); }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 300;
  background: var(--ink); color: #fff;
  padding: 14px 22px; border-radius: var(--radius); font-size: 14px;
  box-shadow: 0 8px 24px rgba(6,14,22,0.25);
  transform: translateY(80px); opacity: 0; transition: all 0.3s;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-accent { width: 4px; height: 100%; position: absolute; left: 0; top: 0; background: var(--brand-primary); border-radius: 4px 0 0 4px; }

/* ── SCANNING ANIMATION ── */
.scanning { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── ACTIVITY FEED ── */
.activity-feed { display: flex; flex-direction: column; gap: 0; }
.activity-item {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid rgba(187,212,236,0.25);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot-col { display: flex; flex-direction: column; align-items: center; }
.activity-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.activity-line { flex: 1; width: 1px; background: rgba(187,212,236,0.4); margin-top: 4px; }
.activity-body { flex: 1; }
.activity-body strong { font-size: 13px; font-weight: 600; }
.activity-body p { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.activity-time { font-size: 11px; color: var(--ink-soft); white-space: nowrap; margin-top: 5px; }

/* ── HOME FEATURES ── */
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 48px; }
.home-panel { background: #fff; border-radius: var(--radius); border: 1px solid rgba(187,212,236,0.6); padding: 28px; }
.home-panel h2 { font-size: 18px; font-weight: 600; margin-bottom: 20px; }

.score-ring-wrap { display: flex; align-items: center; gap: 24px; margin-bottom: 20px; }
.score-ring {
  width: 100px; height: 100px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--brand-primary) 0% 84%, rgba(187,212,236,0.3) 84% 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.score-ring-inner {
  width: 74px; height: 74px; border-radius: 50%; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-num { font-size: 22px; font-weight: 600; color: var(--brand-primary); line-height: 1; }
.score-label { font-size: 10px; color: var(--ink-soft); }
.score-details { flex: 1; }
.score-details p { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.metric-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.metric-label { color: var(--ink-soft); }
.metric-val { font-weight: 600; }

/* ── QUICK ACTIONS ── */
.quick-action-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border: 1.5px solid rgba(187,212,236,0.6);
  border-radius: 10px; background: #fff; cursor: pointer; text-align: left;
  transition: border-color 0.15s; font-family: var(--font); width: 100%;
}
.quick-action-btn:hover { border-color: var(--brand-primary); }
.qa-icon {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--red-gradient);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.qa-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.qa-sub { font-size: 12px; color: var(--ink-soft); }

/* ── FOOTER ── */
footer {
  background: var(--ink); color: var(--brand-secondary);
  padding: 40px 32px; margin-top: 60px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer-logo { background: #fff; padding: 8px 12px; border-radius: 8px; }
.footer-logo img { height: 28px; }
.footer-text { font-size: 12px; opacity: 0.6; }

/* ── ERROR STATE ── */
.error-state {
  text-align: center; padding: 40px; color: var(--ink-soft);
}
.error-state h3 { color: var(--brand-primary); margin-bottom: 8px; }

@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .compliance-layout, .settings-layout, .home-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  nav { padding: 0 16px; }
  .nav-links button { padding: 7px 10px; font-size: 12px; }
}

/* A note under a setting that is saved but not yet acted on, or that is passed to the AI check. */
.rule-note { font-size: 11.5px; color: #8a5a00; margin-top: 3px; }
