/* =====================================================
   REPERA — Espace membre (app)
   Design : Linear · Stripe · Notion · Ramp · Vercel · Anthropic
   ===================================================== */

:root {
  --bg: #F6F8FC;
  --surface: #FFFFFF;
  --surface-2: #F8FAFD;
  --ink: #0F172A;
  --ink-2: #475569;
  --ink-3: #94A3B8;
  --line: #E8EDF4;
  --line-2: #EEF2F8;
  --primary: #2563EB;
  --accent: #7C3AED;
  --grad: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
  --grad-soft: linear-gradient(135deg, rgba(37,99,235,.10), rgba(124,58,237,.10));
  --ok: #10B981; --warn: #F59E0B; --bad: #EF4444; --info: #2563EB;
  --radius: 18px; --radius-sm: 12px;
  --sh-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.04);
  --sh-md: 0 4px 16px -4px rgba(15,23,42,.10);
  --sh-lg: 0 18px 48px -16px rgba(15,23,42,.18);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
  --sidebar-w: 252px;
}

* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-size: 15px; line-height: 1.55;
}
/* subtle mesh background */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 36% at 16% 0%, rgba(37,99,235,.06), transparent 70%),
    radial-gradient(36% 34% at 100% 4%, rgba(124,58,237,.06), transparent 70%);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
::selection { background: rgba(37,99,235,.16); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D7DEEA; border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #C2CCDC; }

/* ============ App shell ============ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  z-index: 50;
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.brandmark {
  position: relative; isolation: isolate;
  width: 30px; height: 30px; border-radius: 8px; background: var(--grad); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem; line-height: 1; flex: none;
  box-shadow: 0 6px 16px -6px rgba(37,99,235,.6);
}
/* Logo B — anneau d'objectif (lens) */
.brandmark::before {
  content: ""; position: absolute; inset: 13%; z-index: -1;
  border-radius: 50%; border: 1.6px solid rgba(255,255,255,.5);
}
.brandmark--sm, .nav__logo--sm { width: 22px; height: 22px; border-radius: 7px; font-size: .72rem; }
.sidebar__name { font-weight: 800; letter-spacing: .14em; font-size: .82rem; }
.sidebar__plan {
  font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: #F5F3FF; border: 1px solid rgba(124,58,237,.18);
  padding: 2px 7px; border-radius: 99px; margin-left: auto;
}
.nav-group { margin-top: 6px; }
.nav-group__label {
  font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); padding: 14px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  font-size: .88rem; font-weight: 500; color: var(--ink-2);
  transition: background .2s var(--ease), color .2s var(--ease);
  position: relative; border: 1px solid transparent;
}
.nav-item svg { width: 18px; height: 18px; flex: none; stroke-width: 1.8; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.is-active {
  background: #fff; color: var(--primary); font-weight: 600;
  border-color: var(--line); box-shadow: var(--sh-sm);
}
.nav-item.is-active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--grad);
}
.nav-item__badge { margin-left: auto; font-size: .6rem; font-weight: 700; color: #fff; background: var(--bad);
  padding: 1px 6px; border-radius: 99px; }
.nav-lock { margin-left: auto; opacity: .5; }
.sidebar__foot { margin-top: auto; padding-top: 14px; }
.upsell {
  background: linear-gradient(150deg, #0F172A, #1E1B4B); color: #fff;
  border-radius: 14px; padding: 16px; position: relative; overflow: hidden;
}
.upsell::after { content:""; position:absolute; inset:0; pointer-events: none;
  background: radial-gradient(60% 80% at 80% 0%, rgba(124,58,237,.5), transparent 70%); }
.upsell b { position: relative; font-size: .82rem; }
.upsell p { position: relative; font-size: .72rem; color: rgba(255,255,255,.7); margin: 6px 0 12px; }
.upsell .btn { position: relative; }

/* ---- Main ---- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: rgba(246,248,252,.8);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__title { font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; }
.topbar__title small { display: block; font-size: .74rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.topsearch {
  margin-left: auto; position: relative; width: min(340px, 34vw);
}
.topsearch input {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 9px 12px 9px 36px; font-size: .85rem; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.topsearch input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.topsearch svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.topbar__icon {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2); position: relative;
  transition: background .2s, color .2s;
}
.topbar__icon:hover { background: var(--surface-2); color: var(--ink); }
.topbar__icon svg { width: 18px; height: 18px; }
.topbar__icon .dot-badge { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; background: var(--bad); border-radius: 50%; border: 1.5px solid #fff; }
.avatar-btn {
  display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 6px 4px 4px;
  border-radius: 99px; border: 1px solid var(--line); background: #fff;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .76rem;
  background: var(--grad);
}
.avatar-btn span { font-size: .82rem; font-weight: 600; }

.view { padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; }
.view-enter { animation: viewIn .45s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============ Generic UI ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 600; font-size: .85rem; line-height: 1; cursor: pointer;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn--primary { color: #fff; background: var(--grad); box-shadow: 0 8px 18px -8px rgba(37,99,235,.5); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -8px rgba(37,99,235,.55); }
.btn--ghost { color: var(--ink-2); background: #fff; border-color: var(--line); }
.btn--ghost:hover { color: var(--ink); border-color: #CBD5E1; }
.btn--soft { color: var(--primary); background: rgba(37,99,235,.08); }
.btn--soft:hover { background: rgba(37,99,235,.14); }
.btn--danger { color: var(--bad); background: #fff; border-color: #FCA5A5; }
.btn--danger:hover { background: #FEF2F2; }
.btn--sm { padding: 7px 12px; font-size: .78rem; }
.btn--block { width: 100%; }
.btn--white { background: #fff; color: var(--primary); }

/* Boutons d'upsell sous la jauge — teintes punchy, curiosité & envie d'acheter */
.btn--up-pro, .btn--up-ent { color: #fff; border: 0; position: relative; overflow: hidden; font-weight: 700; letter-spacing: -.01em; }
.btn--up-pro { background: linear-gradient(120deg,#2563EB 0%,#6D28D9 100%); box-shadow: 0 8px 20px -8px rgba(79,70,229,.6); }
.btn--up-ent { background: linear-gradient(120deg,#7C3AED 0%,#DB2777 100%); box-shadow: 0 8px 20px -8px rgba(219,39,119,.55); }
.btn--up-pro:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -8px rgba(79,70,229,.7); }
.btn--up-ent:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -8px rgba(219,39,119,.62); }
.btn--up-pro .btn-arr, .btn--up-ent .btn-arr { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.btn--up-pro:hover .btn-arr, .btn--up-ent:hover .btn-arr { transform: translateX(3px); }
.btn--up-pro::after, .btn--up-ent::after { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent); transform: skewX(-18deg); transition: left .65s var(--ease); pointer-events: none; }
.btn--up-pro:hover::after, .btn--up-ent:hover::after { left: 130%; }

/* Pulse de la section Offres à l'arrivée (preuve visuelle que l'upsell a bien ouvert) */
@keyframes cardflash { 0% { box-shadow: 0 0 0 4px rgba(124,58,237,.45); border-color: var(--accent); } 100% { box-shadow: var(--sh-sm); } }
.card.flash { animation: cardflash 1.2s var(--ease); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--sh-sm); padding: 20px;
}
.card--pad-lg { padding: 24px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-h h3 { font-size: .98rem; }
.card-h .sub { font-size: .76rem; color: var(--ink-3); font-weight: 500; }
.card-h .spacer { margin-left: auto; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 700;
  padding: 3px 9px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.chip--up { background: #ECFDF5; color: #059669; }
.chip--down { background: #FEF2F2; color: #DC2626; }
.chip--violet { background: #F5F3FF; color: var(--accent); }
.chip--blue { background: #EFF6FF; color: var(--primary); }
.chip--amber { background: #FFFBEB; color: #B45309; }
.chip--gray { background: var(--line-2); color: var(--ink-2); }

.section-title { font-size: 1.05rem; margin: 6px 0 16px; }
.muted { color: var(--ink-3); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ============ Quota bar ============ */
.quota {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; align-items: center;
}
.quota__top { display: flex; align-items: baseline; gap: 10px; }
.quota__used { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.quota__used small { font-size: .85rem; font-weight: 600; color: var(--ink-3); }
.quota__label { font-size: .8rem; color: var(--ink-2); }
.quota__meta { text-align: right; font-size: .74rem; color: var(--ink-3); }
.quota__bar { grid-column: 1 / -1; height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; position: relative; }
.quota__fill { height: 100%; width: 0; border-radius: 99px; background: var(--grad); transition: width 1.1s var(--ease); position: relative; }
.quota__fill--warn { background: linear-gradient(135deg,#F59E0B,#EF4444); }
.quota__legend { grid-column: 1 / -1; display: flex; gap: 18px; font-size: .74rem; color: var(--ink-3); margin-top: 2px; }
.quota__legend b { color: var(--ink); }
.quota__pct { font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.quota__label { font-size: .82rem; color: var(--ink-2); }
.quota__label b { color: var(--ink); font-weight: 700; }
.quota__actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---- Modal recharge (espace membre) ---- */
.appmodal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15,23,42,.5); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s var(--ease); }
.appmodal.open { opacity: 1; }
.appmodal__card { position: relative; background: #fff; border-radius: 18px; max-width: 440px; width: 100%; padding: 26px; box-shadow: var(--sh-lg); }
.appmodal__card h3 { font-size: 1.25rem; }
.appmodal__close { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink-2); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.rpack { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; margin-bottom: 10px; transition: border-color .2s; }
.rpack:hover { border-color: #CBD5E1; }
.rpack--best { border-color: var(--primary); background: rgba(37,99,235,.04); }
.rpack b { font-size: 1rem; }
.rpack em { font-style: normal; display: block; font-size: .74rem; color: var(--ink-3); }
.rpack-up { margin-top: 8px; font-size: .82rem; color: var(--ink-2); text-align: center; padding-top: 14px; border-top: 1px solid var(--line-2); }

/* ============ GEO search engine ============ */
.geosearch {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 22px; padding: 30px;
  background: linear-gradient(160deg, #fff, #F8FAFF);
  box-shadow: var(--sh-md);
}
.geosearch::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 120% at 100% 0%, rgba(124,58,237,.08), transparent 60%);
}
.geosearch__eyebrow { display:inline-flex; align-items:center; gap:7px; font-size:.72rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color: var(--primary); background: rgba(37,99,235,.07); border:1px solid rgba(37,99,235,.14); padding:5px 11px; border-radius:99px; }
.geosearch h2 { font-size: 1.4rem; margin: 14px 0 4px; letter-spacing: -.025em; }
.geosearch p { color: var(--ink-2); font-size: .88rem; }
.geosearch__field { display: flex; gap: 10px; margin-top: 18px; position: relative; z-index: 1; }
.geosearch__input { flex: 1; position: relative; }
.geosearch__input svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ink-3); }
.geosearch__input input {
  width: 100%; border: 1px solid var(--line); border-radius: 13px; background: #fff;
  padding: 16px 16px 16px 46px; font-size: 1rem; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.geosearch__input input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.geosearch__examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.example-chip {
  font-size: .78rem; font-weight: 500; color: var(--ink-2); cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px;
  transition: border-color .2s, color .2s, background .2s;
}
.example-chip:hover { border-color: var(--primary); color: var(--primary); background: rgba(37,99,235,.05); }

/* ============ Dashboard widgets ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--sh-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: #DCE4F0; }
.kpi__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.kpi__ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--grad-soft); color: var(--primary); }
.kpi__ic svg { width: 16px; height: 16px; }
.kpi__name { font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.kpi__val { display: flex; align-items: baseline; gap: 8px; }
.kpi__val b { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.kpi__val small { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.kpi__foot { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: .74rem; color: var(--ink-3); }
.kpi__spark { margin-top: 12px; }

.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.gauge-wrap { position: relative; width: 200px; margin: 0 auto; }
.gauge-wrap svg { transform: rotate(-90deg); display: block; }
.gauge-bg { fill: none; stroke: var(--line-2); }
.gauge-val { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease); }
.gauge-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-num b { font-size: 3rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.gauge-num small { font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.gauge-num .gauge-tag { margin-top: 8px; font-size: .72rem; font-weight: 700; padding: 3px 12px; border-radius: 99px; }

/* spark / line svg */
.spark svg, .linechart svg { width: 100%; height: auto; display: block; }

/* engine rows */
.engine-list { display: grid; gap: 10px; }
.engine-row {
  display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line-2);
}
.engine-row:last-child { border-bottom: 0; }
.engine-id { display: flex; align-items: center; gap: 10px; }
.engine-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.engine-id b { font-size: .88rem; }
.engine-id em { font-style: normal; font-size: .72rem; color: var(--ink-3); display: block; }
.engine-bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.engine-bar i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width 1.1s var(--ease); }
.engine-score { text-align: right; min-width: 90px; }
.engine-score b { font-size: 1.05rem; font-weight: 800; }
.engine-score .chip { margin-left: 6px; }

/* ============ Radar ============ */
.radar-wrap { display: grid; grid-template-columns: 1fr 230px; gap: 24px; align-items: center; }
.radar-legend { display: grid; gap: 12px; }
.radar-leg-item { display: flex; align-items: center; gap: 10px; font-size: .84rem; }
.radar-leg-item .sw { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.radar-leg-item b { font-weight: 600; }
.radar-leg-item .share { margin-left: auto; font-weight: 700; }

/* ============ Recommendations ============ */
.rec-list { display: grid; gap: 12px; }
.rec {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: #fff;
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start;
  transition: box-shadow .25s var(--ease), border-color .25s, transform .25s var(--ease);
}
.rec:hover { box-shadow: var(--sh-md); transform: translateX(2px); }
.rec__pri {
  font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 8px; white-space: nowrap; margin-top: 2px;
}
.pri-critique { background: #FEF2F2; color: #DC2626; border: 1px solid #FCA5A5; }
.pri-elevee   { background: #FFF7ED; color: #EA580C; border: 1px solid #FED7AA; }
.pri-moyenne  { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
.pri-faible   { background: #F0FDF4; color: #16A34A; border: 1px solid #BBF7D0; }
.rec__body b { font-size: .9rem; display: block; margin-bottom: 4px; }
.rec__body p { font-size: .8rem; color: var(--ink-2); }
.rec__meta { display: flex; gap: 16px; margin-top: 10px; }
.rec__meta div { font-size: .72rem; color: var(--ink-3); }
.rec__meta b { font-size: .82rem; color: var(--ink); display: block; }
.rec__gain { text-align: right; }
.rec__gain .impact { font-size: 1.05rem; font-weight: 800; color: var(--ok); }

/* ============ Tables ============ */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 14px; font-size: .85rem; border-bottom: 1px solid var(--line-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.status-pill { font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.st-active { background: #ECFDF5; color: #059669; }
.st-limit { background: #FEF2F2; color: #DC2626; }
.st-trial { background: #FFFBEB; color: #B45309; }
.st-snapshot { background: var(--line-2); color: var(--ink-2); }

/* ============ Report / list cards ============ */
.list-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.file-card {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--sh-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.file-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.file-ic { width: 44px; height: 44px; border-radius: 11px; background: var(--grad-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.file-ic svg { width: 22px; height: 22px; }
.file-card b { font-size: .88rem; }
.file-card em { font-style: normal; font-size: .74rem; color: var(--ink-3); }
.file-card .spacer { margin-left: auto; }

/* ============ Billing ============ */
.plan-banner {
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
  border: 1px solid transparent; border-radius: 20px; padding: 26px 28px;
  background: linear-gradient(#fff,#fff) padding-box, var(--grad) border-box;
  box-shadow: 0 20px 50px -22px rgba(37,99,235,.3);
}
.plan-banner h2 { font-size: 1.5rem; }
.plan-banner .price { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.plan-banner .price small { font-size: .9rem; color: var(--ink-3); font-weight: 600; }

/* ============ Snapshot queue ============ */
.queue { max-width: 640px; margin: 30px auto; }
.queue__phase { display: flex; align-items: center; gap: 12px; padding: 11px 0; font-size: .88rem; color: var(--ink-3); transition: color .3s; }
.queue__phase.is-done { color: var(--ink); }
.queue__phase.is-active { color: var(--primary); font-weight: 600; }
.queue__tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; transition: all .3s; }
.queue__phase.is-done .queue__tick { background: var(--grad); border-color: transparent; color: #fff; }
.queue__phase.is-active .queue__tick { border-color: var(--primary); }
.queue__spin { width: 11px; height: 11px; border: 2px solid rgba(37,99,235,.3); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.queue__tick svg { width: 12px; height: 12px; }
.queue__bar { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-bottom: 20px; }
.queue__bar i { display: block; height: 100%; background: var(--grad); width: 0; transition: width .5s var(--ease); }

/* ============ Locked (gating) ============ */
.locked {
  position: relative; border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 40px; text-align: center; background: var(--surface-2);
}
.locked__ic { width: 52px; height: 52px; border-radius: 14px; background: var(--grad-soft); color: var(--primary); display: grid; place-items: center; margin: 0 auto 16px; }
.locked h3 { margin-bottom: 8px; }
.locked p { color: var(--ink-2); font-size: .88rem; max-width: 420px; margin: 0 auto 18px; }

/* ============ Settings ============ */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: .88rem; font-family: inherit; color: var(--ink); background: #fff;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.toggle-row:last-child { border-bottom: 0; }
.toggle-row b { font-size: .88rem; }
.toggle-row em { font-style: normal; font-size: .76rem; color: var(--ink-3); display: block; }
.switch { width: 42px; height: 24px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .25s; flex: none; }
.switch::after { content:""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--sh-sm); transition: transform .25s var(--ease); }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }

/* utility */
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-8 { margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.stack { display: grid; gap: 16px; }

/* dropdown menu */
.menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-lg);
  padding: 8px; z-index: 60; display: none;
}
.menu.open { display: block; animation: viewIn .2s var(--ease); }
.menu__label { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 8px 10px 4px; }
.menu__item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: .85rem; cursor: pointer; color: var(--ink-2); }
.menu__item svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--ink-3); }
.menu__item a { display: flex; align-items: center; gap: 10px; width: 100%; color: inherit; }
.menu__item a svg { width: 16px; height: 16px; flex: 0 0 auto; }
.menu__item:hover { background: var(--surface-2); color: var(--ink); }
.menu__item.is-on { color: var(--primary); font-weight: 600; }
.menu__item.is-on svg { color: var(--primary); }
.menu__sep { height: 1px; background: var(--line-2); margin: 6px 0; }

/* mobile sidebar toggle */
.menu-toggle { display: none; }
.scrim { display: none; }

/* ============ Concurrents dynamiques ============ */
.comp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.comp-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .82rem; font-weight: 500; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; padding: 6px 8px 6px 12px;
}
.comp-chip--you { background: rgba(37,99,235,.08); border-color: rgba(37,99,235,.2); color: var(--primary); font-weight: 600; padding-right: 12px; }
.comp-x {
  width: 18px; height: 18px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--line); color: var(--ink-2); font-size: .9rem; line-height: 1;
  display: grid; place-items: center; transition: background .2s, color .2s;
}
.comp-x:hover { background: #FEE2E2; color: #DC2626; }
.comp-add { display: flex; gap: 8px; }
.comp-add input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  font-family: inherit; font-size: .88rem; color: var(--ink); background: #fff;
}
.comp-add input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.comp-add input:disabled { background: var(--surface-2); color: var(--ink-3); }

/* ============ Quota upsell (alerte 80% / 100%) ============ */
.quota-upsell {
  grid-column: 1 / -1; margin-top: 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(37,99,235,.07), rgba(124,58,237,.09));
  border: 1px solid rgba(124,58,237,.18);
}
.quota-upsell__ic { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.quota-upsell__ic svg { width: 18px; height: 18px; }
.quota-upsell b { display: block; font-size: .88rem; }
.quota-upsell span { font-size: .8rem; color: var(--ink-2); }
.quota-upsell .btn { margin-left: auto; }
.quota-upsell--full { background: linear-gradient(135deg, rgba(239,68,68,.08), rgba(245,158,11,.1)); border-color: rgba(239,68,68,.25); }

/* ============ Arborescence piliers → score ============ */
.tree { padding: 8px 0 4px; }
.tree__root {
  width: max-content; margin: 0 auto 4px;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, #0F172A, #312E81);
  box-shadow: 0 18px 40px -16px rgba(37,99,235,.5);
  opacity: 0; transform: translateY(-8px); transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.tree.in .tree__root { opacity: 1; transform: none; }
.tree__root .tr-score { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.tree__root .tr-score small { font-size: .8rem; font-weight: 600; opacity: .7; }
.tree__root .tr-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.tree__root .tr-sources { font-size: .74rem; opacity: .75; border-left: 1px solid rgba(255,255,255,.2); padding-left: 14px; }
.tree__stem { width: 2px; height: 26px; margin: 0 auto; background: linear-gradient(var(--primary), rgba(124,58,237,.4)); transform-origin: top; transform: scaleY(0); transition: transform .5s var(--ease) .25s; }
.tree.in .tree__stem { transform: scaleY(1); }
.tree__pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pillar-node {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  box-shadow: var(--sh-sm); opacity: 0; transform: translateY(14px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), box-shadow .25s var(--ease);
}
.pillar-node.in { opacity: 1; transform: none; }
.pillar-node:hover { box-shadow: var(--sh-md); }
.pillar-node::before { content: ""; position: absolute; top: -16px; left: 50%; width: 2px; height: 16px; background: var(--line); transform: translateX(-50%) scaleY(0); transform-origin: bottom; transition: transform .4s var(--ease); }
.pillar-node.in::before { transform: translateX(-50%) scaleY(1); }
.pillar-node__h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pillar-node__h b { font-size: .86rem; }
.pillar-node__pts { margin-left: auto; font-size: .8rem; font-weight: 800; }
.pillar-node__bar { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin: 8px 0 12px; }
.pillar-node__bar i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .9s var(--ease) .2s; }
.st-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.s-fort { background: #10B981; } .s-moyen { background: #F59E0B; } .s-faible { background: #EF4444; }
.crit-list { display: flex; flex-wrap: wrap; gap: 6px; }
.crit {
  display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 500;
  padding: 4px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line-2);
  opacity: 0; transform: scale(.9); transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.pillar-node.in .crit { opacity: 1; transform: none; }
.crit .cdot { width: 6px; height: 6px; border-radius: 50%; }
.crit-fort { color: #047857; } .crit-fort .cdot { background: #10B981; }
.crit-moyen { color: #B45309; } .crit-moyen .cdot { background: #F59E0B; }
.crit-faible { color: #B91C1C; } .crit-faible .cdot { background: #EF4444; }
.tree-sw { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.sw-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.sw-card.forts { background: linear-gradient(160deg, rgba(16,185,129,.06), transparent); border-color: rgba(16,185,129,.25); }
.sw-card.faibles { background: linear-gradient(160deg, rgba(239,68,68,.06), transparent); border-color: rgba(239,68,68,.22); }
.sw-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sw-h b { font-size: .95rem; }
.sw-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.sw-ic svg { width: 16px; height: 16px; }
.sw-ic--ok { background: #ECFDF5; color: #059669; }
.sw-ic--bad { background: #FEF2F2; color: #DC2626; }
.sw-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-top: 1px solid rgba(15,23,42,.05); }
.sw-row:first-of-type { border-top: 0; }
.sw-row .st-dot { margin-top: 5px; }
.sw-row__b { flex: 1; min-width: 0; }
.sw-row__b b { display: block; font-size: .86rem; }
.sw-row__b em { font-style: normal; display: block; font-size: .75rem; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.sw-row__pts { font-weight: 800; font-size: .82rem; color: var(--ink-2); white-space: nowrap; }

@media (max-width: 1080px) { .tree__pillars { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tree__pillars, .tree-sw { grid-template-columns: 1fr; } .tree__root { flex-direction: column; text-align: center; gap: 6px; } .tree__root .tr-sources { border-left: 0; padding-left: 0; } }

/* ============ Auth / login ============ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth__brand {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(155deg, #0F172A 0%, #1E1B4B 55%, #312E81 100%);
  padding: 48px 56px; display: flex; flex-direction: column;
}
.auth__brand::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(45% 50% at 18% 8%, rgba(37,99,235,.45), transparent 70%), radial-gradient(40% 45% at 90% 92%, rgba(124,58,237,.45), transparent 70%); }
.auth__logo { position: relative; display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: .14em; font-size: .9rem; }
.auth__logo .brandmark { box-shadow: 0 8px 20px -6px rgba(0,0,0,.4); }
.auth__brand h1 { position: relative; font-size: 2.1rem; letter-spacing: -.03em; margin-top: auto; max-width: 420px; }
.auth__brand p.lead { position: relative; color: rgba(255,255,255,.72); margin-top: 16px; max-width: 400px; font-size: 1rem; }
.auth__feats { position: relative; display: grid; gap: 14px; margin-top: 30px; }
.auth__feat { display: flex; align-items: center; gap: 12px; font-size: .9rem; color: rgba(255,255,255,.9); }
.auth__feat span { width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.12); display: grid; place-items: center; flex: none; }
.auth__feat svg { width: 15px; height: 15px; }
.auth__quote { position: relative; margin-top: 36px; padding: 18px 20px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); font-size: .86rem; color: rgba(255,255,255,.85); }
.auth__quote b { color: #fff; }
.auth__form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.auth__card { width: 100%; max-width: 380px; }
.auth__back { font-size: .82rem; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 28px; }
.auth__back:hover { color: var(--ink); }
.auth__card h2 { font-size: 1.5rem; letter-spacing: -.02em; }
.auth__card .muted { font-size: .88rem; margin-top: 6px; margin-bottom: 26px; }
.auth__divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--ink-3); font-size: .76rem; }
.auth__divider::before, .auth__divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth__alt { text-align: center; font-size: .84rem; color: var(--ink-2); margin-top: 22px; }
.auth__alt a { color: var(--primary); font-weight: 600; }
.auth__legal { text-align: center; font-size: .72rem; color: var(--ink-3); margin-top: 28px; }
.auth__msg { font-size: .82rem; line-height: 1.4; padding: 9px 12px; border-radius: 9px; margin: 2px 0 6px; }
.auth__msg--error { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.auth__msg--ok { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }

/* ============ Responsive ============ */
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
}
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .radar-wrap { grid-template-columns: 1fr; }
  .list-grid, .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 264px; transform: translateX(-100%);
    transition: transform .3s var(--ease); box-shadow: var(--sh-lg);
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 45; }
  .menu-toggle { display: grid; }
  .topsearch { display: none; }
  .view { padding: 18px; }
  .engine-row { grid-template-columns: 120px 1fr auto; }
  .rec { grid-template-columns: auto 1fr; }
  .rec__gain { grid-column: 2; text-align: left; }
}
@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .quota { grid-template-columns: 1fr; }
  .quota__meta { text-align: left; }
  .geosearch__field { flex-direction: column; }
  .plan-banner { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Plan d'action ---- */
.pa-head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.pa-col { text-align: center; }
.pa-lbl { font-size: .74rem; color: var(--ink-3); }
.pa-num { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--ink); }
.pa-num--ok { color: #10B981; }
.pa-go { display: flex; flex-direction: column; align-items: center; color: var(--primary); font-size: .72rem; text-align: center; }
.pa-go svg { width: 24px; height: 24px; }
.pa-go b { font-size: 1.05rem; margin-top: 2px; }
.pa-prog { flex: 1; min-width: 170px; }
.pa-upsell { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, rgba(37,99,235,.06), rgba(124,58,237,.08)); border: 1px solid rgba(124,58,237,.2); border-radius: 14px; padding: 14px 18px; }
.pa-upsell__ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #fff; color: var(--accent); flex: none; }
.pa-upsell__ic svg { width: 20px; height: 20px; }
.pa-upsell__txt { flex: 1; }
.pa-upsell__txt b { display: block; font-size: .92rem; }
.pa-upsell__txt span { font-size: .8rem; color: var(--ink-2); }
.pa-status { display: flex; gap: 6px; margin-top: 12px; }
.pa-st { font: inherit; font-size: .74rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: #fff; color: var(--ink-2); border-radius: 8px; padding: 5px 11px; transition: all .2s; }
.pa-st:hover { border-color: var(--ink-3); }
.pa-st.is-on { color: #fff; border-color: transparent; }
.pa-st--todo.is-on { background: #64748B; }
.pa-st--doing.is-on { background: #F59E0B; }
.pa-st--done.is-on { background: #10B981; }
.rec--done { opacity: .6; }
.rec--done .rec__body > b { text-decoration: line-through; }

/* ---- Stubs Enterprise ---- */
.avatar--sm { width: 28px; height: 28px; font-size: .72rem; }
.api-key { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.api-key code { flex: 1; min-width: 200px; background: var(--bg-alt, #F7F9FC); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; font-family: ui-monospace, monospace; font-size: .85rem; color: var(--ink); }
.api-ep { padding: 9px 0; border-bottom: 1px solid var(--line-2, #EEF2F8); font-size: .85rem; display: flex; align-items: center; gap: 10px; }
.api-ep:last-child { border-bottom: 0; }