/* =============================================================
   GRC Shield — Mobile-First CSS
   Design System Profissional
   ============================================================= */

/* ─── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #2563EB;
  --blue-light: #DBEAFE;
  --green: #059669;
  --green-light: #D1FAE5;
  --red: #DC2626;
  --red-light: #FEE2E2;
  --orange: #D97706;
  --orange-light: #FEF3C7;
  --purple: #7C3AED;
  --purple-light: #EDE9FE;
  --cyan: #0891B2;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --white: #FFFFFF;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --header-h: 60px;
  --bottom-h: 64px;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: #F0F4F8;
  color: var(--gray-800);
  overflow-x: hidden;
  line-height: 1.5;
}
body.no-scroll { overflow: hidden; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
img { max-width: 100%; }
.hidden { display: none !important; }

/* ─── SPLASH SCREEN ──────────────────────────────────────── */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0C1A2E 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease;
}
.splash.fade-out { opacity: 0; pointer-events: none; }
.splash-content { text-align: center; color: white; }

.splash-logo { margin-bottom: 48px; }
.shield-icon {
  width: 90px; height: 90px; border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 40px rgba(37,99,235,0.5);
  animation: pulse-glow 2s infinite;
}
.shield-icon i { font-size: 42px; color: white; }
.splash-logo h1 {
  font-size: 32px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #60A5FA, #A78BFA);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.splash-logo p { font-size: 13px; color: #94A3B8; letter-spacing: 2px; text-transform: uppercase; margin-top: 6px; }

.splash-loader { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.loader-bar {
  width: 200px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden;
}
.loader-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, #2563EB, #7C3AED);
  animation: loading 1.8s ease forwards;
}
.splash-loader span { font-size: 12px; color: #64748B; }

@keyframes loading { to { width: 100%; } }
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 40px rgba(37,99,235,0.5); }
  50% { box-shadow: 0 0 60px rgba(124,58,237,0.7); }
}

/* ─── APP WRAPPER ────────────────────────────────────────── */
.app-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.app-wrapper.fade-in { animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ─── HEADER ─────────────────────────────────────────────── */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: white;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  box-shadow: var(--shadow-sm);
}
.header-left, .header-right { display: flex; align-items: center; gap: 10px; }
.menu-btn, .notif-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-600); font-size: 17px;
  background: var(--gray-100);
  transition: var(--transition);
}
.menu-btn:hover, .notif-btn:hover { background: var(--gray-200); }

.header-brand { display: flex; align-items: center; gap: 8px; }
.header-brand i { color: var(--blue); font-size: 20px; }
.header-brand span { font-weight: 700; font-size: 17px; color: var(--gray-900); letter-spacing: -0.3px; }

.nist-badge {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: white; padding: 4px 12px; border-radius: 20px;
  display: flex; flex-direction: column; align-items: center; line-height: 1.2;
}
.badge-label { font-size: 9px; font-weight: 600; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-score { font-size: 15px; font-weight: 800; }

.notif-btn { position: relative; }
.notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2px solid white;
}

/* ─── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
  width: 280px; background: white;
  box-shadow: var(--shadow-lg);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 199;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  padding-top: max(20px, env(safe-area-inset-top));
}
.company-info { display: flex; align-items: center; gap: 12px; }
.company-avatar {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
}
.company-name { font-weight: 700; font-size: 14px; color: var(--gray-900); }
.company-sector { font-size: 12px; color: var(--gray-500); }
.sidebar-close {
  width: 32px; height: 32px; border-radius: 8px; background: var(--gray-100);
  display: flex; align-items: center; justify-content: center; color: var(--gray-500);
}

.sidebar-nav { flex: 1; padding: 12px 8px; }
.nav-section-title {
  font-size: 10px; font-weight: 700; color: var(--gray-400);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 12px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--gray-600);
  transition: var(--transition); margin-bottom: 2px;
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item span:not(.nav-badge) { flex: 1; }
.nav-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.nav-item:hover:not(.active) { background: var(--gray-100); }
.nav-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
}
.nav-badge.green { background: var(--green-light); color: var(--green); }
.nav-badge.orange { background: var(--orange-light); color: var(--orange); }

.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--gray-100); }
.version-info { font-size: 11px; color: var(--gray-400); }

/* ─── MAIN CONTENT ───────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-top: var(--header-h);
  margin-bottom: var(--bottom-h);
  padding: 16px;
  max-width: 600px;
  margin-left: auto; margin-right: auto;
  width: 100%;
}
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.25s ease; }

/* ─── PAGE HEADER ────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.page-title { font-size: 22px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.5px; }
.page-subtitle { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

/* ─── CARDS ──────────────────────────────────────────────── */
.card {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 14px; overflow: hidden;
  border: 1px solid var(--gray-100);
}
.card.no-pad { padding: 0; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--gray-50);
}
.card-title { font-size: 13px; font-weight: 700; color: var(--gray-700); display: flex; align-items: center; gap: 6px; }
.card-title i { font-size: 13px; color: var(--blue); }
.card-tag { font-size: 10px; font-weight: 600; color: var(--gray-400); background: var(--gray-100); padding: 2px 8px; border-radius: 20px; }
.card-link { font-size: 12px; font-weight: 600; color: var(--blue); }
.card-body { padding: 16px; }

/* ─── NIST INDEX CARD ────────────────────────────────────── */
.nist-index-card {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-lg);
  color: white;
}
.nist-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.nist-card-label { font-size: 11px; font-weight: 600; color: #64748B; text-transform: uppercase; letter-spacing: 1px; }
.nist-card-title { font-size: 16px; font-weight: 700; color: white; margin-top: 2px; }
.nist-level-badge { background: rgba(255,255,255,0.15); color: white; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }

.nist-scores-row { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.score-col { flex: 1; text-align: center; }
.score-col.current .score-number { color: #60A5FA; }
.score-col.projected .score-number { color: #34D399; }
.score-col.target .score-number { color: #A78BFA; }
.score-number { font-size: 26px; font-weight: 900; line-height: 1; }
.score-label { font-size: 10px; color: #94A3B8; margin-top: 3px; font-weight: 500; }
.score-arrow { color: #475569; font-size: 14px; flex-shrink: 0; }

.progress-track { margin-bottom: 12px; }
.progress-bar-wrapper {
  height: 8px; background: rgba(255,255,255,0.1); border-radius: 8px; overflow: hidden;
  position: relative; margin-bottom: 6px;
}
.progress-fill {
  height: 100%; border-radius: 8px; position: absolute; top: 0; left: 0;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.current-fill { background: #3B82F6; z-index: 2; }
.projected-fill { background: rgba(52,211,153,0.4); z-index: 1; }
.progress-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: #64748B;
}

.nist-gain-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; padding: 10px 12px;
  background: rgba(255,255,255,0.07);
  border-radius: 10px;
}
.nist-gain-row i { font-size: 13px; }

/* ─── STATS ROW ──────────────────────────────────────────── */
.stats-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 14px;
}
.stat-card {
  background: white; border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100);
  display: flex; align-items: center; gap: 12px;
}
.stat-icon {
  width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.stat-icon.red { background: var(--red-light); color: var(--red); }
.stat-icon.orange { background: var(--orange-light); color: var(--orange); }
.stat-icon.blue { background: var(--blue-light); color: var(--blue); }
.stat-icon.green { background: var(--green-light); color: var(--green); }
.stat-value { font-size: 22px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* ─── NIST FUNCTIONS LEGEND ──────────────────────────────── */
.nist-functions-legend {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 16px 14px;
}
.fn-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--gray-600);
}
.fn-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.fn-dot.gv { background: #7C3AED; }
.fn-dot.id { background: #2563EB; }
.fn-dot.pr { background: #059669; }
.fn-dot.de { background: #D97706; }
.fn-dot.rs { background: #DC2626; }
.fn-dot.rc { background: #0891B2; }

/* ─── PARETO ─────────────────────────────────────────────── */
.pareto-insight {
  font-size: 12px; color: var(--gray-500); padding: 8px 16px 14px;
  text-align: center; line-height: 1.5;
}
.pareto-summary-card {
  background: linear-gradient(135deg, #FEF3C7, #FFFBEB);
  border: 1px solid #FDE68A;
  border-radius: var(--radius); padding: 16px;
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 14px;
}
.pareto-icon { font-size: 24px; color: var(--orange); flex-shrink: 0; padding-top: 2px; }
.pareto-title { font-size: 13px; font-weight: 700; color: var(--gray-800); }
.pareto-desc { font-size: 12px; color: var(--gray-600); margin-top: 4px; line-height: 1.5; }

/* ─── IMPACT SIMULATOR ───────────────────────────────────── */
.impact-sim { padding: 16px; }
.sim-score-row { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 16px; }
.sim-score-block { text-align: center; }
.sim-score-val { font-size: 28px; font-weight: 900; }
.sim-score-block.current .sim-score-val { color: var(--blue); }
.sim-score-block.projected .sim-score-val { color: var(--green); }
.sim-score-label { font-size: 11px; color: var(--gray-500); font-weight: 500; }
.sim-arrow { color: var(--gray-400); font-size: 18px; }
.sim-progress-bar {
  height: 8px; background: var(--gray-100); border-radius: 8px; overflow: hidden;
  position: relative; margin-bottom: 12px;
}
.sim-fill { height: 100%; position: absolute; top: 0; left: 0; border-radius: 8px; transition: width 0.6s ease; }
.sim-fill.current-fill { background: var(--blue); z-index: 2; }
.sim-fill.projected-fill { background: rgba(5,150,105,0.35); z-index: 1; }
.sim-hint { font-size: 11px; color: var(--gray-400); display: flex; align-items: center; gap: 6px; }

/* ─── ASSESSMENT ─────────────────────────────────────────── */
.framework-tabs {
  display: flex; overflow-x: auto; gap: 0;
  border-bottom: 1px solid var(--gray-200);
}
.framework-tabs::-webkit-scrollbar { display: none; }
.fw-tab {
  padding: 12px 18px; font-size: 13px; font-weight: 600;
  color: var(--gray-500); white-space: nowrap; flex-shrink: 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.fw-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.assess-progress-bar {
  height: 3px; background: var(--gray-200); border-radius: 2px;
  overflow: hidden; margin-bottom: 12px;
}
.assess-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--blue), var(--purple));
  transition: width 0.5s ease; border-radius: 2px;
}

.assessment-progress-mini {
  background: var(--blue-light); color: var(--blue);
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
}

.category-scroll {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 10px; margin-bottom: 4px;
}
.category-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
  background: white; border: 1.5px solid var(--gray-200); color: var(--gray-600);
  white-space: nowrap; flex-shrink: 0; transition: var(--transition);
}
.cat-chip.active { background: var(--blue); border-color: var(--blue); color: white; }
.cat-chip:hover:not(.active) { border-color: var(--blue); color: var(--blue); }

.assess-fn-section { margin-bottom: 12px; }
.assess-fn-header {
  background: white; border-radius: var(--radius); padding: 14px;
  margin-bottom: 8px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  display: flex; align-items: flex-start; gap: 12px;
}
.assess-fn-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.assess-fn-name { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.assess-fn-desc { font-size: 11px; color: var(--gray-500); margin-top: 3px; line-height: 1.4; }
.assess-category { margin-bottom: 10px; padding-left: 8px; }
.assess-cat-title {
  font-size: 11px; font-weight: 700; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 6px 0; margin-bottom: 6px;
}

.control-card {
  background: white; border-radius: var(--radius); padding: 14px;
  margin-bottom: 8px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  transition: var(--transition);
}
.control-card:hover { box-shadow: var(--shadow); }
.ctrl-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 8px; }
.ctrl-id { font-size: 11px; font-weight: 800; letter-spacing: 0.3px; }
.ctrl-score-badge {
  min-width: 28px; height: 28px; border-radius: 8px;
  background: var(--gray-100); color: var(--gray-400);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; transition: var(--transition);
}
.ctrl-score-badge.filled { color: white; }
.ctrl-name { font-size: 13px; font-weight: 600; color: var(--gray-800); margin-bottom: 4px; }
.ctrl-desc { font-size: 11px; color: var(--gray-500); line-height: 1.5; margin-bottom: 8px; }
.ctrl-mapping { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.mapping-tag { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px; }
.cis-tag { background: #FEE2E2; color: #DC2626; }
.iso-tag { background: #D1FAE5; color: #059669; }
.ig-tag { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }

.maturity-selector { border-top: 1px solid var(--gray-100); padding-top: 10px; }
.mat-label { font-size: 11px; color: var(--gray-500); font-weight: 500; display: block; margin-bottom: 8px; }
.mat-buttons { display: flex; gap: 6px; }
.mat-btn {
  flex: 1; height: 34px; border-radius: 8px; font-size: 13px; font-weight: 700;
  background: var(--gray-100); color: var(--gray-500); transition: var(--transition);
  border: 2px solid transparent;
}
.mat-btn:hover { background: var(--gray-200); }
.mat-btn.active {
  background: var(--blue); color: white; border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.mat-desc { font-size: 10px; color: var(--gray-400); margin-top: 8px; line-height: 1.4; }

.calc-btn-wrapper { padding: 8px 0 16px; }

/* ─── RECOMMENDATIONS ────────────────────────────────────── */
.filter-btn-group { display: flex; gap: 4px; flex-shrink: 0; }
.filter-btn {
  padding: 5px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
  background: var(--gray-100); color: var(--gray-600);
  transition: var(--transition); border: 1.5px solid transparent;
}
.filter-btn.active { background: var(--blue-light); color: var(--blue); border-color: var(--blue); }

.rec-section-title {
  font-size: 11px; font-weight: 700; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 1px;
  padding: 8px 4px; display: flex; align-items: center; gap: 6px;
}
.rec-section-title.pareto-title-label { color: var(--orange); }
.rec-section-title i { font-size: 12px; }

.rec-card {
  background: white; border-radius: var(--radius); padding: 16px;
  margin-bottom: 10px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100); border-left: 4px solid var(--gray-300);
  transition: var(--transition);
}
.rec-card.pareto-highlight { border-left-color: var(--orange); }
.rec-card.critical { border-left-color: var(--red); }
.rec-card.high { border-left-color: var(--orange); }
.rec-card.medium { border-left-color: var(--blue); }
.rec-card.implemented { opacity: 0.7; background: var(--gray-50); }

.rec-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rec-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.rec-id { font-size: 10px; font-weight: 700; color: var(--gray-500); background: var(--gray-100); padding: 2px 7px; border-radius: 20px; }
.rec-priority {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  display: flex; align-items: center; gap: 4px;
}
.rec-priority.critical { background: var(--red-light); color: var(--red); }
.rec-priority.high { background: var(--orange-light); color: var(--orange); }
.rec-priority.medium { background: var(--blue-light); color: var(--blue); }
.pareto-badge {
  font-size: 10px; font-weight: 700; background: #FEF3C7; color: var(--orange);
  padding: 2px 8px; border-radius: 20px; display: flex; align-items: center; gap: 3px;
}

.rec-control-ref { font-size: 11px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.rec-name { font-size: 13px; font-weight: 700; color: var(--gray-800); margin-bottom: 12px; }

.rec-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px;
}
.rec-metric { text-align: center; background: var(--gray-50); border-radius: 8px; padding: 8px 4px; }
.rm-value { font-size: 14px; font-weight: 800; }
.rm-value.impact { color: var(--blue); }
.rm-value.effort { color: var(--orange); }
.rm-value.roi { color: var(--green); }
.rm-value.weeks { color: var(--purple); }
.rm-label { font-size: 10px; color: var(--gray-400); margin-top: 2px; }

.rec-score-progress {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.score-from, .score-to { font-size: 11px; font-weight: 600; color: var(--gray-500); white-space: nowrap; }
.score-progress-bar { flex: 1; height: 6px; background: var(--gray-100); border-radius: 6px; position: relative; overflow: hidden; }
.spb-current { position: absolute; top: 0; left: 0; height: 100%; background: var(--red); border-radius: 6px; }
.spb-target { position: absolute; top: 0; left: 0; height: 100%; background: var(--green); border-radius: 6px; opacity: 0.4; }

.rec-actions-toggle {
  font-size: 11px; color: var(--blue); cursor: pointer;
  display: flex; align-items: center; gap: 6px; padding: 4px 0;
}
.rec-actions-toggle i { font-size: 10px; }
.rec-actions-items { margin-top: 8px; }
.action-item {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: var(--gray-600); padding: 5px 0;
  border-bottom: 1px solid var(--gray-50);
}
.action-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue-light); color: var(--blue);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rec-mapping { font-size: 10px; color: var(--gray-400); margin-top: 6px; display: flex; align-items: center; gap: 5px; }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--gray-300);
  border-radius: 24px; transition: var(--transition); cursor: pointer;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: var(--transition);
}
input:checked + .toggle-slider { background: var(--green); }
input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ─── ROADMAP ─────────────────────────────────────────────── */
.phases-container { margin-bottom: 14px; }
.phase-card {
  background: white; border-radius: var(--radius); padding: 16px;
  margin-bottom: 10px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}
.phase-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.phase-name { font-size: 14px; font-weight: 700; }
.phase-subtitle { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.phase-score-badge { padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 800; color: white; }
.phase-items { margin-bottom: 12px; }
.phase-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--gray-600); padding: 4px 0;
}
.phase-item.done { text-decoration: line-through; opacity: 0.6; }
.phase-progress { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--gray-500); }

.timeline { padding: 8px 0; }
.timeline-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-50);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-item.done { opacity: 0.6; }
.tl-marker {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: white; margin-top: 2px;
}
.tl-id { font-size: 11px; font-weight: 700; color: var(--gray-500); }
.tl-name { font-size: 13px; font-weight: 600; color: var(--gray-800); margin: 2px 0; }
.tl-meta { display: flex; gap: 12px; }
.tl-weeks, .tl-impact { font-size: 11px; color: var(--gray-400); display: flex; align-items: center; gap: 4px; }
.tl-impact { color: var(--green); }

/* ─── FRAMEWORK PAGES ────────────────────────────────────── */
.framework-badge {
  padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 800; flex-shrink: 0;
}
.framework-badge.nist { background: #DBEAFE; color: #1D4ED8; }
.framework-badge.cis { background: #FEE2E2; color: #B91C1C; }
.framework-badge.iso { background: #D1FAE5; color: #065F46; }

.framework-overview-card {
  border-radius: var(--radius); padding: 18px;
  margin-bottom: 14px; display: flex; gap: 14px; align-items: flex-start;
}
.framework-overview-card.nist-card { background: linear-gradient(135deg, #EFF6FF, #DBEAFE); border: 1px solid #BFDBFE; }
.framework-overview-card.cis-card { background: linear-gradient(135deg, #FFF5F5, #FEE2E2); border: 1px solid #FCA5A5; }
.framework-overview-card.iso-card { background: linear-gradient(135deg, #ECFDF5, #D1FAE5); border: 1px solid #6EE7B7; }
.fw-overview-icon { font-size: 28px; flex-shrink: 0; padding-top: 2px; }
.framework-overview-card.nist-card .fw-overview-icon { color: var(--blue); }
.framework-overview-card.cis-card .fw-overview-icon { color: var(--red); }
.framework-overview-card.iso-card .fw-overview-icon { color: var(--green); }
.fw-overview-content h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.fw-overview-content p { font-size: 12px; line-height: 1.5; color: var(--gray-600); margin-bottom: 12px; }
.fw-stats-row { display: flex; gap: 16px; }
.fw-stat { text-align: center; }
.fw-stat strong { display: block; font-size: 18px; font-weight: 800; color: var(--gray-900); }
.fw-stat span { font-size: 10px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; }

.ig-legend { background: white; border-radius: var(--radius); padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.ig-item { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 6px; }
.ig-item:last-child { margin-bottom: 0; }
.ig-dot { width: 10px; height: 10px; border-radius: 50%; }
.ig-item.ig1 .ig-dot { background: var(--red); }
.ig-item.ig2 .ig-dot { background: var(--orange); }
.ig-item.ig3 .ig-dot { background: var(--purple); }

.fw-function-card {
  background: white; border-radius: var(--radius);
  margin-bottom: 8px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100); overflow: hidden;
}
.fw-fn-header {
  display: flex; align-items: center; gap: 10px; padding: 14px;
  cursor: pointer; transition: var(--transition);
}
.fw-fn-header:hover { background: var(--gray-50); }
.fw-fn-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.fw-fn-info { flex: 1; min-width: 0; }
.fw-fn-id { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.fw-fn-name { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.fw-fn-stats { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--gray-400); flex-shrink: 0; }
.fw-chevron { transition: var(--transition); font-size: 12px; }
.fw-fn-body { padding: 0 14px 14px; border-top: 1px solid var(--gray-100); }
.fw-fn-desc { font-size: 12px; color: var(--gray-500); line-height: 1.5; padding: 10px 0; }
.fw-cat { margin-bottom: 12px; padding: 10px; background: var(--gray-50); border-radius: 10px; }
.fw-cat-name { font-size: 12px; font-weight: 700; color: var(--gray-700); margin-bottom: 4px; }
.fw-cat-desc { font-size: 11px; color: var(--gray-500); line-height: 1.4; margin-bottom: 8px; }
.fw-controls-mini { display: flex; flex-direction: column; gap: 4px; }
.fw-ctrl-mini {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--gray-200);
}
.fw-ctrl-mini:last-child { border-bottom: none; }
.ctrl-mini-id { font-size: 10px; font-weight: 800; white-space: nowrap; }
.ctrl-mini-name { flex: 1; color: var(--gray-600); }
.ctrl-mini-score {
  width: 22px; height: 22px; border-radius: 6px; color: white;
  font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ─── FRAMEWORK COVERAGE ─────────────────────────────────── */
.framework-coverage-list { padding: 8px 16px 16px; }
.fw-cov-item { margin-bottom: 12px; }
.fw-cov-item:last-child { margin-bottom: 0; }
.fw-cov-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.fw-cov-name { font-size: 12px; font-weight: 600; color: var(--gray-700); display: flex; align-items: center; gap: 6px; }
.fw-cov-name i { font-size: 12px; }
.fw-cov-pct { font-size: 12px; font-weight: 800; color: var(--gray-600); }
.fw-progress { height: 6px; background: var(--gray-100); border-radius: 6px; overflow: hidden; }
.fw-progress-fill { height: 100%; border-radius: 6px; transition: width 0.8s ease; }
.nist-color { background: var(--blue); }
.cis-color { background: var(--red); }
.iso-color { background: var(--green); }

/* ─── SETUP / FORM ───────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 11px 14px; border-radius: 10px;
  border: 1.5px solid var(--gray-200); font-size: 14px; color: var(--gray-800);
  background: white; transition: var(--transition); outline: none;
}
.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%236B7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.checkbox-group { display: flex; flex-direction: column; gap: 10px; }
.checkbox-item { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--gray-700); }
.checkbox-item input[type="checkbox"] { display: none; }
.checkmark {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--gray-300);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); flex-shrink: 0;
}
.checkbox-item input:checked + .checkmark { background: var(--blue); border-color: var(--blue); }
.checkbox-item input:checked + .checkmark::after { content: '✓'; color: white; font-size: 12px; font-weight: 800; }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 11px; font-size: 14px; font-weight: 700;
  transition: var(--transition); cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue), #1D4ED8);
  color: white; box-shadow: 0 2px 10px rgba(37,99,235,0.3);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(37,99,235,0.4); transform: translateY(-1px); }
.btn-outline { border: 2px solid var(--gray-200); color: var(--gray-700); background: white; }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 8px; }
.btn-full { width: 100%; }

/* ─── REPORTS ────────────────────────────────────────────── */
.report-preview { padding: 16px; background: var(--gray-50); }
.report-company-name { font-size: 18px; font-weight: 800; color: var(--gray-900); }
.report-date { font-size: 11px; color: var(--gray-500); margin-bottom: 16px; }
.report-scores { display: flex; gap: 12px; margin-bottom: 16px; }
.report-score-item { flex: 1; background: white; border-radius: 10px; padding: 12px; text-align: center; box-shadow: var(--shadow-sm); }
.rsi-label { font-size: 10px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; }
.rsi-value { font-size: 20px; font-weight: 900; margin-top: 4px; color: var(--gray-800); }
.rsi-value.current { color: var(--blue); }
.rsi-value.projected { color: var(--green); }
.report-highlight {
  background: white; border-radius: 10px; padding: 12px;
  font-size: 12px; color: var(--gray-600); line-height: 1.6;
  display: flex; gap: 8px; align-items: flex-start;
}
.report-highlight i { color: var(--orange); margin-top: 2px; flex-shrink: 0; }

.findings-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.findings-tbl th {
  text-align: left; padding: 10px 14px;
  background: var(--gray-50); font-size: 10px; font-weight: 700;
  color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray-200);
}
.findings-tbl td { padding: 10px 14px; border-bottom: 1px solid var(--gray-100); }
.tbl-ctrl { font-size: 11px; font-weight: 700; color: var(--gray-700); }
.tbl-fn { font-weight: 700; font-size: 11px; }
.score-pill { padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 800; color: white; }

/* ─── EMPTY STATES ───────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 16px; text-align: center; gap: 10px;
}
.empty-state i { font-size: 40px; color: var(--gray-300); }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--gray-600); }
.empty-state p { font-size: 13px; color: var(--gray-400); max-width: 240px; line-height: 1.5; }

/* ─── BOTTOM NAV ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--bottom-h); background: white;
  border-top: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 8px 4px;
  font-size: 10px; font-weight: 600; color: var(--gray-400);
  transition: var(--transition); border-radius: 10px;
}
.bnav-item i { font-size: 19px; }
.bnav-item.active { color: var(--blue); }
.bnav-item.active i { color: var(--blue); }

/* ─── TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  z-index: 1000; background: var(--gray-900); color: white;
  padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  max-width: 90%; min-width: 200px;
}
.toast.success { background: var(--green); }
.toast.info { background: var(--blue); }
.toast i { font-size: 15px; }
@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ─── PRINT STYLES ───────────────────────────────────────── */
@media print {
  .app-header, .bottom-nav, .sidebar, .sidebar-overlay,
  .menu-btn, .notif-btn, .btn, .toggle-switch,
  .rec-actions-toggle, #page-assessment, #page-setup { display: none !important; }
  .main-content { margin: 0; padding: 16px; }
  .page { display: none !important; }
  #page-reports { display: block !important; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (min-width: 600px) {
  .main-content { padding: 20px; }
  .stats-row { grid-template-columns: repeat(4, 1fr); }
  .nist-scores-row { justify-content: center; }
  .score-number { font-size: 32px; }
}

@media (min-width: 768px) {
  .app-header { padding: 0 24px; }
  .main-content { padding: 24px; }
  .sidebar { transform: none; box-shadow: none; border-right: 1px solid var(--gray-200); }
  .sidebar-overlay { display: none !important; }
  .app-wrapper { flex-direction: row; }
  .sidebar-close { display: none; }
  .main-content { margin-left: 280px; margin-top: var(--header-h); margin-bottom: var(--bottom-h); }
}
