:root {
  --bg: #f4f5f8; --panel: #ffffff; --ink: #14213d; --muted: #5f6b82; --line: #dde1ea;
  --accent: #14213d; --accent-ink: #ffffff; --accent-soft: #e6eaf3; --brand: #f4a300; --link: #1f4fa3;
  --ok: #1d7a4a; --ok-bg: #e2f3e9; --warn: #96620a; --warn-bg: #fbf0d6;
  --bad: #b3261e; --bad-bg: #fbe5e3; --info: #2457a6; --info-bg: #e4ecf9; --idle: #55605b; --idle-bg: #e9edeb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--bg); }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 10px; }
a { color: var(--link); }
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side { background: #14213d; color: #dfe4ef; display: flex; flex-direction: column; padding: 16px 12px; gap: 18px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 2px 6px 0; }
.brand img { height: 40px; width: auto; display: block; }
.brand small { display: block; color: #9aa6c0; font-size: 12px; }
nav { display: block; }
nav a { color: #c9d1e2; text-decoration: none; padding: 8px 10px; border-radius: 7px; display: flex; justify-content: space-between; align-items: center; }
nav a:hover { background: #22365f; color: #fff; }
nav a.on { background: var(--brand); color: #14213d; font-weight: 700; }
nav .count { background: #fff; color: #14213d; border-radius: 10px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.who { margin-top: auto; padding: 0 6px; }
.who label { font-size: 12px; color: #9aa6c0; display: block; margin-bottom: 4px; }
.who select { width: 100%; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.side .hint { color: #9aa6c0; }
main { padding: 22px 28px 60px; min-width: 0; outline: none; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head p { margin: 2px 0 0; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-decoration: none; color: inherit; display: block; }
.kpi span { color: var(--muted); font-size: 12px; display: block; }
.kpi b { font-size: 24px; font-variant-numeric: tabular-nums; }
.kpi.alert b { color: var(--warn); }
.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover { background: #f5f7fb; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll { overflow-x: auto; }
.empty { color: var(--muted); padding: 22px; text-align: center; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.pill.idle { background: var(--idle-bg); color: var(--idle); }
button, .btn { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 13px; border-radius: 7px; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: #b9c5bf; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.danger { color: var(--bad); border-color: #e7b9b5; }
button.small { padding: 3px 9px; font-size: 12px; }
button:disabled { cursor: default; opacity: .55; }
button.primary:disabled { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--muted); opacity: 1; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid #c9d3ce; border-radius: 7px; background: #fff; color: var(--ink); max-width: 100%; }
textarea { width: 100%; min-height: 64px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select { width: 100%; }
.field.wide { grid-column: 1 / -1; }
.req::after { content: " *"; color: var(--bad); }
.notice { border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.notice.warn { background: var(--warn-bg); color: #5c3d05; } .notice.bad { background: var(--bad-bg); color: #7a1711; }
.notice.info { background: var(--info-bg); color: #173a70; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; }
#map, .map { height: 460px; border-radius: 10px; border: 1px solid var(--line); background: #e9eeeb; }
.map.mini { height: 220px; }
.photo { width: 100%; max-width: 360px; border-radius: 8px; border: 1px solid var(--line); display: block; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 130px 1fr 110px; gap: 10px; align-items: center; }
.bar i { display: block; height: 10px; border-radius: 5px; background: var(--brand); min-width: 2px; }
.bar .track { background: var(--idle-bg); border-radius: 5px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.totals { margin-left: auto; width: 280px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .ttc { font-weight: 700; font-size: 16px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.pricegrid input { width: 92px; text-align: right; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #14213d; color: #fff; padding: 10px 16px; border-radius: 8px; width: max-content; max-width: min(92vw, 560px); overflow-wrap: anywhere; z-index: 3000; cursor: pointer; }
#toast.bad { background: var(--bad); }
#toast.top { bottom: auto; top: 16px; }                                 /* en haut quand le bas de l'écran porte un bouton ou une feuille à ne pas couvrir */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  main { padding: 16px; }
  .dl { grid-template-columns: 1fr; }
}

/* ── Connexion ── */
#login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: #14213d; }
.login { background: #fff; border-radius: 14px; padding: 26px; width: 100%; max-width: 420px; display: grid; gap: 14px; }
.login-logo { height: 46px; width: auto; justify-self: start; }
.login h1 { font-size: 20px; }
.login button.primary { padding: 10px; font-size: 15px; }
.demo { border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; color: var(--muted); }
.demo p { margin: 0 0 8px; } .demo code { background: var(--accent-soft); padding: 1px 6px; border-radius: 4px; color: var(--ink); }
.demo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.demo-list button { text-align: left; padding: 5px 8px; } .demo-list button span { display: block; font-size: 11px; color: var(--muted); }

/* ── Menu ── */
.navgroup { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.navgroup > span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #8794b3; padding: 4px 10px 2px; }
nav { overflow-y: auto; flex: 1; min-height: 0; }
.side { gap: 12px; }
.who { margin-top: 0; border-top: 1px solid #24365f; padding-top: 10px; }
.who-name b { display: block; color: #fff; } .who-name span { font-size: 12px; color: #9aa6c0; }
.who .row { margin-top: 8px; gap: 6px; }
.ghost { background: transparent; color: #dfe4ef; border-color: #34497a; } .ghost:hover { border-color: #f4a300; }
.menu-toggle { display: none; background: transparent; color: #fff; border-color: #34497a; }
.bad-text { color: var(--bad) !important; }
.notice ul { margin: 6px 0 0 18px; padding: 0; }
.notice .btn.small, .notice button { margin-left: 8px; }

/* ── Terrain ── */
.stop { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 10px; }
.kpi .track { background: var(--idle-bg); border-radius: 5px; margin-top: 6px; }
.daycell { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; }
.daycell span { font-size: 12px; color: var(--muted); } .daycell.fixed { border-color: var(--brand); background: #fff8e8; }
.plan { margin: 6px 0; padding-left: 20px; } .plan li { margin-bottom: 4px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; }

@media (max-width: 820px) {
  .side { position: sticky; top: 0; z-index: 1000; height: auto; padding: 10px 12px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .brand { flex-direction: row; align-items: center; gap: 8px; padding: 0; } .brand img { height: 30px; } .brand small { display: none; }
  .menu-toggle { display: inline-block; margin-left: auto; }
  nav { display: none; flex-basis: 100%; max-height: 60vh; } nav.open { display: block; }
  .who { flex-basis: 100%; display: none; } nav.open ~ .who { display: block; }
  input, select, textarea, button, .btn { font-size: 16px; } button.small, .btn.small { font-size: 14px; padding: 6px 10px; }
  .totals { width: 100%; }
}
.notice.ok { background: var(--ok-bg, #e3f4ea); color: #14532d; }
/* Création d'un client sur le terrain : le bouton de position, puis ce qu'il a trouvé. */
.geo-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.geo-box button { padding: 10px 18px; }
#geoOut .notice { margin-bottom: 12px; line-height: 1.5; } #geoOut .notice .hint { color: inherit; opacity: .8; }
@media (max-width: 820px) { .geo-box button { width: 100%; min-height: 50px; font-size: 17px; } }

/* ── Saisie par cartes (téléphone et agents de terrain) ── */
.pfilter { display: grid; gap: 8px; margin-bottom: 10px; } .pfilter input { width: 100%; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; } .chips::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; border-radius: 99px; padding: 6px 14px; background: #fff; border: 1px solid var(--line); font-size: 14px; }
.chip.on { background: #14213d; color: #fff; border-color: #14213d; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pcard { display: grid; grid-template-columns: 72px 1fr; gap: 10px 12px; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.pcard.on { border-color: var(--brand); box-shadow: 0 0 0 2px #f4a30033; }
.pthumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; font-weight: 800; font-size: 20px; background: #eef1f6; }
.pinfo { display: grid; gap: 3px; min-width: 0; } .pinfo b { font-size: 15px; line-height: 1.25; } .pprice { font-weight: 700; color: #14213d; }
.pinfo select { width: 100%; margin-top: 4px; } .premise { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; } .premise input { width: 64px; text-align: right; }
.pstep { grid-column: 1 / -1; display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; }
.pstep button { height: 46px; font-size: 24px; font-weight: 700; border-radius: 12px; padding: 0; line-height: 1; } .pstep button[data-plus] { background: var(--brand); border-color: var(--brand); color: #14213d; }
.pstep button:disabled { opacity: .35; } .pstep input { height: 46px; text-align: center; font-size: 18px; font-weight: 700; border-radius: 12px; width: 100%; }
.cartbar { position: sticky; bottom: 0; z-index: 5; margin: 12px -4px 6px; background: #14213d; color: #fff; border-radius: 14px; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; box-shadow: 0 6px 18px #14213d33; }
.cartbar b { font-size: 18px; color: var(--brand); white-space: nowrap; }

/* ── Barre d'onglets en bas (téléphone) ── */
#tabbar { display: none; }
@media (max-width: 820px) {
  #tabbar:not([hidden]) { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; background: #fff; border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 14px #0000000f; }
  #tabbar a, #tabbar button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none; color: var(--muted); text-decoration: none; font-size: 11px; border-radius: 10px; min-width: 0; }
  #tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #tabbar a.on { color: #14213d; font-weight: 700; } #tabbar a.on svg { stroke: var(--brand); stroke-width: 2.4; }
  #tabbar i { position: absolute; top: 2px; left: 54%; background: var(--bad); color: #fff; border-radius: 9px; font-size: 10px; font-style: normal; padding: 0 5px; font-weight: 700; }
  main { padding: 14px 12px 96px; } .menu-toggle { display: none !important; }
  .side { padding: 10px 14px; } .panel { border-radius: 14px; padding: 14px; } .head h1 { font-size: 20px; }
  button, .btn { min-height: 44px; } button.small, .btn.small { min-height: 36px; } button.primary { border-radius: 12px; }
  .cartbar { bottom: 72px; } .pcards { grid-template-columns: 1fr; }
  #toast { bottom: 84px; } #toast.top { bottom: auto; top: 62px; }
}

/* ── Produits en photos, et produit en grand ── */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ptile { position: relative; display: grid; gap: 4px; justify-items: start; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 10px; min-height: 0; font-weight: 400; align-content: start; }
.ptile.on { border-color: var(--brand); box-shadow: 0 0 0 2px #f4a30055; }
.ptile .pthumb { width: 100%; height: auto; aspect-ratio: 1; font-size: 34px; border-radius: 10px; }
.ptile b { font-size: 14px; line-height: 1.25; } .ptile .pprice { font-size: 14px; line-height: 1.35; } .ptile small, .punit small { font-weight: 400; color: var(--muted); }
.ptile .hint { font-size: 12px; } .ptile .pill { font-size: 11px; }
.pbadge { position: absolute; top: 12px; left: 12px; right: 12px; background: #14213d; color: #fff; border-radius: 9px; padding: 4px 8px; font-size: 12px; font-weight: 700; text-align: center; }
.psheet { position: fixed; inset: 0; z-index: 2000; background: #14213d99; display: grid; align-items: end; justify-items: center; }
.psheet-in { position: relative; background: #fff; width: 100%; max-width: 520px; max-height: 94vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.psheet h2 { margin: 0; font-size: 19px; } .psheet p { margin: 0; }
.pbig { width: 100%; max-height: 42vh; object-fit: contain; border-radius: 14px; background: #f4f6f9; display: grid; } .pbig .pthumb { width: 100%; height: 180px; font-size: 56px; border-radius: 14px; }
.pclose { position: absolute; top: 10px; right: 10px; z-index: 1; width: 40px; height: 40px; min-height: 0; border-radius: 50%; font-size: 22px; padding: 0; line-height: 1; background: #fff; }
.punit { display: grid; grid-template-columns: 1fr minmax(150px, 190px); gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.punit > div:first-child { display: grid; gap: 2px; } .punit .pstep { grid-column: auto; grid-template-columns: 46px 1fr 46px; gap: 6px; }
.psum { background: #f4f6f9; border-radius: 12px; padding: 10px 12px; }
@media (min-width: 821px) { .psheet { align-items: center; } .psheet-in { border-radius: 20px; } }
@media (max-width: 820px) { .pgrid { grid-template-columns: 1fr 1fr; } }

.ccard { display: grid; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; text-decoration: none; color: inherit; }
.ccard b { font-size: 16px; } a.ptile { text-decoration: none; color: inherit; }

.ccard.stop { grid-template-columns: 38px 1fr; align-items: center; gap: 12px; scroll-margin-top: 70px; }
.stopn { width: 38px; height: 38px; border-radius: 50%; background: #14213d; color: #fff; display: grid; place-items: center; font-weight: 800; }
.stopinfo { display: grid; gap: 1px; min-width: 0; } .stop.next { border-color: var(--brand); box-shadow: 0 0 0 2px #f4a30055; } .stop.next .stopn { background: var(--brand); color: #14213d; }
.stop.done { opacity: .6; } .stop.done .stopn { background: var(--ok); } main .panel[id^="d"] { scroll-margin-top: 70px; }

/* ── Export Excel d'un tableau, objectifs de commission ── */
.goals { display: grid; gap: 10px; margin: 10px 0; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.goal { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 5px; background: #fff; align-content: start; }
.goal.done { border-color: #bfe3cd; background: #f6fbf8; }
.goal-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.prog { height: 10px; background: #e9edf3; border-radius: 9px; overflow: hidden; } .prog i { display: block; height: 100%; background: var(--brand); border-radius: 9px; min-width: 2px; }
.goal.done .prog i { background: var(--ok); }
@media print { #pageXl { display: none; } }

/* ── Journée de l'agent : le bloc du jour, les clients à visiter, la visite sans commande ── */
.notice.openvisit { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; border: 1px solid #e6c97a; }
.notice.openvisit .btn { flex: none; }
.dayboard { background: #14213d; color: #fff; border-radius: 16px; padding: 18px 18px 16px; margin-bottom: 14px; display: grid; gap: 12px; }
.dayboard p { margin: 0; }
.dayboard .count { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dayboard .count b { font-size: 52px; line-height: .9; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.dayboard .count span { font-size: 16px; color: #d5dcec; }
.dayboard.reached .count b { color: var(--brand); }
/* Un trait par visite : plein orange = commande, blanc = sans commande, pâle = à faire. */
.tally { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; height: 24px; }
.tally i { border-radius: 3px; background: #ffffff24; }
.tally i.sale, .sw.sale { background: var(--brand); } .tally i.nosale, .sw.nosale { background: #fff; }
.tally i.open { background: transparent; box-shadow: inset 0 0 0 2px var(--brand); }
.tally.bar { display: flex; gap: 0; border-radius: 6px; overflow: hidden; height: 14px; } .tally.bar i { border-radius: 0; min-width: 0; }
.dayfacts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dayfacts div { display: grid; gap: 2px; align-content: start; } .dayfacts b { font-size: 20px; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 7px; }
.dayfacts span { font-size: 12.5px; color: #d5dcec; line-height: 1.25; }
.sw { width: 10px; height: 10px; border-radius: 3px; background: #ffffff38; flex: none; }
.daytop { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: #d5dcec; }
.dayboard .why { font-size: 13px; color: #d5dcec; border-top: 1px solid #ffffff22; padding-top: 10px; }

.pushrow { margin-bottom: 14px; }
.pushhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; } .pushhead h2 { margin: 0; }
.pushlist { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; } .pushlist::-webkit-scrollbar { display: none; }
.pushitem { flex: none; width: 104px; display: grid; gap: 5px; justify-items: start; text-decoration: none; color: inherit; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: 12px; padding: 7px; }
.pushitem .pthumb { width: 100%; height: auto; aspect-ratio: 1; border-radius: 8px; font-size: 26px; }
.pushitem span:last-child { font-size: 12.5px; line-height: 1.25; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.goalline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: baseline; margin-top: 8px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; font-size: 13px; }
.goalline b { font-variant-numeric: tabular-nums; white-space: nowrap; } .goalline .prog { grid-column: 1 / -1; height: 6px; } .goalline.done .prog i { background: var(--ok); } .goalline.done b { color: var(--ok); }

.qrow { margin-bottom: 10px; } .qrow h2 { margin: 0 0 6px; font-size: 14px; } .qrow h2 .hint { font-weight: 400; margin-left: 4px; } .qrow .chips.wrap { margin: 0; }
.reqs { display: grid; gap: 8px; } .reqline { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.reqline > div { min-width: 0; overflow-wrap: anywhere; } .reqline .pill { flex: none; }
.reqline .hint { margin: 0; }
/* Demandes de visite hors programme, chez le responsable : une carte par demande, avec les deux réponses (se lit et se touche sur un téléphone). */
.askcards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.askcard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; padding: 14px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; background: #fff; overflow-wrap: anywhere; }
.askcard p { margin: 0; } .askcard .hint { margin: 0; } .askcard input { width: 100%; }
.askhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; } .askhead b { font-size: 16px; }
.asknote { padding: 8px 10px; border-radius: 8px; background: var(--info-bg); color: #173a70; }
.askbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .askbtns button { min-height: 42px; }
.askpast { margin-top: 14px; } .askpast > summary { cursor: pointer; font-weight: 600; } .askpast > summary .hint { font-weight: 400; margin-left: 4px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: #e6eaf3; border-radius: 12px; padding: 4px; margin-bottom: 10px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 9px 8px; font-weight: 600; color: var(--muted); min-height: 0; }
.seg button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #14213d26; }
.seg b { display: inline-block; min-width: 22px; margin-left: 4px; padding: 0 6px; border-radius: 9px; background: #14213d14; font-size: 12px; font-variant-numeric: tabular-nums; }
.seg button[aria-selected="true"] b { background: var(--brand); color: #14213d; }

#tourList { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); margin-bottom: 16px; } #tourList > .panel, #tourList > .more { grid-column: 1 / -1; margin: 0; }
.vcard { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; }
.vnum { width: 34px; height: 34px; border-radius: 50%; background: #14213d; color: #fff; display: grid; place-items: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.vcard.seen .vnum { background: #e6eaf3; color: var(--muted); }
.vwho { display: grid; gap: 2px; min-width: 0; } .vwho b { font-size: 16px; line-height: 1.25; } .vwho .hint { margin: 0; }
.vtags { display: flex; gap: 5px; flex-wrap: wrap; } .vtags:empty { display: none; }
.vmap { font-size: 13px; padding: 6px 2px; white-space: nowrap; }
.vacts { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.vacts > :only-child { grid-column: 1 / -1; text-align: center; } .vacts button, .vacts .btn { padding: 10px 6px; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.monthrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 16px; }
.monthrow > div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.monthrow span { font-size: 12px; color: var(--muted); } .monthrow b { font-size: 20px; font-variant-numeric: tabular-nums; } .monthrow .track { background: var(--idle-bg); border-radius: 5px; margin-top: 6px; }

/* Feuille « Visite sans commande » : un motif par bouton, large sous le pouce. */
.reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.reason { min-height: 52px; padding: 8px 10px; border-radius: 12px; text-align: left; font-weight: 600; line-height: 1.2; }
.reason[aria-checked="true"] { background: #14213d; border-color: #14213d; color: #fff; }
.psheet .field input { width: 100%; }

/* ── Produits à pousser (focus) ── */
.pimg { position: relative; display: block; width: 100%; }
.pflag { position: absolute; left: 0; bottom: 8px; background: var(--brand); color: #14213d; font-weight: 800; font-size: 11px; line-height: 1; padding: 5px 9px 5px 7px; border-radius: 0 8px 8px 0; }
.ptile.focus { border-color: #f4a30099; }
.chip.push { border-color: var(--brand); } .chip.push.on { background: var(--brand); color: #14213d; border-color: var(--brand); } .chip small { font-weight: 700; opacity: .75; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 6px 0; }
.chips.wrap .chip { max-width: 100%; display: inline-flex; align-items: baseline; gap: 5px; } .chips.wrap .chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* Dans la barre du total : les produits à pousser qui ne sont pas encore dans la commande. */
.cartbar { display: grid; gap: 8px; } .cartsum { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cartalso { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; border-bottom: 1px solid #ffffff22; } .cartalso::-webkit-scrollbar { display: none; }
.cartalso span { font-size: 12.5px; color: #d5dcec; white-space: nowrap; }
.cartalso button { white-space: nowrap; min-height: 32px; padding: 3px 10px; border-radius: 99px; background: transparent; color: #fff; border-color: var(--brand); font-size: 13px; }
.pwhy { background: #fff8e8; border-left: 4px solid var(--brand); border-radius: 0 10px 10px 0; padding: 8px 12px; margin: 0; }
h2.sect { font-size: 16px; margin: 4px 0 10px; }
.focards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-bottom: 16px; }
.focard { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: start; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 14px; padding: 10px 12px 10px 10px; text-decoration: none; color: inherit; }
.focard .pthumb { width: 84px; height: 84px; border-radius: 10px; font-size: 26px; object-fit: cover; }
.foinfo { display: grid; gap: 3px; min-width: 0; } .foinfo b { font-size: 16px; line-height: 1.25; } .foinfo small { color: var(--muted); font-weight: 400; }
.fonote { font-size: 13.5px; color: #5c3d05; } .fosold { font-size: 13px; margin-top: 3px; padding-top: 6px; border-top: 1px dashed var(--line); } .fosold.none { color: var(--muted); }
.goal .pushlist { margin-top: 4px; }
.star { border: 0; background: transparent; font-size: 22px; line-height: 1; padding: 2px 6px; color: #c5ccd9; min-height: 0; cursor: pointer; } .star.on { color: var(--brand); } span.star { cursor: default; }
button.star:hover { color: #e09600; }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; } .check input { width: 18px; height: 18px; accent-color: #14213d; }
.completebox { margin: 0 0 14px; padding: 12px 14px; border: 1px solid #f4a30066; background: #fffaf0; border-radius: 10px; display: grid; gap: 10px; } .completebox .hint { margin: 2px 0 0; }
.completebox img.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 6px; } [data-complete] .completebox { margin: 10px 0; }
.focusbox { margin-top: 14px; padding: 12px 14px; border: 1px solid #f4a30066; background: #fffaf0; border-radius: 10px; display: grid; gap: 10px; } .focusbox .hint { margin: 0; }
/* Planning par quartier : une ligne par quartier, une case par jour. */
.qgrid th, .qgrid td { text-align: center; padding: 6px 8px; } .qgrid th:first-child, .qgrid td:first-child { text-align: left; min-width: 180px; } .qgrid td.num, .qgrid th.num { text-align: right; }
/* Une longue liste (des dizaines de quartiers) défile dans son cadre : la ligne des jours reste en vue en haut, et « Sa semaine » juste en dessous. Un nom sans espace se coupe au lieu d'élargir la grille. */
#qGridBox { max-height: min(62vh, 620px); overflow: auto; scroll-padding-top: 44px; } .qgrid { border-collapse: separate; border-spacing: 0; }
.qgrid thead th { position: sticky; top: 0; z-index: 2; background: #fff; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); }
.qgrid td:first-child { max-width: 340px; overflow-wrap: anywhere; }
.qgrid .qcity { display: block; font-weight: 400; }
.qgrid thead .qall { min-height: 26px; margin-top: 2px; }
/* Ville et quartier d'après la position : une ligne par ville, ses quartiers en dessous. */
.placelist details { border-top: 1px solid var(--line); } .placelist details:last-child { border-bottom: 1px solid var(--line); }
.placelist summary { display: flex; align-items: baseline; gap: 10px; padding: 9px 4px; cursor: pointer; list-style: none; } .placelist summary::-webkit-details-marker { display: none; }
.placelist summary::before { content: '▸'; color: var(--muted); width: 12px; flex: none; } .placelist details[open] > summary::before { content: '▾'; }
.placelist summary .n { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.citypick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 16px; max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-top: 8px; background: #fff; }
.citypick label { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; font-weight: 400; color: inherit; cursor: pointer; min-width: 0; } .citypick label[hidden] { display: none; }
.citypick input { width: 18px; height: 18px; flex: none; accent-color: #14213d; } .citypick span:first-of-type { overflow-wrap: anywhere; } .citypick .hint { margin: 0 0 0 auto; font-variant-numeric: tabular-nums; }
#terrBox label.check { font-size: 14px; color: inherit; font-weight: 400; } #terrBox > label:first-child { margin-bottom: 2px; }
.plwho { margin-top: 8px; } .plwho > summary { cursor: pointer; font-weight: 600; } .plwho p { margin: 8px 0 0; line-height: 1.7; }
.placelist ul { list-style: none; margin: 0 0 12px; padding: 0 4px 0 26px; columns: 250px; column-gap: 32px; }
.placelist li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; break-inside: avoid; border-bottom: 1px dotted var(--line); overflow-wrap: anywhere; } .placelist li b { font-variant-numeric: tabular-nums; }
/* Au clavier : une case qui reçoit la main ne reste pas sous le bouton d'enregistrement posé en bas de l'écran. */
html:has(.savebar.dirty) { scroll-padding-bottom: 96px; }
.qgrid tr.on td { background: #fff8e8; } .qgrid thead th:nth-child(3) { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } .qgrid tbody td:nth-child(3) { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.qbox { display: grid; place-items: center; min-width: 34px; min-height: 30px; cursor: pointer; } .qbox input { width: 18px; height: 18px; accent-color: #14213d; }
.qweek th { text-align: left; width: 110px; font-size: 14px; color: var(--ink); } .qweek td { padding: 7px 10px; } .qweek th { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); }
details.panel > summary { cursor: pointer; }
/* Le bouton d'enregistrement du planning reste en vue tant qu'il reste des modifications à enregistrer. */
.savebar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.savebar.dirty { position: sticky; bottom: 12px; z-index: 5; border-color: var(--brand); box-shadow: 0 6px 18px #14213d26; } .savebar .hint { margin: 0; }
#planScreen.busy { opacity: .6; pointer-events: none; }                 /* pendant un enregistrement, rien ne se touche */
.planday { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.planday > .row { flex-wrap: nowrap; } .planday > .row select { flex: 1 1 0; min-width: 0; }
@media (max-width: 820px) {
  #tourList { grid-template-columns: 1fr; }
  .dayboard .count b { font-size: 56px; }
  .qgrid th:first-child, .qgrid td:first-child { min-width: 124px; max-width: 150px; }
  .qgrid th, .qgrid td { padding: 6px 4px; } .qgrid th.num, .qgrid td.num { display: none; }
  html:has(.savebar.dirty) { scroll-padding-bottom: 190px; }
  .qweek th { width: 84px; }
  .savebar.dirty { bottom: 76px; }
}
/* Sur un écran étroit (téléphone, tablette, petite fenêtre), la grille des quartiers défile aussi de côté : le nom du quartier reste en vue. */
@media (max-width: 1200px) {
  .qgrid th:first-child, .qgrid td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 var(--line); }
  .qgrid thead th:first-child { z-index: 3; box-shadow: inset 0 -1px 0 var(--line), 1px 0 0 var(--line); }
  .qgrid tr.on td:first-child { background: #fff8e8; }
}
@media (prefers-reduced-motion: no-preference) { .tally i.open { animation: tallyPulse 1.6s ease-in-out infinite; } }
@keyframes tallyPulse { 50% { opacity: .45; } }
/* Un mot plus long que la ligne (un nom sans espace) se coupe au lieu de pousser la page de côté… */
.notice, .hint, .qweek td, .head p, .head h1, .plan li, .vwho, .ccard, dl.dl dd { overflow-wrap: anywhere; }
/* … sauf dans les tableaux, où cette règle resserrerait les colonnes jusqu'à couper un numéro de téléphone ou un code-barres en deux. */
td .hint, th .hint { overflow-wrap: normal; } .qweek td.num { overflow-wrap: normal; white-space: nowrap; }
/* Un message qui arrive, ou qui est déjà là, ne couvre jamais le bouton d'enregistrement du planning ni une feuille ouverte : il passe en haut de l'écran. */
body:has(.savebar.dirty) #toast, body:has(.psheet) #toast { bottom: auto; top: 16px; }
@media (max-width: 820px) { body:has(.savebar.dirty) #toast, body:has(.psheet) #toast { bottom: auto; top: 62px; } }

/* Prime par produit : la liste de l'agent (un produit par ligne) et la liste du bureau. */
.goal.wide { grid-column: 1 / -1; }
.goalrows { display: grid; gap: 6px; margin-top: 4px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.goalrow { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 3px 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-decoration: none; color: inherit; }
.goalrow.done { border-color: #bfe3cd; background: #f6fbf8; }
.goalrow img, .goalrow .pthumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; grid-row: span 2; }
.goalrow .grname, .goalrow .grstate { display: grid; gap: 1px; min-width: 0; grid-column: 2; }
.goalrow .grstate { font-variant-numeric: tabular-nums; }
.goalrow.plain { grid-template-columns: minmax(0, 1fr); } .goalrow.plain .grname, .goalrow.plain .grstate { grid-column: 1; } .goalrow .grstate .pill { justify-self: start; }
.goalrow .prog { grid-column: 1 / -1; height: 5px; margin-top: 3px; } .goalrow.done .prog i { background: var(--ok); }
.bpbox { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.bpbox .bprows { max-height: 420px; overflow: auto; margin-top: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.bpbox .bprows th { position: sticky; top: 0; background: #fff; z-index: 1; }
.bpbox td.actions { white-space: nowrap; } .bpbox td.actions button + button { margin-left: 6px; }
.bplist summary { cursor: pointer; color: var(--link); } .bplist .scroll { max-height: 300px; overflow: auto; margin-top: 6px; }

/* Recherche dans le menu : on tape le nom d'un écran et on y va. */
.navfind { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.navfind input { width: 100%; background: #1c2d52; border-color: #34497a; color: #fff; padding: 8px 10px; }
.navfind input::placeholder { color: #9aa6c0; }
.navfind input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; background: #22365f; }
#navHits { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
#navHits[hidden] { display: none; }
#navHits a { display: grid; gap: 1px; color: #dfe4ef; text-decoration: none; padding: 7px 10px; border-radius: 7px; }
#navHits a b { font-weight: 600; } #navHits a span { font-size: 11.5px; color: #9aa6c0; }
#navHits a:hover { background: #22365f; color: #fff; }
#navHits a.at { background: var(--brand); color: #14213d; } #navHits a.at span { color: #3a3008; }
#navHits .findhelp, #navHits .findnone { font-size: 11.5px; color: #9aa6c0; margin: 6px 4px 0; line-height: 1.4; }
#navHits .findnone { font-size: 13px; color: #dfe4ef; }
.side.finding #nav { display: none; }
.side.finding .navfind { flex: 1; }
.panel.found, h2.found { animation: foundPulse 2.4s ease-out; }
@keyframes foundPulse { 0%, 55% { box-shadow: 0 0 0 3px var(--brand); } 100% { box-shadow: 0 0 0 3px transparent; } }
@media (max-width: 820px) {
  .navfind, .side.finding .navfind { display: none; flex: 0 0 100%; } .navfind.open, .side.finding .navfind.open { display: flex; }
  #navHits { max-height: 55vh; } #navHits .findhelp { display: none; }
}
main h2 { scroll-margin-top: 14px; }
@media (max-width: 820px) { main h2 { scroll-margin-top: 74px; } }
@media (prefers-reduced-motion: reduce) { .panel.found, h2.found { animation: none; outline: 3px solid var(--brand); } }

/* Ressources humaines : les étapes du dossier, les pièces à cocher. */
.hrsteps { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.hrstep { display: grid; gap: 2px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; border-left: 4px solid var(--warn); }
.hrstep.done { border-left-color: var(--ok); background: #f6fbf8; } .hrstep b { font-weight: 600; }
.hrfile { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.hrfile label.check { display: flex; gap: 8px; align-items: baseline; }
details.hint summary { cursor: pointer; color: var(--link); } details.hint p { margin: 6px 0; text-align: left; }

/* Vérification des liens : une ligne par contrôle (état, ce qui est relié et le résultat, où aller). Sur téléphone, l'état passe au-dessus. */
.verify { display: grid; gap: 0; }
.vrow { display: grid; grid-template-columns: 96px 1fr auto; gap: 4px 14px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line, #e6e9ef); }
.vrow:first-child { border-top: 0; }
.vrow.ok .vwhat b { font-weight: 500; }
.vres { margin-top: 2px; font-size: 13px; }
.verifylist { margin: 4px 0 4px 18px; padding: 0; } .verifylist li { margin: 2px 0; }
@media (max-width: 720px) { .vrow { grid-template-columns: 1fr auto; } .vstate { grid-column: 1 / -1; } }

/* Promotions de l'agent : sur l'écran d'entrée (cartes qui défilent), sur leur écran (prix avant et après), et pendant la saisie (bandeau, vignettes). */
.promostrip { margin-bottom: 14px; }
.promolist { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; } .promolist::-webkit-scrollbar { display: none; }
.promocard { flex: none; width: min(300px, 82vw); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: start; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--ok); border-radius: 12px; padding: 10px 12px; }
.promocard.soon { border-left-color: var(--info); }
.promopct { white-space: nowrap; flex: none; display: inline-grid; place-items: center; min-width: 58px; padding: 7px 8px; border-radius: 10px; background: var(--ok); color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -0.3px; font-variant-numeric: tabular-nums; }
.promocard.soon .promopct, .promoblock.soon .promopct { background: var(--info); }
.promotxt { display: grid; gap: 2px; min-width: 0; } .promotxt b { font-size: 14px; line-height: 1.25; } .promotxt > span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.promotxt .hint { margin: 0; font-size: 12px; }
.promothumbs { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 4px; }
.promothumbs .pthumb { width: 40px; height: 40px; border-radius: 8px; font-size: 13px; object-fit: cover; }
.promothumbs .pthumb.more { display: inline-grid; place-items: center; background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.promoblock .promohead { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; } .promoblock .promohead h2 { margin: 0 0 2px; }
.promosay { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--ok-bg); color: #14532d; font-weight: 600; }
.promoblock.soon .promosay { background: var(--info-bg); color: #173a70; }
.promorows { display: grid; gap: 6px; }
.promorow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; background: #fff; }
.promorow .pthumb { width: 44px; height: 44px; border-radius: 8px; font-size: 14px; object-fit: cover; }
.promoprices { display: grid; gap: 2px; justify-items: end; text-align: right; font-variant-numeric: tabular-nums; } .promoprices s { color: var(--muted); } .promoprices b { color: var(--ok); }
.promobanner { display: grid; gap: 6px; margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--ok-bg); border: 1px solid #b9dfc8; }
.promobanner > b { color: #14532d; } .promobanner span { display: flex; flex-wrap: wrap; gap: 6px; }
.promobanner button { padding: 5px 10px; border-radius: 999px; border: 1px solid #b9dfc8; background: #fff; font-size: 13px; }
.promobanner button b, .ok-text { color: var(--ok); }
.chip.promo { border-color: #b9dfc8; } .chip.promo.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.ptile.promo { border-color: #b9dfc8; } .pflag.promo { background: var(--ok); color: #fff; }
.pprice s { color: var(--muted); font-weight: 400; margin-right: 2px; }
@media (max-width: 520px) { .promorow { grid-template-columns: 40px minmax(0, 1fr); } .promoprices { grid-column: 1 / -1; justify-items: start; text-align: left; } }

/* Carte : les pastilles qui regroupent des clients proches, et les boutons « Tout voir » et « Ma position ». */
.mgroup { background: none; border: 0; }
.mgroup span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; color: #fff; font: 700 12.5px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  border: 3px solid rgba(255, 255, 255, 0.92); box-shadow: 0 1px 4px rgba(20, 33, 61, 0.35); cursor: pointer; }
.mapbtns a { width: auto !important; padding: 0 10px; font: 600 12.5px/30px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: #14213d; white-space: nowrap; }
.mapbtns a.busy { opacity: 0.55; }
@media (max-width: 820px) { #map, .map { height: min(62vh, 520px); } }
/* Les filtres de la liste des clients : sur une ligne au bureau ; sur un téléphone, deux par ligne, pour que la carte arrive tout de suite. */
.cfilters #fq { width: 300px; } .cfilters .viewtabs { margin: 0 0 0 auto; }
@media (max-width: 560px) {
  .cfilters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .cfilters #fq, .cfilters #fcount, .cfilters .viewtabs { grid-column: 1 / -1; } .cfilters #fq, .cfilters select { width: 100%; min-width: 0; }
  .cfilters #fcount:empty { display: none; }
  .cfilters .viewtabs { margin: 0; display: grid; grid-template-columns: 1fr 1fr; }
}

/* La page Tajer : le sommaire en haut, la liste des produits à cocher (photo petite, la liste défile). */
.tjnav { margin: 0 0 14px; } .tjnav .chip { text-decoration: none; color: inherit; }
.tjprods { max-height: 560px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.tjprods td { vertical-align: middle; } .tjprods .pthumb { width: 44px; height: 44px; font-size: 14px; border-radius: 8px; }
.tjprods input[type=checkbox] { width: 20px; height: 20px; }

/* ── Alertes de commandes : la cloche du menu, sa liste, et le message qui reste à l'écran ── */
nav .count.bad { background: #e5484d; color: #fff; }
.kpi.bad b { color: var(--bad); } .kpi.bad { border-color: #e7b9b5; }
.tabs button.tab-bad:not(.on) { border-color: #e7b9b5; color: var(--bad); }
.bell { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; border: 1px solid #2b4170; background: #1a2b4f; color: #dfe4ef; text-align: left; }
.bell:hover { border-color: var(--brand); }
.bell .bell-l { flex: 1; }
.bell i { font-style: normal; font-weight: 800; font-size: 12px; min-width: 24px; text-align: center; padding: 1px 7px; border-radius: 10px; background: #2b4170; color: #c9d1e2; font-variant-numeric: tabular-nums; }
.bell.has i { background: var(--brand); color: #14213d; }
.bell.late i { background: #e5484d; color: #fff; }
.bell.ring svg { animation: bellring .9s ease-in-out 2; transform-origin: 50% 12%; }
@keyframes bellring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(16deg); } 40% { transform: rotate(-13deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
.bellpanel { position: fixed; z-index: 2500; left: 244px; top: 70px; width: min(400px, calc(100vw - 260px)); max-height: calc(100vh - 40px); overflow-y: auto; background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px #14213d33; padding: 14px; }
.bellhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .bellhead h2 { margin: 0; }
.bellitem { display: grid; gap: 3px; padding: 9px 10px; margin-bottom: 6px; border-radius: 9px; text-decoration: none; color: inherit; background: #f6f7fa; border-left: 4px solid var(--info); }
.bellitem:hover { background: #eef1f6; }
.bellitem.late { border-left-color: var(--bad); background: #fdf1f0; } .bellitem.urgent { border-left-color: var(--brand); background: #fff8e8; }
.bellitem .bi-1 { display: flex; justify-content: space-between; gap: 10px; } .bellitem .bi-1 span { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bellitem .bi-2 { font-size: 13px; } .bellitem .hint { margin: 0; }
.bellopts { display: grid; gap: 8px; justify-items: start; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.opop { position: fixed; z-index: 2600; right: 18px; bottom: 18px; width: min(360px, calc(100vw - 24px)); background: #fff; color: var(--ink); border: 1px solid var(--line); border-left: 5px solid var(--brand);
  border-radius: 12px; box-shadow: 0 16px 38px #14213d40; padding: 12px 14px; animation: opopin .22s ease-out; }
.opop.late { border-left-color: var(--bad); }
@keyframes opopin { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.opop-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .opop-h b { font-size: 15px; }
.opop ul { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; gap: 6px; }
.opop li a { display: grid; gap: 2px; text-decoration: none; color: inherit; padding: 7px 9px; border-radius: 8px; background: #f6f7fa; }
.opop li a:hover { background: #eef1f6; } .opop li small { color: var(--muted); font-size: 12px; }
.opop .opop-l { display: flex; justify-content: space-between; gap: 10px; } .opop .opop-l span { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.opop-b { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.opop-x { border: 0; background: none; font-size: 22px; line-height: 1; padding: 2px 8px; color: var(--muted); min-height: 0 !important; }
.opop-x:hover { color: var(--ink); }
body:has(.savebar.dirty) .opop:not(.dock), body:has(.psheet) .opop:not(.dock) { bottom: auto; top: 16px; }
/* Rangé dans le menu (écran large) : à sa place, sous la cloche, sans rien couvrir. */
.opop.dock { position: static; width: auto; padding: 10px 11px; border-left-width: 4px; box-shadow: 0 0 0 3px #f4a30066; flex: none; }
.opop.dock.late { box-shadow: 0 0 0 3px #e5484d66; }
.opop.dock .opop-h b { font-size: 14px; line-height: 1.3; } .opop.dock ul { margin: 6px 0 8px; }
.opop.dock li a { padding: 6px 7px; } .opop.dock .opop-l { flex-wrap: wrap; gap: 0 8px; }
.opop.dock .opop-b { flex-direction: column-reverse; align-items: stretch; gap: 6px; } .opop.dock .opop-b > * { text-align: center; }
@media (prefers-reduced-motion: reduce) { .bell.ring svg, .opop { animation: none; } }
@media (max-width: 820px) {
  .bell { width: auto; margin-left: auto; padding: 6px 8px; border: 0; background: transparent; min-height: 40px; } .bell .bell-l { display: none; }
  .bellpanel { left: 8px !important; right: 8px; top: 56px !important; width: auto; max-height: calc(100vh - 150px); }
  .opop { left: 8px; right: 8px; width: auto; bottom: calc(70px + env(safe-area-inset-bottom)); padding: 9px 12px 10px; }
  .opop ul, .opop .opop-more, .opop .opop-b { display: none; }
  .opop .opop-sum { display: flex; }
  body:has(.savebar.dirty) .opop:not(.dock), body:has(.psheet) .opop:not(.dock) { bottom: auto; top: 62px; }
  body:has(#orderPop) #toast:not(.top) { bottom: 168px; }
}
.opop-sum { display: none; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 0; }
.opop-sum span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tajer, comptes des clients : chercher le client, et les accès donnés (numéro, mot de passe, WhatsApp). */
.tjnew { margin-bottom: 12px; align-items: end; }
.tjpick { position: relative; }
.tjhits { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; display: grid; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 26px #14213d22; overflow: hidden; }
.tjhits:empty { display: none; }
.tjhits button { display: grid; gap: 1px; text-align: left; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; background: #fff; }
.tjhits button:last-child { border-bottom: 0; } .tjhits button:hover, .tjhits button:focus-visible { background: var(--accent-soft); }
.tjhits button span { color: var(--muted); font-size: 12px; } .tjhits .hint { padding: 0 12px; }
.tjcred { margin: 0 0 14px; }
.tjid { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0; font-size: 15px; }
.tjid dt { color: inherit; opacity: .75; } .tjid dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.tjid .pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: 2px; }

/* Rapports : les cartes des rapports prêts et enregistrés ; l'écran d'un rapport (réglages, totaux, graphique, tableau classé). */
.xh { margin: 18px 0 10px; font-size: 16px; }
.xcards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 8px; }
.xcard { display: grid; gap: 4px; align-content: start; text-decoration: none; color: inherit; }
.xcard b { font-size: 15px; color: var(--ink); } .xcard a { text-decoration: none; } .xcard span { font-size: 13px; color: var(--muted); }
a.xcard:hover, .xcard:has(a:hover) { border-color: var(--accent); }
.xcard button { justify-self: start; margin-top: 4px; }
.xbuild { display: grid; gap: 12px; }
.xsrcs, .xrow { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: start; }
.xlab { font-size: 12px; color: var(--muted); font-weight: 600; padding-top: 7px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { text-decoration: none; color: inherit; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.xgrid { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.xf { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; } .xf select, .xf input { font-weight: 400; color: var(--ink); min-width: 150px; }
.xf0 { padding-bottom: 8px; }
.xfils { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.xfil { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 12px; border-radius: 99px; background: var(--accent-soft); font-size: 13px; cursor: pointer; }
.xpick { border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-width: 520px; background: #fff; }
.xpicklist { max-height: 280px; overflow-y: auto; display: grid; gap: 6px; padding: 2px; }
.xkpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 14px; } .xkpis .kpi b { font-size: 20px; }
.xchart { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.xbars { display: grid; gap: 5px; }
.xbar { display: grid; grid-template-columns: minmax(120px, 34%) 1fr minmax(90px, auto); gap: 10px; align-items: center; padding: 2px 4px; border-radius: 6px; }
.xbar:hover, .xbar:focus-visible { background: #f6f7fa; outline: none; }
.xbn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; } .xbn i { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; display: inline-block; min-width: 26px; }
.xbt { height: 14px; } .xbt b { display: block; height: 14px; max-height: 24px; background: var(--brand); border-radius: 0 4px 4px 0; min-width: 2px; }
.xbv { font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; white-space: nowrap; }
.xcols { width: 100%; height: auto; display: block; }
.xcols .xgrid-l { stroke: var(--line); stroke-width: 1; } .xcols .xbase { stroke: #b9c1d1; stroke-width: 1; }
.xcols .xcolm { fill: var(--brand); } .xcols .xcol:hover .xcolm, .xcols .xcol:focus .xcolm { fill: #c98600; } .xcols .xcol { outline: none; }
.xcols .xax { font-size: 11px; fill: var(--muted); } .xcols .xval { font-size: 11px; fill: var(--ink); font-weight: 700; }
.xres td.num { white-space: nowrap; }
.xname { display: inline-block; min-width: 10em; }
@media (max-width: 600px) { .xname { min-width: 7.5em; } }
.xrank { display: inline-block; min-width: 26px; padding: 1px 6px; border-radius: 99px; background: var(--accent-soft); text-align: center; font-weight: 700; font-size: 12px; }
#xtip { position: fixed; z-index: 3500; pointer-events: none; background: #14213d; color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 6px; white-space: nowrap; box-shadow: 0 6px 16px #14213d33; }
@media (max-width: 820px) {
  .xsrcs, .xrow { grid-template-columns: 1fr; gap: 4px; } .xlab { padding-top: 0; }
  .xgrid { display: grid; grid-template-columns: 1fr 1fr; } .xf select, .xf input { min-width: 0; width: 100%; }
  .xbar { grid-template-columns: minmax(90px, 40%) 1fr auto; }
}
.xtop { border-top: 0; padding-top: 0; }
.xmore > summary { cursor: pointer; font-weight: 600; color: var(--link); padding: 4px 0; }
.xmore[open] > summary { margin-bottom: 12px; }
@media (max-width: 820px) {
  .xsrcs .chips.wrap { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .xtop .xfils { grid-column: 1 / -1; }
}
