/* TELICO GESTION – interface */
@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap; src: url("fonts/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url("fonts/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("fonts/montserrat-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 800; font-display: swap; src: url("fonts/montserrat-latin-800-normal.woff2") format("woff2"); }

:root {
  --navy: #0A2350; --navy-9: #061634; --navy-7: #15386f; --blue: #2F80ED; --blue-6: #1f6fd8; --blue-0: #eef5ff; --blue-1: #dbe9fd;
  --ink: #0f1b33; --text: #33415c; --muted: #6b7890; --line: #e3e8f1; --bg: #f4f7fb; --card: #fff;
  --ok: #16a34a; --ok-0: #e8f8ee; --warn: #d97706; --warn-0: #fff6e6; --danger: #dc2626; --danger-0: #fdecec; --wa: #25D366;
  --r: 12px; --r-lg: 16px; --sh: 0 1px 2px rgba(10,35,80,.06), 0 4px 14px rgba(10,35,80,.06); --sh-lg: 0 24px 60px -20px rgba(10,35,80,.35);
  --side: 248px; --top: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 14.5px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { color: var(--ink); margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; font-weight: 800; }
h2 { font-size: 1.02rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; margin-top: 1.2em; }
p { margin: 0 0 .8em; }
a { color: var(--blue-6); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
.warn-t { color: var(--warn); }
.ok { color: var(--ok); }
.danger { color: var(--danger); }
.clickable { cursor: pointer; }
.r, .tbl .r, .tbl th.r { text-align: right; }
code { font-size: .85em; background: var(--bg); padding: 2px 6px; border-radius: 6px; }
:focus-visible { outline: 3px solid rgba(47,128,237,.45); outline-offset: 2px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border-radius: 10px; border: 1.5px solid transparent; background: var(--blue); color: #fff; font-weight: 700; font-size: .9rem; cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .1s; text-decoration: none !important; }
.btn:hover { background: var(--blue-6); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .ic { width: 18px; height: 18px; }
.btn--ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn--ghost:hover { background: var(--blue-0); border-color: var(--blue-1); }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #b91c1c; }
.btn--danger-t { color: var(--danger); }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: #1ebe5a; }
.btn--lg { min-height: 50px; font-size: 1rem; padding: 12px 22px; }
.btn--sm { min-height: 34px; padding: 5px 12px; font-size: .82rem; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--blue-0); }
.icon-btn.sm { width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted); }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.link-btn { color: var(--blue-6); font-weight: 600; cursor: pointer; }

/* ---------- Démarrage, connexion, première configuration ---------- */
.splash { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.splash img { width: 72px; height: 72px; border-radius: 18px; }
.login, .onb { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 500px at 90% -10%, rgba(47,128,237,.35), transparent 60%), linear-gradient(160deg, var(--navy), var(--navy-9)); }
.login-card, .onb-card { width: 100%; max-width: 440px; background: #fff; border-radius: 22px; padding: 30px; box-shadow: var(--sh-lg); }
.onb-card { max-width: 920px; }
.onb-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.onb-brand img { width: 46px; height: 46px; border-radius: 12px; object-fit: contain; }
.onb-brand strong { display: block; color: var(--ink); font-size: 1.05rem; }
.onb-brand span { font-size: .78rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.onb h2 { margin-top: 22px; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--blue-6); }
.onb-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.onb-demo { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: .86rem; color: var(--muted); text-align: center; }
.users { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ucard { display: grid; justify-items: center; gap: 4px; padding: 18px 10px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; }
.ucard:hover { border-color: var(--blue); background: var(--blue-0); }
.ucard strong { color: var(--ink); font-size: .9rem; text-align: center; }
.ucard small { color: var(--muted); font-size: .74rem; }
.av { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; flex: none; }
.back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font-weight: 600; cursor: pointer; padding: 0; margin-bottom: 12px; text-decoration: none !important; }
.back .ic { width: 18px; height: 18px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 10px 0 20px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--blue-1); }
.pin-dots span.on { background: var(--navy); border-color: var(--navy); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.pinpad button { height: 58px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); font-size: 1.35rem; font-weight: 700; color: var(--ink); cursor: pointer; }
.pinpad button:active { background: var(--blue-1); }
.login-foot { margin-top: 18px; color: #c9d5ea; font-weight: 600; }

/* ---------- Structure ---------- */
.shell { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: linear-gradient(180deg, var(--navy), var(--navy-9)); color: #c9d5ea; display: flex; flex-direction: column; z-index: 40; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand img { width: 38px; height: 38px; border-radius: 10px; background: #fff; object-fit: contain; padding: 2px; }
.side-brand strong { display: block; color: #fff; font-size: .9rem; line-height: 1.25; }
.side-brand span { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: #7fb2ff; font-weight: 700; }
.side nav { flex: 1; overflow-y: auto; padding: 12px 10px; display: grid; gap: 2px; align-content: start; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #c9d5ea; font-weight: 600; font-size: .9rem; text-decoration: none; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.is-on { background: var(--blue); color: #fff; box-shadow: 0 8px 18px -10px rgba(47,128,237,.9); }
.nav-badge { margin-left: auto; font-style: normal; font-size: .7rem; font-weight: 800; background: var(--warn); color: #fff; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.nav-badge:empty { display: none; }
.side-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); display: grid; gap: 8px; font-size: .7rem; color: #8ea3c7; }
.lic-chip { font-size: .74rem; font-weight: 700; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; }
.lic-chip--expired { background: var(--danger); }
.lic-chip--active { background: rgba(22,163,74,.25); }
.main { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-shop { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-weight: 700; color: var(--navy); background: #fff; max-width: 60vw; }
.top-shop-ro { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--ink); padding: 4px; }
.user-btn .av { width: 34px; height: 34px; font-size: .85rem; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: var(--warn-0); color: #8a4b00; font-weight: 600; font-size: .88rem; }
.banner--danger { background: var(--danger-0); color: #9b1c1c; }
.view { padding: 24px; flex: 1; width: 100%; max-width: 1400px; }
.view--vendre { padding: 0; max-width: none; }
.bottom, .scrim, .only-mobile { display: none; }

/* ---------- En-têtes, barres d'outils ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar, .filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar select, .filters select, .toolbar input[type=date], .filters input[type=date] { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 10px 14px; border: 0; background: none; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; white-space: nowrap; text-decoration: none !important; }
.tab.is-on { color: var(--navy); border-color: var(--blue); }

/* ---------- Cartes, indicateurs ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--sh); margin-bottom: 18px; min-width: 0; }
.card--danger { border-color: #f5c2c2; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card h2 .ic { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; color: var(--blue); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh); min-width: 0; }
.kpi span { display: block; font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.kpi b { display: block; font-size: 1.45rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; margin: 4px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { color: var(--muted); font-size: .8rem; }
.kpis--sm .kpi b { font-size: 1.15rem; }
.kpi--navy { background: linear-gradient(150deg, var(--navy), var(--navy-7)); border-color: var(--navy); }
.kpi--navy span, .kpi--navy small { color: #9fb2d3; }
.kpi--navy b { color: #fff; }
.kpi--danger b { color: var(--danger); }
.kpi--warn b { color: var(--warn); }
.kpi--ok b { color: var(--ok); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-2.tight, .grid-3.tight { gap: 12px 14px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--bg); color: var(--muted); border: 0; white-space: nowrap; text-decoration: none !important; }
.badge .ic { width: 14px; height: 14px; }
.badge--ok { background: var(--ok-0); color: var(--ok); }
.badge--warn { background: var(--warn-0); color: var(--warn); }
.badge--danger { background: var(--danger-0); color: var(--danger); }
.badge--info { background: var(--blue-0); color: var(--blue-6); }
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--blue-0); color: var(--navy); font-size: .88rem; margin-bottom: 12px; }
.alert .ic { width: 18px; height: 18px; margin-top: 1px; }
.alert a { display: flex; gap: 10px; color: inherit; text-decoration: none; }
.alert--warn { background: var(--warn-0); color: #8a4b00; }
.alert--danger { background: var(--danger-0); color: #9b1c1c; }
.alert--ok { background: var(--ok-0); color: #146c34; }
.alert--info { background: var(--blue-0); color: var(--navy); }
p.alert { display: block; }
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.alerts .alert { margin: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li a, .list li button { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); text-align: left; cursor: pointer; text-decoration: none; }
.list li:last-child a { border-bottom: 0; }
.list li b { color: var(--ink); white-space: nowrap; }
.list--pick { max-height: 50vh; overflow-y: auto; margin: 10px 0; }
.list--pick button:hover { background: var(--blue-0); }
.list--pick strong { display: block; color: var(--ink); }
.list--pick small { color: var(--muted); }
.empty, .empty-row { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty .ic { width: 40px; height: 40px; color: var(--blue-1); margin-bottom: 8px; }
.empty-row { padding: 22px 12px; background: #fff; border: 1px dashed var(--line); border-radius: 12px; }
.empty-row.ok { color: var(--ok); border-style: solid; background: var(--ok-0); border-color: transparent; display: flex; justify-content: center; gap: 8px; }

/* ---------- Tableaux ---------- */
.tbl-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); margin-bottom: 18px; }
.card .tbl-wrap, .modal .tbl-wrap { box-shadow: none; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafcff; white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr[data-row] { cursor: pointer; }
.tbl tbody tr:hover td { background: #fafcff; }
.tbl tfoot td { font-weight: 700; color: var(--ink); background: #fafcff; border-top: 1px solid var(--line); }
.tbl strong { color: var(--ink); }
.tbl.result td { font-size: .92rem; }
.tbl.result tr.b td { font-weight: 700; color: var(--ink); background: #fafcff; }
.tbl.result tr.big td { font-size: 1.05rem; background: var(--blue-0); }
.tbl.result tr.ind td:first-child { padding-left: 30px; color: var(--muted); }
.sm-in { width: 110px; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; text-align: right; }

/* ---------- Graphiques ---------- */
.chart { display: flex; align-items: flex-end; gap: 4px; padding-top: 10px; }
.chart-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.chart-bar { width: 72%; min-height: 2px; background: linear-gradient(180deg, var(--blue), var(--navy)); border-radius: 6px 6px 2px 2px; }
.chart-col span { font-size: .66rem; color: var(--muted); }
.hbars { display: grid; gap: 12px; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; margin-bottom: 5px; }
.hbar-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-top b { color: var(--ink); white-space: nowrap; }
.hbar-track { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.hbar-track div { height: 100%; background: var(--blue); border-radius: 99px; }

/* ---------- Formulaires ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: .8rem; font-weight: 700; color: var(--ink); }
.field small { color: var(--muted); font-size: .76rem; }
.field input, .field select, .field textarea, .form input:not([type=checkbox]):not([type=radio]):not([type=file]), .form select, .form textarea { width: 100%; min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,128,237,.15); }
.field input[readonly] { background: var(--bg); }
.inline { display: flex; gap: 8px; }
.inline > input, .inline > select { flex: 1; min-width: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.switch { display: flex; align-items: center; gap: 10px; font-size: .9rem; cursor: pointer; user-select: none; }
.switch input { width: 20px; height: 20px; accent-color: var(--blue); flex: none; }
.fs { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin: 0; }
.fs legend { font-size: .8rem; font-weight: 700; color: var(--ink); padding: 0 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.sectors { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.sector { position: relative; display: grid; gap: 4px; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; background: #fff; }
.sector input { position: absolute; opacity: 0; }
.sector .ic { width: 26px; height: 26px; color: var(--blue); }
.sector strong { color: var(--ink); font-size: .9rem; }
.sector small { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.sector.is-on { border-color: var(--blue); background: var(--blue-0); box-shadow: 0 0 0 3px rgba(47,128,237,.15); }
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-prev { width: 80px; height: 80px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.empty-logo { display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.roles div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.roles strong { display: block; color: var(--ink); font-size: .85rem; }
.roles small { color: var(--muted); font-size: .78rem; }
.steps-list { padding-left: 20px; display: grid; gap: 8px; margin: 0 0 16px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .88rem; margin: 14px 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; color: var(--ink); }
.lic { display: grid; gap: 2px; padding: 14px 16px; border-radius: 12px; background: var(--blue-0); color: var(--navy); }
.lic b { font-size: 1.1rem; }
.lic--active { background: var(--ok-0); color: #146c34; }
.lic--expired { background: var(--danger-0); color: #9b1c1c; }
.plans { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.plans li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: .88rem; }
.plans strong { color: var(--ink); }
.plans span { color: var(--muted); }
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 16px; }
.acc { text-align: left; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; box-shadow: var(--sh); }
.acc span { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); }
.acc b { display: block; font-size: 1.15rem; color: var(--ink); margin-top: 2px; }
.acc.is-on { border-color: var(--blue); background: var(--blue-0); }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.notes label { display: grid; gap: 4px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.notes input { height: 40px; border: 1.5px solid var(--line); border-radius: 8px; padding: 0 10px; text-align: right; }

/* ---------- Modales et notifications ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(6,22,52,.55); opacity: 0; transition: opacity .18s; }
.modal-wrap.in { opacity: 1; }
.modal { width: 100%; max-width: 620px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: #fff; border-radius: 18px; box-shadow: var(--sh-lg); transform: translateY(12px); transition: transform .18s; }
.modal-wrap.in .modal { transform: none; }
.modal--sm { max-width: 440px; }
.modal--lg { max-width: 920px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.foot-left { margin-right: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
body.has-modal { overflow: hidden; }
#toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 460px); }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 600; font-size: .9rem; box-shadow: var(--sh-lg); opacity: 0; transform: translateY(10px); transition: all .25s; }
.toast.in { opacity: 1; transform: none; }
.toast--error { background: var(--danger); }
.toast--info { background: var(--navy-7); }
.detail-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.detail-head div { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.detail-head span { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.detail-head b { color: var(--ink); font-size: .92rem; }
.detail-pay { display: grid; gap: 6px; margin: 4px 0 12px; }
.detail-pay div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--bg); border-radius: 8px; font-size: .9rem; }
.detail-pay .warn { background: var(--warn-0); color: #8a4b00; font-weight: 700; }
.detail-pay .ok { background: var(--ok-0); color: #146c34; font-weight: 700; }
.menu-list { display: grid; gap: 4px; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; border: 0; background: none; color: var(--ink); font-weight: 600; cursor: pointer; text-align: left; text-decoration: none; }
.menu-list a:hover, .menu-list button:hover { background: var(--blue-0); }
.menu-list .ic { color: var(--blue); }
.done { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 6px 0 14px; }
.done-ic { width: 54px !important; height: 54px !important; color: #fff; background: var(--ok); border-radius: 50%; padding: 12px; }
.done b { font-size: 1.6rem; color: var(--ink); margin-top: 8px; }
.done span { color: var(--muted); font-weight: 600; }
.done-actions { display: grid; gap: 8px; }
.ret-line, .inv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ret-line span, .inv-row span { display: grid; font-weight: 600; color: var(--ink); }
.ret-line small, .inv-row small { color: var(--muted); font-weight: 500; }
.ret-line input, .inv-row input { width: 100px; height: 40px; border: 1.5px solid var(--line); border-radius: 8px; padding: 0 10px; text-align: right; flex: none; }

/* ---------- Caisse (écran Vendre) ---------- */
.pos-screen { display: grid; grid-template-columns: minmax(0, 1fr) 400px; height: calc(100vh - var(--top)); }
.pos-left { padding: 18px 20px; overflow-y: auto; }
.pos-search { position: relative; display: flex; align-items: center; }
.pos-search .ic { position: absolute; left: 14px; color: var(--muted); }
.pos-search input { width: 100%; height: 50px; padding: 0 16px 0 44px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font-size: 1rem; box-shadow: var(--sh); }
.pos-search input:focus { outline: none; border-color: var(--blue); }
.pos-search.sm input { height: 40px; font-size: .9rem; box-shadow: none; border-radius: 10px; min-width: 240px; }
.chips { display: flex; gap: 6px; margin: 14px 0; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: .84rem; color: var(--navy); cursor: pointer; white-space: nowrap; }
.chip.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.pcard { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 12px 14px; min-height: 124px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; cursor: pointer; transition: border-color .15s, transform .1s, box-shadow .15s; }
.pcard:hover { border-color: var(--blue); box-shadow: var(--sh); }
.pcard.bump { transform: scale(.97); border-color: var(--ok); }
.pcard.is-out { opacity: .55; }
.pcard-cat { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-6); }
.pcard strong { color: var(--ink); font-size: .9rem; line-height: 1.3; }
.pcard-meta { font-size: .74rem; color: var(--muted); }
.pcard-foot { margin-top: auto; display: grid; }
.pcard-foot b { color: var(--navy); font-size: .98rem; }
.pcard-foot small { font-size: .74rem; color: var(--muted); }
.pcard-foot small.low { color: var(--danger); font-weight: 700; }
.pos-cart { background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; }
.cart-head-actions { display: flex; align-items: center; gap: 8px; }
.cart-head .switch { font-size: .8rem; font-weight: 600; }
.cart-client { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cc { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--blue-0); border-radius: 10px; padding: 8px 8px 8px 12px; }
.cc strong { display: block; color: var(--ink); }
.cc small { color: var(--muted); }
.cart-lines { flex: 1; overflow-y: auto; padding: 4px 16px; }
.cline { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cline-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cline-top strong { color: var(--ink); font-size: .9rem; line-height: 1.3; }
.cline-bot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.cline-bot b { margin-left: auto; color: var(--ink); white-space: nowrap; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 32px; height: 34px; border: 0; background: var(--bg); cursor: pointer; display: grid; place-items: center; color: var(--navy); }
.qty button .ic { width: 16px; height: 16px; }
.qty input { width: 52px; height: 34px; border: 0; text-align: center; font-weight: 700; }
.x { color: var(--muted); }
.cl-price { width: 96px; height: 34px; border: 1px solid var(--line); border-radius: 8px; text-align: right; padding: 0 8px; }
.cl-price-ro { min-width: 70px; }
.cart-empty { text-align: center; color: var(--muted); padding: 50px 10px; }
.cart-empty .ic { width: 42px; height: 42px; color: var(--blue-1); }
.cart-foot { padding: 14px 16px 16px; border-top: 1px solid var(--line); background: #fafcff; }
.cart-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cart-disc { width: 130px; height: 38px; border: 1px solid var(--line); border-radius: 8px; text-align: right; padding: 0 10px; }
.cart-total { font-size: 1.2rem; font-weight: 800; color: var(--ink); }
.cart-btns { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 10px; }
.pos-cart-toggle { display: none; }
.co-total { text-align: center; background: var(--navy); color: #c9d5ea; border-radius: 14px; padding: 14px; margin-bottom: 4px; }
.co-total span { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.co-total b { display: block; color: #fff; font-size: 1.8rem; font-weight: 800; }
.co-total small { color: #9fb2d3; }
.co-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.co-m { display: grid; gap: 4px; font-size: .8rem; font-weight: 700; color: var(--ink); }
.co-m input { height: 46px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 12px; text-align: right; font-size: 1.05rem; font-weight: 700; }
.co-summary { display: grid; gap: 6px; }
.co-summary div { display: flex; justify-content: space-between; padding: 8px 12px; background: var(--bg); border-radius: 8px; }
.co-summary .ok { background: var(--ok-0); }
.co-summary .warn { background: var(--warn-0); color: #8a4b00; }
.co-summary .danger { background: var(--danger-0); }
.co-summary p { margin: 0; }
.pur-add { background: var(--bg); border-radius: 12px; padding: 12px; }

/* ---------- Mobile ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .pos-screen { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .25s; width: 280px; }
  body.side-open .side { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(6,22,52,.5); z-index: 35; }
  .main { margin-left: 0; padding-bottom: 66px; }
  .top { padding: 0 10px; gap: 8px; }
  .top-shop { max-width: 44vw; padding: 7px 8px; font-size: .85rem; }
  .top-shop-ro { font-size: .85rem; max-width: 50vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .top-right { gap: 6px; }
  .top-right .badge { padding: 3px 7px; }
  .only-mobile { display: inline-grid; }
  .hide-sm { display: none; }
  .view { padding: 16px 12px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .roles { grid-template-columns: 1fr; }
  h1 { font-size: 1.3rem; }
  .bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); height: 64px; padding-bottom: env(safe-area-inset-bottom); }
  .bottom a, .bottom button { flex: 1; display: grid; justify-items: center; align-content: center; gap: 2px; font-size: .68rem; font-weight: 700; color: var(--muted); border: 0; background: none; text-decoration: none; }
  .bottom .is-on { color: var(--blue-6); }
  .pos-screen { grid-template-columns: minmax(0, 1fr); height: auto; min-height: calc(100vh - var(--top) - 64px); }
  .pos-left { padding: 12px 12px 90px; overflow: visible; }
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-cart { position: fixed; inset: var(--top) 0 64px 0; z-index: 32; transform: translateY(110%); transition: transform .25s; border-left: 0; }
  .pos-screen.cart-open .pos-cart { transform: none; }
  .pos-cart-toggle { display: flex; align-items: center; justify-content: center; gap: 10px; position: fixed; left: 12px; right: 12px; bottom: 74px; z-index: 31; height: 54px; border: 0; border-radius: 14px; background: var(--blue); color: #fff; font-weight: 800; font-size: 1rem; box-shadow: 0 14px 30px -10px rgba(47,128,237,.8); }
  .pos-screen.cart-open .pos-cart-toggle { display: none; }
  .modal-wrap { padding: 0; align-items: end; }
  .modal { max-width: none !important; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .pos-search.sm input { min-width: 0; }
  .toolbar > * { flex: 1 1 auto; }
  .tbl th, .tbl td { padding: 10px; }
}
@media (max-width: 420px) { .kpis { grid-template-columns: 1fr 1fr; gap: 8px; } .kpi { padding: 12px; } .kpi b { font-size: 1.1rem; } }

/* ---------- Impression ---------- */
#print-area { display: none; }
@media print {
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block; }
  body { background: #fff; color: #000; }
  .ticket { width: 100%; font-family: "Courier New", monospace; font-size: 11px; line-height: 1.35; color: #000; }
  .ticket .p-head { text-align: center; display: block; }
  .ticket .p-logo { max-width: 40mm; max-height: 18mm; margin: 0 auto 4px; display: block; }
  .ticket .p-name { font-size: 13px; }
  .t-sep { border-top: 1px dashed #000; margin: 5px 0; }
  .t-row { display: flex; justify-content: space-between; gap: 6px; }
  .t-line > div:first-child { font-weight: bold; }
  .t-total { font-size: 14px; font-weight: bold; margin: 3px 0; }
  .t-foot { text-align: center; margin-top: 4px; }
  .t-powered { text-align: center; font-size: 8px; margin-top: 4px; }
  .a4 { font-family: "Montserrat", Arial, sans-serif; font-size: 10.5pt; color: #111; }
  .a4-top { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--navy); padding-bottom: 12px; margin-bottom: 14px; }
  .a4 .p-head { display: flex; gap: 12px; font-size: 9pt; color: #333; }
  .a4 .p-logo { width: 60px; height: 60px; object-fit: contain; }
  .a4 .p-name { font-size: 13pt; color: var(--navy); }
  .a4-doc { text-align: right; }
  .a4-doc h1 { font-size: 16pt; color: var(--navy); margin: 0 0 4px; }
  .a4-client { border: 1px solid #ccd; border-radius: 6px; padding: 8px 12px; margin-bottom: 14px; width: 55%; margin-left: auto; }
  .a4-client span { display: block; font-size: 8pt; text-transform: uppercase; color: #667; }
  .a4-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
  .a4-table th { background: var(--navy); color: #fff; font-size: 8.5pt; text-align: left; padding: 6px 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .a4-table td { padding: 6px 8px; border-bottom: 1px solid #dde; font-size: 9.5pt; }
  .a4-table .r { text-align: right; }
  .a4-table tfoot td { font-weight: bold; border-top: 2px solid var(--navy); }
  .a4-totals { width: 50%; margin-left: auto; display: grid; gap: 4px; }
  .a4-totals div { display: flex; justify-content: space-between; }
  .a4-grand { font-size: 13pt; font-weight: bold; color: var(--navy); border-top: 2px solid var(--navy); padding-top: 6px; }
  .a4-note { font-size: 9pt; color: #444; margin-top: 12px; }
  .a4-sign { display: flex; justify-content: space-between; margin-top: 40px; font-size: 9pt; color: #444; }
  .a4-sign div { width: 40%; border-top: 1px solid #999; padding-top: 4px; }
  .a4-foot { margin-top: 24px; text-align: center; font-size: 8pt; color: #667; }
  .a4 h3 { color: var(--navy); }
}

/* ---------- Signature TELICO et couleurs ---------- */
.sig { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; color: #8ea3c7; font: inherit; font-size: .66rem; line-height: 1.3; opacity: .85; }
.sig:hover { opacity: 1; color: #fff; }
.sig img { width: 22px; height: 22px; border-radius: 6px; }
.sig b { display: block; font-weight: 700; letter-spacing: .04em; }
.login-sig { margin-top: 18px; font-size: .72rem; color: rgba(255,255,255,.45); letter-spacing: .06em; }
.about { display: grid; justify-items: center; gap: 4px; text-align: center; }
.about img { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 6px; }
.about > strong { color: var(--ink); font-size: 1.1rem; }
.about > span { font-size: .76rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.about p { margin: 12px 0; }
.about-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; justify-items: start; }
.about-list li { display: flex; align-items: center; gap: 10px; }
.about-list .ic { color: var(--blue); width: 18px; height: 18px; }
.theme-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.color-f { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.color-f input { width: 44px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
@media print { .a4-sig { margin-top: 10px; text-align: center; font-size: 6.5pt; color: #99a; } }

/* ---------- Ventes exceptionnelles ---------- */
.cl-price-btn { min-width: 92px; height: 34px; border: 1px dashed var(--line); border-radius: 8px; background: #fff; text-align: right; padding: 0 8px; font: inherit; cursor: pointer; color: var(--ink); }
.cl-price-btn:hover { border-color: var(--blue); border-style: solid; }
.cl-price-btn.is-exc { border: 1.5px solid var(--warn); background: var(--warn-0); color: #8a4b00; font-weight: 700; }
.exc-tag { color: #8a4b00; font-weight: 600; }
.approve { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--warn-0); border: 1px solid #f5d9a8; }
.approve > strong { display: flex; align-items: center; gap: 8px; color: #8a4b00; }
.approve > strong .ic { width: 18px; height: 18px; }
.approve > small { color: #8a4b00; }
[hidden]{display:none!important}
