/* ═══════════════════════════════════════════════════════════
   ANSSI AUDIT — Design System (Dark Cyber Theme)
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg-deep:      #060b14;
  --bg-dark:      #0a0e1a;
  --bg-card:      #0d1321;
  --bg-elevated:  #111827;
  --bg-hover:     #162032;
  --border:       #1e2a3a;
  --border-light: #253448;
  --text-primary: #e2e8f0;
  --text-secondary:#8892a4;
  --text-muted:   #4b5563;
  --accent:       #00d4aa;
  --accent-blue:  #0066cc;
  --accent-purple:#7c3aed;
  --danger:       #ef4444;
  --warning:      #f59e0b;
  --success:      #22c55e;
  --sidebar-w:    260px;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,.4);
  --shadow-lg:    0 8px 48px rgba(0,0,0,.6);
  --glow-accent:  0 0 20px rgba(0,212,170,.2);
  --glow-blue:    0 0 20px rgba(0,102,204,.2);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: #33ddb8; }

/* ── Auth Pages ───────────────────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.auth-bg {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(0,102,204,.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(0,212,170,.1) 0%, transparent 50%),
              var(--bg-deep);
}

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,212,170,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,170,.04) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridMove 20s linear infinite;
}
@keyframes gridMove { from { transform: translateY(0); } to { transform: translateY(40px); } }

.particles { position: absolute; inset: 0; overflow: hidden; }

.auth-container { position: relative; z-index: 1; width: 100%; max-width: 480px; padding: 24px; }

.auth-card {
  background: linear-gradient(135deg, rgba(13,19,33,.95) 0%, rgba(10,14,26,.98) 100%);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0,102,204,.1);
}

.auth-logo { text-align: center; margin-bottom: 32px; }
.logo-shield { width: 64px; height: 64px; margin: 0 auto 16px; filter: drop-shadow(var(--glow-accent)); }
.logo-shield svg, .logo-shield-sm svg { width: 100%; height: 100%; }
.auth-logo h1 { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.auth-logo p { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

.auth-form { display: flex; flex-direction: column; gap: 20px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
}
.form-group label .hint { font-weight: 400; color: var(--text-muted); }

.input-wrapper { position: relative; }
.input-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-muted); pointer-events: none;
}
.input-wrapper input,
.input-wrapper select {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.input-wrapper input:focus,
.input-wrapper select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,170,.15);
}
.input-wrapper input::placeholder { color: var(--text-muted); }

.auth-footer { text-align: center; margin-top: 24px; color: var(--text-secondary); font-size: 13px; }

/* Password strength */
.password-strength { margin-top: 6px; }
.pw-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 4px; }
.pw-fill { height: 100%; border-radius: 2px; transition: width .3s, background .3s; }
.password-strength span { font-size: 12px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; transition: all .2s;
  white-space: nowrap; text-decoration: none;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #00b894);
  color: #0a0e1a;
  box-shadow: 0 2px 12px rgba(0,212,170,.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #33ddb8, #00d4aa);
  box-shadow: 0 4px 20px rgba(0,212,170,.4);
  transform: translateY(-1px);
  color: #0a0e1a;
}
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-light); }
.btn-danger { background: rgba(239,68,68,.15); color: var(--danger); border: 1px solid rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 6px 8px; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; display: flex; align-items: center; gap: 10px;
}
.alert-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.25); color: #86efac; }

/* ── App Layout ───────────────────────────────────────────── */
.app-page { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--bg-card) 0%, #0a0e1a 100%);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 16px 16px;
  font-weight: 700; font-size: 15px;
  border-bottom: 1px solid var(--border);
}
.logo-shield-sm { width: 32px; height: 32px; flex-shrink: 0; }

.sidebar-nav { padding: 12px 8px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 14px;
  transition: all .15s; cursor: pointer; margin-bottom: 2px;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active { background: rgba(0,212,170,.1); color: var(--accent); border: 1px solid rgba(0,212,170,.2); }

.sidebar-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); padding: 0 12px 8px; }
.sidebar-progress { padding: 12px 12px; border-top: 1px solid var(--border); }
.theme-progress-item { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 11px; color: var(--text-secondary); }
.theme-progress-item > span:first-child { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.mini-progress { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.mini-fill { height: 100%; border-radius: 2px; transition: width .6s ease; }
.mini-score { font-size: 10px; font-weight: 600; min-width: 28px; text-align: right; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--border);
  margin-top: auto;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #0a0e1a; flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-name { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-company { display: block; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn { color: var(--text-muted); padding: 4px; border-radius: 6px; transition: color .2s; }
.logout-btn:hover { color: var(--danger); }
.logout-btn svg { width: 16px; height: 16px; display: block; }

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; padding: 28px 32px;
  max-width: 1400px;
}

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px;
}
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.5px; margin-bottom: 4px; }
.page-subtitle { color: var(--text-secondary); font-size: 13px; }
.breadcrumb { font-size: 13px; color: var(--text-muted); display: inline-block; margin-bottom: 6px; }
.breadcrumb:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 12px; }

/* ── KPI Grid ─────────────────────────────────────────────── */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .2s, transform .2s;
  animation: slideIn .4s ease both;
  animation-delay: var(--delay, 0s);
}
.kpi-card:hover { border-color: var(--border-light); transform: translateY(-2px); }

.kpi-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-blue { background: rgba(0,102,204,.15); color: #60a5fa; border: 1px solid rgba(0,102,204,.2); }
.kpi-green { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.2); }
.kpi-teal { background: rgba(0,212,170,.12); color: var(--accent); border: 1px solid rgba(0,212,170,.2); }
.kpi-purple { background: rgba(124,58,237,.15); color: #a78bfa; border: 1px solid rgba(124,58,237,.2); }

.kpi-value { font-size: 32px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.kpi-unit { font-size: 18px; font-weight: 600; }
.kpi-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.trend-badge {
  font-size: 11px; padding: 3px 8px; border-radius: 20px; font-weight: 500;
}
.trend-up { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.2); }
.trend-down { background: rgba(239,68,68,.12); color: #f87171; border: 1px solid rgba(239,68,68,.2); }
.trend-warning { background: rgba(245,158,11,.12); color: #fbbf24; border: 1px solid rgba(245,158,11,.2); }
.trend-info { background: rgba(0,102,204,.12); color: #60a5fa; border: 1px solid rgba(0,102,204,.2); }

/* ── Charts ───────────────────────────────────────────────── */
.charts-row { display: grid; grid-template-columns: 1fr 380px; gap: 16px; margin-bottom: 24px; }
.chart-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.chart-title { font-size: 14px; font-weight: 600; margin-bottom: 16px; color: var(--text-secondary); }
.chart-wrapper { height: 220px; }

/* ── Section ──────────────────────────────────────────────── */
.section { margin-bottom: 24px; }
.section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.section-header h2 { font-size: 18px; font-weight: 600; }
.badge {
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 12px;
  padding: 2px 8px; border-radius: 12px;
}

/* ── Audit Cards ──────────────────────────────────────────── */
.audit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }

.audit-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.audit-card:hover { border-color: var(--border-light); box-shadow: var(--shadow); }

.audit-card-header { display: flex; gap: 14px; align-items: flex-start; }

.audit-score-ring { position: relative; width: 72px; height: 72px; flex-shrink: 0; }
.audit-score-ring svg { width: 80px; height: 80px; margin: -4px; }
.ring-score {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}

.audit-info { flex: 1; }
.audit-info h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.audit-target { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.audit-target svg { width: 12px; height: 12px; }
.score-badge { font-size: 11px; padding: 3px 8px; border-radius: 20px; font-weight: 500; }

.audit-progress { display: flex; flex-direction: column; gap: 6px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width .6s ease; }

.audit-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); }
.status-dot { display: flex; align-items: center; gap: 4px; }
.status-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
.status-in_progress::before { background: var(--warning); animation: pulse 2s infinite; }
.status-completed::before { background: var(--success); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.audit-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-secondary);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.empty-icon { width: 80px; height: 80px; margin: 0 auto 16px; opacity: .5; }
.empty-icon svg { width: 100%; height: 100%; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.empty-state p { margin-bottom: 24px; }

/* ── Score display ────────────────────────────────────────── */
.score-display { text-align: center; }
.big-score { font-size: 36px; font-weight: 800; display: block; }
.score-label-sm { font-size: 12px; color: var(--text-secondary); }

/* ── Audit page overview ──────────────────────────────────── */
.audit-overview {
  display: grid; grid-template-columns: 220px 1fr 300px;
  gap: 16px; margin-bottom: 24px;
}

.overview-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}

.gauge-container { position: relative; text-align: center; }
.gauge-container canvas { display: block; }
.gauge-value { font-size: 28px; font-weight: 800; margin-top: -30px; }
.gauge-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.status-cards {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; align-content: center;
}

.status-chip {
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  padding: 12px; border-radius: var(--radius-sm);
  border: 1px solid;
}
.status-chip strong { font-size: 28px; font-weight: 800; }
.status-chip span { font-size: 11px; color: var(--text-secondary); }
.status-chip.compliant { background: rgba(0,212,170,.08); border-color: rgba(0,212,170,.2); }
.status-chip.compliant strong { color: var(--accent); }
.status-chip.partial { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.2); }
.status-chip.partial strong { color: var(--warning); }
.status-chip.non_compliant { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.2); }
.status-chip.non_compliant strong { color: var(--danger); }
.status-chip.unknown { background: rgba(75,85,99,.1); border-color: rgba(75,85,99,.2); }
.status-chip.unknown strong { color: var(--text-muted); }

.radar-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}

/* ── PowerShell Banner ────────────────────────────────────── */
.ps-banner {
  background: linear-gradient(135deg, rgba(0,102,204,.1), rgba(0,212,170,.05));
  border: 1px solid rgba(0,102,204,.3);
  border-radius: var(--radius); padding: 20px;
  display: flex; gap: 16px; align-items: flex-start;
  margin-bottom: 24px;
}
.ps-banner-icon { width: 40px; height: 40px; background: rgba(0,102,204,.2); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ps-banner-icon svg { width: 20px; height: 20px; color: #60a5fa; }
.ps-banner-content { flex: 1; }
.ps-banner-content strong { font-size: 14px; font-weight: 600; }
.ps-banner-content p { font-size: 13px; color: var(--text-secondary); margin: 4px 0 8px; }
.ps-command {
  display: block; background: var(--bg-deep); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 12px; font-size: 12px; font-family: monospace;
  color: var(--accent); word-break: break-all;
}
.ps-banner-actions { display: flex; flex-direction: column; gap: 8px; }

/* ── Theme sections ───────────────────────────────────────── */
.theme-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px; overflow: hidden;
}

.theme-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; cursor: pointer;
  transition: background .15s; user-select: none;
}
.theme-header:hover { background: var(--bg-elevated); }
.theme-title { display: flex; align-items: center; gap: 12px; }
.theme-title h2 { font-size: 15px; font-weight: 600; }
.theme-title p { font-size: 12px; color: var(--text-muted); }
.theme-number {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #0a0e1a; flex-shrink: 0;
}

.theme-score-wrap { display: flex; align-items: center; gap: 12px; }
.theme-score-bar { width: 120px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.theme-score-fill { height: 100%; border-radius: 3px; transition: width .6s; }
.theme-score-val { font-size: 13px; font-weight: 600; min-width: 40px; text-align: right; }
.theme-chevron { width: 16px; height: 16px; color: var(--text-muted); transition: transform .3s; }

.theme-section.collapsed .theme-body { display: none; }
.theme-section.collapsed .theme-chevron { transform: rotate(-90deg); }

.theme-body { border-top: 1px solid var(--border); }

/* ── Measure Cards ────────────────────────────────────────── */
.measure-card {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.measure-card:last-child { border-bottom: none; }
.measure-card:hover { background: rgba(255,255,255,.01); }

.measure-header {
  display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px;
}
.measure-id {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: rgba(0,212,170,.1); border: 1px solid rgba(0,212,170,.2);
  padding: 2px 8px; border-radius: 4px; flex-shrink: 0; margin-top: 2px;
  font-family: monospace;
}
.measure-meta { flex: 1; }
.measure-meta h3 { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.measure-desc { font-size: 12px; color: var(--text-muted); }

.measure-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.source-tag {
  font-size: 11px; padding: 2px 7px; border-radius: 4px;
  display: inline-flex; align-items: center; gap: 4px; font-weight: 500;
}
.source-tag svg { width: 10px; height: 10px; }
.source-auto { background: rgba(34,197,94,.1); color: #4ade80; border: 1px solid rgba(34,197,94,.2); }
.source-powershell { background: rgba(0,102,204,.1); color: #60a5fa; border: 1px solid rgba(0,102,204,.2); }
.source-manual { background: rgba(124,58,237,.1); color: #a78bfa; border: 1px solid rgba(124,58,237,.2); }

.measure-score-badge {
  font-size: 11px; padding: 3px 8px; border-radius: 12px;
  display: flex; align-items: center; gap: 5px; font-weight: 500;
}
.score-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
.badge-unknown { background: rgba(75,85,99,.15); color: var(--text-muted); border: 1px solid rgba(75,85,99,.3); }

/* Auto result */
.auto-result {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 10px;
}
.auto-result > div:first-child { display: flex; align-items: flex-start; gap: 8px; }
.auto-result svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
.auto-result.compliant { background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.2); color: #86efac; }
.auto-result.partial { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.2); color: #fde68a; }
.auto-result.non_compliant { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2); color: #fca5a5; }
.auto-result.unknown { background: rgba(75,85,99,.1); border: 1px solid rgba(75,85,99,.2); color: var(--text-muted); }
.auto-reco { font-size: 12px; color: var(--text-secondary); margin-top: 6px; padding-left: 22px; }

/* PS only */
.ps-only-notice {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(0,102,204,.06); border: 1px solid rgba(0,102,204,.2);
  border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; font-size: 13px;
}
.ps-only-notice svg { width: 18px; height: 18px; color: #60a5fa; flex-shrink: 0; margin-top: 2px; }
.ps-only-notice strong { display: block; color: #93c5fd; margin-bottom: 2px; }
.ps-only-notice p { color: var(--text-secondary); font-size: 12px; }
.ps-result-detail { margin-top: 8px; padding: 8px; background: var(--bg-deep); border-radius: 6px; font-size: 12px; color: var(--text-secondary); }
.ps-detail-label { font-weight: 600; color: var(--text-primary); margin-right: 6px; }

/* Form elements */
.measure-form { border-top: 1px solid var(--border); padding-top: 14px; }
.form-field { margin-bottom: 12px; }
.form-field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-secondary); }

.radio-group, .checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-option, .checkbox-option {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; cursor: pointer; padding: 6px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 6px; transition: all .15s;
}
.radio-option:hover, .checkbox-option:hover { border-color: var(--accent); background: rgba(0,212,170,.05); }
.radio-option input, .checkbox-option input { display: none; }
.radio-custom, .checkbox-custom {
  width: 14px; height: 14px; border: 2px solid var(--border-light);
  border-radius: 50%; flex-shrink: 0; transition: all .15s;
}
.checkbox-custom { border-radius: 3px; }
.radio-option input:checked ~ .radio-custom { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 2px rgba(0,212,170,.2); }
.checkbox-option input:checked ~ .checkbox-custom { border-color: var(--accent); background: var(--accent); }
.radio-option input:checked ~ span:last-child { color: var(--accent); }

.form-select {
  width: 100%; padding: 8px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px;
  outline: none; cursor: pointer;
}
.form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,212,170,.15); }
.form-input {
  width: 100%; padding: 8px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px;
  outline: none;
}
.form-input:focus, .form-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,212,170,.15); }
.form-textarea {
  width: 100%; padding: 8px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px;
  outline: none; resize: vertical; font-family: inherit;
}

.form-actions { display: flex; align-items: center; gap: 12px; padding-top: 8px; }
.save-ok { font-size: 13px; color: var(--accent); }

.evidence-details summary { cursor: pointer; color: var(--text-muted); font-size: 12px; margin-top: 6px; }
.evidence-details pre { font-size: 11px; color: var(--text-secondary); background: var(--bg-deep); padding: 8px; border-radius: 4px; overflow-x: auto; margin-top: 6px; white-space: pre-wrap; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  z-index: 1000; display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 16px; padding: 28px; width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg); margin: 16px;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-header h2 { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; transition: color .2s; }
.modal-close:hover { color: var(--text-primary); }
.modal-close svg { width: 20px; height: 20px; display: block; }
.modal-form .form-group { margin-bottom: 16px; }
.modal-form .input-wrapper input { padding-left: 12px; }
.modal-form .form-group label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 16px; margin-bottom: 16px;
}
.filter-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-status-group { margin-left: auto; }
.filter-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary);
  font-size: 12px; cursor: pointer; transition: all .15s;
}
.filter-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: rgba(0,212,170,.12); border-color: var(--accent); color: var(--accent); }
.filter-count { font-size: 10px; background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 10px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-grey   { background: #8892a4; }
.dot-red    { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green  { background: #00d4aa; }
.no-filter-results {
  text-align: center; padding: 40px; color: var(--text-muted);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14px;
}

.alert-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: 13px;
}
.alert-banner svg { width: 18px; height: 18px; flex-shrink: 0; }
.alert-banner span { flex: 1; }
.alert-banner code { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.alert-banner-info    { background: rgba(0,102,204,.12); border: 1px solid rgba(0,102,204,.3); color: #93c5fd; }
.alert-banner-info svg{ color: #60a5fa; }
.alert-banner-success { background: rgba(0,212,170,.08); border: 1px solid rgba(0,212,170,.25); color: var(--text-secondary); }
.alert-banner-success svg { color: var(--accent); }

.label-hint { font-size: 11px; font-weight: 400; color: var(--accent); background: rgba(0,212,170,.1); padding: 1px 6px; border-radius: 4px; }
.form-help { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 12px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  transform: translateY(80px); opacity: 0;
  transition: all .3s cubic-bezier(.34,1.56,.64,1);
  z-index: 2000; pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: rgba(0,212,170,.15); border: 1px solid rgba(0,212,170,.4); color: var(--accent); }
.toast.error { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4); color: #fca5a5; }

/* ── Report Page ──────────────────────────────────────────── */
.report-actions { display: flex; justify-content: space-between; margin-bottom: 24px; }

.report-document {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}

.report-cover {
  background: linear-gradient(135deg, #0a0e1a 0%, #0d1321 50%, #080d18 100%);
  padding: 48px; border-bottom: 1px solid var(--border);
  text-align: center;
}
.report-cover-logo { width: 80px; height: 80px; margin: 0 auto 24px; filter: drop-shadow(var(--glow-accent)); }
.report-cover-title h1 { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.report-cover-title h2 { font-size: 18px; font-weight: 400; color: var(--accent); margin: 8px 0; }
.report-cover-subtitle { color: var(--text-muted); font-size: 13px; }
.report-cover-meta { margin: 24px auto; max-width: 600px; }
.meta-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; text-align: left;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.meta-grid div { display: flex; flex-direction: column; gap: 2px; }
.meta-grid span { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); }
.meta-grid strong { font-size: 14px; font-weight: 500; }

.report-cover-score { display: flex; align-items: center; justify-content: center; gap: 40px; margin-top: 24px; }
.big-gauge { position: relative; text-align: center; }
.big-gauge svg { display: block; }
.gauge-score-cover { font-size: 32px; font-weight: 800; margin-top: -20px; }
.gauge-label-cover { font-size: 14px; color: var(--text-secondary); }
.cover-stats { display: flex; gap: 24px; }
.cover-stat { text-align: center; }
.cstat-v { font-size: 32px; font-weight: 800; display: block; }
.cover-stat span { font-size: 12px; color: var(--text-secondary); }

.report-section { padding: 32px; border-bottom: 1px solid var(--border); }
.report-section:last-child { border-bottom: none; }
.report-section-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--accent); display: inline-block; }

.theme-summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.theme-summary-card {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
}
.ts-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ts-num {
  width: 24px; height: 24px; border-radius: 6px;
  background: rgba(0,212,170,.15); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.ts-name { font-size: 13px; font-weight: 500; }
.ts-bar-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ts-bar { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.ts-fill { height: 100%; border-radius: 3px; }
.ts-pct { font-size: 13px; font-weight: 600; min-width: 36px; text-align: right; }
.ts-status { font-size: 11px; color: var(--text-muted); }

.report-theme { margin-bottom: 32px; }
.report-theme-title {
  font-size: 16px; font-weight: 600; margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.theme-num-badge {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #0a0e1a; flex-shrink: 0;
}
.theme-pct { margin-left: auto; font-size: 14px; font-weight: 700; }

.report-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  table-layout: fixed;
}
.report-table th {
  text-align: left; padding: 8px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  overflow: hidden;
}
.report-table td { padding: 10px 12px; border: 1px solid var(--border); vertical-align: top; overflow: hidden; }
.report-table tr:hover td { background: rgba(255,255,255,.01); }
.td-id { font-family: monospace; font-size: 12px; white-space: nowrap; }
.td-title { word-break: break-word; }
.td-score { font-weight: 700; text-align: center; }
.td-source { text-align: center; font-size: 11px; }
.status-pill { font-size: 11px; padding: 2px 8px; border-radius: 12px; white-space: nowrap; }
.no-data { color: var(--text-muted); }
.td-details { font-size: 12px; color: var(--text-secondary); word-break: break-word; }
.reco-row td { background: rgba(245,158,11,.04); }
.td-reco { font-size: 12px; color: #fde68a; padding: 8px 12px !important; }
.td-reco-inner { display: flex; gap: 8px; align-items: flex-start; }
.td-reco svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; fill: var(--warning); }

/* ── Section PA-022 ───────────────────────────────────────── */
.pa022-intro {
  display: flex; gap: 24px; align-items: flex-start;
  background: rgba(0,102,204,.07); border: 1px solid rgba(0,102,204,.2);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 4px;
}
.pa022-intro-text { flex: 1; font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.pa022-intro-text p { margin-bottom: 8px; }
.pa022-intro-text p:last-child { margin-bottom: 0; }
.pa022-scores { display: flex; gap: 12px; flex-shrink: 0; }
.pa022-score-card {
  text-align: center; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 18px; min-width: 90px;
}
.pa022-score-val { font-size: 22px; font-weight: 800; line-height: 1.1; }
.pa022-score-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.pa022-footer-note {
  margin-top: 16px; padding: 12px 16px;
  background: var(--bg-elevated); border-left: 3px solid var(--accent-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px; color: var(--text-muted);
}

@media print {
  .pa022-intro { background: #f0f4ff; border-color: #c7d7f0; }
  .pa022-score-card { background: #f8f8f8; border-color: #ddd; }
  .pa022-score-val { color: #333 !important; }
  .pa022-footer-note { background: #f8f8f8; }
}

.report-footer {
  padding: 20px 32px; background: var(--bg-deep);
  text-align: center; font-size: 12px; color: var(--text-muted);
}
.report-footer p { margin: 4px 0; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.animate-fadeInUp { animation: fadeInUp .4s ease both; }
.animate-slideIn  { animation: slideIn .4s ease both; }
.animate-fadeIn   { animation: fadeIn .3s ease both; }
.spin { animation: spin 1s linear infinite; }

/* ── Pré-remplissage formulaire depuis PS/auto ────────────── */
.prefill-notice {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: rgba(0,102,204,.1); border: 1px solid rgba(0,102,204,.3);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--accent-blue);
  margin-bottom: 12px;
}
.prefill-notice svg { width: 14px; height: 14px; flex-shrink: 0; }
.radio-option.prefilled .radio-custom {
  box-shadow: 0 0 0 2px rgba(0,212,170,.4);
}

/* ── Auto-check Banner ────────────────────────────────────── */
.auto-check-banner {
  background: linear-gradient(135deg, rgba(0,102,204,.15), rgba(0,212,170,.1));
  border: 1px solid rgba(0,212,170,.3); border-radius: var(--radius-sm);
  padding: 14px 20px; margin-bottom: 20px;
  transition: background .4s, border-color .4s;
}
.auto-check-banner.auto-check-done  { background: rgba(0,212,170,.08); border-color: rgba(0,212,170,.4); }
.auto-check-banner.auto-check-error { background: rgba(239,68,68,.08);  border-color: rgba(239,68,68,.3); }

.auto-check-inner  { display: flex; align-items: center; gap: 14px; }
.auto-check-content { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.auto-check-content span { font-size: 13px; color: var(--text-primary); }

.auto-check-progress {
  height: 4px; background: var(--border); border-radius: 2px; overflow: hidden;
}
.auto-check-bar {
  height: 100%; width: 5%; background: var(--accent);
  border-radius: 2px; transition: width .6s ease;
}

.auto-check-spinner {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 2px solid rgba(0,212,170,.3); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
.auto-check-done  .auto-check-spinner { display: none; }
.auto-check-error .auto-check-spinner { border-color: rgba(239,68,68,.3); border-top-color: #ef4444; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Card Component ───────────────────────────────────────── */
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--border); font-weight: 600;
}
.card-body { padding: 20px; }

/* ── Action Plan ──────────────────────────────────────────── */
.prio-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
}
.prio-critical { background: rgba(239,68,68,.15); color: #ef4444; border: 1px solid rgba(239,68,68,.3); }
.prio-high     { background: rgba(245,158,11,.15); color: #f59e0b; border: 1px solid rgba(245,158,11,.3); }
.prio-med      { background: rgba(234,179,8,.15);  color: #eab308; border: 1px solid rgba(234,179,8,.3); }

.ai-field {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: 6px; color: var(--text-primary); padding: 4px 8px; font-size: 12px;
  font-family: inherit; transition: border-color .2s;
}
.ai-field:focus { outline: none; border-color: var(--accent); }

.ai-status-todo      { color: var(--text-secondary) !important; }
.ai-status-in_progress { color: var(--warning) !important; }
.ai-status-done      { color: var(--success) !important; }

.print-only { display: none; }

/* ── Sharing UI ───────────────────────────────────────────── */
.share-modal-body { display: flex; flex-direction: column; gap: 16px; }
.share-row { display: flex; gap: 8px; align-items: flex-end; }
.share-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.share-list li {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px;
}
.share-list .share-email { font-weight: 500; }
.share-list .share-perm  { font-size: 11px; color: var(--text-secondary); }

/* ── Print Styles ─────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  .print-only { display: inline !important; }
  .sidebar { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: white; color: black; }
  .report-document { border: none; }
  .report-cover { background: white; color: black; }
  .report-section { border-bottom: 1px solid #ddd; }
  .report-table th { background: #f0f0f0; color: #333; }
  .report-table td { color: #333; border-color: #ddd; }
  .ai-field { display: none; }
  .prio-badge { border: 1px solid #999; color: #333; background: #f5f5f5; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .audit-overview { grid-template-columns: 1fr 1fr; }
  .radar-card { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .main-content { padding: 16px; }
  .charts-row { grid-template-columns: 1fr; }
  .ps-banner { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .audit-overview { grid-template-columns: 1fr; }
}

/* ── charte gaetanmorvan.fr (2026-10) : palette alignée sur le site ── */
:root{--bg-deep:#08080d;--bg-dark:#0c0c14;--bg-card:#14141f;--bg-elevated:#1b1b29;--bg-hover:#22223a;--border:#2b2b3d;--border-light:#3a3a52;--text-primary:#f3f2ee;--text-secondary:#a5a3b3;--accent:#a78bfa;--accent-blue:#22d3ee;--accent-purple:#8b5cf6}
