/* ===================================================================
   DeviW — thème Bootstrap 5.3 : bleu marine, bleu ciel, rouge, gris
   =================================================================== */
:root {
  --navy: #0F2A4E;
  --navy-2: #1D3E68;
  --sky: #2F7DC1;
  --sky-tint: #E1EFFA;
  --red: #C0392B;
  --bg: #EBEEF2;
  --bg-soft: #F7F8FA;
  --line: #D7DCE3;
  --slate: #5B6472;
  --topbar-h: 56px;

  --bs-primary: #0F2A4E;
  --bs-primary-rgb: 15, 42, 78;
  --bs-info: #2F7DC1;
  --bs-info-rgb: 47, 125, 193;
  --bs-danger: #C0392B;
  --bs-danger-rgb: 192, 57, 43;
  --bs-body-color: #1B2430;
  --bs-secondary-color: #5B6472;
  --bs-border-color: #D7DCE3;
  --bs-link-color: #2F7DC1;
  --bs-link-hover-color: #0F2A4E;
  --bs-link-color-rgb: 47, 125, 193;
  --bs-link-hover-color-rgb: 15, 42, 78;
  --bs-border-radius: .5rem;
  --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}
body { background: var(--bg); }
h1, h2, h3, h4, h5 { color: var(--navy); letter-spacing: -.01em; }
.text-navy { color: var(--navy) !important; }
.text-sky { color: var(--sky) !important; }
.bg-navy { background: var(--navy) !important; }
.bg-sky-tint { background: var(--sky-tint) !important; }

/* Boutons */
.btn-primary { --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy); --bs-btn-hover-bg: var(--navy-2); --bs-btn-hover-border-color: var(--navy-2); --bs-btn-active-bg: var(--navy-2); --bs-btn-active-border-color: var(--navy-2); --bs-btn-disabled-bg: var(--navy); --bs-btn-disabled-border-color: var(--navy); }
.btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--sky); --bs-btn-border-color: var(--sky); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #256aa6; --bs-btn-hover-border-color: #256aa6; --bs-btn-active-bg: #256aa6; --bs-btn-active-border-color: #256aa6; --bs-btn-active-color: #fff; }
.btn-outline-primary { --bs-btn-color: var(--navy); --bs-btn-border-color: var(--navy); --bs-btn-hover-bg: var(--navy); --bs-btn-hover-border-color: var(--navy); --bs-btn-active-bg: var(--navy); --bs-btn-active-border-color: var(--navy); }
.btn-danger { --bs-btn-bg: var(--red); --bs-btn-border-color: var(--red); --bs-btn-hover-bg: #a52f23; --bs-btn-hover-border-color: #a52f23; }
.btn-outline-danger { --bs-btn-color: var(--red); --bs-btn-border-color: var(--red); --bs-btn-hover-bg: var(--red); --bs-btn-hover-border-color: var(--red); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--sky); box-shadow: 0 0 0 .2rem rgba(47, 125, 193, .2); }
.form-check-input:checked { background-color: var(--sky); border-color: var(--sky); }
.form-label { font-weight: 600; font-size: .85rem; color: var(--navy); }
.form-label.req::after { content: " *"; color: var(--red); }
.card { border-color: var(--line); box-shadow: 0 1px 2px rgba(15, 42, 78, .05); }
.card-header { background: var(--bg-soft); font-weight: 600; color: var(--navy); }
.table { --bs-table-bg: transparent; }
.table > thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--slate); background: var(--bg-soft); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--sky-tint); }
.badge { font-weight: 600; }
.text-bg-info { color: #fff !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
.page-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sky); }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; font-size: 1.6rem; font-weight: 700; }
.page-head p { margin: .15rem 0 0; color: var(--slate); }

/* ---------- Barre du haut (pleine largeur, collante) ---------- */
.app-topbar { position: sticky; top: 0; z-index: 1030; height: var(--topbar-h); background: var(--navy); color: #fff; display: flex; align-items: center; gap: .5rem; padding: 0 .75rem; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.app-topbar .brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: .01em; }
.app-topbar .brand img { width: 30px; height: 30px; border-radius: 7px; background: #fff; padding: 2px; }
.app-topbar .tb-btn { color: #fff; background: transparent; border: 0; border-radius: .5rem; padding: .35rem .6rem; display: inline-flex; align-items: center; gap: .4rem; line-height: 1; }
.app-topbar .tb-btn:hover, .app-topbar .tb-btn:focus-visible, .app-topbar .tb-btn.show { background: rgba(255,255,255,.12); color: #fff; }
.app-topbar .fi, .dropdown-menu .fi { font-size: 1.1rem; line-height: 1; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.app-topbar .dropdown-menu { --bs-dropdown-border-color: var(--line); --bs-dropdown-link-active-bg: var(--sky-tint); --bs-dropdown-link-active-color: var(--navy); box-shadow: 0 8px 24px rgba(15,42,78,.18); }
.app-topbar .dropdown-item.active .bi-check2 { visibility: visible; }
.notif-badge { position: absolute; top: 2px; right: 2px; min-width: 1.1rem; height: 1.1rem; font-size: .65rem; line-height: 1.1rem; padding: 0 .25rem; border-radius: 1rem; background: var(--red); color: #fff; text-align: center; font-weight: 700; }
.user-chip { display: inline-flex; align-items: center; gap: .45rem; }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--sky); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }

/* ---------- Structure : menu latéral + contenu ---------- */
.app-shell { display: flex; align-items: stretch; min-height: calc(100vh - var(--topbar-h)); }
.app-sidebar { --bs-offcanvas-width: 260px; --bs-offcanvas-bg: #fff; }
.app-sidebar .offcanvas-header { background: var(--navy); color: #fff; }
.app-sidebar .offcanvas-header .brand { color: #fff; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.app-sidebar .offcanvas-header img { width: 28px; height: 28px; border-radius: 6px; background: #fff; padding: 2px; }
.side-nav { list-style: none; margin: 0; padding: .75rem; display: flex; flex-direction: column; gap: .2rem; width: 100%; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: .5rem; color: var(--navy); text-decoration: none; font-weight: 500; }
.side-nav a .bi { font-size: 1.1rem; color: var(--slate); }
.side-nav a:hover { background: var(--bg-soft); }
.side-nav a.active { background: var(--sky-tint); color: var(--navy); font-weight: 700; box-shadow: inset 3px 0 0 var(--sky); }
.side-nav a.active .bi { color: var(--sky); }
.app-main { flex: 1; min-width: 0; padding: 1.25rem; }
@media (min-width: 992px) {
  .app-aside { width: 240px; flex: 0 0 240px; background: #fff; border-right: 1px solid var(--line); position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
  .app-main { padding: 1.75rem 2rem; }
}
@media (max-width: 575.98px) {
  .stat-card .stat-icon { display: none; }
  .app-main { padding: 1rem .75rem; }
  .page-head h1 { font-size: 1.3rem; }
}

/* ---------- Tableau de bord ---------- */
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: .6rem; display: grid; place-items: center; background: var(--sky-tint); color: var(--sky); font-size: 1.25rem; }
.stat-card .stat-value { font-size: clamp(1.05rem, 1.5vw + .4rem, 1.5rem); font-weight: 700; color: var(--navy); line-height: 1.15; white-space: nowrap; }
.stat-card .stat-label { font-size: .78rem; color: var(--slate); text-transform: uppercase; letter-spacing: .05em; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--slate); }
.empty-state .bi { font-size: 2.2rem; color: var(--line); display: block; margin-bottom: .5rem; }
.empty-state h3 { font-size: 1.1rem; }

/* ---------- Formulaire de document ---------- */
.lines-table th, .lines-table td { vertical-align: middle; }
.lines-table .col-qty { width: 100px; }
.lines-table .col-price { width: 150px; }
.lines-table .col-total { width: 140px; text-align: right; white-space: nowrap; }
.lines-table .col-act { width: 48px; }
.totals-box { max-width: 340px; margin-left: auto; }
.totals-box .row + .row { margin-top: .35rem; }
.totals-box .grand { font-size: 1.15rem; font-weight: 700; color: var(--navy); border-top: 2px solid var(--navy); padding-top: .5rem; margin-top: .5rem; }
@media (max-width: 767.98px) {
  .lines-table thead { display: none; }
  .lines-table, .lines-table tbody, .lines-table tr, .lines-table td { display: block; width: 100%; }
  .lines-table tr { border: 1px solid var(--line); border-radius: .5rem; padding: .5rem; margin-bottom: .6rem; background: #fff; }
  .lines-table td { border: 0; padding: .2rem 0; }
  .lines-table td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; text-transform: uppercase; color: var(--slate); }
  .lines-table .col-qty, .lines-table .col-price, .lines-table .col-total, .lines-table .col-act { width: 100%; text-align: left; }
}

/* ---------- Document imprimable (aperçu devis / facture) ---------- */
.doc-wrap { overflow-x: auto; }
.doc { background: #fff; color: #111; width: 100%; max-width: 794px; margin: 0 auto; padding: 44px 48px; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(15,42,78,.08); font-size: 14px; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.doc-company { display: flex; gap: 14px; align-items: flex-start; }
.doc-company img { max-width: 150px; max-height: 100px; width: auto; height: auto; object-fit: contain; flex: 0 0 auto; }
.doc-company.logo-M img { max-width: 100px; max-height: 70px; }
.doc-company.logo-XL img { max-width: 220px; max-height: 140px; }
.doc-company .name { font-weight: 700; font-size: 1.15rem; color: var(--doc-primary, var(--navy)); }
.doc-company .meta { color: #444; }
.doc-qr { width: 110px; height: 110px; flex: 0 0 auto; }
.doc-qr img { width: 100%; height: 100%; display: block; }
.doc-meta { display: flex; justify-content: space-between; gap: 24px; margin: 28px 0 22px; }
.doc-meta .label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #666; }
.doc-title { font-weight: 800; color: #000; text-transform: uppercase; font-size: 22px; letter-spacing: .04em; margin: 0 0 10px; }
.doc table.doc-lines { width: 100%; border-collapse: collapse; }
.doc table.doc-lines th { background: var(--doc-primary, var(--navy)); color: #fff; text-align: left; padding: 8px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.doc table.doc-lines td { padding: 8px 10px; border-bottom: 1px solid #e3e6ea; vertical-align: top; }
.doc .num, .doc table.doc-lines th.num { text-align: right; white-space: nowrap; }
.doc-totals { width: 280px; margin: 16px 0 0 auto; }
.doc-totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.doc-totals .grand { border-top: 2px solid var(--doc-primary, var(--navy)); margin-top: 6px; padding-top: 8px; font-weight: 800; font-size: 16px; color: var(--doc-primary, var(--navy)); }
.doc-notes { margin-top: 26px; padding-top: 12px; border-top: 1px solid #e3e6ea; color: #333; white-space: pre-line; }
@media (max-width: 575.98px) { .doc { padding: 18px 12px; font-size: 12.5px; } .doc table.doc-lines th, .doc table.doc-lines td { padding: 6px 5px; } .doc table.doc-lines th { font-size: 10px; letter-spacing: 0; } .doc-totals { width: 100%; } .doc-head { flex-direction: column-reverse; } .doc-company.logo-L img, .doc-company.logo-XL img { max-width: 130px; max-height: 90px; } .doc-qr { align-self: flex-end; } }

/* ---------- Modèle « moderne » des devis / factures ----------
   Couleurs : --doc-primary (bandeau), --doc-accent / --doc-accent-light (dégradés), --doc-tint (lignes).
   Formes en biais faites avec des linear-gradient à arrêts nets : html2canvas (PDF) les rend, pas clip-path. */
.doc.tpl-modern { padding: 0; min-width: 640px; color: #2b2b2b; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-wrap:has(.tpl-modern) { overflow-x: auto; }
.tpl-modern .m-head { display: flex; min-height: 150px;
  background: linear-gradient(110deg, #fff 0 34%, var(--doc-accent-light) 34% 35.6%, var(--doc-accent) 35.6% 39%, var(--doc-primary) 39% 100%); }
.tpl-modern .m-brand { flex: 0 0 38%; display: flex; align-items: center; justify-content: center; padding: 18px 40px 18px 32px; }
.tpl-modern .m-brand img { max-width: 170px; max-height: 105px; object-fit: contain; }
.tpl-modern .m-brand.logo-M img { max-width: 120px; max-height: 75px; }
.tpl-modern .m-brand.logo-XL img { max-width: 200px; max-height: 125px; }
.tpl-modern .m-brand-name { font-weight: 800; font-size: 22px; color: var(--doc-accent); line-height: 1.15; text-align: center; }
.tpl-modern .m-band { flex: 1; color: #fff; text-align: right; padding: 18px 32px 16px 20px; }
.tpl-modern .m-titlerow { display: flex; justify-content: flex-end; align-items: baseline; gap: 10px; }
.tpl-modern .m-num { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.tpl-modern .m-title { font-size: 34px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 1; }
.tpl-modern .m-company { color: var(--doc-accent-light); font-weight: 800; font-size: 20px; margin-top: 8px; }
.tpl-modern .m-contact { font-size: 13px; line-height: 1.55; margin-top: 2px; }
.tpl-modern .m-location { display: flex; align-items: center; height: 34px; margin-top: 10px; }
.tpl-modern .m-loc-bar { flex: 0 0 40%; height: 100%; background: linear-gradient(110deg, var(--doc-accent) 0 70%, var(--doc-accent-light) 70% 88%, #fff 88% 100%); }
.tpl-modern .m-loc-text { flex: 1; text-align: right; padding: 0 32px; font-size: 14px; color: #333; }
.tpl-modern .m-loc-text .bi { color: var(--doc-accent); }
.tpl-modern .m-body { padding: 22px 32px 10px; }
.tpl-modern .m-parties { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.tpl-modern .m-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #555; font-weight: 600; }
.tpl-modern .m-client { color: var(--doc-accent); font-weight: 800; font-size: 17px; margin: 2px 0; }
.tpl-modern .m-dates { text-align: right; font-size: 13px; line-height: 1.7; }
.tpl-modern .m-dates .m-label { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 13px; }
.tpl-modern .m-qr { width: 92px; height: 92px; margin: 6px 0 0 auto; }
.tpl-modern table.m-lines { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 13px; }
.tpl-modern table.m-lines th { background: var(--doc-accent); color: #fff; text-transform: uppercase; font-size: 12px; letter-spacing: .04em; padding: 10px 12px; text-align: left; }
.tpl-modern table.m-lines th:last-child { background: var(--doc-accent-light); color: var(--doc-primary); }
.tpl-modern table.m-lines td { background: var(--doc-tint); padding: 10px 12px; border-left: 3px solid #fff; vertical-align: top; }
.tpl-modern table.m-lines td:first-child { border-left: 0; }
.tpl-modern table.m-lines tbody tr:nth-child(even) td { background: #f3f3f3; }
.tpl-modern .num, .tpl-modern table.m-lines th.num { text-align: right; white-space: nowrap; }
.tpl-modern .m-bottom { display: flex; justify-content: space-between; gap: 28px; margin-top: 18px; }
.tpl-modern .m-terms { flex: 1; font-size: 12px; color: #444; }
.tpl-modern .m-terms-title { font-weight: 700; color: #222; font-size: 13px; margin-bottom: 4px; }
.tpl-modern .m-terms-text { white-space: pre-line; }
.tpl-modern .m-totals { width: 300px; font-size: 13px; }
.tpl-modern .m-totals > div { display: flex; justify-content: space-between; padding: 3px 12px; }
.tpl-modern .m-totals .m-grand { margin-top: 10px; padding: 11px 12px; color: #fff; font-weight: 800; font-size: 16px;
  background: linear-gradient(90deg, var(--doc-accent) 0%, var(--doc-accent-light) 100%); }
.tpl-modern .m-sign { width: 230px; margin: 34px 0 18px auto; text-align: center; }
.tpl-modern .m-sign-line { border-bottom: 1px solid #555; height: 44px; }
.tpl-modern .m-sign-name { font-weight: 700; font-size: 13px; margin-top: 6px; }
.tpl-modern .m-sign-label { font-size: 12px; color: #666; }
.tpl-modern .m-foot { height: 28px; background: linear-gradient(110deg, var(--doc-accent) 0 44%, var(--doc-accent-light) 44% 46%, var(--doc-primary) 46% 100%); }

/* Réglages : vignettes de modèle et palettes */
.tpl-choice { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.tpl-thumb { display: block; width: 84px; height: 110px; border: 1px solid var(--line); border-radius: 6px; background: #fff; position: relative; overflow: hidden; }
.tpl-thumb i, .tpl-thumb b, .tpl-thumb s { position: absolute; left: 10%; right: 10%; display: block; }
.tpl-thumb-modern i { left: 0; right: 0; top: 0; height: 26%; background: linear-gradient(110deg, #fff 0 32%, #b87350 32% 40%, #3b2418 40% 100%); }
.tpl-thumb-modern b { top: 40%; height: 9%; background: #b87350; }
.tpl-thumb-modern s { top: 55%; height: 30%; background: repeating-linear-gradient(#e9e9e9 0 6px, #fff 6px 9px); }
.tpl-thumb-classic i { top: 8%; height: 14%; width: 30%; right: auto; background: #0f2a4e; }
.tpl-thumb-classic b { top: 40%; height: 8%; background: #0f2a4e; }
.tpl-thumb-classic s { top: 52%; height: 32%; background: repeating-linear-gradient(#fff 0 5px, #e3e6ea 5px 6px); }
.tpl-choice input:checked + .tpl-thumb { outline: 3px solid var(--sky); outline-offset: 2px; }
.preset-sw { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px; border: 1px solid rgba(0,0,0,.15); }

@media print {
  body { background: #fff; }
  .app-topbar, .app-aside, .no-print, .alert { display: none !important; }
  .app-main { padding: 0 !important; }
  .doc { border: 0; box-shadow: none; max-width: none; padding: 0; }
  .doc.tpl-modern { min-width: 0; }
  @page { margin: 10mm; }
  .doc-wrap { overflow: visible; }
}

/* ---------- Pages publiques ---------- */
.pub-nav { background: var(--navy); }
.hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 62%, #24578d 100%); color: #fff; min-height: calc(100vh - var(--topbar-h)); display: flex; align-items: center; padding: 3rem 0; }
.hero h1 { color: #fff; font-weight: 800; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1; }
.hero p.lead { color: rgba(255,255,255,.85); max-width: 34rem; }
.hero .illus { max-width: 480px; width: 100%; }
.hero .btn-light { color: var(--navy); font-weight: 600; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: .75rem; padding: 1.4rem; height: 100%; }
.feature .bi { width: 46px; height: 46px; border-radius: .7rem; background: var(--sky-tint); color: var(--sky); display: grid; place-items: center; font-size: 1.4rem; margin-bottom: .8rem; }
.pf-card { background: #fff; border: 1px solid var(--line); border-radius: .75rem; padding: 1.2rem; height: 100%; text-decoration: none; color: inherit; display: block; transition: transform .15s, box-shadow .15s; }
.pf-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,42,78,.12); color: inherit; }
.pf-logo { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--sky-tint); display: grid; place-items: center; color: var(--sky); font-weight: 700; font-size: 1.3rem; }
.pf-hero { background: linear-gradient(160deg, var(--navy), var(--navy-2)); color: #fff; padding: 3rem 0; }
.pf-hero h1 { color: #fff; font-weight: 800; }
.pf-hero .pf-logo { width: 84px; height: 84px; background: #fff; }
.pf-item img { width: 100%; height: 200px; object-fit: cover; border-radius: .6rem .6rem 0 0; }
.auth-card { max-width: 420px; width: 100%; }
.foot { color: var(--slate); font-size: .85rem; padding: 1.5rem 0; }
.logo-preview { max-width: 96px; max-height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: .5rem; padding: 4px; background: #fff; }
.item-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: .5rem; background: var(--bg-soft); }

/* ---- Abonnement / administration ---- */
.side-title { padding: 1rem 1.1rem .35rem; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.55); font-weight: 700; }
.sev-info { color: #2F7DC1; } .sev-success { color: #198754; } .sev-warning { color: #e0a800; } .sev-danger { color: #dc3545; }
.notif-item.unread { background: rgba(47,125,193,.08); }
.notif-item .bi-circle-fill { font-size: .5rem; vertical-align: middle; }
.stat-card .stat-num { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.temp-pw { font-size: 1.4rem; letter-spacing: .08em; user-select: all; }
.app-sidebar .offcanvas-body { flex-direction: column; }
.side-title { color: var(--slate, #6b7a90); }

/* Bouton WhatsApp (vert officiel) ; « pulse » = appuyer encore une fois pour ouvrir le partage */
.btn-whatsapp { --bs-btn-color: #fff; --bs-btn-bg: #25d366; --bs-btn-border-color: #25d366; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #1ebe5b; --bs-btn-hover-border-color: #1ebe5b; --bs-btn-active-bg: #19a84f; --bs-btn-active-border-color: #19a84f; --bs-btn-disabled-bg: #25d366; --bs-btn-disabled-border-color: #25d366; --bs-btn-disabled-color: #fff; }
@keyframes deviw-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .6); } 50% { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); } }
.btn-pulse { animation: deviw-pulse 1.2s ease-in-out infinite; }

/* Chat abonné ↔ équipe */
.chat-card { display: flex; flex-direction: column; height: min(70vh, 640px); }
.chat-box { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; background: var(--bg-soft, #f6f8fb); }
.chat-msg { max-width: min(80%, 34rem); }
.chat-msg.mine { align-self: flex-end; }
.chat-msg.theirs { align-self: flex-start; }
.chat-meta { font-size: .75rem; color: var(--slate, #64748b); margin: 0 .3rem .15rem; }
.chat-msg.mine .chat-meta { text-align: right; }
.chat-body { padding: .55rem .8rem; border-radius: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg.mine .chat-body { background: var(--navy, #0f2a4e); color: #fff; border-bottom-right-radius: .3rem; }
.chat-msg.theirs .chat-body { background: #fff; border: 1px solid var(--line, #e3e6ea); border-bottom-left-radius: .3rem; }
.chat-empty { margin: auto; text-align: center; }
.chat-empty .bi { font-size: 2.2rem; }
.chat-form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--line, #e3e6ea); background: #fff; }
.chat-form textarea { resize: none; }
.min-w-0 { min-width: 0; }

/* ---------- Pages d'accès : panneau d'accueil bleu + carte blanche du formulaire ---------- */
.auth-stage { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 2.5rem 1rem; background: #eef2f7; }
.auth-split { position: relative; width: 100%; max-width: 980px; display: grid; grid-template-columns: 1.1fr 1fr; overflow: hidden; border-radius: 22px;
  background: linear-gradient(135deg, #1b56a3 0%, #2f7dc1 60%, #3d93da 100%); box-shadow: 0 34px 70px -24px rgba(15, 42, 78, .55); }
.auth-split.auth-admin { background: linear-gradient(135deg, #0b1f3a 0%, #163a66 60%, #1f5fae 100%); }
.auth-split::before, .auth-split::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-split::before { width: 420px; height: 420px; left: -140px; bottom: -230px; background: rgba(255, 255, 255, .09); }
.auth-split::after { width: 560px; height: 560px; left: -220px; top: -330px; background: rgba(255, 255, 255, .05); }
.auth-hero { position: relative; z-index: 1; display: flex; align-items: center; padding: 3.5rem 3rem; color: #fff; }
.auth-hero-logo { border-radius: 14px; background: #fff; padding: 6px; margin-bottom: 1.4rem; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .4); }
.auth-welcome { color: #fff; font-weight: 800; font-size: clamp(1.8rem, 3.2vw, 2.6rem); letter-spacing: .07em; text-transform: uppercase; margin-bottom: .35rem; }
.auth-headline { font-weight: 700; font-size: .86rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1rem; opacity: .95; }
.auth-text { font-size: .93rem; line-height: 1.6; opacity: .88; max-width: 36ch; margin-bottom: 1.2rem; }
.auth-points { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.auth-points li { margin-bottom: .45rem; opacity: .95; }
.auth-points .bi { color: #9fd3ff; }
.auth-panel { position: relative; z-index: 1; display: flex; align-items: center; padding: 1.75rem; }
.auth-box { width: 100%; background: #fff; border-radius: 18px; padding: 2.4rem 2.1rem 1.6rem; box-shadow: 0 20px 44px -14px rgba(0, 0, 0, .38); }
.auth-title { font-weight: 800; font-size: 2rem; color: var(--navy); margin-bottom: .2rem; }
.auth-sub { color: #6b7a90; font-size: .88rem; margin-bottom: 1.4rem; }
.auth-box .form-label { font-size: .82rem; font-weight: 600; color: #43526a; margin-bottom: .3rem; }
.auth-box .form-control { border-radius: 10px; border-color: #d3dbe6; padding: .7rem .9rem; }
.auth-box .form-control:focus { border-color: var(--sky); box-shadow: 0 0 0 .2rem rgba(47, 125, 193, .18); }
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 5.2rem; }
.pw-toggle { position: absolute; right: .45rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--sky);
  font-weight: 700; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; padding: .35rem .5rem; border-radius: 6px; }
.pw-toggle:hover, .pw-toggle:focus-visible { background: var(--sky-tint); outline: none; }
.btn-auth { color: #fff; font-weight: 700; padding: .8rem 1rem; border: 0; border-radius: 10px; background: linear-gradient(90deg, #1b56a3, #2f7dc1);
  box-shadow: 0 10px 22px -10px rgba(27, 86, 163, .8); }
.btn-auth:hover, .btn-auth:focus-visible { color: #fff; filter: brightness(1.08); }
.auth-admin .btn-auth, .auth-admin ~ * .btn-auth { background: linear-gradient(90deg, #0b1f3a, #1f5fae); }
.auth-foot { text-align: center; font-size: .85rem; margin-top: 1.6rem; color: #6b7a90; }
.auth-foot a { font-weight: 700; }
@media (max-width: 767.98px) {
  .auth-stage { padding: 1rem .75rem 2rem; align-items: flex-start; }
  .auth-split { grid-template-columns: 1fr; border-radius: 18px; }
  .auth-hero { padding: 1.6rem 1.5rem .6rem; }
  .auth-hero-logo { width: 40px; height: 40px; margin-bottom: .8rem; }
  .auth-welcome { font-size: 1.6rem; }
  .auth-text, .auth-points { display: none; }
  .auth-panel { padding: .9rem; }
  .auth-box { padding: 1.6rem 1.25rem 1.2rem; }
  .auth-title { font-size: 1.6rem; }
}
