/* =========================================================
   Bulk SMS — identité Nextcom, design « ligne directe »
   Aplats sans dégradés, menu marine uni, chiffres en chasse fixe,
   mode clair et mode sombre (html[data-theme]).
   ========================================================= */
:root {
    --bg: #F3F5F9;
    --card: #FFFFFF;
    --champ: #FFFFFF;
    --line: #E2E7EF;
    --line-forte: #C9D1DE;
    --piste: #E9EDF4;
    --survol: #F7F9FC;
    --text: #0E1A33;
    --mut: #5A6478;
    --acc: #2563EB;
    --acc-dark: #1D4ED8;
    --acc-soft: #EAF0FE;
    --anneau: rgba(37, 99, 235, .15);
    --ok: #15803D;   --ok-soft: #E9F8EF;
    --warn: #9A4A06; --warn-soft: #FFF4DC;
    --bad: #B42318;  --bad-soft: #FEEEEC;
    --neutre-soft: #EEF1F6;
    --navy: #0F2A6B;
    --menu: #0F2A6B;
    --credit: #0F2A6B;
    --jaune: #FFD84D;
    --jaune-ink: #D9A400;
    --rouge: #C2281B;
    --radius: 14px;
    --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
    --titre: Sora, Inter, sans-serif;
}
html[data-theme="sombre"] {
    color-scheme: dark;
    --bg: #0A1222; --card: #101B2E; --champ: #0C1626; --line: #1F2D45; --line-forte: #33445F; --piste: #1A263B; --survol: #13203A;
    --text: #E6ECF5; --mut: #97A4B8;
    --acc: #5B8CFF; --acc-dark: #8DB0FF; --acc-soft: #16264A; --anneau: rgba(91, 140, 255, .25);
    --ok: #4ADE80; --ok-soft: #12301F; --warn: #FBBF24; --warn-soft: #33270E; --bad: #F87171; --bad-soft: #3A1A1A; --neutre-soft: #1A263B;
    --menu: #070E1C; --credit: #13295C; --jaune-ink: #E8B820; --rouge: #F87171;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.tw {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5;
    background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
body.tw a { color: var(--acc-dark); text-decoration: none; }
body.tw a:hover { color: var(--acc); }
html[data-theme="sombre"] body.tw a:hover { color: #B5CBFF; }
h1, h2, h3 { color: var(--text); }
.tw-icon { width: 18px; height: 18px; flex-shrink: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ---------- Structure ---------- */
.tw-shell { display: flex; min-height: 100vh; }
.tw-sidebar {
    width: 248px; flex-shrink: 0; background: var(--menu);
    padding: 18px 14px 14px; display: flex; flex-direction: column; gap: 0;
    position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none;
}
html[data-theme="sombre"] .tw-sidebar { border-right: 1px solid #1B2840; }
.tw-sidebar::-webkit-scrollbar { display: none; }
.tw-brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 16px; text-decoration: none !important; }
.tw-brand-logo { width: 38px; height: 38px; flex-shrink: 0; background: #fff; border-radius: 10px; padding: 2px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.tw-brand-logo img { width: 100%; height: 100%; object-fit: contain; transform: scale(1.3); }
.tw-brand-name { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tw-brand-name b { font-family: var(--titre); font-size: 15px; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.tw-brand-name span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: #9FB4E0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tw-nav { display: flex; flex-direction: column; gap: 2px; flex: 1 0 auto; }
.tw-nav-titre { font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: #8FA6D6; margin: 14px 12px 6px; }
.tw-nav-titre:first-child { margin-top: 2px; }
.tw-nav a {
    display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 12px; border-radius: 8px;
    font-size: 13.5px; font-weight: 500; color: #C9D6F2 !important; text-decoration: none !important;
}
.tw-nav a .tw-icon { width: 18px; height: 18px; }
.tw-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff !important; }
.tw-nav a.active { background: rgba(255, 255, 255, .09); color: #fff !important; font-weight: 600; box-shadow: inset 3px 0 0 var(--jaune); }
.tw-nav-pastille { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--jaune); color: #0F2A6B; font-family: var(--mono); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* Solde : un crédit prépayé, bordure pointillée jaune */
.tw-solde { display: flex; flex-direction: column; gap: 4px; margin: 14px 0 12px; padding: 11px 12px 11px 14px; border-radius: 10px;
    background: rgba(255, 216, 77, .08); border: 1px dashed rgba(255, 216, 77, .45); text-decoration: none !important; }
.tw-solde:hover { background: rgba(255, 216, 77, .13); }
.tw-solde small { font-size: 12px; color: #C9D6F2; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tw-solde small::after { content: "+ RECHARGER"; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--jaune); }
.tw-solde b { font-family: var(--mono); font-size: 18px; font-weight: 700; letter-spacing: -.02em; color: var(--jaune); white-space: nowrap; }

.tw-user { padding: 12px 4px 0; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; align-items: center; gap: 10px; }
.tw-avatar { width: 32px; height: 32px; border-radius: 8px; background: var(--jaune); color: #0F2A6B; font-family: var(--titre); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; text-transform: uppercase; flex-shrink: 0; }
.tw-user-name { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.tw-user-name b { font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-user-name span { font-size: 12px; color: #9FB4E0; }
.tw-user form { margin: 0; }
.tw-icon-btn {
    width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
    color: var(--mut) !important; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; position: relative;
}
.tw-icon-btn:hover { color: var(--text) !important; border-color: var(--line-forte); }
.tw-icon-btn.plain { border-color: transparent; background: transparent; width: 36px; height: 36px; color: #C9D6F2 !important; }
.tw-icon-btn.plain:hover { background: rgba(255, 255, 255, .08); color: #fff !important; }

/* Contenu : en-tête simple séparé par un filet, sans bandeau coloré */
.tw-main { flex: 1; min-width: 0; padding: 28px 36px 48px; display: flex; flex-direction: column; gap: 22px; }
.tw-main > * { min-width: 0; }
.tw-topbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.tw-title { display: flex; flex-direction: column; gap: 5px; }
.tw-title h1 { margin: 0; font-family: var(--titre); font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--text); line-height: 1.2; }
.tw-title p { margin: 0; font-size: 14px; color: var(--mut); }
.tw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
/* Bouton de thème : icône du mode actif (lune en sombre, soleil en clair) */
.tw-theme-ico { display: none; line-height: 0; }
html[data-theme="sombre"] .tw-theme-sombre, html:not([data-theme="sombre"]) .tw-theme-clair { display: inline-flex; }
.tw-burger { display: none; }
.tw-backdrop { display: none; }

/* ---------- Cartes et blocs : aplats, filets, pas d'ombre portée ---------- */
.tw-card, .carte { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.carte + .carte { margin-top: 0; }
.carte h2, .tw-card h2 { margin: 0 0 12px; font-family: var(--titre); font-size: 15px; font-weight: 700; }
.tw-bloc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tw-bloc-head { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.tw-bloc-head h2 { margin: 0; font-family: var(--titre); font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.tw-bloc-head h2 .tw-icon { color: var(--acc); width: 17px; height: 17px; }
.tw-bloc-head .tw-bloc-lien { margin-left: auto; font-size: 13px; font-weight: 600; white-space: nowrap; }
.tw-bloc-body { padding: 14px 20px; }
.tw-bloc-body.flush { padding: 0; }

.grille, .deux { display: grid; gap: 20px; }
.grille { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.deux { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.tw-pile { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.deux.large { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
@media (max-width: 1199px) { .deux.large { grid-template-columns: minmax(0, 1fr); } }

/* Chiffres clés : une seule bande à cellules séparées par des filets.
   .credit = le solde, présenté comme un crédit prépayé (marine, chiffres jaunes). */
.tw-grid-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tw-kpi { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 112px; padding: 18px 20px; color: var(--text) !important; text-decoration: none !important; min-width: 0; border-left: 1px solid var(--line); }
.tw-grid-kpi > .tw-kpi:first-child { border-left: 0; }
a.tw-kpi:hover { background: var(--survol); }
.tw-kpi-top { order: -1; display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--mut); }
.tw-kpi-top .tw-icon { width: 15px; height: 15px; }
.tw-kpi-val { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; overflow: hidden; }
.tw-kpi-val b { font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; color: var(--text); }
.tw-kpi-val span { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--mut); }
.tw-kpi-foot { margin-top: auto; font-size: 12px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-kpi.credit { background: var(--credit); border-left: 0; overflow: hidden; }
/* Ondes concentriques discrètes, rappel des arcs du logo */
.tw-kpi.credit::before, .tw-kpi.credit::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; border: 9px solid rgba(255, 255, 255, .06); }
.tw-kpi.credit::before { right: -34px; top: -34px; width: 96px; height: 96px; }
.tw-kpi.credit::after { right: -78px; top: -78px; width: 184px; height: 184px; }
.tw-kpi.credit > * { position: relative; z-index: 1; }
a.tw-kpi.credit:hover { background: var(--credit); filter: brightness(1.08); }
.tw-kpi.credit + .tw-kpi { border-left: 0; }
.tw-kpi.credit .tw-kpi-top { color: #C9D6F2; }
.tw-kpi.credit .tw-kpi-val b, .tw-kpi.credit .tw-kpi-val span { color: var(--jaune); }
.tw-kpi.credit .tw-kpi-foot { color: #C9D6F2; border-top: 1px dashed rgba(255, 255, 255, .28); padding-top: 8px; }

.chiffre { font-family: var(--mono); font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
.legende, .tw-muted { color: var(--mut); font-size: 13px; }
.mono { font-family: var(--mono); }

/* ---------- Formulaires ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin: 14px 0 6px; }
input, select, textarea {
    width: 100%; min-height: 44px; padding: 9px 13px; border: 1px solid var(--line-forte); border-radius: 10px;
    background: var(--champ); color: var(--text); font: inherit; font-size: 14px;
}
input:hover, select:hover, textarea:hover { border-color: var(--mut); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--acc); box-shadow: 0 0 0 3px var(--anneau); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--acc); }
input[type=file] { padding: 9px; }
input[type=tel], input[name*=numero], textarea[name=numeros] { font-family: var(--mono); font-size: 13.5px; }
input:disabled { opacity: .7; }
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.aide { color: var(--mut); font-size: 12.5px; margin-top: 6px; }
#compteur { font-family: var(--mono); font-size: 12px; }
.erreur-champ { color: var(--bad); font-size: 13px; margin-top: 4px; }

/* ---------- Boutons ---------- */
.btn, .tw-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 17px; border-radius: 10px;
    font: inherit; font-size: 14px; font-weight: 600; text-decoration: none !important; border: 1px solid var(--acc);
    background: var(--acc); color: #fff !important; cursor: pointer; white-space: nowrap;
}
html[data-theme="sombre"] .btn, html[data-theme="sombre"] .tw-btn { background: #2F6BFF; border-color: #2F6BFF; }
.btn:hover, .tw-btn:hover { background: var(--acc-dark); border-color: var(--acc-dark); color: #fff !important; }
html[data-theme="sombre"] .btn:hover, html[data-theme="sombre"] .tw-btn:hover { background: #2559DB; border-color: #2559DB; }
.btn .tw-icon, .tw-btn .tw-icon { width: 17px; height: 17px; }
.btn.second, .tw-btn.ghost, html[data-theme="sombre"] .btn.second, html[data-theme="sombre"] .tw-btn.ghost { background: var(--card); color: var(--text) !important; border-color: var(--line-forte); }
.btn.second:hover, .tw-btn.ghost:hover, html[data-theme="sombre"] .btn.second:hover, html[data-theme="sombre"] .tw-btn.ghost:hover { background: var(--survol); border-color: var(--mut); color: var(--text) !important; }
.btn.danger, .tw-btn.danger, html[data-theme="sombre"] .btn.danger, html[data-theme="sombre"] .tw-btn.danger { background: var(--card); color: var(--bad) !important; border-color: var(--line-forte); }
.btn.danger:hover, .tw-btn.danger:hover, html[data-theme="sombre"] .btn.danger:hover, html[data-theme="sombre"] .tw-btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); color: var(--bad) !important; }
.btn.jaune, html[data-theme="sombre"] .btn.jaune { background: var(--jaune); border-color: var(--jaune); color: #0F2A6B !important; }
.btn.jaune:hover, html[data-theme="sombre"] .btn.jaune:hover { background: #F5C800; border-color: #F5C800; color: #0F2A6B !important; }
.btn.petit, .tw-btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.bloc { width: 100%; height: 48px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
form.en-ligne { display: inline; margin: 0; }

/* ---------- Alertes ---------- */
.alerte { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); font-size: 14px; background: var(--card); }
.alerte.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.alerte.ko { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.alerte.info { background: var(--acc-soft); color: var(--acc-dark); border-color: transparent; }
.alerte.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.alerte a { color: inherit !important; text-decoration: underline !important; text-underline-offset: 2px; }
.alerte > div { width: 100%; }

/* ---------- Tableaux ---------- */
.defile { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tableau { width: 100%; border-collapse: collapse; }
.tableau th { text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--mut); text-transform: uppercase; letter-spacing: .1em;
    padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: transparent; }
.tableau td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.tableau tbody tr:hover td { background: var(--survol); }
.tableau tr:last-child td { border-bottom: 0; }
.tableau td.num, .tableau td.mono { font-family: var(--mono); font-size: 13px; }
.carte > .defile { margin: 0 -22px; }
.carte > .defile .tableau th:first-child, .carte > .defile .tableau td:first-child { padding-left: 22px; }
.carte > .defile .tableau th:last-child, .carte > .defile .tableau td:last-child { padding-right: 22px; }
.carte > .defile + .pagination, .carte > .defile ~ .pagination { margin-top: 14px; }
.carte > h2 + .tableau, .carte > h2 + .defile { margin-top: 4px; }
.tw-bloc-body.flush .tableau th:first-child, .tw-bloc-body.flush .tableau td:first-child { padding-left: 20px; }
.tw-bloc-body.flush .tableau th:last-child, .tw-bloc-body.flush .tableau td:last-child { padding-right: 20px; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ligne { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ligne:last-child { border-bottom: 0; }

/* ---------- Pastilles (statuts) ---------- */
.pastille { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pastille::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pastille.ok { background: var(--ok-soft); color: var(--ok); }
.pastille.ko { background: var(--bad-soft); color: var(--bad); }
.pastille.warn { background: var(--warn-soft); color: var(--warn); }
.pastille.info { background: var(--acc-soft); color: var(--acc-dark); }
.pastille.mut { background: var(--neutre-soft); color: var(--mut); }
a.pastille { text-decoration: none !important; }

/* ---------- Choix segmentés (réseau, source…) ---------- */
.onglets { display: inline-flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; padding: 4px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.onglets label { margin: 0; display: inline-flex; gap: 8px; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 7px;
    font-size: 13px; font-weight: 500; color: var(--mut); cursor: pointer; }
.onglets label:hover { color: var(--text); }
.onglets label:has(input:checked) { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(14, 26, 51, .12); }
html[data-theme="sombre"] .onglets label:has(input:checked) { background: var(--piste); box-shadow: none; }
.onglets label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.onglets img { height: 22px; width: auto; border-radius: 5px; }
.cache { display: none !important; }

/* Choix du moyen de paiement avec logo de l'opérateur */
.reseaux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.reseau { position: relative; margin: 0; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-forte); border-radius: 12px; background: var(--card); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.reseau:hover { border-color: var(--mut); }
.reseau input { position: absolute; opacity: 0; pointer-events: none; }
.reseau:has(input:checked) { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc), 0 0 0 4px var(--anneau); }
.reseau:has(input:focus-visible) { outline: 2px solid var(--acc); outline-offset: 2px; }
.reseau img { width: 44px; height: 44px; object-fit: contain; border-radius: 9px; background: #fff; flex: none; }
.reseau span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.reseau b { font-size: 14px; }
.reseau small { font-size: 12px; color: var(--mut); font-weight: 500; }
@media (max-width: 420px) { .reseaux { grid-template-columns: 1fr; } }

/* Guide d'intégration : blocs de code et onglets de langage */
.code { margin: 8px 0 0; background: #0A1222; color: #E2E8F0; border: 1px solid #1F2D45; border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre; }
.code .c { color: #7C8BA3; }
code.inline { background: var(--acc-soft); color: var(--acc-dark); border-radius: 5px; padding: 1px 6px; font-size: 12.5px; font-family: var(--mono); }
.langues { display: inline-flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; padding: 4px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.langues button { height: 32px; padding: 0 12px; border-radius: 7px; border: 0; background: transparent; color: var(--mut); font-family: var(--mono); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.langues button.on { background: var(--card); color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(14, 26, 51, .12); }
html[data-theme="sombre"] .langues button.on { background: var(--piste); box-shadow: none; }
.methode { display: inline-block; min-width: 58px; text-align: center; border-radius: 5px; padding: 2px 8px; font-family: var(--mono); font-size: 11px; font-weight: 700; color: #fff; }
.methode.get { background: #15803D; } .methode.post { background: #2563EB; } .methode.delete { background: #B42318; }
.cle-claire { font-family: var(--mono); word-break: break-all; background: var(--card); border: 1px dashed var(--acc); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.sommaire { display: flex; gap: 8px; flex-wrap: wrap; }
.sommaire a { padding: 6px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
h3.guide { font-family: var(--titre); font-size: 15px; margin: 22px 0 6px; }
.tw-bloc-body p { margin: 8px 0; }

/* Barre d'acheminement d'une diffusion : livrés (bleu), transmis à l'opérateur (jaune, animé), échecs (rouge), annulés (gris) */
.barre-envoi { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.barre-pistes { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--piste); }
.barre-pistes .seg { display: block; height: 100%; transition: width .6s ease; }
.barre-pistes .seg[style*="width: 0%"] { display: none; }
.barre-pistes .seg.livre { background: var(--acc); }
.barre-pistes .seg.transmis { background: var(--jaune-ink); background-image: linear-gradient(90deg, transparent 0, rgba(255, 255, 255, .45) 50%, transparent 100%); background-size: 40px 100%; animation: rayures 1.4s linear infinite; }
.barre-pistes .seg.echec { background: var(--rouge); }
.barre-pistes .seg.annule { background: #A0AEC0; }
@keyframes rayures { from { background-position: -40px 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .barre-pistes .seg.transmis { animation: none; background-image: none; } }
.barre-legende { font-size: 12px; color: var(--mut); display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: center; line-height: 1.4; }
.barre-legende b { color: var(--text); font-family: var(--mono); font-weight: 700; }
.barre-legende .pt::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: 0; }
.barre-legende .pt.livre::before { background: var(--acc); }
.barre-legende .pt.echec::before { background: var(--rouge); }
.barre-legende .pt.attente::before { background: var(--jaune-ink); }
.barre-envoi.compacte { gap: 4px; }
.barre-envoi.compacte .barre-pistes { height: 4px; }
.barre-envoi.compacte .barre-legende { font-size: 11.5px; }

/* Aperçu d'un message : bulle de SMS */
.message-apercu { white-space: pre-wrap; word-break: break-word; background: var(--piste); color: var(--text); border-radius: 16px 16px 16px 4px; padding: 11px 14px; font-size: 14px; line-height: 1.5; max-width: 520px; }
/* Nouvel envoi : jauge des SMS et aperçu sur un téléphone */
.segments { display: flex; gap: 4px; margin-top: 10px; }
.segments i { flex: 1; height: 6px; border-radius: 2px; background: var(--piste); overflow: hidden; display: flex; max-width: 160px; }
.segments i b { display: block; height: 100%; background: var(--acc); transition: width .15s; }
.segments i.trop b { background: var(--rouge); }
.apercu-tel { border-radius: var(--radius); background: var(--piste); border: 1px solid var(--line); padding: 22px 18px 0; display: flex; flex-direction: column; align-items: center; gap: 14px; overflow: hidden; }
html[data-theme="sombre"] .apercu-tel { background: #0D1729; }
.apercu-titre { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); }
.tel { width: 100%; max-width: 280px; min-height: 300px; border: 10px solid #0E1A33; border-bottom: 0; border-radius: 34px 34px 0 0; background: #fff; color: #0E1A33; display: flex; flex-direction: column; }
html[data-theme="sombre"] .tel { border-color: #24324D; }
.tel-tete { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 16px 12px 12px; border-bottom: 1px solid #E8EBF0; }
.tel-avatar { width: 40px; height: 40px; border-radius: 50%; background: #DCE5F7; color: #1D4ED8; font-family: var(--titre); font-weight: 700; font-size: 16px; display: grid; place-items: center; }
.tel-tete b { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tel-tete small { font-size: 11px; color: #6B7385; }
.tel-fil { padding: 16px 14px 20px; display: flex; }
.tel-bulle { max-width: 88%; background: #ECEEF2; color: #0E1A33; font-size: 13px; line-height: 1.45; padding: 9px 12px; border-radius: 16px 16px 16px 4px; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto; }
.tel-bulle.vide { color: #6B7385; font-style: italic; }

.pagination { display: flex; gap: 4px; list-style: none; padding: 0; margin: 14px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); font-family: var(--mono); font-size: 13px; }
.pagination a:hover { border-color: var(--line-forte); background: var(--survol); }
.pagination .courant span { background: var(--acc); color: #fff; border-color: var(--acc); }
.attente { text-align: center; padding: 26px 10px; }
.rond { width: 46px; height: 46px; border: 4px solid var(--acc-soft); border-top-color: var(--acc); border-radius: 50%; margin: 0 auto 14px; animation: tourne 1s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ---------- Pages de connexion : formulaire à gauche, panneau marine Nextcom à droite ---------- */
body.tw.az-page { background: var(--card); }
.az { display: flex; min-height: 100vh; width: 100%; overflow-x: hidden; }
.az-form { flex: 1 1 56%; min-width: 0; background: var(--card); display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.az-inner { width: 100%; max-width: 400px; }
.az-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 34px; text-decoration: none !important; }
.az-brand .mk { width: 42px; height: 42px; border-radius: 11px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.az-brand .mk img { width: 42px; height: 42px; object-fit: contain; transform: scale(1.5); }
.az-brand b { font-family: var(--titre); font-weight: 700; font-size: 20px; color: var(--text); letter-spacing: -.01em; }
.az-form h1 { font-family: var(--titre); font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; line-height: 1.2; }
.az-form .sous { margin: 0 0 22px; color: var(--mut); font-size: 15px; }
.az-form input, .az-form select { min-height: 48px; border-radius: 10px; font-size: 16px; }
.az-form .btn.bloc { height: 50px; border-radius: 10px; font-weight: 700; font-size: 15px; }
.az-form .btn.second { width: 100%; }
.az-foot { margin-top: 20px; color: var(--mut); font-size: 14.5px; }
.az-foot a { font-weight: 700; }
.az-form .alerte { margin-bottom: 16px; }
.az-side { flex: 1 1 44%; position: relative; overflow: hidden; background: #0F2A6B; color: #fff; display: flex; align-items: center; justify-content: center; padding: 48px; }
html[data-theme="sombre"] .az-side { background: #0B1D4A; }
.az-side .bg1, .az-side .bg2, .az-side .dots { display: none; }
/* Ondes concentriques : rappel des arcs du logo Nextcom */
.az-side::before, .az-side::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; border: 16px solid rgba(255, 255, 255, .05); }
.az-side::before { right: -120px; top: -120px; width: 340px; height: 340px; }
.az-side::after { right: -240px; top: -240px; width: 580px; height: 580px; }
.az-side-in { position: relative; z-index: 1; max-width: 390px; }
.az-mark { width: 76px; height: 76px; border-radius: 20px; background: #fff; display: grid; place-items: center; overflow: hidden; margin-bottom: 28px; }
.az-mark img { width: 76px; height: 76px; object-fit: contain; transform: scale(1.5); }
.az-side h2 { font-family: var(--titre); font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 12px; color: #fff; }
.az-side h2 b { color: var(--jaune); font-weight: 700; }
.az-side p { margin: 0 0 26px; font-size: 15.5px; line-height: 1.6; color: #C9D6F2; }
.az-points { list-style: none; margin: 0; padding: 18px 0 0; display: flex; flex-direction: column; gap: 13px; border-top: 1px dashed rgba(255, 255, 255, .25); }
.az-points li { display: flex; align-items: center; gap: 11px; font-size: 14.5px; font-weight: 500; color: #E6ECF5; }
.az-points li svg { flex: none; width: 22px; height: 22px; padding: 4px; border-radius: 6px; background: rgba(255, 216, 77, .14); color: var(--jaune); }

/* ---------- Écrans moyens ---------- */
@media (min-width: 992px) and (max-width: 1250px) {
    .tw-sidebar { width: 220px; }
    .tw-main { padding: 22px 22px 32px; gap: 18px; }
}
@media (min-width: 1700px) {
    .tw-main { padding-left: calc((100vw - 248px - 1440px) / 2); padding-right: calc((100vw - 248px - 1440px) / 2); }
}
@media (max-width: 1100px) {
    .tw-grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tw-grid-kpi > .tw-kpi:nth-child(odd) { border-left: 0; }
    .tw-grid-kpi > .tw-kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
    .tw-kpi.credit + .tw-kpi { border-left: 1px solid var(--line); }
}

/* ---------- Tablette et téléphone : menu latéral repliable ---------- */
@media (max-width: 991px) {
    .tw-shell { display: block; }
    .tw-sidebar { position: fixed; left: 0; top: 0; z-index: 1050; transform: translateX(-100%); transition: transform .2s; }
    body.tw-menu-open .tw-sidebar { transform: none; }
    .tw-backdrop { display: block; position: fixed; inset: 0; background: rgba(10, 18, 34, .45); z-index: 1045; opacity: 0; pointer-events: none; transition: opacity .2s; }
    body.tw-menu-open .tw-backdrop { opacity: 1; pointer-events: auto; }
    .tw-burger { display: inline-flex; }
    .tw-main { padding: 16px 16px 28px; gap: 16px; }
    .tw-topbar { align-items: center; padding-bottom: 14px; }
    .tw-title h1 { font-size: 21px; }
}
@media (max-width: 920px) {
    .az { flex-direction: column; }
    .az-side { flex: none; order: -1; padding: 30px 28px; justify-content: flex-start; }
    .az-mark { width: 56px; height: 56px; border-radius: 15px; margin-bottom: 16px; }
    .az-mark img { width: 56px; height: 56px; }
    .az-side h2 { font-size: 23px; }
    .az-side p { margin-bottom: 0; }
    .az-points, .az-brand { display: none; }
    .az-form { padding: 34px 22px 44px; }
}
@media (max-width: 599px) {
    .tw-main { padding: 12px 12px 24px; gap: 14px; }
    .tw-topbar { flex-direction: column; align-items: stretch; }
    .tw-title h1 { font-size: 20px; }
    .tw-actions { width: 100%; }
    .tw-actions > .tw-btn { flex: 1 1 auto; }
    .tw-kpi { min-height: 96px; padding: 14px 14px; }
    .tw-kpi-val b { font-size: 21px; }
    .carte, .tw-card { padding: 16px; }
    .carte > .defile { margin: 0 -16px; }
    .carte > .defile .tableau th:first-child, .carte > .defile .tableau td:first-child { padding-left: 16px; }
    .carte > .defile .tableau th:last-child, .carte > .defile .tableau td:last-child { padding-right: 16px; }
    .tw-bloc-head, .tw-bloc-body { padding-left: 16px; padding-right: 16px; }
    .deux { grid-template-columns: minmax(0, 1fr); }
}
