/* Charte GBP : indigo dominant, crème à la place du blanc, or foncé sur clair, or clair sur foncé.
   Titres en Goudy soulignés d'un filet or ; texte en Cera (Arial en substitution). */
@font-face { font-family: "Sorts Mill Goudy"; src: url(/fonts/SortsMillGoudy-Regular.ttf); font-display: swap }
@font-face { font-family: "Sorts Mill Goudy"; font-style: italic; src: url(/fonts/SortsMillGoudy-Italic.ttf); font-display: swap }
:root {
  --indigo: #2b2d86; --indigo-2: #4a55a0; --indigo-3: #e6e7f2; --indigo-ink: #1d1f5c;
  --or: #c8a957; --or-clair: #e3d5af; --or-ink: #7a5f1c;
  --creme: #f4f3eb; --feuille: #fbfaf6; --trait: #dcd9c9; --texte: #26284f; --doux: #65667f;
  --alerte: #a3282f; --alerte-fond: #f8e4e2; --attention: #8a5a00; --attention-fond: #f9ecc9; --ok: #2c6b4f;
  --titre: "Goudy Old Style", "Sorts Mill Goudy", Georgia, serif;
  --corps: "Cera Pro", Cera, Arial, sans-serif;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
html, body { height: 100% }
body { margin: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); background: var(--creme); color: var(--texte); font: 14px/1.45 var(--corps); font-variant-numeric: tabular-nums }
h1, h2, h3 { font-family: var(--titre); font-weight: 400; color: var(--indigo); margin: 0; text-wrap: balance }
h1 { font-size: 34px; line-height: 1.1 }
h2 { font-size: 23px; line-height: 1.2 }
h3 { font-size: 18px }
p { margin: 0 }
a { color: var(--indigo) }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px }

#rail { background: var(--indigo); color: var(--creme); display: flex; flex-direction: column; padding: 26px 0 20px; overflow: hidden; height: 100vh; position: sticky; top: 0 }
#waves { position: absolute; left: 0; bottom: 0; width: 100%; height: 46%; opacity: .5; pointer-events: none }
#waves path { fill: none; stroke: var(--or-clair); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .55 }
.brand { font: 23px/1.12 var(--titre); padding: 0 22px 18px }
.brand span { display: block; font: 700 9px/1.6 var(--corps); letter-spacing: .12em; text-transform: uppercase; color: var(--or-clair) }
#nav { display: flex; flex-direction: column; margin-top: 10px }
#nav a { color: var(--creme); text-decoration: none; padding: 11px 22px; font-size: 15px; border-bottom: 1px solid transparent }
#nav a:hover { background: rgba(255, 255, 255, .07) }
#nav a[aria-current] { background: var(--creme); color: var(--indigo); font-weight: 700 }
.shop { margin-top: auto; padding: 0 22px; font-size: 11px; color: var(--or-clair); position: relative; display: block }
.shop select { display: block; width: 100%; margin-top: 5px; background: var(--indigo-ink); color: var(--creme); border-color: var(--or-clair); text-overflow: ellipsis; font-size: 12px; padding: 7px 5px }

input:disabled { background: var(--creme); color: var(--doux) }
.user { padding: 14px 22px 0; position: relative; font-size: 13px }
.shop[hidden] + .user { margin-top: auto }
.user b, .user small { display: block; overflow-wrap: anywhere }
.user small { color: var(--or-clair) }
.user span { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 6px }
.user a, .user button { color: var(--or-clair); background: none; border: 0; padding: 2px 0; font-size: 12px; text-decoration: underline }
.user button:hover { background: none; color: var(--creme) }
body.auth { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--indigo) }
body.auth #rail { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0 }
body.auth #nav, body.auth .shop, body.auth .user { display: none }
body.auth main { position: relative; z-index: 1; display: grid; place-items: center; min-height: 100vh; padding: 100px 24px 30px }
body.auth #ai, body.auth #ai-open { display: none }
.door { width: 100%; display: grid; place-items: center; gap: 40px }
.door.wide { grid-template-columns: minmax(0, 1fr) minmax(0, 430px); max-width: 1060px; gap: 70px }
.pitch { color: var(--creme) }
.pitch h1 { color: var(--creme); font-size: 40px; line-height: 1.12 }
.pitch h1::after { content: ""; display: block; width: 120px; height: 2px; background: var(--or-clair); margin-top: 18px }
.pitch ul { padding: 0; margin: 24px 0; list-style: none; display: grid; gap: 14px; font-size: 16px; max-width: 54ch }
.pitch b { color: var(--or-clair) }
.gate { background: var(--feuille); border-top: 4px solid var(--or); padding: 32px 34px; width: min(430px, 100%); display: grid; gap: 15px }
.gate h2 { font-size: 28px }
.gate > button { padding-block: 10px }
.gate .alt { font-size: 13px }
.qr { width: 210px; justify-self: center } .qr svg { display: block; width: 100% }
.codes { background: var(--creme); padding: 14px 18px; margin: 0; font-size: 15px; line-height: 1.7; columns: 2 }
.pick { display: grid; gap: 8px }

/* Assistant */
#ai-open { position: fixed; right: 24px; bottom: 22px; z-index: 25; background: var(--indigo); color: var(--creme); border: 0; border-top: 3px solid var(--or); padding: 12px 20px; font-size: 15px; box-shadow: 0 8px 24px rgba(29, 31, 92, .3) }
#ai-open:hover { background: var(--indigo-ink) }
#ai { position: fixed; right: 0; top: 0; bottom: 0; width: 390px; max-width: 100vw; background: var(--feuille); border-left: 1px solid var(--trait); border-top: 4px solid var(--or); z-index: 28; display: flex; flex-direction: column }
#ai header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--trait) }
#ai .log { flex: 1; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; padding: 9px 13px; max-width: 92% }
.msg.user { align-self: flex-end; background: var(--indigo); color: var(--creme) }
.msg.assistant { align-self: flex-start; background: var(--indigo-3) }
.msg.wait { color: var(--doux); font-style: italic }
.msg.bad { background: var(--alerte-fond); color: var(--alerte) }
.prop { border: 1px solid var(--or); border-left-width: 5px; background: #fff; padding: 12px 14px; display: grid; gap: 8px }
.prop.confirm { border-color: var(--indigo-2) } .prop.dismiss { opacity: .6 }
.prop ul { margin: 0; padding-left: 17px; font-size: 13px } .prop .txt { justify-self: start; padding-left: 0 }
.start { display: grid; gap: 8px } .start button { white-space: normal; text-align: left }
.ask { border-top: 1px solid var(--trait); padding: 14px 18px; display: grid; gap: 8px }
.ask textarea { resize: none }
.ask > div { display: flex; gap: 12px; justify-content: space-between; align-items: center }
.ask small { color: var(--doux) }
@media (min-width: 1180px) { body.with-ai { padding-right: 390px } body.with-ai #ai-open { display: none } body.with-ai #toasts { right: 410px } }

.count-tag { background: var(--or); color: var(--indigo-ink); font-size: 11px; font-weight: 700; padding: 1px 7px; margin-left: 4px }
.req h2 { font: 700 16px/1.3 var(--corps) }
.req blockquote { margin: 12px 0 0; padding: 10px 14px; background: var(--creme); white-space: pre-wrap; overflow-wrap: anywhere }
.req p + p, .warn-line { margin-top: 10px } .warn-line { color: var(--attention) }
.meter { height: 8px; background: var(--indigo-3); margin-bottom: 20px } .meter i { display: block; height: 100%; background: var(--indigo) } .meter i.hot { background: var(--alerte) }
.bars .w { width: 100% } .bars .w i { display: block; height: 12px; background: var(--indigo); min-width: 2px }
.mine { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)) }
.mine .paper { margin: 0 !important; padding: 20px }
.mine ul { list-style: none; padding: 0; margin: 14px 0 0 }
.mine li { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--trait); align-items: start }
.mine li.now { box-shadow: inset 4px 0 0 var(--or); padding-left: 10px }
.mine li.off { color: var(--doux) }
.mine li small { display: block; color: var(--or-ink) }
.mine li > div:last-child { display: grid; gap: 5px }
.mine .chip { font-size: 13px } .mine .chip i { font-style: normal } .mine .chip span { white-space: normal } .mine .chip p { margin-top: 4px }
.mine .chip .tag { background: var(--feuille) }

main { padding: 26px 28px 60px; min-width: 0; outline: 0 }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 24px; margin-bottom: 18px }
.head > div:first-child { flex: 1 1 260px; min-width: 0 }
.head h1::after { content: ""; display: block; width: 120px; height: 2px; background: var(--or); margin-top: 9px }
.sub { color: var(--doux); margin-top: 8px }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.bar.main { margin-bottom: 14px; justify-content: space-between }

button, .btn, select, input, textarea { font: inherit; color: inherit }
button, .btn { border: 1px solid var(--indigo); background: transparent; color: var(--indigo); padding: 7px 13px; border-radius: 2px; cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.3; white-space: nowrap }
button:hover, .btn:hover { background: var(--indigo-3) }
button.pri, .btn.pri { background: var(--indigo); color: var(--creme) }
button.pri:hover, .btn.pri:hover { background: var(--indigo-ink) }
button.dan { border-color: var(--alerte); color: var(--alerte) }
button.dan:hover { background: var(--alerte-fond) }
button.txt { border-color: transparent; padding-inline: 8px }
button:disabled { opacity: .4; cursor: default }
.seg { display: inline-flex; border: 1px solid var(--indigo); border-radius: 2px }
.seg button { border: 0; border-radius: 0 }
.seg button + button { border-left: 1px solid var(--indigo) }
.seg button[aria-pressed=true] { background: var(--indigo); color: var(--creme) }
input, select, textarea { border: 1px solid #b9b7a8; background: #fff; padding: 7px 9px; border-radius: 2px; width: 100%; min-width: 0 }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--indigo) }
input[type=color] { padding: 2px; height: 34px; width: 46px }
.bar input, .bar select { width: auto }
label { font-size: 12px; color: var(--doux); display: block }
label > input:not([type=checkbox]):not([type=radio]), label > select, label > textarea { margin-top: 4px; color: var(--texte); font-size: 14px }
label.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--texte) }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px }
.full { grid-column: 1 / -1 }
.menu { position: relative }
.menu > div { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: #fff; border: 1px solid var(--indigo); min-width: 250px; padding: 5px 0; box-shadow: 0 8px 24px rgba(29, 31, 92, .18) }
.menu > div button { display: block; width: 100%; border: 0; text-align: left; border-radius: 0; padding: 9px 14px }
.menu hr { border: 0; border-top: 1px solid var(--trait); margin: 5px 0 }

.notice { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; background: var(--or-clair); padding: 9px 14px; margin-bottom: 14px; color: var(--indigo-ink) }
.notice button { margin-left: auto }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border: 1px solid var(--or); color: var(--or-ink); border-radius: 2px; white-space: nowrap }
.tag.red { border-color: var(--alerte); color: var(--alerte) }
.tag.blue { border-color: var(--indigo-2); color: var(--indigo) }

/* Planning */
.sheet { background: var(--feuille); border: 1px solid var(--trait); overflow: auto; max-height: calc(100vh - 210px); min-height: 260px }
table.plan { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; table-layout: fixed }
.plan th, .plan td { border-right: 1px solid var(--trait); border-bottom: 1px solid var(--trait); padding: 0; vertical-align: top; font-weight: 400; text-align: left }
.plan thead th { position: sticky; top: 0; background: var(--feuille); z-index: 5; padding: 8px 9px; border-bottom: 2px solid var(--or) }
.plan thead th b { font: 700 16px/1.1 var(--corps); color: var(--indigo); display: block }
.plan thead small { color: var(--doux); font-size: 11px }
.plan thead th.today { background: var(--indigo) }
.plan thead th.today b, .plan thead th.today small, .plan thead th.today button { color: var(--creme) }
.plan thead th .lock { float: right; border: 0; padding: 0 2px; font-size: 11px }
.plan thead th.locked { box-shadow: inset 0 -4px 0 var(--indigo-2) }
.plan .who { position: sticky; left: 0; background: var(--feuille); z-index: 4; padding: 8px 10px; width: 190px }
.plan thead .who { z-index: 6 }
.plan .who a { color: var(--texte); text-decoration: none; font-weight: 700; display: block; overflow-wrap: anywhere }
.plan .who a:hover { text-decoration: underline }
.plan .who small { color: var(--doux); display: block }
.plan .tot { width: 104px; padding: 8px 10px; text-align: right }
.plan thead .tot { text-align: right }
.plan .tot b { display: block }
.plan .tot small { color: var(--doux); display: block; font-size: 11px }
.plan tr.grp th { background: var(--indigo-3); color: var(--indigo-ink); font-weight: 700; padding: 6px 10px; position: sticky; left: 0 }
.plan tfoot th, .plan tfoot td { position: sticky; bottom: 0; background: var(--creme); padding: 7px 9px; border-top: 1px solid var(--or); z-index: 4; font-size: 12px }
.plan tfoot th.who { z-index: 6 }
.cell { min-height: 54px; height: 100%; padding: 3px; display: flex; flex-direction: column; gap: 3px; position: relative }
.cell.drop { background: var(--indigo-3); box-shadow: inset 0 0 0 2px var(--or) }
.cell.locked { background: #f0efe8 }
.add { flex: 1; min-height: 20px; border: 0; background: transparent; color: transparent; padding: 0 }
.add:hover, .add:focus-visible { color: var(--indigo); background: var(--indigo-3) }
.chip { border: 1px solid var(--line, var(--indigo)); border-left-width: 5px; background: var(--bg, #fff); color: var(--fg, var(--indigo-ink)); padding: 4px 6px; border-radius: 2px; text-align: left; line-height: 1.25; font-size: 12px; width: 100%; white-space: normal; cursor: grab; position: relative }
.chip:hover { background: var(--bg, #fff); filter: brightness(.96) }
.chip b { white-space: nowrap; letter-spacing: -.01em; display: flex; justify-content: space-between; gap: 6px }
.chip span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.chip.draft { border-style: dashed; border-left-style: solid }
.chip.other { opacity: .62; cursor: default; background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(29, 31, 92, .12) 5px 10px) }
.chip.abs { --bg: #eceae0; --line: #8d8b7d; --fg: #45443c }
.chip.warn::after, .cell > .flag { content: "!"; position: absolute; top: -4px; right: -3px; width: 15px; height: 15px; border-radius: 50%; background: var(--attention); color: #fff; font: 700 11px/15px var(--corps); text-align: center }
.chip.err::after { background: var(--alerte) }
.chip.dragging { opacity: .35 }
.plan .tot small.mono { color: var(--ok) } .plan .tot small.neg { color: var(--or-ink) } .plan .tot small.pos { color: var(--alerte) }
/* Mois */
.plan.month { min-width: 1500px }
.plan.month .who { width: 160px }
.plan.month .cell { min-height: 36px; padding: 2px }
.plan.month .chip { padding: 2px 3px; font-size: 10px; border-left-width: 3px }
.plan.month .chip span { display: none }
.plan.month thead th { padding: 6px 3px; text-align: center }
.plan.month thead th.who { text-align: left; padding-left: 10px }
.plan.month thead th b { font-size: 15px }
.plan.month .we { background: #f3f1e6 }
/* Jour */
.day { min-width: 980px }
.drow { display: grid; grid-template-columns: 190px 1fr 80px; border-bottom: 1px solid var(--trait); min-height: 46px }
.drow > div { padding: 8px 10px; min-width: 0 }
.track { position: relative; padding: 0 !important; border-inline: 1px solid var(--trait); background: repeating-linear-gradient(90deg, var(--trait) 0 1px, transparent 1px calc(100% / 20)) }
.track .chip { position: absolute; top: 4px; bottom: 4px; width: auto; white-space: nowrap }
.hrs { position: relative; height: 26px }
.hrs span { position: absolute; font-size: 11px; color: var(--doux); padding-left: 3px }
.count { display: grid; grid-template-columns: repeat(20, 1fr); text-align: center; font-size: 12px; padding: 0 !important; align-items: center }
.count span { padding: 6px 0 } .count span.z { color: #b9b7a8 }

.alerts { margin-top: 16px }
.alerts summary { cursor: pointer; font-weight: 700; color: var(--indigo) }
.alerts ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 1px }
.alerts li { display: grid; grid-template-columns: 90px 200px 1fr; gap: 12px; padding: 7px 10px; background: var(--attention-fond); color: #4a3200 }
.alerts li.error { background: var(--alerte-fond); color: #6d161c }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--doux); margin-top: 10px }
.legend i { display: inline-block; width: 22px; height: 12px; border: 1px solid var(--line); border-left-width: 5px; background: var(--bg); vertical-align: -1px; margin-right: 5px }

/* Équipe */
.split { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); gap: 24px; align-items: start }
.people { background: var(--feuille); border: 1px solid var(--trait); max-height: calc(100vh - 240px); overflow: auto }
.people button { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--trait); border-radius: 0; text-align: left; padding: 10px 14px; color: var(--texte); white-space: normal }
.people button[aria-current] { background: var(--indigo); color: var(--creme) }
.people button[aria-current] small { color: var(--or-clair) }
.people small { color: var(--doux); display: block }
.paper { background: var(--feuille); border: 1px solid var(--trait); padding: 24px 26px }
.paper + .paper { margin-top: 18px }
.paper > h2 + * , .paper > .phead + * { margin-top: 16px }
.phead { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center }
.empty { color: var(--doux); padding: 26px; text-align: center }

/* Tables */
.scroll { overflow-x: auto; background: var(--feuille); border: 1px solid var(--trait) }
table.data { border-collapse: collapse; width: 100% }
.data th, .data td { padding: 8px 11px; border-bottom: 1px solid var(--trait); text-align: left; white-space: nowrap }
.data th { font-size: 12px; color: var(--indigo); border-bottom: 2px solid var(--or); vertical-align: bottom }
.data .n { text-align: right }
.data td.z { color: #b0ae9f }
.data tr.sum td { font-weight: 700; background: var(--indigo-3) }
.data tr.det td { background: #fff; padding: 12px 16px }
.paper .scroll { border: 0 }
.data td > button.txt { padding-left: 0 }
.stats { display: flex; flex-wrap: wrap; gap: 8px 34px; margin-bottom: 16px }
.stats div { color: var(--doux); font-size: 12px }
.stats b { display: block; font: 700 22px/1.2 var(--corps); color: var(--indigo) }

dialog { border: 0; border-top: 4px solid var(--or); padding: 0; width: min(580px, calc(100vw - 24px)); background: var(--feuille); color: var(--texte); max-height: calc(100vh - 40px); box-shadow: 0 20px 60px rgba(29, 31, 92, .35) }
dialog::backdrop { background: rgba(29, 31, 92, .55) }
dialog form { display: grid; gap: 16px; padding: 24px 26px }
dialog .foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--trait); padding-top: 16px }
dialog .foot .left { margin-right: auto }
.err-msg { color: var(--alerte); background: var(--alerte-fond); padding: 8px 12px }
.days { display: flex; flex-wrap: wrap; gap: 6px }
.days label { border: 1px solid var(--indigo); padding: 5px 10px; display: flex; gap: 6px; color: var(--texte); font-size: 13px; cursor: pointer }
#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 32px)) }
#toasts div { background: var(--indigo-ink); color: var(--creme); padding: 11px 16px; border-left: 4px solid var(--or) }
#toasts div.bad { background: var(--alerte) }

@media (max-width: 860px) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; height: auto }
  #rail { height: auto; position: relative; padding: 14px 0 0 }
  .brand { font-size: 19px; padding: 0 16px 8px }
  #waves { height: 100% }
  .user { padding: 8px 16px 0; order: 1 } .user b, .user small { display: inline; margin-right: 8px } .user span { display: inline-flex; margin: 0 }
  .shop { order: 1; padding: 0 16px; margin: 0 }
  #nav { order: 2; flex-direction: row; overflow-x: auto; margin-top: 12px }
  #nav a { padding: 10px 16px }
  main { padding: 18px 16px 50px }
  .split, .door.wide { grid-template-columns: minmax(0, 1fr) }
  .door.wide { gap: 26px } .pitch h1 { font-size: 28px }
  .people { max-height: 300px }
  .alerts li { grid-template-columns: 1fr; gap: 2px }
  .sheet { max-height: none }
  .plan .who { width: 120px }
  .menu > div { right: auto; left: 0; max-width: calc(100vw - 32px) }
}
@media print {
  @page { size: A4 landscape; margin: 9mm }
  body { display: block; background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact }
  #rail, #ai, #ai-open, .bar, .notice, .alerts, #toasts, .add, .lock, .chip::after { display: none !important }
  main { padding: 0 }
  .sheet { overflow: visible; max-height: none; border: 0 }
  table.plan, .plan.month { min-width: 0 }
  .plan th, .plan td { position: static !important }
  .plan tr { break-inside: avoid }
  .cell { min-height: 30px }
  .head h1 { font-size: 24px }
}
