/* NOCR — feuille de style de l'interface générale. */

:root {
  /* Couleurs proches de l'interface que les équipes connaissent (bleu canard), voir docs/design.md. */
  --night: #023b47;
  --teal: #0e7c86;
  --teal-dark: #064552;
  --bg: #eef2f6;
  --surface: #ffffff;
  --text: #1f2a33;
  --muted: #63707c;
  --border: #dbe2e8;
  --accent: #0e7c86;
  --accent-soft: #e2f2f3;
  --green: #27ae60;
  --orange: #ee8f10;
  --purple: #7c3aed;
  --danger: #d64040;
  --danger-soft: #fdecea;
  --warning-soft: #fff4d6;
  --radius: 14px;
  --shadow: 0 6px 18px rgba(2, 59, 71, .08);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }

/* Barre de menu (haut de page) : css/site_header.css, partagée avec l'appli. */

.content { padding: 1.5rem 1.2rem; max-width: 1250px; margin: 0 auto; }
.content.centered { margin: 2rem auto; }
/* Pages qui ont besoin de toute la largeur (calendriers) */
.content.wide { max-width: none; }

@media (max-width: 900px) {
  .content { padding: 1rem; }
}

/* Bandeau de titre (comme les pages actuelles) */
.content > h1:first-of-type, .page-header {
  background: linear-gradient(120deg, var(--teal), var(--teal-dark));
  color: #fff; border-radius: var(--radius); padding: 1.1rem 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.2rem;
}
.content > h1:first-of-type { font-size: 1.7rem; font-weight: 800; }
.page-header h1 { font-size: 1.7rem; font-weight: 800; color: #fff; }
.page-header a:not(.button) { color: #e2f6f7; }
.page-header .button, .page-header button { background: #fff; color: var(--teal-dark); border-color: #fff; }
.page-header .button.secondary, .page-header button.secondary { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .6); }
.page-header .button.danger, .page-header button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.card .page-header { background: none; color: inherit; box-shadow: none; padding: 0; margin-bottom: .8rem; border-radius: 0; }
.card .page-header .button.secondary, .card .page-header button.secondary { background: var(--surface); color: var(--teal); border-color: var(--teal); }
.card .page-header a:not(.button) { color: var(--teal); }

/* Blocs */
.card { background: var(--surface); border: 0; border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem;
        box-shadow: var(--shadow); }
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.page-header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.page-header h1 { margin: 0; flex: 1; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input[type=search], .toolbar select { width: auto; min-width: 12rem; }
.toolbar input[type=date] { width: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 1.25rem; }
.muted { color: var(--muted); }
.badge { display: inline-block; font-size: .8rem; padding: .1rem .5rem; border-radius: 999px; background: var(--bg);
         border: 1px solid var(--border); margin: 0 .2rem .2rem 0; }
.badge.ok { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.badge.off { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; vertical-align: middle; }
dl.details { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; }

/* Tableaux */
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
th { background: #f5f8fa; }

/* Formulaires */
.field { margin-bottom: 1rem; }
.field > label { display: block; margin-bottom: .3rem; font-weight: 500; }
label.checkbox { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
input, select, textarea { width: 100%; padding: .55rem .7rem; font: inherit; border: 2px solid var(--border);
                          border-radius: 10px; background: var(--surface); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 124, 134, .15); }
input[type=checkbox], input[type=radio] { width: auto; }
input[type=color] { width: 4rem; height: 2.4rem; padding: .15rem; }
textarea { min-height: 5rem; }
.field ul { list-style: none; padding: 0; margin: 0; }
.field ul li label { display: flex; gap: .5rem; align-items: center; font-weight: 400; padding: .15rem 0; }
.checkbox-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.checkbox-groups fieldset { border: 1px solid var(--border); border-radius: 6px; margin: 0; }
.help { display: block; color: var(--muted); font-size: .85rem; margin-top: .25rem; }
.errorlist { color: var(--danger); margin: .25rem 0; }
.field-error input, .field-error select, .field-error textarea { border-color: var(--danger); }
.form-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
fieldset.formset-row { border: 1px solid var(--border); border-radius: 6px; margin: 0 0 .75rem; padding: .75rem; }

/* Boutons */
button, .button { display: inline-block; background: linear-gradient(135deg, var(--teal), var(--teal-dark)); color: #fff;
                  border: 1px solid var(--teal); border-radius: 10px; padding: .55rem 1rem; font: inherit; font-weight: 600;
                  cursor: pointer; text-decoration: none; }
.button.green, button.green { background: var(--green); border-color: var(--green); }
.button.orange, button.orange { background: var(--orange); border-color: var(--orange); }
.button.secondary, button.secondary { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.button.danger, button.danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
button.link { background: none; border: 0; color: var(--accent); padding: 0; text-decoration: underline; }
button.ghost { background: none; color: var(--accent); border: 1px solid var(--border); padding: .2rem .6rem; font-size: .85rem; box-shadow: none; }
.switch { min-width: 7.5rem; }
.switch.on { background: var(--accent); }
.switch.off { background: var(--surface); color: var(--muted); border-color: var(--border); }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { background: var(--accent-soft); border-radius: 6px; padding: .7rem 1rem; margin-bottom: .5rem; }
.messages li.warning, .messages li.error { background: var(--warning-soft); }
.links { margin-top: 1.25rem; line-height: 1.9; }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* Catalogue */
.catalog-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; align-items: start; }
.catalog-tree { padding: .5rem; max-height: calc(100vh - 140px); overflow-y: auto; position: sticky; top: 70px; }
.catalog-tree a { display: block; padding: .35rem .5rem; border-radius: 6px; text-decoration: none; color: var(--text); }
.catalog-tree a.sub { padding-left: 1.6rem; font-size: .92rem; color: var(--muted); }
.catalog-tree a.sub2 { padding-left: 2.6rem; }
.catalog-tree a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.catalog-tree .icon { display: inline-block; width: 1.4rem; }
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.article-card { display: flex; flex-direction: column; gap: .25rem; padding: .85rem; background: var(--surface);
                border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text);
                min-height: 6rem; }
.article-card:hover { border-color: var(--accent); }
.article-card.archived { opacity: .6; }
.article-card .name { font-weight: 600; }
.small { font-size: .85rem; }
.big-price { font-size: 1.5rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
@media (max-width: 800px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-tree { position: static; max-height: 14rem; }
}

/* Bilans */
.report-filters .toolbar { margin-bottom: .6rem; }
.report-filters label { display: inline-flex; gap: .4rem; align-items: center; }
.small-button { padding: .3rem .7rem; font-size: .88rem; }
.inline-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.point-picker .items { padding: .6rem; max-height: 60vh; overflow-y: auto; z-index: 20; }
.point-picker fieldset { border: 0; padding: 0; margin: 0 0 .6rem; }
.point-picker legend { font-weight: 700; font-size: .85rem; color: var(--muted); }
.point-picker label { display: flex; padding: .15rem 0; }
.report-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.report-tabs a { background: var(--surface); border-radius: 999px; padding: .35rem .9rem; text-decoration: none;
                 color: var(--teal-dark); font-weight: 600; box-shadow: var(--shadow); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: .75rem; margin-bottom: .5rem; }
.kpi { background: var(--surface); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow);
       display: flex; flex-direction: column; gap: .15rem; }
.kpi .label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.kpi strong { font-size: 1.5rem; }
.small-kpis .kpi { box-shadow: none; background: var(--bg); }
.small-kpis .kpi strong { font-size: 1.2rem; }
.delta { font-size: .85rem; font-weight: 600; }
.delta.up { color: var(--green); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 0 1.25rem; }
section[id] { scroll-margin-top: 80px; }
.report-grid > * { min-width: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.detail-row td:empty { display: none; }
table.nested { width: 100%; background: var(--bg); }
table.traffic td, table.traffic th { text-align: center; padding: .35rem .3rem; font-size: .85rem; }
.heat-1 { background: #e2f2f3; }
.heat-2 { background: #b5dfe2; }
.heat-3 { background: #6fbfc6; color: #fff; }
.heat-4 { background: var(--teal); color: #fff; }
@media (max-width: 600px) {
  .report-grid { grid-template-columns: 1fr; }
  .kpi strong { font-size: 1.25rem; }
}

/* Boutiques : rayons */
a.kpi { text-decoration: none; color: inherit; }
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: .75rem; }
.shelf-card { border: 1px solid var(--border); border-left: 5px solid var(--green); border-radius: 10px; padding: .7rem .8rem;
              display: flex; flex-direction: column; gap: .35rem; background: var(--surface); }
.shelf-card.late, .shelf-card.never { border-left-color: var(--danger); }
.shelf-card.soon { border-left-color: var(--orange); }
.shelf-head { display: flex; justify-content: space-between; gap: .5rem; align-items: start; }
.shelf-photos { display: flex; gap: .3rem; }
.shelf-photos img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.shelf-renew { display: flex; gap: .4rem; margin: 0; }
.shelf-history { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: .75rem; }
.shelf-history img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 8px; }

/* Tableau de bord d'une boutique : rayons à gauche, demandes à droite */
.shop-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .8rem 1.5rem;
               background: linear-gradient(120deg, var(--teal-dark), var(--night)); color: #fff; border-radius: var(--radius);
               padding: 1rem 1.4rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.shop-banner h1 { margin: 0; font-size: 1.5rem; font-weight: 800; color: #fff; }
.shop-banner p { margin: .2rem 0 0; color: #bfe0e3; font-size: .9rem; }
.shop-figures { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.2rem; }
.shop-figures > span { display: flex; flex-direction: column; line-height: 1.2; }
.shop-figures small { color: #bfe0e3; font-size: .75rem; }
.shop-figures strong { font-size: 1.15rem; }
.shop-figures .delta.up { color: #7ee2a8; } .shop-figures .delta.down { color: #ffb4b4; } .shop-figures .delta.flat { color: #bfe0e3; }
.shop-figures .button { background: #fff; color: var(--teal-dark); border-color: #fff; }
.shop-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.board-side { display: flex; flex-direction: column; gap: 1rem; }
.board-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 1rem 1rem; margin: 0; }
.board-title { display: flex; align-items: center; gap: .6rem; margin: 0 -1rem .8rem; padding: .7rem 1rem;
               border-bottom: 1px solid var(--border); background: #f7f9fb; border-radius: var(--radius) var(--radius) 0 0; }
.board-title h2 { margin: 0; font-size: 1.05rem; flex: 1; }
.board-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .7rem; }
.board-stats > div { background: #f3f6f8; border-radius: 10px; padding: .45rem; text-align: center; display: flex; flex-direction: column; }
.board-stats strong { font-size: 1.3rem; line-height: 1.2; }
.board-stats span { font-size: .8rem; color: var(--muted); }
.board-stats .late strong { color: #c53030; } .board-stats .soon strong { color: #c05621; } .board-stats .ok strong { color: #276749; }
.age { display: inline-block; border-radius: 8px; padding: .1rem .5rem; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.age.late { background: #fde8e8; color: #c53030; } .age.soon { background: #fef3e2; color: #c05621; } .age.ok { background: #e6f4ea; color: #276749; }
.rayon { border: 1px solid var(--border); border-radius: 10px; margin-bottom: .5rem; }
.rayon > summary { display: flex; gap: .6rem; align-items: center; padding: .55rem .75rem; cursor: pointer; list-style: none; }
.rayon > summary::-webkit-details-marker { display: none; }
.rayon > summary::before { content: "▸"; color: var(--muted); font-size: .8rem; transition: transform .15s; }
.rayon[open] > summary::before { transform: rotate(90deg); }
.rayon-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rayon-name small, .spot-name small, .request-text small { color: var(--muted); font-size: .78rem; }
.rayon-state { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.counters { display: flex; gap: .25rem; }
.counters .age { font-size: .72rem; padding: 0 .35rem; }
.spots { border-top: 1px solid var(--border); padding: .5rem .75rem; background: #fafbfc; border-radius: 0 0 10px 10px; }
.spot { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.spot img, .spot .no-photo { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: grid; place-items: center;
                             background: var(--bg); color: var(--muted); }
.spot-name { flex: 1; min-width: 8rem; display: flex; flex-direction: column; }
.spot-actions { display: flex; gap: .3rem; margin: 0; }
.new-rayon { margin-top: .8rem; font-size: .9rem; }
.new-rayon > div { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .3rem; }
.new-rayon input[name=name] { width: auto; flex: 1 1 10rem; padding: .3rem .5rem; }
.new-rayon label { display: inline-flex; align-items: center; gap: .3rem; margin: 0; font-weight: 400; }
.new-rayon input[type=number] { width: 4.5rem; padding: .3rem .4rem; }
.type-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.type-chips label { margin: 0; cursor: pointer; }
.type-chips input { position: absolute; opacity: 0; pointer-events: none; }
.type-chips span { display: inline-block; padding: .15rem .5rem; border-radius: 4px; font-size: .85rem; font-weight: 600;
                   border: 1px solid var(--chip); color: var(--chip); background: color-mix(in srgb, var(--chip) 8%, #fff); }
.type-chips input:checked + span { background: var(--chip); color: #fff; }
.type-chips input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.request-line { display: flex; gap: .5rem; }
.request-line input { flex: 1; }
.request { display: flex; align-items: flex-start; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.request:last-child { border-bottom: 0; }
.request form { margin: 0; }
.type-badge { color: #fff; border-radius: 6px; padding: .15rem .5rem; font-size: .8rem; font-weight: 600; white-space: nowrap; margin-top: .1rem; }
.request-text { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.request-text a { color: var(--text); text-decoration: none; }
.request button { padding: .2rem .6rem; font-size: .82rem; background: #fff; }
.request button.resolve { color: var(--green); border-color: var(--green); }
.request button.reopen { color: var(--muted); border-color: var(--border); }
.resolved .type-badge { opacity: .55; }
.resolved .request-text a { color: var(--muted); }
@media (max-width: 900px) { .shop-board { grid-template-columns: 1fr; } }

/* Notifications : la cloche et la liste */
.notification-list { list-style: none; padding: 0; margin: 0; }
.notification-list li { border-bottom: 1px solid var(--border, #ddd); }
.notification-list button.link { display: flex; flex-direction: column; gap: .15rem; width: 100%; text-align: left; padding: .6rem .4rem; }
.notification-list li.unread { background: color-mix(in srgb, var(--teal, #0e7c86) 8%, transparent); }
.notification-list li.important strong::before { content: "❗ "; }

.week-nav { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* Planning : grille mois / semaine, proche de l'écran que les équipes connaissent */
.cal-tabs { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.cal-tab { --tab: var(--teal); padding: .5rem 1rem; border-radius: 10px; border: 2px solid var(--tab); background: var(--surface);
           color: var(--text); text-decoration: none; font-weight: 600; }
.cal-tab.dashed { border-style: dashed; border-color: #7f8c8d; }
.cal-tab.leave { --tab: #d97706; border-color: #f59e0b; }
.cal-tab.active { background: var(--tab); border-color: var(--tab); color: #fff; border-style: solid; }
.cal-views { margin-left: auto; display: inline-flex; background: var(--surface); border-radius: 10px; padding: .2rem; box-shadow: var(--shadow); }
.cal-views a { padding: .4rem .9rem; border-radius: 8px; text-decoration: none; color: var(--teal-dark); font-weight: 600; }
.cal-views a.active { background: var(--teal); color: #fff; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; gap: .5rem; background: var(--surface);
           border-radius: 12px; padding: .9rem 1.2rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.cal-nav strong { font-size: 1.5rem; color: var(--teal); text-align: center; }
.cal-filters { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; padding: .9rem 1.2rem; }
.cal-filters label { display: flex; flex-direction: column; font-size: .85rem; font-weight: 600; color: var(--muted); }
.cal-filters select, .cal-filters input { width: auto; min-width: 12rem; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: #e8eef4;
            border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 4rem; }
.cal-head { background: var(--teal); color: #fff; padding: .8rem .3rem; text-align: center; font-weight: 700; }
.cal-head .short { display: none; }
.cal-day { background: var(--surface); min-height: 120px; padding: .4rem; min-width: 0; }
.calendar.week-view .cal-day { min-height: 320px; }
.cal-day.other { background: #f8f9fa; opacity: .75; }
.cal-day.other .cal-num { color: #999; }
.cal-day.today { background: #e0f2fe; }
.cal-num { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.1rem; margin-bottom: .35rem; }
.cal-num .dname { display: none; }
.cal-num .add { text-decoration: none; opacity: .35; font-weight: 400; }
.cal-day:hover .cal-num .add { opacity: 1; }
.cal-day.can-add { cursor: pointer; }
.cal-day.can-add:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day.can-add .cal-group { cursor: default; }
.cal-slot { display: flex; flex-direction: column; gap: .1rem; color: #fff; padding: .35rem .45rem; margin-bottom: .3rem;
            border-radius: 6px; text-decoration: none; font-size: .9rem; line-height: 1.25; transition: transform .15s, box-shadow .15s; }
.cal-slot:hover { transform: translateX(2px); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.cal-slot.mine { outline: 3px solid #ffd54f; outline-offset: -3px; }
.cal-slot .t { font-weight: 700; overflow-wrap: anywhere; }
.cal-slot .h { font-size: .8rem; opacity: .9; }
.cal-slot .type { align-self: flex-start; background: rgba(0, 0, 0, .18); border-radius: 4px; padding: 0 .35rem; font-size: .72rem; }
.cal-group { display: flex; flex-direction: column; gap: .15rem; padding: .35rem .45rem; margin-bottom: .3rem; border-radius: 6px;
             font-size: .9rem; line-height: 1.25; }
.cal-group.mine { outline: 3px solid #ffd54f; outline-offset: -3px; }
.cal-group > .t { font-weight: 700; overflow-wrap: anywhere; }
.cal-group > .h { font-size: .8rem; opacity: .9; }
.cal-item { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; color: inherit; text-decoration: none;
            border-radius: 4px; padding: .05rem 0; }
.cal-item:hover { background: rgba(255, 255, 255, .15); }
.cal-item .pill { font-size: .75rem; font-weight: 700; border-radius: 4px; padding: .05rem .4rem; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.cal-item .hh { font-size: .72rem; opacity: .85; }
.color-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.color-tile { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .8rem; border-radius: 8px; text-decoration: none;
              box-shadow: 0 1px 3px rgba(0, 0, 0, .15); transition: transform .15s; }
.color-tile:hover { transform: translateY(-2px); }
.color-tile span { font-size: .8rem; opacity: .85; }
.color-tile.off { opacity: .5; }
.counts { display: inline-flex; flex-wrap: wrap; gap: .2rem; }
.counts b { font-size: .72rem; border-radius: 4px; padding: 0 .3rem; line-height: 1.35; }
.counts .count { background: rgba(255, 255, 255, .35); color: #1f2a33; }
.counts .count.partial { background: rgba(255, 220, 80, .85); }
.counts .count.empty { background: rgba(255, 110, 110, .9); }
.role { --role: var(--teal); background: #fff; color: var(--role); border: 1.5px solid var(--role); border-radius: 4px; padding: 0 .3rem; font-size: .72rem; }
.role.missing { background: var(--role); color: #fff; border-color: #fff; }
.mine-badge { margin-left: auto; flex: none; background: #ffd54f; color: #1f2a33; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 0 .45rem; line-height: 1.5; }
.cal-legend .mine-badge { margin-left: 0; }
.cal-slot .t-row { display: flex; align-items: flex-start; gap: .3rem; }
.cal-slot .t-row .t { min-width: 0; }
.cal-legend { font-size: .85rem; margin: -.4rem 0 .6rem; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
/* Créneaux passés : grisés */
.cal-slot.past, .cal-group.past { filter: grayscale(.5); opacity: .75; }
.cal-group:not(.past) .cal-item.past { filter: grayscale(.6); opacity: .7; }
.cal-slot.past:hover, .cal-group.past:hover { opacity: .95; }
.cal-absent { display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .2rem; }
.cal-absent span { font-size: .72rem; background: var(--warning-soft); color: #7c5a00; border-radius: 4px; padding: 0 .3rem; }
.cal-leave { font-size: .75rem; border-radius: 4px; padding: .1rem .3rem; margin-top: .2rem; background: #e8f5e9; color: #1b5e20; }
.cal-leave.requested { background: var(--warning-soft); color: #7c5a00; }
.cal-fab { position: fixed; right: 1.5rem; bottom: 1.5rem; background: var(--green); color: #fff; text-decoration: none;
           font-weight: 700; padding: .9rem 1.4rem; border-radius: 999px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); z-index: 50; }
@media (max-width: 768px) {
  .cal-head { padding: .5rem 0; font-size: .8rem; }
  .cal-head .long { display: none; }
  .cal-head .short { display: inline; }
  .cal-day { min-height: 70px; padding: .2rem; }
  .cal-num { font-size: .85rem; }
  .cal-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .2rem; }
  .cal-tab { white-space: nowrap; padding: .35rem .7rem; font-size: .85rem; }
  .cal-nav { padding: .5rem; }
  .cal-nav .button { padding: .4rem .6rem; font-size: .85rem; }
  .cal-num .add { display: none; }
  .cal-slot { padding: .15rem .2rem; font-size: .65rem; border-radius: 4px; }
  .cal-slot .t { overflow-wrap: normal; word-break: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cal-fab { right: 1rem; bottom: 1rem; padding: .7rem 1rem; }
  .cal-slot .end, .cal-slot .counts, .cal-slot .type { display: none; }
  .cal-group { padding: .15rem .2rem; font-size: .65rem; border-radius: 4px; }
  .cal-group > .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
  .cal-item .hh, .cal-item .counts { display: none; }
  .mine-badge { font-size: .55rem; padding: 0 .25rem; }
  .cal-item .pill { font-size: .6rem; padding: 0 .2rem; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .cal-nav strong { font-size: 1.1rem; }
  .cal-views { margin-left: 0; }
  .calendar.week-view { grid-template-columns: 1fr; }
  .calendar.week-view .cal-head { display: none; }
  .calendar.week-view .cal-day { min-height: 0; }
  .calendar.week-view .cal-num .dname { display: inline; }
  .calendar.week-view .cal-slot { font-size: .85rem; padding: .3rem .45rem; }
  .calendar.week-view .cal-slot .t { white-space: normal; }
  .calendar.week-view .cal-group { font-size: .85rem; padding: .3rem .45rem; }
  .calendar.week-view .cal-item .hh, .calendar.week-view .cal-item .counts { display: initial; }
  .calendar.week-view .cal-item .pill { font-size: .75rem; }
  .calendar.week-view .cal-slot .end, .calendar.week-view .cal-slot .counts, .calendar.week-view .cal-slot .type { display: initial; }
}
.registrations { list-style: none; padding: 0; }
.registrations li { padding: .35rem 0; border-bottom: 1px solid var(--border, #eee); }
.registrations li.cancelled { opacity: .6; }
.inline-form { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

/* Congés : calendrier du mois */
table.month { table-layout: fixed; width: 100%; }
table.month td { vertical-align: top; height: 4.5rem; padding: .2rem; border: 1px solid var(--border, #e5e5e5); }
table.month td.out { opacity: .4; }
table.month .num { font-size: .75rem; color: var(--muted, #666); display: block; }
table.month .leave { display: block; font-size: .78rem; border-left: 4px solid; padding-left: .25rem; margin: .1rem 0; text-decoration: none; color: inherit; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
table.month .leave.requested { font-style: italic; opacity: .75; }

/* Kanban */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.board-tile { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: inherit; }
.kanban { display: flex; gap: .7rem; overflow-x: auto; align-items: flex-start; padding-bottom: 1rem; }
.kanban .column { flex: 0 0 280px; background: color-mix(in srgb, var(--teal, #0e7c86) 6%, var(--card, #fff)); border-radius: 10px; padding: .5rem; }
.kanban .column header { display: flex; justify-content: space-between; align-items: center; }
.kanban .column h2 { font-size: 1rem; margin: 0; }
.kanban .cards { min-height: 2rem; display: flex; flex-direction: column; gap: .4rem; margin: .4rem 0; }
.kcard { display: flex; flex-direction: column; gap: .2rem; background: var(--card, #fff); border-radius: 8px; padding: .45rem .55rem; text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(0,0,0,.12); cursor: grab; }
.kcard.dragging { opacity: .5; }
.kcard.done strong { text-decoration: line-through; opacity: .6; }
.kcard .labels { display: flex; gap: .2rem; }
.kcard .labels span { width: 28px; height: 6px; border-radius: 3px; }
.kcard .meta { display: flex; gap: .4rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted, #666); align-items: center; }
.kcard .due.late { color: #a33; font-weight: 700; }
.kcard .who { background: var(--teal, #0e7c86); color: #fff; border-radius: 999px; padding: 0 .35rem; text-transform: uppercase; }
.kanban .add-card input, .kanban .column.new input { width: 100%; }
.card-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; }
@media (max-width: 800px) { .card-layout { grid-template-columns: 1fr; } .kanban .column { flex-basis: 85vw; } }

/* Iris (assistant IA) */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; align-items: start; }
.chat-log { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .75rem; }
.bubble { max-width: 85%; padding: .7rem .9rem; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.bubble p { margin: 0 0 .5rem; }
.bubble ul { margin: 0 0 .5rem; padding-left: 1.2rem; }
.bubble p:last-child, .bubble ul:last-child { margin-bottom: 0; }
.bubble.question { align-self: flex-end; background: var(--bg); }
.bubble.answer.error { border-left: 4px solid var(--danger); }
.chat-form { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }
.chat-form textarea { flex: 1; min-width: 220px; }
.chat-history ul { list-style: none; padding: 0; margin: 0 0 1rem; line-height: 1.5; }
.chat-history li.active a { font-weight: 600; }
@media (max-width: 800px) { .chat-layout { grid-template-columns: 1fr; } .bubble { max-width: 100%; } }

/* Stock à l'unité : scan en rafale (douchette, caméra), fiche du dernier objet scanné */
.stock-scan-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.stock-scan-row input[name=code] { flex: 1; min-width: 12rem; font-size: 1.3rem; letter-spacing: .05em; }
.scan-camera { display: block; width: 100%; max-width: 420px; margin-top: .75rem; border-radius: var(--radius); background: #000; }
.stock-counter { font-size: 1.1rem; }
.stock-counter strong { font-size: 1.6rem; }
.stock-head { display: flex; gap: 1rem; align-items: flex-start; }
.stock-cover { width: 90px; max-height: 140px; object-fit: contain; border-radius: 4px; }
.stock-cover-small { width: 32px; max-height: 48px; object-fit: contain; }
.stock-quick { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.stock-quick label { display: flex; flex-direction: column; font-size: .85rem; }
@media (max-width: 700px) { .stock-head { flex-direction: column; } }

/* Fenêtres (popups) : voir static/js/modal.js. Bandeau bleu canard en haut, barre d'actions
   collée en bas, comme les fenêtres que les équipes connaissent. */
dialog.modal { border: 0; border-radius: var(--radius); padding: 0; width: min(720px, calc(100vw - 2rem)); max-height: calc(100vh - 3rem);
               background: var(--bg); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); color: var(--text); overflow: hidden; }
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal .modal-body { overflow: auto; flex: 1 1 auto; overscroll-behavior: contain; }
dialog.modal::backdrop { background: rgba(2, 30, 38, .55); }
dialog.modal .modal-close { position: absolute; top: .6rem; right: .7rem; z-index: 3; border-radius: 999px;
                            width: 2.2rem; height: 2.2rem; padding: 0; background: rgba(255, 255, 255, .15); color: #fff;
                            border: 1px solid rgba(255, 255, 255, .5); box-shadow: none; }
dialog.modal .modal-body > .content { padding: 0 1.1rem 0; max-width: none; margin: 0; }
dialog.modal .content > h1:first-of-type, dialog.modal .content > .page-header:first-of-type, dialog.modal .content > .toolbar:first-of-type {
  position: sticky; top: 0; z-index: 2; margin: 0 -1.1rem 1rem; padding: .9rem 3.5rem .9rem 1.2rem; border-radius: 0;
  background: linear-gradient(120deg, var(--teal), var(--teal-dark)); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
dialog.modal .content > h1:first-of-type, dialog.modal .content > :first-child h1 { color: #fff; font-size: 1.25rem; font-weight: 700; margin: 0; }
dialog.modal .content > :first-child .button { display: none; } /* actions : dans la barre du bas */
dialog.modal .content > :first-child a:not(.button) { color: #e2f6f7; }
dialog.modal .card { padding: 1rem; box-shadow: 0 1px 4px rgba(2, 59, 71, .08); }
dialog.modal .form-actions, dialog.modal .action-bar { position: sticky; bottom: 0; z-index: 2; margin: 1rem -1.1rem 0; padding: .7rem 1.1rem;
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -2px 8px rgba(0, 0, 0, .06); }
dialog.modal .form-actions a { display: inline-flex; align-items: center; padding: .55rem 1rem; border-radius: 10px; background: #6c757d;
                               color: #fff; text-decoration: none; font-weight: 600; }
dialog.modal .htmx-request { opacity: .6; transition: opacity .2s; }
@media (max-width: 700px) {
  dialog.modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  dialog.modal .modal-body > .content { min-height: 100%; display: flex; flex-direction: column; }
  dialog.modal .form-actions, dialog.modal .action-bar { margin-top: auto; }
}

/* Fiche d'un créneau (page ou fenêtre) */
.slot-sheet h2 { margin: 0 0 .6rem; font-size: 1.05rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .45rem .8rem; margin: 0; align-items: center; }
dl.facts dt { font-weight: 700; }
dl.facts dt::after { content: " :"; }
dl.facts dd { margin: 0; }
.facts-text { margin: .8rem 0 0; }
.tag { display: inline-block; font-size: .85rem; font-weight: 700; border-radius: 6px; padding: .1rem .55rem; }
.places { display: inline-block; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: .05rem .55rem; color: #fff; background: var(--green); }
.places.partial { background: #f5b301; color: #1f2a33; }
.places.empty { background: var(--danger); }
.people { list-style: none; padding: 0; margin: 0 0 .6rem; display: flex; flex-direction: column; gap: .35rem; }
.people li { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; background: var(--bg); border-radius: 8px; padding: .45rem .7rem; }
.people li.cancelled { opacity: .6; }
.people li form { margin-left: auto; }
.people .chip { font-size: .78rem; font-weight: 600; background: var(--accent-soft); color: var(--teal-dark); border-radius: 6px; padding: .05rem .45rem; }
button.icon { background: none; border: 0; color: var(--danger); padding: .1rem .4rem; box-shadow: none; font-size: .95rem; }
.you { background: var(--accent-soft); border-radius: 8px; padding: .5rem .7rem; font-weight: 600; }
details.add-person { margin-top: .6rem; }
details.add-person summary, .slot-sheet details summary { cursor: pointer; color: var(--teal); font-weight: 600; }
.action-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.action-bar form { margin: 0; }
.action { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-width: 6.2rem;
          min-height: 4rem; padding: .5rem .8rem; border-radius: 12px; border: 0; color: #fff; font-weight: 700; font-size: .95rem;
          text-decoration: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); cursor: pointer; line-height: 1.1; }
.action span { font-size: .9rem; }
.action:hover { filter: brightness(1.08); }
.action.grey { background: #6c757d; }
.action.green { background: var(--green); }
.action.teal { background: var(--teal); }
.action.orange { background: #f0ad4e; }
.action.red { background: #e74c3c; }
.action.purple { background: var(--purple); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.chip-button { background: var(--accent-soft); color: var(--teal-dark); border: 1px solid transparent; border-radius: 999px;
               padding: .3rem .8rem; font-size: .9rem; font-weight: 600; box-shadow: none; }
.chip-button:hover { border-color: var(--teal); }
@media (max-width: 700px) { .action { min-width: 0; flex: 1 1 5.5rem; } }
.negative { color: var(--danger); font-weight: 700; }

/* Liste des événements : cartes */
.ev-tabs { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: 1rem; }
.ev-tab { padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none; font-size: .9rem; }
.ev-tab span { color: var(--muted); font-size: .8rem; }
.ev-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ev-tab.active span { color: #e2f2f3; }
.ev-total { margin-left: auto; font-size: .85rem; }
.ev-list { display: flex; flex-direction: column; gap: .7rem; }
.ev-card { display: flex; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .8rem 1rem; box-shadow: var(--shadow); }
.ev-main { flex: 1; min-width: 0; }
.ev-title { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.ev-title > a { font-weight: 700; color: var(--text); text-decoration: none; }
.ev-title > a:hover { color: var(--accent); }
.ev-type { font-size: .8rem; }
.ev-status { font-size: .75rem; font-weight: 700; color: #fff; border-radius: 5px; padding: .1rem .5rem; background: var(--muted); }
.ev-status.running { background: #2f80ed; }
.ev-status.upcoming, .ev-status.confirmed { background: var(--accent); }
.ev-status.done { background: var(--green); }
.ev-status.draft { background: #95a5a6; }
.ev-status.cancelled { background: var(--danger); }
.ev-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .85rem; margin-top: .25rem; }
.ev-desc { margin: .3rem 0 0; font-size: .85rem; color: var(--orange); overflow-wrap: anywhere; }
.ev-progress { height: 4px; background: var(--border); border-radius: 2px; margin-top: .5rem; overflow: hidden; }
.ev-progress span { display: block; height: 100%; background: var(--green); }
.ev-progress-label { margin: .2rem 0 0; font-size: .75rem; }
.ev-counts { display: flex; gap: 1rem; margin: 0; text-align: center; }
.ev-counts div { min-width: 3.6rem; }
.ev-counts dd { margin: 0; font-size: 1.15rem; font-weight: 700; }
.ev-counts dt { font-size: .75rem; color: var(--muted); }
.ev-actions { display: flex; flex-direction: column; gap: .35rem; align-items: stretch; }
.ev-actions .button { text-align: center; padding: .35rem .8rem; }
@media (max-width: 768px) {
  .ev-card { flex-wrap: wrap; }
  .ev-main { flex-basis: 100%; }
  .ev-counts { flex: 1; justify-content: space-between; }
  .ev-actions { flex-direction: row; }
}

/* Fiche d'un événement : planning journalier + blocs repliables */
.ev-head { align-items: flex-start; }
.ev-head > div { flex: 1; min-width: 0; }
.ev-back { color: inherit; opacity: .8; font-size: .85rem; text-decoration: none; }
.ev-sub { margin: .2rem 0 0; font-size: .9rem; opacity: .9; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ev-detail { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 1.2rem; align-items: start; }
.ev-desc-full { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .9rem; margin: 0 0 .8rem; color: var(--orange); font-size: .9rem; }
.ev-days-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.ev-days-head h2 { margin: 0; font-size: 1.05rem; }
.ev-day { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; overflow: hidden; }
.ev-day-head { background: #123943; color: #fff; padding: .55rem .9rem; display: flex; gap: .6rem; align-items: baseline; }
.ev-day-head span { font-size: .8rem; opacity: .8; }
.ev-day-body { padding: .6rem; display: flex; flex-direction: column; gap: .5rem; }
.ev-slot { display: flex; gap: .7rem; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: .55rem .65rem; }
.ev-slot.cancelled { opacity: .5; }
.ev-pill { flex: none; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .25rem .65rem; margin-top: .1rem; }
.ev-slot-main { flex: 1; min-width: 0; }
.ev-slot-title { margin: 0; overflow-wrap: anywhere; }
.ev-slot-title a { color: var(--text); }
.ev-slot-meta { margin: .2rem 0 0; display: flex; flex-wrap: wrap; gap: .1rem .8rem; font-size: .82rem; color: var(--muted); }
.ev-slot-desc { margin: .25rem 0 0; font-size: .82rem; font-style: italic; color: var(--orange); }
.ev-chip { display: inline-block; margin-top: .3rem; font-size: .75rem; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: .05rem .45rem; }
.ev-slot-tools { flex: none; display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 15rem; }
.ev-slot-tools form { margin: 0; }
.ev-outcome { font-size: .78rem; padding: .15rem .3rem; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); }
.ev-outcome.done { border-color: var(--green); color: var(--green); font-weight: 700; }
.ev-outcome.postponed { border-color: var(--orange); color: var(--orange); font-weight: 700; }
span.ev-outcome { flex: none; }
.ev-tool { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-size: .9rem; cursor: pointer; padding: 0; }
.ev-tool.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.ev-add { display: block; text-align: center; border: 2px dashed var(--border); border-radius: 10px; padding: .4rem; color: var(--accent); text-decoration: none; font-size: .9rem; }
.ev-add:hover { border-color: var(--accent); }
.ev-side { display: flex; flex-direction: column; gap: .7rem; }
.ev-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 0 .9rem; }
.ev-box[open] { padding-bottom: .8rem; }
.ev-box > summary { cursor: pointer; font-weight: 700; padding: .7rem 0; list-style: none; display: flex; align-items: center; gap: .4rem; }
.ev-box > summary::-webkit-details-marker { display: none; }
.ev-box > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.ev-box:not([open]) > summary::after { transform: rotate(-90deg); }
.ev-box > summary span { font-weight: 400; font-size: .85rem; color: var(--muted); }
.ev-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.ev-tile { border: 1px solid var(--border); border-radius: 10px; padding: .55rem; text-align: center; }
.ev-tile strong { display: block; font-size: 1.3rem; }
.ev-tile span { font-size: .75rem; color: var(--muted); }
.ev-tile.green { background: #e8f8ef; border-color: #b7e4c7; } .ev-tile.green strong { color: var(--green); }
.ev-tile.blue { background: #eaf1fd; border-color: #c4d7fa; } .ev-tile.blue strong { color: #2f80ed; }
.ev-tile.orange { background: var(--warning-soft); border-color: #f6dca0; } .ev-tile.orange strong { color: var(--orange); }
.ev-box-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: .8rem 0 .3rem; }
.ev-mini { width: 100%; font-size: .85rem; border-collapse: collapse; }
.ev-mini td, .ev-mini th { padding: .25rem .2rem; border-bottom: 1px solid var(--border); text-align: left; }
.ev-mini td:not(:first-child), .ev-mini th:not(:first-child) { text-align: right; }
.ev-big { font-size: 1.4rem; font-weight: 700; color: var(--green); margin: 0 0 .5rem; }
.ev-big span { font-size: .85rem; font-weight: 400; }
.button.ev-wide { display: block; text-align: center; margin-bottom: .5rem; }
.ev-box form > button.ev-wide { width: 100%; margin-bottom: .5rem; }
.ev-off { text-align: right; margin: 0; }
.ev-off button { font-size: .8rem; padding: .15rem .5rem; }
.button.green { background: var(--green); border-color: var(--green); color: #fff; }
.ev-list-plain { list-style: none; padding: 0; margin: 0 0 .6rem; font-size: .88rem; }
.ev-list-plain li { padding: .25rem 0; border-bottom: 1px solid var(--border); }
.ev-inline { display: flex; flex-wrap: wrap; gap: .3rem; }
.ev-inline > * { flex: 1 1 8rem; }
.ev-inline button { flex: 0 0 auto; }
@media (max-width: 900px) {
  .ev-head { flex-wrap: wrap; }
  .ev-head > div { flex: 1 1 100%; }
  .ev-detail { grid-template-columns: 1fr; }
  .ev-side { order: -1; }
  .ev-slot { flex-wrap: wrap; }
  .ev-slot-tools { max-width: none; width: 100%; justify-content: flex-start; }
}

/* Planning de l'équipe salariée : une ligne par salarié, une colonne par jour. */
ul.plain { list-style: none; padding: 0; margin: 0 0 .5rem; }
ul.plain li { padding: .25rem 0; }
.print-only { display: none; }
table.staff-grid { font-size: .85rem; }
table.staff-grid th, table.staff-grid td { border: 1px solid var(--border); padding: .25rem; text-align: center; vertical-align: top; }
table.staff-grid th.who { text-align: left; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.staff-grid td.total, table.staff-grid th.total { white-space: nowrap; text-align: right; }
table.staff-grid .weekend { background: #f6f8fa; }
table.staff-grid .today { box-shadow: inset 0 0 0 2px var(--accent); }
table.staff-grid td.off { background: repeating-linear-gradient(45deg, #f3f5f7, #f3f5f7 4px, #fff 4px, #fff 8px); }
table.staff-grid tr.mine th.who { color: var(--accent); }
table.staff-grid .cell-link { display: block; min-height: 2rem; color: inherit; text-decoration: none; border-radius: 6px; }
table.staff-grid .cell-link:hover { background: var(--accent-soft); }
table.staff-grid .shift { display: block; white-space: nowrap; font-weight: 600; }
table.staff-grid .holiday { display: block; color: var(--muted); font-size: .75rem; }
.absence { display: inline-block; border-radius: 4px; padding: .05rem .3rem; margin: .05rem 0; background: var(--abs, #7f8c8d); color: #fff; font-weight: 700; font-size: .75rem; white-space: nowrap; }
.absence small { font-weight: 400; }
.absence.requested { background: transparent; color: var(--text) !important; border: 2px dashed var(--abs, #7f8c8d); }
table.staff-grid td.covered .absence { display: block; }
table.staff-grid tfoot .count small { color: var(--muted); }
table.staff-grid tfoot .count.short { background: var(--danger-soft); color: var(--danger); font-weight: 700; }
table.staff-grid.month-grid { font-size: .72rem; }
table.staff-grid.month-grid th, table.staff-grid.month-grid td { padding: .15rem; min-width: 2.6rem; }
@media print {
  .no-print, .site-header, nav, .messages { display: none !important; }
  .print-only { display: block; }
  .table-wrap { box-shadow: none; overflow: visible; }
  table.staff-grid { font-size: .7rem; }
  table.staff-grid .cell-link { min-height: 0; }
}
details.inline-details { margin: .75rem 0; }
details.inline-details summary { cursor: pointer; color: var(--accent); }
.alert.warning { background: var(--warning-soft); color: #7c5a00; border-radius: 8px; padding: .6rem .9rem; }
.team-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 0 0 .8rem; }
.team-tools form { margin: 0; }
.team-tools label { display: flex; align-items: center; gap: .4rem; margin: 0; }
.team-tools select { width: auto; }

/* Fiche du contrat de travail : semaine type en tableau. */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1.25rem; }
.grid-3 .span-2 { grid-column: span 2; }
@media (max-width: 600px) { .grid-3 .span-2 { grid-column: auto; } }
table.week-template td, table.week-template th { padding: .35rem .4rem; vertical-align: middle; }
table.week-template input, table.week-template select { width: 100%; min-width: 5.5rem; margin: 0; }
table.week-template.no-cycle .col-week { display: none; }
table.week-template tr.removed td { opacity: .45; text-decoration: line-through; }
table.week-template tr.row-error td { background: var(--danger-soft); }
table.week-template .hours { white-space: nowrap; font-weight: 600; }
.week-footer { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-top: .8rem; }
details.card > summary { font-weight: 600; }
table.week-template .col-day { width: 9.5rem; }
table.week-template .col-time { width: 8.5rem; }
table.week-template .col-pause { width: 6.5rem; }
table.week-template .col-week { width: 5.5rem; }
table.week-template .col-del { width: 4.5rem; text-align: center; }
.mobile-only { display: none; }
@media (max-width: 700px) {
  table.week-template thead { display: none; }
  table.week-template, table.week-template tbody { display: block; }
  table.week-template tr { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .6rem; padding: .7rem .6rem; border-bottom: 1px solid var(--border); }
  table.week-template td { display: block; width: auto !important; padding: 0; border: 0; }
  table.week-template td[hidden] { display: none; }
  table.week-template td::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); margin-bottom: .15rem; }
  table.week-template td.hours { align-self: end; text-align: left !important; }
  table.week-template td.col-del::before { content: none; }
  table.week-template td.col-del { text-align: left; align-self: end; }
  table.week-template tr.row-error-msg { display: block; }
  table.week-template tr.row-error-msg td::before { content: none; }
  .mobile-only { display: inline; }
}
.cal-team { display: flex; flex-wrap: wrap; gap: .1rem .4rem; font-size: .72rem; color: var(--teal-dark); background: var(--accent-soft); border-radius: 4px; padding: .1rem .3rem; margin: .1rem 0 .2rem; text-decoration: none; }
.cal-team small { color: var(--muted); }
.calendar.hide-team .cal-team { display: none; }
h3.staff-planned { font-size: .95rem; margin: .8rem 0 .3rem; }
table.staff-grid .shift small.act { display: block; font-weight: 400; font-size: .7rem; color: var(--muted); border-left: 3px solid var(--act); padding-left: .2rem; margin: 0 auto; width: fit-content; }

/* Nuancier (widget ColorInput) */
.color-picker { display: grid; gap: .55rem; }
.color-picker .swatches { display: flex; flex-wrap: wrap; gap: .45rem; }
.color-picker .swatch {
  position: relative; width: 2rem; height: 2rem; min-height: 0; padding: 0; border-radius: 50%;
  background: var(--swatch, var(--surface)); border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
  transition: transform .12s ease, box-shadow .12s ease;
}
.color-picker .swatch:hover { transform: scale(1.1); }
.color-picker .swatch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.color-picker .swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--swatch, var(--accent));
}
.color-picker .swatch[aria-pressed="true"]::after {
  content: "✓"; color: var(--swatch-text, #fff); font-weight: 700; font-size: .9rem;
}
.color-picker .swatch.none { border: 2px dashed var(--border); box-shadow: none; }
.color-picker .swatch.none[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--muted); }
.color-picker .swatch.none[aria-pressed="true"]::after { content: none; }
.color-picker .swatch.custom {
  background: var(--swatch, conic-gradient(#e5484d, #f5a524, #30a46c, #0090ff, #6e56cf, #d6409f, #e5484d));
  color: #fff; font-weight: 700; overflow: hidden;
}
.color-picker .swatch.custom[aria-pressed="true"] span { display: none; }
.color-picker .swatch.custom span { text-shadow: 0 0 3px rgba(0, 0, 0, .6); }
.color-picker .swatch.custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.color-picker .color-line { display: flex; gap: .5rem; align-items: center; }
.color-picker .color-hex { width: 7.5rem; font-family: ui-monospace, monospace; text-transform: lowercase; }
.color-picker .color-preview {
  padding: .3rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: var(--accent-soft); color: var(--text);
}
.color-picker .color-preview.empty { background: transparent; border: 1px dashed var(--border); color: var(--muted); }

/* Vérification des heures */
.chip { display: inline-block; font-size: .8rem; font-weight: 600; border-radius: 999px; padding: .1rem .6rem;
        background: var(--accent-soft); color: var(--teal-dark); white-space: nowrap; vertical-align: middle; }
.chip.ok { background: #e3f5ea; color: #1e7a45; }
.chip.warn { background: var(--warning-soft); color: #8a5a00; }
.chip.off { background: var(--bg); color: var(--muted); }
.button.disabled { opacity: .45; pointer-events: none; }
.hours-kpis .kpi.warn { border-left: 5px solid var(--orange); }
.hours-kpis .kpi.ok { border-left: 5px solid var(--green); }
.hours-kpis .kpi .muted { font-size: .85rem; }
.hours-day { font-size: 1.1rem; margin: 1.4rem 0 .6rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.hours-slot { border-left: 6px solid var(--act); padding: .9rem 1rem; margin-bottom: .8rem; scroll-margin-top: 90px; }
.hours-slot.done { opacity: .85; }
.hours-slot header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.hours-slot header > div:first-child { flex: 1 1 240px; }
.hours-slot header form { margin: 0; }
.hours-title { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--text); }
.hours-title:hover { color: var(--accent); }
.act-pill { border-left: 4px solid var(--act); padding-left: .35rem; }
.hours-progress { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--muted); font-size: .9rem; }
.hours-progress progress { width: 90px; height: .5rem; accent-color: var(--green); }
.hours-people { list-style: none; margin: 0; padding: 0; }
.hours-people li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto auto; align-items: center; gap: .4rem .8rem;
                   padding: .55rem .4rem; border-top: 1px solid var(--border); }
.hours-people li.present { background: linear-gradient(90deg, #e3f5ea55, transparent 60%); }
.hours-people li.absent .who strong { color: var(--muted); }
.hours-people .avatar { width: 2.2rem; height: 2.2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
                        background: var(--act); color: #fff; font-weight: 700; opacity: .9; }
.hours-people li.absent .avatar { background: var(--border); color: var(--muted); }
.hours-people .who { display: flex; flex-direction: column; min-width: 0; }
.hours-people .actions { display: flex; gap: .4rem; align-items: center; }
.hours-people .actions form { margin: 0; display: flex; align-items: center; gap: .25rem; }
.hours-people .actions input[name="hours"] { width: 4.2rem; text-align: right; padding: .35rem .4rem; }
.hours-people .actions .unit { color: var(--muted); }
.hours-people button.ok { background: var(--green); color: #fff; padding: .4rem .7rem; }
.hours-people button.no { color: var(--danger); border-color: var(--border); padding: .4rem .7rem; font-size: 1rem; }
.hours-people button.no:disabled { opacity: .4; }
.empty-state { text-align: center; padding: 2rem 1rem; }
@media (max-width: 700px) {
  .hours-people li { grid-template-columns: 2.2rem minmax(0, 1fr); }
  .hours-people .state { grid-column: 2; }
  .hours-people .actions { grid-column: 1 / -1; justify-content: flex-end; }
  .hours-people .actions .label { display: none; }
}
.hours-progress progress { appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; background: var(--bg); overflow: hidden; }
.hours-progress progress::-webkit-progress-bar { background: var(--bg); border-radius: 999px; }
.hours-progress progress::-webkit-progress-value { background: var(--green); border-radius: 999px; }
.hours-progress progress::-moz-progress-bar { background: var(--green); border-radius: 999px; }
@media (max-width: 700px) {
  .hours-kpis { grid-template-columns: repeat(3, 1fr); }
  .hours-kpis .kpi { padding: .6rem .7rem; }
  .hours-nav strong { font-size: 1.1rem; }
  .hours-nav .label { display: none; }
}

/* Stock : listes d'objets étiquetés (reprise d'une étiquette, déplacements) */
.stock-list { list-style: none; padding: 0; margin: .5rem 0; }
.stock-list li { padding: .45rem 0; border-bottom: 1px solid var(--border, #e5e5e5); }

/* Étiquettes : planche A4 ou rouleau d'imprimante à étiquettes (une étiquette par page) */
.label-format { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.label-format p { flex-basis: 100%; }
@media print {
  .label-sheet.roll { display: block; }
  .label-sheet.roll > * { border: none; margin: 0; padding-left: 3mm; padding-right: 3mm; break-after: page; page-break-after: always; }
  .label-sheet.roll > *:last-child { break-after: auto; page-break-after: auto; }
}

/* Liste de choix avec recherche (js/search-select.js) */
.search-select { position: relative; }
.search-select input { width: 100%; }
.search-select-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: .2rem 0; list-style: none; max-height: 18rem; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.search-select-list li { padding: .45rem .7rem; cursor: pointer; }
.search-select-list li.active, .search-select-list li:hover { background: var(--accent-soft); }
.search-select-list li.empty { color: var(--muted); cursor: default; }
.search-select-list li:not(.empty) { color: var(--text); }

/* Planning : « Mon planning » (horaires de travail, créneaux couverts, inscriptions) */
.mine-days { display: grid; gap: .8rem; }
.mine-day h2 { margin: 0 0 .4rem; font-size: 1.05rem; text-transform: capitalize; }
.mine-shift p { margin: .2rem 0; }
.mine-shift .registrations { margin: .2rem 0 .4rem 1.4rem; }

/* Télétravail : joignable, pas sur place */
.cal-team span.remote, .shift.remote { opacity: .7; font-style: italic; }

/* Onglets d'un module (Planning) : les écrans voisins, en haut de la page */
.page-tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 2px solid var(--border); margin: 0 0 1rem; }
.nav-items .items a[hidden] { display: none; }
.page-tabs a { padding: .4rem .6rem; font-size: .95rem; white-space: nowrap; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -2px; border-radius: 6px 6px 0 0; }
.page-tabs a:hover { color: var(--accent); background: var(--accent-soft); }
.page-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Notifications aux équipes : choix des personnes */
.broadcast-people { margin: 0 0 1rem; }
.broadcast-people .people-box { max-height: 16rem; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: .4rem .6rem; margin-top: .4rem; }
.broadcast-people .people-box > div { columns: 14rem; }
.broadcast-people .people-box label { display: flex; gap: .4rem; align-items: center; break-inside: avoid; padding: .15rem 0; }
.broadcast-form { max-width: 60rem; }

/* Filtres en haut d'une liste (période, statut…) : sur une ligne, champs à leur taille */
form.filters { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; margin: 0 0 1rem; }
form.filters label { display: flex; flex-direction: column; gap: .2rem; margin: 0; }
form.filters input:not([type=checkbox]):not([type=radio]), form.filters select { width: auto; min-width: 10rem; margin: 0; }

/* Menu latéral des responsables (pages du planning et des congés) : repliable, « ☰ Gestion »
   sur tablette et téléphone */
.side-menu .side-group { margin: .9rem 0 .25rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.side-menu .side-group:first-child { margin-top: 0; }
.side-menu nav a { display: block; padding: .35rem .6rem; border-radius: 6px; color: var(--text, inherit); text-decoration: none; }
.side-menu nav a:hover { background: var(--accent-soft); color: var(--accent); }
.side-menu nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.side-menu button { background: none; border: 1px solid var(--border); color: var(--muted); padding: .2rem .55rem; border-radius: 6px; font-size: .85rem; cursor: pointer; }
.side-menu .side-fold { float: right; }
@media (min-width: 900px) {
  main.content:has(> .side-menu) { position: relative; padding-left: calc(1.2rem + 13rem + 1.5rem); }
  main.content:has(> .side-menu.folded) { padding-left: calc(1.2rem + 2.4rem + 1rem); }
  .side-menu { position: absolute; left: 1.2rem; top: 1.5rem; bottom: 1.5rem; width: 13rem; }
  .side-menu nav { position: sticky; top: 1rem; clear: both; padding-top: .4rem; }
  .side-menu .side-open { display: none; }
  .side-menu.folded { width: 2.4rem; }
  .side-menu.folded nav { display: none; }
}
@media (max-width: 899px) {
  .side-menu { margin: 0 0 .8rem; }
  .side-menu .side-fold { display: none; }
  .side-menu nav { display: none; margin-top: .4rem; padding: .6rem; border: 1px solid var(--border); border-radius: 8px; }
  .side-menu.open nav { display: block; }
}
@media print { main.content:has(> .side-menu) { padding-left: 1.2rem; } }

/* Liste des factures (comme oressource) : cartes par statut, puces, actions */
.invoice-cards { grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); margin-bottom: 1rem; }
.invoice-cards .kpi { border-top: 4px solid #9aa5ad; text-align: center; align-items: center; text-decoration: none; color: inherit; }
.invoice-cards .kpi .label { text-transform: uppercase; font-size: .75rem; letter-spacing: .03em; }
.invoice-cards .kpi.tone-teal { border-top-color: var(--teal); }
.invoice-cards .kpi.tone-green { border-top-color: var(--green); }
.invoice-cards .kpi.tone-red { border-top-color: var(--danger); }
.invoice-cards .kpi.tone-orange { border-top-color: #f0c040; }
.invoice-cards .kpi.selected { outline: 2px solid var(--teal); }
.invoice-filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .7rem 1rem; }
.invoice-filters .chips { margin: 0; }
.chip-button.active { background: var(--teal); color: #fff; }
a.chip-button { text-decoration: none; }
.tab-count { font-weight: 400; }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.chip.info { background: var(--accent-soft); color: var(--teal-dark); }
.invoice-list .actions-cell { white-space: nowrap; text-align: right; }
form.filters.invoice-filters label { flex-direction: row; align-items: center; gap: .4rem; font-weight: 600; }
.invoice-filters input[type=search] { flex: 0 1 16rem; }
.invoice-list td:first-child { white-space: nowrap; }
.invoice-filters input[type=number] { width: 5rem; }

/* Bilans : répartitions en barres, colonnes et courbes (comme l'ancien logiciel) */
.report-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px) { .report-grid.two { grid-template-columns: minmax(0, 1fr); } }
.report-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1100px) { .report-grid.three { grid-template-columns: minmax(0, 1fr); } }
.report-panel { background: var(--bg); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1rem; min-width: 0; }
.report-grid > .report-panel { margin-bottom: 0; }
.report-grid { margin-bottom: 1rem; }
.report-panel h3 { margin: 0 0 .7rem; font-size: 1.05rem; }
.report-panel .report-panel { padding: 0; background: none; margin-bottom: .5rem; }
.section-title { margin: 1.2rem 0 .6rem; }
.hbars { display: grid; grid-template-columns: minmax(8rem, 1.3fr) minmax(5rem, 2fr) auto auto; gap: .45rem .8rem; align-items: center; }
.hbars.with-count { grid-template-columns: minmax(8rem, 1.3fr) minmax(5rem, 2fr) auto auto auto; }
.hb-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hb-track { display: block; height: .8rem; background: var(--surface); border-radius: 999px; overflow: hidden; }
.hb-bar { display: block; height: 100%; border-radius: 999px; min-width: 3px; }
.hb-value { text-align: right; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hb-share, .hb-count { text-align: right; white-space: nowrap; font-size: .9rem; font-variant-numeric: tabular-nums; }
.report-wide-list .hbars { grid-template-columns: minmax(10rem, 1fr) minmax(8rem, 3fr) auto auto auto; }
td.bar-col { width: 30%; min-width: 6rem; }
td.bar-col.wide-bar { width: 35%; }
.colchart { width: 100%; height: auto; display: block; }
.colchart .grid { stroke: var(--border); stroke-width: 1; }
.colchart .tick { font-size: 11.5px; fill: var(--muted); }
.colchart rect:hover { filter: brightness(1.15); }
.linechart { width: 100%; height: auto; display: block; }
.linechart .grid { stroke: var(--border); stroke-width: 1; }
.linechart .tick { font-size: 12px; fill: var(--muted); }
.chart-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .9rem; margin: .4rem 0 0; }
.chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.chart-legend i { width: .8rem; height: .8rem; border-radius: 50%; display: inline-block; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.panel-head h3 { margin: 0; }
.seg { display: inline-flex; gap: .25rem; }
.traffic-details summary { cursor: pointer; color: var(--teal-dark); font-weight: 600; margin-top: .3rem; }
.stack { display: flex; height: .9rem; border-radius: 999px; overflow: hidden; background: var(--bg); }
.stack > span { display: block; height: 100%; }
.flow-sold { background: var(--teal); }
.flow-out { background: #f0a500; }
.flow-gap { background: #c9d3da; }

/* Bilans : onglets et tableau de bord */
.report-tabs a.active { background: var(--teal); color: #fff; }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: .75rem; margin-bottom: 1rem; }
.dash-kpi { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem 1rem;
            display: flex; flex-direction: column; gap: .1rem; text-decoration: none; color: inherit; border-top: 4px solid var(--teal); }
a.dash-kpi:hover { outline: 2px solid var(--teal); }
.dash-kpi.rate { border-top-color: #1baf7a; }
.dash-kpi .label { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.dash-kpi strong { font-size: clamp(1.2rem, 1.6vw, 1.55rem); line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
.dash-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem 1rem; min-width: 0; }
.dash-card.span-8 { grid-column: span 8; }
.dash-card.span-6 { grid-column: span 6; }
.dash-card.span-4 { grid-column: span 4; }
.dash-card.span-3 { grid-column: span 3; }
@media (max-width: 1200px) { .dash-card.span-3 { grid-column: span 6; } }
@media (max-width: 900px) { .dash-card[class*="span-"] { grid-column: span 12; } }
.dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.dash-head h3 { margin: 0; font-size: 1rem; }
.dash-head a { font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.dash-card .report-panel { padding: 0; background: none; margin: 0; }
.dash-card .report-panel h3:empty { display: none; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.donut { width: 180px; height: 180px; transform: rotate(0deg); }
.donut-value { font-size: 5px; font-weight: 700; fill: var(--text); }
.donut-label { font-size: 3px; fill: var(--muted); }
.donut-legend { list-style: none; padding: 0; margin: 0; width: 100%; font-size: .9rem; }
.donut-legend li { display: flex; align-items: center; gap: .5rem; padding: .15rem 0; }
.donut-legend i { width: .75rem; height: .75rem; border-radius: 3px; flex: none; }
.donut-legend span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; }
.mini-bars { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .6rem; align-items: center; }
.mini-bars .hb-track { grid-column: 1 / -1; height: .5rem; margin-bottom: .35rem; background: var(--bg); }
.mb-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.mb-value { text-align: right; font-weight: 700; white-space: nowrap; font-size: .92rem; font-variant-numeric: tabular-nums; }
.dash-table { width: 100%; }
.dash-table td { padding: .35rem .3rem; border-bottom: 1px solid var(--border); }
@media print { .report-tab[hidden] { display: block !important; } }
#reports.htmx-request { opacity: .45; pointer-events: none; transition: opacity .15s; }
.report-period { display: inline-flex; gap: .6rem; flex-wrap: wrap; }

/* Étiquette produit : ligne qui dit si le produit est au catalogue (js/label-product.js) */
.label-product-status { margin: .35rem 0 0; font-size: .88rem; border-radius: 6px; padding: 0; }
.label-product-status:empty { display: none; }
.label-product-status.ok { background: var(--accent-soft); color: var(--accent); padding: .35rem .6rem; }
.label-product-status.known { background: var(--bg); border: 1px solid var(--border); padding: .35rem .6rem; }
.label-product-status.new { background: var(--warning-soft); color: #7c5a00; padding: .35rem .6rem; }

/* Accueil : bandeau de bienvenue, filtre par boutique, collecté (bleu canard) et vendu (orange) */
.home-hero { background: linear-gradient(120deg, var(--teal) 0%, #8fd0bd 100%); color: #fff; border-radius: 18px; padding: 1.3rem 1.6rem; box-shadow: 0 10px 28px rgba(14, 124, 134, .25); margin-bottom: 1rem; }
.home-hero h1 { margin: 0 0 .2rem; font-size: 1.6rem; }
.home-hero p { margin: 0; font-size: 1.05rem; opacity: .95; }
.home-hero p::first-letter { text-transform: uppercase; }
.home-filter { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--teal); border-radius: var(--radius); padding: .9rem 1.2rem; margin-bottom: 1rem; }
.home-filter label { display: inline; margin: 0; font-weight: 600; font-size: .9rem; }
.home-filter select { width: auto; flex: 0 1 320px; min-width: 0; margin: 0; }
.home-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.home-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; border-left: 4px solid var(--teal); display: flex; flex-direction: column; gap: .35rem; }
.home-card.sale { border-left-color: #d97706; }
.home-card-head { color: #fff; font-weight: 700; font-size: 1.15rem; text-align: center; text-transform: uppercase; letter-spacing: .02em; border-radius: 10px; padding: .75rem; margin-bottom: .4rem; background: linear-gradient(120deg, #8fd0bd, var(--teal)); }
.home-card.sale .home-card-head { background: linear-gradient(120deg, #ee9a10, #c96a06); }
.home-card-label { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.home-card strong { font-size: 1.9rem; line-height: 1.15; }
.home-card small { color: var(--teal); font-size: .78rem; }
@media (max-width: 700px) { .home-figures { grid-template-columns: 1fr; } }

/* Prêts de matériel */
.badge.warn { background: var(--warning-soft); border-color: transparent; color: #7c5a00; }
tr.loan-late td { background: var(--danger-soft); }
tr.loan-late td:first-child { box-shadow: inset 4px 0 0 var(--danger); }

/* Récapitulatif éco-organisme : mois ou trimestre, détails repliables */
.declaration-nav { flex-wrap: wrap; }
.declaration-nav input[type=month] { width: auto; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.segmented a { padding: .35rem .9rem; text-decoration: none; color: var(--muted); }
.segmented a.active { background: var(--teal); color: #fff; }
.report-grid > .wide { grid-column: 1 / -1; }
.declaration-doc summary, .declaration-detail summary { cursor: pointer; }
.declaration-detail { margin-top: .75rem; }
.declaration-detail summary { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media print { .declaration-detail:not([open]) { display: none; } }

/* Catégories du catalogue : tuiles comme en caisse, réordonnées par glisser-déposer (sortable.js). */
.category-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 900px) { .category-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .category-tiles { grid-template-columns: 1fr; } }
.category-tile { --tile: var(--teal); position: relative; display: flex; flex-direction: column; gap: .5rem; min-height: 120px;
                 padding: .8rem .9rem; border-radius: 12px; color: #fff; cursor: grab; user-select: none; -webkit-touch-callout: none;
                 background: linear-gradient(135deg, var(--tile), color-mix(in srgb, var(--tile) 70%, #000));
                 text-shadow: 0 1px 2px rgba(0, 0, 0, .45); box-shadow: 0 3px 8px rgba(0, 0, 0, .12); }
.category-tile-head { display: flex; align-items: center; gap: .5rem; }
.category-tile-head strong { flex: 1; font-size: 1.15rem; line-height: 1.2; overflow-wrap: break-word; min-width: 0; }
.category-tile-icon { font-size: 1.6rem; }
.category-tile-edit { color: #fff; font-size: .85rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px;
                      border: 1px solid rgba(255, 255, 255, .6); text-decoration: none; text-shadow: none; }
.category-tile-edit:hover { background: rgba(255, 255, 255, .18); }
.category-tile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; font-size: .9rem; margin-top: auto; }
.category-tile-meta .category-tile-edit { margin-left: auto; }
.category-tile-subs { display: flex; flex-wrap: wrap; gap: .3rem; }
.category-tile-subs a { color: #fff; background: rgba(0, 0, 0, .2); border-radius: 999px; padding: .15rem .6rem; font-size: .85rem;
                        text-decoration: none; text-shadow: none; cursor: grab; }
.category-tile-subs a:hover { background: rgba(0, 0, 0, .32); }
.category-tile-subs span { background: rgba(255, 255, 255, .18); border-radius: 999px; padding: .15rem .6rem; font-size: .85rem; text-shadow: none; }
.category-tile.archived { filter: grayscale(.85); opacity: .7; }
.category-tile-actions { display: flex; gap: .35rem; margin-left: auto; }
.category-tile-actions form { margin: 0; }
.category-tile-meta .category-tile-actions .category-tile-edit { margin-left: 0; }
button.category-tile-edit { background: transparent; min-height: 0; cursor: pointer; font: inherit; font-size: .85rem; font-weight: 700; }
.sortable-active, .sortable-active * { cursor: grabbing !important; }
.sortable-dragging { opacity: .55; outline: 3px dashed var(--night); outline-offset: 2px; }
.category-tile-subs a.sortable-dragging { outline-color: #fff; }
.sortable-saving { opacity: .85; }

/* Heures et paie : absences de la période, un groupe de lignes par salarié. */
table.absences tbody + tbody tr:first-child > * { border-top: 2px solid var(--border, #d0d7de); }
table.absences tbody th[scope="row"] { text-align: left; font-weight: 600; white-space: nowrap; vertical-align: top; }

/* Vérifier les collectes : une ligne par bon, pesées par flux en pastilles. */
form.filters label.inline { flex-direction: row; align-items: center; gap: .4rem; padding-bottom: .5rem; }
/* Vérifier les collectes : comme à la saisie, les bons à gauche, le bon choisi en ticket à droite. */
.collect-verify { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 1rem; align-items: start; }
.collect-verify .bons ul { list-style: none; margin: 0; padding: 0; }
.collect-verify .bons h2 small { font-weight: 500; font-size: .85rem; }
.collect-verify .bons li.day { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted);
  padding: .8rem .3rem .3rem; border-bottom: 1px solid var(--border); }
.collect-verify .bons li.empty { padding: 1rem .3rem; }
.collect-verify .bons a { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto auto 5.5rem; gap: .6rem; align-items: center;
  padding: .55rem .5rem; border-radius: 10px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.collect-verify .bons a:hover { background: var(--accent-soft); }
.collect-verify .bons a.picked { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--teal); }
.collect-verify .bons a.cancelled { opacity: .5; text-decoration: line-through; }
.collect-verify .bons .who { display: flex; flex-direction: column; min-width: 0; }
.collect-verify .bons .who small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collect-verify .bons .kg { text-align: right; white-space: nowrap; }
.collect-verify .bons .dots { display: flex; gap: .2rem; flex-wrap: wrap; justify-content: flex-end; }
.collect-verify .bons .dots i { --chip: #7f8c8d; font-style: normal; min-width: 1.5rem; height: 1.5rem; border-radius: 6px; display: grid; place-items: center;
  font-size: .85rem; background: var(--chip); }
.collect-verify .bons .badge { margin: 0; }
.collect-verify .ticket { position: sticky; top: 1rem; }

.ticket { display: flex; flex-direction: column; gap: .6rem; padding: 1.1rem; border-radius: var(--radius); color: #fff;
  background: linear-gradient(160deg, var(--teal), var(--teal-dark) 55%, var(--night)); box-shadow: var(--shadow); }
.ticket.cancelled { background: linear-gradient(160deg, #7b8a92, #4a565c); }
.ticket h2 { color: #fff; margin: 0; }
.ticket h2 small { display: block; font-size: .85rem; font-weight: 500; opacity: .85; }
.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.ticket .total { font-size: 1.9rem; font-weight: 800; white-space: nowrap; }
.ticket .lines { list-style: none; margin: 0; padding: .3rem 0; border-top: 1px solid rgba(255,255,255,.35); border-bottom: 1px solid rgba(255,255,255,.35); }
.ticket .lines li { --chip: #7f8c8d; display: flex; justify-content: space-between; gap: .5rem; padding: .55rem .6rem; margin: .15rem 0;
  border-radius: 6px; box-shadow: inset 5px 0 0 var(--chip); background: rgba(255,255,255,.06); }
.ticket .lines li.empty { box-shadow: none; opacity: .75; }
.collect-edit .ticket .lines li:not(.empty) { cursor: pointer; }
.collect-edit .ticket .lines li:not(.empty):hover { background: rgba(255,255,255,.16); }
.ticket dl { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; margin: 0; }
.ticket dt { color: #d3eef0; font-size: .85rem; }
.ticket dd { margin: 0; }
.ticket .note { background: rgba(255,255,255,.14); border-radius: 10px; padding: .5rem .7rem; margin: 0; }
.ticket .hint { margin: 0; font-size: .82rem; opacity: .8; }
.ticket label { color: #d3eef0; }
.ticket input, .ticket select, .ticket textarea { color: var(--text); }
.ticket .help { color: #c4e3e6; }
.ticket .field { margin: 0; }
.ticket .button, .ticket button[type=submit] { width: 100%; justify-content: center; text-align: center; }
.ticket > .button:not(.secondary) { background: #fff; color: var(--teal-dark); border-color: #fff; font-weight: 800; }
button.big, .button.big { min-height: 52px; font-size: 1.1rem; font-weight: 800; }

/* Corriger un bon : trois colonnes comme l'écran de saisie (flux, masse, bon). */
.collect-edit { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, .8fr) minmax(300px, 1fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.collect-edit > .card { margin: 0; }
.flow-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.flow-tile { --chip: #0e7c86; min-height: 84px; border: 0; border-radius: 12px; color: #fff; font-weight: 700; padding: .4rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; text-align: center; overflow-wrap: anywhere;
  background: linear-gradient(135deg, var(--chip), color-mix(in srgb, var(--chip) 70%, #000)); text-shadow: 0 1px 2px rgba(0,0,0,.45);
  box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.flow-tile .icon { font-size: 1.5rem; }
.flow-tile.picked { outline: 4px solid var(--night); outline-offset: 2px; }
.collect-edit .selected { background: var(--accent-soft); border-radius: 10px; padding: .55rem .8rem; font-weight: 700; color: var(--teal-dark); }
.collect-edit #masse { font-size: 1.4rem; font-weight: 700; text-align: right; }
.collect-edit #add-line { width: 100%; margin-top: .6rem; }
.collect-edit .numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .6rem; }
.collect-edit .numpad button { min-height: 50px; font-size: 1.35rem; }
@media (max-width: 1100px) {
  .collect-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .collect-edit .ticket { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .collect-verify, .collect-edit { grid-template-columns: minmax(0, 1fr); }
  .collect-verify .ticket { position: static; order: -1; }
  .collect-verify .bons a { grid-template-columns: 3rem minmax(0, 1fr) auto; }
  .collect-verify .bons .dots, .collect-verify .bons .badge { display: none; }
}

/* Destinataires des sorties : une colonne par catégorie (réemploi, recyclage ou filière, non valorisé). */
.recipient-alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 1rem; }
.recipient-alerts .card.warn { border-left: 5px solid var(--orange); }
.recipient-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.recipient-column { --cat: #7f8c8d; display: flex; flex-direction: column; gap: .5rem; }
.recipient-column.reuse { --cat: #1baf7a; }
.recipient-column.recycling { --cat: #eda100; }
.recipient-column.disposal { --cat: #7f8c8d; }
.recipient-column header { display: grid; grid-template-columns: 1fr auto; gap: .1rem .5rem; align-items: baseline; color: #fff; border-radius: var(--radius);
  padding: .9rem 1rem; background: linear-gradient(135deg, var(--cat), color-mix(in srgb, var(--cat) 65%, #000)); box-shadow: var(--shadow); }
.recipient-column header h2 { margin: 0; color: #fff; font-size: 1.15rem; }
.recipient-column header strong { font-size: 1.3rem; white-space: nowrap; }
.recipient-column header small { grid-column: 1 / -1; opacity: .9; }
.recipient-column .empty { padding: .5rem 1rem; }
.recipient-card { display: flex; flex-direction: column; gap: .2rem; padding: .7rem .9rem; border-radius: 12px; background: var(--surface);
  box-shadow: var(--shadow), inset 4px 0 0 var(--cat); color: var(--text); text-decoration: none; }
.recipient-card:hover { box-shadow: var(--shadow), inset 4px 0 0 var(--cat), 0 0 0 2px var(--cat); }
.recipient-card.inactive { opacity: .55; }
.recipient-card .name { font-weight: 800; font-size: 1.05rem; }
.recipient-card .name::before { content: ""; display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .4rem;
  background: var(--chip); vertical-align: middle; }
.recipient-card .type, .recipient-card .stats { font-size: .85rem; color: var(--muted); }
.recipient-card .exceptions { display: flex; flex-wrap: wrap; gap: .3rem; }
.recipient-card .exceptions .chip.reuse { background: #e3f6ec; color: #13774f; }
.recipient-card .exceptions .chip.recycling { background: #fdf1d6; color: #8a5a00; }
.recipient-card .exceptions .chip.disposal { background: var(--bg); color: var(--muted); }
.recipient-card .badges:empty { display: none; }
.recipient-card .badges .badge { margin: 0 .2rem 0 0; }
@media (max-width: 1000px) { .recipient-columns { grid-template-columns: minmax(0, 1fr); } }
/* Vérifier les ventes : moyens de paiement en pastilles dans la liste. */
.collect-verify .bons .pays { display: flex; gap: .2rem; flex-wrap: wrap; justify-content: flex-end; }
.collect-verify .bons .pays i { --chip: #7f8c8d; font-style: normal; font-size: .75rem; font-weight: 600; padding: .05rem .45rem; border-radius: 999px;
  background: color-mix(in srgb, var(--chip) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--chip) 45%, transparent); white-space: nowrap; }
.collect-verify .bons a.cancelled-kind .kg { color: var(--danger); }
@media (max-width: 800px) { .collect-verify .bons .pays { display: none; } }
/* Corriger un ticket au bureau : articles à gauche, ticket corrigé à droite. */
.sale-correct { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.sale-correct > .card { margin: 0; }
.correct-lines th.num, .correct-lines td.num { text-align: right; }
.correct-lines input:not([type=checkbox]) { width: 6.5rem; text-align: right; }
.correct-lines tr.removed td:not(:first-child) { opacity: .45; text-decoration: line-through; }
.sale-correct .ticket h3 { color: #fff; margin: .4rem 0 0; font-size: 1rem; }
.pay-rows { display: flex; flex-direction: column; gap: .4rem; }
.pay-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .4rem; }
.pay-row input, .pay-row select { margin: 0; }
@media (max-width: 900px) { .sale-correct { grid-template-columns: minmax(0, 1fr); } }
/* Journée de caisse : le détail à gauche, la vérification à droite. */
.cash-day { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 1rem; align-items: start; }
.cash-day-main > .card { margin-top: 0; }
.cash-day > .ticket { position: sticky; top: 1rem; }
.cash-day .ticket h3 { color: #fff; margin: 1rem 0 .3rem; font-size: 1rem; }
.cash-day .ticket .plain { color: #fff; }
.cash-day-totals { display: grid; grid-template-columns: auto auto; justify-content: start; gap: .2rem 1.5rem; }
.cash-day-totals dd { margin: 0; font-weight: 600; text-align: right; }
.lines.plain { list-style: none; padding: 0; margin: 0; }
.lines.plain li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0 .35rem .6rem; border-left: 4px solid var(--chip, transparent); border-bottom: 1px solid var(--border, #e5e7eb); }
.cash-days td.num, .cash-days th.num, .cash-day td.num, .cash-day th.num { text-align: right; }
@media (max-width: 900px) { .cash-day { grid-template-columns: minmax(0, 1fr); } .cash-day > .ticket { position: static; } }
