/* ============================================================================
   GoodRevyu — Dashboard SPA. Design moderne, épuré, accessible (WCAG AA).
   Thème clair/sombre : prefers-color-scheme + surcharge via [data-theme].
   Palette : indigo #4F46E5, cyan #06B6D4, encre #0F172A.
   ============================================================================ */

/* ---- Design tokens (thème clair par défaut) ---- */
:root {
  --indigo: #4F46E5;
  --indigo-600: #4338CA;
  --indigo-050: #EEF2FF;
  --cyan: #06B6D4;
  --ink: #0F172A;

  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-muted: #475569;
  --text-faint: #64748B;

  --primary: var(--indigo);
  --primary-contrast: #FFFFFF;
  --focus: #4F46E5;

  --ok: #059669;
  --ok-bg: #ECFDF5;
  --warn: #B45309;
  --warn-bg: #FFFBEB;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --info: #0369A1;
  --info-bg: #EFF6FF;

  --star: #F59E0B;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, .18);

  --sidebar-w: 248px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ---- Thème sombre ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1220;
    --surface: #111A2E;
    --surface-2: #16213A;
    --border: #24304B;
    --border-strong: #33415F;
    --text: #E8EDF6;
    --text-muted: #A6B2C9;
    --text-faint: #8592AC;
    --indigo-050: #1E2540;
    --primary: #6366F1;
    --focus: #818CF8;
    --ok: #34D399;   --ok-bg: #06281F;
    --warn: #FBBF24; --warn-bg: #2A2109;
    --danger: #F87171; --danger-bg: #2C1414;
    --info: #38BDF8; --info-bg: #0B2233;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 6px 16px rgba(0,0,0,.4);
    --shadow-lg: 0 24px 48px rgba(0,0,0,.55);
  }
}
[data-theme="dark"] {
  --bg: #0B1220;
  --surface: #111A2E;
  --surface-2: #16213A;
  --border: #24304B;
  --border-strong: #33415F;
  --text: #E8EDF6;
  --text-muted: #A6B2C9;
  --text-faint: #8592AC;
  --indigo-050: #1E2540;
  --primary: #6366F1;
  --focus: #818CF8;
  --ok: #34D399;   --ok-bg: #06281F;
  --warn: #FBBF24; --warn-bg: #2A2109;
  --danger: #F87171; --danger-bg: #2C1414;
  --info: #38BDF8; --info-bg: #0B2233;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 6px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 48px rgba(0,0,0,.55);
}

/* ---- Reset léger ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
[dir="rtl"] { direction: rtl; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 700; color: var(--text); }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }

/* ---- Focus visible universel (accessibilité clavier) ---- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  background: var(--primary); color: #fff; padding: 10px 16px;
  border-radius: 8px; transition: top .15s;
}
.skip-link:focus { top: 8px; }

/* ============================================================================
   Layout
   ============================================================================ */
#app { min-height: 100vh; }

.auth-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1100px 500px at 10% -10%, color-mix(in srgb, var(--indigo) 22%, transparent), transparent),
    radial-gradient(900px 500px at 100% 0%, color-mix(in srgb, var(--cyan) 18%, transparent), transparent),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 32px;
}
.auth-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-card .brand img { height: 36px; width: auto; }
.auth-card .brand b { font-size: 1.15rem; letter-spacing: -.01em; }
.auth-alt { margin-top: 16px; font-size: .92rem; color: var(--text-muted); text-align: center; }

.app-layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---- Barre latérale ---- */
.sidebar {
  background: var(--surface); border-inline-end: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.sidebar-head img { width: 30px; height: 30px; }
.sidebar-head b { font-size: 1.08rem; letter-spacing: -.01em; }
.nav { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 500;
  text-decoration: none; transition: background .12s, color .12s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--indigo-050); color: var(--primary); font-weight: 600; }
.nav a .ico { width: 20px; height: 20px; flex: none; display: grid; place-items: center; }
.nav a svg { width: 18px; height: 18px; }
.nav-sep { height: 1px; background: var(--border); margin: 8px 4px; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm);
  width: 100%; background: transparent; border: none; cursor: pointer; color: var(--text); text-align: start;
}
.user-chip:hover { background: var(--surface-2); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--indigo), var(--cyan)); color: #fff; font-weight: 700; font-size: .85rem;
}
.user-chip .meta { min-width: 0; }
.user-chip .meta .nm { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .meta .em { font-size: .78rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Zone principale ---- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30;
}
.topbar .page-title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.topbar .spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.menu-toggle { display: none; }
.content { padding: 22px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ============================================================================
   Composants
   ============================================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: .86rem; }
.mono { font-family: var(--mono); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---- Cartes de statistiques ---- */
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat .label { font-size: .82rem; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.stat .sub { font-size: .85rem; color: var(--text-muted); margin-top: 2px; }
.stat .value.accent { color: var(--primary); }

/* ---- Boutons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: 10px; font-weight: 600; font-size: .92rem;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  cursor: pointer; transition: transform .04s, background .12s, border-color .12s, box-shadow .12s;
  white-space: nowrap; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: not-allowed; pointer-events: none; }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 11px; font-size: .85rem; border-radius: 8px; }
.btn.lg { padding: 12px 20px; font-size: 1rem; }
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: var(--primary-contrast);
  box-shadow: 0 1px 2px rgba(79,70,229,.35);
}
.btn-primary:hover { background: var(--indigo-600); border-color: var(--indigo-600); }
.btn-cyan { background: var(--cyan); border-color: var(--cyan); color: #04202a; }
.btn-cyan:hover { filter: brightness(.96); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.btn-danger:hover { background: var(--danger-bg); }
.btn .spin { width: 16px; height: 16px; }

/* ---- Badges d'état ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px;
  border-radius: 999px; font-size: .78rem; font-weight: 600; line-height: 1.5;
  border: 1px solid transparent; white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-neutral { color: var(--text-muted); background: var(--surface-2); }

/* ---- Étoiles ---- */
.stars { display: inline-flex; gap: 1px; color: var(--star); line-height: 1; }
.stars svg { width: 16px; height: 16px; }
.stars.lg svg { width: 22px; height: 22px; }
.stars .empty { color: var(--border-strong); }

/* ---- Formulaires ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-weight: 600; font-size: .9rem; }
.field .hint { font-size: .82rem; color: var(--text-faint); }
.field .err { font-size: .82rem; color: var(--danger); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
textarea { resize: vertical; min-height: 92px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%), linear-gradient(135deg, var(--text-faint) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-inline-end: 34px; }
[dir="rtl"] select { background-position: 18px 55%, 13px 55%; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.checkbox input { width: auto; margin-top: 3px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 0 0 14px; }
legend { font-weight: 600; padding: 0 6px; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---- Tableaux ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
thead th {
  text-align: start; font-weight: 600; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .03em; color: var(--text-faint); padding: 11px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface-2); }

/* ---- Toolbar de filtres ---- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search { position: relative; flex: 1 1 240px; min-width: 200px; }
.toolbar .search input { padding-inline-start: 38px; }
.toolbar .search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-faint); }
.toolbar select { width: auto; min-width: 140px; }

/* ---- Boîte de réception des avis ---- */
.review-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .12s, box-shadow .12s;
}
.review-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.review-item .who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.review-item .who .name { font-weight: 600; }
.review-item .who .excerpt { color: var(--text-muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.review-item .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.plat { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--text-muted); font-weight: 600; }

/* ---- Détail avis / réponse ---- */
.review-quote {
  border-inline-start: 3px solid var(--primary); background: var(--surface-2);
  padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; color: var(--text);
}
.reply-box { position: relative; }
.reply-box textarea { min-height: 150px; font-size: .96rem; }
.guardrail {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  border-radius: var(--radius); border: 1px solid transparent; font-size: .9rem;
}
.guardrail.ok { color: var(--ok); background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.guardrail.blocked { color: var(--danger); background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.guardrail svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.guardrail .body { color: var(--text); }
.guardrail .body strong { color: inherit; }

/* ---- Cartes plateformes (connexion) ---- */
.provider {
  display: flex; flex-direction: column; gap: 12px; padding: 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm);
}
.provider .logo { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; }
.provider .logo.google { background: #4285F4; }
.provider .logo.meta { background: #1877F2; }
.provider .logo.trustpilot { background: #00B67A; }
.provider .logo.simulation { background: linear-gradient(135deg, var(--indigo), var(--cyan)); }
.provider h3 { margin: 0; }

/* ---- Jauge de quota ---- */
.gauge { background: var(--surface-2); border-radius: 999px; height: 10px; overflow: hidden; }
.gauge > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--indigo), var(--cyan)); transition: width .4s ease; }
.gauge.warn > i { background: linear-gradient(90deg, #F59E0B, #EF4444); }

/* ---- Modale ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; z-index: 100;
  animation: fade .15s ease;
}
.modal {
  width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: pop .16s ease;
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---- Toasts ---- */
.toasts {
  position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px; max-width: 380px;
}
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: slidein .2s ease; color: var(--text);
}
.toast .ico { flex: none; width: 20px; height: 20px; }
.toast.ok { border-inline-start: 4px solid var(--ok); }
.toast.err { border-inline-start: 4px solid var(--danger); }
.toast.info { border-inline-start: 4px solid var(--info); }
.toast .msg { font-size: .9rem; }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---- États vides & chargement ---- */
.empty { text-align: center; padding: 46px 20px; color: var(--text-muted); }
.empty .emoji { font-size: 2.4rem; margin-bottom: 8px; }
.empty h3 { color: var(--text); }
.spin { display: inline-block; width: 20px; height: 20px; border: 2.5px solid color-mix(in srgb, var(--text-faint) 40%, transparent); border-top-color: var(--primary); border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.loading-block { display: grid; place-items: center; padding: 50px; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---- Bannière cookies (Loi 25) ---- */
.cookie-banner {
  position: fixed; inset-inline: 16px; bottom: 16px; z-index: 250; margin: 0 auto; max-width: 780px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 18px 20px;
}
.cookie-banner h3 { margin: 0 0 6px; }
.cookie-banner .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.cookie-prefs { display: grid; gap: 10px; margin-top: 14px; }
.cookie-prefs .opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.cookie-prefs .opt input { width: auto; margin-top: 3px; }
.cookie-prefs .opt .t { font-weight: 600; }

/* ---- Divers ---- */
.pill-tabs { display: inline-flex; gap: 4px; background: var(--surface-2); border-radius: 10px; padding: 4px; }
.pill-tabs button { border: none; background: transparent; padding: 6px 14px; border-radius: 8px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.pill-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.kbd { font-family: var(--mono); font-size: .8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.copybox { display: flex; gap: 8px; align-items: center; }
.copybox input { font-family: var(--mono); font-size: .85rem; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-weight: 600; margin-bottom: 14px; }
.back-link:hover { color: var(--text); text-decoration: none; }

/* ---- Cloche de notifications + panneau déroulant ---- */
.notif-wrap { position: relative; display: inline-flex; }
.notif-btn { position: relative; }
.notif-count {
  position: absolute; top: -4px; inset-inline-end: -4px; min-width: 17px; height: 17px;
  padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 17px; text-align: center;
  border: 2px solid var(--surface); pointer-events: none;
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; width: 360px; max-width: 88vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 90; overflow: hidden; display: flex; flex-direction: column;
  max-height: 70vh; animation: pop .16s ease;
}
.notif-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-head .spacer { flex: 1; }
.notif-body { overflow-y: auto; max-height: 52vh; }
.notif-foot { padding: 8px 12px; border-top: 1px solid var(--border); }
.notif-empty { text-align: center; padding: 28px 16px; }
.notif-empty .emoji { font-size: 1.8rem; margin-bottom: 6px; }

/* ---- Élément de notification (dropdown + écran) ---- */
.notif-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.notif-item {
  display: flex; gap: 11px; align-items: flex-start; width: 100%; text-align: start;
  padding: 12px 14px; border: none; border-bottom: 1px solid var(--border);
  background: transparent; color: var(--text); cursor: pointer; transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.notif-item.unread:hover { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.notif-ico { flex: none; width: 20px; height: 20px; color: var(--text-muted); display: grid; place-items: center; margin-top: 1px; }
.notif-ico svg { width: 18px; height: 18px; }
.notif-txt { min-width: 0; flex: 1; }
.notif-title { font-weight: 600; font-size: .92rem; }
.notif-body-txt { color: var(--text-muted); font-size: .86rem; margin-top: 2px; }
.notif-time { color: var(--text-faint); font-size: .76rem; margin-top: 4px; }
.notif-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 6px; }

/* ---- Demandes d'avis : QR + sélecteur de contacts ---- */
.qr-box { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 16px; margin-top: 4px; }
.qr-img { display: block; margin: 12px auto 0; border-radius: var(--radius-sm); background: #fff; padding: 8px; }
.contact-picker {
  display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 6px;
}
.contact-opt {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .12s;
}
.contact-opt:hover { background: var(--surface-2); }
.contact-opt input { width: auto; flex: none; }
.contact-opt .nm { font-weight: 600; }
.contact-opt .em { margin-inline-start: auto; }

/* ---- Concurrents (veille) ---- */
.rating-cell { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rating-cell .rating-num { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Résumé du comparatif : devant (vert) / derrière (rouge). */
.compare-summary {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 12px;
  padding: 12px 14px; border-radius: var(--radius); border: 1px solid transparent;
}
.compare-summary .compare-ico { font-size: 1.1rem; line-height: 1.2; flex: none; }
.compare-summary.ahead { color: var(--ok); background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.compare-summary.behind { color: var(--danger); background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.compare-summary .small { color: var(--text-muted); }

/* Met en évidence la ligne « vous » dans le tableau comparatif. */
tr.compare-you td { background: var(--indigo-050); }

/* Badges de tendance ▲/▼/– */
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: .85rem; font-variant-numeric: tabular-nums; }
.trend .trend-arrow { line-height: 1; }
.trend-up { color: var(--ok); }
.trend-down { color: var(--danger); }
.trend-flat { color: var(--text-faint); }

/* Résultats de recherche + ajout manuel */
.cmp-results { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.cmp-result {
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.cmp-result:hover { border-color: var(--border-strong); }
.cmp-result-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cmp-manual { padding-top: 4px; }

/* ============================================================================
   Responsive
   ============================================================================ */
@media (max-width: 900px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .inline-fields { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: 82%; max-width: 300px; z-index: 120;
    transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  body.nav-open .sidebar { transform: none; }
  .nav-scrim { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 110; display: none; }
  body.nav-open .nav-scrim { display: block; }
  .menu-toggle { display: grid; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .review-item { grid-template-columns: 1fr; }
  .review-item .side { flex-direction: row; align-items: center; }
  .content { padding: 16px; }
  .notif-panel { position: fixed; inset-inline: 12px; inset-inline-end: 12px; width: auto; top: 62px; }
}

/* ---- Réduction des animations ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
