/* Layout: fixed left rail (navy pill nav, like the mockup) + content column; rail becomes a top bar under 860px */
:root {
  --bg: #f6f7fa;
  --surface: #ffffff;
  --surface-2: #f1f3f7;
  --line: #e3e6ee;
  --fg: #111827;
  --muted: #6b7385;
  --ink: #0f1729;          /* primary navy: active nav, primary buttons */
  --ink-fg: #ffffff;
  --focus: #3b5bdb;
  --blue-bg: #e7efff; --blue-fg: #2350c8;
  --amber-bg: #fff3d6; --amber-fg: #9a6200;
  --green-bg: #e3f6ea; --green-fg: #1d7a43;
  --red-bg: #fde8e8; --red-fg: #b42323;
  --violet-bg: #efe9ff; --violet-fg: #5b3cc4;
  --grey-bg: #eceef3; --grey-fg: #5b6273;
  --info-bg: #eef4ff; --info-line: #c9dafc; --info-fg: #2148b8;
  --shadow: 0 1px 2px rgba(15,23,41,.05), 0 8px 24px -12px rgba(15,23,41,.12);
  --f-ui: "Figtree", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0d111a; --surface: #151b27; --surface-2: #1c2433; --line: #283143;
  --fg: #e8ebf2; --muted: #9099ad; --ink: #e8ecf6; --ink-fg: #0d111a; --focus: #7d9bff;
  --blue-bg: #1b2a4d; --blue-fg: #9db8ff; --amber-bg: #3a2c0c; --amber-fg: #f4c56a;
  --green-bg: #12321f; --green-fg: #7fd9a2; --red-bg: #3d1717; --red-fg: #ff9d9d;
  --violet-bg: #2a2150; --violet-fg: #c2b1ff; --grey-bg: #252d3c; --grey-fg: #aab2c3;
  --info-bg: #17223b; --info-line: #2b3d66; --info-fg: #a9c1ff;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0d111a; --surface: #151b27; --surface-2: #1c2433; --line: #283143;
  --fg: #e8ebf2; --muted: #9099ad; --ink: #e8ecf6; --ink-fg: #0d111a; --focus: #7d9bff;
  --blue-bg: #1b2a4d; --blue-fg: #9db8ff; --amber-bg: #3a2c0c; --amber-fg: #f4c56a;
  --green-bg: #12321f; --green-fg: #7fd9a2; --red-bg: #3d1717; --red-fg: #ff9d9d;
  --violet-bg: #2a2150; --violet-fg: #c2b1ff; --grey-bg: #252d3c; --grey-fg: #aab2c3;
  --info-bg: #17223b; --info-line: #2b3d66; --info-fg: #a9c1ff;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--fg); font-family: var(--f-ui); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); font-size: .8em; letter-spacing: -.01em; }

.app { display: grid; grid-template-columns: 272px minmax(0,1fr); min-height: 100%; }
.rail { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 20px 18px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 42px; height: 42px; border-radius: 10px; background: var(--ink); color: var(--ink-fg); display: grid; place-items: center; }
.brand-mark svg { width: 22px; height: 22px; }
.brand b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.brand span { font-size: 13px; color: var(--muted); }
nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 18px 14px 6px; font-weight: 600; }
.nav-a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; text-decoration: none; color: var(--fg); font-weight: 500; }
.nav-a:hover { background: var(--surface-2); }
.nav-a[aria-current="page"] { background: var(--ink); color: var(--ink-fg); font-weight: 600; }
.nav-a .count { margin-left: auto; background: var(--blue-bg); color: var(--blue-fg); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.nav-a[aria-current="page"] .count { background: var(--ink-fg); color: var(--ink); }
.who { border-top: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 10px; }
.who-row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.who-row img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.who-row b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-row span { font-size: 12.5px; color: var(--muted); }
.demo { background: var(--surface-2); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.demo-t { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; display: flex; justify-content: space-between; }
.demo label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.demo select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 13px; }

main { padding: 40px clamp(16px, 5vw, 64px) 64px; min-width: 0; }
.wrap { max-width: 1200px; margin: 0 auto; display: grid; gap: 24px; }
.head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.head h1 { font-size: clamp(24px, 3vw, 30px); letter-spacing: -.02em; margin: 0; font-weight: 700; text-wrap: balance; }
.head p { margin: 4px 0 0; color: var(--muted); }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 9px 16px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }
.btn.primary:hover { opacity: .9; }
.btn.danger { color: var(--red-fg); }
.btn.danger.solid { background: var(--red-fg); color: var(--surface); border-color: var(--red-fg); }
.btn.ok { background: var(--green-fg); color: var(--surface); border-color: var(--green-fg); }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { border: 0; background: none; padding: 7px; border-radius: 8px; cursor: pointer; color: var(--muted); display: inline-grid; }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn.del:hover { color: var(--red-fg); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 14px; }
.tab[aria-pressed="true"] { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }

.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 0 14px; }
.search input { border: 0; outline: 0; background: none; padding: 12px 0; flex: 1; min-width: 0; }
.search:focus-within { border-color: var(--focus); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; }
.toolbar .search { flex: 1 1 260px; }
.toolbar select { border: 1px solid var(--line); background: var(--surface); border-radius: 11px; padding: 0 12px; min-height: 44px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.list { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; cursor: pointer; text-align: left; width: 100%; }
.row:hover { border-color: color-mix(in srgb, var(--fg) 25%, var(--line)); }
.thumb { width: 46px; height: 46px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.thumb.sm { width: 38px; height: 38px; border-radius: 9px; }
.row-main { min-width: 0; flex: 1; }
.row-main b { display: block; font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main span { color: var(--muted); font-size: 14px; }
.row-end { display: flex; align-items: center; gap: 10px; color: var(--muted); flex-wrap: wrap; justify-content: flex-end; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.s-blue { background: var(--blue-bg); color: var(--blue-fg); }
.s-amber { background: var(--amber-bg); color: var(--amber-fg); }
.s-green { background: var(--green-bg); color: var(--green-fg); }
.s-red { background: var(--red-bg); color: var(--red-fg); }
.s-violet { background: var(--violet-bg); color: var(--violet-fg); }
.s-grey { background: var(--grey-bg); color: var(--grey-fg); }

.info { display: flex; gap: 12px; background: var(--info-bg); border: 1px solid var(--info-line); color: var(--info-fg); padding: 14px 18px; border-radius: 12px; }
.info b { font-weight: 700; }

.cat-h { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; margin-top: 4px; }
.cat-h small { color: var(--muted); font-weight: 400; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.asset { padding: 18px 20px; display: grid; gap: 4px; cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s; }
.asset:hover:not([disabled]) { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--fg) 25%, var(--line)); }
.asset[disabled] { cursor: not-allowed; opacity: .6; }
.asset b { font-weight: 600; font-size: 16px; }
.asset .ref { color: var(--muted); font-size: 13px; }
.asset .foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.asset .foot span:last-child { text-align: right; min-width: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th { text-align: left; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
th:first-child { border-top-left-radius: 14px; } th:last-child { border-top-right-radius: 14px; }
td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.cell-asset { display: flex; gap: 14px; align-items: center; }
.cell-asset b { display: block; font-weight: 600; }
.cell-asset span { color: var(--muted); }
.dispo { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.meter { width: 90px; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; }

.fn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.fn { padding: 22px 24px; display: grid; gap: 14px; align-content: start; }
.fn-top { display: flex; justify-content: space-between; gap: 10px; }
.fn-top b { font-size: 18px; font-weight: 600; display: block; }
.fn-top span { color: var(--muted); }
.lbl { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); padding: 5px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.chip svg.i { width: 15px; height: 15px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.kpi { padding: 18px 20px; display: grid; gap: 6px; }
.kpi .k { font-size: 13.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.kpi .v { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.kpi .h { font-size: 13px; color: var(--muted); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; align-items: start; }
.panel { padding: 6px 0; }
.panel-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px 10px; gap: 10px; }
.panel-h h2 { font-size: 16px; margin: 0; font-weight: 600; }
.panel-h a { color: var(--muted); font-size: 14px; text-decoration: none; font-weight: 500; }
.panel-h a:hover { color: var(--fg); }
.p-row { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--line); }
.p-row .row-main b { font-size: 15px; }
.p-row .row-main span { font-size: 13px; }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty b { color: var(--fg); font-size: 16px; }

/* modal */
.scrim { position: fixed; inset: 0; background: rgba(9,13,22,.55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 16px; width: min(560px, 100%); max-height: calc(100% - 32px); overflow-y: auto; padding: 26px 28px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); display: grid; gap: 18px; }
.modal-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-h h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.modal-h p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 14px; }
.field input, .field select, .field textarea { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--surface); width: 100%; }
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.field .err { font-size: 12.5px; color: var(--red-fg); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.actions .spacer { margin-right: auto; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; cursor: pointer; font-size: 14px; }
.checks label:has(input:checked) { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }
.checks input { position: absolute; opacity: 0; pointer-events: none; }
.checks label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.confirm { background: var(--red-bg); color: var(--red-fg); border-radius: 10px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-weight: 500; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding-bottom: 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 8px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 12px; height: 12px; border-radius: 50%; margin: 4px 3px; background: currentColor; }
.timeline b { font-weight: 600; font-size: 14px; }
.timeline span { display: block; color: var(--muted); font-size: 13px; }
.timeline q { display: block; font-size: 13.5px; margin-top: 3px; quotes: none; }

.toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--ink-fg); padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.banner { background: var(--amber-bg); color: var(--amber-fg); padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; }

@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0,1fr); }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 14px 16px; }
  nav { flex-direction: row; overflow-x: auto; padding: 10px 12px; gap: 6px; }
  .nav-label { display: none; }
  .nav-a { white-space: nowrap; padding: 8px 12px; }
  .who { grid-template-columns: 1fr; padding: 10px 16px 14px; }
  .who-row { display: none; }
  .demo { grid-template-columns: 1fr 1fr; }
  .demo-t { grid-column: 1 / -1; }
  main { padding-top: 24px; }
  .pair { grid-template-columns: 1fr; }
  .row { padding: 14px 16px; gap: 12px; }
  .modal { padding: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* --- connexion, comptes --- */
.login { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: min(420px, 100%); padding: 32px 30px; display: grid; gap: 18px; box-shadow: var(--shadow); }
.login-card .brand { padding: 0; border: 0; }
.login-card h1 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.login-card p { margin: 0; color: var(--muted); font-size: 14px; }
.form-err { background: var(--red-bg); color: var(--red-fg); border-radius: 9px; padding: 10px 12px; font-size: 14px; font-weight: 500; }
.who-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.secret { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-family: var(--f-mono); font-size: 16px; letter-spacing: .02em; word-break: break-all; }
.secret code { flex: 1; user-select: all; }
.muted { color: var(--muted); }
.tag-off { opacity: .55; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .kpis, .kpis:has(> :nth-child(3):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis, .kpis:has(> :nth-child(3):last-child) { grid-template-columns: minmax(0, 1fr); } }

/* --- champs personnalisés --- */
.modal.wide { width: min(720px, 100%); }
.specs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.specs span { background: var(--surface-2); border-radius: 6px; padding: 2px 8px; font-size: 12.5px; color: var(--fg); }
.spec-line { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.fields-ed { display: grid; gap: 10px; }
.field-ed { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; background: var(--surface); }
.field-ed-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.field-ed-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; }
.field-ed-foot label { display: inline-flex; gap: 7px; align-items: center; cursor: pointer; }
.field-ed-foot .spacer { flex: 1; }
.icon-btn[disabled] { opacity: .3; cursor: default; }
svg.i.up { transform: rotate(-90deg); } svg.i.down { transform: rotate(90deg); }
@media (max-width: 560px) { .field-ed-main { grid-template-columns: 1fr; } }

/* --- exemplaires --- */
.modal table { min-width: 0; }
.modal table.compact th, .modal table.compact td { padding: 9px 12px; font-size: 14px; }
.modal table.compact th:first-child, .modal table.compact th:last-child { border-radius: 0; }
.modal .table-wrap { border: 1px solid var(--line); border-radius: 12px; max-height: 50vh; overflow: auto; }
.pick { display: grid; gap: 8px; max-height: 45vh; overflow-y: auto; }
.pick label { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; }
.pick label:has(input:checked) { border-color: var(--ink); background: var(--surface-2); }
.pick label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.pick input { width: 18px; height: 18px; flex: none; }
select.mini { border: 1px solid var(--line); border-radius: 7px; padding: 3px 6px; background: var(--surface); font-size: 13.5px; }

/* --- gestion par catégorie, prêt, import --- */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
label.opt { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 400; }
label.opt > input { width: auto; margin-top: 3px; flex: none; }
label.opt > span { display: grid; gap: 2px; }
label.opt b { font-weight: 600; }
label.opt.sub { margin-left: 26px; font-size: 14px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14.5px; }
.steps a { color: var(--focus); font-weight: 600; }
.imp-sum { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.imp-list { list-style: none; margin: 0; padding: 0; max-height: 34vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.imp-list li { padding: 7px 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; font-size: 14px; }
.imp-list li:first-child { border-top: 0; }

/* --- planning des prêts --- */
.pl-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pl-nav input[type=date] { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: var(--surface); }
.pl-wrap { overflow-x: auto; }
table.pl { min-width: 0; width: max-content; border-collapse: separate; border-spacing: 0; }
table.pl th, table.pl td { padding: 0; border-bottom: 1px solid var(--line); }
table.pl th:first-child, table.pl th:last-child { border-radius: 0; }
.pl-name { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 220px; max-width: 260px; padding: 8px 14px !important; border-right: 1px solid var(--line); text-align: left; }
th.pl-name { background: var(--surface-2); }
.pl-day { width: 38px; text-align: center !important; padding: 6px 0 !important; font-variant-numeric: tabular-nums; font-size: 13px !important; letter-spacing: 0 !important; text-transform: none !important; }
.pl-day span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.pl-day.today { color: var(--focus); }
.pl-day.today span { color: var(--focus); }
.pl-cell { width: 38px; height: 34px; text-align: center; }
.we { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
td.today { box-shadow: inset 1px 0 0 var(--focus), inset -1px 0 0 var(--focus); }
.pl-n { display: inline-grid; place-items: center; min-width: 26px; height: 24px; border-radius: 6px; font-weight: 700; font-size: 13px; font-style: normal; font-variant-numeric: tabular-nums; }
.pl-asset .pl-name { background: var(--surface); }
.pl-resa .pl-name { padding-left: 62px !important; }
.pl-link { all: unset; cursor: pointer; font-size: 13.5px; color: var(--muted); }
.pl-link:hover { color: var(--fg); text-decoration: underline; }
.pl-bar { all: unset; display: block; height: 14px; margin: 0 -1px; cursor: pointer; background: currentColor; }
.pl-bar.start { margin-left: 4px; border-top-left-radius: 7px; border-bottom-left-radius: 7px; }
.pl-bar.end { margin-right: 4px; border-top-right-radius: 7px; border-bottom-right-radius: 7px; }
.pl-bar.s-green { color: var(--green-fg); } .pl-bar.s-violet { color: var(--violet-fg); } .pl-bar.s-red { color: var(--red-fg); }
.pl-bar.s-blue { color: var(--blue-fg); }
.pl-bar.pending { background: repeating-linear-gradient(45deg, currentColor 0 4px, transparent 4px 8px); box-shadow: inset 0 0 0 1.5px currentColor; }
.pl-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); align-items: center; }
.pl-legend span { display: inline-flex; gap: 6px; align-items: center; }
.pl-legend .pl-bar { width: 26px; margin: 0; display: inline-block; }
.ask-dispo { border-radius: 9px; padding: 9px 12px; font-size: 14px; font-weight: 600; }
.exp-list { display: flex; gap: 10px; flex-wrap: wrap; }

/* les éléments masqués le restent, même avec un display défini plus haut */
[hidden] { display: none !important; }
/* un bouton ne s'étire pas seul : largeur explicite des barres du planning */
.pl-bar { width: calc(100% + 2px); box-sizing: border-box; }
.pl-bar.start, .pl-bar.end { width: calc(100% - 3px); }
.pl-bar.start.end { width: calc(100% - 8px); }
.pl-legend .pl-bar { width: 26px !important; }
/* catalogue : équipement en rupture, visible et demandable */
.asset.rupture { border-style: dashed; }
.pour-qui { max-width: 420px; }
