/* ============================================================
   BakeryOS — Couche Opérations (v0.9.0)
   Styles : Parc matériel · Planning · Paie · Calendrier · édition recette ·
   conversations assistant · modale + formulaires génériques.
   100% thème-aware (variables de app.css), Jour / Nuit.
   ============================================================ */

/* —————————————————— Formulaires génériques —————————————————— */
.bk-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.bk-toolbar .lbl, .rec-new-btn .lbl { display: inline; }
.bk-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bk-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.bk-field { display: block; margin-bottom: 12px; }
.bk-lbl { display: block; font-size: 11.5px; font-weight: 700; color: var(--txt-2); text-transform: uppercase; letter-spacing: .4px; margin: 0 2px 6px; }
.bk-lbl i { font-style: normal; font-weight: 600; color: var(--txt-3); text-transform: none; letter-spacing: 0; }
.bk-in {
  width: 100%; box-sizing: border-box; padding: 11px 13px; font: inherit; font-size: 15px;
  border: 1px solid var(--ligne-fort); border-radius: var(--rayon-sm); background: var(--surface-2); color: var(--txt);
  transition: border-color var(--t-rapide), box-shadow var(--t-rapide), background var(--t-rapide);
}
.bk-in:focus { outline: none; border-color: var(--ble); box-shadow: 0 0 0 3px rgba(212,169,58,.18); background: var(--surface); }
textarea.bk-in { resize: vertical; line-height: 1.5; }
.bk-check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--txt); margin: 4px 2px 6px; cursor: pointer; }
.bk-check input { width: 18px; height: 18px; accent-color: var(--croute); }
.bk-title { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 4px 0 16px; }
.bk-hint, .bk-disclaimer {
  display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--txt-2);
  background: var(--surface-2); border: 1px solid var(--ligne); border-radius: var(--rayon-sm); padding: 10px 13px; margin: 0 0 14px;
}
.bk-disclaimer { margin: 18px 0 0; }
.bk-hint svg, .bk-disclaimer svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--ambre); margin-top: 1px; }
.bk-empty { text-align: center; color: var(--txt-2); padding: 40px 16px; }
.bk-empty > svg { width: 44px; height: 44px; color: var(--croute); opacity: .6; }
.bk-empty p { max-width: 460px; margin: 14px auto 18px; line-height: 1.55; }
.bk-empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* —————————————————— Modale générique —————————————————— */
.bk-modal {
  position: fixed; inset: 0; z-index: 230; display: grid; place-items: start center;
  padding: max(24px, env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  background: rgba(30, 17, 6, .55); backdrop-filter: blur(4px); overflow: auto;
  animation: bk-fade .2s ease both;
}
@keyframes bk-fade { from { opacity: 0; } to { opacity: 1; } }
.bk-card {
  position: relative; width: 100%; max-width: 540px; margin: auto 0; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--ligne-fort); border-radius: 20px;
  padding: 24px 22px 20px; box-shadow: 0 30px 80px rgba(0,0,0,.45);
  animation: gate-in .32s cubic-bezier(.2,.7,.2,1) both;
}
.bk-x { position: absolute; top: 13px; right: 13px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--ligne-fort); background: var(--surface-2); color: var(--txt); cursor: pointer; display: grid; place-items: center; }
.bk-x svg { width: 16px; height: 16px; }
.bk-h { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--croute); margin: 0 30px 16px 0; }
:root[data-theme="nuit"] .bk-h { color: var(--ble-clair); }
.bk-body { max-height: none; }
.bk-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.bk-foot .btn { padding: 11px 18px; }
.bk-confirm-msg { font-size: 15px; line-height: 1.5; color: var(--txt); margin: 0; }

/* —————————————————— Recettes : tableau multi-fournées —————————————————— */
.rec-mult-table th:first-child, .rec-mult-table td:first-child { text-align: left; }
.rec-mult-table tbody tr.rec-tot td { background: var(--surface-2); font-weight: 700; border-top: 2px solid var(--ligne-fort); }
.rec-mult-table tbody tr.rec-tot.rec-tot-soft td { font-weight: 600; color: var(--txt-2); border-top: 0; }
.mult-add { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.mult-add .mult-input { margin-left: 0; flex: 0 0 120px; }
.mult-add .btn { flex: 0 0 auto; }
/* Traduction de la fiche (anglais) */
.rec-xlate-btn { width: 100%; margin-top: 12px; justify-content: center; }
.rec-xlate-hint { font-size: 12px; margin-top: 6px; text-align: center; }
.rec-xlate.ok { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--txt-2); font-size: 13px; font-weight: 600; }
.rec-xlate.ok .btn { flex: 0 0 auto; }

/* —————————————————— Cockpit IA du tableau de bord —————————————————— */
.dash-ai { padding: 18px 20px 20px; margin-bottom: 18px; border-color: var(--ligne-fort);
  background: linear-gradient(180deg, var(--surface), var(--surface-2)); box-shadow: var(--ombre-2); }
.dash-ai-h { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.dash-ai-ic { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--croute), #8a561f); color: #fff; box-shadow: 0 6px 16px rgba(122,74,30,.32); }
.dash-ai-ic svg { width: 22px; height: 22px; }
.dash-ai-t { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.dash-ai-sub { font-size: 13px; color: var(--txt-2); margin-top: 1px; }
.dash-ai-bar { display: flex; align-items: flex-end; gap: 9px; }
.dash-ai-input { flex: 1; resize: none; max-height: 120px; box-sizing: border-box; border: 1px solid var(--ligne-fort);
  border-radius: 16px; padding: 13px 16px; font: inherit; font-size: 15px; background: var(--surface); color: var(--txt); line-height: 1.4; }
.dash-ai-input:focus { outline: none; border-color: var(--ble); box-shadow: 0 0 0 3px rgba(212,169,58,.2); }
.dash-ai-input::placeholder, .pp-ai-in::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-ai-bar .asst-send { flex: 0 0 42px; height: 42px; }
.dash-ai-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dash-ai-chips .asst-chip { font-size: 13px; padding: 8px 14px; }

/* —————————————————— Édition manuelle générique (kv + tableaux) —————————————————— */
.ed-list, .ed-table { display: grid; gap: 8px; margin-bottom: 10px; }
.ed-kv-row { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 8px; align-items: center; }
.ed-trow { display: grid; gap: 8px; align-items: center; }
.ed-thead { display: grid; gap: 8px; padding: 0 2px 2px; }
.ed-thead span { font-size: 11px; font-weight: 700; color: var(--txt-2); text-transform: uppercase; letter-spacing: .4px; }
.ed-kv-row .bk-in, .ed-trow .bk-in { padding: 9px 11px; }
.ed-kv-row .btn, .ed-trow .btn { flex: 0 0 auto; }
@media (max-width: 640px) {
  .ed-trow { grid-template-columns: 1fr 1fr auto !important; }
  .ed-thead { display: none; }
}

/* —————————————————— Parc matériel —————————————————— */
.parc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.parc-card { display: flex; flex-direction: column; overflow: hidden; }
.parc-photo { height: 150px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.parc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.parc-photo.ph svg { width: 44px; height: 44px; color: var(--ligne-fort); }
.parc-card-body { padding: 14px 16px 16px; }
.parc-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.parc-card-h b { font-family: var(--serif); font-size: 17px; }
.parc-type { font-size: 12px; color: var(--txt-2); text-transform: uppercase; letter-spacing: .6px; margin: 2px 0 8px; }
.parc-card .dl { font-size: 13.5px; }
.parc-card .dl .row { padding: 7px 0; }
.parc-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--txt-2); margin-top: 10px;
  background: var(--surface-2); border-radius: var(--rayon-xs); padding: 9px 11px; }
.parc-note svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--levain); margin-top: 1px; }
.parc-actions { display: flex; gap: 8px; margin-top: 12px; }
.ab-photo-wrap { margin-bottom: 12px; }
.ab-photo { width: 100%; height: 170px; border-radius: var(--rayon-sm); overflow: hidden; background: var(--surface-2); display: grid; place-items: center; padding: 0; border: 1px solid var(--ligne); }
.ab-photo.ph { border: 2px dashed var(--ligne-fort); cursor: pointer; color: var(--txt-2); gap: 8px; }
.ab-photo.ph svg { width: 30px; height: 30px; color: var(--croute); }
.ab-photo.ph span { font-size: 13px; font-weight: 600; }
.ab-photo img { width: 100%; height: 100%; object-fit: cover; }
.ab-photo-actions { display: flex; gap: 8px; margin-top: 8px; }
.bk-scan { text-align: center; padding: 26px 10px; color: var(--txt-2); }
.bk-scan > svg { width: 40px; height: 40px; color: var(--croute); }
.bk-scan-spin { width: 30px; height: 30px; margin: 14px auto 12px; border: 3px solid var(--ligne-fort); border-top-color: var(--ble); border-radius: 50%; animation: bk-spin .8s linear infinite; }
@keyframes bk-spin { to { transform: rotate(360deg); } }

/* —————————————————— Équipe —————————————————— */
.emp-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: middle; flex: 0 0 11px; }

/* —————————————————— Planning (rota) —————————————————— */
/* ————— Planning / rota ————— */
.pl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.pl-week { display: flex; flex-direction: column; line-height: 1.15; }
.pl-week .muted { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; }
.pl-week b { font-family: var(--serif); font-size: 18px; }
.pl-head .pl-today { margin-left: auto; }
.pl-jump { width: 150px; padding: 7px 9px; font-size: 12.5px; color: var(--txt); cursor: pointer; }
.pl-jump::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
:root[data-theme="nuit"] .pl-jump::-webkit-calendar-picker-indicator { filter: invert(.8); }
.pl-pdf-btn { margin-left: 0; }
/* — Creneaux reutilisables : replies par defaut, la grille est la vue de travail — */
.pl-slots { padding: 0; margin-bottom: 14px; overflow: hidden; }
.pl-slots-sum { list-style: none; display: flex; align-items: center; gap: 9px; padding: 13px 16px; cursor: pointer; user-select: none; flex-wrap: wrap; }
.pl-slots-sum::-webkit-details-marker { display: none; }
.pl-slots-sum svg { width: 17px; height: 17px; color: var(--croute); flex: 0 0 17px; }
:root[data-theme="nuit"] .pl-slots-sum svg { color: var(--ble); }
.pl-slots-sum b { font-family: var(--serif); font-size: 15px; }
.pl-sum-dots { display: flex; gap: 4px; align-items: center; }
.pl-sum-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.pl-slots-sum .muted { font-size: 12px; color: var(--txt-3); }
.pl-sum-chev { margin-left: auto; display: flex; transition: transform .18s ease; color: var(--txt-3); }
.pl-sum-chev svg { width: 15px; height: 15px; color: inherit; }
.pl-slots[open] .pl-sum-chev { transform: rotate(90deg); }
.pl-slots[open] .pl-slots-sum { border-bottom: 1px solid var(--ligne); }
.pl-slots-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 8px; padding: 12px 16px 2px; }
.pl-slot-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 9px; background: var(--surface-2); border: 1px solid var(--ligne); border-radius: var(--rayon-sm); }
.pl-slot-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.pl-slot-name { flex: 1 1 110px; min-width: 84px; font-weight: 600; border-color: transparent; background: transparent; }
.pl-slot-name:hover, .pl-slot-name:focus { border-color: var(--ligne-fort); background: var(--surface); }
.pl-slot-times { display: flex; align-items: center; gap: 5px; }
.pl-st { width: 60px; padding: 6px 4px; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.pl-slot-off { font-size: 12px; color: var(--txt-2); font-style: italic; }
.pl-slot-h { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; color: var(--croute); min-width: 44px; text-align: right; }
:root[data-theme="nuit"] .pl-slot-h { color: var(--ble-clair); }
.pl-split-btn { border: 1px solid var(--ligne); background: var(--surface-2); color: var(--txt-2); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; padding: 3px 9px; border-radius: 20px; }
.pl-split-btn:hover { border-color: var(--ble); color: var(--croute); }
.pl-slot-addbtn { margin: 10px 16px 14px; }
/* — Grille hebdo : la piece maitresse — */
.pl-grid-card { padding: 0; overflow-x: auto; }
.pl-grid { min-width: 820px; }
.pl-grid-row { display: grid; grid-template-columns: 172px repeat(7, 1fr) 68px; border-bottom: 1px solid var(--ligne); }
.pl-grid-row:last-child { border-bottom: 0; }
.pl-grid-head { background: var(--surface-2); border-bottom: 1px solid var(--ligne-fort); }
.pl-grid-day { padding: 8px 6px 7px; text-align: center; border-left: 1px solid var(--ligne); }
.pl-grid-head .pl-grid-day b { display: block; font-size: 9.5px; letter-spacing: .9px; text-transform: uppercase; color: var(--txt-2); margin-bottom: 1px; }
.pl-dnum { font-family: var(--serif); font-size: 16px; color: var(--txt); line-height: 1; }
.pl-grid-day.wknd, .pl-grid-cell.wknd:not(.on):not(.hol), .pl-grid-cov-c.wknd { background: color-mix(in srgb, var(--croute) 5%, transparent); }
.pl-grid-day.today { box-shadow: inset 0 -2.5px 0 var(--croute); }
.pl-grid-day.today b, .pl-grid-day.today .pl-dnum { color: var(--croute); }
:root[data-theme="nuit"] .pl-grid-day.today { box-shadow: inset 0 -2.5px 0 var(--ble); }
:root[data-theme="nuit"] .pl-grid-day.today b, :root[data-theme="nuit"] .pl-grid-day.today .pl-dnum { color: var(--ble); }
.pl-grid-emp { display: flex; align-items: center; gap: 7px; padding: 9px 10px; border-right: 1px solid var(--ligne-fort); position: sticky; left: 0; background: var(--surface); z-index: 2; }
.pl-emp-id { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pl-emp-id b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-emp-id .muted { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-ord { display: flex; flex-direction: column; gap: 1px; flex: 0 0 auto; }
.pl-ord-b { width: 17px; height: 14px; padding: 0; line-height: 1; font-size: 7.5px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ligne); border-radius: 4px; background: var(--surface-2); color: var(--txt-2); cursor: pointer; }
.pl-ord-b:hover:not(:disabled) { border-color: var(--ble); color: var(--croute); }
.pl-ord-b:disabled { opacity: .25; cursor: default; }
:root[data-theme="nuit"] .pl-ord-b:hover:not(:disabled) { color: var(--ble-clair); }
.pl-grid-cell { position: relative; padding: 6px 5px 5px; border-left: 1px solid var(--ligne); min-height: 54px; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.pl-grid-cell.on { background: color-mix(in srgb, var(--slotc) 15%, transparent); box-shadow: inset 3px 0 0 var(--slotc); }
.pl-grid-cell.hol { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--slotc) 13%, transparent) 0 6px, transparent 6px 12px); box-shadow: inset 3px 0 0 var(--slotc); }
.pl-grid-cell.off { background: repeating-linear-gradient(45deg, transparent, transparent 5px, var(--surface-2) 5px, var(--surface-2) 10px); }
.pl-grid-cell:not(.on):not(.off):not(.hol):hover { background: color-mix(in srgb, var(--ble) 8%, transparent); }
.pl-assign { width: 100%; border: 0; background: transparent; font: inherit; font-size: 12.5px; color: var(--txt); appearance: none; -webkit-appearance: none; -moz-appearance: none; padding: 2px 0; cursor: pointer; text-align: center; text-align-last: center; border-radius: 6px; }
.pl-grid-cell.on .pl-assign { font-weight: 650; }
.pl-grid-cell.hol .pl-assign { font-weight: 600; color: var(--slotc); }
.pl-grid-cell.off .pl-assign { color: var(--txt-3); font-style: italic; }
.pl-grid-cell:not(.on):not(.off):not(.hol) .pl-assign { color: var(--txt-3); opacity: .5; }
.pl-grid-cell:not(.on):not(.off):not(.hol):hover .pl-assign { opacity: .9; }
.pl-assign:focus-visible { outline: 1.5px dashed var(--ble); outline-offset: 1px; }
.pl-grid-sub { display: block; text-align: center; font-size: 10.5px; color: var(--txt-2); font-variant-numeric: tabular-nums; letter-spacing: .2px; min-height: 13px; }
.pl-grid-tot { display: flex; align-items: center; justify-content: center; padding: 6px; border-left: 1px solid var(--ligne-fort); font-variant-numeric: tabular-nums; }
.pl-grid-tot b { background: color-mix(in srgb, var(--ble) 13%, transparent); padding: 2px 9px; border-radius: 999px; font-size: 12.5px; white-space: nowrap; }
/* — Couverture (pied de grille) : effectif + heures posees par jour — */
.pl-grid-cov { background: var(--surface-2); border-top: 1px solid var(--ligne-fort); }
.pl-cov-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .7px; color: var(--txt-3); }
.pl-grid-cov-c { text-align: center; padding: 7px 4px 6px; border-left: 1px solid var(--ligne); display: flex; flex-direction: column; line-height: 1.25; }
.pl-grid-cov-c b { font-size: 13px; color: var(--croute); }
:root[data-theme="nuit"] .pl-grid-cov-c b { color: var(--ble); }
.pl-grid-cov-c span { font-size: 10px; color: var(--txt-3); font-variant-numeric: tabular-nums; }
.pl-grid-cov-c.today b { text-decoration: underline 2px var(--croute); text-underline-offset: 3px; }
.pl-cov-tot b { background: color-mix(in srgb, var(--vert) 14%, transparent); }
/* Editable employee colour bubble (native colour input styled as a dot) */
.emp-dot-pick { -webkit-appearance: none; -moz-appearance: none; appearance: none; border: none; padding: 0; width: 15px; height: 15px; flex: 0 0 15px; border-radius: 50%; cursor: pointer; background: none; }
.emp-dot-pick::-webkit-color-swatch-wrapper { padding: 0; }
.emp-dot-pick::-webkit-color-swatch { border: none; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.emp-dot-pick::-moz-color-swatch { border: none; border-radius: 50%; }
.emp-dot-pick:hover { box-shadow: 0 0 0 2px var(--ble); }
/* — Suivi des conges — */
.pl-slots-h { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.pl-slots-h svg { width: 18px; height: 18px; color: var(--croute); flex: 0 0 18px; }
:root[data-theme="nuit"] .pl-slots-h svg { color: var(--ble); }
.pl-slots-h b { font-family: var(--serif); font-size: 16px; }
.pl-slots-h .muted { font-size: 12px; color: var(--txt-3); }
.pl-hol { padding: 14px 16px; }
.pl-hol-list { display: grid; gap: 6px; margin: 10px 0 12px; }
.pl-hol-row { display: flex; align-items: center; gap: 9px; padding: 7px 10px; background: var(--surface-2); border: 1px solid var(--ligne); border-radius: var(--rayon-sm); flex-wrap: wrap; }
.pl-hol-name { flex: 1 1 auto; font-size: 14px; }
.pl-hol-bar { flex: 0 1 110px; min-width: 60px; height: 5px; border-radius: 99px; background: var(--surface); border: 1px solid var(--ligne); overflow: hidden; }
.pl-hol-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ble), var(--croute)); border-radius: 99px; }
.pl-hol-stat { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--txt-2); min-width: 58px; text-align: right; }
.pl-hol-stat b { color: var(--croute); font-size: 14px; }
:root[data-theme="nuit"] .pl-hol-stat b { color: var(--ble); }
.pl-hol-left b { color: var(--vert); }
.pl-hol-left.neg b { color: var(--rouge); }
.pl-hol-cfg { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pl-hol-cfg .bk-lbl { margin: 0; }
.pl-hol-cfg .pl-st { width: 72px; }
@media (max-width: 720px) {
  .pl-grid-row { grid-template-columns: 128px repeat(7, minmax(88px, 1fr)) 60px; }
  .pl-slots-list { grid-template-columns: 1fr; }
}
/* — Production : feuille du jour — */
.pr-sheet { display: grid; gap: 14px; margin-top: 4px; }
.pr-progwrap { display: flex; align-items: center; gap: 10px; }
.pr-prog { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; flex: 1 1 auto; max-width: 320px; }
.pr-prog-bar { height: 100%; background: linear-gradient(90deg, var(--ble), var(--croute)); border-radius: 999px; transition: width .35s ease; }
.pr-prog-lbl { font-size: 13px; color: var(--txt-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.pr-cat { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 12px 14px; }
.pr-cat-h { font-family: var(--serif); font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--croute); margin-bottom: 6px; }
:root[data-theme="nuit"] .pr-cat-h { color: var(--ble); }
.pr-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--ligne); }
.pr-row:last-child { border-bottom: 0; }
/* Print-only tick: an empty box on screen (preview of the paper), never interactive — ticked by pen on the printout. */
.pr-chk { box-sizing: border-box; display: inline-block; width: 16px; height: 16px; flex: 0 0 16px; border: 1.6px solid var(--ligne-fort); border-radius: 4px; background: var(--surface); }
.pr-qty { min-width: 36px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--croute); background: color-mix(in srgb, var(--ble) 15%, transparent); border-radius: var(--rayon-sm); padding: 2px 7px; font-size: 13px; }
:root[data-theme="nuit"] .pr-qty { color: var(--ble); }
.pr-qty-0 { background: none; }
.pr-label { flex: 1 1 auto; font-size: 14.5px; }
.pr-edit { gap: 8px; }
.pr-qin { width: 56px; text-align: center; }
.pr-lin { flex: 1 1 auto; min-width: 80px; }
.pr-cin { width: 132px; flex: 0 0 auto; }
.pr-addbtn { margin-top: 8px; }
/* — Client orders on the production sheet — */
.pr-ord { padding: 7px 0; border-bottom: 1px solid var(--ligne); }
.pr-ord-h { display: flex; align-items: center; gap: 8px; }
.pr-ord-c { font-weight: 600; flex: 1 1 auto; }
.pr-ord-act { flex: 0 0 auto; display: flex; gap: 2px; }
.pr-ord-lines { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 3px; }
.pr-ord-line { font-size: 14px; color: var(--txt-2); }
.pr-ord-line b { color: var(--txt); }
/* — Production graph setup (P1) — */
.pg-busy, .pg-empty { padding: 22px 18px; display: flex; align-items: center; gap: 12px; color: var(--txt-2); font-size: 14px; }
.pg-empty { flex-direction: column; text-align: center; }
.pg-busy svg, .pg-empty svg { width: 24px; height: 24px; color: var(--ble); flex: 0 0 24px; }
.pg-flags { padding: 14px 16px; border-left: 3px solid var(--ble); }
.pg-flag { padding: 9px 0; border-bottom: 1px solid var(--ligne); }
.pg-flag:last-child { border-bottom: 0; }
.pg-flag.warn .pg-flag-q { color: var(--rouge); font-weight: 600; }
.pg-flag-r { display: inline-block; font-size: 11px; font-weight: 600; color: var(--croute); background: var(--surface-2); border: 1px solid var(--ligne); border-radius: 6px; padding: 1px 8px; margin-bottom: 5px; }
:root[data-theme="nuit"] .pg-flag-r { color: var(--ble-clair); }
.pg-savedbar { background: color-mix(in srgb, var(--vert) 13%, transparent); border: 1px solid color-mix(in srgb, var(--vert) 35%, transparent); color: var(--vert); border-radius: var(--rayon); padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.pg-savedbar svg { width: 18px; height: 18px; flex: 0 0 18px; }
.pg-allok { background: color-mix(in srgb, var(--vert) 11%, transparent); border: 1px solid color-mix(in srgb, var(--vert) 30%, transparent); color: var(--vert); border-radius: var(--rayon); padding: 11px 14px; margin-bottom: 14px; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.pg-allok svg { width: 18px; height: 18px; flex: 0 0 18px; }
.pg-review { border-color: color-mix(in srgb, var(--ble) 45%, var(--ligne)) !important; }
.pg-review-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pg-pend { display: flex; align-items: center; gap: 8px; margin: 4px 0 4px 8px; padding: 5px 9px; border-radius: var(--rayon-sm); background: color-mix(in srgb, var(--ble) 14%, transparent); border: 1px solid color-mix(in srgb, var(--ble) 35%, transparent); font-size: 11.5px; }
.pg-pend-q { flex: 1 1 auto; min-width: 0; color: var(--txt-2); }
.pg-pend-q b { color: var(--croute); }
:root[data-theme="nuit"] .pg-pend-q b { color: var(--ble); }
.pg-pend .icon-btn { flex: 0 0 auto; padding: 3px; }
.pg-pend .pg-pa { color: var(--vert); }
.pg-pend .pg-pr { color: var(--txt-3); }
.pg-pend .icon-btn svg { width: 15px; height: 15px; }
.pg-pend-in { width: 58px; height: 28px; flex: 0 0 auto; text-align: center; }
.pp-stations { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 2px; }
.pp-st { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 4px 11px; border: 1px solid var(--ligne-fort); border-radius: var(--rayon-pill); background: var(--surface); color: var(--txt-3); cursor: pointer; }
.pp-st svg { width: 13px; height: 13px; }
.pp-st.on { background: color-mix(in srgb, var(--ble) 18%, transparent); border-color: var(--ble); color: var(--croute); font-weight: 500; }
:root[data-theme="nuit"] .pp-st.on { color: var(--ble); }
.pg-flag-q { font-size: 13.5px; margin-bottom: 6px; }
.pg-flag-a { width: 100%; }
.pg-sum { display: grid; gap: 8px; margin: 12px 0; }
.pg-sum-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.pg-sum-row b { color: var(--croute); }
.pg-chip { background: var(--surface-2); border: 1px solid var(--ligne); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.pg-dough { padding: 12px 14px; margin-bottom: 12px; }
.pg-dough-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.pg-dough-h b { font-family: var(--serif); font-size: 15px; }
.pg-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.pg-kind-bread { background: color-mix(in srgb, #c9971f 18%, transparent); color: #8a6510; }
.pg-kind-enriched { background: color-mix(in srgb, #a9760a 18%, transparent); color: #7a4a1e; }
.pg-kind-laminated { background: color-mix(in srgb, #a9760a 24%, transparent); color: #6e3f14; }
.pg-kind-pastry { background: color-mix(in srgb, #b1506a 16%, transparent); color: #8a3550; }
:root[data-theme="nuit"] .pg-kind-bread, :root[data-theme="nuit"] .pg-kind-enriched, :root[data-theme="nuit"] .pg-kind-laminated { color: var(--ble-clair); }
.pg-prod { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--ligne); }
.pg-prod:last-child { border-bottom: 0; }
.pg-prod-n { font-size: 14px; }
.pg-paton { width: 66px; text-align: center; }
.pg-unit { font-size: 12px; color: var(--txt-2); margin-left: -4px; }
.pg-yield { font-size: 12px; color: var(--croute); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 78px; text-align: right; }
:root[data-theme="nuit"] .pg-yield, :root[data-theme="nuit"] .pg-sum-row b { color: var(--ble); }
.pg-ok { color: #2e7d4f; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.pg-know { padding: 14px 16px; }
.pg-know-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--ligne); }
.pg-know-row:last-child { border-bottom: 0; }
.pg-know-qa { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pg-know-q { font-size: 12.5px; color: var(--txt-2); }
.pg-know-a { font-size: 13.5px; color: var(--ink, var(--txt)); font-weight: 500; }
.pg-know-row .icon-btn { flex: 0 0 auto; opacity: .55; }
.pg-know-row .icon-btn:hover { opacity: 1; }
/* — Products page — */
.pp-head { gap: 8px; flex-wrap: wrap; }
.pp-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--ligne); flex-wrap: wrap; }
.pp-row:last-child { border-bottom: 0; }
.pp-nm { flex: 2 1 150px; min-width: 110px; font-weight: 500; }
.pp-cat { flex: 0 0 auto; width: 120px; }
.pp-wt { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.pp-paton { width: 60px; text-align: center; }
.pp-rec { flex: 1 1 130px; min-width: 100px; }
.pp-dough { flex: 1 1 130px; min-width: 100px; }
/* — Production bake plan (computed mixes) — */
.pr-bake-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pr-mixer-w { margin-left: auto; font-size: 12px; color: var(--txt-2); font-weight: 400; text-transform: none; letter-spacing: 0; }
.pr-mixer { width: 56px; text-align: center; }
.pr-bk-d { margin: 8px 0 4px; }
.pr-bk-dh { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; }
.pr-bk-dh b { font-size: 14px; }
.pr-bk-mix { margin-left: auto; font-size: 12px; font-weight: 500; color: #6a4a12; background: var(--goldbg, color-mix(in srgb, var(--ble) 16%, transparent)); padding: 2px 10px; border-radius: 20px; white-space: nowrap; }
:root[data-theme="nuit"] .pr-bk-mix { color: var(--ble); }
.pr-bk-row { display: flex; align-items: center; gap: 10px; padding: 5px 0 5px 8px; border-bottom: 1px solid var(--ligne); }
.pr-bk-row:last-child { border-bottom: 0; }
.pr-bk-nm { flex: 1 1 auto; font-size: 14px; }
.pr-bk-t { width: 60px; text-align: center; }
/* On-screen qty inputs on the production sheet → 44px finger targets, 16px font (15px triggers iOS input zoom). Print/fitclone neutralise these heights. */
.pr-bk-t, .pr-qin { min-height: 44px; font-size: 16px; padding-top: 8px; padding-bottom: 8px; }
.pr-bk-w { font-size: 11.5px; color: var(--txt-3); min-width: 56px; }
.pr-bk-row.on { background: color-mix(in srgb, var(--ble) 8%, transparent); border-radius: var(--rayon-sm); }
.pr-mode { display: inline-flex; align-items: stretch; border: 1px solid var(--ligne); border-radius: 7px; overflow: hidden; flex: 0 0 auto; }
.pr-mode-b { min-height: 36px; padding: 4px 10px; font-size: 13px; color: var(--txt-2); font-weight: 500; border: 0; background: none; cursor: pointer; }
.pr-mode-b.on { background: var(--croute); color: #fbf3df; }
.pr-mode-b:disabled { opacity: .35; cursor: not-allowed; }
/* — Action-bar overflow menu (native <details> disclosure for secondary actions) — */
.prod-actmenu { position: relative; display: inline-flex; }
.prod-actmenu > summary { list-style: none; cursor: pointer; }
.prod-actmenu > summary::-webkit-details-marker { display: none; }
.prod-actmenu > summary::marker { content: ''; }
.prod-actmenu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,.18); min-width: max-content; }
.prod-actmenu-pop .btn { width: 100%; justify-content: flex-start; }
.pr-bk-out { font-size: 12px; color: var(--croute); font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; font-weight: 500; }
:root[data-theme="nuit"] .pr-bk-out { color: var(--ble); }
/* The dough header carries the BASE recipe's qty cell inline (the dough IS that recipe's mix). In print the mode
   toggles are hidden, so it collapses to a single sharp line: name · qty · kg · pétrins. */
.pr-bk-dh { flex-wrap: wrap; gap: 6px 8px; }
.pr-bk-dh > .pr-bk-nm { flex: 0 1 auto; font-size: 13.5px; font-weight: 700; }
.pr-bk-dh .pr-bk-mix { margin-left: auto; background: none; padding: 0; font-size: 11.5px; }
.pr-bk-tot { background: none; padding: 0 0 0 8px; }
.pr-bk-base { display: inline-flex; align-items: center; gap: 6px; }
/* Thin coloured left-edge = the dough type (replaces the repeated PAIN / PÂTE ENRICHIE / FEUILLETÉ tags). */
.pr-bk-d { margin: 5px 0 4px; border-left: 2px solid var(--ligne-fort); padding-left: 9px; }
.pr-bk-d.pr-k-bread { border-left-color: #c9971f; }
.pr-bk-d.pr-k-enriched { border-left-color: #a9760a; }
.pr-bk-d.pr-k-laminated { border-left-color: #6e3f14; }
.pr-bk-d.pr-k-pastry { border-left-color: #b1506a; }
/* Tray-up checklist: TWO columns so 20–30 products stay on one A4 page, as tight as possible but readable. */
.pr-2col { column-count: 2; column-gap: 18px; }
.pr-2col > .pr-row { break-inside: avoid; }
.pr-tu { padding: 1px 0 1px 2px; border-bottom: 0; gap: 7px; }
.pr-tu .pr-label { font-size: 11.5px; line-height: 1.25; }
.pr-tu .pr-chk { width: 10px; height: 10px; flex: 0 0 10px; }
.pr-tu-edit { padding: 2px 0; }
/* In-row reorder / remove controls (✎ Edit): move a product up/down or take it off the sheet. */
.pr-rowctl { display: inline-flex; gap: 1px; margin-left: auto; flex: 0 0 auto; }
.pr-rowctl .icon-btn { width: 22px; height: 22px; }
.pr-tu-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 7px; }
/* A SUB-RECIPE pulled from the base dough (ciabatta from baguette dough): nested + slightly smaller, with a tick to show it derives from the dough above. */
.pr-bk-sub { padding-left: 24px; position: relative; }
.pr-bk-sub::before { content: "↳"; position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--txt-3); font-size: 12px; }
.pr-bk-sub .pr-bk-nm { font-size: 12.5px; color: var(--txt-2); }
.pr-bk-sub .pr-bk-out { font-size: 11px; }
.pr-bk-ku { font-size: 11px; color: var(--txt-3); font-weight: 600; }
.pr-bk-tot { margin-left: 10px; font-size: 12px; font-weight: 600; color: var(--croute); background: var(--surface-2); padding: 2px 9px; border-radius: 20px; text-transform: none; letter-spacing: 0; }
.pr-tplhint { display: flex; align-items: center; gap: 8px; background: color-mix(in srgb, var(--ble) 10%, transparent); border-radius: var(--rayon-sm); padding: 8px 12px; margin: 6px 0 10px; font-size: 12.5px; color: var(--txt-2); }
.pr-tplhint svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--ble); }
.pr-sec-h { display: flex; align-items: center; gap: 8px; }
.pr-sec-lab { font-weight: 600; }
.pr-sec-ct { font-size: 12px; color: var(--txt-3); font-weight: 500; }
.pr-secctl { margin-left: auto; display: inline-flex; gap: 1px; }
.pr-secctl .icon-btn { padding: 3px; color: var(--txt-3); }
.pr-secctl .icon-btn svg { width: 16px; height: 16px; }
.pr-sec-title { max-width: 220px; font-weight: 600; }
.pr-sec-off { opacity: .5; }
.pr-rsub { font-size: 11px; color: var(--txt-3); margin-left: 6px; }
.pr-qrow { display: flex; align-items: center; gap: 10px; }
.pr-qrow .pr-qlabel { flex: 1 1 auto; min-width: 0; }
.pr-qrow .pr-bk-t { width: 60px; flex: 0 0 auto; }
.pr-qrow .pr-qunit { min-width: 38px; text-align: left; color: var(--txt-3); }
.pr-qrow .pr-mode { flex: 0 0 auto; }
.pr-facts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 2px 0 8px 32px; font-size: 11.5px; color: var(--txt-3); }
.pr-facts svg { width: 13px; height: 13px; flex: 0 0 auto; }
.pr-factin { width: 50px; height: 28px; text-align: center; }
.pr-factu { color: var(--txt-3); }
.pr-temp { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--txt-3); margin-left: 8px; }
.pr-tempin { width: 56px; height: 28px; text-align: center; }
.pr-temptgl { margin-left: auto; }
.pr-tag { font-size: 10.5px; padding: 1px 7px; border-radius: 20px; margin-left: 6px; font-weight: 500; white-space: nowrap; }
.pr-t-tom { background: color-mix(in srgb, var(--ble) 18%, transparent); color: #2f5c8a; }
:root[data-theme="nuit"] .pr-t-tom { color: var(--ble); }
.pr-empty { display: flex; align-items: center; gap: 7px; padding: 7px 2px; font-size: 12px; }
.pr-empty svg { width: 15px; height: 15px; flex: 0 0 auto; }
.pr-addsec { margin-top: 6px; }
.pr-secadd { color: var(--croute); }
:root[data-theme="nuit"] .pr-secadd { color: var(--ble); }
.pr-secadd.on { background: color-mix(in srgb, var(--ble) 20%, transparent); border-radius: var(--rayon-sm); }
.pr-picker { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 2px 12px; margin-bottom: 4px; border-bottom: 1px dashed var(--ligne); }
.pr-pchip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 5px 11px 5px 8px; border: 1px solid var(--ligne-fort); border-radius: var(--rayon-pill); background: var(--surface-2); color: var(--txt-2); cursor: pointer; }
.pr-pchip svg { width: 14px; height: 14px; }
.pr-pchip.on { background: color-mix(in srgb, var(--ble) 18%, transparent); border-color: var(--ble); color: var(--txt); font-weight: 500; }
.pr-pdone { margin-left: auto; }
.pr-mixerline { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12px; color: var(--txt-3); margin: 2px 0 8px; }
.pr-mixerline .pr-mixer { width: 54px; text-align: center; }
.pr-mixerline .pr-bk-tot { color: var(--croute); font-weight: 600; }
:root[data-theme="nuit"] .pr-mixerline .pr-bk-tot { color: var(--ble); }
.pr-tplbar { background: var(--surface-2); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 10px 14px; margin-bottom: 2px; }
.pr-tplbar-h { display: flex; align-items: center; gap: 7px; font-family: var(--serif); font-size: 13px; color: var(--croute); margin-bottom: 7px; }
:root[data-theme="nuit"] .pr-tplbar-h { color: var(--ble); }
.pr-tplbar-h svg { width: 16px; height: 16px; }
.pr-ttabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pr-ttab { font-size: 12.5px; padding: 5px 12px; border: 1px solid var(--ligne-fort); border-radius: var(--rayon-pill); background: var(--surface); color: var(--txt-2); cursor: pointer; }
.pr-ttab.on { background: var(--croute); color: #fbf3df; border-color: var(--croute); font-weight: 500; }
:root[data-theme="nuit"] .pr-ttab.on { background: var(--ble); color: #1c1712; border-color: var(--ble); }
.pr-tnew { display: inline-flex; align-items: center; padding: 5px 9px; }
.pr-tnew svg { width: 15px; height: 15px; }
.pr-tacts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pr-asnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.pr-asn-h { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--txt-3); margin-right: 4px; }
.pr-asn { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 46px; padding: 5px 7px; border: 1px solid var(--ligne); border-radius: var(--rayon-sm); background: var(--surface); cursor: pointer; }
.pr-asn.on { border-color: var(--ble); background: color-mix(in srgb, var(--ble) 14%, transparent); }
.pr-asn-d { font-size: 11px; font-weight: 600; color: var(--txt-2); }
.pr-asn-t { font-size: 10px; color: var(--txt-3); max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-asn.on .pr-asn-t { color: var(--croute); }
:root[data-theme="nuit"] .pr-asn.on .pr-asn-t { color: var(--ble); }
.pr-printhead { display: none; }
.pr-tplnow { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--txt-3); margin-bottom: 2px; }
.pr-tplnow svg { width: 15px; height: 15px; }
.pr-daystrip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.pr-daystrip > svg { width: 16px; height: 16px; color: var(--croute); }
:root[data-theme="nuit"] .pr-daystrip > svg { color: var(--ble); }
.pr-daystrip-l { font-size: 12px; color: var(--txt-3); }
.pr-daychip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 5px 12px; border: 1px solid var(--ligne-fort); border-radius: var(--rayon-pill); background: var(--surface); color: var(--txt-2); cursor: pointer; }
.pr-daychip svg { width: 14px; height: 14px; }
.pr-daychip.on { background: var(--croute); color: #fbf3df; border-color: var(--croute); font-weight: 500; }
:root[data-theme="nuit"] .pr-daychip.on { background: var(--ble); color: #1c1712; border-color: var(--ble); }
.pr-dayover { font-size: 11.5px; color: var(--txt-3); display: inline-flex; align-items: center; gap: 5px; }
.pr-dayclear { border: 0; background: none; color: var(--croute); cursor: pointer; font-size: 11.5px; text-decoration: underline; padding: 0; }
:root[data-theme="nuit"] .pr-dayclear { color: var(--ble); }
.pr-dowsel { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin: 4px 0 8px; }
.pr-dow-b { font-size: 11.5px; padding: 5px 10px; border: 1px solid var(--ligne); border-radius: 7px; background: var(--surface-2); color: var(--txt-2); font-weight: 500; cursor: pointer; }
.pr-dow-b.on { background: var(--croute); color: #fbf3df; border-color: var(--croute); }
:root[data-theme="nuit"] .pr-dow-b.on { background: var(--ble); color: #2a1c0c; border-color: var(--ble); }
.pr-dowcopy { margin-left: auto; }
/* (bloc rota dupliqué supprimé — la grille v0.80 plus haut fait foi : F6) */

/* —————————————————— Paie —————————————————— */
.pa-list { display: grid; gap: 12px; }
.pa-item { display: flex; align-items: center; gap: 14px; padding: 15px 18px; cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; }
.pa-item-main { display: flex; flex-direction: column; min-width: 0; }
.pa-item-main b { font-family: var(--serif); font-size: 17px; }
.pa-item-main .muted { font-size: 13px; }
.pa-item-net { margin-left: auto; text-align: right; flex: 0 0 auto; }
.pa-item-net .muted { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; display: block; }
.pa-item-net b { font-family: var(--serif); font-size: 20px; color: var(--vert); }
.pa-item-chev { color: var(--txt-3); display: flex; } .pa-item-chev svg { width: 18px; height: 18px; }
.cot-lib { padding: 8px 10px; text-align: left; }
.cot-tx { padding: 8px 8px; text-align: right; max-width: 92px; }
.pa-totals { display: flex; flex-direction: column; gap: 2px; }
.pa-tot-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; font-size: 14.5px; }
.pa-tot-row b { font-variant-numeric: tabular-nums; }
.pa-tot-row.neg b { color: var(--rouge); }
.pa-tot-row.net { border-top: 1px solid var(--ligne); margin-top: 2px; padding-top: 11px; font-size: 16px; }
.pa-tot-row.net b { font-family: var(--serif); font-size: 22px; color: var(--vert); }
.pa-tot-sep { height: 1px; background: var(--ligne); margin: 8px 0; }
.pa-tot-row.cout b { color: var(--croute); } :root[data-theme="nuit"] .pa-tot-row.cout b { color: var(--ble-clair); }

/* —————————————————— Calendrier —————————————————— */
.cal-mlabel { font-family: var(--serif); font-size: 16px; font-weight: 600; min-width: 130px; text-align: center; text-transform: capitalize; }
.cal-wrap { padding: 14px 14px 16px; }
.cal-grid-h { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 6px; }
.cal-wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--txt-2); text-transform: uppercase; letter-spacing: .5px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-cell { position: relative; aspect-ratio: 1 / 1; border: 1px solid var(--ligne); border-radius: 10px; background: var(--surface-2);
  cursor: pointer; padding: 6px; display: flex; flex-direction: column; align-items: flex-start; font: inherit; color: var(--txt);
  transition: border-color var(--t-rapide), background var(--t-rapide), transform var(--t-rapide); }
.cal-cell:hover { border-color: var(--ble); transform: translateY(-1px); }
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.empty:hover { transform: none; }
.cal-num { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-cell.today { border-color: var(--ble); box-shadow: inset 0 0 0 1px var(--ble); }
.cal-cell.today .cal-num { color: var(--croute); } :root[data-theme="nuit"] .cal-cell.today .cal-num { color: var(--ble-clair); }
.cal-cell.sel { background: linear-gradient(160deg, var(--croute), #8a561f); border-color: var(--croute); color: #fff; }
.cal-cell.sel .cal-num { color: #fff; }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; margin-top: auto; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; }
.cal-ev { display: flex; gap: 10px; align-items: flex-start; padding: 11px 2px; border-bottom: 1px solid var(--ligne); }
.cal-ev:last-child { border-bottom: 0; }
.cal-ev-bar { width: 4px; align-self: stretch; border-radius: 4px; flex: 0 0 4px; min-height: 30px; }
.cal-ev-body { flex: 1; min-width: 0; }
.cal-ev-t { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cal-ev-act { display: flex; gap: 4px; flex: 0 0 auto; }
/* Slim strip shown above the sheet when the day has zero events — low-chrome, no card. */
.pr-evstrip { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 2px; margin: 0 0 6px; }
.pr-evstrip-l { font-size: 12.5px; color: var(--txt-2); }
/* Keep the slim strip off the printed A4, just like the events card was (app.css hides .page > .card). */
@media print { .pr-evstrip { display: none !important; } }
.timeline li { position: relative; }
.timeline .ms-del { position: absolute; right: 0; top: 0; border: 0; background: transparent; color: var(--txt-3); cursor: pointer; padding: 2px; opacity: .6; }
.timeline .ms-del:hover { color: var(--rouge); opacity: 1; }
.timeline .ms-del svg { width: 15px; height: 15px; }
.chk-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 14px; }
.chk-tog { width: 24px; height: 24px; padding: 0; justify-content: center; border-radius: 50%; border: 0; cursor: pointer; flex: 0 0 24px; }
.chk-tog svg { width: 14px; height: 14px; }
.chk-row .chk-del { margin-left: auto; opacity: .55; }
.chk-row .chk-del:hover { opacity: 1; }

/* —————————————————— Recettes : liste + édition —————————————————— */
.rec-top { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.rec-top .rec-search-wrap { flex: 1; margin-bottom: 0; }
.rec-new-btn { flex: 0 0 auto; white-space: nowrap; }
.rec-detail-top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.rec-detail-actions { margin-left: auto; display: flex; gap: 8px; }
.re-ings { display: grid; gap: 9px; }
.re-row { display: flex; gap: 8px; align-items: center; }
.re-row .bk-in { padding: 9px 11px; }
.re-row .re-g { flex: 0 0 92px; text-align: right; }
.re-row .btn { flex: 0 0 auto; }
.re-steps { display: grid; gap: 14px; }
.re-step-h { display: flex; gap: 8px; align-items: center; margin-bottom: 7px; }
.re-step-n { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; }

/* —————————————————— Assistant : conversations —————————————————— */
.conv-bar { display: flex; align-items: center; gap: 10px; padding: 0 0 12px; border-bottom: 1px solid var(--ligne); margin-bottom: 12px; }
.conv-new { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; border: 1px solid var(--ligne-fort); background: var(--surface);
  color: var(--txt); border-radius: 30px; padding: 8px 13px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.conv-new:hover { border-color: var(--ble); background: var(--surface-2); }
.conv-new svg { width: 15px; height: 15px; }
.conv-chips { display: flex; gap: 7px; overflow-x: auto; flex: 1; padding: 2px; scrollbar-width: thin; }
.conv-chip { flex: 0 0 auto; border: 1px solid var(--ligne); background: var(--surface-2); color: var(--txt-2); border-radius: 30px;
  padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all var(--t-rapide); }
.conv-chip:hover { border-color: var(--ble); }
.conv-chip.actif { background: var(--croute); color: #fff; border-color: var(--croute); }
.conv-tools { display: flex; gap: 6px; flex: 0 0 auto; }
.conv-tools .icon-btn { width: 34px; height: 34px; }
.conv-tools .icon-btn svg { width: 16px; height: 16px; }

/* —————————————————— Responsive —————————————————— */
@media (max-width: 920px) {
  .conv-bar { position: sticky; top: 0; background: var(--bg); z-index: 8; padding-top: 4px; }
}
@media (max-width: 720px) {
  .parc-grid { grid-template-columns: 1fr; }
  .bk-grid2, .bk-grid3 { grid-template-columns: 1fr; }
  .pl-day { flex-wrap: wrap; }
  .pl-dname { flex: 1 0 100%; }
  .pl-h { min-width: 0; }
  .cal-wrap { padding: 10px 6px 12px; }
  .cal-grid, .cal-grid-h { gap: 3px; }
  .cal-cell { padding: 4px; border-radius: 8px; }
  .cal-num { font-size: 12px; }
  .conv-new span { display: none; }
}
@media (max-width: 560px) {
  .cal-mlabel { min-width: 92px; font-size: 14px; }
}

/* ============================================================
   PRODUITS v2 — calm family surface (v0.30.0)
   Families = the baker's shop sections; each card is a readable
   mirror of what the AI derived; the override layer hides inside
   an opened card. Theme-aware (Jour + Nuit) via design tokens.
   ============================================================ */
.pp-fams { display: flex; flex-direction: column; gap: 14px; }
.pp-fam-h { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 4px 10px; background: none; border: none; cursor: pointer; text-align: left; }
.pp-fam-tw { color: var(--txt-3); font-size: 12px; width: 12px; }
.pp-fam-nm { font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; font-weight: var(--fw-semibold); color: var(--txt-2); }
.pp-fam-c { color: var(--txt-3); font-size: var(--fs-label); font-weight: var(--fw-medium); }
.pp-fam-body { display: flex; flex-direction: column; gap: 8px; }

.pp-card { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon-sm); overflow: hidden; transition: border-color var(--t-rapide); }
.pp-card.open { border-color: var(--ligne-fort); }
.pp-card.has-pend { border-color: var(--ble); }
.pp-card-h { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 12px; background: none; border: none; cursor: pointer; text-align: left; }
.pp-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pp-card-nm { font-family: var(--serif); font-size: var(--fs-card); font-weight: var(--fw-semibold); color: var(--txt); line-height: 1.1; }
.pp-card-sum { font-size: var(--fs-micro); color: var(--txt-3); font-variant-numeric: tabular-nums; }
.pp-pendmark { display: inline-block; font-size: 10px; color: var(--croute); background: var(--ble-clair); border-radius: var(--rayon-pill); padding: 1px 8px; margin: 1px 0 1px; align-self: flex-start; font-weight: var(--fw-semibold); }
.pp-chev { color: var(--txt-3); flex: none; display: flex; }
.pp-chev svg { width: 16px; height: 16px; }

.pp-dots { display: flex; gap: 5px; padding: 0 12px 11px; }
.pp-dot { width: 17px; height: 17px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 8.5px; font-weight: var(--fw-semibold); color: var(--txt-3); background: var(--surface-2); border: 1px solid var(--ligne); }
.pp-dot.on { background: var(--ble); color: var(--croute-fonce); border-color: var(--ble); }

.pp-ovr { padding: 12px; border-top: 1px dashed var(--ligne); background: var(--surface-2); }
.pp-lk { font-size: 11px; margin-left: 4px; opacity: .85; }

/* Family selector inside an opened card (v0.31.0) — reassign → stations/flow re-derive instantly. */
.pp-fampick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.pp-fampick-l { font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--txt-3); margin-right: 2px; }
.pp-fp { font-size: 12px; padding: 5px 11px; border-radius: var(--rayon-pill); border: 1px solid var(--ligne-fort); background: var(--surface); color: var(--txt-2); cursor: pointer; }
.pp-fp.on { background: var(--ble); border-color: var(--ble); color: var(--croute-fonce); font-weight: var(--fw-semibold); }

/* AI console on the Products page (v0.32.0) — you talk, the AI edits your products. */
.pp-ai { background: var(--surface); border: 1px solid var(--ligne-fort); border-radius: var(--rayon-sm); padding: 10px; margin-bottom: 14px; }
.pp-ai-feed { margin-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.pp-ai-u { align-self: flex-end; max-width: 85%; background: var(--surface-2); color: var(--txt); border-radius: 12px 12px 4px 12px; padding: 6px 10px; font-size: var(--fs-body-sm); }
.pp-ai-a { font-size: var(--fs-body-sm); color: var(--txt-2); line-height: 1.45; }
.pp-ai-a.pp-ai-think { color: var(--txt-3); }
.pp-ai-a.pp-ai-err { color: var(--rouge); }
.pp-ai-ok { color: var(--vert); }
.pp-ai-ok svg, .pp-ai-think svg { width: 13px; height: 13px; vertical-align: -2px; }
.pp-ai-bar { display: flex; align-items: flex-end; gap: 8px; }
.pp-ai-in { flex: 1; resize: none; min-height: 38px; max-height: 120px; line-height: 1.35; }
.pp-ai-go { flex: none; background: var(--ble); color: var(--croute-fonce); width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0; }
.pp-ai-go svg { width: 17px; height: 17px; }

/* ============================================================
   PRODUCTION SHEET v2 — the approved "print-preview" skin (v0.34)
   Book-serif on warm paper · crust rules · gold · KPI chips ·
   2-column body · sign-off. Theme-aware (Jour + Nuit). The sheet
   IS the live editor (+ ajouter on every section). Prints clean.
   ============================================================ */
.pr-paper { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 20px 18px 14px; box-shadow: var(--ombre-1); font-variant-numeric: tabular-nums; }
.pr-paphead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pr-eyebrow { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--croute); font-weight: 600; }
:root[data-theme="nuit"] .pr-eyebrow { color: var(--ble-clair); }
.pr-ptitle { font-family: var(--serif); font-size: 27px; font-weight: 600; line-height: 1; margin-top: 3px; color: var(--txt); }
.pr-plive { display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--croute); background: var(--ble-clair); border-radius: 20px; padding: 2px 9px; font-weight: 600; margin-top: 8px; }
:root[data-theme="nuit"] .pr-plive { color: var(--ble); background: color-mix(in srgb, var(--ble) 16%, transparent); }
.pr-pdate { font-family: var(--serif); font-size: 16px; color: var(--ble); font-weight: 600; text-align: right; }
.pr-pbakers { font-size: 11px; color: var(--txt-2); margin-top: 2px; text-align: right; }
.pr-rule-d { border-top: 2px solid var(--croute); margin: 11px 0 0; }
:root[data-theme="nuit"] .pr-rule-d { border-color: var(--ble); }
.pr-rule-g { border-top: 1px solid var(--ble); opacity: .5; margin-top: 2px; }
.pr-chips { display: flex; gap: 7px; flex-wrap: wrap; margin: 13px 0 4px; }
.pr-chip2 { background: var(--bg); border: 1px solid var(--ligne); border-radius: var(--rayon-sm); padding: 5px 11px; min-width: 52px; }
.pr-chip2 .k { font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--txt-3); }
.pr-chip2 .v { font-family: var(--serif); font-size: 16px; color: var(--croute); font-weight: 600; }
:root[data-theme="nuit"] .pr-chip2 .v { color: var(--ble); }
.pr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; margin-top: 10px; }
@media (max-width: 640px) { .pr-cols { grid-template-columns: 1fr; gap: 0; } }
/* section blocks live flat inside the paper (the card chrome is the paper itself) */
.pr-paper .pr-cat { background: none; border: 0; border-radius: 0; padding: 0; margin-bottom: 13px; }
.pr-paper .pr-sec-h { padding-bottom: 4px; border-bottom: 1px solid var(--ble); margin-bottom: 5px; }
.pr-paper .pr-sec-lab { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--croute); font-weight: 700; }
:root[data-theme="nuit"] .pr-paper .pr-sec-lab { color: var(--ble-clair); }
.pr-paper .pr-secadd { margin-left: auto; border: 1px dashed var(--ble); border-radius: 14px; padding: 1px 8px; color: var(--ble); width: auto; height: auto; gap: 2px; }
.pr-paper .pr-secadd .lbl { font-size: 10px; font-weight: 600; }
.pr-paper .pr-secadd svg { width: 12px; height: 12px; }
/* sign-off + foot (for the printed sheet) */
.pr-signoff { display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.pr-so { flex: 1 1 110px; }
.pr-so .l { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-3); }
.pr-so .line { border-bottom: 1px solid var(--croute); height: 17px; }
.pr-papfoot { display: flex; justify-content: space-between; margin-top: 13px; padding-top: 8px; border-top: 1px solid var(--ligne); font-size: 10.5px; color: var(--txt-3); }
.pr-papfoot .b { font-family: var(--serif); color: var(--croute); }
:root[data-theme="nuit"] .pr-papfoot .b { color: var(--ble); }
/* Off-screen clone used to measure the print height for auto-fit (mirrors @media print density EXACTLY,
   so the measured height matches the printout — tightened whitespace, fonts kept at screen size). */
.pr-fitclone { visibility: hidden; }
/* Mirror @media print's hidden controls so the measured height matches the PRINTOUT, not the screen.
   These never print, so they must not inflate the measured height (or the auto-fit zooms text too small). */
.pr-fitclone .pr-plive, .pr-fitclone .pr-secadd, .pr-fitclone .pr-secctl, .pr-fitclone .pr-mode,
.pr-fitclone .pr-picker, .pr-fitclone .pr-temptgl, .pr-fitclone .pr-dowsel { display: none !important; }
.pr-fitclone .pr-cat { margin-bottom: 6px !important; }
.pr-fitclone .pr-sec-h { margin-bottom: 3px !important; padding-bottom: 3px !important; }
.pr-fitclone .pr-row, .pr-fitclone .pr-qrow, .pr-fitclone .pr-srow, .pr-fitclone .pr-bk-row, .pr-fitclone .pr-prod, .pr-fitclone .pr-titem { padding: 2px 0 !important; }
.pr-fitclone .pr-bk-dh { margin: 4px 0 2px !important; }
.pr-fitclone .pr-chips { margin: 8px 0 2px !important; }
.pr-fitclone .bk-in, .pr-fitclone .pr-bk-t, .pr-fitclone .pr-qin, .pr-fitclone .pr-factin { height: auto !important; min-height: 0 !important; padding: 0 2px !important; line-height: 1.05 !important; }
.pr-fitclone .pr-row, .pr-fitclone .pr-qrow, .pr-fitclone .pr-srow, .pr-fitclone .pr-bk-row { line-height: 1.1 !important; }
.pr-fitclone .pr-chk { width: 13px !important; height: 13px !important; flex: 0 0 13px !important; }

/* — Calendar → production link — */
.cal-prod { position: absolute; top: 4px; right: 4px; color: var(--croute); opacity: .5; pointer-events: none; }
.cal-prod svg { width: 12px; height: 12px; }
.cal-cell.sel .cal-prod { color: #fff; opacity: .8; }
:root[data-theme="nuit"] .cal-prod { color: var(--ble); }
.cal-prodsum { display: flex; flex-wrap: wrap; gap: 10px; }
.cps { background: var(--surface-2); border: 1px solid var(--ligne); border-radius: var(--rayon-sm); padding: 8px 14px; min-width: 82px; }
.cps-k { font-size: 11px; color: var(--txt-3); text-transform: uppercase; letter-spacing: .4px; }
.cps-v { font-size: 20px; font-weight: 600; font-family: var(--serif); color: var(--croute); }
:root[data-theme="nuit"] .cps-v { color: var(--ble); }

/* — Insights / Analyses — */
.ins-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ins-kpi { background: var(--surface-2); border: 1px solid var(--ligne); border-radius: 12px; padding: 14px 16px; }
.ins-kv { font-size: 26px; font-weight: 600; font-family: var(--serif); color: var(--croute); line-height: 1.1; }
:root[data-theme="nuit"] .ins-kv { color: var(--ble); }
.ins-kl { font-size: 12px; color: var(--txt-2); margin-top: 3px; }
.ins-ks { font-size: 11.5px; color: var(--txt-3); margin-top: 2px; }
.ins-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--txt-2); }
.ins-note svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--ble); }
.ins-bars { display: flex; flex-direction: column; gap: 9px; }
.ins-bar { display: grid; grid-template-columns: 116px 1fr auto; align-items: center; gap: 10px; }
.ins-bl { font-size: 13px; color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-tr { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.ins-fl { display: block; height: 100%; background: linear-gradient(90deg, var(--ble), var(--croute)); border-radius: 999px; }
.ins-bv { font-size: 13px; font-weight: 600; color: var(--croute); font-variant-numeric: tabular-nums; min-width: 58px; text-align: right; }
:root[data-theme="nuit"] .ins-bv { color: var(--ble); }
.ins-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px; text-align: center; color: var(--txt-2); }
.ins-empty svg { width: 34px; height: 34px; color: var(--ligne-fort); }
.ins-empty.sm { flex-direction: row; padding: 10px 4px; gap: 8px; text-align: left; }
.ins-empty.sm svg { width: 18px; height: 18px; flex: 0 0 18px; }
@media (max-width: 720px) { .ins-kpis { grid-template-columns: 1fr; } .ins-bar { grid-template-columns: 92px 1fr auto; } }

/* — AI co-pilot bubble (global, every page) — */
#bk-bubble { position: fixed; inset: 0; pointer-events: none; z-index: 95; }
/* On the Assistant chat page the FAB is redundant (you're already in the chat) and overlaps its send button → hide it there. */
body[data-route="assistant"] #bk-bubble { display: none; }
.bk-fab { pointer-events: auto; }   /* the FAB is always tappable; the CLOSED panel must NOT capture taps (it overlaps the FAB on mobile) — its pointer-events stay none until .open */
.bk-fab { position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px; border: 0; border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 20%, var(--croute), #5e3a18); color: var(--ble-clair);
  box-shadow: 0 8px 22px rgba(78,47,18,.34), inset 0 1px 0 rgba(255,255,255,.12); cursor: pointer; display: grid; place-items: center;
  transition: transform .25s cubic-bezier(.2,.9,.3,1.4), box-shadow .25s; }
.bk-fab::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1.5px solid var(--ble); opacity: .32; }
.bk-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 28px rgba(78,47,18,.42); }
.bk-fab:active { transform: scale(.96); }
.bk-fab svg { width: 24px; height: 24px; }
.bk-fab .bk-fab-x { position: absolute; opacity: 0; transform: rotate(-45deg) scale(.6); transition: .22s; display: grid; }
.bk-fab .bk-fab-i { display: grid; transition: .22s; }
.bk-fab.on { background: radial-gradient(120% 120% at 30% 20%, #6e4423, #4a2c12); }
.bk-fab.on .bk-fab-i { opacity: 0; transform: rotate(45deg) scale(.6); }
.bk-fab.on .bk-fab-x { opacity: 1; transform: rotate(0) scale(1); }

.bk-panel { position: fixed; right: 20px; bottom: 92px; width: 384px; max-width: calc(100vw - 40px);
  height: 552px; max-height: calc(100vh - 150px); background: var(--surface); border: 1px solid var(--ligne); border-radius: 18px;
  box-shadow: 0 20px 50px rgba(40,30,16,.28); display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(14px) scale(.98); transform-origin: bottom right; pointer-events: none;
  transition: opacity .2s, transform .24s cubic-bezier(.2,.9,.3,1.2); }
#bk-bubble.open .bk-panel { opacity: 1; transform: none; pointer-events: auto; }

.bub-panel-h { display: flex; align-items: center; gap: 8px; padding: 13px 12px 13px 16px; border-bottom: 1px solid var(--ligne); background: linear-gradient(var(--surface-2), var(--surface)); }
.bub-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.bub-title > svg { width: 19px; height: 19px; color: var(--croute); flex: 0 0 19px; }
:root[data-theme="nuit"] .bub-title > svg { color: var(--ble); }
.bub-title b { font-family: var(--serif); font-size: 16px; color: var(--croute); }
:root[data-theme="nuit"] .bub-title b { color: var(--ble-clair); }
.bub-here { font-size: 11px; color: var(--txt-3); margin-left: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bub-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.bub-row { display: flex; gap: 8px; max-width: 100%; }
.bub-row.bub-u { justify-content: flex-end; }
.bub-msg { padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; max-width: 82%; white-space: pre-wrap; word-break: break-word; }
.bub-u .bub-msg { background: var(--croute); color: #fff; border-bottom-right-radius: 5px; }
.bub-a .bub-msg { background: var(--surface-2); border: 1px solid var(--ligne); border-bottom-left-radius: 5px; }
.bub-ic { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--ligne); display: grid; place-items: center; }
.bub-ic svg { width: 15px; height: 15px; color: var(--croute); }
:root[data-theme="nuit"] .bub-ic svg { color: var(--ble); }

.bub-typing { display: inline-flex; gap: 4px; align-items: center; }
.bub-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--txt-3); animation: bubdot 1s infinite ease-in-out; }
.bub-typing span:nth-child(2) { animation-delay: .15s; } .bub-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bubdot { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.bub-empty { text-align: center; color: var(--txt-2); padding: 22px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: auto 0; }
.bub-empty svg { width: 30px; height: 30px; color: var(--ble); }
.bub-empty p { font-size: 14px; max-width: 244px; }
.bub-ctx { font-size: 11.5px; color: var(--txt-3); background: var(--surface-2); border: 1px solid var(--ligne); border-radius: 999px; padding: 3px 11px; }
.bub-err { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--rouge); background: var(--rouge-bg); border: 1px solid color-mix(in srgb, var(--rouge) 35%, transparent); border-radius: 12px; padding: 9px 12px; }
.bub-err svg { width: 16px; height: 16px; flex: 0 0 16px; }

.bub-pending { border: 1px solid var(--ble); background: var(--surface-2); border-radius: 14px; padding: 11px 13px; }
.bub-pending.bub-danger { border-color: var(--ambre); background: var(--ambre-bg); }
.bub-pend-h { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--croute); margin-bottom: 7px; }
.bub-pend-h svg { width: 15px; height: 15px; color: var(--ble); }
.bub-ops { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.bub-ops li { font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; color: var(--txt); background: var(--surface); border: 1px solid var(--ligne); border-radius: 8px; padding: 5px 9px; word-break: break-word; }
.bub-ops li b { color: var(--croute); }
.bub-opv { color: var(--txt-2); }
.bub-pend-act { display: flex; justify-content: flex-end; gap: 8px; }

.bub-input { display: flex; gap: 8px; padding: 11px 12px; border-top: 1px solid var(--ligne); background: var(--surface); }
.bub-input .bk-in { flex: 1; }
.bub-send { width: 40px; flex: 0 0 40px; border: 0; border-radius: 11px; background: var(--croute); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .2s, transform .15s; }
.bub-send svg { width: 18px; height: 18px; transform: rotate(-90deg); }
.bub-send:hover { background: #5e3a18; } .bub-send:active { transform: scale(.94); } .bub-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 640px) {
  .bk-fab { right: 16px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: 52px; height: 52px; }
  .bk-panel { right: 8px; left: 8px; width: auto; max-width: none; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); height: 70vh; max-height: 70vh; }
}
@media (prefers-reduced-motion: reduce) {
  .bk-fab, .bk-panel, .bub-send { transition: none; }
  .bub-typing span { animation: none; }
}

/* — image attach (bubble + assistant chat) — */
.bub-cam { width: 38px; flex: 0 0 38px; border: 1px solid var(--ligne); border-radius: 11px; background: var(--surface-2); color: var(--croute); cursor: pointer; display: grid; place-items: center; transition: border-color .15s; }
.bub-cam svg { width: 18px; height: 18px; }
.bub-cam:hover { border-color: var(--ble); }
:root[data-theme="nuit"] .bub-cam { color: var(--ble); }
.bub-attach { display: flex; align-items: center; gap: 8px; padding: 8px 12px 0; }
.bub-attach img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; border: 1px solid var(--ligne); }
.bub-attach-x { width: 22px; height: 22px; border: 1px solid var(--ligne); border-radius: 50%; background: var(--surface-2); color: var(--txt-2); cursor: pointer; display: grid; place-items: center; padding: 0; }
.bub-attach-x svg { width: 12px; height: 12px; }
.bub-msgimg { display: block; max-width: 180px; max-height: 180px; border-radius: 10px; margin-bottom: 5px; }
.bub-prow { padding: 4px 0 2px 36px; }
.bub-prow .bub-pending { margin: 0; }
.bub-applied { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--vert); }
.bub-applied svg { width: 14px; height: 14px; }
.bub-a .bub-msgerr { background: var(--rouge-bg); border-color: color-mix(in srgb, var(--rouge) 35%, transparent); color: var(--rouge); }

.asst-barwrap { display: contents; }   /* slot the preview above the input bar without changing the bar's layout */
.asst-pend { display: flex; align-items: center; gap: 8px; padding: 8px 6px 2px; }
.asst-pend img { width: 54px; height: 54px; object-fit: cover; border-radius: 10px; border: 1px solid var(--ligne); }
.asst-pend-x { width: 24px; height: 24px; border: 1px solid var(--ligne); border-radius: 50%; background: var(--surface-2); color: var(--txt-2); cursor: pointer; display: grid; place-items: center; padding: 0; }
.asst-pend-x svg { width: 13px; height: 13px; }

/* — À valider (Upgrade D · Phase 2 — API-origin ops awaiting approval) — */
.va-wrap { margin-bottom: 12px; }
.va-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 9px 2px; border-bottom: 1px solid var(--ligne); }
.va-row:last-child { border-bottom: 0; }
.va-row-main { min-width: 0; flex: 1; }
.va-preview { font-weight: 600; font-size: 13.5px; color: var(--txt); }
.va-src { font-size: 11.5px; color: var(--txt-3); margin-top: 2px; }
.va-row-act { display: flex; gap: 6px; flex-shrink: 0; }
.va-empty { font-size: 13px; color: var(--txt-3); padding: 6px 2px; }
.va-note { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--txt-2); background: var(--surface-2); border: 1px solid var(--ligne); border-radius: 10px; padding: 7px 10px; margin: 0 0 9px; }
.va-note svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--ble); }
/* expand-to-inspect detail */
.va-chev svg { transition: transform .18s ease; }
.va-chev.open svg { transform: rotate(90deg); }
.va-detail { flex-basis: 100%; margin-top: 8px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--ligne); border-radius: var(--rayon-sm, 10px); font-size: 12.5px; color: var(--txt); }
.va-detail table { width: 100%; border-collapse: collapse; }
.va-detail td { padding: 3px 0; border-bottom: 1px solid var(--ligne); vertical-align: top; }
.va-detail tr:last-child td { border-bottom: 0; }
.va-detail .va-g { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--txt-2); }
.va-detail .va-h { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--txt-3); margin: 9px 0 4px; }
.va-detail .va-meta { margin: 2px 0; }
.va-detail .va-mut { color: var(--txt-3); }
.va-detail .va-steps { margin: 0; padding-left: 18px; } .va-detail .va-steps li { margin: 2px 0; }
.va-alghead { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ambre); margin: 0 0 5px; }
.va-algs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.va-alg { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--croute); background: color-mix(in srgb, var(--ambre) 18%, transparent); border: 1px solid color-mix(in srgb, var(--ambre) 45%, transparent); }
.va-noalg { font-size: 12px; color: var(--txt-3); margin-bottom: 4px; }
.va-json { white-space: pre-wrap; font-size: 11.5px; color: var(--txt-2); margin: 0; }
/* nav count badge ("À valider (N)") */
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--ble); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; vertical-align: middle; }

/* — Ingredients page — */
.ing-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 12px; }
.ing-kpi { background: var(--surface-2); border: 1px solid var(--ligne); border-radius: var(--rayon-sm); padding: 8px 11px; }
.ing-kpi .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--txt-3); }
.ing-kpi .v { font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--croute); line-height: 1.1; }
:root[data-theme="nuit"] .ing-kpi .v { color: var(--ble); }
.ing-kpi .v.ok { color: var(--vert); } .ing-kpi .v.warn { color: var(--ambre); } .ing-kpi .v.bad { color: var(--rouge); }
.ing-dup { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; background: var(--surface); border: 1.5px solid var(--ble); border-radius: var(--rayon-sm); padding: 9px 12px; margin-bottom: 12px; }
.ing-dup > svg { width: 17px; height: 17px; color: var(--ambre); flex: 0 0 17px; }
.ing-dup-t { flex: 1; min-width: 150px; font-size: 13px; color: var(--txt); }
.ing-catwrap { margin-bottom: 10px; }
.ing-cathead { display: flex; align-items: center; gap: 6px; padding: 4px 4px 6px; cursor: pointer; }
.ing-cathead > svg { width: 15px; height: 15px; color: var(--croute); }
.ing-lab { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--croute); }
:root[data-theme="nuit"] .ing-lab, :root[data-theme="nuit"] .ing-cathead > svg { color: var(--ble); }
.ing-csub { font-size: 11.5px; color: var(--txt-3); }
.ing-addc { margin-left: auto; width: 28px; height: 28px; }
.ing-catcard { padding: 0; overflow: hidden; }
.ing-row { display: flex; align-items: center; gap: 10px; padding: 9px 13px; cursor: pointer; }
.ing-row + .ing-row, .ing-edit + .ing-row, .ing-row + .ing-edit { border-top: 1px solid var(--ligne); }
.ing-row:hover { background: var(--surface-2); }
.ing-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.ing-dot.d-g { background: var(--vert); } .ing-dot.d-a { background: var(--ambre); } .ing-dot.d-r { background: var(--rouge); }
.ing-nm { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ing-mt { font-weight: 400; color: var(--txt-3); font-size: 11px; }
.ing-pr { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.ing-pr i { font-size: 10px; color: var(--txt-3); font-weight: 400; font-style: normal; }
.ing-nopr { font-size: 11.5px; color: var(--ambre); font-weight: 500; }
.ing-lk { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: var(--croute); min-width: 30px; justify-content: flex-end; }
.ing-lk svg { width: 12px; height: 12px; opacity: .8; }
:root[data-theme="nuit"] .ing-lk { color: var(--ble); }
.ing-edit { padding: 11px 13px; background: var(--surface-2); display: flex; flex-direction: column; gap: 7px; }
.ing-erow { display: flex; gap: 7px; }
.ing-erow .bk-in { flex: 1; min-width: 0; }
.ing-eprice { max-width: 92px; } .ing-eunit { max-width: 66px; } .ing-epack { max-width: 140px; }
.ing-eactions { display: flex; align-items: center; gap: 6px; }
.ing-recost { flex: 1; font-size: 11px; color: var(--croute); display: inline-flex; align-items: center; gap: 4px; }
.ing-recost svg { width: 13px; height: 13px; }
:root[data-theme="nuit"] .ing-recost { color: var(--ble); }
.ing-sec-h { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--croute); margin: 16px 0 2px; }
:root[data-theme="nuit"] .ing-sec-h { color: var(--ble); }
.ing-csub2 { font-size: 12px; color: var(--txt-3); margin-bottom: 8px; }
.ing-cost { padding: 0; overflow: hidden; }
.ing-crow { display: flex; align-items: center; gap: 9px; padding: 9px 13px; }
.ing-crow + .ing-crow { border-top: 1px solid var(--ligne); }
.ing-cnm { flex: 1; min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ing-cu { font-size: 12.5px; color: var(--txt-2); white-space: nowrap; }
.ing-cu i { font-size: 10px; color: var(--txt-3); font-style: normal; }
.ing-miss { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: var(--ambre); }
.ing-miss svg { width: 12px; height: 12px; }
.ing-mb { font-size: 12px; font-weight: 600; border-radius: 9px; padding: 2px 9px; min-width: 44px; text-align: center; }
.ing-mb.ok { background: var(--vert-bg); color: var(--vert); }
.ing-mb.warn { background: var(--ambre-bg); color: var(--ambre); }
.ing-mb.bad { background: var(--rouge-bg); color: var(--rouge); }
.ing-mb.todo { background: var(--surface-2); color: var(--txt-3); font-weight: 500; }
.ing-firstrun { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 18px; text-align: center; color: var(--txt-2); }
.ing-firstrun > svg { width: 34px; height: 34px; color: var(--ligne-fort); }
.ing-catempty { font-size: 12.5px; color: var(--txt-3); padding: 4px 6px 8px; }
.ing-pchips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.ing-pchip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--ligne-fort); color: var(--txt-2); font-size: 12.5px; border-radius: 16px; padding: 5px 13px; cursor: pointer; }
.ing-pchip svg { width: 13px; height: 13px; }
.ing-pchip.on { background: var(--croute); border-color: var(--croute); color: #fff; }
.ing-pcount { font-size: 12px; color: var(--txt-3); margin-top: 10px; text-align: center; }
.ing-papwrap { display: flex; justify-content: center; }
.ing-paper { width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon-sm); padding: 18px 20px; }
.ip-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--croute); padding-bottom: 6px; margin-bottom: 4px; }
.ip-head b { font-family: var(--serif); font-size: 15px; color: var(--txt); }
.ip-head span { font-size: 12px; color: var(--or); }
.ip-colh { display: flex; align-items: center; font-size: 9.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--txt-3); padding: 5px 0; }
.ip-colh .ip-nm { flex: 1; }
.ip-bcap { width: 70px; text-align: center; }
.ip-cat { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--croute); margin: 8px 0 2px; }
:root[data-theme="nuit"] .ip-cat { color: var(--ble); }
.ip-line { display: flex; align-items: center; gap: 9px; padding: 5px 0; border-bottom: 1px solid var(--ligne); }
.ip-chk { width: 13px; height: 13px; border: 1.3px solid var(--ligne-fort); border-radius: 3px; flex: 0 0 13px; }
.ip-line .ip-nm { flex: 1; font-size: 12.5px; }
.ip-blank { width: 70px; border-bottom: 1px solid var(--ligne-fort); height: 14px; }
.ip-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--txt-3); margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--ligne); }
.ing-addlv { margin: 8px 12px 12px; }

/* — Recipe role / sub-recipe — */
.re-roledesc { font-size: 12.5px; color: var(--txt-2); margin-bottom: 10px; }
.re-roleseg { display: inline-flex; border: 1px solid var(--ligne-fort); border-radius: 12px; overflow: hidden; background: var(--surface-2); flex-wrap: wrap; }
.re-roleb { padding: 8px 16px; font-size: 13px; font-weight: 500; border: 0; background: transparent; color: var(--txt-2); cursor: pointer; }
.re-roleb.on { background: var(--croute); color: #fff; }
.re-usedin { margin-top: 14px; }
.re-usedin-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-3); margin-bottom: 8px; }
.re-chips { display: flex; flex-wrap: wrap; gap: 7px; max-height: 220px; overflow: auto; }
.re-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--ligne-fort); color: var(--txt-2); font-size: 12.5px; border-radius: 16px; padding: 5px 12px; cursor: pointer; }
.re-chip svg { width: 13px; height: 13px; }
.re-chip.on { background: var(--croute); border-color: var(--croute); color: #fff; }
.re-auto { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--croute); margin-bottom: 8px; }
.re-auto.muted { color: var(--txt-3); }
.re-auto svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 2px; }
:root[data-theme="nuit"] .re-auto:not(.muted) { color: var(--ble); }
.re-usedmanual { font-size: 11.5px; color: var(--txt-3); margin: 4px 0 6px; }

/* — AI tidy panel — */
.ing-tidy { background: var(--surface); border: 1.5px solid var(--ble); border-radius: var(--rayon-sm); padding: 10px 12px; margin-bottom: 14px; }
.ing-tidy-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ing-tidy-h > svg { width: 18px; height: 18px; color: var(--or); }
.ing-tidy-h b { font-size: 14px; }
.ing-tidy-n { background: var(--ble); color: var(--croute-fonce); font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 8px; }
.ing-tidy-h .btn.mini { margin-left: auto; }
.ing-tidy-busy { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--txt-2); padding: 4px 2px; }
.ing-tidy-busy svg { width: 15px; height: 15px; animation: bk-spin 1s linear infinite; }
@keyframes bk-spin { to { transform: rotate(360deg); } }
.ing-tprop { display: flex; align-items: flex-start; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--ligne); }
.ing-tp-ic { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; color: var(--croute); flex: 0 0 26px; }
.ing-tp-ic svg { width: 15px; height: 15px; }
.ing-tp-b { flex: 1; min-width: 0; }
.ing-tp-d { font-size: 13px; font-weight: 500; }
.ing-tp-r { font-size: 11.5px; color: var(--txt-3); margin-top: 2px; }
.ing-tp-a { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }

/* —————————————————— Connecter l'IA —————————————————— */
.cn-url { display: flex; gap: 8px; align-items: stretch; }
.cn-url .bk-in { flex: 1; min-width: 0; }
.cn-step { border-top: 1px solid var(--ligne); }
.cn-step:last-of-type { border-bottom: 1px solid var(--ligne); }
.cn-step > summary { cursor: pointer; padding: 12px 2px; font-weight: 600; font-size: 14px; list-style: none; }
.cn-step > summary::-webkit-details-marker { display: none; }
.cn-step > summary::before { content: "+"; display: inline-block; width: 16px; color: var(--txt-3); font-weight: 700; }
.cn-step[open] > summary::before { content: "–"; }
.cn-step-b { padding: 0 2px 14px 18px; font-size: 13px; color: var(--txt-2); line-height: 1.55; }

/* —————————————————— Lignes de liste module (Factures · Connexions IA) — thème-aware —————————————————— */
.mrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--ligne); }
.mrow:last-child { border-bottom: 0; }
.mrow-txt { min-width: 0; }
.mrow-t { font-weight: 600; overflow-wrap: anywhere; }
.mrow-s { font-size: 11.5px; color: var(--txt-3); overflow-wrap: anywhere; }
.mrow-act { display: flex; gap: 6px; flex-shrink: 0; }
.fac-ok { background: var(--vert); color: #fff; border-color: transparent; }
.fac-ok:hover { background: var(--vert); filter: brightness(1.07); border-color: transparent; }

/* Invitations membres (Profil) — .acc-input n'était stylé QUE dans le tiroir (.account) ; sur la carte claire il tombait en natif nu */
.mi-form .acc-input { border: 1px solid var(--ligne-fort); background: var(--surface); color: var(--txt);
  border-radius: var(--rayon-sm); padding: 11px 13px; font: inherit; font-size: 14px; width: 100%; box-sizing: border-box; min-height: var(--tap-min); }
