/* pharma — identité visuelle.
   Idée : l'étiquette de rayon et le ticket de caisse. Papier gris-vert, encre presque noire, vert « croix de pharmacie ».
   Les états de stock reprennent les codes couleur des étiquettes de rayon. Un seul élément expressif : le ticket de la caisse. */

:root {
  --paper: #f4f8f7; --surface: #ffffff; --ink: #1e293b; --ink2: #475569; --faint: #64748b;
  --line: #e2e8f0; --line2: #cbd5e1;
  --green: #0d9488; --primary: #0f766e; --primary-hi: #0b5c56; --on-primary: #ffffff; --tint: #e6f2f1; --tint2: #cde6e3;
  --warn: #b45c04; --warn-bg: #fcf1e3; --warn-dot: #d97706;
  --bad: #b91c1c; --bad-bg: #fdecec; --bad-dot: #dc2626;
  --ok: #117a38; --ok-bg: #e9f7ef;
  --mute-bg: #eef2f6;
  --r-card: 12px; --r-ctl: 8px; --r-tag: 4px;
  --f-body: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --f-head: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Menlo, monospace;
  --side-w: 15.5rem;

  --bs-body-bg: var(--surface); --bs-body-color: var(--ink); --bs-body-font-family: var(--f-body);
  --bs-border-color: var(--line); --bs-secondary-color: var(--ink2); --bs-secondary-bg: var(--mute-bg); --bs-tertiary-bg: var(--paper);
  --bs-link-color: var(--primary); --bs-link-hover-color: var(--primary-hi); --bs-link-color-rgb: 15,118,110; --bs-link-hover-color-rgb: 11,92,86;
  --bs-primary: var(--primary); --bs-primary-rgb: 15,118,110; --bs-focus-ring-color: rgba(15,118,110,.35);
  --bs-border-radius: var(--r-ctl); --bs-border-radius-lg: var(--r-card);
}
[data-bs-theme="dark"] {
  --paper: #0b1514; --surface: #111e1c; --ink: #e2ece9; --ink2: #a9bdb8; --faint: #8aa09a;
  --line: #213430; --line2: #2f4742;
  --green: #2dd4bf; --primary: #14b8a6; --primary-hi: #5eead4; --on-primary: #03201c; --tint: #14352f; --tint2: #1d4a42;
  --warn: #f3c25c; --warn-bg: #3d2f0a; --warn-dot: #f0a81c;
  --bad: #ff9d90; --bad-bg: #451a15; --bad-dot: #ff6a58;
  --ok: #7ee2ae; --ok-bg: #123b28;
  --mute-bg: #1c2b28;
  --bs-body-bg: var(--surface); --bs-body-color: var(--ink); --bs-border-color: var(--line); --bs-secondary-color: var(--ink2); --bs-tertiary-bg: var(--paper);
  --bs-link-color: var(--green); --bs-link-hover-color: #99f6e4; --bs-link-color-rgb: 45,212,191; --bs-link-hover-color-rgb: 153,246,228;
  --bs-primary-rgb: 20,184,166;
}

html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--f-body); background-color: var(--paper); background-image: radial-gradient(circle at 100% 0%, rgba(15,118,110,.05), transparent 42%), radial-gradient(circle at 0% 100%, rgba(14,116,144,.04), transparent 46%); background-attachment: fixed; color: var(--ink); font-size: .95rem; line-height: 1.5; font-feature-settings: 'tnum' 1; }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { font-family: var(--f-head); font-weight: 700; letter-spacing: -.01em; }
a { color: var(--bs-link-color); text-underline-offset: .18em; }
.text-muted, .text-body-secondary { color: var(--ink2) !important; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.ph-ico { flex: none; }
/* Motif de gélules, plaquettes et comprimés sur tout le fond de l'application (derrière les cartes) */
body.ph-app::before { content: ''; position: fixed; inset: 0; z-index: -1; background: url('../images/pills-pattern.svg') 0 0 / 260px 260px repeat; opacity: .4; pointer-events: none; }
[data-bs-theme="dark"] body.ph-app::before { filter: brightness(1.9); opacity: .4; }
@media print { body.ph-app::before { display: none; } }
.ph-skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--ink); color: var(--paper); padding: .5rem .9rem; border-radius: 0 0 var(--r-ctl) 0; }
.ph-skip:focus { left: 0; }

/* ---------- Structure : menu latéral + contenu ---------- */
.ph-shell { display: block; min-height: 100vh; }
@media (min-width: 992px) { .ph-shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); } }
.ph-side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; width: min(18rem, 86vw); }
@media (min-width: 992px) { .ph-side { position: sticky; top: 0; height: 100vh; width: auto; } }
.ph-side__head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1rem 1rem 1.1rem; }
.ph-brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); min-width: 0; }
.ph-brand:hover { color: var(--ink); }
.ph-brand__txt { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.ph-brand__txt b { font: 800 1.3rem/1 var(--f-head); letter-spacing: -.02em; }
.ph-brand__txt small { font-size: .74rem; color: var(--ink2); margin-top: .22rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 10.5rem; }
.ph-nav { display: flex; flex-direction: column; gap: 2px; padding: .4rem .7rem; overflow-y: auto; }
.ph-nav__a { display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: var(--r-ctl); color: var(--ink2); text-decoration: none; font-weight: 500; }
.ph-nav__a:hover { background: var(--paper); color: var(--ink); }
.ph-nav__a.is-on { background: var(--tint); color: var(--primary); font-weight: 600; }
.ph-nav__a.is-on .ph-ico { color: var(--green); }
.ph-body { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
/* Barre du haut */
.ph-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .6rem; height: 3.6rem; padding: 0 1rem; background: var(--surface); border-bottom: 1px solid var(--line); }
@media (min-width: 992px) { .ph-top { padding: 0 1.75rem; } }
.ph-top__burger, .ph-top__icon { border: 0; background: none; color: var(--ink2); width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: var(--r-ctl); }
.ph-top__burger:hover, .ph-top__icon:hover { background: var(--paper); color: var(--ink); }
.ph-top__ph { font: 600 .95rem var(--f-head); color: var(--ink2); align-items: center; gap: .55rem; }
.ph-top__logo { height: 1.9rem; max-width: 5.5rem; width: auto; object-fit: contain; border-radius: 4px; }
.ph-top__right { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.ph-top .ph-brand { margin-right: auto; }
.ph-top .ph-brand__txt b { font-size: 1.15rem; }
.ph-user { display: flex; align-items: center; gap: .6rem; border: 0; background: none; padding: .25rem .5rem .25rem .3rem; border-radius: 999px; color: var(--ink); }
.ph-user:hover, .ph-user[aria-expanded="true"] { background: var(--paper); }
.ph-user__av { width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font: 700 .82rem var(--f-head); letter-spacing: .02em; overflow: hidden; }
.ph-user__av img, .ph-menu__av img, .ph-avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-user__txt { flex-direction: column; text-align: left; line-height: 1.2; min-width: 0; }
.ph-user__txt b { font-weight: 600; font-size: .88rem; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-user__txt small { color: var(--ink2); font-size: .75rem; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-user__chev { color: var(--ink2); }
.ph-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--line2); --bs-dropdown-border-radius: 12px; --bs-dropdown-link-color: var(--ink); --bs-dropdown-link-hover-bg: var(--paper); --bs-dropdown-link-active-bg: var(--tint); --bs-dropdown-divider-bg: var(--line); min-width: 15rem; padding: .4rem; box-shadow: 0 16px 36px -14px rgba(19,32,26,.35); margin-top: .4rem !important; }
.ph-menu__who { display: flex; align-items: center; gap: .65rem; padding: .45rem .7rem .55rem; line-height: 1.25; }
.ph-menu__who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ph-menu__av { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font: 700 .85rem var(--f-head); overflow: hidden; flex: none; }
.ph-menu__who small { color: var(--ink2); }
.ph-menu .dropdown-item { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border-radius: var(--r-ctl); font-size: .92rem; }
.ph-menu .dropdown-item .ph-ico { width: 18px; height: 18px; color: var(--ink2); }
.ph-menu__out, .ph-menu__out .ph-ico { color: var(--bad) !important; }
.ph-main { flex: 1; width: 100%; padding: 1.4rem 1.25rem 3rem; }
@media (min-width: 992px) { .ph-main { padding: 1.75rem 1.75rem 3rem; } }
@media (max-width: 991.98px) { .ph-main { padding-bottom: 6rem; } }
.ph-foot { text-align: left; font-size: .78rem; color: var(--faint); padding: 1rem 1.25rem 1.2rem; }
@media (min-width: 992px) { .ph-foot { padding: 1rem 1.75rem 1.4rem; } }
@media (max-width: 991.98px) { .ph-foot { padding-bottom: 5.5rem; } }
.ph-foot a { color: inherit; }
.ph-banner { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; justify-content: space-between; background: var(--warn-bg); color: var(--warn); padding: .6rem 1.25rem; font-size: .9rem; border-bottom: 1px solid color-mix(in srgb, var(--warn-dot) 35%, transparent); }
.ph-banner--warn { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad-dot) 35%, transparent); }
.ph-banner a { font-weight: 700; color: inherit; }

/* Barre d'accès rapide (téléphone) */
.ph-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-top: 1px solid var(--line); padding: .25rem .25rem calc(.25rem + env(safe-area-inset-bottom)); }
.ph-tabs__a { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .35rem .1rem; border: 0; background: none; color: var(--ink2); font-size: .72rem; font-weight: 500; text-decoration: none; border-radius: var(--r-ctl); }
.ph-tabs__a.is-on { color: var(--primary); font-weight: 700; background: var(--tint); }

/* ---------- Composants ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.65rem; margin: 0; font-weight: 800; letter-spacing: -.02em; }
.ph-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.1rem 1.25rem; }
.ph-card > h2, .ph-card > .h5 { font-size: 1rem; margin-bottom: .85rem; }
.card { --bs-card-bg: var(--surface); --bs-card-border-color: var(--line); --bs-card-border-radius: var(--r-card); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.btn { --bs-btn-border-radius: var(--r-ctl); --bs-btn-font-weight: 600; --bs-btn-padding-y: .45rem; --bs-btn-padding-x: .95rem; }
.btn-lg { --bs-btn-padding-y: .7rem; --bs-btn-font-size: 1.05rem; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-color: var(--on-primary); --bs-btn-hover-bg: var(--primary-hi); --bs-btn-hover-border-color: var(--primary-hi); --bs-btn-hover-color: var(--on-primary); --bs-btn-active-bg: var(--primary-hi); --bs-btn-active-border-color: var(--primary-hi); --bs-btn-active-color: var(--on-primary); --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); --bs-btn-disabled-color: var(--on-primary); --bs-btn-focus-shadow-rgb: 15,118,110; }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-hover-color: var(--on-primary); --bs-btn-active-bg: var(--primary); --bs-btn-active-border-color: var(--primary); --bs-btn-active-color: var(--on-primary); }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--green); --bs-btn-border-color: var(--green); }
.btn-outline-secondary { --bs-btn-color: var(--ink2); --bs-btn-border-color: var(--line2); --bs-btn-hover-bg: var(--paper); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--line2); --bs-btn-active-bg: var(--paper); --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: var(--line2); }
.form-control, .form-select { border-color: var(--line2); background-color: var(--surface); color: var(--ink); }
.form-control:focus, .form-select:focus { border-color: var(--green); box-shadow: 0 0 0 .2rem rgba(15,118,110,.22); background-color: var(--surface); color: var(--ink); }
.form-control::placeholder { color: var(--faint); }
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .3rem; }
.input-group-text { background: var(--paper); border-color: var(--line2); color: var(--ink2); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.alert { border-radius: var(--r-ctl); border-width: 1px; }
.alert-success { --bs-alert-bg: var(--ok-bg); --bs-alert-color: var(--ok); --bs-alert-border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.alert-danger { --bs-alert-bg: var(--bad-bg); --bs-alert-color: var(--bad); --bs-alert-border-color: color-mix(in srgb, var(--bad-dot) 40%, transparent); }
.alert-warning { --bs-alert-bg: var(--warn-bg); --bs-alert-color: var(--warn); --bs-alert-border-color: color-mix(in srgb, var(--warn-dot) 45%, transparent); }
.modal-content { border-color: var(--line); border-radius: var(--r-card); background: var(--surface); }
.nav-tabs { --bs-nav-tabs-link-active-bg: var(--surface); --bs-nav-tabs-link-active-border-color: var(--line) var(--line) var(--surface); --bs-nav-tabs-border-color: var(--line); }
.nav-tabs .nav-link { color: var(--ink2); font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--ink); font-weight: 600; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--primary); --bs-nav-pills-link-active-color: var(--on-primary); --bs-nav-link-color: var(--ink2); --bs-nav-link-hover-color: var(--ink); }
.nav-pills .nav-link { font-weight: 500; }
.nav-pills .nav-link.active { font-weight: 600; }
.pagination { --bs-pagination-color: var(--ink2); --bs-pagination-active-bg: var(--primary); --bs-pagination-active-border-color: var(--primary); --bs-pagination-active-color: var(--on-primary); --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--line); --bs-pagination-hover-bg: var(--paper); }

/* Tableaux */
.table { --bs-table-bg: transparent; --bs-table-border-color: var(--line); --bs-table-hover-bg: color-mix(in srgb, var(--tint) 55%, transparent); --bs-table-color: var(--ink); }
.table > :not(caption) > * > * { padding: .68rem .8rem; }
.table-sm > :not(caption) > * > * { padding: .5rem .6rem; }
.table th { font-size: .8rem; font-weight: 600; color: var(--ink2); white-space: nowrap; border-bottom: 1px solid var(--line2); background: transparent; }
.ph-card:not(.p-0) .table td:first-child, .ph-card:not(.p-0) .table th:first-child { padding-left: 0; }
.ph-card:not(.p-0) .table td:last-child, .ph-card:not(.p-0) .table th:last-child { padding-right: 0; }
.table a:not(.btn) { text-decoration: none; }
.table a:not(.btn):hover { text-decoration: underline; }
.ph-card.p-0 .table td:first-child, .ph-card.p-0 .table th:first-child { padding-left: 1.25rem; }
.ph-card.p-0 .table td:last-child, .ph-card.p-0 .table th:last-child { padding-right: 1.25rem; }
.table tbody tr:last-child > * { border-bottom-width: 0; }
.table-responsive { border-radius: var(--r-card); }

/* Pastilles de chiffres des pages secondaires (stock, ventes, rapports, fiche produit) */
.ph-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: .95rem 1.1rem; height: 100%; display: block; text-decoration: none; color: inherit; }
.ph-stat small { color: var(--ink2); display: block; font-size: .84rem; font-weight: 500; }
.ph-stat b { display: block; font: 800 1.5rem/1.2 var(--f-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.ph-stat--warn b { color: var(--warn); } .ph-stat--danger b { color: var(--bad); }
a.ph-stat:hover { border-color: var(--green); color: inherit; }

/* Étiquettes d'état : un carré de couleur + le mot, comme sur un rayon */
.badge-soft { display: inline-flex; align-items: center; gap: .4em; padding: .18em .55em .18em .45em; border-radius: var(--r-tag); font-weight: 600; font-size: .76rem; line-height: 1.35; white-space: nowrap; }
.badge-soft::before { content: ''; width: .5em; height: .5em; border-radius: 2px; background: currentColor; flex: none; }
.bs-ok { background: var(--ok-bg); color: var(--ok); } .bs-warn { background: var(--warn-bg); color: var(--warn); } .bs-bad { background: var(--bad-bg); color: var(--bad); } .bs-mute { background: var(--mute-bg); color: var(--ink2); }
.bs-warn::before { background: var(--warn-dot); } .bs-bad::before { background: var(--bad-dot); } .bs-ok::before { background: var(--green); } .bs-mute::before { background: var(--faint); }
.rx { display: inline-block; font: 600 .7rem/1 var(--f-head); border: 1.5px solid var(--bad); color: var(--bad); border-radius: 3px; padding: .18rem .3rem; }

/* ---------- Tableau de bord ---------- */
.ph-kpis { display: grid; grid-template-columns: repeat(2, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; margin-bottom: 1rem; }
@media (min-width: 992px) { .ph-kpis { grid-template-columns: repeat(4, 1fr); } }
.ph-kpi { padding: 1.1rem 1.25rem 1.15rem; text-decoration: none; color: inherit; display: block; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ph-kpi:nth-child(2n) { border-right: 0; } .ph-kpi:nth-last-child(-n+2) { border-bottom: 0; }
@media (min-width: 992px) { .ph-kpi { border-bottom: 0; } .ph-kpi:nth-child(2n) { border-right: 1px solid var(--line); } .ph-kpi:last-child { border-right: 0; } }
a.ph-kpi:hover { background: color-mix(in srgb, var(--tint) 60%, transparent); color: inherit; }
.ph-kpi small { display: block; color: var(--ink2); font-size: .84rem; font-weight: 500; }
.ph-kpi b { display: block; font: 800 1.85rem/1.15 var(--f-head); letter-spacing: -.02em; margin: .25rem 0 .15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ph-kpi span { font-size: .8rem; color: var(--ink2); }
.ph-kpi--warn b { color: var(--warn); } .ph-kpi--danger b { color: var(--bad); }
.ph-up { color: var(--ok); font-weight: 600; } .ph-down { color: var(--bad); font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: .4rem; height: 10rem; border-bottom: 1px solid var(--line2); position: relative; padding-top: 1rem; }
.bars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; position: relative; }
.bars i { display: block; width: 100%; max-width: 2.4rem; background: var(--tint2); border-radius: 4px 4px 0 0; min-height: 3px; transition: background .15s; }
[data-bs-theme="dark"] .bars i { background: #24523c; }
.bars > div:hover i { background: var(--green); }
.bars > div.is-today i { background: var(--green); }
.bars > div.is-today b { color: var(--ink); }
.bars b { font: 600 .68rem var(--f-body); color: var(--ink2); position: absolute; top: -.1rem; white-space: nowrap; }
.bars-x { display: flex; gap: .4rem; margin-top: .35rem; }
.bars-x span { flex: 1; text-align: center; font-size: .7rem; color: var(--ink2); line-height: 1.15; }
.bars-x span.is-today { color: var(--ink); font-weight: 700; }
.bars-max { position: absolute; left: 0; top: -.35rem; font-size: .7rem; color: var(--faint); }
.watch { list-style: none; margin: 0; padding: 0; }
.watch a { display: flex; align-items: center; gap: .7rem; padding: .62rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.watch li:last-child a { border-bottom: 0; }
.watch a:hover span { text-decoration: underline; }
.watch i { width: .6rem; height: .6rem; border-radius: 2px; flex: none; background: var(--line2); }
.watch .is-bad i { background: var(--bad-dot); } .watch .is-warn i { background: var(--warn-dot); }
.watch span { flex: 1; }
.watch b { font: 700 1.05rem var(--f-head); font-variant-numeric: tabular-nums; }
.watch .is-bad b { color: var(--bad); } .watch .is-warn b { color: var(--warn); }
.top-row { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.top-row:last-child { border-bottom: 0; }
.top-row__line { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.top-row__bar { height: 4px; background: var(--paper); border-radius: 2px; margin-top: .4rem; overflow: hidden; }
.top-row__bar i { display: block; height: 100%; background: var(--green); border-radius: 2px; }

/* ---------- Caisse : le ticket ---------- */
.pos { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 992px) { .pos { grid-template-columns: minmax(0, 1fr) 27rem; align-items: start; } .pos__cart { position: sticky; top: 1.25rem; } }
.pos__search input { font-size: 1.2rem; padding: .85rem 1rem .85rem 3rem; border-radius: 10px; border: 2px solid var(--line2); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%2366766d' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 1rem center; }
.pos__search input:focus { border-color: var(--green); }
.pos__keys { color: var(--faint); font-size: .8rem; margin: .5rem .2rem 0; }
.pos__keys kbd { font: 600 .72rem var(--f-mono); background: var(--surface); color: var(--ink2); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: .05rem .35rem; }
.pos__filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-top: .85rem; }
.pos__cats { display: flex; flex-wrap: wrap; gap: .4rem; min-width: 0; }
.chip { text-decoration: none; border: 1px solid var(--line2); background: var(--surface); color: var(--ink2); border-radius: 999px; padding: .28rem .85rem; font-size: .85rem; font-weight: 500; }
.chip:hover { border-color: var(--primary); color: var(--ink); }
.chip.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.pos__stock { display: flex; align-items: center; gap: .5rem; padding-left: 0; white-space: nowrap; font-size: .88rem; }
.pos__stock .form-check-input { float: none; margin: 0; width: 2.4em; height: 1.3em; }
.pos__stock .form-check-label { margin: 0; }
.pos__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(11.5rem, 44%), 1fr)); gap: .65rem; margin-top: .9rem; }
.pos__grid > .pos__empty { grid-column: 1 / -1; }
.pcard { position: relative; display: flex; flex-direction: column; gap: .3rem; text-align: left; min-height: 7.6rem; padding: .8rem .85rem .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: inherit; transition: border-color .12s, background .12s, transform .08s; }
.pcard:hover:not(:disabled), .pcard:focus-visible { border-color: var(--primary); background: color-mix(in srgb, var(--tint) 70%, var(--surface)); outline: none; }
.pcard:active:not(:disabled) { transform: scale(.975); }
.pcard:disabled { opacity: .55; cursor: not-allowed; }
.pcard.is-in { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.pcard__name { display: flex; flex-direction: column; line-height: 1.25; padding-right: 1.6rem; }
.pcard__name b { font-weight: 650; font-size: .98rem; }
.pcard__name em { font-style: normal; color: var(--ink2); font-size: .84rem; }
.pcard__sub { color: var(--ink2); font-size: .78rem; line-height: 1.3; }
.pcard__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; padding-top: .3rem; }
.pcard .price { font: 600 1rem var(--f-mono); letter-spacing: -.02em; white-space: nowrap; }
.pcard .badge-soft { font-size: .7rem; }
.pcard__rx { position: absolute; top: .65rem; right: .65rem; }
.pcard__n { position: absolute; top: -.45rem; left: -.45rem; min-width: 1.7rem; height: 1.7rem; padding: 0 .4rem; border-radius: 999px; background: var(--primary); color: var(--on-primary); font: 700 .8rem/1.7rem var(--f-mono); text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.pos__pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .3rem; margin-top: 1rem; }
.pos__pager .btn { min-width: 2.2rem; }
.pos__dots { color: var(--faint); padding: 0 .2rem; }
.pos__empty { color: var(--ink2); text-align: center; padding: 1.6rem 0; margin: 0; }
.pos__grid .pos__empty { background: transparent; border: 1.5px dashed var(--line2); border-radius: 10px; }

.pos__cart { --edge: 9px; position: relative; background: var(--surface); border: 0; border-radius: 0; padding: 1.4rem 1.35rem 1.5rem; margin: var(--edge) 0; filter: drop-shadow(0 1px 0 var(--line2)) drop-shadow(0 6px 14px rgba(19,32,26,.08)); }
.pos__cart::before, .pos__cart::after { content: ''; position: absolute; left: 0; right: 0; height: var(--edge); background: linear-gradient(135deg, transparent 75%, var(--surface) 75%) 0 0 / calc(var(--edge) * 1.6) var(--edge), linear-gradient(225deg, transparent 75%, var(--surface) 75%) 0 0 / calc(var(--edge) * 1.6) var(--edge); }
.pos__cart::before { top: calc(var(--edge) * -1); transform: scaleY(-1); }
.pos__cart::after { bottom: calc(var(--edge) * -1); }
[data-bs-theme="dark"] .pos__cart { filter: drop-shadow(0 1px 0 var(--line2)); }
.pos__cart > h2 { font: 700 1.05rem var(--f-head); margin-bottom: .6rem; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem; padding: .75rem 0; border-bottom: 1.5px dashed var(--line2); }
.cart-line b { font-weight: 650; }
.cart-line > .text-end > b { font: 600 1rem var(--f-mono); letter-spacing: -.02em; }
.cart-line .qty { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.cart-line .qty button { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid var(--line2); background: var(--surface); font-weight: 700; font-size: 1.1rem; line-height: 1; color: var(--ink); }
.cart-line .qty button:hover { background: var(--tint); border-color: var(--green); }
.cart-line .qty input { width: 3.4rem; text-align: center; font-family: var(--f-mono); font-weight: 600; }
.cart-line .btn-link { font-size: .82rem; }
.cart-line .qty input[data-a=price] { width: 4.6rem !important; }
.cart-line .qty { flex-wrap: nowrap; gap: .25rem; }
.cart-line .qty .small { margin-left: .2rem !important; }
.cart-sum { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 1rem; padding-top: .9rem; border-top: 2px solid var(--ink); }
.cart-sum > span:first-child { font: 700 1rem var(--f-head); padding-bottom: .5rem; }
.cart-total { font-family: var(--f-head); font-size: 2.6rem; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.pos__go { font: 700 1.15rem var(--f-head) !important; padding: .95rem 1rem !important; border-radius: 10px !important; }
.pos__go:disabled { background: var(--mute-bg); border-color: var(--mute-bg); color: var(--faint); opacity: 1; }
.pos__change { font: 600 1.15rem var(--f-mono); letter-spacing: -.02em; }
.pick { position: relative; }
.pick__list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--surface); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 14px 30px -14px rgba(19,32,26,.4); max-height: 15rem; overflow: auto; margin-top: 4px; }
.pick__list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .55rem .8rem; color: inherit; }
.pick__list button:hover, .pick__list button.on { background: var(--tint); }

/* ---------- Connexion et chargement (même langage visuel qu'afia) ---------- */
.ph-auth { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; overflow: hidden; background: radial-gradient(circle at 8% 12%, rgba(14,116,144,.07), transparent 45%), linear-gradient(160deg, #ffffff 0%, var(--paper) 45%, #eef4f5 100%); }
[data-bs-theme="dark"] .ph-auth { background: radial-gradient(circle at 8% 12%, rgba(20,184,166,.10), transparent 45%), linear-gradient(160deg, #0b1220 0%, #0e1626 55%, #0b1220 100%); }
.ph-auth__pattern { position: absolute; inset: 0; background: url('../images/pills-pattern.svg') center top / 260px 260px repeat; -webkit-mask-image: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.25) 0%, rgba(0,0,0,.9) 75%); mask-image: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.25) 0%, rgba(0,0,0,.9) 75%); pointer-events: none; }
[data-bs-theme="dark"] .ph-auth__pattern { filter: brightness(1.9); opacity: .8; }
.ph-auth__card { position: relative; z-index: 1; width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -22px rgba(15,23,42,.35); padding: 2.5rem 2rem; }
.ph-auth__brand { text-align: center; margin-bottom: 1.75rem; }
.ph-auth__logo { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--primary) !important; }
.ph-auth__logo img { width: 44px; height: 44px; }
.ph-auth__logo b { font: 800 1.9rem/1 var(--f-head); letter-spacing: -.02em; text-transform: lowercase; }
.ph-auth__brand p { color: var(--faint); margin: .5rem 0 0; }
.ph-auth__card h1 { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; }
.ph-auth__foot { margin: 1.4rem 0 0; font-size: .78rem; color: var(--faint); text-align: center; }
/* Page « Chargement » après la connexion */
.ph-loading { text-align: center; padding: .5rem 0 0; }
.ph-loading__txt { color: var(--faint); margin: 0; }

/* Écran de chargement des pages : un comprimé qui tourne */
.ph-loader { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; background: var(--paper); opacity: 1; transition: opacity .35s ease, visibility .35s; animation: ph-loader-failsafe .4s 7s forwards; }
.ph-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; animation: none; }
.ph-loader.is-nav { background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(3px); }
.ph-loader__box { display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.ph-pill { display: block; filter: drop-shadow(0 6px 8px rgba(15,118,110,.25)); }
.ph-pill__spin { transform-box: view-box; transform-origin: 60px 60px; animation: ph-pill-spin 1.1s linear infinite; }
.ph-loading__pill { display: flex; justify-content: center; margin: 1rem 0 .6rem; }
@keyframes ph-pill-spin { to { transform: rotate(360deg); } }
@keyframes ph-loader-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@media (prefers-reduced-motion: reduce) { .ph-pill__spin { animation-duration: 4s; } }
@media print { .ph-loader { display: none !important; } }

/* ---------- Ticket imprimé ---------- */
.ph-print { background: #fff; color: #000; font-family: 'Courier New', monospace; }
.noprint { text-align: center; padding: 1rem; }
@media print { .noprint, .ph-side, .ph-top, .ph-tabs, .ph-foot, .ph-banner { display: none !important; } body { background: #fff !important; } .ph-shell { display: block; } .ph-main { padding: 0 !important; max-width: none; } .print-only { display: block !important; } }
.print-only { display: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 991.98px) { .pos__keys { display: none; } }

/* Barre du ticket (téléphone) : visible dès qu'un produit est ajouté, au-dessus de la barre d'accès rapide */
.pos__bar { position: fixed; left: .75rem; right: .75rem; bottom: calc(4.4rem + env(safe-area-inset-bottom)); z-index: 45; display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; border-radius: 12px; background: var(--primary); color: var(--on-primary); text-decoration: none; box-shadow: 0 10px 24px -10px rgba(15,23,42,.5); }
.pos__bar:hover { color: var(--on-primary); }
.pos__bar b { font: 700 1.05rem var(--f-mono); margin-left: auto; }
.pos__bar-go { font-weight: 700; font-size: .9rem; opacity: .95; }
.pos__bar[hidden] { display: none !important; }
@media (max-width: 991.98px) { .pos__grid { gap: .5rem; } .pcard { min-height: 6.8rem; padding: .7rem; } }

/* ---------- Cloche d'alertes, liste des alertes, toasts ---------- */
.ph-bell { position: relative; }
.ph-bell__btn { position: relative; }
.ph-bell__n { position: absolute; top: -.2rem; right: -.25rem; min-width: 1.1rem; height: 1.1rem; padding: 0 .28rem; border-radius: 999px; background: var(--bad-dot); color: #fff; font-size: .66rem; font-weight: 700; line-height: 1.1rem; text-align: center; border: 2px solid var(--surface); box-sizing: content-box; }
.ph-bell__panel { width: min(22rem, calc(100vw - 1.5rem)); padding: 0; border-radius: var(--r-card, 12px); overflow: hidden; }
.ph-bell__head { display: flex; justify-content: space-between; align-items: center; padding: .65rem .9rem; border-bottom: 1px solid var(--line); }
.ph-bell__all { border: 0; background: none; color: var(--primary); font-size: .8rem; font-weight: 600; padding: 0; }
.ph-bell__list { list-style: none; margin: 0; padding: 0; max-height: 22rem; overflow-y: auto; }
.ph-bell__it a { display: block; padding: .6rem .9rem .6rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; border-left: 3px solid var(--warn-dot); font-size: .86rem; }
.ph-bell__it--danger a { border-left-color: var(--bad-dot); }
.ph-bell__it--info a { border-left-color: var(--primary); }
.ph-bell__it a:hover { background: var(--paper); }
.ph-bell__it a small { display: block; color: var(--ink2); font-size: .76rem; margin-top: .1rem; font-weight: 400; }
.ph-bell__it.is-read a { opacity: .6; }
.ph-bell__it.is-read a b { font-weight: 500; }
.ph-bell__empty { margin: 0; padding: 1.4rem .9rem; text-align: center; color: var(--ink2); font-size: .85rem; }
.ph-bell__foot { display: block; text-align: center; padding: .6rem; font-size: .84rem; font-weight: 600; color: var(--primary); text-decoration: none; border-top: 1px solid var(--line); }
.ph-bell__foot:hover { background: var(--paper); }

.ph-alerts { list-style: none; margin: 0; padding: 0; }
.ph-alerts__it { display: flex; gap: .85rem; align-items: flex-start; padding: .85rem 1rem; border-bottom: 1px solid var(--line); border-left: 4px solid var(--warn-dot); }
.ph-alerts__it:last-child { border-bottom: 0; }
.ph-alerts__it--danger { border-left-color: var(--bad-dot); }
.ph-alerts__it--info { border-left-color: var(--primary); }
.ph-alerts__it.is-read { opacity: .72; }
.ph-alerts__ico { color: var(--ink2); margin-top: .1rem; }
.ph-alerts__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.ph-alerts__txt span { color: var(--ink2); font-size: .88rem; }
.ph-alerts__txt small { color: var(--ink2); }
.ph-alerts__act { display: flex; gap: .4rem; align-items: center; }
@media (max-width: 575.98px) { .ph-alerts__it { flex-wrap: wrap; } .ph-alerts__act { width: 100%; padding-left: 2rem; } }

.ph-toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 1085; display: flex; flex-direction: column; gap: .55rem; width: min(24rem, calc(100vw - 2rem)); pointer-events: none; }
.ph-toast { pointer-events: auto; position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: .7rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line2); border-radius: 12px; padding: .75rem .9rem .85rem; box-shadow: 0 12px 32px rgba(15,23,42,.22); text-decoration: none; font-size: .86rem; animation: ph-toast-in .28s ease-out; transition: opacity .35s, transform .35s; }
.ph-toast:hover { color: var(--ink); border-color: var(--primary); }
.ph-toast__ic { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 10px; display: grid; place-items: center; background: var(--tint); color: var(--primary); }
.ph-toast--danger .ph-toast__ic { background: rgba(220,38,38,.12); color: #DC2626; }
.ph-toast--warn .ph-toast__ic { background: rgba(217,119,6,.14); color: #B45309; }
.ph-toast--ok .ph-toast__ic { background: rgba(22,163,74,.13); color: #15803D; }
.ph-toast__tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ph-toast__k { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ink2); }
.ph-toast--danger .ph-toast__k { color: #DC2626; }
.ph-toast--warn .ph-toast__k { color: #B45309; }
.ph-toast__tx b { font-weight: 650; overflow-wrap: anywhere; }
.ph-toast__tx > span { color: var(--ink2); overflow-wrap: anywhere; }
.ph-toast__x { flex: none; margin-left: auto; border: 0; background: transparent; color: var(--ink2); font-size: 1.25rem; line-height: 1; padding: 0 .1rem; cursor: pointer; }
.ph-toast__x:hover { color: var(--ink); }
.ph-toast__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--primary); transform-origin: left; animation: ph-toast-bar linear forwards; opacity: .55; }
.ph-toast--danger .ph-toast__bar { background: #DC2626; }
.ph-toast--warn .ph-toast__bar { background: #D97706; }
.ph-toast.is-hold .ph-toast__bar { animation-play-state: paused; }
.ph-toast.is-out { opacity: 0; transform: translateX(14px); }
@keyframes ph-toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ph-toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 991.98px) { .ph-toasts { bottom: 4.6rem; } }
@media (prefers-reduced-motion: reduce) { .ph-toast { animation: none; } .ph-toast__bar { display: none; } }

.ph-avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-user__txt { flex-direction: column; text-align: left; line-height: 1.2; min-width: 0; }
.ph-user__txt b { font-weight: 600; font-size: .88rem; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-user__txt small { color: var(--ink2); font-size: .75rem; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-user__chev { color: var(--ink2); }
.ph-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--line2); --bs-dropdown-border-radius: 12px; --bs-dropdown-link-color: var(--ink); --bs-dropdown-link-hover-bg: var(--paper); --bs-dropdown-link-active-bg: var(--tint); --bs-dropdown-divider-bg: var(--line); min-width: 15rem; padding: .4rem; box-shadow: 0 16px 36px -14px rgba(19,32,26,.35); margin-top: .4rem !important; }
.ph-menu__who { display: flex; align-items: center; gap: .65rem; padding: .45rem .7rem .55rem; line-height: 1.25; }
.ph-menu__who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ph-menu__av { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font: 700 .85rem var(--f-head); overflow: hidden; flex: none; }
.ph-menu__who small { color: var(--ink2); }
.ph-menu .dropdown-item { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border-radius: var(--r-ctl); font-size: .92rem; }
.ph-menu .dropdown-item .ph-ico { width: 18px; height: 18px; color: var(--ink2); }
.ph-menu__out, .ph-menu__out .ph-ico { color: var(--bad) !important; }
.ph-main { flex: 1; width: 100%; padding: 1.4rem 1.25rem 3rem; }
@media (min-width: 992px) { .ph-main { padding: 1.75rem 1.75rem 3rem; } }
@media (max-width: 991.98px) { .ph-main { padding-bottom: 6rem; } }
.ph-foot { text-align: left; font-size: .78rem; color: var(--faint); padding: 1rem 1.25rem 1.2rem; }
@media (min-width: 992px) { .ph-foot { padding: 1rem 1.75rem 1.4rem; } }
@media (max-width: 991.98px) { .ph-foot { padding-bottom: 5.5rem; } }
.ph-foot a { color: inherit; }
.ph-banner { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; justify-content: space-between; background: var(--warn-bg); color: var(--warn); padding: .6rem 1.25rem; font-size: .9rem; border-bottom: 1px solid color-mix(in srgb, var(--warn-dot) 35%, transparent); }
.ph-banner--warn { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad-dot) 35%, transparent); }
.ph-banner a { font-weight: 700; color: inherit; }

/* Barre d'accès rapide (téléphone) */
.ph-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-top: 1px solid var(--line); padding: .25rem .25rem calc(.25rem + env(safe-area-inset-bottom)); }
.ph-tabs__a { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .35rem .1rem; border: 0; background: none; color: var(--ink2); font-size: .72rem; font-weight: 500; text-decoration: none; border-radius: var(--r-ctl); }
.ph-tabs__a.is-on { color: var(--primary); font-weight: 700; background: var(--tint); }

/* ---------- Composants ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.65rem; margin: 0; font-weight: 800; letter-spacing: -.02em; }
.ph-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 1.1rem 1.25rem; }
.ph-card > h2, .ph-card > .h5 { font-size: 1rem; margin-bottom: .85rem; }
.card { --bs-card-bg: var(--surface); --bs-card-border-color: var(--line); --bs-card-border-radius: var(--r-card); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.btn { --bs-btn-border-radius: var(--r-ctl); --bs-btn-font-weight: 600; --bs-btn-padding-y: .45rem; --bs-btn-padding-x: .95rem; }
.btn-lg { --bs-btn-padding-y: .7rem; --bs-btn-font-size: 1.05rem; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-color: var(--on-primary); --bs-btn-hover-bg: var(--primary-hi); --bs-btn-hover-border-color: var(--primary-hi); --bs-btn-hover-color: var(--on-primary); --bs-btn-active-bg: var(--primary-hi); --bs-btn-active-border-color: var(--primary-hi); --bs-btn-active-color: var(--on-primary); --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); --bs-btn-disabled-color: var(--on-primary); --bs-btn-focus-shadow-rgb: 15,118,110; }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-hover-color: var(--on-primary); --bs-btn-active-bg: var(--primary); --bs-btn-active-border-color: var(--primary); --bs-btn-active-color: var(--on-primary); }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--green); --bs-btn-border-color: var(--green); }
.btn-outline-secondary { --bs-btn-color: var(--ink2); --bs-btn-border-color: var(--line2); --bs-btn-hover-bg: var(--paper); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--line2); --bs-btn-active-bg: var(--paper); --bs-btn-active-color: var(--ink); --bs-btn-active-border-color: var(--line2); }
.form-control, .form-select { border-color: var(--line2); background-color: var(--surface); color: var(--ink); }
.form-control:focus, .form-select:focus { border-color: var(--green); box-shadow: 0 0 0 .2rem rgba(15,118,110,.22); background-color: var(--surface); color: var(--ink); }
.form-control::placeholder { color: var(--faint); }
.form-label { font-weight: 600; font-size: .85rem; margin-bottom: .3rem; }
.input-group-text { background: var(--paper); border-color: var(--line2); color: var(--ink2); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.alert { border-radius: var(--r-ctl); border-width: 1px; }
.alert-success { --bs-alert-bg: var(--ok-bg); --bs-alert-color: var(--ok); --bs-alert-border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.alert-danger { --bs-alert-bg: var(--bad-bg); --bs-alert-color: var(--bad); --bs-alert-border-color: color-mix(in srgb, var(--bad-dot) 40%, transparent); }
.alert-warning { --bs-alert-bg: var(--warn-bg); --bs-alert-color: var(--warn); --bs-alert-border-color: color-mix(in srgb, var(--warn-dot) 45%, transparent); }
.modal-content { border-color: var(--line); border-radius: var(--r-card); background: var(--surface); }
.nav-tabs { --bs-nav-tabs-link-active-bg: var(--surface); --bs-nav-tabs-link-active-border-color: var(--line) var(--line) var(--surface); --bs-nav-tabs-border-color: var(--line); }
.nav-tabs .nav-link { color: var(--ink2); font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--ink); font-weight: 600; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--primary); --bs-nav-pills-link-active-color: var(--on-primary); --bs-nav-link-color: var(--ink2); --bs-nav-link-hover-color: var(--ink); }
.nav-pills .nav-link { font-weight: 500; }
.nav-pills .nav-link.active { font-weight: 600; }
.pagination { --bs-pagination-color: var(--ink2); --bs-pagination-active-bg: var(--primary); --bs-pagination-active-border-color: var(--primary); --bs-pagination-active-color: var(--on-primary); --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--line); --bs-pagination-hover-bg: var(--paper); }

/* Tableaux */
.table { --bs-table-bg: transparent; --bs-table-border-color: var(--line); --bs-table-hover-bg: color-mix(in srgb, var(--tint) 55%, transparent); --bs-table-color: var(--ink); }
.table > :not(caption) > * > * { padding: .68rem .8rem; }
.table-sm > :not(caption) > * > * { padding: .5rem .6rem; }
.table th { font-size: .8rem; font-weight: 600; color: var(--ink2); white-space: nowrap; border-bottom: 1px solid var(--line2); background: transparent; }
.ph-card:not(.p-0) .table td:first-child, .ph-card:not(.p-0) .table th:first-child { padding-left: 0; }
.ph-card:not(.p-0) .table td:last-child, .ph-card:not(.p-0) .table th:last-child { padding-right: 0; }
.table a:not(.btn) { text-decoration: none; }
.table a:not(.btn):hover { text-decoration: underline; }
.ph-card.p-0 .table td:first-child, .ph-card.p-0 .table th:first-child { padding-left: 1.25rem; }
.ph-card.p-0 .table td:last-child, .ph-card.p-0 .table th:last-child { padding-right: 1.25rem; }
.table tbody tr:last-child > * { border-bottom-width: 0; }
.table-responsive { border-radius: var(--r-card); }

/* Pastilles de chiffres des pages secondaires (stock, ventes, rapports, fiche produit) */
.ph-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: .95rem 1.1rem; height: 100%; display: block; text-decoration: none; color: inherit; }
.ph-stat small { color: var(--ink2); display: block; font-size: .84rem; font-weight: 500; }
.ph-stat b { display: block; font: 800 1.5rem/1.2 var(--f-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.ph-stat--warn b { color: var(--warn); } .ph-stat--danger b { color: var(--bad); }
a.ph-stat:hover { border-color: var(--green); color: inherit; }

/* Étiquettes d'état : un carré de couleur + le mot, comme sur un rayon */
.badge-soft { display: inline-flex; align-items: center; gap: .4em; padding: .18em .55em .18em .45em; border-radius: var(--r-tag); font-weight: 600; font-size: .76rem; line-height: 1.35; white-space: nowrap; }
.badge-soft::before { content: ''; width: .5em; height: .5em; border-radius: 2px; background: currentColor; flex: none; }
.bs-ok { background: var(--ok-bg); color: var(--ok); } .bs-warn { background: var(--warn-bg); color: var(--warn); } .bs-bad { background: var(--bad-bg); color: var(--bad); } .bs-mute { background: var(--mute-bg); color: var(--ink2); }
.bs-warn::before { background: var(--warn-dot); } .bs-bad::before { background: var(--bad-dot); } .bs-ok::before { background: var(--green); } .bs-mute::before { background: var(--faint); }
.rx { display: inline-block; font: 600 .7rem/1 var(--f-head); border: 1.5px solid var(--bad); color: var(--bad); border-radius: 3px; padding: .18rem .3rem; }

/* ---------- Tableau de bord ---------- */
.ph-kpis { display: grid; grid-template-columns: repeat(2, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; margin-bottom: 1rem; }
@media (min-width: 992px) { .ph-kpis { grid-template-columns: repeat(4, 1fr); } }
.ph-kpi { padding: 1.1rem 1.25rem 1.15rem; text-decoration: none; color: inherit; display: block; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ph-kpi:nth-child(2n) { border-right: 0; } .ph-kpi:nth-last-child(-n+2) { border-bottom: 0; }
@media (min-width: 992px) { .ph-kpi { border-bottom: 0; } .ph-kpi:nth-child(2n) { border-right: 1px solid var(--line); } .ph-kpi:last-child { border-right: 0; } }
a.ph-kpi:hover { background: color-mix(in srgb, var(--tint) 60%, transparent); color: inherit; }
.ph-kpi small { display: block; color: var(--ink2); font-size: .84rem; font-weight: 500; }
.ph-kpi b { display: block; font: 800 1.85rem/1.15 var(--f-head); letter-spacing: -.02em; margin: .25rem 0 .15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ph-kpi span { font-size: .8rem; color: var(--ink2); }
.ph-kpi--warn b { color: var(--warn); } .ph-kpi--danger b { color: var(--bad); }
.ph-up { color: var(--ok); font-weight: 600; } .ph-down { color: var(--bad); font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: .4rem; height: 10rem; border-bottom: 1px solid var(--line2); position: relative; padding-top: 1rem; }
.bars > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; position: relative; }
.bars i { display: block; width: 100%; max-width: 2.4rem; background: var(--tint2); border-radius: 4px 4px 0 0; min-height: 3px; transition: background .15s; }
[data-bs-theme="dark"] .bars i { background: #24523c; }
.bars > div:hover i { background: var(--green); }
.bars > div.is-today i { background: var(--green); }
.bars > div.is-today b { color: var(--ink); }
.bars b { font: 600 .68rem var(--f-body); color: var(--ink2); position: absolute; top: -.1rem; white-space: nowrap; }
.bars-x { display: flex; gap: .4rem; margin-top: .35rem; }
.bars-x span { flex: 1; text-align: center; font-size: .7rem; color: var(--ink2); line-height: 1.15; }
.bars-x span.is-today { color: var(--ink); font-weight: 700; }
.bars-max { position: absolute; left: 0; top: -.35rem; font-size: .7rem; color: var(--faint); }
.watch { list-style: none; margin: 0; padding: 0; }
.watch a { display: flex; align-items: center; gap: .7rem; padding: .62rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.watch li:last-child a { border-bottom: 0; }
.watch a:hover span { text-decoration: underline; }
.watch i { width: .6rem; height: .6rem; border-radius: 2px; flex: none; background: var(--line2); }
.watch .is-bad i { background: var(--bad-dot); } .watch .is-warn i { background: var(--warn-dot); }
.watch span { flex: 1; }
.watch b { font: 700 1.05rem var(--f-head); font-variant-numeric: tabular-nums; }
.watch .is-bad b { color: var(--bad); } .watch .is-warn b { color: var(--warn); }
.top-row { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.top-row:last-child { border-bottom: 0; }
.top-row__line { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; }
.top-row__bar { height: 4px; background: var(--paper); border-radius: 2px; margin-top: .4rem; overflow: hidden; }
.top-row__bar i { display: block; height: 100%; background: var(--green); border-radius: 2px; }

/* ---------- Caisse : le ticket ---------- */
.pos { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 992px) { .pos { grid-template-columns: minmax(0, 1fr) 27rem; align-items: start; } .pos__cart { position: sticky; top: 1.25rem; } }
.pos__search input { font-size: 1.2rem; padding: .85rem 1rem .85rem 3rem; border-radius: 10px; border: 2px solid var(--line2); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%2366766d' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 1rem center; }
.pos__search input:focus { border-color: var(--green); }
.pos__keys { color: var(--faint); font-size: .8rem; margin: .5rem .2rem 0; }
.pos__keys kbd { font: 600 .72rem var(--f-mono); background: var(--surface); color: var(--ink2); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: .05rem .35rem; }
.pos__filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-top: .85rem; }
.pos__cats { display: flex; flex-wrap: wrap; gap: .4rem; min-width: 0; }
.chip { text-decoration: none; border: 1px solid var(--line2); background: var(--surface); color: var(--ink2); border-radius: 999px; padding: .28rem .85rem; font-size: .85rem; font-weight: 500; }
.chip:hover { border-color: var(--primary); color: var(--ink); }
.chip.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 600; }
.pos__stock { display: flex; align-items: center; gap: .5rem; padding-left: 0; white-space: nowrap; font-size: .88rem; }
.pos__stock .form-check-input { float: none; margin: 0; width: 2.4em; height: 1.3em; }
.pos__stock .form-check-label { margin: 0; }
.pos__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(11.5rem, 44%), 1fr)); gap: .65rem; margin-top: .9rem; }
.pos__grid > .pos__empty { grid-column: 1 / -1; }
.pcard { position: relative; display: flex; flex-direction: column; gap: .3rem; text-align: left; min-height: 7.6rem; padding: .8rem .85rem .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: inherit; transition: border-color .12s, background .12s, transform .08s; }
.pcard:hover:not(:disabled), .pcard:focus-visible { border-color: var(--primary); background: color-mix(in srgb, var(--tint) 70%, var(--surface)); outline: none; }
.pcard:active:not(:disabled) { transform: scale(.975); }
.pcard:disabled { opacity: .55; cursor: not-allowed; }
.pcard.is-in { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.pcard__name { display: flex; flex-direction: column; line-height: 1.25; padding-right: 1.6rem; }
.pcard__name b { font-weight: 650; font-size: .98rem; }
.pcard__name em { font-style: normal; color: var(--ink2); font-size: .84rem; }
.pcard__sub { color: var(--ink2); font-size: .78rem; line-height: 1.3; }
.pcard__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; padding-top: .3rem; }
.pcard .price { font: 600 1rem var(--f-mono); letter-spacing: -.02em; white-space: nowrap; }
.pcard .badge-soft { font-size: .7rem; }
.pcard__rx { position: absolute; top: .65rem; right: .65rem; }
.pcard__n { position: absolute; top: -.45rem; left: -.45rem; min-width: 1.7rem; height: 1.7rem; padding: 0 .4rem; border-radius: 999px; background: var(--primary); color: var(--on-primary); font: 700 .8rem/1.7rem var(--f-mono); text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.pos__pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .3rem; margin-top: 1rem; }
.pos__pager .btn { min-width: 2.2rem; }
.pos__dots { color: var(--faint); padding: 0 .2rem; }
.pos__empty { color: var(--ink2); text-align: center; padding: 1.6rem 0; margin: 0; }
.pos__grid .pos__empty { background: transparent; border: 1.5px dashed var(--line2); border-radius: 10px; }

.pos__cart { --edge: 9px; position: relative; background: var(--surface); border: 0; border-radius: 0; padding: 1.4rem 1.35rem 1.5rem; margin: var(--edge) 0; filter: drop-shadow(0 1px 0 var(--line2)) drop-shadow(0 6px 14px rgba(19,32,26,.08)); }
.pos__cart::before, .pos__cart::after { content: ''; position: absolute; left: 0; right: 0; height: var(--edge); background: linear-gradient(135deg, transparent 75%, var(--surface) 75%) 0 0 / calc(var(--edge) * 1.6) var(--edge), linear-gradient(225deg, transparent 75%, var(--surface) 75%) 0 0 / calc(var(--edge) * 1.6) var(--edge); }
.pos__cart::before { top: calc(var(--edge) * -1); transform: scaleY(-1); }
.pos__cart::after { bottom: calc(var(--edge) * -1); }
[data-bs-theme="dark"] .pos__cart { filter: drop-shadow(0 1px 0 var(--line2)); }
.pos__cart > h2 { font: 700 1.05rem var(--f-head); margin-bottom: .6rem; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem; padding: .75rem 0; border-bottom: 1.5px dashed var(--line2); }
.cart-line b { font-weight: 650; }
.cart-line > .text-end > b { font: 600 1rem var(--f-mono); letter-spacing: -.02em; }
.cart-line .qty { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.cart-line .qty button { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid var(--line2); background: var(--surface); font-weight: 700; font-size: 1.1rem; line-height: 1; color: var(--ink); }
.cart-line .qty button:hover { background: var(--tint); border-color: var(--green); }
.cart-line .qty input { width: 3.4rem; text-align: center; font-family: var(--f-mono); font-weight: 600; }
.cart-line .btn-link { font-size: .82rem; }
.cart-line .qty input[data-a=price] { width: 4.6rem !important; }
.cart-line .qty { flex-wrap: nowrap; gap: .25rem; }
.cart-line .qty .small { margin-left: .2rem !important; }
.cart-sum { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 1rem; padding-top: .9rem; border-top: 2px solid var(--ink); }
.cart-sum > span:first-child { font: 700 1rem var(--f-head); padding-bottom: .5rem; }
.cart-total { font-family: var(--f-head); font-size: 2.6rem; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.pos__go { font: 700 1.15rem var(--f-head) !important; padding: .95rem 1rem !important; border-radius: 10px !important; }
.pos__go:disabled { background: var(--mute-bg); border-color: var(--mute-bg); color: var(--faint); opacity: 1; }
.pos__change { font: 600 1.15rem var(--f-mono); letter-spacing: -.02em; }
.pick { position: relative; }
.pick__list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--surface); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 14px 30px -14px rgba(19,32,26,.4); max-height: 15rem; overflow: auto; margin-top: 4px; }
.pick__list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .55rem .8rem; color: inherit; }
.pick__list button:hover, .pick__list button.on { background: var(--tint); }

/* ---------- Connexion et chargement (même langage visuel qu'afia) ---------- */
.ph-auth { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; overflow: hidden; background: radial-gradient(circle at 8% 12%, rgba(14,116,144,.07), transparent 45%), linear-gradient(160deg, #ffffff 0%, var(--paper) 45%, #eef4f5 100%); }
[data-bs-theme="dark"] .ph-auth { background: radial-gradient(circle at 8% 12%, rgba(20,184,166,.10), transparent 45%), linear-gradient(160deg, #0b1220 0%, #0e1626 55%, #0b1220 100%); }
.ph-auth__pattern { position: absolute; inset: 0; background: url('../images/pills-pattern.svg') center top / 260px 260px repeat; -webkit-mask-image: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.25) 0%, rgba(0,0,0,.9) 75%); mask-image: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.25) 0%, rgba(0,0,0,.9) 75%); pointer-events: none; }
[data-bs-theme="dark"] .ph-auth__pattern { filter: brightness(1.9); opacity: .8; }
.ph-auth__card { position: relative; z-index: 1; width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px -22px rgba(15,23,42,.35); padding: 2.5rem 2rem; }
.ph-auth__brand { text-align: center; margin-bottom: 1.75rem; }
.ph-auth__logo { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--primary) !important; }
.ph-auth__logo img { width: 44px; height: 44px; }
.ph-auth__logo b { font: 800 1.9rem/1 var(--f-head); letter-spacing: -.02em; text-transform: lowercase; }
.ph-auth__brand p { color: var(--faint); margin: .5rem 0 0; }
.ph-auth__card h1 { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; }
.ph-auth__foot { margin: 1.4rem 0 0; font-size: .78rem; color: var(--faint); text-align: center; }
/* Page « Chargement » après la connexion */
.ph-loading { text-align: center; padding: .5rem 0 0; }
.ph-loading__txt { color: var(--faint); margin: 0; }


/* ---------- Ticket imprimé ---------- */
.ph-print { background: #fff; color: #000; font-family: 'Courier New', monospace; }
.noprint { text-align: center; padding: 1rem; }
@media print { .noprint, .ph-side, .ph-top, .ph-tabs, .ph-foot, .ph-banner { display: none !important; } body { background: #fff !important; } .ph-shell { display: block; } .ph-main { padding: 0 !important; max-width: none; } .print-only { display: block !important; } }
.print-only { display: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 991.98px) { .pos__keys { display: none; } }

/* Barre du ticket (téléphone) : visible dès qu'un produit est ajouté, au-dessus de la barre d'accès rapide */
.pos__bar { position: fixed; left: .75rem; right: .75rem; bottom: calc(4.4rem + env(safe-area-inset-bottom)); z-index: 45; display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; border-radius: 12px; background: var(--primary); color: var(--on-primary); text-decoration: none; box-shadow: 0 10px 24px -10px rgba(15,23,42,.5); }
.pos__bar:hover { color: var(--on-primary); }
.pos__bar b { font: 700 1.05rem var(--f-mono); margin-left: auto; }
.pos__bar-go { font-weight: 700; font-size: .9rem; opacity: .95; }
.pos__bar[hidden] { display: none !important; }
@media (max-width: 991.98px) { .pos__grid { gap: .5rem; } .pcard { min-height: 6.8rem; padding: .7rem; } }

/* ---------- Cloche d'alertes, liste des alertes, toasts ---------- */
.ph-bell { position: relative; }
.ph-bell__btn { position: relative; }
.ph-bell__n { position: absolute; top: -.2rem; right: -.25rem; min-width: 1.1rem; height: 1.1rem; padding: 0 .28rem; border-radius: 999px; background: var(--bad-dot); color: #fff; font-size: .66rem; font-weight: 700; line-height: 1.1rem; text-align: center; border: 2px solid var(--surface); box-sizing: content-box; }
.ph-bell__panel { width: min(22rem, calc(100vw - 1.5rem)); padding: 0; border-radius: var(--r-card, 12px); overflow: hidden; }
.ph-bell__head { display: flex; justify-content: space-between; align-items: center; padding: .65rem .9rem; border-bottom: 1px solid var(--line); }
.ph-bell__all { border: 0; background: none; color: var(--primary); font-size: .8rem; font-weight: 600; padding: 0; }
.ph-bell__list { list-style: none; margin: 0; padding: 0; max-height: 22rem; overflow-y: auto; }
.ph-bell__it a { display: block; padding: .6rem .9rem .6rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; border-left: 3px solid var(--warn-dot); font-size: .86rem; }
.ph-bell__it--danger a { border-left-color: var(--bad-dot); }
.ph-bell__it--info a { border-left-color: var(--primary); }
.ph-bell__it a:hover { background: var(--paper); }
.ph-bell__it a small { display: block; color: var(--ink2); font-size: .76rem; margin-top: .1rem; font-weight: 400; }
.ph-bell__it.is-read a { opacity: .6; }
.ph-bell__it.is-read a b { font-weight: 500; }
.ph-bell__empty { margin: 0; padding: 1.4rem .9rem; text-align: center; color: var(--ink2); font-size: .85rem; }
.ph-bell__foot { display: block; text-align: center; padding: .6rem; font-size: .84rem; font-weight: 600; color: var(--primary); text-decoration: none; border-top: 1px solid var(--line); }
.ph-bell__foot:hover { background: var(--paper); }

.ph-alerts { list-style: none; margin: 0; padding: 0; }
.ph-alerts__it { display: flex; gap: .85rem; align-items: flex-start; padding: .85rem 1rem; border-bottom: 1px solid var(--line); border-left: 4px solid var(--warn-dot); }
.ph-alerts__it:last-child { border-bottom: 0; }
.ph-alerts__it--danger { border-left-color: var(--bad-dot); }
.ph-alerts__it--info { border-left-color: var(--primary); }
.ph-alerts__it.is-read { opacity: .72; }
.ph-alerts__ico { color: var(--ink2); margin-top: .1rem; }
.ph-alerts__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.ph-alerts__txt span { color: var(--ink2); font-size: .88rem; }
.ph-alerts__txt small { color: var(--ink2); }
.ph-alerts__act { display: flex; gap: .4rem; align-items: center; }
@media (max-width: 575.98px) { .ph-alerts__it { flex-wrap: wrap; } .ph-alerts__act { width: 100%; padding-left: 2rem; } }


.ph-avatar-lg { width: 5rem; height: 5rem; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font: 700 1.5rem var(--f-head); overflow: hidden; flex: none; }
.ph-logo-box { width: 5rem; height: 5rem; border: 1px dashed var(--line2); border-radius: var(--r-card); display: grid; place-items: center; color: var(--faint); background: var(--paper); flex: none; overflow: hidden; }
.ph-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ph-logo-lg { height: 3.2rem; max-width: 8rem; width: auto; object-fit: contain; border-radius: 6px; }
.ph-row-logo { height: 1.7rem; width: 1.7rem; object-fit: contain; border-radius: 4px; vertical-align: middle; margin-right: .5rem; }

/* ---------- Pagination des listes ---------- */
.ph-pager { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; }
.ph-card.p-0 .ph-pager { padding: 0 1rem .85rem; }
.ph-pager .page-link { color: var(--ink2); border-color: var(--line2); background: var(--surface); min-width: 2rem; text-align: center; }
.ph-pager .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.ph-pager .page-item.disabled .page-link { color: var(--faint); background: transparent; }

.ph-nav__n { margin-left: auto; background: var(--bad-dot); color: #fff; font-style: normal; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: .05rem .45rem; }

/* ---------- Documents imprimés (bon de commande, clôture, feuille d'inventaire) ---------- */
.doc { max-width: 190mm; margin: 0 auto 2rem; padding: 10mm; font: 13px/1.45 'Inter', Arial, sans-serif; background: #fff; color: #111; }
.ph-print .doc, .ph-print .doc * { font-family: 'Inter', Arial, sans-serif; }
.doc h1 { font-size: 20px; font-weight: 800; margin: .4rem 0 .15rem; } .doc h2 { font-size: 16px; font-weight: 800; margin: 0 0 .3rem; }
.doc .r { text-align: right; } .doc-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #111; padding-bottom: .6rem; margin-bottom: .8rem; }
.doc-box { border: 1px solid #999; padding: .5rem .7rem; margin-bottom: .8rem; }
.doc-table { width: 100%; border-collapse: collapse; margin-bottom: .8rem; } .doc-table th, .doc-table td { border: 1px solid #999; padding: 4px 6px; vertical-align: top; } .doc-table thead th { background: #eee; }
.doc-sign { display: flex; justify-content: space-between; margin-top: 2.2rem; } .doc-sign div:last-child { border-top: 1px solid #111; padding-top: 4px; min-width: 55mm; text-align: center; }
.doc-blank { display: inline-block; min-width: 22mm; border-bottom: 1px solid #111; height: 1.1em; }
@media print { .doc { padding: 0; margin: 0; max-width: none; } }
/* A4 réservé aux documents (page nommée) : ne doit pas s'appliquer au ticket thermique, sinon le navigateur réduit le ticket */
@page a4doc { size: A4; margin: 12mm; }
.doc, .pd { page: a4doc; }

/* Bouton clair/sombre : lune en mode clair, soleil en mode sombre */
[data-theme-toggle] .i-sun { display: none; }
[data-theme-toggle] .i-moon, [data-theme-toggle] .i-sun { display: inline-flex; align-items: center; }
[data-theme-toggle] .i-sun { display: none; }
[data-theme="dark"] [data-theme-toggle] .i-moon { display: none; }
[data-theme="dark"] [data-theme-toggle] .i-sun { display: inline-flex; }

/* Listes de référence */
.ph-list { display: flex; flex-direction: column; gap: .35rem; max-height: 22rem; overflow: auto; }
.ph-list__row { display: flex; align-items: center; gap: .6rem; }
.ph-list__name { flex: 1; margin: 0; }
.ph-list__row .btn { line-height: 1; padding: .2rem .5rem; }

/* ============ Documents imprimables (facture, rapports, bons) : « pd » ============ */
.pd { --pd-ink: #17202a; --pd-mute: #5b6770; --pd-line: #d7dfdd; --pd-acc: #0F766E; max-width: 190mm; margin: 0 auto 2rem; padding: 12mm 12mm 10mm; background: #fff; color: var(--pd-ink); font: 12.5px/1.45 'Inter', system-ui, Arial, sans-serif; position: relative; box-shadow: 0 1px 8px #0002; }
.ph-print .pd, .ph-print .pd * { font-family: 'Inter', system-ui, Arial, sans-serif; }
.pd-bar, .tk-bar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; max-width: 190mm; margin: 1rem auto .6rem; padding: 0 .5rem; }
.pd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.2rem; padding-bottom: .9rem; border-bottom: 3px solid var(--pd-acc); margin-bottom: 1rem; }
.pd-id { display: flex; gap: .8rem; align-items: center; }
.pd-logo { max-height: 18mm; max-width: 38mm; object-fit: contain; }
.pd-org { font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--pd-ink); }
.pd-orgsub { color: var(--pd-mute); font-size: 11px; margin-top: .15rem; }
.pd-doc { text-align: right; }
.pd-kind { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--pd-acc); font-weight: 700; }
.pd-no { font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.pd-meta { color: var(--pd-mute); font-size: 11.5px; } .pd-meta span { color: var(--pd-mute); opacity: .8; }
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1rem; }
.pd-card { border: 1px solid var(--pd-line); border-radius: 6px; padding: .6rem .8rem; background: #fafcfb; }
.pd-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--pd-mute); font-weight: 700; margin-bottom: .2rem; }
.pd-muted { color: var(--pd-mute); font-size: 11px; }
.pd-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 12px; }
.pd-table th { background: var(--pd-acc); color: #fff; text-align: left; padding: 6px 8px; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; font-weight: 700; }
.pd-table td { padding: 6px 8px; border-bottom: 1px solid var(--pd-line); vertical-align: top; }
.pd-table tbody tr:nth-child(even) td { background: #f6faf9; }
.pd-table .r, .pd-totals .r { text-align: right; white-space: nowrap; } .pd-table th.r { text-align: right; }
.pd-n { width: 7mm; color: var(--pd-mute); }
.pd-table tfoot td, .pd-table tfoot th { border-top: 2px solid var(--pd-ink); background: #fff; color: var(--pd-ink); font-weight: 800; text-transform: none; font-size: 12px; letter-spacing: 0; }
.pd-sum { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.2rem; margin-bottom: 1rem; }
.pd-words { flex: 1; border-left: 3px solid var(--pd-acc); padding: .2rem .8rem; }
.pd-totals { min-width: 66mm; border-collapse: collapse; } .pd-totals td { padding: 4px 8px; }
.pd-totals__main td { background: var(--pd-acc); color: #fff; font-weight: 800; font-size: 14px; }
.pd-totals__due td { color: #b42318; font-weight: 800; border-top: 1px solid var(--pd-line); }
.pd-note { border: 1px dashed var(--pd-line); border-radius: 6px; padding: .5rem .8rem; margin-bottom: 1rem; color: var(--pd-mute); }
.pd-note--bad { border-color: #b42318; color: #b42318; }
.pd-sign { display: flex; justify-content: space-between; gap: 2rem; margin: 1.6rem 0 1rem; } .pd-sign > div { flex: 1; min-height: 22mm; border-top: 1px solid var(--pd-ink); padding-top: .25rem; }
.pd-foot { text-align: center; color: var(--pd-mute); font-size: 10.5px; border-top: 1px solid var(--pd-line); padding-top: .5rem; }
.pd-mark { position: absolute; top: 34mm; right: 16mm; transform: rotate(-12deg); border: 3px solid var(--pd-acc); color: var(--pd-acc); font-weight: 900; letter-spacing: .2em; font-size: 22px; padding: .1rem .8rem; border-radius: 6px; opacity: .55; }
.pd-mark--bad { border-color: #b42318; color: #b42318; }
.pd h2.pd-h { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--pd-acc); margin: 1.1rem 0 .4rem; font-weight: 800; }
@media print { .pd { box-shadow: none; margin: 0; padding: 0; max-width: none; } .pd-bar, .tk-bar { display: none !important; } .pd-table th, .pd-totals__main td, .pd-mark { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .pd-table tr { break-inside: avoid; } .pd-table thead { display: table-header-group; } }
@media (max-width: 700px) { .pd { padding: 6mm; } .pd-head, .pd-sum { flex-direction: column; } .pd-doc { text-align: left; } .pd-grid { grid-template-columns: 1fr; } .pd-table { display: block; overflow-x: auto; } }

/* ============ Ticket thermique 80 / 58 mm : « tk » ============ */
.tk { box-sizing: border-box; width: 80mm; max-width: 100%; margin: 0 auto 2rem; padding: 4mm 4mm 8mm; background: #fff; color: #000; font: 12px/1.35 'Courier New', ui-monospace, monospace; box-shadow: 0 1px 8px #0002; }
.tk-58 { width: 58mm; font-size: 10.5px; padding: 3mm 2mm 8mm; }
.tk-bar { max-width: 80mm; justify-content: center; }
.tk-switch { display: inline-flex; border: 1px solid var(--line2, #ccd); border-radius: 6px; overflow: hidden; } .tk-switch a { padding: .25rem .6rem; text-decoration: none; color: inherit; font-size: .85rem; } .tk-switch a.is-on { background: #0F766E; color: #fff; }
.tk-logo { text-align: center; margin-bottom: 2mm; } .tk-logo img { max-height: 16mm; max-width: 60%; }
.tk-name { text-align: center; font-weight: 700; font-size: 1.25em; letter-spacing: .02em; text-transform: uppercase; }
.tk-sub { text-align: center; font-size: .9em; margin-top: 1mm; }
.tk-rule { border-top: 1px dashed #000; margin: 2.5mm 0; } .tk-rule--solid { border-top-style: solid; }
.tk-title { text-align: center; font-weight: 700; letter-spacing: .25em; font-size: 1.05em; }
.tk-no { text-align: center; font-weight: 700; font-size: 1.15em; margin-bottom: 1.5mm; }
.tk-meta > div, .tk-tot > div { display: flex; justify-content: space-between; gap: 2mm; } .tk-meta b { font-weight: 400; text-align: right; }
.tk-it { margin-bottom: 1.6mm; } .tk-it__n { font-weight: 700; } .tk-it__n small { font-weight: 400; }
.tk-it__l { display: flex; justify-content: space-between; gap: 2mm; padding-left: 2mm; }
.tk-tot__main { font-weight: 700; font-size: 1.3em; border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 1mm 0; margin: 1.5mm 0; }
.tk-tot__due { font-weight: 700; border: 1px solid #000; padding: .6mm 1mm; margin-top: 1mm; }
.tk-stamp { text-align: center; font-weight: 700; letter-spacing: .3em; border: 1px solid #000; margin: 2mm 12mm 0; padding: .4mm 0; }
.tk-bc { text-align: center; } .tk-bc__svg { width: 100%; height: 11mm; display: block; } .tk-bc div { font-size: .9em; letter-spacing: .08em; }
.tk-foot { text-align: center; margin-top: 2.5mm; } .tk-foot small { font-size: .85em; }
.tk-end { text-align: center; font-size: .8em; margin-top: 2mm; }
@media print { html, body { background: #fff; } .tk { box-shadow: none; margin: 0; width: 80mm; max-width: none; padding: 3mm 4mm 8mm; } .tk-58 { width: 58mm; padding: 3mm 3mm 8mm; } .tk-switch { display: none; } .tk-it__n, .tk-sub, .tk-foot { overflow-wrap: anywhere; } }
.tk-bar, .tk-bar .btn, .pd-bar .btn { font-family: 'Inter', system-ui, Arial, sans-serif !important; }
.tk-hint { text-align: center; font-size: .8rem; color: #5b6770; margin: 0 auto .6rem; max-width: 80mm; }

/* ---------- Discussion (chat) ---------- */
.ph-subtabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line2); list-style: none; padding: 0; }
.ph-subtabs .nav-link { padding: .55rem .9rem; color: var(--ink2); border-bottom: 2px solid transparent; font-weight: 600; text-decoration: none; display: block; }
.ph-subtabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.ch-card { display: flex; flex-direction: column; overflow: hidden; }
.ch-head { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line2); background: var(--paper); }
.ch-av { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font: 700 1rem var(--f-head); }
.ch-av svg { max-width: 70%; }
.ch { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ch__flow { height: min(62vh, 560px); overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .35rem; background: var(--paper); scroll-behavior: smooth; }
.ch__empty { margin: auto; text-align: center; color: var(--ink2); display: flex; flex-direction: column; align-items: center; gap: .35rem; max-width: 22rem; }
.ch__empty svg { width: 2.4rem; height: 2.4rem; color: var(--faint); }
.ch__empty--big { min-height: 55vh; justify-content: center; padding: 2rem; }
.ch-day { text-align: center; margin: .6rem 0 .3rem; }
.ch-day span { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--ink2); background: var(--surface); border: 1px solid var(--line2); border-radius: 99px; padding: .15rem .7rem; }
.ch-msg { display: flex; }
.ch-msg--mine { justify-content: flex-end; }
.ch-b { max-width: min(34rem, 82%); padding: .5rem .75rem .35rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line2); box-shadow: 0 1px 1px rgba(15,23,42,.04); }
.ch-msg--mine .ch-b { background: var(--primary); color: var(--on-primary); border-color: var(--primary); border-bottom-right-radius: 4px; }
.ch-msg--their .ch-b { border-bottom-left-radius: 4px; }
.ch-who { display: block; font-size: .72rem; font-weight: 700; color: var(--primary); margin-bottom: .1rem; }
.ch-t { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.ch-meta { display: block; text-align: right; font-size: .68rem; opacity: .75; margin-top: .1rem; }
.ch-tick { letter-spacing: -.2em; margin-left: .15rem; opacity: .6; }
.ch-tick.is-read { opacity: 1; color: #A7F3D0; }
.ch-msg--pending .ch-b { opacity: .6; }
.ch__form { display: flex; gap: .5rem; align-items: flex-end; padding: .7rem; border-top: 1px solid var(--line2); background: var(--surface); }
.ch__form textarea { resize: none; max-height: 9rem; border-radius: 12px; }
.ch__send { flex: none; width: 2.7rem; height: 2.7rem; padding: 0; display: grid; place-items: center; border-radius: 50%; }
.ch__err { padding: 0 .9rem .6rem; }
.ch-split { display: grid; grid-template-columns: minmax(16rem, 22rem) 1fr; gap: 1rem; align-items: start; }
.ch-list { overflow: hidden; }
.ch-convs { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow-y: auto; }
.ch-conv { display: flex; align-items: center; gap: .65rem; padding: .65rem .8rem; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--line2); }
.ch-conv:hover { background: var(--tint); color: var(--ink); }
.ch-conv.is-on { background: var(--tint); box-shadow: inset 3px 0 0 var(--primary); }
.ch-conv__t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ch-conv__t b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-conv__t small { color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-conv__r { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; flex: none; }
.ch-conv__r small { color: var(--ink2); font-size: .7rem; }
.ch-back { display: none; }
@media (max-width: 767.98px) {
  .ch-split { grid-template-columns: 1fr; }
  .ch-split.has-cur .ch-list { display: none; }
  .ch-split:not(.has-cur) .ch-main { display: none; }
  .ch-back { display: inline-block; }
  .ch__flow { height: 58vh; }
}

/* ---------- Barres de répartition ---------- */
.ph-bar { margin-bottom: .65rem; }
.ph-bar__l { display: flex; justify-content: space-between; gap: .75rem; font-size: .88rem; margin-bottom: .2rem; }
.ph-bar__t { height: .55rem; border-radius: 99px; background: var(--tint); overflow: hidden; }
.ph-bar__t i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }

/* ---------- Caisse : journal, billetage, graphique ---------- */
.ph-stat--ok { border-color: var(--primary); background: var(--tint); }
.ph-ledger td { padding: .55rem .35rem; }
.ph-ledger__tot td { border-top: 2px solid var(--ink); font-size: 1.05rem; }
.ph-sign { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; font-weight: 800; font-size: .85rem; margin-right: .35rem; }
.ph-sign--in { background: rgba(22,163,74,.14); color: #15803D; }
.ph-sign--out { background: rgba(220,38,38,.12); color: #DC2626; }
.ph-bills { display: flex; flex-direction: column; gap: .35rem; }
.ph-bills__r { display: grid; grid-template-columns: 5.5rem 1rem 5rem 1fr; align-items: center; gap: .4rem; margin: 0; }
.ph-bills__d { font-weight: 700; font-variant-numeric: tabular-nums; }
.ph-bills__x { color: var(--ink2); text-align: center; }
.ph-bills__s { text-align: right; color: var(--ink2); font-variant-numeric: tabular-nums; font-size: .86rem; }
.ph-gap { display: flex; justify-content: space-between; align-items: center; padding: .55rem .8rem; border-radius: 10px; background: var(--tint); font-size: .9rem; }
.ph-gap b { font-size: 1.1rem; }
.ph-gap.is-ok { background: rgba(22,163,74,.12); color: #15803D; }
.ph-gap.is-bad { background: rgba(220,38,38,.1); color: #B91C1C; }
.ph-spark { display: flex; align-items: flex-end; gap: .5rem; height: 7.5rem; }
.ph-spark__c { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .3rem; }
.ph-spark__c i { display: block; width: 100%; max-width: 2.6rem; background: var(--line2); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.ph-spark__c.is-on i { background: var(--primary); }
.ph-spark__c small { color: var(--ink2); font-size: .72rem; }

.pd-big { font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.pd-card--bad { border-color: #b42318; background: #fff6f5; } .pd-card--bad .pd-big, .pd-bad { color: #b42318; }

/* ---------- Rapport imprimable ---------- */
.pd-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: .9rem; }
.pd-kpi { border: 1px solid var(--pd-line); border-top: 3px solid var(--pd-acc); border-radius: 6px; padding: .5rem .65rem; background: #fafcfb; }
.pd-kpi .pd-big { font-size: 17px; }
.pd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.pd-chart { width: 100%; height: auto; margin-bottom: .8rem; }
.pd-table td.pd-muted { color: var(--pd-mute); }
.pd h2.pd-h { break-after: avoid; } .pd-table { break-inside: auto; } .pd-kpis, .pd-cols > div { break-inside: avoid; }
@media (max-width: 700px) { .pd-kpis { grid-template-columns: 1fr 1fr; } .pd-cols { grid-template-columns: 1fr; } }
.ph-spark--wide { height: 10rem; gap: 2px; }
.ph-spark--wide .ph-spark__c i { max-width: none; border-radius: 3px 3px 1px 1px; background: var(--primary); opacity: .85; }
.ph-spark--wide .ph-spark__c:hover i { opacity: 1; }

/* ---------- Étapes (suivi d'une commande) ---------- */
.ph-steps { list-style: none; display: flex; gap: 0; padding: 0; margin: 0; }
.ph-steps li { flex: 1; display: flex; align-items: center; gap: .55rem; padding: .6rem .8rem; background: var(--surface); border: 1px solid var(--line2); color: var(--ink2); font-weight: 600; position: relative; }
.ph-steps li:first-child { border-radius: 10px 0 0 10px; } .ph-steps li:last-child { border-radius: 0 10px 10px 0; } .ph-steps li + li { border-left: 0; }
.ph-steps li span { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--tint); font-size: .8rem; }
.ph-steps li.is-done { color: var(--primary); } .ph-steps li.is-done span { background: var(--primary); color: var(--on-primary); }
.ph-steps li.is-on { color: var(--ink); background: var(--tint); border-color: var(--primary); } .ph-steps li.is-on span { background: var(--primary); color: var(--on-primary); }

/* ---------- Assistant afia (panneau d'aide) ---------- */
.ph-top__assistant { color: var(--primary) !important; box-shadow: inset 0 0 0 1px var(--primary); }
.ph-top__assistant:hover { background: var(--tint) !important; }
.ph-top__assistant[aria-expanded="true"] { background: var(--primary) !important; color: var(--on-primary) !important; }
.ph-help { position: fixed; top: 4.1rem; right: 1rem; z-index: 1070; width: min(27rem, calc(100vw - 2rem)); max-height: min(36rem, calc(100vh - 6rem)); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 6px rgba(15,23,42,.07), 0 28px 60px -12px rgba(15,23,42,.3); }
.ph-help[hidden] { display: none; }
.ph-help__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .6rem; padding: .85rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; }
.ph-help__mark { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; flex: 0 0 auto; color: #fff; background: linear-gradient(135deg, var(--primary), #2dd4bf); border-radius: 8px; }
.ph-help__nom { font-weight: 700; line-height: 1.1; }
.ph-help__sous { font-size: .78rem; color: var(--faint); }
.ph-help__close { margin-left: auto; border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--faint); }
.ph-help__close:hover { color: var(--ink); }
.ph-help__corps { padding: .9rem 1rem 1rem; }
.ph-help__zone { position: relative; }
.ph-help__champ { width: 100%; padding: .6rem 2.2rem .6rem .8rem; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line2); border-radius: 8px; }
.ph-help__champ:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
.ph-help__envoi { position: absolute; top: 50%; right: .4rem; transform: translateY(-50%); display: grid; place-items: center; width: 1.7rem; height: 1.7rem; padding: 0; cursor: pointer; color: var(--primary); background: none; border: 0; border-radius: 6px; }
.ph-help__envoi:hover { background: var(--tint); }
.ph-help__note { margin: .5rem 0 .9rem; font-size: .78rem; color: var(--faint); }
.ph-help__reponse, .ph-help__attente { padding: .85rem .95rem; margin-bottom: .9rem; background: var(--tint); border: 1px solid var(--line); border-left: 3px solid var(--primary); border-radius: 4px 12px 12px 4px; }
.ph-help__reponse h4 { margin: 0 0 .35rem; font-size: 1rem; font-weight: 700; }
.ph-help__reponse p { margin: 0 0 .5rem; font-size: .88rem; line-height: 1.55; }
.ph-help__aller { display: inline-block; margin-top: .6rem; font-size: .88rem; font-weight: 600; }
.ph-help__origine { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; font-size: .76rem; color: var(--faint); }
.ph-help__ligne { height: .62rem; margin-bottom: .5rem; border-radius: 999px; background: linear-gradient(90deg, var(--line) 25%, var(--tint2) 50%, var(--line) 75%); background-size: 200% 100%; animation: ph-help-vague 1.1s linear infinite; }
.ph-help__ligne:nth-child(2) { width: 92%; animation-delay: .1s; }
.ph-help__ligne:nth-child(3) { width: 72%; animation-delay: .2s; margin-bottom: 0; }
@keyframes ph-help-vague { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ph-help__ligne { animation: none; } }
.ph-help__section { margin: 0 0 .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.ph-help__item { display: block; padding: .55rem .7rem; margin-bottom: .35rem; text-decoration: none; color: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.ph-help__item:hover { border-color: var(--primary); background: var(--tint); color: inherit; }
.ph-help__titre { display: block; font-weight: 600; font-size: .9rem; }
.ph-help__resume { display: block; font-size: .85rem; color: var(--faint); }
.ph-help__module { display: inline-block; margin-top: .25rem; font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.ph-help__vide { margin: .4rem 0; font-size: .88rem; color: var(--faint); }
.ph-help__toutes { display: inline-block; margin-top: .7rem; font-size: .88rem; font-weight: 600; }
@media (max-width: 575.98px) { .ph-help { top: 3.6rem; right: .5rem; left: .5rem; width: auto; } }

/* ---------- Fenêtre des conditions (première connexion) ---------- */
.ph-auth__card--wide { max-width: 760px; padding: 1.4rem 1.8rem 1.2rem; } .ph-auth__card--wide .ph-auth__brand p { display: none; } .ph-auth__card--wide .ph-auth__brand { margin-bottom: .6rem; }
.ph-terms h1 { font-size: 1.35rem; margin-bottom: .4rem; }
.ph-terms__intro { color: var(--ink2); font-size: .93rem; margin-bottom: 1rem; }
.ph-terms__scroll { max-height: min(44vh, 26rem); overflow-y: auto; border: 1px solid var(--line2); border-radius: 10px; padding: 1.1rem 1.25rem; background: var(--surface); font-size: .9rem; scroll-behavior: smooth; }
.ph-terms__scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ph-terms__bar { height: 3px; border-radius: 3px; background: var(--line); margin: .5rem 0 .4rem; overflow: hidden; } .ph-terms__bar span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .15s; }
.ph-terms__hint { font-size: .82rem; color: var(--faint); margin-bottom: .9rem; } .ph-terms__hint.is-ok { color: var(--ok); font-weight: 600; }
.ph-terms__title { font-size: 1.05rem; margin: 1.4rem 0 .8rem; padding-top: 1rem; border-top: 2px solid var(--line); } .ph-terms__title small { font-weight: 400; color: var(--faint); font-size: .78rem; margin-left: .4rem; }
.ph-terms__end { text-align: center; color: var(--faint); font-size: .8rem; margin: 1.2rem 0 .2rem; }
.ph-terms__scroll h2 { font-size: .98rem; font-weight: 700; margin: 1.2rem 0 .45rem; } .ph-terms__scroll h2 span { color: var(--primary); margin-right: .3rem; }
.ph-terms__scroll p, .ph-terms__scroll li { color: var(--ink2); } .ph-terms__scroll ul { padding-left: 1.15rem; }
.ph-terms__scroll .lg__table { width: 100%; border-collapse: collapse; font-size: .85rem; margin: .6rem 0; } .ph-terms__scroll .lg__table th, .ph-terms__scroll .lg__table td { border: 1px solid var(--line); padding: .45rem .6rem; vertical-align: top; text-align: left; } .ph-terms__scroll .lg__table th { background: var(--tint); color: var(--primary-hi); }
.ph-terms__scroll .lg__note { background: var(--tint); border-left: 4px solid var(--primary); border-radius: 6px; padding: .1rem .85rem; margin: .7rem 0; } .ph-terms__scroll .lg__note p { color: var(--ink); margin: .5rem 0; }
.lg__rules { background: var(--tint); border: 1px solid var(--tint2); border-radius: 10px; padding: .9rem 1.1rem 1rem; margin-bottom: 1rem; } .lg__rules h2 { font-size: 1rem; margin: 0 0 .5rem; color: var(--primary-hi); } .lg__rules ol { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; } .lg__rules li { color: var(--ink); } .lg__rules b { color: var(--primary-hi); }
@media (max-width: 575px) { .ph-auth__card--wide { padding: 1.2rem 1rem; } .ph-terms__scroll { max-height: 48vh; padding: .8rem .9rem; } }
