/* Library — papier listing, intercalaires de classeur. */
@font-face { font-family: "Schibsted"; src: url(fonts/schibsted-latin.woff2) format("woff2"); font-weight: 400 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212; }
@font-face { font-family: "Schibsted"; src: url(fonts/schibsted-latin-ext.woff2) format("woff2"); font-weight: 400 800; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+A720-A7FF; }

:root {
  --desk: #d6ddd3;
  --desk-2: #c8d1c4;
  --paper: #fcfdf9;
  --band: #e4efe0;
  --band-edge: #cfe0ca;
  --ink: #18251e;
  --ink-2: #536359;
  --forest: #1d5a42;
  --forest-2: #164733;
  --stabilo: #f3e24b;
  --danger: #b42318;
  --line: #d9e2d5;
  --radius: 7px;
  --font: "Schibsted", "Segoe UI", system-ui, sans-serif;
}
.k-sapin { --k: #1d5a42; } .k-menthe { --k: #2f8f6c; } .k-ciel { --k: #2b74a8; } .k-encre { --k: #2b3a67; } .k-prune { --k: #6b3e75; }
.k-rose { --k: #b83f70; } .k-brique { --k: #a8432c; } .k-ocre { --k: #a87420; } .k-citron { --k: #7b8618; } .k-ardoise { --k: #55606b; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--desk); }
.num, .nowrap, .count, .code, input[type=date] { font-variant-numeric: tabular-nums; }
h1, h2 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 750; }
h2 { font-size: 18px; font-weight: 700; margin-top: 2em; }
a { color: var(--forest); }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--stabilo); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); border-radius: 3px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- Formulaires ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; padding: 8px 10px; border: 1.5px solid #b9c6b5; border-radius: var(--radius); background: #fff; min-height: 38px;
}
input:hover, select:hover, textarea:hover { border-color: #8fa08b; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px #1d5a4233; }
input[type=checkbox], input[type=radio] { accent-color: var(--forest); width: 17px; height: 17px; margin: 0; vertical-align: middle; }
label { display: block; font-weight: 600; font-size: 14px; }
label > input, label > select, label > textarea, label > .rename-row, label > .taginput { margin-top: 4px; font-weight: 400; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 4px; }
.stack { display: grid; gap: 14px; }
.stack.narrow { max-width: 360px; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row > label { flex: 1 1 180px; }
.inline { display: inline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; min-height: 38px; border: 1.5px solid var(--forest); border-radius: var(--radius);
  background: var(--forest); color: #fff; font-weight: 650; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--forest-2); border-color: var(--forest-2); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--forest); }
.btn.ghost:hover { background: #1d5a4214; }
.btn.small { padding: 5px 11px; min-height: 32px; font-size: 14px; }
.btn.wide { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--forest); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }
.link.danger, .danger { color: var(--danger); }
.icon { border: 1.5px solid var(--line); background: #fff; border-radius: 5px; width: 30px; height: 30px; cursor: pointer; }
.icon:disabled { opacity: .35; cursor: default; }

.flash { padding: 10px 14px; border-radius: var(--radius); background: #dff0dc; border-left: 5px solid var(--forest); margin-bottom: 18px; }
.flash.err { background: #fbe5e2; border-color: var(--danger); }
.flash.info { background: #fdf7c9; border-color: #c9b31a; }
.error { color: var(--danger); font-weight: 600; margin: 0; }

/* ---------- Le papier listing (signature visuelle) ---------- */
.sheet, .slip {
  position: relative; background: var(--paper);
  /* perforations d'entraînement + pointillés de détachement dans la marge gauche */
  background-image:
    radial-gradient(circle at 15px 50%, var(--desk) 0 5px, transparent 5.5px),
    linear-gradient(to right, transparent 33px, var(--band-edge) 33px 34px, transparent 34px);
  background-size: 34px 24px, 100% 100%;
  background-repeat: repeat-y, no-repeat;
  padding-left: 58px;
}
.sheet::after, .slip::after { /* bord droit perforé */
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 30px;
  background: radial-gradient(circle at 15px 50%, var(--desk) 0 5px, transparent 5.5px) 0 0 / 30px 24px repeat-y;
  pointer-events: none;
}

/* ---------- Pages d'accès ---------- */
body.bare { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px;
  background: var(--desk) repeating-linear-gradient(-35deg, transparent 0 22px, #ffffff1a 22px 23px); }
.slip { width: min(470px, 100%); padding: 36px 56px 32px 66px; border-radius: 3px; box-shadow: 0 1px 0 #fff inset, 0 18px 40px -18px #2a3d3266, 0 2px 4px #2a3d321f; }
.slip::before { /* bandes vertes discrètes en tête du feuillet */
  content: ""; position: absolute; left: 34px; right: 30px; top: 0; height: 72px;
  background: repeating-linear-gradient(var(--band) 0 24px, transparent 24px 48px); opacity: .9;
}
.slip > * { position: relative; }
.slip-head { margin: -8px 0 34px; height: 48px; display: flex; align-items: center; }
.slip h1 { font-size: 28px; }
.slip .lead { color: var(--ink-2); }
.slip .aside { margin: 18px 0 0; font-size: 14px; color: var(--ink-2); }
.logo { display: inline-flex; align-items: center; gap: 9px; font-size: 22px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.code { font-size: 26px !important; letter-spacing: .3em; text-align: center; font-weight: 700; }
.steps { padding-left: 1.3em; margin: 0 0 18px; }
.steps li { margin-bottom: 12px; padding-left: 4px; }
.qr { margin: 12px 0; width: 196px; height: 196px; padding: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); }
.qr img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.key { display: inline-block; font-size: 15px; letter-spacing: .08em; background: var(--band); padding: 6px 10px; border-radius: 5px; word-break: break-all; }
details summary { cursor: pointer; color: var(--forest); font-weight: 600; }
.codes { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 18px; }
.codes li { font: 600 16px/1 ui-monospace, Consolas, monospace; letter-spacing: .06em; padding: 10px; background: var(--band); border-radius: 5px; text-align: center; }

/* ---------- Application ---------- */
body.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.rail { padding: 22px 0 18px 18px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; }
.rail-logo { text-decoration: none; margin: 0 0 22px 6px; }
.rail-nav { display: grid; gap: 1px; padding-right: 14px; }
.rail-nav a { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: var(--radius); text-decoration: none; color: var(--ink); font-weight: 550; }
.rail-nav a:hover { background: var(--desk-2); }
.rail-nav a.on { background: var(--paper); font-weight: 700; }
.rail-nav.small a { font-size: 14px; font-weight: 500; }
.rail-title { margin: 20px 0 6px 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.count { font-size: 12px; font-weight: 700; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: #0000000f; text-align: center; }
.count.hot { background: var(--stabilo); color: var(--ink); }

/* Groupes = intercalaires qui dépassent du classeur */
.tabs { display: grid; gap: 5px; }
.tab { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-right: 0; padding: 7px 12px 7px 12px; text-decoration: none; color: #fff;
  background: var(--k); border-radius: 9px 0 0 9px; font-weight: 600; font-size: 14px; margin-right: 12px; transition: margin .15s ease; box-shadow: inset -6px 0 8px -6px #00000040; }
.tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .count { background: #ffffff33; color: #fff; }
.tab:hover { margin-right: 5px; }
.tab.on { margin-right: 0; box-shadow: none; }
.tab-add { margin: 2px 14px 0 10px; font-size: 13px; color: var(--ink-2); }
.rail-foot { margin-top: auto; padding-top: 18px; }
.rail-user { margin: 10px 14px 0 10px; padding-top: 12px; border-top: 1.5px solid var(--desk-2); display: grid; gap: 2px; font-size: 14px; }
.rail-user span { font-weight: 650; }
.rail-user .link { justify-self: start; font-size: 13px; color: var(--ink-2); }

.sheet { margin: 14px 14px 14px 0; border-radius: 3px; padding: 22px 52px 40px 60px; min-width: 0; box-shadow: 0 10px 30px -14px #2a3d3255, 0 1px 3px #2a3d321a; }
.bar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.bar h1 { margin: 0; }
.search { flex: 1; }
.search input { padding-left: 38px !important; min-height: 42px !important;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23536359' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") 12px 50% no-repeat !important; }
.title-row { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.title-row h1 { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 99px; background: var(--stabilo); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.chip:hover { background: #e8d334; }
.save-view { display: inline-flex; gap: 6px; }
.save-view input { width: 170px !important; min-height: 32px !important; padding: 4px 8px !important; font-size: 14px; }

.bulkbar { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px 8px 14px; margin-bottom: 10px;
  background: var(--ink); color: #fff; border-radius: var(--radius); box-shadow: 0 8px 18px -8px #0006; }
.bulkbar select, .bulkbar input { width: auto !important; min-height: 32px !important; padding: 4px 8px !important; color: var(--ink); }
.bulkbar .btn { background: var(--stabilo); border-color: var(--stabilo); color: var(--ink); }

/* Le registre */
.table-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger th { text-align: left; font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 8px 10px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.ledger th a { color: inherit; text-decoration: none; }
.ledger th a:hover { color: var(--ink); text-decoration: underline; }
.ledger th.sorted { color: var(--ink); }
.ledger td { padding: 0 10px; height: 38px; vertical-align: middle; }
.ledger tbody tr { border-bottom: 1px solid var(--line); } /* fond uni : une couleur ne doit jamais suggérer une catégorie */
.ledger tbody tr:hover { background: #fdf7c9; }
.ledger tbody tr[data-id] { cursor: pointer; }
.ledger .num { text-align: right; white-space: nowrap; }
.ledger .check { width: 34px; padding-right: 0; }
.ledger td.name { min-width: 240px; max-width: 420px; }
.ledger tfoot td { border-top: 2px solid var(--ink); font-weight: 700; height: 42px; }
.ledger.compact td { height: 32px; }
.ledger tr.off td { color: var(--ink-2); text-decoration: line-through; }
.ledger tr.warn td { color: var(--danger); }
.open { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; max-width: 100%; }
.open .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.open:focus-visible { outline: 3px solid var(--stabilo); }
tr.new .nm::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: #d9a400; vertical-align: 2px; }
.dot-new { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #d9a400; }
.ext { display: inline-block; min-width: 34px; padding: 1px 5px; border-radius: 3px; border: 1.5px solid currentColor; color: var(--ink-2); font-size: 11px; font-weight: 750; text-align: center; text-transform: lowercase; line-height: 1.4; flex: none; }
.ext.big { font-size: 18px; padding: 6px 12px; }
td.auto, .auto { text-decoration: underline dotted #a88f00 2px; text-underline-offset: 4px; }
.pill { display: inline-block; margin: 1px 4px 1px 0; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 650; line-height: 20px; white-space: nowrap;
  color: var(--k); background: color-mix(in srgb, var(--k) 13%, white); }
.tabpill { border-radius: 6px 2px 2px 6px; background: var(--k); color: #fff; }
.legend { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.empty { padding: 60px 20px; text-align: center; color: var(--ink-2); font-size: 17px; }

/* ---------- Dépôt ---------- */
.dropzone { display: grid; justify-items: center; gap: 6px; padding: 54px 24px 44px; text-align: center; border-radius: 10px;
  border: 2.5px dashed #9fb39b; background: repeating-linear-gradient(var(--band) 0 28px, transparent 28px 56px); transition: border-color .15s, background-color .15s; }
.dropzone.over { border-color: var(--forest); border-style: solid; background-color: #fdf7c9; }
.dz-title { font-size: 22px; font-weight: 750; margin: 0; }
.dz-help { color: var(--ink-2); margin: 0 0 12px; }
.dz-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.dz-group { margin-top: 14px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.dz-group select { width: auto !important; margin: 0; }
.queue { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 4px; }
.queue li { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; padding: 8px 12px; border-radius: 5px; background: #fff; border: 1.5px solid var(--line); font-size: 14px; }
.queue .q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.queue .q-state { color: var(--ink-2); }
.queue .bar-track { grid-column: 1 / -1; height: 4px; background: var(--band); border-radius: 2px; overflow: hidden; }
.queue .bar-fill { height: 100%; width: 0; background: var(--forest); transition: width .2s; }
.queue li.ok { border-color: #9cc79a; } .queue li.ok .q-state { color: var(--forest); font-weight: 700; }
.queue li.ko { border-color: #e3a49c; background: #fdf1ef; } .queue li.ko .q-state { color: var(--danger); font-weight: 600; }
.queue-done { margin-top: 12px; font-weight: 650; }

/* ---------- Fiche document (tiroir) ---------- */
.drawer { position: fixed; inset: 0; z-index: 20; }
.drawer-scrim { position: absolute; inset: 0; background: #18251e66; animation: fade .15s ease; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(1180px, 96vw); background: var(--paper); box-shadow: -18px 0 40px -20px #0008; animation: slide .2s ease; overflow: hidden; }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }
.doc { display: grid; grid-template-columns: 1fr 440px; height: 100%; }
.doc-preview { background: #525a55; min-height: 0; display: flex; }
.doc-preview iframe { border: 0; width: 100%; height: 100%; background: #fff; }
.doc-preview img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.no-preview { margin: auto; text-align: center; color: #fff; display: grid; gap: 12px; justify-items: center; }
.no-preview .ext { color: #fff; }
.doc-side { overflow-y: auto; padding: 18px 24px 30px; }
.doc-head { display: flex; flex-direction: row-reverse; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.doc-head p { margin: 0; }
.close { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.close:hover { background: var(--band); }
.doc-form { display: grid; gap: 16px; }
.rename input { font-size: 18px; font-weight: 700; }
.rename-row { display: flex; align-items: center; gap: 6px; }
.rename-row .ext { font-size: 13px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 14px; background: var(--band); border-radius: var(--radius); }
.field-grid label span { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.field-grid label em { white-space: nowrap; line-height: 18px; margin-top: 1px; font-style: normal; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 99px; background: var(--stabilo); }
.field-grid label.auto { text-decoration: none; }
.field-grid label.auto input, .field-grid label.auto select { border-style: dashed; border-color: #b59c00; }
input.num { text-align: right; }
.groups { display: flex; flex-wrap: wrap; gap: 6px; }
.groups legend { width: 100%; }
.toggle { display: inline-flex; cursor: pointer; font-weight: 600; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { padding: 4px 12px; border-radius: 8px 3px 3px 8px; border: 1.5px solid var(--k); color: var(--k); font-size: 14px; }
.toggle input:checked + span { background: var(--k); color: #fff; }
.toggle input:focus-visible + span { outline: 3px solid var(--stabilo); outline-offset: 2px; }
.taginput { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 5px 6px; border: 1.5px solid #b9c6b5; border-radius: var(--radius); background: #fff; min-height: 40px; }
.taginput:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px #1d5a4233; }
.taginput input[type=text] { flex: 1; min-width: 100px; border: 0 !important; box-shadow: none !important; padding: 3px !important; min-height: 0 !important; margin: 0 !important; }
.taginput .pill { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 13px; --k: var(--ink-2); }
.taginput .pill button { all: unset; cursor: pointer; font-weight: 800; padding: 0 2px; }
.check-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius); border: 1.5px solid var(--line); cursor: pointer; }
.doc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.doc-more { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 20px; padding-top: 14px; border-top: 1.5px solid var(--line); }
.history { margin-top: 18px; font-size: 13px; }
.history ul { padding-left: 18px; color: var(--ink-2); }

/* ---------- Réglages ---------- */
.subtabs { display: flex; flex-wrap: wrap; gap: 4px; margin: -6px 0 22px; border-bottom: 2px solid var(--ink); }
.subtabs a { padding: 8px 14px; border-radius: 8px 8px 0 0; text-decoration: none; color: var(--ink-2); font-weight: 600; margin-bottom: -2px; border: 2px solid transparent; }
.subtabs a:hover { color: var(--ink); background: var(--band); }
.subtabs a.on { color: var(--ink); background: var(--paper); border-color: var(--ink); border-bottom-color: var(--paper); }
.two-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px 48px; }
.two-cols h2 { margin-top: 0; }
.item-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1.5px solid var(--line); }
.item-row > input { flex: 1 1 160px; width: auto !important; }
.item-row.add { border-bottom: 0; }
.swatches { display: inline-flex; gap: 3px; }
.swatch { position: relative; width: 20px; height: 20px; border-radius: 5px 2px 2px 5px; background: var(--k); cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.swatch:has(input:focus-visible) { outline: 3px solid var(--stabilo); outline-offset: 3px; }
.rules { list-style: none; padding: 0; margin: 0 0 14px; }
.rules li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 12px; }
.rules li:nth-child(odd) { background: var(--band); }
mark { background: var(--stabilo); padding: 0 4px; border-radius: 3px; }
.lead { font-size: 16px; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  body.app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; padding: 14px 16px 6px; }
  .rail-logo { margin-bottom: 10px; }
  .tabs { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .tab, .tab:hover, .tab.on { margin-right: 0; border-radius: 8px; }

  .rail-foot { margin-top: 10px; }
  .sheet { margin: 0; padding: 18px 16px 30px 40px; background-size: 24px 24px, 100% 100%; background-image: radial-gradient(circle at 11px 50%, var(--desk) 0 4px, transparent 4.5px), linear-gradient(to right, transparent 23px, var(--band-edge) 23px 24px, transparent 24px); }
  .sheet::after { display: none; }
  .bar { flex-wrap: wrap; }
  .doc { grid-template-columns: 1fr; grid-template-rows: 45vh auto; overflow-y: auto; }
  .doc-side { overflow: visible; }
  .field-grid { grid-template-columns: 1fr; }
  .slip { padding: 28px 22px 26px 50px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .rail, .bar, .toolbar, .filters, .bulkbar, button, .btn { display: none !important; } body, .sheet, .slip { background: #fff !important; box-shadow: none; } }

/* ---------- Sélecteur de langue ---------- */
.langs { display: inline-flex; gap: 2px; font-size: 12px; font-weight: 700; }
.langs a { padding: 2px 6px; border-radius: 4px; color: var(--ink-2); text-decoration: none; }
.langs a:hover { background: var(--desk-2); color: var(--ink); }
.langs a.on { background: var(--ink); color: #fff; }
.slip-head { justify-content: space-between; }
.slip-head .langs a:hover { background: var(--band); }
.rail-user .langs { margin: 4px 0 2px -6px; }

/* ---------- Vues en onglets (intercalaires posés sur le registre) ---------- */
.viewtabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px; margin: 2px 0 16px; border-bottom: 2px solid var(--ink); }
.viewtabs > a, .viewtabs .newview > summary { display: block; padding: 7px 14px; margin-bottom: -2px; border: 2px solid transparent; border-radius: 9px 9px 0 0;
  color: var(--ink-2); font-weight: 650; text-decoration: none; font-size: 14px; }
.viewtabs > a:hover { color: var(--ink); background: var(--band); }
.viewtabs > a.on { color: var(--ink); background: var(--paper); border-color: var(--ink); border-bottom-color: var(--paper); }
.viewtabs .newview > summary { color: var(--forest); border-style: dashed; border-color: #9fb39b; border-bottom: 0; }
.viewtabs .newview > summary:hover { background: var(--band); }

/* ---------- Barre de filtres ---------- */
.filterbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin: 6px 0 10px; }
.filters-form, .filterbar-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filterbar-label { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-right: 2px; }
.filterbar-tools { font-size: 14px; gap: 6px 14px; }
.fdrop { position: relative; }
.fdrop > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1.5px solid #b9c6b5;
  border-radius: 99px; background: #fff; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.fdrop > summary::-webkit-details-marker { display: none; }
.fdrop > summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); opacity: .55; }
.fdrop > summary:hover { border-color: var(--forest); }
.fdrop[open] > summary { border-color: var(--forest); box-shadow: 0 0 0 3px #1d5a4222; }
.fdrop > summary.active { background: var(--stabilo); border-color: #c9b31a; }
.fdrop > summary b { font-size: 12px; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--ink); color: #fff; text-align: center; }
.viewtabs .fdrop > summary::after { display: none; }
.fdrop-panel { position: absolute; z-index: 15; top: calc(100% + 6px); left: 0; min-width: 250px; max-width: min(340px, 86vw); max-height: 60vh; overflow-y: auto;
  display: grid; gap: 8px; padding: 14px; background: #fff; border: 1.5px solid var(--ink); border-radius: var(--radius); box-shadow: 0 14px 30px -12px #18251e55; }
.fdrop.right .fdrop-panel { left: auto; right: 0; }
.fdrop-panel.wide { min-width: 300px; }
.fdrop-panel fieldset { display: grid; gap: 4px; padding-bottom: 8px; border-bottom: 1.5px solid var(--line); }
.fdrop-panel .btn { justify-self: start; }
.opt { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; cursor: pointer; padding: 2px 0; }
.opt em { color: var(--ink-2); }
.dot { width: 10px; height: 10px; border-radius: 3px; background: var(--k); flex: none; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.range label { font-weight: 500; font-size: 13px; }
.hint { margin: 0; font-size: 13px; color: var(--ink-2); }
.stack-sm { display: grid; gap: 6px; }
.chips .link { align-self: center; }
.viewbanner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 9px 14px; margin: 0 0 12px; border-radius: var(--radius);
  background: #fdf7c9; border-left: 5px solid #c9b31a; font-size: 14px; }
.viewbanner.soft { background: var(--band); border-color: var(--forest); }
.save-view { display: inline-flex; gap: 6px; }
.save-view input { width: 190px !important; min-height: 32px !important; padding: 4px 8px !important; font-size: 14px; }

/* ---------- Réglages : colonnes ---------- */
.addcol { padding: 16px 18px; margin-bottom: 26px; background: var(--band); border-radius: var(--radius); }
.addcol h2 { margin-top: 0; }
.colform { display: grid; gap: 12px; }
.colform .form-row > label { max-width: 320px; }
.choices { display: grid; gap: 4px; }
.choices-label { font-weight: 600; font-size: 14px; }
.choices .taginput .pill { --k: var(--forest); }
.collist { list-style: none; padding: 0; margin: 0 0 30px; }
.colrow { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1.5px solid var(--line); }
.colrow .arrows { display: flex; gap: 3px; padding-top: 4px; flex: none; }
.colrow details { flex: 1; min-width: 0; }
.colrow summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 7px 8px; border-radius: var(--radius); }
.colrow summary::-webkit-details-marker { display: none; }
.colrow summary:hover { background: var(--band); }
.colrow summary .preview { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colrow summary .edit { margin-left: auto; color: var(--forest); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.colrow details[open] summary { background: var(--band); border-radius: var(--radius) var(--radius) 0 0; }
.colrow details[open] summary .edit { visibility: hidden; }
.colrow details > form.colform { padding: 14px 12px 6px; background: var(--band); }
.colrow .coldelete { padding: 4px 12px 14px; background: var(--band); border-radius: 0 0 var(--radius) var(--radius); }
.badge { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: #fff; border: 1.5px solid var(--line); color: var(--ink-2); }
.doc-actions { align-items: center; }
.status-done { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: #dff0dc; color: var(--forest); font-weight: 700; font-size: 14px; }
.status-done::before { content: "✓"; }

/* Bouton « Déposer » de la barre latérale (admin) : zone de dépôt en miniature */
.rail-upload { display: flex; align-items: center; gap: 8px; margin: 0 14px 14px 0; padding: 10px 12px; border: 2px dashed #8fa58b; border-radius: var(--radius);
  color: var(--forest); font-weight: 700; text-decoration: none; background: #ffffff66; }
.rail-upload:hover { border-style: solid; border-color: var(--forest); background: var(--paper); }
.rail-upload.on { border-style: solid; border-color: var(--forest); background: var(--forest); color: #fff; }
@media (max-width: 900px) { .rail-upload { margin-right: 0; } }

.invite-link { padding: 14px 16px; margin-bottom: 18px; border-radius: var(--radius); background: #fdf7c9; border-left: 5px solid #c9b31a; }
.invite-link p { margin: 0 0 6px; }
.invite-link input { flex: 1 1 400px; font-size: 13px; }
