/* Vacances Patrick Location */
:root {
  --brand: #256fba;
  --brand-2: #a9c5ec;
  --brand-dim: #e8f0fa;
  --bg: #f3f5f9;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --line: #d9dfe8;
  --line-2: #b9c3d2;
  --grid: #c9d1dd;
  --ink: #142033;
  --ink-2: #4a5873;
  --ink-3: #7b879b;
  --ok: #17803d;
  --ok-dim: #dcf2e3;
  --warn: #9a6400;
  --warn-dim: #fdf0d3;
  --bad: #c62f2f;
  --bad-dim: #fbe1e0;
  /* agences */
  --c-bussigny: #2c6fd1;
  --c-geneve: #2f9a57;
  --c-nyon: #d99a00;
  --c-direction: #d0413a;
  --c-none: #7b879b;
  --anniv: #c2549b;
  /* fériés (comme la légende de l'Excel) */
  --h-both: #e02020;
  --h-ge: #6fb93a;
  --h-vd: #0070c0;
  --we: #eceef2;
  --r: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.boot { padding: 40px; text-align: center; color: var(--ink-3); }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- barre du haut ---------- */
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1680px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.top .logo { height: 34px; display: block; }
.top .ttl { border-left: 1px solid var(--line); padding-left: 14px; line-height: 1.2; }
.top .ttl b { display: block; font-size: 16px; }
.top .ttl span { font-size: 12px; color: var(--ink-3); }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav button { border: 0; background: none; padding: 8px 14px; border-radius: 8px; font-weight: 600; color: var(--ink-2); font-size: 14px; position: relative; }
.nav button:hover { background: var(--brand-dim); color: var(--brand); }
.nav button[aria-current="page"] { background: var(--brand); color: #fff; }
.nav .badge { position: absolute; top: 2px; right: 2px; background: var(--bad); color: #fff; border-radius: 999px; font-size: 10px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; text-align: center; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.who b { color: var(--ink); }

main { max-width: 1680px; margin: 0 auto; padding: 18px 16px 80px; }
.narrow { max-width: 980px; margin: 0 auto; }

/* ---------- éléments ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; }
.panel-h { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-h h2 { font-size: 16px; }
.panel-h .sp { margin-left: auto; }
.panel-b { padding: 16px; }
.panel-b > :first-child { margin-top: 0; }
.panel-b > :last-child { margin-bottom: 0; }

.btn { border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 8px 14px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.pri:hover { filter: brightness(1.08); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { filter: brightness(1.08); color: #fff; }
.btn.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn.bad:hover { background: var(--bad-dim); }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { color: var(--brand); background: var(--brand-dim); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

input[type=text], input[type=password], input[type=number], input[type=date], input[type=tel], select, textarea {
  border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
label.f { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 14px; font-weight: 500; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed=true] { background: var(--brand); color: #fff; }

.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.souhait { background: var(--warn-dim); color: var(--warn); }
.chip.valide { background: var(--ok-dim); color: var(--ok); }
.chip.refuse { background: var(--bad-dim); color: var(--bad); }
.chip.info { background: var(--brand-dim); color: var(--brand); }
.chip.mute { background: var(--panel-2); color: var(--ink-3); border: 1px solid var(--line); }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--sc, var(--c-none)); flex: 0 0 auto; }
.pname { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.pname sup { font-size: 10px; color: var(--ink-3); font-weight: 700; }

.note { border-radius: 8px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.note.info { background: var(--brand-dim); color: #1d4f86; }
.note.warn { background: var(--warn-dim); color: #6e4800; }
.note.bad { background: var(--bad-dim); color: #8f1f1f; }
.note.ok { background: var(--ok-dim); color: #11592b; }
.note ul { margin: 4px 0 0; padding-left: 18px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; }
.tile b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile span { font-size: 12px; color: var(--ink-3); }
.tile.hi { border-color: var(--brand); background: var(--brand-dim); }
.tile.hi b { color: var(--brand); }
.tile.neg { border-color: var(--bad); background: var(--bad-dim); }
.tile.neg b { color: var(--bad); }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.t th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; background: var(--panel-2); white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.n { text-align: right; font-variant-numeric: tabular-nums; }
table.t input[type=number] { width: 80px; text-align: right; }
.scroll-x { overflow-x: auto; }

/* ---------- connexion ---------- */
.login { max-width: 560px; margin: 6vh auto; padding: 0 16px; }
.login .card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.login .logo { height: 54px; display: block; margin: 0 auto 6px; }
.login h1 { text-align: center; font-size: 20px; margin-bottom: 18px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 6px 0 16px; }
.people button { border: 1px solid var(--line-2); border-left: 4px solid var(--sc); background: var(--panel-2); border-radius: 8px; padding: 10px 12px; text-align: left; font-weight: 600; }
.people button small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.people button[aria-pressed=true] { background: var(--brand-dim); border-color: var(--brand); border-left-color: var(--sc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent); }
.code-in { font-size: 26px !important; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- planning (style Excel) ---------- */
.ptools { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ptools h2 { font-size: 22px; margin-right: 6px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.fbtn { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 3px 11px 3px 8px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.fbtn[aria-pressed=false] { opacity: .45; text-decoration: line-through; }
.fbtn.toggle[aria-pressed=true] { border-color: var(--brand); background: var(--brand-dim); color: var(--brand); }
.fbtn.toggle[aria-pressed=false] { text-decoration: none; }

.sheet { background: #fff; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.sheet-title { text-align: center; font-weight: 800; font-size: 20px; padding: 10px 0 8px; border-bottom: 2px solid #000; }
.months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 0; }
.months + .months { border-top: 0; }
.month {
  --lanes: 7;
  display: grid;
  grid-template-columns: 26px 36px repeat(var(--lanes), minmax(13px, 1fr)) minmax(15px, 1fr);
  grid-template-rows: 22px repeat(31, 21px);
  border-right: 2px solid #000; border-bottom: 2px solid #000;
  position: relative; min-width: 0;
}
.months .month:nth-child(4n) { border-right: 0; }
.mh { background: #d9d9d9; font-weight: 800; font-size: 12px; text-transform: uppercase; display: flex; align-items: center; padding-left: 4px; border-bottom: 1.5px solid #000; border-right: 1px solid var(--grid); white-space: nowrap; overflow: hidden; }
.mh.name { grid-column: 1 / 4; }
.mh.lane { justify-content: center; padding: 0; font-weight: 500; font-style: italic; font-size: 9.5px; text-transform: none; background: #fff; color: #333; }
.mh.lane.other { background: #d9d9d9; }
.c { border-bottom: 1px solid var(--grid); border-right: 1px solid var(--grid); font-size: 11.5px; display: flex; align-items: center; min-width: 0; }
.c.num { justify-content: center; font-weight: 800; }
.c.wd { padding-left: 3px; color: #222; border-right: 1.5px solid #000; }
.c.lane.other { border-left: 1px solid #999; }
.c.we { background: var(--we); }
.c.num.h-both { background: var(--h-both); color: #fff; }
.c.num.h-ge { background: var(--h-ge); color: #fff; }
.c.num.h-vd { background: var(--h-vd); color: #fff; }
.c.wd.summer { box-shadow: inset 3px 0 0 #f2c14e; }
.c.wd.over { background: var(--bad-dim); color: var(--bad); font-weight: 700; }
.c.wd.over::after { content: "!"; margin-left: auto; margin-right: 3px; font-weight: 900; }
.c.today { box-shadow: inset 0 0 0 2px var(--brand); }
.c.blank { background: repeating-linear-gradient(135deg, #fafafa, #fafafa 4px, #f0f0f0 4px, #f0f0f0 5px); }
.c.out { background: #f4f4f4; }

.bar {
  position: relative; z-index: 2; margin: 1px 1px; border-radius: 3px;
  background: var(--sc); color: #fff; border: 1px solid color-mix(in srgb, var(--sc) 70%, #000);
  display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
  writing-mode: vertical-rl; text-orientation: upright; font-weight: 800; font-size: 11px; line-height: 1; letter-spacing: -1px;
  padding: 2px 0; min-width: 0;
}
.bar.souhait {
  color: color-mix(in srgb, var(--sc) 80%, #000);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--sc) 22%, #fff) 0 5px, color-mix(in srgb, var(--sc) 40%, #fff) 5px 7px);
  border: 1.5px dashed var(--sc);
}
.bar.refuse { background: #eee; color: #999; border: 1px dashed #bbb; text-decoration: line-through; }
.bar.other { --sc: #8a94a6; }
.bar.conflict { outline: 2px solid var(--bad); outline-offset: -2px; }
.bar.cont-top { border-top-left-radius: 0; border-top-right-radius: 0; border-top-style: dotted; margin-top: 0; }
.bar.cont-bot { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-style: dotted; margin-bottom: 0; }
.bar:hover, .bar.hl { filter: brightness(1.08); box-shadow: 0 0 0 2px #000; z-index: 3; }
.bar.dim { opacity: .18; }

.legend { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); padding: 10px 12px; border-top: 1px solid var(--line); background: var(--panel-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.legend .sw-s { background: repeating-linear-gradient(135deg, #d6e3f6 0 4px, #b0c8ec 4px 6px); border: 1.5px dashed var(--c-bussigny); }
.legend .sw-v { background: var(--c-bussigny); }

@media (max-width: 1280px) { .months { grid-template-columns: repeat(2, minmax(0, 1fr)); } .months .month:nth-child(2n) { border-right: 0; } }
@media (max-width: 600px) {
  .months { grid-template-columns: 1fr; }
  .months .month { border-right: 0 !important; grid-template-rows: 26px repeat(31, 26px); }
  .c { font-size: 13px; }
  .bar { font-size: 12.5px; }
  .top .ttl { display: none; }
  .top-in { padding: 6px 10px; gap: 6px 10px; }
  .top .logo { height: 28px; }
  .top .who { margin-left: auto; }
  .nav { order: 3; }
  .ptools h2 { display: none; }
  .nav { width: 100%; margin-left: 0; }
  .nav button { flex: 1; padding: 8px 6px; font-size: 13px; }
  main { padding: 12px 10px 60px; }
}

/* ---------- été ---------- */
.slots { display: grid; gap: 10px; }
.slot { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.slot.mine { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.slot .sid { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--brand); }
.slot .sd { font-size: 17px; font-weight: 700; }
.slot .sm { font-size: 13px; color: var(--ink-3); }
.slot .who { margin-top: 6px; flex-wrap: wrap; gap: 6px 10px; }
.ranks { display: flex; gap: 6px; }
.rk { width: 46px; height: 46px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; font-weight: 700; display: grid; place-items: center; line-height: 1.05; color: var(--ink-3); }
.rk small { display: block; font-size: 9px; font-weight: 600; }
.rk[aria-pressed=true] { background: var(--brand); border-color: var(--brand); color: #fff; }
.rk:disabled { opacity: .4; cursor: not-allowed; }
.mx td.pick { cursor: pointer; text-align: center; }
.mx td.pick:hover { background: var(--brand-dim); }
.mx .r { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-weight: 700; font-size: 13px; }
.mx .r1 { background: var(--brand); color: #fff; }
.mx .r2 { background: color-mix(in srgb, var(--brand) 45%, #fff); color: #fff; }
.mx .r3 { background: color-mix(in srgb, var(--brand) 18%, #fff); color: var(--brand); }
.mx .r0 { color: var(--line-2); }
.mx td.asg .r { box-shadow: 0 0 0 3px var(--ok); }
.mx td.asg .r0 { background: var(--ok); color: #fff; }
.strip { display: grid; gap: 1px; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; height: 46px; margin-top: 8px; }
.strip i { display: block; background: var(--brand); opacity: .7; border-radius: 2px 2px 0 0; min-height: 1px; }
.strip i.we { opacity: .25; }
.strip i.ov { background: var(--bad); opacity: 1; }

/* ---------- listes ---------- */
.alist { display: grid; gap: 8px; }
.aitem { border: 1px solid var(--line); border-left: 4px solid var(--sc); border-radius: 8px; padding: 9px 12px; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; background: #fff; }
.aitem .dates { font-weight: 700; min-width: 190px; }
.aitem .meta { font-size: 13px; color: var(--ink-3); }
.aitem .acts { margin-left: auto; display: flex; gap: 6px; }
.aitem.conflict { background: #fff7f6; }

/* ---------- dialogue ---------- */
dialog[open] { display: flex; flex-direction: column; }
dialog { max-height: calc(100dvh - 24px); border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(10, 20, 40, .3); color: var(--ink); }
dialog::backdrop { background: rgba(15, 25, 45, .45); }
.dlg-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.dlg-h h3 { font-size: 17px; }
.dlg-h .x { margin-left: auto; }
.dlg-b { padding: 16px 18px; overflow-y: auto; flex: 1 1 auto; }
.dlg-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--panel-2); border-radius: 0 0 14px 14px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--ink-3); }
dl.kv dd { margin: 0; font-weight: 500; }

#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 18px; border-radius: 999px; font-size: 14px; z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 92vw; text-align: center; }
#toast.show { opacity: 1; }
#toast.err { background: var(--bad); }

.codes-print { display: none; }

/* ---------- impression : planning A4 paysage ---------- */
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body { background: #fff; }
  .top, .ptools, .no-print, #toast, dialog { display: none !important; }
  main { padding: 0; max-width: none; }
  .sheet { border: 0; border-radius: 0; }
  .months { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .months .month { border-right: 2px solid #000 !important; }
  .months .month:nth-child(4n) { border-right: 0 !important; }
  .months .month:nth-child(4n+1) { break-before: auto; }
  .month { grid-template-rows: 17px repeat(31, 18.5px) !important; }
  .months { break-inside: avoid; }
  .months + .months { break-before: page; }
  .c, .mh { font-size: 9px !important; }
  .bar { font-size: 9.5px !important; }
  .legend { background: none; break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
a.btn { text-decoration: none; color: inherit; display: inline-block; }

/* semaine */
.nowrap { white-space: nowrap; }
table.wk { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.wk th { font-weight: 600; font-size: 12px; color: var(--ink-2); padding: 4px 2px; text-align: center; white-space: nowrap; }
table.wk th:first-child, table.wk td.who { text-align: left; padding-right: 10px; white-space: nowrap; }
table.wk td { padding: 3px 1px; border-top: 1px solid var(--line); min-width: 34px; }
table.wk tr[data-a] { cursor: pointer; }
table.wk tr[data-a]:hover td { background: var(--brand-dim); }
table.wk .we { background: var(--we); }
table.wk .td { box-shadow: inset 0 0 0 2px var(--brand); }
table.wk td:last-child { padding-left: 10px; }
.wbar { display: block; height: 18px; border-radius: 4px; background: var(--sc); }
.wbar.souhait { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--sc) 25%, #fff) 0 4px, color-mix(in srgb, var(--sc) 45%, #fff) 4px 6px); border: 1.5px dashed var(--sc); }
.hd { display: inline-block; width: 7px; height: 7px; border-radius: 2px; vertical-align: middle; }
.hd.h-both { background: var(--h-both); } .hd.h-vd { background: var(--h-vd); } .hd.h-ge { background: var(--h-ge); }
.icsurl { font-size: 12px !important; font-family: ui-monospace, Menlo, monospace; }

/* objectif 90 % */
.pbar { position: relative; height: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; margin-top: 10px; }
.pbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--warn); }
.pbar i.ok { background: var(--ok); }
.pbar span { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }

/* réponses, nouveautés */
.reply { margin-top: 10px; background: var(--brand-dim); color: #1d4f86; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.aitem .reply { margin-top: 2px; }
.news { border-color: var(--brand); }
.nlist { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
