/* ==========================================================================
   Boulangerie Ny Antsika Ambositra — système de design
   Mise en page inspirée d'AdminLTE 4 : menu latéral sombre réductible,
   barre du haut blanche, cartes ombrées, petites boîtes colorées.
   Couleur principale : le brun caramel de la boulangerie.
   ========================================================================== */

:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface-2: #f8f9fa;
    --line: #dee2e6;
    --line-strong: #ced4da;
    --ink: #212529;
    --ink-2: #495057;
    --muted: #6c757d;
    --brand: #96582a;
    --brand-strong: #74411c;
    --brand-soft: #f4e7d8;
    --brand-ring: rgba(150, 88, 42, .25);
    --accent: #d38b2c;
    --accent-soft: #fbefd9;
    --success: #198754;
    --success-soft: #d1e7dd;
    --warning: #ffc107;
    --warning-ink: #664d03;
    --warning-soft: #fff3cd;
    --danger: #dc3545;
    --danger-soft: #f8d7da;
    --info: #0dcaf0;
    --info-ink: #055160;
    --info-soft: #cff4fc;
    --radius: .375rem;
    --radius-sm: .375rem;
    --shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
    --shadow-lg: 0 .5rem 1rem rgba(0, 0, 0, .15);
    --sidebar-w: 250px;
    --sidebar-mini-w: 4.6rem;
    --sidebar-bg: #343a40;
    --sidebar-ink: #c2c7d0;
    --header-h: 57px;
    --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.25; color: var(--ink); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; transition: grid-template-columns .2s; }

.sidebar {
    position: sticky; top: 0; z-index: 30; height: 100vh; width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background: var(--sidebar-bg); color: var(--sidebar-ink);
    box-shadow: 0 14px 28px rgba(0, 0, 0, .25), 0 10px 10px rgba(0, 0, 0, .22);
    transition: width .2s;
}
.sidebar__brand {
    display: flex; align-items: center; gap: .7rem; height: var(--header-h); flex: none;
    padding: 0 .85rem; border-bottom: 1px solid #4b545c; color: #fff; overflow: hidden; white-space: nowrap;
}
.sidebar__brand:hover { text-decoration: none; color: #fff; }
/* Le logo original garde son fond blanc : on le pose dans un cadre blanc, sans le retoucher. */
.sidebar__logo { flex: none; display: grid; place-items: center; width: 42px; height: 42px; padding: 2px; background: #fff; border-radius: .4rem; }
.sidebar__logo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }
.sidebar__brand span { font-weight: 300; font-size: 1.15rem; line-height: 1.1; }
.sidebar__brand small { display: block; color: var(--sidebar-ink); font-weight: 400; font-size: .75rem; letter-spacing: .02em; }
.nav { padding: .5rem .5rem 1.5rem; flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: #6c757d transparent; }
.nav__section { margin: .9rem .5rem .3rem; padding: 0 .5rem; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: #8a929a; font-weight: 600; white-space: nowrap; overflow: hidden; }
.nav__link {
    display: flex; align-items: center; gap: .7rem; padding: .5rem .9rem; margin-bottom: .2rem;
    border-radius: var(--radius); color: var(--sidebar-ink); font-size: .95rem; white-space: nowrap; overflow: hidden;
}
.nav__link .icon { width: 19px; height: 19px; }
.nav__link span { overflow: hidden; text-overflow: ellipsis; }
.nav__link:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.nav__link--success, .nav__link--success:hover { background: var(--success); color: #fff; font-weight: 600; }
.nav__link--success:hover { background: #146c43; }
.nav__link.is-active { background: var(--brand); color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24); }
/* « Nouvelle commande » du menu : style bouton vert, même quand la page est ouverte (2026-11-06). */
.nav__link--success.is-active { background: #146c43; color: #fff; }
.sidebar__foot { padding: .65rem 1rem; border-top: 1px solid #4b545c; font-size: .78rem; color: #8a929a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
    position: sticky; top: 0; z-index: 20; height: var(--header-h);
    display: flex; align-items: center; gap: .75rem; padding: 0 1rem;
    background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar__menu { color: var(--muted); }
.topbar__search { flex: 1; max-width: 420px; position: relative; }
.topbar__search .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar__search input[type=search] { padding-left: 2.3rem; background: var(--surface-2); border-color: transparent; }
.topbar__search input[type=search]:focus { background: #fff; border-color: var(--line-strong); }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: .5rem; font-size: .92rem; }

/* Menu utilisateur (sans JavaScript : <details>) */
.user-menu { position: relative; }
.user-menu > summary { display: flex; align-items: center; gap: .55rem; padding: .3rem .5rem; border-radius: var(--radius); cursor: pointer; list-style: none; color: var(--ink-2); }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--surface-2); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 600; font-size: .85rem; flex: none; }
.avatar--lg { width: 72px; height: 72px; font-size: 1.6rem; border: 3px solid rgba(255, 255, 255, .35); }
.user-menu__panel {
    position: absolute; right: 0; top: calc(100% + .4rem); width: 300px; z-index: 60;
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--line); overflow: hidden;
}
.user-menu__head { padding: 1.1rem; text-align: center; background: var(--brand); color: #fff; }
.user-menu__head .avatar { margin-bottom: .5rem; }
.user-menu__head strong { display: block; font-weight: 500; font-size: 1.05rem; }
.user-menu__head small { color: rgba(255, 255, 255, .8); }
.user-menu__foot { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .75rem; background: var(--surface-2); }
.user-menu__foot form { display: block; }
.user-menu__foot .btn { width: 100%; padding-left: .4rem; padding-right: .4rem; font-size: .88rem; }

.content { padding: 1rem 1.5rem 2.5rem; width: 100%; flex: 1; }
.app-footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.5rem; background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.app-footer strong { color: var(--ink-2); font-weight: 600; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; padding-top: .25rem; }
.page-head p { margin: .2rem 0 0; color: var(--muted); }
.page-head__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.breadcrumb { display: flex; gap: .45rem; align-items: center; font-size: .88rem; color: var(--muted); margin: .25rem 0 .35rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--brand); }
.breadcrumb__sep { color: var(--line-strong); }
.breadcrumb .icon { width: 15px; height: 15px; }

/* Réduction du menu sur ordinateur : icônes seules, le menu s'ouvre au survol. */
@media (min-width: 901px) {
    .app.sidebar-collapsed { grid-template-columns: var(--sidebar-mini-w) 1fr; }
    .app.sidebar-collapsed .sidebar:not(:hover) { width: var(--sidebar-mini-w); }
    .app.sidebar-collapsed .sidebar:not(:hover) .sidebar__brand > span:not(.sidebar__logo),
    .app.sidebar-collapsed .sidebar:not(:hover) .nav__link span,
    .app.sidebar-collapsed .sidebar:not(:hover) .sidebar__foot { visibility: hidden; }
    .app.sidebar-collapsed .sidebar:not(:hover) .nav__section { height: 1px; margin: .6rem .9rem; background: #4b545c; color: transparent; }
    .app.sidebar-collapsed .sidebar:not(:hover) .nav { scrollbar-width: none; }
    .app.sidebar-collapsed .sidebar:hover { box-shadow: 0 14px 28px rgba(0, 0, 0, .35); }
}

/* Menu déroulant d'action (<details>) */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown[open] > summary { background: #e9ecef; }
.dropdown__panel { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 60; width: 320px; display: flex; flex-direction: column; gap: .75rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.dropdown__panel .help { margin: 0; }
@media (max-width: 560px) { .dropdown { flex: 1; } .dropdown > summary { width: 100%; } .dropdown__panel { position: fixed; left: .75rem; right: .75rem; top: auto; width: auto; } }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 0; }
.card:has(> .card__head) { border-top: 3px solid var(--brand); }
.card + .card, .card + .grid, .grid + .card, .section + .section, .stats + .card, .stats + .grid { margin-top: 1.25rem; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem 1.25rem; border-bottom: 1px solid rgba(0, 0, 0, .125); flex-wrap: wrap; min-height: 50px; }
.card__head h2 { font-size: 1.1rem; font-weight: 400; }
.card__body { padding: 1.25rem; }
.card__foot { padding: .75rem 1.25rem; border-top: 1px solid rgba(0, 0, 0, .125); background: rgba(0, 0, 0, .03); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }

/* Chiffres clés : boîtes séparées façon « info-box ». */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 1rem; }
.stat { background: var(--surface); padding: .85rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow); border-left: 4px solid var(--brand); min-width: 0; }
.stat__label { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.stat__value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: .1rem; overflow-wrap: anywhere; }
.stat__value small { font-size: .85rem; font-weight: 400; color: var(--muted); }
.stat--alert { border-left-color: var(--danger); }
.stat--alert .stat__value { color: var(--danger); }

/* Petites boîtes colorées du tableau de bord (« small-box »). */
.small-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.small-box { position: relative; display: flex; flex-direction: column; border-radius: var(--radius); box-shadow: var(--shadow); color: #fff; overflow: hidden; min-width: 0; }
.small-box__inner { padding: .9rem 1rem; position: relative; z-index: 1; }
.small-box__inner h3 { font-size: 2rem; font-weight: 700; margin: 0 0 .2rem; color: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; }
.small-box__inner h3 small { font-size: 1rem; font-weight: 500; opacity: .85; }
.small-box__inner p { margin: 0; font-size: 1rem; padding-right: 4.5rem; }
.small-box__icon { position: absolute; right: .9rem; top: .9rem; width: 64px; height: 64px; opacity: .25; stroke-width: 1.5; transition: transform .3s; }
.small-box:hover .small-box__icon { transform: scale(1.1); }
.small-box__footer { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: .3rem; padding: .25rem; background: rgba(0, 0, 0, .1); color: rgba(255, 255, 255, .85); font-size: .9rem; position: relative; z-index: 1; }
.small-box__footer:hover { background: rgba(0, 0, 0, .15); color: #fff; text-decoration: none; }
.small-box__footer .icon { width: 15px; height: 15px; }
.small-box--primary { background: var(--brand); }
.small-box--info { background: #17a2b8; }
.small-box--success { background: var(--success); }
.small-box--warning { background: var(--warning); color: #1f2d3d; }
.small-box--warning .small-box__footer { color: rgba(0, 0, 0, .65); }
.small-box--danger { background: var(--danger); }
.small-box--secondary { background: var(--muted); }

dl.props { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
dl.props dt { color: var(--muted); font-size: .9rem; }
dl.props dd { margin: 0; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th, .table td { padding: .6rem .75rem; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table thead th { font-weight: 700; color: var(--ink); background: transparent; border-top: 0; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table tbody tr:nth-of-type(odd) { background: rgba(0, 0, 0, .025); }
.table tbody tr:hover { background: rgba(0, 0, 0, .055); }
.table tbody tr:has(> td > .empty) { background: none; }
.table tfoot td, .table tfoot th { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--line); }
.table .actions { text-align: right; white-space: nowrap; }
.table tr.is-muted td { color: var(--muted); }
.table tr.is-struck td { text-decoration: line-through; color: var(--muted); }
.table td.zero { color: var(--line-strong); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .3em .6em; border-radius: var(--radius); font-size: .75rem; font-weight: 700; line-height: 1; white-space: nowrap; background: #6c757d; color: #fff; vertical-align: middle; }
.badge--success { background: var(--success); }
.badge--danger { background: var(--danger); }
.badge--warning { background: var(--warning); color: #1f2d3d; }
.badge--info { background: #17a2b8; }
.badge--accent { background: var(--brand); }
.badge--neutral { background: #e9ecef; color: var(--ink-2); }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .375rem .75rem; min-height: 38px; border-radius: var(--radius);
    border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
    font: inherit; font-size: .95rem; font-weight: 400; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: #e9ecef; border-color: var(--line-strong); text-decoration: none; color: var(--ink); }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 .25rem var(--brand-ring); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn--blue { background: #0d6efd; border-color: #0d6efd; color: #fff; }
.btn--blue:hover { background: #0b5ed7; border-color: #0a58ca; color: #fff; }
.btn--success { background: var(--success); border-color: var(--success); color: #fff; }
.btn--success:hover { background: #146c43; border-color: #146c43; color: #fff; }
.btn--orange { background: #e8590c; border-color: #e8590c; color: #fff; }
.btn--orange:hover { background: #c94d0a; border-color: #c94d0a; color: #fff; }
.btn--purple { background: #6f42c1; border-color: #6f42c1; color: #fff; }
.btn--purple:hover { background: #5a32a3; border-color: #5a32a3; color: #fff; }
.btn--teal { background: #0f766e; border-color: #0f766e; color: #fff; }
.btn--teal:hover { background: #0b5f58; border-color: #0b5f58; color: #fff; }
.btn--red { background: #c92a2a; border-color: #c92a2a; color: #fff; }
.btn--red:hover { background: #a61e1e; border-color: #a61e1e; color: #fff; }
.btn--warning { background: var(--warning); border-color: var(--warning); color: #212529; }
.btn--warning:hover { background: #e0a800; border-color: #d39e00; color: #212529; }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn--sm { padding: .25rem .5rem; min-height: 31px; font-size: .85rem; }
.btn--icon { padding: .375rem; min-width: 38px; }
.btn[disabled], .btn.is-busy { opacity: .65; pointer-events: none; }
.inline-form { display: inline; }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field > label, .label { font-size: .92rem; font-weight: 700; color: var(--ink); }
.field .required::after { content: " *"; color: var(--danger); }
.help { font-size: .84rem; color: var(--muted); }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], select, textarea {
    width: 100%; padding: .375rem .75rem; min-height: 38px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; color: var(--ink); font: inherit; font-size: .95rem;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, input:focus, select:focus, textarea:focus { outline: 0; border-color: #d4a57f; box-shadow: 0 0 0 .25rem var(--brand-ring); }
textarea { min-height: 80px; resize: vertical; }
input[type=number], input[inputmode=numeric], input[inputmode=decimal] { font-variant-numeric: tabular-nums; }
input:disabled, select:disabled { background: #e9ecef; color: var(--muted); }
.has-error input, .has-error select, .has-error textarea, input.is-invalid { border-color: var(--danger); }
.form-error { font-size: .85rem; color: var(--danger); }
.form-error ul { margin: 0; padding: 0; list-style: none; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-size: .95rem; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--brand); box-shadow: none; }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; padding-top: .5rem; }
.input-unit { display: flex; align-items: stretch; }
.input-unit input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
/* Fiches de saisie en tableau : champs lisibles, le tableau défile sur téléphone. */
.entry-table .input-unit, .entry-table input { min-width: 6.5rem; }
.entry-table .input-unit input { min-width: 4.5rem; }
.entry-table td:first-child { min-width: 8rem; }
/* Pains obtenus par chariot : cases alignées en haut (indication « prévu » sous certaines). */
.cart-table tbody td { vertical-align: top; }
.cart-table tbody td:first-child, .cart-table tbody td.num { padding-top: 1.15rem; }
/* Type de pain absent du chariot prévu : case grisée, non saisissable. */
.cart-table td.cart-cell--off input { background: #e9ecef; border-color: #e9ecef; color: var(--muted); cursor: not-allowed; }
.input-unit span { display: flex; align-items: center; padding: 0 .75rem; border: 1px solid var(--line); border-left: 0; background: #e9ecef; color: var(--ink-2); font-size: .88rem; border-radius: 0 var(--radius) var(--radius) 0; white-space: nowrap; }

.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; padding: .9rem 1.25rem; border-bottom: 1px solid rgba(0, 0, 0, .125); }
.filters .field { min-width: 150px; }
.filters .field--grow { flex: 1; min-width: 200px; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.segmented a { padding: .375rem .8rem; font-size: .9rem; color: var(--ink-2); border-right: 1px solid var(--line); }
.segmented a:last-child { border-right: 0; }
.segmented a:hover { background: var(--surface-2); text-decoration: none; }
.segmented a.is-active { background: var(--brand); color: #fff; }

/* ---------- Messages ---------- */
.flash-stack { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.alert { display: flex; gap: .65rem; align-items: flex-start; padding: .75rem 1rem; border-radius: var(--radius); border: 1px solid transparent; border-left-width: 5px; font-size: .95rem; }
.alert .icon { margin-top: 2px; }
.alert--success { background: var(--success-soft); border-color: var(--success); color: #0a3622; }
.alert--error { background: var(--danger-soft); border-color: var(--danger); color: #58151c; }
.alert--warning { background: var(--warning-soft); border-color: var(--warning); color: var(--warning-ink); }
.alert--info { background: var(--info-soft); border-color: var(--info); color: var(--info-ink); }
/* Bandeau avec un bouton d'action à droite (ex. : « Nouvelle commande »). */
.alert--action { align-items: center; flex-wrap: wrap; }
.alert--action > div { flex: 1; min-width: 200px; }
.alert ul { margin: .25rem 0 0; padding-left: 1.1rem; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.empty .icon { width: 34px; height: 34px; color: var(--line-strong); margin-bottom: .5rem; }
.empty p { margin: .25rem 0 1rem; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; gap: .75rem; justify-content: space-between; align-items: center; padding: .7rem 1.25rem; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; }
/* Alertes du tableau de bord : en tête de page, fond coloré, icône pastille, rouge pulsé pour les urgences. */
.dash-alerts { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 2px solid var(--danger); overflow: hidden; }
.dash-alerts__head { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.25rem; background: var(--danger); color: #fff; }
.dash-alerts__head h2 { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: .02em; }
.dash-alerts__head .icon { width: 22px; height: 22px; }
.dash-alerts__count { min-width: 1.7rem; height: 1.7rem; padding: 0 .45rem; border-radius: 999px; background: #fff; color: var(--danger); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
/* Le cadre prend la couleur de l'alerte la plus grave. */
.dash-alerts--warning { border-color: #d39e00; }
.dash-alerts--warning .dash-alerts__head { background: #d39e00; }
.dash-alerts--warning .dash-alerts__count { color: #d39e00; }
.dash-alerts--info { border-color: #17a2b8; }
.dash-alerts--info .dash-alerts__head { background: #17a2b8; }
.dash-alerts--info .dash-alerts__count { color: #17a2b8; }
.dash-alerts__list { list-style: none; margin: 0; padding: .6rem; display: flex; flex-direction: column; gap: .5rem; }
.dash-alert { display: flex; align-items: center; gap: .85rem; padding: .7rem 1rem; border-radius: var(--radius); border-left: 6px solid; font-weight: 500; }
.dash-alert__text { flex: 1; min-width: 0; }
.dash-alert__icon { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.dash-alert__icon .icon { width: 20px; height: 20px; }
.dash-alert--danger { background: var(--danger-soft); border-color: var(--danger); color: #58151c; }
.dash-alert--danger .dash-alert__icon { background: var(--danger); animation: dash-alert-pulse 1.6s ease-out infinite; }
.dash-alert--warning { background: var(--warning-soft); border-color: var(--warning); color: var(--warning-ink); }
.dash-alert--warning .dash-alert__icon { background: #d39e00; }
.dash-alert--info { background: var(--info-soft); border-color: var(--info); color: var(--info-ink); }
.dash-alert--info .dash-alert__icon { background: #17a2b8; }
.dash-alert__btn { flex: none; background: #fff; }
@keyframes dash-alert-pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, .55); } 70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); } }
@media (prefers-reduced-motion: reduce) { .dash-alert--danger .dash-alert__icon { animation: none; } }
@media (max-width: 575.98px) { .dash-alert { flex-wrap: wrap; } .dash-alert__btn { margin-left: calc(36px + .85rem); } }
.dash-alerts-none { margin: 0 0 1rem; }

/* Recettes : lignes de farine (farine de base = somme des farines). */
.recipe-flour-total { padding: .3rem .75rem; border-radius: 999px; background: var(--warning-soft); color: var(--warning-ink); }
.recipe-flour-total strong { font-size: 1.05rem; }
.table tr.is-flour td:first-child { box-shadow: inset 4px 0 0 #d39e00; font-weight: 600; }
.dash-alerts-none .icon { color: var(--success); }

.section-title { margin: 0 0 .6rem; font-size: 1.05rem; font-weight: 500; color: var(--ink-2); }
.shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.shortcut { display: flex; align-items: center; gap: .85rem; padding: .7rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); font-weight: 500; transition: box-shadow .15s; }
.shortcut:hover { text-decoration: none; color: var(--brand-strong); box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 3px 8px rgba(0, 0, 0, .2); }
.shortcut .icon { width: 44px; height: 44px; padding: 11px; border-radius: var(--radius); background: var(--brand); color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }

.pagination { display: flex; gap: 0; justify-content: center; padding: .9rem; flex-wrap: wrap; }
.pagination a, .pagination span { padding: .375rem .75rem; border: 1px solid var(--line); margin-left: -1px; font-size: .9rem; background: #fff; }
.pagination > :first-child { border-radius: var(--radius) 0 0 var(--radius); }
.pagination > :last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.pagination a:hover { background: var(--surface-2); text-decoration: none; }
.pagination .is-current { background: var(--brand); color: #fff; border-color: var(--brand); position: relative; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: .7rem 1.25rem .7rem 2.4rem; border-bottom: 1px solid var(--line); font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; left: 1.1rem; top: 1.05rem; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.timeline li:last-child { border-bottom: 0; }
.timeline time { display: block; font-size: .8rem; color: var(--muted); }

details.disclosure > summary { cursor: pointer; color: var(--brand); font-size: .92rem; list-style: none; }
details.disclosure > summary::-webkit-details-marker { display: none; }
/* Résumé affiché comme un bouton (ex. « Payer… ») : garder les couleurs du bouton. */
details.disclosure > summary.btn--primary { color: #fff; font-size: .85rem; }
details.disclosure[open] > summary { margin-bottom: .75rem; }

/* ---------- Connexion (façon « login-box ») ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: #e9ecef; }
.auth__box { width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border-top: 3px solid var(--brand); overflow: hidden; }
/* Fond blanc : le logo original (fond blanc) s'intègre sans être retouché. */
.auth__head { padding: 1.5rem 1.5rem .5rem; text-align: center; border-bottom: 1px solid var(--line); }
.auth__logo { display: block; width: 130px; height: auto; margin: 0 auto .75rem; }
.auth__title { margin-bottom: 1rem; }
.auth__title h1 { font-size: 1.25rem; font-weight: 400; }
.auth__title p { color: var(--muted); margin: .25rem 0 0; font-size: .92rem; }
.auth .flash-stack { margin: 1rem 1.5rem 0; }
.auth .card { box-shadow: none; border: 0; border-radius: 0; }
.auth .card__body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.auth .btn--primary { width: 100%; min-height: 42px; }

/* ---------- Saisie de commande ---------- */
.order-lines .qty { width: 110px; text-align: right; }
.order-lines tr.has-qty td { background: #fff8ec; }
.order-total { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-box { position: sticky; top: calc(var(--header-h) + 1rem); }

/* ---------- Impression ---------- */
.print-only { display: none; }
.print-head { display: none; align-items: center; gap: 1rem; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 2px solid #000; }
.print-head img { width: 70px; }

@media print {
    /* Cases de marge définies : le navigateur n'imprime ni date, ni heure, ni titre, ni lien (2026-11-09). */
    @page {
        size: A4; margin: 12mm;
        @top-left { content: ""; } @top-center { content: ""; } @top-right { content: ""; }
        @bottom-left { content: ""; } @bottom-right { content: ""; }
        /* Numéro de page en bas (2026-11-09). */
        @bottom-center { content: "Page " counter(page) " / " counter(pages); font-family: "Segoe UI", Arial, sans-serif; font-size: 9pt; color: #333; }
    }
    body { background: #fff; font-size: 11pt; }
    .sidebar, .topbar, .app-footer, .no-print, .page-head__actions, .filters, .flash-stack, .pagination, .breadcrumb { display: none !important; }
    .app { display: block; }
    .content { padding: 0; max-width: none; }
    .card, .stat { border: 0 !important; box-shadow: none; }
    .stat { border-left: 2px solid #999 !important; }
    .card__head { padding: .5rem 0; }
    .table th, .table td { padding: .3rem .4rem; }
    .table tbody tr:nth-of-type(odd) { background: none; }
    .table thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .badge { background: none !important; color: #000 !important; border: 1px solid #999; }
    .print-only { display: block; }
    .print-head { display: flex; }
    a { color: inherit; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .grid-side { grid-template-columns: 1fr; }
    .summary-box { position: static; }
}
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; }
    .app:not(.nav-open) .sidebar { box-shadow: none; }
    .app.nav-open .sidebar { transform: none; }
    .app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 40; }
    .topbar { padding: 0 .75rem; }
    .user-menu__name { display: none; }
    .content { padding: 1rem 1rem 2.5rem; }
    .app-footer { padding: .8rem 1rem; }
    .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
    .stat__value { font-size: 1.2rem; }
    .small-box__inner h3 { font-size: 1.6rem; }
}
@media (max-width: 560px) {
    .topbar__search { display: none; }
    .page-head { align-items: stretch; }
    .page-head__actions .btn { flex: 1; }
    .table th, .table td { padding: .5rem .6rem; }
    .filters .field { min-width: 100%; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .stat { padding: .65rem .75rem; }
    .user-menu__panel { position: fixed; left: .75rem; right: .75rem; top: calc(var(--header-h) + .25rem); width: auto; }
}

/* Rapports */
.report .report-h { font-size: 1.1rem; font-weight: 500; margin: 1.5rem 0 .5rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line); }
.report .report-h:first-child { margin-top: 0; }
.report .report-h3 { font-size: .98rem; margin: 1rem 0 .4rem; }
.report table.table { margin-bottom: .5rem; }
.report-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 1.25rem; align-items: start; }
.report-cols > div { min-width: 0; overflow-x: auto; }
.report-note { font-size: .82rem; color: var(--muted); }

/* Une colonne de grille ne doit jamais élargir la page (contenus longs, tableaux, formulaires). */
.grid > * { min-width: 0; }

/* Scan des bons */
.scanner__form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.scanner__form .field--grow { flex: 1; min-width: 220px; }
.scanner__form input { font-size: 1.05rem; min-height: 44px; }
.scanner__camera { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.scanner__video { width: 100%; max-width: 480px; aspect-ratio: 4 / 3; object-fit: cover; background: #000; border-radius: var(--radius); }
.scanner .help { margin: .9rem 0 0; }

/* Couleur fixe par type de pain (fonction Twig bread_color) : la même sur toutes les pages. */
.bread-c0 { --bread: #0d6efd; }  /* Gros pain : bleu */
.bread-c1 { --bread: #6f42c1; }  /* XL : violet */
.bread-c2 { --bread: #198754; }  /* GM : vert */
.bread-c3 { --bread: #fd7e14; }  /* GMK : orange */
.bread-c4 { --bread: #d63384; }  /* CMP : rose */
.bread-c5 { --bread: #0aa2c0; }  /* BOULE : cyan */
.bread-c6 { --bread: #8d5524; }
.bread-c7 { --bread: #6610f2; }
.bread-c8 { --bread: #5c7c1a; }
.bread-c9 { --bread: #495057; }
.bread-chips { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.bread-chip {
    display: inline-flex; align-items: center; padding: .1rem .45rem; border-radius: var(--radius);
    border-left: 3px solid var(--bread); white-space: nowrap; font-weight: 600; font-size: .84rem;
    background: color-mix(in srgb, var(--bread) 12%, #fff); color: color-mix(in srgb, var(--bread) 70%, #000);
}
.stat--bread { border-left-color: var(--bread); }
.stat--bread .stat__label { color: color-mix(in srgb, var(--bread) 75%, #000); font-weight: 600; }
.small-box--bread { background: var(--bread); }
@media print {
    .bread-chip { background: none !important; border-left-color: #999; color: #000; }
}

/* Fiche fournisseur : produits vendus, cases à cocher par catégorie */
.supplier-products { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 1.25rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem 1.5rem; }
.supplier-products legend { font-weight: 600; padding: 0 .35rem; }
.supplier-products__title { font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); margin-bottom: .25rem; }
.supplier-products .checkbox { display: flex; gap: .45rem; align-items: center; margin: .25rem 0; font-weight: 400; }

/* Commande en production : étapes « pains récupérés » puis « paiements » (2026-11-03). */
.card--step { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
/* Étape « Pains récupérés par le client » en bleu #24b3e9 (2026-11-09). */
.card--step-sky, .card--step-sky:has(> .card__head) { border-color: #24b3e9; border-top-color: #24b3e9; box-shadow: 0 0 0 3px rgba(36, 179, 233, .25); }
.step-num.step-num--sky { background: #24b3e9; }
.btn--sky { background: #24b3e9; border-color: #24b3e9; color: #fff; }
.btn--sky:hover { background: #1a9fd1; border-color: #1a9fd1; color: #fff; }
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; margin-right: .5rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: .8rem; font-weight: 700; vertical-align: middle; }

/* Ingrédients regroupés par catégorie dans les tableaux (2026-11-05). */
.table tr.group-row td { background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding-top: .45rem; padding-bottom: .45rem; }
@media print { .table tr.group-row td { background: #eee !important; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* Rapports (2026-11-05) : une section colorée par thème, chaque tableau dans un bloc encadré. */
.report-section { --sec: var(--brand); --sec-soft: var(--brand-soft); border: 1px solid var(--line); border-left: 5px solid var(--sec); border-radius: var(--radius); padding: 1rem 1.25rem 1.25rem; margin-top: 1.5rem; background: var(--surface); }
.report-section:first-child { margin-top: 0; }
.report-section--sales { --sec: #2f6fae; --sec-soft: #e8f0f9; }
.report-section--production { --sec: var(--brand); --sec-soft: var(--brand-soft); }
.report-section--shop { --sec: #2e7d4f; --sec-soft: #e6f3ea; }
.report-section--result { --sec: #b26a00; --sec-soft: #fbefd9; }
.report .report-section > .report-h { margin: 0 0 .25rem; color: var(--sec); border-bottom: 2px solid var(--sec); padding-bottom: .35rem; font-weight: 600; }
.report-block { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: .9rem; background: var(--surface); }
.report .report-block > .report-h3 { margin: 0; padding: .5rem .8rem; background: var(--sec-soft); color: var(--sec); border-bottom: 1px solid var(--line); font-size: .95rem; font-weight: 600; }
.report-block .table { margin: 0; }
.report-block .table thead th { background: var(--surface-2); }
@media print {
    .report-section { break-inside: auto; border-left-width: 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .report-block { break-inside: avoid; }
    .report .report-block > .report-h3 { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Recherche avec suggestions (combobox), ex. choix du client d'une facture (2026-11-05). */
.combo { position: relative; }
.combo__field { position: relative; }
.combo__field input { width: 100%; padding-left: 2.3rem; padding-right: 2.2rem; }
.combo__icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.combo__clear { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); width: 1.6rem; height: 1.6rem; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.combo__clear:hover { background: var(--brand-soft); color: var(--brand-strong); }
.combo__list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem; list-style: none; max-height: 18rem; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 24px rgba(0, 0, 0, .12); }
.combo__item { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .5rem .65rem; border-radius: 6px; cursor: pointer; }
.combo__item.is-active, .combo__item:hover { background: var(--brand-soft); }
.combo__item.is-selected .combo__label::after { content: ' ✓'; color: var(--brand); }
.combo__label { font-weight: 600; color: var(--ink); }
.combo__detail { font-size: .85rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.combo__empty { padding: .6rem .65rem; color: var(--muted); font-style: italic; }

/* Bulle de discussion entre utilisateurs (2026-11-06). */
.chat { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: .75rem; }
.chat__bubble { position: relative; width: 3.4rem; height: 3.4rem; border: 0; border-radius: 50%; background: #29b6f6; color: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, .22); cursor: pointer; display: grid; place-items: center; transition: transform .15s, background .15s; }
.chat__bubble:hover { background: #0ea5e9; transform: translateY(-2px); }
.chat__bubble .icon { width: 1.55rem; height: 1.55rem; }
.chat__badge { position: absolute; top: -.2rem; right: -.2rem; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.35rem; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.chat__panel { width: min(23rem, calc(100vw - 2rem)); height: min(32rem, calc(100vh - 7rem)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .2); overflow: hidden; }
.chat__panel[hidden] { display: none; }
.chat__head { display: flex; align-items: center; gap: .5rem; padding: .7rem .8rem; background: var(--brand); color: #fff; }
.chat__title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.chat__title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__title small { opacity: .85; font-size: .76rem; }
.chat__icon-btn { width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.3rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.chat__icon-btn:hover { background: rgba(255, 255, 255, .28); }
.chat__icon-btn .icon { width: 1rem; height: 1rem; }
.chat__list { flex: 1; overflow-y: auto; margin: 0; padding: .35rem; list-style: none; }
.chat__conv { display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: 10px; cursor: pointer; }
.chat__conv:hover, .chat__conv:focus { background: var(--brand-soft); outline: 0; }
.chat__conv--general { border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; margin-bottom: .25rem; }
.chat__avatar { flex: none; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-weight: 700; font-size: .85rem; display: grid; place-items: center; }
.chat__conv--general .chat__avatar { background: var(--brand); color: #fff; }
.chat__conv-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.chat__conv-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__conv-text small { color: var(--muted); font-size: .76rem; }
.chat__unread { flex: none; min-width: 1.4rem; height: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .74rem; font-weight: 700; line-height: 1.4rem; text-align: center; }
.chat__thread { flex: 1; overflow-y: auto; padding: .8rem; background: var(--bg); display: flex; flex-direction: column; gap: .45rem; }
.chat__msg { align-self: flex-start; max-width: 82%; display: flex; flex-direction: column; }
.chat__msg--mine { align-self: flex-end; align-items: flex-end; }
.chat__who { font-size: .72rem; font-weight: 600; color: var(--brand-strong); margin: 0 0 .1rem .3rem; }
.chat__text { padding: .5rem .75rem; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; }
.chat__msg--mine .chat__text { background: var(--brand); color: #fff; border-color: var(--brand); border-radius: 14px 14px 4px 14px; }
.chat__time { font-size: .68rem; color: var(--muted); margin: .1rem .35rem 0; }
.chat__note { margin: auto; color: var(--muted); font-size: .85rem; text-align: center; padding: 1rem; }
.chat__note--error { margin: 0; color: var(--danger); padding: .3rem; }
.chat__form { display: flex; align-items: flex-end; gap: .5rem; padding: .6rem; border-top: 1px solid var(--line); background: var(--surface); }
.chat__form[hidden], .chat__thread[hidden], .chat__list[hidden] { display: none; }
.chat__form textarea { flex: 1; resize: none; min-height: 2.4rem; max-height: 7.5rem; overflow-y: hidden; border-radius: 18px; padding: .55rem .85rem; line-height: 1.3; }
.chat__send { flex: none; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%; background: var(--brand); color: #fff; cursor: pointer; display: grid; place-items: center; }
.chat__send:hover { background: var(--brand-strong); }
.chat__send .icon { width: 1.05rem; height: 1.05rem; }
@media print { .chat { display: none !important; } }

/* Tableau de bord : pains par date de livraison, colonnes empilées par type (2026-11-06). */
.dash-chart__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.dash-chart__filter { display: flex; align-items: center; gap: .4rem; }
.dash-chart__filter input[type=month] { width: auto; }
.dash-chart__card { padding: .9rem 1rem .6rem; }
.dash-chart__legend { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: 0 0 .5rem; padding: 0; list-style: none; font-size: .86rem; color: var(--ink); }
.dash-chart__legend li { display: inline-flex; align-items: center; gap: .4rem; }
.dash-chart__legend strong { font-variant-numeric: tabular-nums; }
.dash-chart__legend-total { margin-left: auto; color: var(--muted); }
.dash-chart__swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: 3px; background: var(--bread); }
.dash-chart__plot { position: relative; }
.dash-chart__plot svg { display: block; width: 100%; height: auto; }
.dash-chart__grid { stroke: var(--line); stroke-width: 1; }
.dash-chart__axis { stroke: var(--line-strong); stroke-width: 1; }
.dash-chart__tick, .dash-chart__day { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.dash-chart__day.is-sunday { font-weight: 700; }
.dash-chart__seg { fill: var(--bread); }
.dash-chart__hit { fill: transparent; cursor: default; }
.dash-chart__hit.is-active { fill: rgba(0, 0, 0, .04); }
.dash-chart__tip { position: absolute; z-index: 5; pointer-events: none; min-width: 11rem; padding: .55rem .7rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 22px rgba(0, 0, 0, .14); font-size: .82rem; color: var(--ink); }
.dash-chart__tip strong { display: block; margin-bottom: .3rem; }
.dash-chart__tip-row { display: flex; justify-content: space-between; gap: 1rem; padding: .08rem 0; }
.dash-chart__tip-row span { display: inline-flex; align-items: center; gap: .4rem; }
.dash-chart__tip-row b { font-variant-numeric: tabular-nums; }
.dash-chart__tip-total { margin-top: .3rem; padding-top: .3rem; border-top: 1px solid var(--line); font-weight: 600; }
.dash-chart__table { margin-top: .4rem; }
.dash-chart__table summary { cursor: pointer; color: var(--brand); font-size: .86rem; padding: .25rem 0; }
.dash-chart__table .table { margin-top: .4rem; }

/* Tableau de bord, blocs (2026-11-06) : Demain, Argent à suivre, Magasin et stock, Le mois. */
.dash-block__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.dash-block__actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.dash-kpi__label { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.dash-kpi__value { display: block; font-size: 1.6rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.dash-kpi__value small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.dash-tomorrow__grid { display: grid; grid-template-columns: minmax(150px, auto) 1fr minmax(240px, auto); gap: 1rem 1.5rem; align-items: start; padding: 1rem; }
.dash-tomorrow__total { border-right: 1px solid var(--line); padding-right: 1.25rem; }
.dash-tomorrow__total .dash-kpi__value { font-size: 2.2rem; color: var(--brand-strong); }
.dash-tomorrow__types { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem .9rem; margin: 0; padding: 0; list-style: none; }
.dash-tomorrow__types li { display: flex; align-items: center; gap: .45rem; padding: .35rem .55rem; border-radius: 6px; background: var(--surface-2); border-left: 4px solid var(--bread); }
.dash-tomorrow__types li .dash-chart__swatch { display: none; }
.dash-tomorrow__types li strong { margin-left: auto; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.dash-tomorrow__prod { display: grid; gap: .35rem; margin: 0; }
.dash-tomorrow__prod div { display: flex; justify-content: space-between; gap: 1rem; }
.dash-tomorrow__prod dt { color: var(--muted); }
.dash-tomorrow__prod dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 900px) {
    .dash-tomorrow__grid { grid-template-columns: 1fr; }
    .dash-tomorrow__total { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: .75rem; }
}
.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 0 1.25rem; align-items: start; }
.dash-cols--wide { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; }
@media (max-width: 900px) { .dash-cols--wide { grid-template-columns: minmax(0, 1fr); } }
.dash-money { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-bottom: 1px solid var(--line); }
.dash-money__item { display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1rem; color: inherit; text-decoration: none; min-width: 0; }
.dash-money__item + .dash-money__item { border-left: 1px solid var(--line); }
.dash-money__item .dash-kpi__value { font-size: 1.35rem; }
a.dash-money__item:hover { background: var(--surface-2); }
.dash-money__item.is-alert .dash-kpi__value { color: var(--danger); }
.dash-money__item.is-warn .dash-kpi__value { color: var(--warning-ink); }
@media (max-width: 560px) { .dash-money { grid-template-columns: 1fr; } .dash-money__item + .dash-money__item { border-left: 0; border-top: 1px solid var(--line); } }
.dash-shop__line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; }
.dash-shop__line a strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.dash-kpi { display: flex; flex-direction: column; gap: .2rem; padding: .8rem .95rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.dash-kpi .dash-kpi__value { font-size: 1.45rem; }
.dash-kpi__prev { font-size: .8rem; color: var(--muted); }
.dash-delta { font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); }
.dash-delta.is-good { color: var(--success); }
.dash-delta.is-bad { color: var(--danger); }
.dash-card-title { margin: 0 0 .6rem; font-size: .95rem; font-weight: 600; }
.dash-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dash-line__dot { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.dash-hbars { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.dash-hbars li { display: grid; grid-template-columns: minmax(80px, 8rem) 1fr auto; align-items: center; gap: .6rem; font-size: .88rem; }
.dash-hbars__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-hbars__track { height: 12px; border-radius: 0 4px 4px 0; background: var(--surface-2); overflow: hidden; }
.dash-hbars__bar { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--bread); }
.dash-hbars__value { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; min-width: 7.5rem; }
.dash-mini td { padding-top: .3rem; padding-bottom: .3rem; }
.dash-mini tfoot td { font-weight: 600; }
.dash-cols { margin-bottom: 1.25rem; }
.dash-cols > .section { margin-top: 0; }
.dash-cols--wide { margin-bottom: 0; }
.dash-cols--wide > .card { margin-top: 0; }
/* Caisse générale : règlement d'un achat à payer (2026-11-06). */
.debt-pay { display: grid; gap: .35rem; margin-top: .4rem; min-width: 14rem; }

/* Icône voiture du client « Mpitety tsena » : en noir (2026-11-06). */
.car-mark { color: #000; }

/* Chariot enregistré (2026-11-06) : ligne en lecture seule dans la saisie de production. */
.cart-locked input { background: var(--surface-2, #f1f3f5); }

/* Boutons d'un long formulaire collés en bas de l'écran (saisie de production, 2026-11-06). */
.form-actions--sticky {
    position: sticky; bottom: 0; z-index: 15; margin-top: 1rem; padding: .7rem 5.5rem .7rem 1.25rem; /* à droite : place du bouton de discussion */
    background: var(--surface); border: 1px solid rgba(0, 0, 0, .125); border-radius: var(--radius);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, .08);
}

