/*
 * Système de design commun : page principale, DevisVocal, Sentinelle, Encaisse.
 * Fichier identique sur les 4 sites ; la couleur de marque dépend de <body data-app="…">.
 */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Couleurs ---------- */
:root {
  --bg: #f7f8fa;
  --bg-alt: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --warn-border: #fcd34d;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --soon: #64748b;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, .35);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1160px;
  /* Marque par défaut (page principale) */
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-ink: #ffffff;
  --brand-soft: #eef2ff;
  --brand-text: #4338ca;
}
body[data-app="devis"] { --brand: #ea580c; --brand-2: #f59e0b; --brand-soft: #fff7ed; --brand-text: #c2410c; }
body[data-app="sentinelle"] { --brand: #059669; --brand-2: #0d9488; --brand-soft: #ecfdf5; --brand-text: #047857; }
body[data-app="encaisse"] { --brand: #4f46e5; --brand-2: #2563eb; --brand-soft: #eef2ff; --brand-text: #4338ca; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --bg-alt: #0f1523;
    --surface: #121826;
    --surface-2: #161d2d;
    --text: #e8ecf3;
    --text-2: #c3cad6;
    --muted: #8b95a7;
    --border: #232b3b;
    --border-strong: #2e3849;
    --ok: #34d399;
    --ok-bg: #0c2a22;
    --warn: #fbbf24;
    --warn-bg: #2a2110;
    --warn-border: #7a5a14;
    --danger: #f87171;
    --danger-bg: #2d1414;
    --soon: #8b95a7;
    --shadow-sm: none;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 12px 32px -16px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .8);
    --brand-soft: #1b1f3a;
    --brand-text: #a5b4fc;
  }
  body[data-app="devis"] { --brand-soft: #2b1a0e; --brand-text: #fdba74; }
  body[data-app="sentinelle"] { --brand-soft: #0c2a22; --brand-text: #6ee7b7; }
  body[data-app="encaisse"] { --brand-soft: #1b1f3a; --brand-text: #a5b4fc; }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--text); letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 3.2vw, 2rem); margin: 0 0 16px; font-weight: 700; }
h2 { font-size: 1.15rem; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 1.02rem; margin: 0; font-weight: 650; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.err { color: var(--danger); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.inline { display: inline; margin: 0; }
/* L'attribut hidden doit toujours l'emporter (les composants définissent souvent display) */
[hidden] { display: none !important; }
.icon-svg { width: 1.1em; height: 1.1em; flex: none; vertical-align: -0.18em; }
::selection { background: var(--brand); color: var(--brand-ink); }

/* ---------- En-tête public ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.05rem; color: var(--text); letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  box-shadow: 0 6px 16px -6px var(--brand);
}
.brand-mark .icon-svg { width: 18px; height: 18px; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a:not(.btn), .nav .link { color: var(--text-2); font-size: .93rem; font-weight: 500; padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.nav a:not(.btn):hover { background: var(--bg-alt); color: var(--text); }
.nav .btn { margin: 0 0 0 6px; }
@media (max-width: 640px) { .nav a.hide-sm { display: none; } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: var(--brand-ink);
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; cursor: pointer;
  text-decoration: none; margin: 4px 6px 4px 0; transition: transform .12s ease, box-shadow .15s ease, background .15s ease, filter .15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.btn:hover { filter: brightness(1.06); text-decoration: none; box-shadow: 0 6px 18px -8px var(--brand); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--surface-2); box-shadow: var(--shadow-sm); }
.btn-sm { padding: 7px 12px; font-size: .86rem; }
.btn.danger, .btn-ghost.danger { color: var(--danger); }
.btn.recording { background: var(--danger); color: #fff; animation: pulse 1.3s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--danger) 20%, transparent); } }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-text); cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ---------- Vitrine : hero ---------- */
.hero { position: relative; padding: 72px 0 56px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 620px; z-index: -1;
  background:
    radial-gradient(40% 50% at 20% 30%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%),
    radial-gradient(35% 45% at 80% 20%, color-mix(in srgb, var(--brand-2) 16%, transparent), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; color: var(--brand-text);
  background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.08; letter-spacing: -0.035em; margin-bottom: 20px; font-weight: 780; }
.gradient-text { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.14rem; color: var(--text-2); max-width: 580px; margin-bottom: 28px; line-height: 1.65; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 4px; }
.hero-note { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; color: var(--muted); font-size: .88rem; }
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-note .icon-svg { color: var(--ok); }

/* Aperçu d'interface (maquette HTML) */
.mock { position: relative; }
.mock-window {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
  overflow: hidden; transform: perspective(1400px) rotateY(-4deg) rotateX(2deg);
}
@media (max-width: 900px) { .mock-window { transform: none; } }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); display: block; }
.mock-bar span { margin-left: 10px; font-size: .78rem; color: var(--muted); }
.mock-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.mock-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: .86rem; }
.mock-row strong { font-weight: 600; }
.mock-row .muted { font-size: .78rem; }
.mock-total { display: flex; justify-content: space-between; padding: 12px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-text); font-weight: 700; }
.mock-float {
  position: absolute; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  padding: 10px 14px; font-size: .82rem; display: flex; align-items: center; gap: 10px;
}
.mock-float .dot { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.mock { padding-bottom: 34px; }
.mock-float.f1 { left: -22px; bottom: -6px; }
.mock-float.f2 { right: -14px; top: -16px; }
@media (max-width: 900px) { .mock-float.f1 { left: 8px; } .mock-float.f2 { right: 8px; } }
.wave { display: flex; align-items: center; gap: 3px; height: 26px; }
.wave i { width: 3px; border-radius: 2px; background: var(--brand); display: block; animation: wave 1.2s ease-in-out infinite; }
.wave i:nth-child(odd) { animation-delay: -.4s; } .wave i:nth-child(3n) { animation-delay: -.8s; }
@keyframes wave { 0%, 100% { height: 6px; } 50% { height: 24px; } }
@media (prefers-reduced-motion: reduce) { .wave i, .btn.recording { animation: none; height: 14px; } }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--bg-alt); color: var(--text-2); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.brand { background: var(--brand-soft); color: var(--brand-text); }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.03em; margin-bottom: 10px; font-weight: 750; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.kicker { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 8px; display: block; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm); color: var(--text);
}
a.card { transition: border-color .15s, transform .15s, box-shadow .15s; }
a.card:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.card h3 { font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .94rem; }
.card ul { margin: 4px 0 8px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.card ul li { position: relative; padding-left: 26px; color: var(--text-2); font-size: .94rem; }
.card ul li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.card .icon, .feature-icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 1.3rem;
  background: var(--brand-soft); color: var(--brand-text); margin-bottom: 6px;
}
.feature-icon .icon-svg { width: 22px; height: 22px; }
.card.featured { border: 2px solid var(--brand); box-shadow: 0 20px 50px -30px var(--brand); position: relative; }
.card.narrow { max-width: 420px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; counter-reset: step; }
.step { position: relative; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; margin-bottom: 12px;
  background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: .9rem;
}
.step h3 { margin-bottom: 6px; }
.step p { color: var(--muted); margin: 0; font-size: .94rem; }

.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; padding: 22px 0; color: var(--muted); font-size: .9rem; }
.trust span { display: inline-flex; align-items: center; gap: 8px; }
.trust .icon-svg { color: var(--brand-text); }

.grid.plans { grid-template-columns: repeat(auto-fit, minmax(270px, 380px)); justify-content: center; gap: 20px; margin-top: 8px; }
.grid.pricing { grid-template-columns: minmax(0, 420px); }
.price { font-size: 2.4rem; font-weight: 780; letter-spacing: -0.03em; margin: 4px 0 6px; }
.price small { font-size: .95rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.plan-tag { position: absolute; top: -12px; left: 22px; }

details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; padding: 16px 20px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.3rem; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: "–"; }
details > *:not(summary) { padding: 0 20px 16px; }
details p { color: var(--muted); margin: 0; }
.faq { max-width: 760px; margin: 0 auto; }

.cta-band {
  position: relative; overflow: hidden; border-radius: 22px; padding: 56px 28px; text-align: center; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 30px 60px -30px var(--brand);
}
.cta-band h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.03em; }
.cta-band p { color: rgba(255, 255, 255, .85); font-size: 1.05rem; }
.cta-band .btn { background: #fff; color: #0f172a; }

/* ---------- Pied de page ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; margin-top: 0; color: var(--muted); font-size: .88rem; background: var(--surface); }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form.wide { max-width: 780px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 550; font-size: .9rem; color: var(--text-2); }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--text-2); }
label.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
label.color input { width: 72px; height: 42px; padding: 4px; }
input, textarea, select {
  font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); width: 100%; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
input[type="checkbox"], input[type="color"], input[type="file"] { width: auto; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 0; display: flex; flex-direction: column; gap: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
legend { font-weight: 700; padding: 0 8px; color: var(--text); font-size: .95rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.form > .btn, .form > button.btn { align-self: flex-start; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); margin: 0 0 16px; border: 1px solid var(--border); background: var(--surface); font-size: .93rem; }
.flash.ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-bg); color: var(--ok); }
.flash.error { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-bg); color: var(--danger); }
.flash.warn { background: var(--warn-bg); border-color: var(--warn-border); color: var(--text); }
.banner { background: var(--brand-soft); color: var(--brand-text); border-bottom: 1px solid color-mix(in srgb, var(--brand) 20%, transparent); text-align: center; padding: 9px 16px; font-size: .88rem; font-weight: 500; }
.banner a { font-weight: 650; text-decoration: underline; }
.banner.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; padding: 3px 10px 3px 8px; border-radius: 999px; vertical-align: middle; background: var(--bg-alt); color: var(--soon); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.beta, .badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.soon { color: var(--soon); }
.badge.danger { color: var(--danger); background: var(--danger-bg); }

/* ---------- Connexion / inscription ---------- */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 48px 20px; }
.auth {
  width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 36px; box-shadow: var(--shadow);
}
.auth h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth > p.muted { margin-bottom: 22px; }
.auth .btn, .auth .form > .btn { width: 100%; align-self: stretch; margin: 6px 0 0; padding: 12px; }
.auth > p:last-child { margin: 22px 0 0; text-align: center; color: var(--muted); font-size: .92rem; }

/* ---------- Espace connecté : coque ---------- */
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
@media (min-width: 901px) {
  /* Fond de la colonne latérale sur toute la hauteur, même quand la page est longue */
  .app-shell { background: linear-gradient(to right, var(--surface) 247px, var(--border) 247px, var(--border) 248px, transparent 248px); }
}
.app-main section:not([class]) { padding: 0; margin-bottom: 20px; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; border-right: 1px solid var(--border); background: var(--surface);
}
.sidebar .brand { padding: 4px 8px 16px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-nav .link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; font-size: .92rem; font-weight: 520;
  color: var(--text-2); text-decoration: none; width: 100%; text-align: left;
}
.side-nav a:hover, .side-nav .link:hover { background: var(--bg-alt); color: var(--text); text-decoration: none; }
.side-nav a.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 620; }
.side-nav .icon-svg { width: 18px; height: 18px; opacity: .85; }
.side-cta { margin: 6px 0 10px; }
.side-cta .btn { width: 100%; margin: 0; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.app-content { min-width: 0; display: flex; flex-direction: column; }
.app-main { width: 100%; max-width: 1120px; padding: 32px 36px 48px; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; z-index: 40; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); gap: 4px; }
  .sidebar .brand { padding: 0 8px 0 0; }
  .sidebar .brand-name { display: none; }
  .side-nav { flex-direction: row; }
  .side-nav a, .side-nav .link { white-space: nowrap; padding: 8px 10px; }
  .side-cta { margin: 0; }
  .side-cta .btn { white-space: nowrap; }
  .side-foot { margin: 0; padding: 0; border: 0; flex-direction: row; }
  .side-label { display: none; }
  .app-main { padding: 22px 16px 40px; }
}
.side-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }

/* ---------- Espace connecté : composants ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 22px; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.panel > h2 { font-size: 1rem; }
.panel p:last-child { margin-bottom: 0; }
details.panel { padding: 0; }
details.panel > summary { padding: 16px 22px; }
details.panel > *:not(summary) { padding: 0 22px 20px; }
.empty { color: var(--muted); border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 32px 20px; text-align: center; margin: 0; background: var(--surface-2); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat-value { font-size: 1.65rem; font-weight: 750; letter-spacing: -0.03em; line-height: 1.2; }
.stat-value.err { color: var(--danger); }
.stat-label { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.two-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 22px; }
.two-cols section { padding: 0; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row-link {
  display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.row-link:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: var(--shadow); text-decoration: none; }
.row-link.late { border-left: 3px solid var(--danger); }
.row-main { min-width: 0; }
.row-side { text-align: right; white-space: nowrap; font-weight: 650; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.tabs { display: flex; gap: 4px; margin: 4px 0 16px; padding: 4px; background: var(--bg-alt); border-radius: 11px; width: fit-content; }
.tab { padding: 7px 14px; color: var(--muted); border-radius: 8px; font-size: .9rem; font-weight: 550; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .74rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); padding: 10px 8px; }
.table td { border-bottom: 1px solid var(--border); padding: 12px 8px; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.big { font-size: 1.1rem; font-weight: 700; }

.todo { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.apercu { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; margin-top: 10px; font-size: .9rem; }
.danger-zone { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; }
.exemple { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; overflow-x: auto; font-size: .82rem; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.share input { flex: 1; min-width: 220px; font-size: .86rem; padding: 8px 12px; background: var(--surface-2); }
.report-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.upsell { max-width: 640px; border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border)); background: linear-gradient(180deg, var(--brand-soft), var(--surface) 70%); }
.month-form { flex-direction: row; align-items: flex-end; max-width: 380px; margin-bottom: 20px; }

/* ---------- Sentinelle ---------- */
.summary { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: .9rem; }
.summary::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); }
.summary.up { background: var(--ok-bg); color: var(--ok); }
.summary.down { background: var(--danger-bg); color: var(--danger); }
.site-list { display: flex; flex-direction: column; gap: 8px; }
.site-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.site-row:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); box-shadow: var(--shadow); text-decoration: none; }
.site-row.down { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: linear-gradient(90deg, var(--danger-bg), var(--surface) 40%); }
.site-row.hors-forfait { opacity: .6; }
.site-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.site-main .badge { align-self: flex-start; }
.site-main .url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.site-metrics { display: flex; gap: 26px; flex-wrap: wrap; }
.site-metrics > span { display: flex; flex-direction: column; font-size: .92rem; font-weight: 600; min-width: 64px; font-variant-numeric: tabular-nums; }
.site-metrics .label { font-size: .68rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.exp { font-weight: 650; }
.exp.ok { color: var(--ok); } .exp.warn { color: var(--warn); } .exp.danger { color: var(--danger); }
.add-site { margin-bottom: 18px; }
.spark { width: 100%; height: 130px; display: block; }
.spark-line { fill: none; stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-down { fill: var(--danger); opacity: .45; }
.spark-legend { display: flex; justify-content: space-between; }
@media (max-width: 600px) { .site-main .url { max-width: 250px; } .site-metrics { gap: 16px; } }

/* ---------- DevisVocal ---------- */
.cat-row, .cat-head { display: grid; grid-template-columns: 1fr 90px 120px auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.cat-new { grid-template-columns: 1fr 90px 120px auto; margin-bottom: 24px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.cat-head { color: var(--muted); font-size: .76rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.cat-row input { padding: 8px 10px; }
@media (max-width: 700px) {
  .cat-row, .cat-new { grid-template-columns: 1fr 1fr; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
  .cat-row input[name="designation"], .cat-new input[name="designation"] { grid-column: 1 / -1; }
  .cat-head { display: none; }
}
.dictee { border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border)); background: linear-gradient(180deg, var(--brand-soft), var(--surface) 60%); }
.dictee { max-width: 780px; }
.dictee textarea { margin-bottom: 10px; }
.ligne { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.ligne + .ligne { margin-top: 8px; }
.ligne.a-completer { border-color: var(--warn-border); background: var(--warn-bg); }
.ligne-details { display: grid; grid-template-columns: 90px 90px 130px 100px 1fr auto; gap: 8px; align-items: end; }
.ligne-details label { font-size: .76rem; color: var(--muted); font-weight: 500; }
.ligne-details input, .ligne-details select { padding: 8px; }
.l-total { font-weight: 700; text-align: right; padding-bottom: 9px; font-variant-numeric: tabular-nums; }
.a-completer .l-total { color: var(--warn); font-weight: 600; }
.l-suppr { width: auto; margin: 0 0 2px; }
@media (max-width: 700px) { .ligne-details { grid-template-columns: 1fr 1fr; } .l-total { text-align: left; } }
.totaux { margin-left: auto; min-width: 280px; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.totaux div { display: flex; justify-content: space-between; gap: 24px; }
.totaux .grand { font-size: 1.12rem; border-top: 1px solid var(--border); padding-top: 8px; }
.sign-panel { max-width: 720px; }
.sig-label { font-size: .92rem; color: var(--text-2); }
.sig-pad { width: 100%; max-width: 600px; aspect-ratio: 3 / 1; border: 2px dashed var(--border-strong); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }
.refuse { margin-top: 12px; }

/* Document (devis / facture) : toujours sur fond « papier » */
.doc { background: #fff; color: #1a1a1a; border: 1px solid var(--border); border-radius: 12px; padding: clamp(18px, 4vw, 44px); max-width: 900px; margin: 0 auto 20px; font-size: .93rem; box-shadow: var(--shadow); }
.doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.doc-company { font-size: 1.2rem; font-weight: 750; }
.doc-meta { text-align: right; }
.doc-kind { font-size: 1.5rem; font-weight: 800; letter-spacing: .1em; color: var(--brand); }
.doc section { padding: 0; }
.doc-to { display: flex; flex-wrap: wrap; gap: 16px 40px; margin-bottom: 22px; }
.doc-to > div { background: #f5f6f8; border-radius: 10px; padding: 12px 16px; min-width: 240px; }
.doc-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: #6b7280; margin-bottom: 2px; font-weight: 650; }
.doc-title { font-size: 1.08rem; margin: 0 0 12px; color: #111; }
.doc-lines { width: 100%; border-collapse: collapse; min-width: 560px; }
.doc-lines th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; border-bottom: 2px solid #111; padding: 8px 6px; }
.doc-lines td { border-bottom: 1px solid #e5e7eb; padding: 9px 6px; vertical-align: top; }
.doc-lines .designation { width: 50%; }
.doc-totals { margin: 16px 0 16px auto; border-collapse: collapse; min-width: 280px; font-variant-numeric: tabular-nums; }
.doc-totals td { padding: 4px 6px; }
.doc-totals .grand td { font-weight: 800; font-size: 1.08rem; border-top: 2px solid #111; padding-top: 8px; }
.doc-notes { background: #f5f6f8; border-radius: 10px; padding: 12px 16px; margin: 12px 0; }
.doc-mentions { font-size: .78rem; color: #4b5563; margin-top: 20px; }
.doc-mentions p { margin: 0 0 4px; }
.doc-signature { margin-top: 24px; border-top: 1px solid #e5e7eb; padding-top: 12px; font-size: .88rem; }
.signature-box { height: 90px; border: 1px dashed #bbb; border-radius: 8px; margin-top: 8px; max-width: 320px; }
.doc-signature.signed img { max-width: 280px; display: block; margin-top: 8px; }
.doc-page { background: var(--bg-alt); }

/* ---------- Encaisse ---------- */
.pay { max-width: 560px; margin: 24px auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.pay h1 { font-size: 1.4rem; }
.pay-amount { font-size: 2.8rem; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0; font-variant-numeric: tabular-nums; }
.pay .panel { margin-top: 16px; box-shadow: none; background: var(--surface-2); }
.lettre { background: #fff; color: #1a1a1a; max-width: 800px; margin: 0 auto; padding: clamp(24px, 5vw, 64px); border: 1px solid var(--border); border-radius: 10px; line-height: 1.6; box-shadow: var(--shadow); }
.lettre-dest { margin: 32px 0 24px auto; width: fit-content; min-width: 240px; }
.lettre-lieu { text-align: right; }
.lettre-corps { margin-top: 24px; }
.editable { background: #fff4c2; border-radius: 4px; padding: 2px 4px; }

/* ---------- Rapport Sentinelle (aux couleurs de l'agence, toujours clair) ---------- */
.report-page { background: #f1f3f6; color: #1a1a1a; }
.report { --brand: #2f5bea; background: #fff; border-radius: 16px; margin-top: 28px; margin-bottom: 28px; padding: clamp(18px, 4vw, 44px); max-width: 980px; box-shadow: 0 20px 50px -30px rgba(0, 0, 0, .35); }
.report a { color: var(--brand); }
.report h1 { color: #111827; }
.report h2 { color: var(--brand); font-size: 1.1rem; margin-bottom: 10px; }
.report section { padding: 16px 0; }
.report-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 4px solid var(--brand); padding-bottom: 14px; margin-bottom: 26px; }
.report-agency { font-size: 1.4rem; font-weight: 800; color: var(--brand); letter-spacing: -0.02em; }
.report .stat { background: #f8fafc; border-color: #e5e7eb; box-shadow: none; }
.report .stat-value { color: var(--brand); }
.report .stat-label, .report .muted { color: #64748b; }
.report .table th { color: #64748b; border-color: #d1d5db; }
.report .table td { border-color: #e5e7eb; }
.report .btn-ghost { color: #111; border-color: #d1d5db; background: #fff; }
.report-foot { border-top: 1px solid #e5e7eb; padding-top: 12px; margin-top: 12px; }

/* ---------- Page principale et textes longs ---------- */
.product-card { gap: 12px; padding: 26px; }
.product-card .feature-icon { color: #fff; background: linear-gradient(135deg, var(--p1), var(--p2)); box-shadow: 0 10px 22px -12px var(--p1); }
.product-card .cta { margin-top: auto; font-weight: 650; color: var(--p1); display: inline-flex; align-items: center; gap: 6px; }
.product-card.disabled { opacity: .7; }
.prose { max-width: 760px; padding: 48px 20px 24px; margin: 0 auto; }
.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.15rem; margin-top: 34px; scroll-margin-top: 80px; }
.prose p, .prose li { color: var(--text-2); }
.prose li { margin-bottom: 4px; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 22px; box-shadow: var(--shadow-sm); }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
@media (max-width: 600px) { .toc ol { columns: 1; } }

/* ---------- Impression ---------- */
@media print {
  body, .report-page, .doc-page { background: #fff; }
  .site-header, .site-footer, .banner, .no-print, .flash, .sidebar { display: none !important; }
  .app-shell { display: block; }
  .app-main { padding: 0; max-width: none; }
  .doc, .lettre { border: 0; padding: 0; max-width: none; margin: 0; box-shadow: none; font-size: 10.5pt; }
  .doc-lines { min-width: 0; }
  .doc-lines tr, .doc-totals, .doc-signature, .stat, .table tr { break-inside: avoid; }
  .report { margin: 0; padding: 0; max-width: none; border-radius: 0; box-shadow: none; }
  .report-page .container { padding: 0; }
  .editable { background: none; padding: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 15mm; }
}
