:root {
  --ink: #1a2633;
  --muted: #5a6b7d;
  --line: #b4c2d0;
  --paper: #ffffff;
  --canvas: #c9d3df;
  --panel: #e4ebf3;
  --navy: #1e3a5f;
  --on-navy: #ffffff;
  --danger: #8b2e2e;
  --focus: #1e3a5f;
  --side: 248px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

.app {
  display: grid;
  grid-template-columns: minmax(340px, 420px) 1fr;
  min-height: 100vh;
}

.editor {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  border-right: 1px solid var(--line);
}

.editor::before {
  content: "";
  height: 3px;
  flex: none;
  background: var(--navy);
}

.editor-scroll {
  overflow: auto;
  padding: 28px 28px 12px;
  flex: 1;
}

.brand {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.paris {
  margin: 10px 0 0;
  font-size: 13px;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}

.tag {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.note {
  margin: 18px 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 26px 0 12px;
}

h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.head-actions { display: flex; gap: 14px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 14px;
}

.field span, legend, .check span {
  font-size: 13px;
  color: var(--muted);
}

input, select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #8ea0b4;
  color: var(--ink);
  font: 15px/1.4 "Source Sans 3", "Segoe UI", sans-serif;
  padding: 9px 11px;
  border-radius: 2px;
  color-scheme: light;
}

input::placeholder { color: #8b95a3; }

input:focus, select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.16);
}

.field.bad input, .field.bad select {
  border-color: #9d3f3a;
  box-shadow: none;
}

input[type="radio"],
input[type="checkbox"] {
  width: auto;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  accent-color: var(--navy);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

fieldset.seg {
  border: 1px solid var(--line);
  margin: 0 0 16px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

fieldset.seg legend { padding: 0 6px; }

fieldset.seg label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}

fieldset.seg input { width: auto; }

fieldset.seg label:has(input:checked) {
  background: var(--panel);
  color: var(--navy);
  outline: 1px solid var(--navy);
}

.calc, .summary, .hint, .alert { margin: 0 0 10px; font-size: 13px; line-height: 1.45; }
.calc { color: var(--navy); min-height: 1.2em; font-weight: 600; }
.summary { color: var(--muted); }
.hint { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.hint.quiet { margin: 0 0 12px; }

.alert {
  padding: 8px 10px;
  background: #fbf4f4;
  color: var(--danger);
  border: 1px solid #ead4d4;
}

.missing {
  margin: 0 0 16px;
  padding-left: 18px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.missing.ok {
  list-style: none;
  padding-left: 0;
  color: var(--muted);
}

details.block { border-top: 1px solid var(--line); margin-top: 8px; }

details.block summary {
  cursor: pointer;
  padding: 14px 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.block-body { padding-bottom: 8px; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  font-size: 14px;
}

.check input { width: auto; }

.text-btn, .btn, .btn-primary {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  cursor: pointer;
}

.text-btn {
  background: none;
  border: none;
  color: var(--navy);
  padding: 0;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-btn:hover { color: #16304f; }

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 20px 16px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.btn-primary { grid-column: 1 / -1; }

.btn, .btn-primary {
  border-radius: 2px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
}

.btn-primary {
  background: var(--navy);
  color: var(--on-navy);
  border: 1px solid var(--navy);
}

.btn-primary:hover { background: #16304f; }

.btn {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn:hover { border-color: var(--navy); color: var(--navy); }

.history-block { margin: 8px 0 24px; }

#history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#history li { display: flex; gap: 6px; }

#history .empty {
  color: var(--muted);
  font-size: 13px;
  display: block;
}

#history .load {
  flex: 1;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 10px;
  cursor: pointer;
  font-family: inherit;
}

#history .load strong { display: block; font-size: 14px; font-weight: 600; }
#history .load span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
#history .load:hover { border-color: var(--navy); }

#history .drop {
  width: 36px;
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 18px;
}

#history .drop:hover { color: var(--danger); border-color: #ead4d4; }

.preview {
  padding: 32px 28px 72px;
  background: var(--canvas);
}

.preview-head {
  width: min(760px, 100%);
  margin: 0 auto 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet {
  width: min(760px, 100%);
  margin: 0 auto;
  background: #fff;
  color: #111;
  padding: 52px 54px 44px;
  border: 1px solid #d5dbe3;
  box-shadow: 0 14px 36px rgba(20, 38, 61, 0.12);
  overflow-wrap: break-word;
  font-family: "Times New Roman", Times, "Liberation Serif", Georgia, serif;
  font-size: 15.5px;
  line-height: 1.45;
}

.watermark {
  margin: 0 0 14px;
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--danger);
}

.mast {
  text-align: center;
  margin: 0 0 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e6e6e6;
}

.sheet h1 {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: none;
}

.ref, .stamp {
  margin: 10px 0 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 12.5px;
  color: #333;
  text-align: center;
}

.stamp { margin-top: 2px; letter-spacing: 0; text-transform: none; }

.facts {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 28px;
  font-size: 14px;
}

.facts caption {
  caption-side: top;
  text-align: left;
  font-family: "Times New Roman", Times, serif;
  font-size: 12px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #666;
  margin-bottom: 4px;
}

.facts th, .facts td {
  border: none;
  border-bottom: 1px solid #ececec;
  padding: 7px 0;
  vertical-align: baseline;
  text-align: left;
  font-weight: 400;
  background: transparent;
}

.facts th {
  width: 34%;
  padding-right: 16px;
  color: #555;
  font-weight: 400;
  font-style: italic;
}

.doc-between {
  margin: 8px 0 16px;
  text-align: center;
  font-family: "Times New Roman", Times, serif;
  font-size: 15px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
  text-transform: none;
  color: #111;
}

.party { margin: 0 0 14px; }

.party h2 {
  margin: 0 0 4px;
  font-family: "Times New Roman", Times, serif;
  font-size: 15.5px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: #111;
}

.party p, .alias, .accord, .done, .art p, .legal {
  margin: 0 0 8px;
  font-size: 15.5px;
  line-height: 1.55;
  text-align: justify;
  hyphens: auto;
  orphans: 3;
  widows: 3;
}

.alias { font-style: italic; }

.accord, .done {
  text-align: center;
  font-style: italic;
  margin: 18px 0;
}

.art { margin: 0; break-inside: auto; }

.art h3 {
  display: block;
  margin: 18px 0 6px;
  padding: 0;
  border: none;
  font-family: "Times New Roman", Times, serif;
  font-size: 15.5px;
  font-weight: 700;
  text-align: left;
  letter-spacing: 0;
  text-transform: none;
  color: #111;
  break-after: avoid;
  page-break-after: avoid;
}

.art-no,
.art-name {
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: #111;
  border: none;
  padding: 0;
  line-height: 1.3;
}

.art-name::before { content: " — "; }

.art-main p { margin-bottom: 8px; }

.blank {
  color: #8a8a8a;
  border-bottom: 1px solid #cfcfcf;
}

.warn { color: var(--danger); }

.close {
  margin-top: 18px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.signs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 12px;
}

.sign {
  min-height: 150px;
  border: none;
  border-top: 1px solid #111;
  padding: 12px 0 0;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  break-inside: avoid;
}

.sign strong {
  display: block;
  font-family: "Times New Roman", Times, serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sign-who {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.sign-space {
  display: block;
  height: 72px;
  border-bottom: 1px solid #111;
  margin: 10px 0 8px;
}

.sign em {
  font-style: italic;
  color: #333;
  font-family: "Times New Roman", Times, serif;
  font-size: 12px;
}

.legal {
  margin-top: 28px;
  padding-top: 8px;
  border-top: 1px solid #e6e6e6;
  font-size: 11px !important;
  text-align: left !important;
  color: #777;
  font-family: "Times New Roman", Times, serif;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%) translateY(12px);
  background: var(--navy);
  color: var(--on-navy);
  padding: 10px 14px;
  font-size: 13.5px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

body[data-type="cdi"] .rate-row { grid-template-columns: 1fr; }
body[data-type="cdi"] .only-cdd { display: none; }
body[data-type="cdd"] .only-cdi { display: none; }
.only-partiel { display: none; }
body[data-temps="partiel"] .only-partiel { display: flex; }
.only-remplacement { display: none; }
body[data-motif="remplacement"] .only-remplacement { display: flex; }

.combo-list {
  position: fixed;
  z-index: 6;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(26, 35, 50, 0.12);
  max-height: 280px;
  overflow: auto;
}

.combo-list li {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
}

.combo-list li[aria-selected="true"] { background: var(--panel); }

.combo-list .meta {
  display: block;
  margin-top: 2px;
  color: var(--navy);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.combo-empty {
  color: var(--muted);
  cursor: default;
}

@media (max-width: 1100px) {
  .app { display: block; }
  .editor { position: relative; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .preview { padding: 20px 12px 48px; }
  .sheet { padding: 32px 18px 28px; }
  .actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 640px) {
  .editor-scroll { padding: 20px 16px 8px; }
  .brand { font-size: 22px; }
  .grid-2 { grid-template-columns: 1fr; }
  input, select { font-size: 16px; }
  .btn, .btn-primary { min-height: 44px; }
  fieldset.seg label { min-height: 40px; padding: 8px 10px; }
  .preview-head {
    letter-spacing: 0.04em;
    font-size: 11px;
    flex-wrap: wrap;
  }
  .sheet { font-size: 15px; }
  .sheet h1 { font-size: 17px; letter-spacing: 0.06em; }
  .party p, .alias, .accord, .done, .art p { font-size: 15px; text-align: left; hyphens: manual; }
  .facts { font-size: 14px; }
  .facts th, .facts td { display: block; width: auto; padding: 2px 0; }
  .facts th { border-bottom: none; padding-top: 10px; padding-right: 0; }
  .facts tr:first-child th { padding-top: 6px; }
  .signs { grid-template-columns: 1fr; gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .edge-drawer, .staff-card { transition: none; }
  input, select, .btn, .btn-primary { transition: none; }
}

.gate[hidden],
.topbar[hidden],
.workspace[hidden],
.gate-card[hidden],
.gate-form[hidden],
.gate-step[hidden],
#forgotAsk[hidden],
#forgotDone[hidden] { display: none !important; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    linear-gradient(115deg, #1e3a5f 0 42%, #d5dee8 42% 100%);
  overflow: auto;
}

.gate-panel {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid #8ea0b4;
  border-top: 3px solid #1e3a5f;
  padding: 34px 32px 26px;
  box-shadow: 0 28px 70px rgba(16, 26, 40, 0.18);
}

.gate-logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border: 1px solid #8ea0b4;
  background: #f7f9fc;
}

.gate-logo img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.gate-logo-slot,
#companyLogoSlot {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #4d6278;
}

.gate-kicker { text-align: center; }
.gate-panel .brand {
  margin: 0;
  text-align: center;
  font-size: 34px;
  color: #1e3a5f;
}
.gate-panel .tag {
  text-align: center;
  text-wrap: balance;
  margin: 8px 0 22px;
}
.gate-panel .btn-primary { width: 100%; margin-top: 4px; text-align: center; }
.gate-link {
  display: block;
  width: 100%;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
  background: none;
  color: #1e3a5f;
  font: 600 14px/1.4 "Source Sans 3", "Segoe UI", sans-serif;
  text-align: center;
  cursor: pointer;
}
.gate-link:hover { text-decoration: underline; }
.gate-done {
  margin: 0 0 4px;
  color: #1e3a5f;
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}
@media (max-width: 800px) {
  .gate-panel { padding: 28px 20px 22px; }
  .gate-panel .brand { font-size: 30px; }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  backdrop-filter: blur(10px);
}
.top-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.top-back, .top-out {
  border: none;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
}
.top-back { display: none; background: #1e3a5f; }
.top-back:hover { background: #16304f; }
.top-out { background: #8b2e2e; }
.top-out:hover { background: #6f2424; }
body[data-space="contrats"] #headerLogout,
body[data-space="equipe"] #headerLogout,
body[data-space="planning"] #headerLogout,
body[data-space="suivi"] #headerLogout,
body[data-space="conges"] #headerLogout,
body[data-space="parametres"] #headerLogout,
body[data-space="salarie"] #headerLogout { display: none; }
.top-mark { width: 8px; height: 32px; background: var(--navy); }
#whoName {
  display: block;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
#spaceTitle {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

body:has(#edgeNav:not([hidden])) { padding-left: var(--side); }
.edge-nav {
  position: fixed;
  z-index: 45;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--side);
}
.edge-nav[hidden] { display: none !important; }
.edge-rail { display: none; }
.rail-dot[hidden] { display: none !important; }
.edge-drawer {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 28px 16px 22px;
  background: #14263d;
  color: #fff;
  border-right: 1px solid var(--line);
}
.edge-kicker {
  margin: 0 0 22px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.edge-links { display: flex; flex-direction: column; gap: 18px; flex: 1; min-height: 0; overflow: auto; }
.edge-group { display: flex; flex-direction: column; gap: 2px; }
.edge-account { margin-top: auto; }
.edge-label {
  margin: 0 0 4px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.48);
}
.edge-drawer .btn {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  border: none;
  border-left: 2px solid transparent;
  padding: 10px 12px;
}
.edge-drawer .btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
body[data-space="contrats"] #goContrats,
body[data-space="equipe"] #goEquipe,
body[data-space="planning"] #goPlanning,
body[data-space="suivi"] #goHeures,
body[data-space="conges"] #goConges,
body[data-space="parametres"] #goParametres {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: #fff;
  color: #fff;
}
body[data-space="salarie"] .edge-patron,
body[data-space="salarie"] #goParametres { display: none; }
.edge-drawer .btn.edge-out {
  margin-top: 8px;
  justify-content: center;
  text-align: center;
  background: #8b2e2e;
  color: #fff !important;
  border: none;
}
.edge-drawer .btn.edge-out:hover { background: #6f2424; color: #fff; }
.bell-wrap { position: relative; }
body:not([data-space="salarie"]) .edge-only-salarie { display: none; }
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 99px;
  background: #8f3d3d;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}
.badge[hidden], .notice-panel[hidden] { display: none !important; }
.notice-panel {
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  width: min(320px, calc(100vw - var(--side) - 28px));
  max-height: 320px;
  overflow: auto;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px;
  z-index: 20;
}
.notice-panel .fresh { background: var(--panel); }

.workspace {
  min-height: calc(100vh - 64px);
  padding: 28px 28px 48px;
  background: var(--canvas);
}
.staff-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.staff-head h2 {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 32px;
  letter-spacing: -0.03em;
  text-transform: none;
  color: var(--ink);
}
.staff-head .btn-primary { grid-column: auto; width: auto; }
.staff-create {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.8fr 0.9fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #8ea0b4;
  background: #f7f9fc;
}
.staff-create[hidden] { display: none !important; }
.staff-create .field { margin: 0; }
.staff-create .alert { grid-column: 1 / -1; }
.staff-create .btn-primary { grid-column: auto; width: auto; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.staff-card {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px;
  min-height: 124px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.staff-card:hover { border-color: var(--navy); box-shadow: 0 10px 24px rgba(20, 38, 61, 0.1); }
.staff-card.on { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: var(--panel); }
.staff-who { display: flex; align-items: center; gap: 12px; }
.staff-who strong { display: block; font-size: 16px; }
.staff-who span, .staff-meta { color: var(--muted); font-size: 13px; }
.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--navy);
  color: var(--on-navy);
  font-size: 14px;
  font-weight: 600;
  flex: none;
}
.staff-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; }
.staff-modal {
  width: min(920px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  margin: 0;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; text-transform: none; letter-spacing: 0; }
.modal-head .btn { width: auto; }
.fiche-grid { display: grid; grid-template-columns: 1.3fr 1fr 0.8fr 0.6fr 1fr; gap: 8px; align-items: end; }
.fiche-grid .field { margin: 0; }
.fiche-grid .wide { grid-column: 1 / -1; }
.fiche-actions { margin: 12px 0; }
.fiche-actions .btn-primary { grid-column: auto; width: auto; }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  padding: 22px 22px 20px;
  box-shadow: 0 12px 28px rgba(20, 38, 61, 0.08);
}
.panel h2 { margin: 18px 0 10px; }
.panel h2:first-child { margin-top: 0; }
.settings-form { display: flex; flex-direction: column; gap: 22px; max-width: 840px; }
.settings-block + .settings-block { padding-top: 18px; border-top: 1px solid var(--line); }
.settings-form .field { margin: 0 0 12px; }
.settings-form .field:last-child { margin-bottom: 0; }
.settings-form .grid-2 { margin-bottom: 12px; }
.settings-form .grid-2 .field { margin: 0; }
.settings-form .fiche-actions { margin: 0; }
#parametres .leave-head { flex-wrap: wrap; align-items: flex-end; }
#settingsTotals { align-self: end; }
#settingsTotals .hour-card { min-width: 132px; }
#settingsTotals .hour-card strong { font-size: 18px; }

.people, .docs { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.people button, .docs li {
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
}
.people button { cursor: pointer; }
.people button strong, .docs strong { display: block; }
.people button span, .docs span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.people button[aria-current="true"] { border-color: var(--navy); background: var(--panel); }
.docs li { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.docs a, .docs .text-btn { white-space: nowrap; color: var(--navy); }
.docs li.is-accepte { background: #d7eadc; border-color: #b7d4bf; }
.docs li.is-attente { background: #e4e7eb; border-color: #cfd4da; }

.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-actions .btn, .doc-actions .btn-primary { flex: 1; }

.portal-card { width: min(640px, 100%); margin: 0 auto; }
.portal-card .btn { margin-top: 12px; }
.module-index, .module-back { display: none; }
.module-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 138px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.module-card[data-module="portalPlanning"] { background: #d5e2f2; border-color: #b4c7de; border-top-color: #1e3a5f; }
.module-card[data-module="portalHours"] { background: #d3e6e8; border-color: #b3d0d4; border-top-color: #1d5962; }
.module-card[data-module="portalLeave"] { background: #e1e4f2; border-color: #c4c9e2; border-top-color: #3a4570; }
.module-card[data-module="portalDocs"] { background: #e4eaf1; border-color: #c5d0dc; border-top-color: #4d6278; }
.module-card[data-module="portalPlanning"] span { color: #1e3a5f; }
.module-card[data-module="portalHours"] span { color: #1d5962; }
.module-card[data-module="portalLeave"] span { color: #3a4570; }
.module-card[data-module="portalDocs"] span { color: #4d6278; }
.module-card:active { filter: brightness(0.97); }
body[data-space="salarie"] #portalLogout { display: none; }
.module-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.module-card strong {
  margin-top: 10px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.module-back { margin: 0 0 4px; }

html:not([data-file]) body:not([data-space]) .app { display: none; }
html[data-file] #gate { display: none !important; }

body[data-space="equipe"] .app,
body[data-space="planning"] .app,
body[data-space="suivi"] .app,
body[data-space="conges"] .app,
body[data-space="parametres"] .app,
body[data-space="salarie"] .app,
body[data-space="salarie"] #goContrats,
body[data-space="salarie"] #goEquipe,
body[data-space="salarie"] #goPlanning,
body[data-space="salarie"] #goHeures,
body[data-space="salarie"] #goConges { display: none; }

.hours-story { margin: 12px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink); }
.hour-totals { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; margin: 14px 0 8px; }
.hour-card { background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--navy); padding: 12px 14px; }
.hour-card span { display: block; color: var(--muted); font-size: 12px; }
.hour-card strong { display: block; margin-top: 4px; font-family: "Source Serif 4", Georgia, serif; font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.hour-card.is-extra { border-top-color: #1d5962; }
.hour-card.is-extra strong { color: #1d5962; }
.hour-card.is-declared { background: #d5e2f2; border-color: #b7c9de; border-top-color: #1e3a5f; }
.hour-card.is-declared strong { color: #1e3a5f; }
.hour-card.is-contract { background: #e4eaf1; border-color: #c5d0dc; border-top-color: #4d6278; }
.hour-card.is-contract strong { color: #4d6278; }
.hour-card.is-plan { background: #d4dee8; border-color: #b9c6d4; border-top-color: #5d7390; }
.hour-card.is-plan strong { color: #2f4560; }
.hour-card.is-25 { background: #d3e6e8; border-color: #b7d0d4; border-top-color: #1d5962; }
.hour-card.is-25 strong { color: #1d5962; }
.hour-card.is-50 { background: #e1e4f2; border-color: #c9cede; border-top-color: #3a4570; }
.hour-card.is-50 strong { color: #3a4570; }
.hour-card.is-comp { background: #e4eaf1; border-color: #c9d3de; border-top-color: #4d6278; }
.hour-card.is-comp strong { color: #4d6278; }
.hour-card.is-down { background: #f4e6e6; border-color: #e2c8c8; border-top-color: #8b2e2e; }
.hour-card.is-down strong { color: #8b2e2e; }
.hour-card.is-ok { background: #d7eadc; border-color: #b7d4bf; border-top-color: #2f6b4a; }
.hour-card.is-ok strong { color: #1e4d34; }
.hour-card.is-wait { background: #e4e7eb; border-color: #cfd4da; border-top-color: #5c6670; }
.hour-card.is-wait strong { color: #3d4650; }
.leave-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.leave-head strong {
  display: block;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  color: #1e3a5f;
}
.leave-counts { display: flex; flex: none; border: 1px solid #8ea0b4; background: #fff; }
.hour-tools { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
#suivi .leave-head { flex-wrap: wrap; }
#suivi .hours-title { flex: 1 1 240px; }
.team-tools { align-items: center; }
.team-tools .btn-primary {
  grid-column: auto;
  width: auto;
  height: 42px;
  min-height: 42px;
  padding: 0 16px;
}
.team-table { min-width: 860px; }
.team-table tbody tr { cursor: pointer; }
.team-table tbody tr:hover { background: #f4f7fb; }
.team-table tbody tr.is-open,
.team-table tbody tr.is-open:hover { background: #e8eef6; }
.team-table .team-id { font-variant-numeric: tabular-nums; white-space: nowrap; }
.team-table .leave-act { margin-left: 0; color: #1e3a5f; }
.team-table tbody tr.is-off td { color: #5c6670; }
.team-flag {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.team-flag.is-on {
  color: #1e4d34;
  background: #d7eadc;
  border: 1px solid #b7d4bf;
}
.team-flag.is-off {
  color: #8b2e2e;
  background: #f4e6e6;
  border: 1px solid #e2c8c8;
}
.team-find {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 0 0 14px;
}
.team-find .field { flex: 1 1 220px; max-width: 360px; margin: 0; }
.team-find .view-switch { margin: 0; }
#employeeDetail .fiche-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
#toggleEmployee.is-off,
#toggleEmployee.is-refuse {
  background: #8b2e2e;
  color: #fff;
  border-color: #8b2e2e;
}
#toggleEmployee.is-off:hover,
#toggleEmployee.is-refuse:hover { background: #6f2424; }
#toggleEmployee.is-on {
  background: #1e6b3a;
  color: #fff;
  border-color: #1e6b3a;
}
#toggleEmployee.is-on:hover { background: #185832; }
.leave-counts .hour-card {
  min-width: 118px;
  margin: 0;
  border: 0;
  border-right: 1px solid #d5dee8;
  border-top: 0;
  border-radius: 0;
  padding: 10px 14px 12px;
}
.leave-counts .hour-card:last-child { border-right: 0; }
.leave-counts .hour-card strong { font-size: 28px; line-height: 1; }
.leave-block { margin-top: 22px; }
.leave-block-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; }
.leave-block h3 {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  color: #1e3a5f;
}
.leave-block-head span { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: #4d6278; }
.leave-scroll { overflow-x: auto; border: 1px solid #8ea0b4; }
.leave-table { width: 100%; min-width: 760px; border-collapse: collapse; background: #fff; }
.leave-table th, .leave-table td {
  padding: 12px 14px;
  border-right: 1px solid #d5dee8;
  border-bottom: 1px solid #d5dee8;
  text-align: left;
  vertical-align: middle;
}
.leave-table th:last-child, .leave-table td:last-child { border-right: 0; }
.leave-table tbody tr:last-child td { border-bottom: 0; }
.leave-table thead th {
  background: #e8eef6;
  border-bottom: 2px solid #1e3a5f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1e3a5f;
}
.leave-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.leave-table td strong { display: block; font-size: 16px; }
.leave-table tr.is-accepte { background: #f3faf6; }
.leave-table tr.is-refuse { background: #f7f8fa; }
.leave-table tr.is-refuse td { color: #5a6b7d; }
.leave-table td.leave-empty { color: var(--muted); font-size: 14px; }
.leave-actions { white-space: nowrap; text-align: right; }
.leave-act { margin-left: 14px; padding: 0; font-size: 14px; font-weight: 700; text-decoration: none; }
.leave-act:hover { text-decoration: underline; }
.leave-act.is-accept { color: #1e4d34; }
.leave-act.is-refuse { color: #8b2e2e; }
.hour-card.is-solde { background: #d7eadc; border-color: #b7d4bf; border-top-color: #2f6b4a; }
.hour-card.is-solde strong { color: #1e4d34; }
.hour-card.is-solde.is-empty { background: #f4e6e6; border-color: #e2c8c8; border-top-color: #8b2e2e; }
.hour-card.is-solde.is-empty strong { color: #8b2e2e; }
.hour-card.is-acquis { background: #d5e2f2; border-color: #b7c9de; border-top-color: #1e3a5f; }
.hour-card.is-acquis strong { color: #1e3a5f; }
.hour-card.is-pris { background: #e1e4f2; border-color: #c9cede; border-top-color: #3a4570; }
.hour-card.is-pris strong { color: #3a4570; }
.hours-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 0 0 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.hours-title { min-width: 0; text-align: left; }
.hours-kicker {
  display: block;
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #4d6278;
}
.hours-head #hoursLabel,
.leave-head #hoursLabel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  color: #1e3a5f;
}
.hours-tools {
  display: flex;
  align-items: center;
  flex: none;
  gap: 10px;
}
.month-switch {
  display: flex;
  align-items: stretch;
  height: 42px;
  background: #fff;
  border: 1px solid #8ea0b4;
}
.month-switch:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.16);
}
.month-switch .btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  min-width: 40px;
  min-height: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--navy);
}
.month-switch .btn:hover { background: #f4f7fb; }
.month-switch .btn:first-child { border-right: 1px solid #d5dde6; }
.month-switch .btn:last-child { border-left: 1px solid #d5dde6; }
.hours-jump {
  display: block;
  position: relative;
  width: 210px;
  margin: 0;
}
.hours-jump span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.hours-jump select {
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 28px 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%231e3a5f' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center;
  box-shadow: none;
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.hours-jump select:focus { border: 0; box-shadow: none; }
.hours-tools > .btn {
  width: auto;
  min-height: 42px;
  height: 42px;
  padding: 0 16px;
}
.hours-note {
  max-width: 68ch;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.hour-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-bottom: 8px; }
.hour-nav strong,
#weekLabel,
#myWeekLabel,
#hoursLabel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}
.week-no {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  background: #e4eaf1;
  color: #1e3a5f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.now-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  background: #1e3a5f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.docs strong .now-badge { margin-left: 6px; }
.hour-split { margin: 4px 0 12px; }
.hour-split-bar { display: flex; height: 10px; background: #e4ebf3; }
.hour-split-bar i { display: block; min-width: 2px; }
#myHourLife { width: 100%; }
#myHourListTitle[hidden],
#hourHistory[hidden],
#hourConfirmNote[hidden] { display: none !important; }
.month-detail { margin-top: 10px; }
.month-detail .hours-story { margin-top: 0; }
.month-detail .docs { margin-bottom: 0; }
.month-detail .sup-row { margin: 8px 0 12px; }
.docs li.week-line {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.week-line-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.week-line-top strong { font-size: 15px; line-height: 1.3; }
.week-hours {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}
.sup-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sup-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  padding: 7px 10px;
  font-style: normal;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}
.sup-chip b { font-size: 16px; font-weight: 700; }
.sup-chip.is-25 { background: #d3e6e8; color: #1d5962; }
.sup-chip.is-50 { background: #e1e4f2; color: #3a4570; }
.sup-chip.is-comp { background: #e4eaf1; color: #4d6278; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 18px; }
.chart-card { margin: 0; border: 1px solid var(--line); padding: 14px 14px 10px; background: var(--panel); }
.chart-card h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.chart-wide { grid-column: 1 / -1; }
.chart-card svg { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart-gridline { stroke: #d5dde6; stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: "Source Sans 3", "Segoe UI", sans-serif; }
.chart-name { fill: var(--ink); font-size: 13px; font-family: "Source Sans 3", "Segoe UI", sans-serif; }
.chart-mark { stroke: #1e3a5f; stroke-width: 2; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.chart-legend .swatch-line { width: 12px; height: 0; border-top: 2px solid #1e3a5f; background: transparent !important; vertical-align: 2px; }
.hour-metrics .spark { grid-column: 1 / -1; display: flex; align-items: end; gap: 4px; height: 42px; padding: 4px 2px; }
.spark span { flex: 1; background: var(--navy); min-height: 4px; }
.hour-scroll { overflow-x: auto; margin-top: 6px; border: 1px solid #8ea0b4; }
.hour-table { width: 100%; min-width: 640px; border-collapse: collapse; }
.hour-table th, .hour-table td {
  padding: 12px 14px;
  border-right: 1px solid #d5dee8;
  border-bottom: 1px solid #d5dee8;
  text-align: left;
  vertical-align: middle;
}
.hour-table th:last-child, .hour-table td:last-child { border-right: 0; }
.hour-table tbody tr:last-child td { border-bottom: 0; }
.hour-table thead th {
  background: #e8eef6;
  border-bottom: 2px solid #1e3a5f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1e3a5f;
}
.hour-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 16px; }
.hour-table td strong { display: block; font-size: 16px; }
.hour-table td span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.hour-table .team-flag.is-off {
  display: inline-block;
  margin-top: 6px;
  color: #8b2e2e;
  background: #f4e6e6;
  border: 1px solid #e2c8c8;
  font-size: 11px;
}
.hour-table tbody tr { cursor: pointer; }
.hour-table tbody tr:hover { background: #f4f7fb; }
.hour-table tr.is-open, .hour-table tr.is-open:hover { background: #e8eef6; }
.hour-table td.sup25 { color: #1d5962; font-weight: 700; }
.hour-table td.sup50 { color: #3a4570; font-weight: 700; }
.hour-table tfoot td {
  background: #e8eef6;
  border-top: 2px solid #1e3a5f;
  border-bottom: 0;
  padding: 12px 14px;
  font-size: 16px;
  font-weight: 700;
  color: #1e3a5f;
}
.hour-table tfoot td span {
  display: block;
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4d6278;
}
.hour-table tfoot td strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #1e3a5f;
}
.hour-table tfoot td.num {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: #1e3a5f;
}
.hour-table tfoot td.sup25 { color: #1d5962; }
.hour-table tfoot td.sup50 { color: #3a4570; }
.hour-table tr.hour-detail { cursor: default; background: #f7f9fc; }
.hour-table tr.hour-detail:hover { background: #f7f9fc; }
.hour-table tr.hour-detail > td { padding: 6px 18px 14px; border-bottom: 0; }
.hour-fold { max-width: 680px; }
.hour-fold > p { margin: 12px 0; color: var(--muted); font-size: 14px; }
.hour-week { margin-top: 10px; }
.hour-week header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 6px;
  border-bottom: 1px solid #c5d0dc;
}
.hour-table .hour-week .week-no { display: inline-flex; margin: 0; flex: none; }
.hour-table .hour-week header strong {
  display: inline;
  font-size: 15px;
  font-weight: 600;
  color: #1e3a5f;
  white-space: nowrap;
}
.hour-table .hour-week header b {
  margin-left: auto;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1e3a5f;
  white-space: nowrap;
}
.hour-day {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 64px auto;
  align-items: center;
  column-gap: 16px;
  padding: 7px 0;
  border-bottom: 1px solid #e4ebf3;
  font-size: 14px;
}
.hour-week .hour-day:last-child { border-bottom: 0; }
.hour-table .hour-day .day-when {
  display: inline;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e3a5f;
  white-space: nowrap;
}
.hour-table .hour-day .day-slot {
  display: inline;
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
}
.hour-day .day-slot i {
  margin-left: 8px;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}
.hour-day .day-count {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hour-day .text-btn { justify-self: end; font-size: 14px; font-weight: 700; text-decoration: none; }
.hour-day .text-btn:hover { text-decoration: underline; }
.hour-person { border-top: 1px solid var(--line); padding: 16px 0; }
.hour-person h3 { margin: 0 0 4px; font-size: 16px; }
.hour-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.hour-base { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.hour-base .field { margin: 0; width: 120px; }
.hour-person .docs { margin-top: 8px; }
@media (max-width: 800px) {
  .hours-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .hour-day { grid-template-columns: 92px minmax(0, 1fr) 48px auto; column-gap: 8px; }
  .leave-head { flex-direction: column; align-items: stretch; }
  .leave-head strong { font-size: 34px; }
  #suivi .hours-title { flex: none; }
  .team-tools { flex-direction: column; align-items: stretch; }
  .team-tools .btn-primary { width: 100%; }
  .leave-counts { width: 100%; }
  .leave-counts .hour-card { flex: 1; min-width: 0; }
  .hours-head #hoursLabel,
  .leave-head #hoursLabel,
  .hours-head #weekLabel { font-size: 34px; }
  .hour-tools { flex-direction: column; align-items: stretch; }
  .hour-tools .month-switch,
  .hour-tools > .btn { width: 100%; }
  .plan-tools { flex-wrap: wrap; }
  .plan-switch { flex: 1 1 100%; }
  .hours-tools { width: 100%; }
  .month-switch { flex: 1; min-width: 0; }
  .hours-jump { width: auto; flex: 1; }
  .hour-totals, .hour-metrics { grid-template-columns: 1fr 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-wide { grid-column: auto; }
}

.plan-panel { overflow: visible; }
.hours-head #weekLabel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: #1e3a5f;
}
.hours-head #weekLabel .week-no,
.hours-head #weekLabel .now-badge {
  flex: none;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
}
#planning .hours-head { flex-wrap: wrap; align-items: flex-end; }
#planning .hours-title { flex: 1 1 320px; }
.plan-tools { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
.plan-switch { height: 42px; max-width: 100%; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.view-switch { display: inline-flex; margin-bottom: 8px; }
.view-switch .btn { min-height: 40px; border-radius: 0; margin-left: -1px; }
.view-switch .btn:first-child { margin-left: 0; border-radius: 2px 0 0 2px; }
.view-switch .btn:last-child { border-radius: 0 2px 2px 0; }
.view-switch .btn.on { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.plan-switch .view-switch {
  display: flex;
  margin: 0;
  border-left: 1px solid #d5dee8;
  border-right: 1px solid #d5dee8;
}
.plan-switch .view-switch .btn {
  width: auto;
  min-width: 72px;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  border-left: 1px solid #d5dee8;
  background: transparent;
  color: #1e3a5f;
}
.plan-switch .view-switch .btn:first-child { border-left: 0; }
.plan-switch .view-switch .btn.on { background: #1e3a5f; color: #fff; }
.day-pick.focus { box-shadow: inset 0 0 0 2px #8ea0b8; }
.shift-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid #8ea0b4;
  background: #f7f9fc;
}
.shift-form[hidden] { display: none !important; }
.shift-line { display: grid; grid-template-columns: 1.6fr 0.7fr 0.7fr 1.2fr; gap: 8px; align-items: end; }
.shift-form .field, .shift-edit .field { margin: 0; }
.day-picks, .plan-actions, .shift-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.day-pick {
  min-height: 40px;
  min-width: 72px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}
.day-pick.on { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }
.plan-actions { justify-content: flex-end; margin: 0 0 12px; }
.plan-actions .btn, .plan-actions .btn-primary {
  grid-column: auto;
  width: auto;
  height: 42px;
  min-height: 42px;
  padding: 0 16px;
}
.shift-edit .btn-primary { grid-column: auto; width: auto; }
.shift-edit {
  margin: 0 0 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.shift-edit[hidden] { display: none !important; }
.shift-edit strong { align-self: center; margin-right: 4px; }
.plan-scroll { overflow-x: auto; margin: 6px 0 18px; border: 1px solid #8ea0b4; background: #fff; }
.plan-grid { display: grid; grid-template-columns: 148px repeat(7, minmax(108px, 1fr)); gap: 0; min-width: 920px; }
.plan-grid > * { border-right: 1px solid #d5dee8; border-bottom: 1px solid #d5dee8; }
.plan-grid > :nth-child(8n) { border-right: 0; }
.plan-name, .plan-day {
  padding: 10px 12px;
  background: #e8eef6;
  border-bottom: 2px solid #1e3a5f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1e3a5f;
}
button.plan-day { border-top: 0; border-left: 0; text-align: left; font: inherit; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.plan-grid > .plan-day.on { background: #1e3a5f; color: #fff; }
.plan-day.today { box-shadow: inset 0 -3px 0 #1e3a5f; }
.day-board { min-width: 640px; }
.day-names, .day-body { display: grid; gap: 6px; }
.day-names { margin-bottom: 6px; }
.day-scale, .day-col { height: 672px; }
.day-hour { height: 48px; box-sizing: border-box; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
.day-col {
  position: relative;
  background-color: #ffffff;
  background-image: repeating-linear-gradient(to bottom, transparent, transparent 47px, #d5dde6 47px, #d5dde6 48px);
}
.day-col .shift { position: absolute; margin: 0; overflow: hidden; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; min-width: 720px; }
.month-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-height: 96px;
  padding: 6px;
  background: #ffffff;
  border-right: 1px solid #d5dee8;
  border-bottom: 1px solid #d5dee8;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.month-cell.out, .month-cell.end { background: #eef3f7; }
.month-cell.on { box-shadow: inset 0 0 0 2px var(--navy); }
.month-cell.today .month-num { background: var(--navy); color: var(--on-navy); }
.month-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; font-size: 12px; font-weight: 600; }
.month-chip { display: block; background: var(--navy); color: var(--on-navy); font-size: 11px; line-height: 1.3; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-more { font-size: 11px; color: var(--muted); }
.month-grid > .plan-day { border-right: 1px solid #d5dee8; }
.month-grid > :nth-child(7n) { border-right: 0; }
#myPlan { overflow-x: auto; }
.portal-card .month-grid { min-width: 640px; }
.plan-cell.end, .month-cell.end { background: #f7f9fc; }
.plan-who { font-size: 15px; font-weight: 600; padding: 12px; color: #1e3a5f; }
.plan-who span { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.plan-cell { min-height: 78px; background: #ffffff; padding: 6px; cursor: pointer; }
.plan-cell.day-col {
  height: 672px;
  min-height: 672px;
  padding: 0;
  background-color: #ffffff;
  background-image: repeating-linear-gradient(to bottom, transparent, transparent 47px, #d5dde6 47px, #d5dde6 48px);
}
.plan-cell.end { background: #eef3f7; }
.plan-cell.over, .month-cell.over { border-color: var(--navy); background: var(--panel); box-shadow: inset 0 0 0 1px var(--navy); }
.mini-row { display: flex; gap: 8px; overflow-x: auto; margin: 4px 0 12px; padding-bottom: 4px; }
.mini-card {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-width: 168px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid #8ea0b4;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.mini-card strong, .mini-card span { display: block; }
.mini-card span { color: var(--muted); font-size: 12px; }
.mini-card .avatar { width: 32px; height: 32px; font-size: 12px; color: var(--on-navy); }
.mini-ghost { width: auto; min-width: 168px; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(26, 35, 50, 0.45);
}
.modal[hidden] { display: none !important; }
.modal-card { width: min(440px, 100%); background: var(--paper); border: 1px solid var(--line); padding: 18px; }
.modal-card h2 { margin: 0 0 4px; text-transform: none; letter-spacing: 0; }
.confirm-when { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.confirm-slot {
  margin: 2px 0 6px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 28px;
  line-height: 1.15;
  color: var(--navy);
}
.hour-confirm { width: min(480px, 100%); }
.confirm-cards { grid-template-columns: 1fr 1fr; margin: 12px 0 4px; }
.confirm-cards .is-span { grid-column: 1 / -1; }
.hour-card .sup-row { margin-top: 8px; }
.assign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.assign-grid .field { margin: 0; }
.assign-grid .wide { grid-column: 1 / -1; }
.modal-card .fiche-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal-card .btn-primary { grid-column: auto; width: auto; }
.cell-plus { display: block; color: #8ea0b4; font-size: 18px; line-height: 70px; text-align: center; pointer-events: none; }
.plan-cell.leave {
  background: #d7eadc;
  padding: 0;
}
.plan-cell.day-col.leave {
  background: #d7eadc;
  background-image: none;
}
.leave-chip, .leave-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  height: 100%;
  background: transparent;
  color: var(--navy);
  border: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px;
  margin: 0;
}
.leave-banner {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: #d7eadc;
}
.month-chip.leave { background: #d7eadc; color: var(--navy); }
.spark span.off { background: #b7c6d4; }
.shift { position: relative; background: var(--navy); color: var(--on-navy); padding: 6px 18px 6px 8px; margin-bottom: 4px; font-size: 12px; line-height: 1.3; cursor: grab; touch-action: none; user-select: none; }
.shift-len { opacity: 0.75; }
.shift-x {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  cursor: pointer;
  font-size: 16px;
  line-height: 22px;
  padding: 0;
}
.shift-ghost { position: fixed; z-index: 40; pointer-events: none; width: 110px; opacity: 0.92; }
.shift-ghost.mini-ghost { width: auto; min-width: 168px; background: var(--panel); }
.portal-card h2 { margin-top: 22px; }
#portalPlanning, #portalHours, #portalLeave, #portalDocs { scroll-margin-top: 76px; }

@media (max-width: 1180px) {
  :root { --side: 212px; }
  .staff-create, .fiche-grid { grid-template-columns: 1fr 1fr; }
  .shift-line { grid-template-columns: 1fr 1fr; }
  .day-pick, .plan-actions .btn, .plan-actions .btn-primary, .shift-edit .btn, .shift-edit .btn-primary { min-height: 44px; }
}

@media (max-width: 800px) {
  :root { --side: 18px; }
  .topbar { padding: 12px 16px; }
  .workspace { padding: 16px 12px 36px; }
  .workspace-grid { grid-template-columns: 1fr; }
  .staff-create, .fiche-grid, .shift-line { grid-template-columns: 1fr; }
  .gate { background: #d5dee8; }
  .edge-rail {
    display: block;
    position: absolute;
    z-index: 3;
    top: 0;
    bottom: 0;
    left: 0;
    width: 18px;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
  }
  .edge-rail span {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--navy);
  }
  .rail-dot {
    position: absolute;
    top: 18px;
    left: 8px;
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: #8f3d3d;
  }
  .edge-nav { width: 18px; }
  .edge-nav.open { width: 240px; }
  .edge-drawer {
    width: 240px;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }
  .edge-nav.open .edge-drawer {
    transform: none;
    box-shadow: 16px 0 40px rgba(20, 38, 61, 0.22);
  }
  body[data-space="salarie"] .edge-nav.open { width: 240px; }
  body[data-space="salarie"] .module-index {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0 8px;
  }
  body[data-space="salarie"][data-module] .module-index { display: none; }
  body[data-space="salarie"] .portal-module { display: none; }
  body[data-space="salarie"][data-module="portalPlanning"] #modPlanning,
  body[data-space="salarie"][data-module="portalHours"] #modHours,
  body[data-space="salarie"][data-module="portalLeave"] #modLeave,
  body[data-space="salarie"][data-module="portalDocs"] #modDocs { display: block; }
  body[data-space="salarie"][data-module] #portalName,
  body[data-space="salarie"][data-module] #portalPoste { display: none; }
  body[data-space="salarie"][data-module] .top-back { display: inline-flex; }
}

@media print {
  body { background: #fff; padding-left: 0 !important; }
  .editor, .preview-head, .toast, noscript, .gate, .topbar, .workspace, .edge-nav { display: none !important; }
  .app { display: block !important; }
  body[data-space="equipe"] .app,
  body[data-space="planning"] .app,
  body[data-space="suivi"] .app,
  body[data-space="conges"] .app,
  body[data-space="parametres"] .app,
  body[data-space="salarie"] .app { display: none !important; }
  .preview {
    background: #fff !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  .sheet {
    width: auto;
    max-width: none;
    margin: 0;
    border: none;
    box-shadow: none;
    padding: 0;
    color: #000;
    font-size: 11pt;
  }
  .sheet h1 { font-size: 16pt; letter-spacing: 0.08em; }
  .subtitle { font-size: 12pt; }
  .ref, .stamp { font-size: 10pt; color: #000; }
  .party p, .alias, .art p {
    font-size: 11pt !important;
    line-height: 1.45 !important;
    text-align: justify !important;
    hyphens: auto;
    color: #000;
  }
  .accord, .done {
    text-align: center !important;
    font-size: 11pt !important;
    color: #000;
  }
  .art h3, .party h2, .doc-between { font-size: 12pt; color: #000; }
  .art h3 { margin: 11pt 0 4pt; }
  .facts { font-size: 10.5pt; break-inside: avoid; }
  .facts th, .facts td { display: table-cell; width: auto; padding: 5pt 0; border-bottom: 1px solid #ddd; }
  .facts th { width: 34%; background: transparent !important; }
  .mast { break-inside: avoid; }
  .signs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10mm !important;
  }
  .sign { min-height: 36mm; }
  .sign-space { height: 22mm; }
  .legal { font-size: 8pt !important; color: #222 !important; }
  @page { size: A4; margin: 18mm 18mm 18mm; }
}
@media (max-width: 800px) {
  .hours-head #weekLabel { font-size: 34px; }
  #planning .plan-tools { display: grid; grid-template-columns: 1fr; justify-content: stretch; width: 100%; }
  #planning .plan-switch {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    width: 100%;
    height: 42px;
  }
  #planning .plan-switch .view-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
  #planning .plan-switch .view-switch .btn { min-width: 0; width: 100%; padding: 0 4px; }
  #planning .plan-tools > .btn { width: 100%; }
}
