:root {
  --brand: #0B5F73;
  --brand-ink: #FFFFFF;
  --brand-soft: #E3F0F3;
  --navy: #142231;
  --navy-2: #22364B;
  --navy-line: #2C4259;
  --ink: #142231;
  --muted: #4A5868;
  --line: #DCE1E7;
  --line-soft: #EEF1F4;
  --bg: #F5F6F8;
  --card: #FFFFFF;
  --field: #FFFFFF;
  --hover: #F5F7F9;
  --ok-bg: #E4F2E8; --ok: #1F5E3A;
  --warn-bg: #FFF2D1; --warn: #6B4A00;
  --bad-bg: #FBE9E5; --bad: #A3341F;
  --info-bg: #E3F0F3; --info: #08485A;
  --grey-bg: #EEF1F4; --grey: #4A5868;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(20, 34, 49, .12);
  --mono: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
:root[data-theme="dark"] {
  --ink: #E6ECF1; --muted: #9DABB9; --line: #2C3D50; --line-soft: #223244; --bg: #0E1823; --card: #142231;
  --field: #0F1B28; --hover: #1A2B3D; --brand-soft: #123844;
  --ok-bg: #173A27; --ok: #9AD7AE; --warn-bg: #3D3112; --warn: #F0D08A; --bad-bg: #44211B; --bad: #F2A796;
  --info-bg: #123844; --info: #9FD3DF; --grey-bg: #223244; --grey: #9DABB9;
  --shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--brand); }
:root[data-theme="dark"] a { color: #9FD3DF; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }
.mono { font-family: var(--mono); }
.num { font-family: var(--mono); text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 236px; flex: 0 0 236px; background: var(--navy); color: #C9D3DD; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 18px; color: #fff; text-decoration: none; }
.side .brand img { max-height: 36px; max-width: 150px; background: #fff; border-radius: 6px; padding: 3px 6px; }
.side .brand b { font-size: 17px; letter-spacing: .06em; }
.side .brand small { display: block; font-size: 11px; color: #9FD3DF; letter-spacing: 0; font-weight: 500; }
.nav-group { padding: 6px 10px 10px; }
.nav-group h6 { margin: 8px 10px 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #7F93A6; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: #C9D3DD; text-decoration: none; min-height: 40px; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.on { background: var(--navy-2); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #5FB3C4; }
.nav a .count { margin-left: auto; background: #5FB3C4; color: #0C1A26; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.side .foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--navy-line); font-size: 12.5px; }
.side .foot button { background: none; border: 0; color: #9FD3DF; padding: 6px 0; cursor: pointer; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 20; min-height: 60px; }
.topbar .menu-btn { display: none; }
.trial { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 5px 12px 6px; font-size: 12.5px; font-weight: 600; display: inline-flex; flex-direction: column; gap: 4px; white-space: nowrap; }
.trial .trial-bar { display: block; height: 4px; border-radius: 4px; background: rgba(0,0,0,.08); overflow: hidden; }
.trial .trial-bar i { display: block; height: 100%; background: currentColor; border-radius: 4px; }
.trial.urgent { background: #FBE9E5; color: #A3341F; }
.content { padding: 26px 32px 60px; max-width: none; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

@media (max-width: 900px) {
  .side { position: fixed; z-index: 50; left: -260px; transition: left .2s; box-shadow: var(--shadow); }
  .side.open { left: 0; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 18px 16px 60px; }
  .topbar { padding: 10px 16px; }
}

/* ---------- Cards, grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 34, 49, .04); }
.card.pad { padding: 18px 20px; }
.card h2, .card h3 { margin: 0 0 12px; font-size: 16px; }
.card .card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.card .card-head h2, .card .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }
.g-dash { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 900px) { .g-dash { grid-template-columns: minmax(0, 1fr); } }
.kpi { padding: 18px 20px; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 27px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.kpi .sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.kpi a { text-decoration: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.icon { padding: 0; width: 36px; min-height: 36px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { flex: 0 0 auto; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); padding: 0 11px; outline: none; }
.textarea { padding: 9px 11px; min-height: 80px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input[readonly], .input:disabled, .select:disabled, .textarea[readonly] { background: var(--hover); color: var(--muted); }
.input.num-in { text-align: right; font-family: var(--mono); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.form-grid .span2 { grid-column: span 2; }
@media (max-width: 520px) { .form-grid .span2 { grid-column: auto; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card); position: sticky; top: 0; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--hover); }
table.t tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; }
table.t th.num, table.t td.num { text-align: right; }
table.t th.num { font-family: inherit; }
table.t input[type=checkbox] { accent-color: var(--brand); }
a.card { text-decoration: none; display: block; }
a.card:hover { border-color: var(--brand); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-grey { background: var(--grey-bg); color: var(--grey); }

/* ---------- Toolbar / filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); align-items: flex-end; }
.filters .field { min-width: 150px; }
.search { position: relative; flex: 1 1 240px; }
.search .input { padding-left: 36px; }
.search svg { position: absolute; left: 11px; top: 11px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; min-height: 44px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); }

/* ---------- Document editor ---------- */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.doc-side { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); align-items: start; }
@media (min-width: 1560px) { .doc-layout { grid-template-columns: minmax(0, 1fr) 330px; } .doc-side { grid-template-columns: minmax(0, 1fr); } }
.lines { width: 100%; border-collapse: collapse; min-width: 900px; }
.lines th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lines td { padding: 6px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.lines .input { min-height: 36px; padding: 0 8px; }
.lines tr.texte td { background: var(--hover); }
.lines .drag { color: var(--muted); }
.totals { display: flex; flex-direction: column; gap: 8px; }
.totals .tl { display: flex; justify-content: space-between; gap: 12px; }
.totals .tl span:last-child { font-family: var(--mono); }
.totals .grand { font-size: 18px; font-weight: 700; padding-top: 10px; border-top: 1px solid var(--line); }
.marge { background: var(--hover); border-radius: 8px; padding: 10px 12px; display: flex; justify-content: space-between; font-size: 13px; }
.picker { position: relative; }
.picker-list { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: 420px; max-height: 300px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.picker-list button { display: flex; width: 100%; gap: 10px; justify-content: space-between; text-align: left; background: none; border: 0; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.picker-list button.on, .picker-list button:hover { background: var(--brand-soft); }
.locked-note { display: flex; gap: 10px; align-items: center; background: var(--info-bg); color: var(--info); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px; }
.chain { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Modal, toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 18, 27, .5); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal { background: var(--card); border-radius: 14px; width: 100%; max-width: 560px; box-shadow: var(--shadow); }
.modal.wide { max-width: 900px; }
.modal.xwide { max-width: 1000px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; }
.toast.err { background: #A3341F; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth .pitch { background: var(--navy); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth .pitch h1 { font-size: 40px; line-height: 1.1; margin: 0; letter-spacing: -.02em; }
.auth .pitch h1 em { color: #5FB3C4; font-style: normal; }
.auth .pitch ul { padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; color: #C9D3DD; }
.auth .formside { display: grid; place-items: center; padding: 32px 16px; }
.auth form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.auth form h2 { margin: 0; font-size: 24px; }
.err-box { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 8px; font-size: 13px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth .pitch { padding: 32px 20px; } .auth .pitch h1 { font-size: 30px; } }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding-top: 20px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .stack-bar { width: 100%; max-width: 54px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 0 0; overflow: hidden; }
.bars .v { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.bars .lbl { font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Import ---------- */
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 26px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- Print (A4) ---------- */
.paper { background: #fff; color: #142231; width: 210mm; min-height: 297mm; padding: 14mm 14mm 18mm; margin: 0 auto; box-shadow: 0 4px 24px rgba(0,0,0,.15); font-size: 10pt; line-height: 1.4; position: relative; }
.paper .ph { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.paper .ph img { max-height: 22mm; max-width: 60mm; }
.paper .em { font-size: 9pt; color: #4A5868; }
.paper .em b { color: #142231; font-size: 11pt; }
.paper .dt { text-align: right; }
.paper .dt h1 { margin: 0; font-size: 18pt; letter-spacing: .02em; }
.paper .dt .no { font-family: var(--mono); font-size: 11pt; }
.paper .addr { margin: 9mm 0 7mm auto; width: 85mm; border: 1px solid #DCE1E7; border-radius: 6px; padding: 4mm 5mm; }
.paper .refs { display: flex; flex-wrap: wrap; gap: 4mm 8mm; margin-bottom: 5mm; font-size: 9pt; }
.paper .refs b { display: block; font-size: 8pt; color: #4A5868; font-weight: 500; }
.paper table { width: 100%; border-collapse: collapse; font-size: 9pt; }
.paper th { text-align: left; border-bottom: 1.5px solid #142231; padding: 2mm 1.5mm; font-weight: 600; }
.paper td { border-bottom: 1px solid #E3E7EC; padding: 2mm 1.5mm; vertical-align: top; }
.paper tr.sec td { background: #F2F4F6; font-weight: 600; }
.paper .r { text-align: right; white-space: nowrap; }
.paper .tot { display: flex; justify-content: flex-end; margin-top: 5mm; }
.paper .tot table { width: 80mm; }
.paper .tot td { border: 0; padding: 1mm 1.5mm; }
.paper .tot tr.g td { border-top: 1.5px solid #142231; font-size: 11pt; font-weight: 700; padding-top: 2mm; }
.paper .mentions { margin-top: 8mm; font-size: 8.5pt; color: #4A5868; }
.paper .foot { position: absolute; left: 14mm; right: 14mm; bottom: 8mm; text-align: center; font-size: 7.5pt; color: #4A5868; border-top: 1px solid #E3E7EC; padding-top: 2mm; }
.paper .stamp { display: inline-block; border: 1.5px solid #A3341F; color: #A3341F; padding: 1mm 3mm; border-radius: 4px; font-weight: 700; font-size: 9pt; transform: rotate(-3deg); }
.paper .sign { margin-top: 12mm; display: flex; justify-content: flex-end; }
.paper .sign div { width: 70mm; border-top: 1px solid #142231; padding-top: 2mm; font-size: 9pt; }
.preview-wrap { background: #E6EAEE; padding: 20px; max-height: 72vh; overflow: auto; border-radius: 8px; }
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body.printing { background: #fff; }
  #print-root .paper { box-shadow: none; margin: 0; width: auto; min-height: 0; height: auto; page-break-after: always; }
  #print-root .paper .foot { position: static; margin-top: 10mm; }
  #print-root .paper tr { page-break-inside: avoid; }
  #print-root .paper:last-child { page-break-after: auto; }
}

/* ---------- V2 : pastilles de filtre, menu Créer, recherche, graphiques ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 18px 0; }
.chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 14px; cursor: pointer; min-width: 120px; text-align: left; }
.chip b { font-size: 13px; }
.chip span { font-size: 12.5px; color: var(--muted); }
.chip.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.chip.bad b { color: var(--bad); }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 230px; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; }
.menu-list a:hover, .menu-list button:hover { background: var(--hover); }
.menu-list hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 0; }
.searchbox { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 0 10px; min-height: 38px; color: var(--muted); cursor: pointer; min-width: 240px; }
.searchbox kbd { margin-left: auto; font-family: var(--font); font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: var(--card); }
@media (max-width: 900px) { .searchbox { min-width: 0; } .searchbox .lbl, .searchbox kbd { display: none; } .trial { display: none; } }
.palette { position: fixed; inset: 0; background: rgba(10, 18, 27, .45); z-index: 120; display: flex; justify-content: center; padding: 10vh 16px; }
.palette-box { background: var(--card); width: 100%; max-width: 620px; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; align-self: flex-start; }
.palette-box input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; font-size: 16px; outline: none; background: var(--card); }
.palette-box .res { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette-box .res button { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.palette-box .res button.on { background: var(--brand-soft); }
.palette-box .res small { color: var(--muted); margin-left: auto; }
.palette-box .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px 4px; }
.chart text { font-family: var(--font); }
.aging { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line-soft); margin: 14px 0 12px; }
.aging-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.aging-legend div { font-size: 12.5px; color: var(--muted); }
.aging-legend b { display: block; color: var(--ink); font-size: 15px; }
.aging-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.hbar { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.hbar .track { height: 8px; border-radius: 4px; background: var(--line-soft); }
.hbar .fill { height: 8px; border-radius: 4px; background: var(--brand); }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-3x { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g-3x { grid-template-columns: minmax(0, 1fr); } }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1250px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g5 { grid-template-columns: minmax(0, 1fr); } }
.stock-bar { width: 90px; height: 6px; border-radius: 3px; background: var(--line-soft); display: inline-block; vertical-align: middle; overflow: hidden; }
.stock-bar i { display: block; height: 6px; }

/* ---------- Copilote ---------- */
.pilot-wrap { position: fixed; left: 0; top: 0; z-index: 150; background: none; border: 0; padding: 0; cursor: pointer; transition: transform .9s cubic-bezier(.45, 0, .2, 1); filter: drop-shadow(0 8px 14px rgba(10, 18, 27, .18)); }
.pilot-wrap:focus-visible { outline: 3px solid #5FB3C4; outline-offset: 4px; border-radius: 12px; }
.pilot-wrap.flip .pilot { transform: scaleX(-1); }
.pilot .arm-right, .pilot .arm-left { transform-box: view-box; transition: transform .45s ease; }
.pilot .arm-right { transform-origin: 88px 78px; }
.pilot .arm-left { transform-origin: 32px 78px; }
.pilot .eyes { transform-box: fill-box; transform-origin: center; animation: ck-blink 4.5s infinite; }
.pilot.pose-idle { animation: ck-bob 3.2s ease-in-out infinite; }
.pilot.pose-wave .arm-right { animation: ck-wave 1.1s ease-in-out infinite; }
.pilot.pose-point .arm-right { transform: rotate(-82deg); }
.pilot.pose-fly { animation: ck-tilt .9s ease-in-out; }
.pilot.pose-fly .arm-right { transform: rotate(-150deg); }
.pilot.pose-fly .arm-left { transform: rotate(150deg); }
.pilot.pose-fly .pilot-shadow { opacity: 0; }
@keyframes ck-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes ck-blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes ck-wave { 0%, 100% { transform: rotate(-150deg); } 50% { transform: rotate(-115deg); } }
@keyframes ck-tilt { 0% { transform: rotate(0); } 40% { transform: rotate(-9deg) translateY(-6px); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .pilot-wrap { transition: none; } .pilot, .pilot * { animation: none !important; } }
.tour-ring { position: fixed; z-index: 140; border: 3px solid #5FB3C4; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(10, 18, 27, .32); pointer-events: none; transition: all .35s ease; }
.tour-bubble { position: fixed; z-index: 160; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px; }
.tour-bubble p { margin: 0 0 12px; line-height: 1.5; }
.tour-bubble .tb-title { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); margin-bottom: 6px; }
.tour-bubble .tb-title span { color: var(--muted); font-weight: 600; }
.tour-bubble .tb-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.copilot-panel { position: fixed; right: 16px; bottom: 146px; z-index: 155; width: 370px; max-width: calc(100vw - 24px); max-height: min(560px, calc(100vh - 170px)); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.cp-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.cp-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; overflow: hidden; }
.cp-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cp-msg { max-width: 88%; padding: 10px 12px; border-radius: 12px; line-height: 1.5; }
.cp-msg.assistant { background: var(--hover); align-self: flex-start; border-bottom-left-radius: 4px; }
.cp-msg.user { background: var(--brand); color: var(--brand-ink); align-self: flex-end; border-bottom-right-radius: 4px; }
.cp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cp-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line-soft); }
.cp-dots { display: inline-flex; gap: 4px; }
.cp-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: ck-dot 1s infinite; }
.cp-dots i:nth-child(2) { animation-delay: .15s; } .cp-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ck-dot { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@media print { .pilot-wrap, .tour-ring, .tour-bubble, .copilot-panel { display: none !important; } }
.pilot-wrap.docked .pilot { width: 66px; height: 82px; }
.pilot-wrap .pilot { transition: width .6s ease, height .6s ease; }
.content { padding-bottom: 110px; }
.copilot-panel { bottom: 108px; }
.pilot-wrap.docked { z-index: 90; }
.toasts { right: 96px; }
@media (max-width: 600px) { .toasts { right: 12px; left: 12px; bottom: 100px; } }

/* ---------- V4 : deux modules, gestion de projet ---------- */
.modswitch { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin: 0 12px 10px; background: #0E1A26; border: 1px solid var(--navy-line); border-radius: 12px; padding: 4px; touch-action: pan-y; user-select: none; }
.modswitch .thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: #5FB3C4; transition: transform .32s cubic-bezier(.3, .7, .2, 1); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.modswitch.right .thumb { transform: translateX(100%); }
.modswitch button { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; color: #C9D3DD; font-size: 11.5px; font-weight: 600; line-height: 1.15; padding: 7px 4px; cursor: pointer; min-height: 48px; border-radius: 9px; text-align: center; transition: color .25s; }
.modswitch button[aria-selected="true"] { color: #0C1A26; }
.modswitch button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .modswitch .thumb { transition: none; } }
.nav-toggle { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; color: #C9D3DD; background: none; border: 0; min-height: 40px; cursor: pointer; text-align: left; }
.nav-toggle:hover { background: var(--navy-2); color: #fff; }
.nav-toggle.has-on { color: #fff; }
.nav-toggle .chev { margin-left: auto; transition: transform .2s; display: inline-flex; color: #7F93A6; }
.nav-sub.open .nav-toggle .chev { transform: rotate(90deg); }
.nav-children { padding-left: 16px; margin-left: 18px; border-left: 1px solid var(--navy-line); }
.nav-children a { min-height: 36px; padding: 7px 10px; font-size: 13.5px; }

.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: 0 0 auto; letter-spacing: .02em; }
.avatar.empty { background: var(--grey-bg); color: var(--muted); font-size: 12px; border: 1px dashed var(--line); }
.who { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.progress { display: inline-flex; align-items: center; gap: 8px; width: 100%; }
.progress .track { flex: 1; height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; min-width: 50px; }
.progress .track i { display: block; height: 100%; border-radius: 4px; transition: width .5s ease; }
.progress b { font-size: 12.5px; min-width: 38px; text-align: right; }
.progress.slim .track { height: 5px; margin-top: 8px; }
.poste { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--pc); background: color-mix(in srgb, var(--pc) 13%, transparent); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.poste::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--pc); }
.gdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.flux { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.flux-step { flex: 1 0 86px; position: relative; display: flex; flex-direction: column; align-items: center; padding: 10px 6px 9px; border-radius: 10px; background: color-mix(in srgb, var(--pc) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--pc) 30%, transparent); color: var(--ink); text-decoration: none; }
.flux-step b { font-size: 24px; line-height: 1.1; color: var(--pc); }
.flux-step span { font-size: 12px; color: var(--muted); font-weight: 600; }
.flux-step.zero { opacity: .55; }
.flux-step.hot { background: #FFF2D1; border-color: #E0A800; }
.flux-step.hot b { color: #9A6400; }
.flux-step:not(:last-child)::after { content: '›'; position: absolute; right: -6px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; z-index: 1; }
.flux-step:hover { border-color: var(--pc); }
.charge { display: flex; gap: 10px; align-items: center; padding: 7px 0; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-soft); }
.charge:last-of-type { border-bottom: 0; }
.charge .track { display: block; height: 6px; border-radius: 3px; background: var(--line-soft); margin-top: 5px; overflow: hidden; }
.charge .track i { display: block; height: 100%; border-radius: 3px; }
.charge:hover b { color: var(--brand); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.feed li:last-child { border-bottom: 0; }
.feed li a { color: var(--ink); text-decoration: none; }
.feed li a:hover { color: var(--brand); }
.feed small { color: var(--muted); }

.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kcol { flex: 0 0 272px; background: var(--hover); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 210px); }
.kcol.empty-col { flex-basis: 150px; }
.kcol.focus { box-shadow: 0 0 0 2px var(--pc); }
.kcol header { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; font-weight: 700; border-top: 4px solid var(--pc); border-radius: 12px 12px 0 0; background: var(--card); border-bottom: 1px solid var(--line); }
.kcol header b { background: var(--pc); color: #fff; border-radius: 99px; font-size: 12px; padding: 1px 8px; }
.kitems { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.kcard { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; cursor: pointer; box-shadow: 0 1px 2px rgba(20,34,49,.05); }
.kcard:hover { border-color: var(--brand); }
.kcard.late { border-left: 4px solid var(--bad); }
.kcard .kc-title { font-weight: 600; margin-top: 4px; font-size: 13.5px; }
.kcard .who span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }

.tr-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .tr-layout { grid-template-columns: minmax(0, 1fr); } }
.steps { list-style: none; margin: 16px 0 0; padding: 0; position: relative; }
.steps li { display: flex; gap: 12px; padding: 0 0 14px; position: relative; }
.steps li:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.steps li.st-fait:not(:last-child)::before { background: var(--ok); }
.steps .dot { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--grey-bg); color: var(--muted); border: 2px solid var(--line); position: relative; z-index: 1; }
.steps .st-fait .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps .st-en_cours .dot { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 5px var(--brand-soft); animation: ck-pulse 2s infinite; }
.steps .st-a_faire b { color: var(--muted); font-weight: 600; }
@keyframes ck-pulse { 0%, 100% { box-shadow: 0 0 0 4px var(--brand-soft); } 50% { box-shadow: 0 0 0 8px var(--brand-soft); } }
@media (prefers-reduced-motion: reduce) { .steps .st-en_cours .dot { animation: none; } }
.select.sm { min-height: 30px; font-size: 12.5px; padding: 0 6px; width: auto; max-width: 170px; }

.odonto { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 12px; overflow-x: auto; }
.odonto .arch { display: flex; gap: 3px; align-items: center; }
.odonto .arch:first-child { border-bottom: 1px dashed var(--line); padding-bottom: 4px; }
.odonto .arc { flex: 0 0 74px; font-size: 11.5px; color: var(--muted); cursor: pointer; border-radius: 6px; padding: 4px 6px; border: 1px solid transparent; }
.odonto .arc.on { background: var(--brand); color: var(--brand-ink); }
.tooth { flex: 1 1 0; min-width: 20px; max-width: 34px; width: auto; height: 34px; border-radius: 9px 9px 6px 6px; border: 1.5px solid var(--line); background: var(--card); font-size: 10.5px; font-weight: 600; color: var(--muted); cursor: pointer; padding: 0; }
.tooth.m { border-radius: 10px; flex-grow: 1.2; }
.odonto .arch > .tooth:nth-of-type(8) { margin-right: 8px; }
.tooth.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.tooth:disabled { cursor: default; }
.odonto.print .arc { flex-basis: 18mm; font-size: 7pt; color: #4A5868; }
.odonto.print .arc.on { background: #142231; color: #fff; }
.odonto.print .tooth { flex: 0 0 auto; width: 6mm; height: 7.5mm; font-size: 6.5pt; border-color: #B8C2CC; background: #fff; color: #4A5868; }
.odonto.print .tooth.m { width: 7mm; }
.odonto.print .tooth.on { background: #142231; border-color: #142231; color: #fff; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--card) inset; }
.pick-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-top: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pick-list .check { font-size: 13px; gap: 6px; }
.gamme-card.click { cursor: pointer; }
.gamme-card.click:hover { border-color: var(--brand); }
.route { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.route li { display: flex; flex-direction: column; padding: 5px 9px; border-radius: 8px; background: color-mix(in srgb, var(--pc) 10%, var(--card)); border-left: 3px solid var(--pc); font-size: 12.5px; line-height: 1.25; }
.route li small { color: var(--muted); font-size: 11px; }
.bell { position: relative; }
.bell-n { position: absolute; top: 2px; right: 1px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 99px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; }
.notif-list { width: 380px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto; }
.notif-list a { align-items: flex-start; font-size: 13px; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
.notif-list a.unread { background: var(--brand-soft); }

/* Fiche de travail imprimée */
.paper.fiche .fiche-grid { display: grid; grid-template-columns: 1.4fr 1fr .6fr .8fr 1fr; gap: 0; border: 1.5px solid #142231; border-radius: 4px; margin-top: 6mm; }
.paper.fiche .fiche-grid > div { padding: 2mm 3mm; border-right: 1px solid #DCE1E7; display: flex; flex-direction: column; font-size: 10pt; }
.paper.fiche .fiche-grid > div:last-child { border-right: 0; }
.paper.fiche .fiche-grid b { font-size: 7.5pt; color: #4A5868; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.paper.fiche .fiche-grid span { font-size: 8.5pt; color: #4A5868; }
.paper.fiche .fiche-grid .big { font-size: 15pt; font-weight: 800; color: #142231; }
.paper.fiche .fiche-grid .due { background: #142231; color: #fff; }
.paper.fiche .fiche-grid .due b, .paper.fiche .fiche-grid .due .big { color: #fff; }
.paper.fiche .fiche-label { font-size: 7.5pt; color: #4A5868; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 1.5mm; }
.paper.fiche .fiche-box { border: 1px solid #DCE1E7; border-radius: 3px; min-height: 16mm; padding: 2mm; white-space: pre-wrap; }
.paper.fiche table.gamme td { height: 7mm; vertical-align: middle; }
.paper.fiche .box { display: inline-block; width: 4.5mm; height: 4.5mm; border: 1.2px solid #142231; border-radius: 1px; text-align: center; line-height: 4.2mm; font-size: 8pt; vertical-align: middle; margin-right: 2mm; }
.paper.fiche .fiche-line { border-bottom: 1px solid #B8C2CC; height: 7mm; }
.paper.fiche .check-line { font-size: 9pt; padding: 1mm 0; }
.qr-missing { width: 24mm; font-size: 6pt; word-break: break-all; }
.input.w-qty { min-width: 58px; }
.input.w-pu { min-width: 86px; }
.content.full { max-width: none; }
.content.full .kanban { min-height: calc(100vh - 200px); }
.content.full .kcol { flex: 1 0 260px; }
.content.full .kcol.empty-col { flex: 0 0 118px; }

/* ---------- V5 : planification, portail ---------- */
.plancal { display: flex; flex-direction: column; gap: 6px; }
.pc-head, .pc-week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.pc-head span { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; }
.pc-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 58px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; padding: 6px 2px 9px; color: var(--ink); font: inherit; }
.pc-day b { font-size: 17px; line-height: 1.1; }
.pc-day small { font-size: 11px; color: var(--muted); }
.pc-day.e-ok { border-color: #8CC9A0; background: #F1F9F3; }
.pc-day.e-ok:hover { border-color: var(--ok); }
.pc-day.e-passe { opacity: .35; cursor: default; }
.pc-day.e-ferme { background: repeating-linear-gradient(45deg, var(--hover), var(--hover) 5px, var(--card) 5px, var(--card) 10px); color: var(--muted); cursor: not-allowed; }
.pc-day.e-trop_tot { background: var(--grey-bg); color: var(--muted); cursor: not-allowed; }
.pc-day.e-complet { background: #FBE9E5; border-color: #E8B4A8; color: #A3341F; cursor: not-allowed; }
.pc-day:disabled { cursor: not-allowed; }
.pc-day.best { box-shadow: 0 0 0 2px var(--ok) inset; }
.pc-day.sel { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 4px 12px rgba(11, 95, 115, .3); }
.pc-day.sel small { color: var(--brand-ink); opacity: .85; }
.pc-tag { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); background: var(--ok); color: #fff; font-style: normal; font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px; white-space: nowrap; }
.pc-load { position: absolute; left: 8px; right: 8px; bottom: 4px; height: 3px; border-radius: 2px; background: var(--line-soft); overflow: hidden; }
.pc-load span { display: block; height: 100%; background: var(--muted); }
.pc-day.sel .pc-load span { background: var(--brand-ink); }
.pc-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.pc-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -2px; border: 1.5px solid var(--line); }
.pc-legend i.e-ok { background: #F1F9F3; border-color: #8CC9A0; }
.pc-legend i.e-trop_tot { background: var(--grey-bg); }
.pc-legend i.e-complet { background: #FBE9E5; border-color: #E8B4A8; }
.pc-legend i.e-ferme { background: repeating-linear-gradient(45deg, var(--hover), var(--hover) 3px, var(--card) 3px, var(--card) 6px); }
.warn-box { display: flex; gap: 8px; align-items: center; background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-top: 12px; }
.input.warn-in { border-color: #D08A00; box-shadow: 0 0 0 3px rgba(208, 138, 0, .15); }
.cred { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; background: var(--hover); border-radius: 10px; padding: 14px; }
.cred span { color: var(--muted); font-size: 13px; }
.cred b { word-break: break-all; }
.portal-body { background: var(--bg); }
.portal-inner { max-width: 1280px; margin: 0 auto; padding-left: 24px; padding-right: 24px; width: 100%; }
.portal-top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.portal-top .portal-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.portal-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.portal-brand img { max-height: 40px; max-width: 160px; }
.portal-brand b { display: block; font-size: 16px; }
.portal-brand small { color: var(--muted); font-size: 12px; }
.pb-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; }
.portal-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.portal-nav > a:not(.btn) { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; }
.portal-nav > a.on:not(.btn) { color: var(--ink); background: var(--hover); }
.portal-main { padding-top: 26px; padding-bottom: 40px; }
.portal-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; padding-top: 14px; padding-bottom: 30px; border-top: 1px solid var(--line); }
.stepn { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 13px; margin-right: 10px; vertical-align: 1px; }
.chip-sm { min-height: 34px; min-width: 44px; padding: 0 10px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; }
.chip-sm.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg label { display: flex; flex-direction: column; gap: 2px; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.seg label.on { border-color: var(--brand); background: var(--brand-soft); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { color: var(--muted); font-size: 12.5px; }
@media (max-width: 560px) { .seg { grid-template-columns: 1fr; } }
.portal-date { position: sticky; top: 84px; }
.date-big { background: var(--brand-soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.date-big small { color: var(--muted); display: block; }
.date-big b { font-size: 22px; display: block; text-transform: capitalize; }
.date-big span { font-size: 12.5px; color: var(--muted); }
.ok-circle { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin: 0 auto; }
@media (max-width: 1100px) { .portal-date { position: static; } }
@media (max-width: 700px) { .portal-top { position: static; } .portal-top .portal-inner { padding-top: 10px; padding-bottom: 10px; } }

/* ---------- V6 : fichiers joints ---------- */
.fdrop { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px 18px; margin-bottom: 12px; }
.fdrop b { color: var(--ink); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ftile { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.ftile.click { cursor: pointer; }
.ftile.click:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(20,34,49,.08); }
.fthumb { position: relative; aspect-ratio: 4 / 3; background: color-mix(in srgb, var(--kc) 10%, var(--hover)); display: grid; place-items: center; overflow: hidden; }
.fthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ficon { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--kc); }
.ficon b { font-size: 11px; letter-spacing: .06em; }
.f3d { position: absolute; top: 6px; left: 6px; background: #2E86C1; color: #fff; font-size: 10.5px; font-weight: 800; padding: 1px 6px; border-radius: 5px; }
.fprog { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.7); overflow: hidden; }
.fprog i { display: block; height: 100%; background: var(--brand); transition: width .2s; }
.fmeta { padding: 7px 9px 8px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fmeta b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmeta span { font-size: 11.5px; color: var(--muted); }
.fdel { position: absolute; top: 4px; right: 4px; width: 28px !important; min-height: 28px !important; background: rgba(255,255,255,.9) !important; border-radius: 50% !important; }
.viewer3d { position: relative; height: min(62vh, 640px); background: #EEF1F4; border-radius: 10px; overflow: hidden; touch-action: none; }
.viewer3d canvas { display: block; width: 100% !important; height: 100% !important; }
.v3-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.clip { display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; color: var(--muted); font-weight: 600; }
.ia-badge { display: inline-block; margin-left: 6px; background: linear-gradient(135deg, #0B5F73, #5FB3C4); color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 6px; padding: 1px 6px; vertical-align: 1px; letter-spacing: .04em; }
.cp-p { margin: 0 0 6px; } .cp-p:last-child { margin-bottom: 0; } .cp-list { margin: 4px 0 8px; padding-left: 18px; } .cp-list li { margin: 3px 0; }

.fx-ok { display: flex; gap: 8px; align-items: center; background: var(--ok-bg, #E4F2E8); color: var(--ok, #1F5E3A); padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.fx-warn { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.fx-ok a, .fx-warn a, .err-box a { color: inherit; font-weight: 600; }

.art-picker { position: relative; width: min(460px, 100%); }
.art-input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--card); }
.art-input .input { border: 0; padding-left: 0; box-shadow: none; background: transparent; }
.art-list { position: absolute; z-index: 45; right: 0; top: calc(100% + 4px); width: min(560px, 92vw); max-height: 420px; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.art-sec { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px 4px; }
.art-row { display: flex; width: 100%; justify-content: space-between; gap: 12px; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--ink); font: inherit; }
.art-row:hover, .art-row:focus-visible { background: var(--hover); outline: none; }
.art-row span { display: flex; flex-direction: column; min-width: 0; }
.art-row span b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.art-row small { color: var(--muted); font-size: 12px; }
.art-row .r { align-items: flex-end; white-space: nowrap; font-weight: 600; }
.art-hint { padding: 8px 10px; color: var(--muted); font-size: 13px; }
