/* Layout : registre du jour — une colonne d'heures façon registre, un volet résumé à droite (empilé sur mobile) */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --ink: #15203a;
  --muted: #5a6580;
  --line: #dbe1eb;
  --accent: #2348c4;
  --accent-soft: #e4eaff;
  --accent-ink: #ffffff;
  --now: #c3343c;
  --ok: #1b7549;
  --ok-soft: #dff3e8;
  --warn: #9a5b0c;
  --warn-soft: #fbefd9;
  --c0: #6b7385; --c1: #2a6fb8; --c2: #6a4bc4; --c3: #1f8a6b; --c4: #c0457a; --c5: #4a5468; --c6: #b06a12; --c7: #c62828; --c8: #c85000; --c9: #8f7300; --c10: #4a8420; --c11: #0b8596; --c12: #3a52c9; --c13: #8a5a3c; --c14: #ad3399;
  --shadow: 0 1px 2px rgba(21,32,58,.06), 0 4px 16px rgba(21,32,58,.06);
  --f-display: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --f-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1320; --surface: #151d2e; --surface-2: #1b2539; --ink: #e5eaf4; --muted: #97a2b9; --line: #263149;
    --accent: #85a2ff; --accent-soft: #1f2b4d; --accent-ink: #0b1220; --now: #ff6f76;
    --ok: #57c592; --ok-soft: #173326; --warn: #e3a64e; --warn-soft: #36290f;
    --c0: #8e97aa; --c1: #6aa8ec; --c2: #a58cf0; --c3: #4fc4a0; --c4: #ee7fae; --c5: #a3adc2; --c6: #e6a25a; --c7: #ff7b7b; --c8: #ff9f5a; --c9: #f0cf4f; --c10: #9bd45f; --c11: #4fd0e0; --c12: #8f9dff; --c13: #c99a78; --c14: #f08ae0;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1320; --surface: #151d2e; --surface-2: #1b2539; --ink: #e5eaf4; --muted: #97a2b9; --line: #263149;
  --accent: #85a2ff; --accent-soft: #1f2b4d; --accent-ink: #0b1220; --now: #ff6f76;
  --ok: #57c592; --ok-soft: #173326; --warn: #e3a64e; --warn-soft: #36290f;
  --c0: #8e97aa; --c1: #6aa8ec; --c2: #a58cf0; --c3: #4fc4a0; --c4: #ee7fae; --c5: #a3adc2; --c6: #e6a25a; --c7: #ff7b7b; --c8: #ff9f5a; --c9: #f0cf4f; --c10: #9bd45f; --c11: #4fd0e0; --c12: #8f9dff; --c13: #c99a78; --c14: #f08ae0;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: none; margin: 0 auto; padding-left: max(clamp(16px, 2.5vw, 40px), env(safe-area-inset-left, 0px)); padding-right: max(clamp(16px, 2.5vw, 40px), env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 650; text-wrap: balance; margin: 0; letter-spacing: -.01em; }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }

/* En-tête */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; padding-top: env(safe-area-inset-top, 0px); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.seal { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); display: grid; place-items: center; font-family: var(--f-display); font-weight: 650; font-size: 14px; flex: none; }
.logo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; background: #fff; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.brand h1 { font-size: 20px; line-height: 1.15; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.banner { margin-top: 14px; padding: 10px 14px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); font-size: 14px; }

/* Barre de date */
.daybar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding-block: 22px 16px; }
.datenav { display: flex; align-items: center; gap: 10px; min-width: 0; }
.datelabel { min-width: 0; }
.datelabel h2 { font-size: clamp(22px, 4.2vw, 30px); line-height: 1.15; }
.datelabel h2::first-letter { text-transform: uppercase; }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 18px; flex: none; }
.iconbtn:hover { border-color: var(--accent); color: var(--accent); }
.datetools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: 14px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--now); }
.btn.danger.armed { background: var(--now); color: var(--surface); border-color: var(--now); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.big { padding: 12px 18px; font-size: 15px; width: 100%; }
input[type="date"].datepick { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; font-size: 14px; }

/* Grille principale */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 24vw, 420px); gap: clamp(20px, 1.8vw, 32px); align-items: start; padding-bottom: 40px; }
.planning { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.hour { display: grid; grid-template-columns: 74px minmax(0, 1fr); border-top: 1px solid var(--line); min-height: 64px; }
.hour:first-child { border-top: 0; }
.hlabel { padding: 12px 0 0 16px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; border-right: 1px solid var(--line); }
.hour.now .hlabel { color: var(--now); }
.hour.now { background: linear-gradient(90deg, color-mix(in srgb, var(--now) 7%, transparent), transparent 40%); }
.hour.lunch .hlabel::after { content: "pause"; display: block; font-size: 11px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
.hbody { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.add { border: 1px dashed transparent; background: transparent; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.hour:hover .add, .add:focus-visible { border-color: var(--line); color: var(--accent); }
.hour:hover .add:hover { border-color: var(--accent); background: var(--accent-soft); }
.task { --c: var(--c0); text-align: left; border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line)); background: color-mix(in srgb, var(--c) 9%, var(--surface)); border-radius: 8px; padding: 9px 12px 9px 14px; display: grid; gap: 2px; position: relative; min-width: 0; }
.task::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--c); }
.task:hover { border-color: var(--c); }
.t-line { display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: baseline; }
.t-time { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }
.t-cat { font-size: 12.5px; font-weight: 700; color: var(--c); }
.t-title { font-weight: 400; overflow-wrap: anywhere; }
.t-meta { font-size: 13px; color: var(--muted); }
.cont { font-size: 13px; color: var(--muted); padding: 2px 10px; border-left: 3px solid var(--c, var(--line)); }
.h0 { --c: var(--c0); } .h1 { --c: var(--c1); } .h2 { --c: var(--c2); } .h3 { --c: var(--c3); } .h4 { --c: var(--c4); } .h5 { --c: var(--c5); } .h6 { --c: var(--c6); }
.h7 { --c: var(--c7); } .h8 { --c: var(--c8); } .h9 { --c: var(--c9); } .h10 { --c: var(--c10); } .h11 { --c: var(--c11); } .h12 { --c: var(--c12); } .h13 { --c: var(--c13); } .h14 { --c: var(--c14); }

/* Volet */
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.card h3 { font-size: 18px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .l { font-size: 12.5px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.cours { background: var(--accent-soft); color: var(--accent); }
.pill.transmis { background: var(--warn-soft); color: var(--warn); }
.pill.vise { background: var(--ok-soft); color: var(--ok); }
.note { font-size: 13.5px; color: var(--muted); margin: 0; }
.visa { border-left: 3px solid var(--ok); padding: 4px 0 4px 12px; font-size: 14px; }
.visa p { margin: 4px 0 0; white-space: pre-wrap; }

.mixbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.mixbar span { background: var(--c); }
.mixlist { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.mixlist li { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 8px; align-items: center; }
.mixlist li i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

/* Feuille (modale) */
.sheet-back { position: fixed; inset: 0; background: color-mix(in srgb, var(--ink) 40%, transparent); z-index: 20; display: grid; place-items: center; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px)); }
.sheet { background: var(--surface); border-radius: 16px; width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.sheet-head h2 { font-size: 24px; }
.close { border: 0; background: var(--surface-2); width: 34px; height: 34px; border-radius: 50%; font-size: 18px; flex: none; }
form.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .field .lab { font-size: 13px; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 9px 11px; width: 100%; }
.field textarea { min-height: 90px; resize: vertical; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg label { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { color: var(--accent); }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.err { color: var(--now); font-size: 14px; margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.actions .spacer { flex: 1; }

/* Bilan */
.bilan-sec { display: flex; flex-direction: column; gap: 10px; }
.bilan-sec h3 { font-size: 16px; font-family: var(--f-body); font-weight: 700; }
.chrono { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.chrono li { display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.chrono li:first-child { border-top: 0; }
.chrono .ct { font-weight: 700; font-variant-numeric: tabular-nums; }
.chrono .cc { font-weight: 700; color: var(--c); font-size: 13px; }
.chrono p { margin: 2px 0 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.copyarea { width: 100%; min-height: 160px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--bg); font-size: 13px; }

/* Équipe */
.teamhead { display: flex; gap: 10px 20px; flex-wrap: wrap; align-items: baseline; padding-bottom: 14px; }
.teamlist { display: grid; gap: 10px; padding-bottom: 40px; }
.agent { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1.4fr) auto repeat(4, minmax(70px, .6fr)) auto; gap: 10px 18px; align-items: center; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent .stat .v { font-size: 17px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 28px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; font-size: 18px; }

.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.people li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; }
.searchres { display: grid; gap: 6px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 30; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.mobilebar { display: none; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; order: -1; }
  .side .bilan-btn { display: none; }
  .mobilebar.on { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; background: var(--surface); border-top: 1px solid var(--line); padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  body.has-bar main { padding-bottom: 80px; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
  .agent { grid-template-columns: minmax(0, 1fr) auto; }
  .agent .stat { display: none; }
  .agent .agent-sum { display: block; grid-column: 1 / -1; }
}
@media (min-width: 861px) { .agent .agent-sum { display: none; } }
@media (max-width: 520px) {
  .brand h1 { font-size: 18px; }
  .logo { width: 44px; height: 44px; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; padding: 7px 8px; }
  .hour { grid-template-columns: 58px minmax(0, 1fr); }
  .hlabel { padding-left: 10px; }
  form.grid { grid-template-columns: 1fr; }
  .sheet-back { place-items: end center; padding: 0; }
  .sheet { border-radius: 16px 16px 0 0; max-height: 92vh; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
  .chrono li { grid-template-columns: 1fr; gap: 2px; }
  .datetools .datepick { flex: 1; }
}
/* Gestion */
.gestion { grid-template-columns: minmax(0, 1fr) clamp(340px, 26vw, 440px); }
.roster { list-style: none; margin: 0; padding: 0; display: grid; }
.rrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.rrow:first-child { border-top: 0; }
.rmain { min-width: 0; display: flex; flex-direction: column; }
.rmain b { overflow-wrap: anywhere; }
.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .08em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 14px; white-space: nowrap; }
button.code:hover { border-color: var(--accent); color: var(--accent); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.steps b { color: var(--ink); }
.gate { max-width: 460px; margin: 48px auto; }
.gate .code-in { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 22px; letter-spacing: .14em; text-transform: uppercase; text-align: center; }
.chip { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
@media (max-width: 860px) {
  .gestion { grid-template-columns: minmax(0, 1fr); }
  .gestion .side { order: 0; }
  .rrow { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: rise .18s ease-out; }
  @keyframes rise { from { transform: translateY(12px); opacity: .6; } to { transform: none; opacity: 1; } }
}

/* Photo d'équipe (volet de droite, ordinateur seulement) */
.team-photo { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.team-photo img { display: block; width: 100%; height: auto; }
.team-photo figcaption { padding: 10px 14px; font-size: 13px; color: var(--muted); }
@media (max-width: 860px) { .team-photo { display: none; } }
/* « Ma journée » sur ordinateur : l'écran reste fixe ; seuls le planning (à gauche) et la fiche du bilan (à droite) défilent.
   La photo reste en place au-dessus de la fiche. */
@media (min-width: 861px) {
  body.shell { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
  body.shell > header.top, body.shell > #banner { flex: none; }
  body.shell > main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  body.shell > main > .wrap { flex: 1 1 auto; min-height: 0; width: 100%; box-sizing: border-box; display: flex; flex-direction: column; }
  body.shell .layout { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; padding-bottom: 16px; }
  body.shell .leftcol { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 8px; margin-right: -8px; padding-bottom: 8px; }
  body.shell .leftcol > * { flex: none; }
  body.shell .layout > .mine-side { position: static; min-height: 0; max-height: none; overflow: hidden; }
  .mine-side .team-photo { flex: none; }
  .mine-side .team-photo img { max-height: 30vh; }
  .side-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; margin-right: -6px; border-radius: 14px; }
  /* Hors « Ma journée » (ex. Gestion) : la colonne de droite reste collée sous l'en-tête et défile seule. */
  .layout > .side:not(.mine-side) { top: calc(var(--top-h, 120px) + 12px); max-height: calc(100vh - var(--top-h, 120px) - 24px); overflow-y: auto; overscroll-behavior: contain; }
  /* Barres de défilement bleues, toujours visibles */
  .layout > .side, .side-scroll, body.shell .leftcol { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 55%, transparent) transparent; }
  .layout > .side::-webkit-scrollbar, .side-scroll::-webkit-scrollbar, body.shell .leftcol::-webkit-scrollbar { width: 8px; }
  .layout > .side::-webkit-scrollbar-track, .side-scroll::-webkit-scrollbar-track, body.shell .leftcol::-webkit-scrollbar-track { background: transparent; }
  .layout > .side::-webkit-scrollbar-thumb, .side-scroll::-webkit-scrollbar-thumb, body.shell .leftcol::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 8px; }
  .layout > .side::-webkit-scrollbar-thumb:hover, .side-scroll::-webkit-scrollbar-thumb:hover, body.shell .leftcol::-webkit-scrollbar-thumb:hover { background: var(--accent); }
}



/* Types de tâches personnels */
.labrow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 700; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); vertical-align: -1px; margin-right: 8px; }
.typerow { grid-template-columns: minmax(0, 1fr) auto; }
.seg.hues label { padding: 6px 8px; }
.seg.hues .dot { margin: 0; width: 18px; height: 18px; }

/* À reprendre */
.todo-list { display: grid; gap: 22px; padding-bottom: 40px; max-width: 1100px; }
.todo-day { display: grid; gap: 8px; }
.todo-day h3 { font-size: 17px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.todo-date::first-letter { text-transform: uppercase; }
.todo-day h3 .note { font-family: var(--f-body); font-weight: 400; }
.todo-item { cursor: default; }
.todo-item:hover { border-color: color-mix(in srgb, var(--c) 35%, var(--line)); }
.todo-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.todo-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 6px; }

/* Reste à faire */
.leftcol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bell { flex: none; vertical-align: -3px; }
.reminders { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line)); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.rem-head { display: flex; align-items: center; gap: 8px; color: var(--warn); flex-wrap: wrap; }
.rem-head b { font-size: 16px; }
.rem-item { --c: var(--c0); display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 10px; padding: 10px 12px; }
.rem-when { font-weight: 700; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; }
.rem-body { min-width: 0; overflow-wrap: anywhere; }
.rem-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
fieldset.rappel { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 14px; margin: 0; gap: 10px; background: var(--surface-2); }
fieldset.rappel legend { font-size: 13px; font-weight: 700; color: var(--warn); padding: 0 6px; display: flex; align-items: center; gap: 6px; }
fieldset.rappel .note { margin: 0; }
@media (max-width: 860px) { .rem-item { grid-template-columns: minmax(0, 1fr); } .rem-actions { justify-content: flex-start; } }

.t-reste { display: block; margin-top: 6px; padding: 7px 10px; border-radius: 6px; background: var(--warn-soft); color: var(--ink); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.t-reste b { color: var(--warn); }
.reste-text { margin: 4px 0; white-space: pre-wrap; }
fieldset.rappel textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 9px 11px; width: 100%; min-height: 80px; resize: vertical; }

/* Temps de travail */
.horaire { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 10px; background: var(--surface-2); }
.h-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.h-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px 12px; margin: 0; }
.h-grid dt { font-size: 12.5px; color: var(--muted); }
.h-grid dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.horaire .note { margin: 0; }
.ecart-cours { color: var(--accent); }
.ecart-transmis { color: var(--warn); }
.ecart-vise { color: var(--ok); }

.cumul-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cumul-row > div { display: flex; flex-direction: column; min-width: 0; }
.cumul-v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cumul-mini { margin-top: 2px; white-space: nowrap; }

/* Résumés jour / semaine / mois */
.recap-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.recap-body { display: flex; flex-direction: column; gap: 16px; }
.table-wrap { overflow-x: auto; }
table.recap { width: 100%; border-collapse: collapse; font-size: 14px; }
table.recap th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.recap td { padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.recap tr.is-conge td { color: var(--muted); }
.recap-day { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.recap-day + .recap-day { margin-top: 8px; }
.recap-day summary { cursor: pointer; font-size: 14px; }
.recap-day summary b::first-letter { text-transform: uppercase; }
.print-opt { display: inline-flex; align-items: center; gap: 6px; }
.pill.conge { background: var(--accent-soft); color: var(--c2); }
.pill.conge::before { background: currentColor; }
.conge-banner { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--c2) 40%, var(--line)); color: var(--ink); border-radius: 12px; padding: 12px 16px; font-size: 14.5px; }
.conge-banner b { color: var(--c2); }

/* Recherche */
.searchbar { display: flex; gap: 8px; margin: -4px 0 16px; max-width: 760px; }
.searchbar input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 12px; }
.search-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.search-results .task { width: 100%; }

/* Congés */
.cg-list { list-style: none; margin: 0; padding: 0; display: grid; }
.cg-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto auto auto; gap: 8px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.cg-item:first-child { border-top: 0; }
.cg-item.mine .cg-who b { color: var(--accent); }
.cg-who, .cg-when { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.cg-today { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-cg { background: var(--accent-soft); border-radius: 999px; padding: 5px 12px; font-size: 14px; }

/* Messages */
.msg-layout { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; padding-bottom: 40px; }
.conv-list { padding: 8px; gap: 4px; }
.conv { position: relative; text-align: left; border: 0; background: transparent; border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; width: 100%; }
.conv:hover { background: var(--surface-2); }
.conv.active { background: var(--accent-soft); }
.conv.unread .conv-last { color: var(--ink); font-weight: 700; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding-right: 26px; }
.conv-last { font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.badge { position: absolute; top: 10px; right: 10px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; min-width: 20px; height: 20px; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.msg-pane { min-height: 320px; }
.msg-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; padding: 4px 2px; }
.bubble { max-width: min(560px, 85%); border-radius: 14px; padding: 9px 13px; display: grid; gap: 3px; }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble .note { font-size: 12px; }
.bubble.them { background: var(--surface-2); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.me { background: var(--accent-soft); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; border-top: 1px solid var(--line); padding-top: 12px; }
.msg-compose textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 9px 11px; width: 100%; resize: vertical; }
.msg-compose .err { grid-column: 1 / -1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 860px) {
  .msg-layout { grid-template-columns: minmax(0, 1fr); }
  .cg-item { grid-template-columns: minmax(0, 1fr) auto; }
  .cg-item .cg-when { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .tabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .tabs button { flex: none; white-space: nowrap; }
}

/* Impression : seule la zone #printArea est imprimée, en noir sur blanc.
   Les styles « .paper » servent à la fois à l'impression et à l'aperçu à l'écran. */
#printArea { display: none; }
.paper { font-size: 11pt; background: #fff; color: #111;
  --bg: #fff; --surface: #fff; --surface-2: #f2f3f5; --ink: #111; --muted: #555; --line: #c9ced8;
  --accent: #1d3fb0; --accent-soft: #e9eefc; --ok: #1b6b42; --ok-soft: #e3f3ea; --warn: #8a5200; --warn-soft: #fbf0dc; --now: #a3222a;
  --c0: #555; --c1: #1f5fa8; --c2: #5a3cb0; --c3: #1c7a5e; --c4: #a83a6a; --c5: #3d4658; --c6: #94570b; --c7: #a51f1f; --c8: #a84300; --c9: #6f5900; --c10: #3a6c16; --c11: #086b78; --c12: #2c41a8; --c13: #6e4630; --c14: #8c2a7c; }
.paper .print-head { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid #111; padding-bottom: 6px; margin-bottom: 10px; }
.paper .print-head img { width: 40px; height: 40px; border-radius: 50%; }
.paper .print-title { font-family: var(--f-display); font-size: 15pt; font-weight: 650; }
.paper .print-meta { margin-left: auto; text-align: right; font-size: 9.5pt; }
.paper .print-h1 { font-family: var(--f-display); font-size: 13pt; margin: 0 0 8px; }
.paper .print-foot { margin-top: 12px; font-size: 8.5pt; color: #555; border-top: 1px solid #ccc; padding-top: 4px; }
.paper .stats { display: grid; grid-template-columns: repeat(3, 1fr) !important; gap: 6px; margin-bottom: 8px; }
.paper .bilan-sec, .paper .horaire, .paper table.recap tr { break-inside: avoid; }
.paper .bilan-sec { margin-top: 10px; }
.paper .bilan-sec h3 { font-size: 11.5pt; }
.paper .mixbar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.paper .pill { border: 1px solid currentColor; }
.paper .syn { border: 1px solid #ccc; }
/* Détail compact : une ligne par tâche */
.paper .print-detail { display: block; margin-top: 10px; }
.paper .print-detail h3 { margin: 0 0 4px; }
.paper table.pd { width: 100%; border-collapse: collapse; font-size: 8.5pt; line-height: 1.25; }
.paper table.pd th, .paper table.pd td { text-align: left; vertical-align: top; padding: 1.5pt 4pt; border-bottom: 0.5pt solid #d5d9e0; }
.paper table.pd thead th { font-size: 8pt; color: #555; border-bottom: 1pt solid #111; }
.paper table.pd thead { display: table-header-group; }
.paper table.pd tr { break-inside: avoid; }
.paper table.pd .pd-h { white-space: nowrap; font-variant-numeric: tabular-nums; width: 1%; }
.paper table.pd .pd-c { white-space: nowrap; width: 1%; font-weight: 700; color: var(--c); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.paper table.pd .pd-n { color: #555; font-style: italic; }
.paper table.pd tr.pd-day th { background: #eef0f4; font-size: 8.5pt; padding-top: 3pt; border-bottom: 1pt solid #888; break-after: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.paper table.pd tr.pd-day th::first-letter { text-transform: uppercase; }

/* Aperçu avant impression */
.pv-back { position: fixed; inset: 0; z-index: 25; background: #6b7280; display: flex; flex-direction: column; }
.pv-back[hidden] { display: none; }
.pv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.pv-bar .spacer { flex: 1; }
.pv-scroll { flex: 1; overflow: auto; padding: 20px 16px 40px; }
.pv-page { position: relative; width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; padding: 10mm; box-sizing: border-box; box-shadow: 0 6px 24px rgba(0,0,0,.35);
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--pv-step, 277mm) - 2px), #e11d48 calc(var(--pv-step, 277mm) - 2px), #e11d48 var(--pv-step, 277mm)) content-box, #fff; }

@media print {
  @page { margin: 10mm; }
  body > *:not(#printArea) { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
  #printArea { display: block !important; }
}

/* Résumé synthétique */
.syn { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 15px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.syn b { font-variant-numeric: tabular-nums; }
.chrono.compact li { grid-template-columns: 96px minmax(0, 1fr); padding: 6px 0; }
.chrono.compact .cl { min-width: 0; overflow-wrap: anywhere; }
.chrono.compact .t-reste { margin-top: 4px; }
details.recap-detail > summary { cursor: pointer; padding: 4px 0; }

.danger-zone { border: 1px solid color-mix(in srgb, var(--now) 45%, var(--line)); border-radius: 10px; padding: 12px 14px; gap: 8px; }
.danger-zone > b { color: var(--now); }
.danger-zone .note { margin: 0; }

/* Compte et connexion */
[hidden] { display: none !important; }
img { max-width: 100%; }
.account { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account .who-me { font-size: 13.5px; color: var(--muted); }
.account .who-me b { color: var(--ink); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.login { max-width: 420px; margin: 56px auto; }
.login form { display: grid; gap: 14px; }
.pwrow { display: flex; gap: 8px; }
.pwrow input { flex: 1; min-width: 0; }
.muted-row { opacity: .6; }
@media (max-width: 520px) { .account { width: 100%; justify-content: space-between; } }
.agent-name { padding: 0; text-align: left; font: inherit; color: inherit; }
.agent-name:hover b { text-decoration: underline; }
.print-what { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 8px 10px; max-width: 100%; }
.seg label[hidden] { display: none; }

/* Formulaire de tâche : intitulés en couleur pour mieux s'y retrouver (Fin en rouge, le reste en vert) */
#taskForm .field > label[for]:not(.note), #taskForm .field > .lab, #taskForm .labrow > label { color: var(--ok); }
#taskForm .field > label[for="fEnd"]:not(.note) { color: var(--now); }

/* ===== Effets des boutons : survol (soulèvement + ombre) et clic (enfoncement + onde) ===== */
@media (prefers-reduced-motion: no-preference) {
  .btn, .iconbtn, .tabs button, .task, .add, .close, .seg label, .linkbtn, button.code, .conv, .seg.hues .dot {
    transition: transform .16s cubic-bezier(.2,.8,.3,1.2), box-shadow .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease, filter .16s ease;
  }
  .btn, .tabs button, .task, .iconbtn { position: relative; overflow: hidden; }
  @media (hover: hover) {
    .btn:not(:disabled):hover, .iconbtn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--accent) 55%, transparent); background-color: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
    .btn.primary:not(:disabled):hover { background-color: var(--accent); box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--accent) 75%, transparent); }
    .btn.danger:not(:disabled):hover { border-color: var(--now); background-color: color-mix(in srgb, var(--now) 8%, var(--surface)); box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--now) 55%, transparent); }
    .tabs button:hover:not([aria-selected="true"]) { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--ink); transform: translateY(-1px); }
    .task:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--c) 60%, transparent); }
    .seg label:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-1px); }
    .seg.hues label:hover { transform: none; }
    .seg.hues label:hover .dot { transform: scale(1.25); }
    .close:hover { transform: rotate(90deg); background: color-mix(in srgb, var(--now) 15%, var(--surface-2)); color: var(--now); }
    .linkbtn:hover { text-underline-offset: 4px; filter: brightness(1.15); }
    .add:hover { transform: translateX(3px); }
  }
  .btn:not(:disabled):active, .iconbtn:active { transform: translateY(0) scale(.96); box-shadow: none; transition-duration: .06s; }
  .tabs button:active, .seg label:active { transform: scale(.94); transition-duration: .06s; }
  .task:active { transform: scale(.985); box-shadow: none; transition-duration: .06s; }
  .close:active { transform: rotate(90deg) scale(.85); }
  .add:active, .linkbtn:active { transform: scale(.96); }
  /* Onde lumineuse au point de clic */
  .ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .28; transform: scale(0); animation: ripple .55s ease-out forwards; }
  .btn.primary .ripple { background: #fff; opacity: .45; }
  @keyframes ripple { to { transform: scale(1); opacity: 0; } }
}
.photo-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.photo-pick { cursor: pointer; }
.team-photo img { aspect-ratio: 900 / 587; object-fit: cover; }

/* Plein écran sur Mac : laisser la place à la barre d'outils de Safari qui se superpose en haut */
html.fs header.top { padding-top: 44px; }
