:root {
  --or:       #d4a853;
  --or-clair: #e8c278;
  --or-pale:  #f5e6c0;
  --accent:   #4a9eff;
  --rouge:    #e85d4a;
  --vert:     #52c07e;
  --r-sm:  8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 40px;
}

:root[data-theme="dark"],
:root:not([data-theme]) {
  --bg:        #0a0a0f;
  --bg-2:      #12121a;
  --bg-3:      #1c1c28;
  --text:          #f0ece4;
  --text-dim:      #c8c4bc;
  --text-muted:    #6b6878;
  --text-contrast: #ffffff;
  --border:      #334155;
  --shadow-or:   0 0 60px rgba(212, 168, 83, .18);
  --shadow-card: 0 4px 32px rgba(0, 0, 0, .5);
  --primary: var(--or);
}

:root[data-theme="light"] {
  --bg:        #ffffff;
  --bg-2:      #f8fafc;
  --bg-3:      #f1f5f9;
  --text:          #0f172a;
  --text-dim:      #475569;
  --text-muted:    #64748b;
  --text-contrast: #000000;
  --border:      #e2e8f0;
  --shadow-or:   0 0 40px rgba(212, 168, 83, .12);
  --shadow-card: 0 4px 24px rgba(15, 23, 42, .08);
  --primary: var(--or);
}

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: 'Syne', system-ui, sans-serif;
  line-height: 1.1;
  color: var(--text);
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--or-clair);
}

nav.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 2rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--or);
  margin-right: auto;
}

nav.nav a {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

nav.nav a:hover,
nav.nav a.active {
  color: var(--or);
  border-bottom-color: var(--or);
}

.btn-theme {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);
  transition: border-color 0.2s;
}

.btn-theme:hover {
  border-color: var(--or);
}

main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: var(--or);
}

.card-action {
  display: block;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.card-action:hover {
  border-color: var(--or);
  box-shadow: var(--shadow-or);
  transform: translateY(-2px);
  color: var(--text);
}

.card-action h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.card-action-desc {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 0.5rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--or);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, .15);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

select {
  cursor: pointer;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-3);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--text-muted);
  background: var(--bg-2);
}

.btn-primary {
  background: var(--or);
  color: var(--text-contrast);
  border-color: var(--or);
}

.btn-primary:hover {
  background: var(--or-clair);
  border-color: var(--or-clair);
  color: var(--text-contrast);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent);
  color: #fff;
}

.btn-danger {
  background: var(--rouge);
  color: #fff;
  border-color: var(--rouge);
}

.btn-danger:hover {
  opacity: 0.85;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

thead th {
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tbody tr:hover {
  background: var(--bg-3);
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag-pattern {
  background: rgba(82, 192, 126, .15);
  color: var(--vert);
}

.tag-anti-pattern {
  background: rgba(232, 93, 74, .15);
  color: var(--rouge);
}

.tag-convention {
  background: rgba(74, 158, 255, .15);
  color: var(--accent);
}

.tag-reference {
  background: rgba(212, 168, 83, .15);
  color: var(--or);
}

.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-card);
}

.login-card h1 {
  text-align: center;
  margin-bottom: 0.25rem;
  color: var(--or);
}

.login-card .login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

.login-error {
  background: rgba(232, 93, 74, .12);
  border: 1px solid var(--rouge);
  color: var(--rouge);
  padding: 0.5rem 0.8rem;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  text-align: center;
}

.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.7rem 1.2rem;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-card);
  animation: toast-in 0.3s ease-out;
  max-width: 400px;
}

.toast-success {
  background: var(--vert);
  color: #fff;
}

.toast-error {
  background: var(--rouge);
  color: #fff;
}

.toast-info {
  background: var(--accent);
  color: #fff;
}

.toast-warning {
  background: var(--or);
  color: var(--text-contrast);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.2rem;
  text-align: center;
}

.stat-card .stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--or);
}

.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.bargraph {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.bargraph-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.bargraph-label {
  min-width: 120px;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: right;
}

.bargraph-bar {
  flex: 1;
  height: 24px;
  background: var(--bg);
  border-radius: var(--r-sm);
  overflow: hidden;
  position: relative;
}

.bargraph-fill {
  height: 100%;
  background: var(--or);
  border-radius: var(--r-sm);
  transition: width 0.5s ease-out;
}

.bargraph-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  min-width: 30px;
}

footer.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-2);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

/* Dashboard two-column layout */
.dashboard-header h1 {
  margin-bottom: 0.25rem;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
  margin-top: 1rem;
}

.dashboard-sidebar {
  position: sticky;
  top: 5rem;
}

.dashboard-sidebar h2 {
  font-size: 1rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.actions-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.actions-secondary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.card-action-hero {
  border-color: var(--or-pale);
  background: var(--bg-2);
  padding: 1.75rem;
}

.card-action-hero h3 {
  font-size: 1.2rem;
}

.actions-secondary .card-action {
  padding: 1rem 1.25rem;
}

.actions-secondary .card-action h3 {
  font-size: 0.95rem;
}

.actions-secondary .card-action-desc {
  font-size: 0.84rem;
}

@media (max-width: 1000px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .dashboard-sidebar {
    position: static;
  }
  .actions-secondary {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .actions-primary {
    grid-template-columns: 1fr;
  }
  .actions-secondary {
    grid-template-columns: 1fr;
  }
}

@keyframes pulse-critical {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.pulse-critical {
  animation: pulse-critical 1.5s ease-in-out infinite;
  border: 2px solid var(--rouge);
}

.section-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--or);
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--or);
  margin-bottom: 0.3rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
}

.badge {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-applied {
  background: rgba(82, 192, 126, .18);
  color: var(--vert);
}

.badge-partial {
  background: rgba(212, 168, 83, .18);
  color: var(--or);
}

.badge-absent {
  background: rgba(232, 93, 74, .15);
  color: var(--rouge);
}

.badge-critical {
  background: var(--rouge);
  color: #fff;
  animation: pulse-critical 1.5s ease-in-out infinite;
}

.badge-draft {
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px dashed var(--border);
}

.badge-active {
  background: rgba(82, 192, 126, .12);
  color: var(--vert);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--text-dim);
}

pre, code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

code {
  background: var(--bg-3);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
}

pre code {
  background: none;
  padding: 0;
}

.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.checkbox-group label,
.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
}

.help-section {
  margin-bottom: 2rem;
}

.help-section h2 {
  font-size: 1.2rem;
  color: var(--or);
  margin-bottom: 0.5rem;
}

.help-section p,
.help-section li {
  color: var(--text-dim);
  line-height: 1.7;
}

.help-section ul {
  padding-left: 1.5rem;
}

.help-section li {
  margin-bottom: 0.3rem;
}

/* Utility classes */
.text-dim  { color: var(--text-dim); }
.text-or   { color: var(--or); }
.text-muted { color: var(--text-muted); }

/* ── Modal ──────────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-pattern-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--or);
  background: color-mix(in srgb, var(--or) 12%, transparent);
  padding: 2px 8px;
  border-radius: var(--r-sm);
}

/* ── Audit ──────────────────────────────────────────────────────────────── */

.audit-scan-summary {
  margin-bottom: 1.5rem;
}

.scan-summary-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.scan-project-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--or);
}

.scan-meta-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.scan-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.scan-meta-val {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.scan-meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scan-key-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.key-file-badge {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--r-xl);
  border: 1px solid;
  font-family: 'JetBrains Mono', monospace;
}

.key-file-badge.kf-ok {
  color: var(--vert);
  border-color: var(--vert);
  background: color-mix(in srgb, var(--vert) 10%, transparent);
}

.key-file-badge.kf-missing {
  color: var(--text-muted);
  border-color: var(--border);
  background: transparent;
  text-decoration: line-through;
  opacity: 0.6;
}

/* Cartes filtrables */
.card-filter {
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card-filter:hover {
  border-color: var(--or);
}

.card-filter-active {
  border-color: var(--or);
  box-shadow: var(--shadow-or);
}

.card-filter-reset .stat-value {
  color: var(--text-muted);
}

/* Barre sticky score + filtres */
.audit-sticky-bar {
  position: sticky;
  top: 57px;       /* hauteur de la nav */
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

/* Table scrollable */
.audit-table-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.audit-table-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.audit-row-counter {
  font-size: 0.8rem;
  color: var(--or);
  font-family: 'JetBrains Mono', monospace;
}

.audit-table-wrapper {
  overflow-y: auto;
  max-height: calc(100vh - 360px);
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overscroll-behavior: contain;
}

.audit-table-wrapper .audit-table {
  margin: 0;
  border-radius: 0;
  border: none;
}

.audit-table-wrapper .audit-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-2);
  z-index: 5;
  box-shadow: 0 1px 0 var(--border);
}

/* Score ring + stats côte à côte */
.audit-score-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.audit-score-ring {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}

.score-val {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  position: relative;
  z-index: 1;
  margin-top: 4px;
}

.score-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  position: absolute;
  bottom: 14px;
}

.audit-stats {
  flex: 1;
  margin: 0;
}

/* Stat colors */
.stat-vert  { color: var(--vert); }
.stat-or    { color: var(--or); }
.stat-rouge { color: var(--rouge); }

/* Fichiers volumineux */
.audit-details-block {
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.audit-details-toggle {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-dim);
  user-select: none;
  background: var(--bg-2);
}

.audit-details-toggle:hover {
  color: var(--text);
}

.largest-files-list {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lf-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.lf-name {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  min-width: 200px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lf-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
}

.lf-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.lf-loc {
  color: var(--text-muted);
  min-width: 60px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

/* Tableau audit */
.audit-table .audit-title-cell {
  max-width: 260px;
}

.audit-table .audit-title-cell .badge-xs {
  font-size: 0.65rem;
  padding: 1px 6px;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.signals-cell {
  text-align: center;
}

.signals-ratio {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  padding: 2px 8px;
  border-radius: var(--r-sm);
}

.sig-full    { color: var(--vert); background: color-mix(in srgb, var(--vert) 12%, transparent); }
.sig-partial { color: var(--or);   background: color-mix(in srgb, var(--or) 12%, transparent); }
.sig-none    { color: var(--rouge); background: color-mix(in srgb, var(--rouge) 12%, transparent); }

/* Preuves */
.evidence-cell {
  max-width: 320px;
}

.evidence-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.evidence-item {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.evidence-item.evidence-file   { color: var(--accent); }
.evidence-item.evidence-import { color: var(--or); }
.evidence-item.evidence-dir    { color: var(--vert); }
.evidence-item.evidence-regex  { color: var(--text-dim); }

.evidence-more {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 900px) {
  .audit-score-row { flex-direction: column; align-items: flex-start; }
  .evidence-cell, .audit-table .audit-title-cell { max-width: 160px; }
  .lf-name { min-width: 120px; max-width: 120px; }
  .scan-meta-row { gap: 1rem; }
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.filter-bar .filter-item {
  display: flex;
  flex-direction: column;
}

.filter-bar input,
.filter-bar select {
  width: auto;
  min-width: 160px;
}

@media (max-width: 768px) {
  nav.nav {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }

  nav.nav a {
    font-size: 0.82rem;
  }

  main {
    padding: 1rem;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .actions-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar input,
  .filter-bar select {
    width: 100%;
    min-width: auto;
  }

  table {
    font-size: 0.82rem;
  }

  thead th,
  tbody td {
    padding: 0.4rem 0.5rem;
  }
}

/* ── Plugin IA audit ──────────────────────────────────────────────────────── */

.ai-review-zone {
  margin: 1.5rem 0;
}

.btn-ai {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--or);
  background: transparent;
  color: var(--or);
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-ai:hover {
  background: var(--or);
  color: var(--bg);
}

.ai-review-block {
  margin-top: 1rem;
  border-left: 3px solid var(--or);
  padding: 1.25rem 1.5rem;
}

.ai-review-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ai-review-badge {
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bg);
  background: var(--or);
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-sm);
  letter-spacing: 0.05em;
}

.ai-review-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--or);
}

.ai-review-content.prose h1,
.ai-review-content.prose h2,
.ai-review-content.prose h3 {
  font-family: 'Syne', sans-serif;
  color: var(--text);
  margin: 1rem 0 0.4rem;
}

.ai-review-content.prose p {
  margin: 0.5rem 0;
  color: var(--text-dim);
  line-height: 1.7;
}

.ai-review-content.prose ul,
.ai-review-content.prose ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.ai-review-content.prose li {
  margin: 0.25rem 0;
  color: var(--text-dim);
}

.ai-review-content.prose strong {
  color: var(--text);
}

.ai-review-content.prose code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--bg-3);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: var(--or-clair);
}

/* ── Settings ─────────────────────────────────────────────────────────────── */

.form-label-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.form-label-toggle input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--or);
  cursor: pointer;
}

.help-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.help-shortcuts .card {
  padding: 1.25rem;
}

.help-shortcuts h3 {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}
