#organizationChart { display: block; min-width: 0; }
.org-chart-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 14px; }
.org-chart-tools button { width: 34px; height: 34px; border: 1px solid #c6dce7; border-radius: 4px; background: white; font-size: 22px; color: #173c50; cursor: pointer; }
.org-chart-tools input { width: 120px; }
.org-chart-tools output { min-width: 44px; font-size: 12px; }
.leave-timeline + details .approval-stages { grid-template-columns: 1fr; padding: 10px 0; }
.org-chart-scroll { overflow: auto; max-height: 76vh; border: 1px solid var(--line); background: #f8fbfc; padding: 28px 18px; }
.org-chart-tree { display: flex; width: max-content; min-width: 100%; justify-content: center; gap: 32px; }
.org-tree-branch, .org-tree-leaf { position: relative; min-width: 0; margin: 0; text-align: center; }
.org-tree-branch > summary { position: relative; list-style: none; cursor: pointer; width: 240px; margin: 0 auto; }
.org-tree-branch > summary::-webkit-details-marker { display: none; }
.org-tree-children { display: flex; align-items: flex-start; gap: 20px; padding: 34px 8px 0; position: relative; }
.org-tree-children::before { content: ''; position: absolute; height: 34px; width: 1px; background: #9cb4c3; top: 0; left: 50%; }
.org-tree-children > *::before { content: ''; position: absolute; height: 18px; border-top: 1px solid #9cb4c3; top: -18px; left: -10px; right: -10px; }
.org-tree-children > *::after { content: ''; position: absolute; height: 18px; width: 1px; background: #9cb4c3; top: -18px; left: 50%; }
.org-tree-children > :first-child::before { left: 50%; }
.org-tree-children > :last-child::before { right: 50%; }
#organizationChart .org-person { display: flex; align-items: center; text-align: left; width: 240px; min-height: 104px; padding: 14px; gap: 10px; box-sizing: border-box; border: 1px solid #c6dce7; border-top: 3px solid #149d8b; background: white; border-radius: 6px; box-shadow: 0 3px 10px #16394b08; }
#organizationChart .org-manager { border-top-color: #007eaf; background: #edf7fc; }
#organizationChart .org-level-director { background: #dceaf7; border-top-color: #3c6a9c; }
#organizationChart .org-level-responsible { background: #edf7fc; border-top-color: #007eaf; }
#organizationChart .org-level-team_lead { background: #eef7ef; border-top-color: #438853; }
#organizationChart .org-person > div { min-width: 0; overflow-wrap: anywhere; }
#organizationChart .org-person b { display: block; font-size: 13px; line-height: 1.4; color: #173c50; }
#organizationChart .org-position { display: block; font-size: 12px; line-height: 1.4; font-weight: 600; margin-bottom: 6px; color: #476777; }
#organizationChart .employee-photo { flex: 0 0 34px; width: 34px; height: 34px; background-size: cover; background-position: center; }
.org-node-department { display: block; font-size: 11px; color: var(--muted); max-width: 240px; margin: 5px auto 0; overflow-wrap: anywhere; }
.org-team-count { display: inline-block; font-size: 11px; color: #476777; padding: 3px 8px; background: #e5eff3; margin-top: 5px; border-radius: 4px; }
.org-team-members { flex-direction: column; align-items: center; gap: 12px; }
.org-direct-members { position: relative; display: flex; flex-direction: column; gap: 12px; width: 240px; }
.org-team-members > *::before, .org-team-members > *::after { display: none; }
.org-unassigned { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; }
.org-unassigned > summary { cursor: pointer; font-weight: 600; color: #806123; }
.org-unassigned-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 14px; margin-top: 18px; }
.approval-case { border-bottom: 1px solid var(--line); }
#requests > .page-head { position: static; }
.approval-stages { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 20px 28px 28px; gap: 0; list-style: none; margin: 0; background: #fbfdfe; border-top: 1px solid #edf2f5; }
.approval-stages:empty { display: none; }
.approval-stages li { position: relative; min-width: 0; padding: 0 16px 0 0; overflow-wrap: anywhere; }
.approval-stages li:not(:last-child)::after { content: ''; position: absolute; height: 2px; background: #dce6ec; top: 17px; left: 42px; right: 8px; }
.approval-step-marker { display: grid; place-items: center; width: 36px; height: 36px; box-sizing: border-box; border: 1px solid #cbdbe5; border-radius: 50%; background: #f0f5f8; color: #718596; font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.approval-step-content { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.approval-stages strong { font-size: 13px; line-height: 1.5; color: #234659; }
.approval-step-person { display: block; font-size: 13px; line-height: 1.5; color: #526c7c; }
.approval-step-status { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 11px; line-height: 1.5; font-weight: 600; color: #667d8c; background: #edf2f5; }
.approval-step-date { font-size: 11px; line-height: 1.5; color: #718596; }
.stage-approved .approval-step-marker { background: #16876d; border-color: #16876d; color: white; }
.approval-stages li.stage-approved::after { background: #90cdbd; }
.stage-approved .approval-step-status { color: #14755e; background: #e4f4ee; }
.is-current .approval-step-marker { background: #007fba; color: white; border-color: #007fba; box-shadow: 0 0 0 4px #e3f2fa; }
.is-current .approval-step-status { background: #e3f2fa; color: #006b9c; }
.is-unassigned .approval-step-status,.stage-bypassed .approval-step-status { color: #90671c; background: #fff3d9; }
.stage-rejected .approval-step-marker { background: #bf4949; border-color: #bf4949; color: white; }
.stage-rejected .approval-step-status { background: #fdecec; color: #a43838; }
.leave-timeline + details .approval-stages li { padding: 0 0 18px 48px; min-height: 60px; }
.leave-timeline + details .approval-step-marker { position: absolute; left: 0; top: 0; }
.leave-timeline + details .approval-stages li::after { left: 17px; top: 42px; bottom: 6px; width: 2px; height: auto; }
@media (max-width: 700px) {
  .approval-stages { grid-template-columns: 1fr; padding: 22px 18px 8px; }
  .approval-stages li { padding: 0 0 24px 50px; min-height: 64px; }
  .approval-step-marker { position: absolute; left: 0; top: 0; }
  .approval-stages li:not(:last-child)::after { left: 17px; top: 42px; bottom: 7px; height: auto; width: 2px; }
}
@media (max-width: 600px) { .org-chart-scroll { max-height: 65vh; padding: 18px 10px; } }
@media (max-width: 600px) {
  .org-chart-tree { display: block; width: 100%; }
  .org-tree-children { flex-direction: column; align-items: stretch; gap: 14px; margin-left: 4px; padding: 16px 0 0 7px; border-left: 1px solid #9cb4c3; }
  .org-tree-children::before,.org-tree-children > *::before,.org-tree-children > *::after { display: none; }
  .org-tree-branch > summary,#organizationChart .org-person,.org-direct-members { width: 100%; }
  .org-unassigned-grid { grid-template-columns: 1fr; }
  .org-node-department { margin-left: 0; text-align: left; }
}
.hierarchy-filters { display:grid; grid-template-columns:2fr 1fr 1fr; gap:16px; padding:20px; border-bottom:1px solid #dce8ee; }
#managerteams > .page-head { position:static; }
#managerteams .manager-team-table { min-width:1050px; }
#managerteams .manager-identity { min-width:190px; }
#managerTeamForm { display:grid; gap:18px; }
#managerTeamChanges:empty { display:none; }
#managerTeamChanges { color:#855300; background:#fff7e5; padding:12px; border-radius:6px; }
@media (max-width:700px) { .hierarchy-filters { grid-template-columns:1fr; } }
.content > #settings.view > .page-head { position:relative; top:auto; }
.shift-settings-layout { display:grid; gap:32px; }
#calendar .calendar-filters { display:grid; grid-template-columns:minmax(180px,1.2fr) minmax(150px,1fr) minmax(150px,1fr) auto; gap:14px; align-items:end; }
#calendar .calendar-filters label { width:auto; min-width:0; margin:0; }
#calendar .calendar-filters label[hidden] { display:none; }
#calendar .calendar-filters .btn { margin:0; }
.calendar-person-history { margin-top:24px; padding-top:24px; border-top:1px solid var(--line); }
.calendar-history-head { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:16px; }
.calendar-history-head h2 { font-size:18px; margin:0; letter-spacing:0; }
.calendar-history-head p { color:var(--muted); margin:6px 0 0; font-size:14px; }
.calendar-history-head > strong { font-size:18px; }
.calendar-history-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:16px; padding:16px 0; border-bottom:1px solid var(--line); font-size:13px; }
.calendar-history-row p { color:var(--muted); margin:6px 0 0; }
@media(max-width:1000px) { #calendar .calendar-filters { grid-template-columns:1fr 1fr; } }
@media(max-width:600px) {
  #calendar .calendar-filters { grid-template-columns:1fr; }
  .calendar-history-head { align-items:flex-start; }
  .calendar-history-row { grid-template-columns:minmax(0,1fr) auto; gap:10px; }
  .calendar-history-row .status { grid-column:1/-1; justify-self:start; }
}
.shift-section { min-width:0; }
.shift-section-head { display:flex; align-items:center; margin:0 0 16px; }
.shift-section-head h3 { margin:0; font-size:18px; letter-spacing:0; }
.shift-config-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.shift-config-card { border:1px solid var(--line); border-radius:8px; padding:20px; display:grid; gap:18px; background:#fff; }
.shift-settings-layout label { margin:0; font-size:13px; line-height:1.4; }
.shift-settings-layout input:not([type=checkbox]) { min-width:0; height:44px; min-height:44px; padding:10px 12px; border-radius:6px; font-size:14px; }
.shift-settings-layout input:focus-visible { outline:2px solid #007fb7; outline-offset:2px; }
.shift-config-title { display:grid; grid-template-columns:4px minmax(0,1fr) auto; gap:12px; align-items:center; }
.shift-color { width:4px; height:44px; border-radius:2px; }
.shift-headcount { align-self:end; padding-bottom:12px; color:var(--muted); font-size:12px; white-space:nowrap; }
.shift-time-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.shift-time-grid fieldset { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; min-width:0; margin:0; padding:0; border:0; }
.shift-time-grid legend { font-size:12px; font-weight:800; color:#006b98; margin-bottom:8px; padding:0; }
.shift-time-grid label { font-size:12px; color:#54697c; }
.shift-config-options { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.shift-settings-layout .shift-active { display:flex; align-items:center; gap:9px; position:relative; cursor:pointer; white-space:nowrap; }
.shift-active input { position:absolute; width:1px; height:1px; opacity:0; margin:0; padding:0; }
.shift-switch-track { position:relative; display:block; flex:none; width:38px; height:22px; background:#8998a4; border-radius:20px; transition:background .15s; }
.shift-switch-track::before { content:''; position:absolute; top:3px; left:3px; width:16px; height:16px; background:#fff; border-radius:50%; transition:transform .15s; }
.shift-active input:checked + .shift-switch-track { background:#087fb3; }
.shift-active input:checked + .shift-switch-track::before { transform:translateX(16px); }
.shift-active input:focus-visible + .shift-switch-track { outline:2px solid #007fb7; outline-offset:3px; }
.shift-settings-layout .shift-grace { display:flex; align-items:center; gap:10px; font-size:12px; }
.shift-grace > span { display:flex; align-items:center; gap:6px; }
.shift-settings-layout .shift-grace input { width:64px; margin:0; }
.shift-grace small { color:var(--muted); font-size:12px; }
.shift-config-footer { display:flex; justify-content:flex-end; padding-top:12px; border-top:1px solid var(--line); }
.shift-settings-layout .btn { min-height:40px; padding:10px 16px; border-radius:6px; font-size:13px; }
.shift-settings-layout .btn:disabled { opacity:.5; cursor:not-allowed; }
.shift-assignment-section { border-top:1px solid var(--line); padding-top:24px; }
.shift-assignment-tools { display:grid; grid-template-columns:1fr 1.2fr 1.4fr; gap:16px; margin-bottom:20px; }
.shift-assignment-tools .ts-wrapper { margin-top:7px; }
.shift-assignment-tools .ts-control { min-height:44px!important; border-radius:6px!important; font-size:14px!important; }
.shift-assignment-tools .ts-wrapper.single .ts-control::after { content:''; display:block; position:absolute; top:50%; right:14px; width:0; height:0; border-style:solid; border-width:5px 4px 0; border-color:#526b67 transparent transparent; pointer-events:none; }
.shift-search { display:flex; align-items:center; gap:8px; margin-top:7px; border:1px solid #cddde3; border-radius:6px; padding-left:12px; background:#fff; }
.shift-search > [data-icon] { color:#6c8190; display:flex; }
.shift-settings-layout .shift-search input { margin:0; border:0; background:transparent; }
.shift-search:focus-within { outline:2px solid #007fb7; outline-offset:2px; }
.shift-search input:focus-visible { outline:none; }
.shift-selection-head { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:12px 14px; border-block:1px solid var(--line); background:#edf5f8; }
.shift-selection-head label { display:flex; align-items:center; gap:10px; cursor:pointer; }
.shift-selection-head > span { font-size:12px; color:#54697c; }
.shift-settings-layout .shift-person input,.shift-selection-head input { width:18px; height:18px; min-height:18px; margin:0; padding:0; flex:none; accent-color:#007fb7; }
.shift-people-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); max-height:430px; overflow:auto; background:#fff; scrollbar-gutter:stable; }
.shift-settings-layout .shift-person { display:grid; grid-template-columns:18px 34px minmax(0,1fr) auto; gap:12px; align-items:center; border-bottom:1px solid var(--line); padding:14px; cursor:pointer; }
.shift-person:nth-child(odd) { border-right:1px solid var(--line); }
.shift-person:hover { background:#f5fafc; }
.shift-person:has(input:checked) { background:#eaf7fc; }
.shift-person:focus-within { outline:2px solid #007fb7; outline-offset:-2px; }
.shift-person .team-avatar { width:34px; height:34px; font-size:11px; }
.shift-person-identity { min-width:0; overflow-wrap:anywhere; }
.shift-person b { font-size:13px; }
.shift-person small { display:block; font-size:11px; line-height:1.5; color:var(--muted); font-weight:400; }
.shift-person-current { max-width:110px; overflow-wrap:anywhere; font-size:11px; font-weight:600; color:#597182; background:#f0f4f6; border-radius:4px; padding:5px 7px; }
.shift-person-current.is-other { color:#845713; background:#fff5df; }
.shift-assignment-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; padding-top:16px; }
#shiftAssignmentChanges { font-size:12px; color:#845713; }
.shift-badge { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.shift-badge::before { content:''; width:8px; height:8px; border-radius:50%; background:var(--shift-color); }
@media (max-width:1100px) { .shift-config-list { grid-template-columns:1fr; } .shift-assignment-tools { grid-template-columns:1fr 1fr; } .shift-assignment-tools > label:last-child { grid-column:1/-1; } }
@media (max-width:700px) {
  .shift-people-list,.shift-assignment-tools { grid-template-columns:1fr; }
  .shift-config-card { padding:16px; gap:16px; }
  .shift-config-title { grid-template-columns:4px minmax(0,1fr); }
  .shift-headcount { grid-column:2; padding:0; }
  .shift-time-grid { grid-template-columns:1fr; gap:14px; }
  .shift-config-options { flex-wrap:wrap; gap:16px; }
  .shift-selection-head,.shift-assignment-footer { align-items:stretch; flex-direction:column; gap:12px; }
  .shift-settings-layout .shift-person { grid-template-columns:18px 30px minmax(0,1fr); gap:10px; padding:12px 8px; border-right:0; }
  .shift-person-current { grid-column:3; justify-self:start; max-width:100%; }
}

/* Shifts : horaires particuliers (vendredi, samedi) */
.shift-day-overrides { display:grid; gap:8px; min-width:0; margin:0; padding:14px 0 0; border:0; border-top:1px dashed var(--line); }
.shift-day-overrides legend { float:left; width:100%; margin-bottom:6px; padding:0; font-size:12px; font-weight:800; color:#006b98; }
.shift-day-overrides legend small { display:block; margin-top:2px; font-weight:400; color:var(--muted); }
.shift-day-row { display:grid; grid-template-columns:minmax(96px,1fr) repeat(4,minmax(0,1fr)); gap:8px; align-items:end; padding:8px 10px; border:1px solid var(--line); border-radius:8px; background:#fbfcfd; }
.shift-day-row:has([data-day-enabled]:checked) { background:#f2f9fc; border-color:#bfe0ee; }
.shift-settings-layout .shift-day-row label { font-size:11px; color:#54697c; }
.shift-settings-layout .shift-day-row input[type=time] { height:38px; min-height:38px; padding:8px; font-size:12px; margin-top:4px; }
.shift-settings-layout .shift-day-row input:disabled { background:#f3f5f7; color:#9aa7b1; }
.shift-settings-layout .shift-day-toggle { display:flex; align-items:center; gap:8px; min-height:38px; cursor:pointer; font-size:13px; font-weight:700; color:var(--brand-950, #12324a); }
.shift-day-toggle input { width:17px; height:17px; min-height:17px; margin:0; accent-color:#007fb7; }

/* Shifts : affectation en masse */
.shift-section-head p { margin:6px 0 0; color:var(--muted); font-size:13px; }
.shift-summary { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:18px; }
.shift-summary-chip { display:grid; grid-template-columns:auto auto; align-items:center; column-gap:12px; min-width:140px; padding:10px 14px; border:1px solid var(--line); border-left:4px solid var(--shift-color); border-radius:8px; background:#fff; color:inherit; text-align:left; cursor:pointer; font:inherit; }
.shift-summary-chip .shift-badge { font-size:13px; font-weight:700; }
.shift-summary-chip b { justify-self:end; font-size:18px; line-height:1; }
.shift-summary-chip small { grid-column:1/-1; margin-top:4px; color:var(--muted); font-size:11px; }
.shift-summary-chip:hover { background:#f5fafc; }
.shift-summary-chip.is-active { background:#eaf7fc; border-color:#7cc3e2; border-left-color:var(--shift-color); box-shadow:0 0 0 1px #7cc3e2 inset; }
.shift-summary-chip:focus-visible { outline:2px solid #007fb7; outline-offset:2px; }
.shift-assignment-tools { grid-template-columns:1.4fr repeat(3,minmax(0,1fr)); }
.shift-bulk-bar { position:sticky; top:76px; z-index:3; display:flex; flex-wrap:wrap; align-items:center; gap:10px 16px; padding:12px 14px; border:1px solid #cfe3ec; border-radius:8px 8px 0 0; background:#edf5f8; }
.shift-bulk-all { display:flex; align-items:center; gap:10px; cursor:pointer; font-size:13px; font-weight:700; }
.shift-bulk-bar input { width:18px; height:18px; min-height:18px; margin:0; padding:0; flex:none; accent-color:#007fb7; }
#shiftSelectionCount { font-size:12px; color:#54697c; }
.shift-bulk-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-left:auto; }
.shift-bulk-label { font-size:12px; font-weight:700; color:#54697c; }
.shift-settings-layout .shift-bulk-actions .btn { min-height:36px; padding:8px 14px; }
.shift-settings-layout .shift-assign-btn { display:inline-flex; align-items:center; gap:7px; }
.shift-assign-btn::before { content:''; width:8px; height:8px; border-radius:50%; background:var(--shift-color); box-shadow:0 0 0 2px #fff; }
/* Hauteur fixe : filtrer ne fait pas sauter la page. */
.shift-assignment-section .shift-people-list { border:1px solid var(--line); border-top:0; border-radius:0 0 8px 8px; height:min(560px,62vh); max-height:none; align-content:start; }
.shift-person-current { display:inline-flex; align-items:center; gap:6px; border-left:3px solid var(--shift-color); }
.shift-person-current.is-none { color:#845713; background:#fff5df; }

/* Organisation RH : calendrier lisible et résumé des shifts */
.schedule-head { display:grid; grid-template-columns:minmax(130px,1.25fr) repeat(4,minmax(92px,1fr)); gap:9px; padding:0 12px 2px; font-size:11px; font-weight:700; color:var(--text-soft, #54697c); }
.schedule-head small { font-weight:400; }
.schedule-label { display:none; }
.schedule-editor .schedule-row { align-items:center; padding:8px 11px; }
.schedule-editor .schedule-row input[type=time] { margin-top:0; }
.schedule-editor .schedule-row.is-off { background:#f3f5f7; }
.schedule-editor .schedule-row.is-off .schedule-day span { color:#8a99a5; font-weight:600; }
.late-after-field small { display:block; margin-top:6px; color:var(--muted); font-size:12px; font-weight:400; line-height:1.4; }
.hr-shift-summary { display:grid; gap:8px; margin-bottom:6px; }
.hr-shift-row { display:grid; grid-template-columns:minmax(0,auto) 1fr auto; gap:12px; align-items:center; padding:10px 12px; border:1px solid var(--line); border-radius:8px; font-size:13px; }
.hr-shift-row .shift-badge { font-weight:700; }
.hr-shift-row small { color:var(--muted); font-size:12px; }
.hr-shift-row b { font-size:16px; }
.hr-shift-row.is-inactive { opacity:.6; }
@media (max-width:1100px) {
  .schedule-head { display:none; }
  .schedule-label { display:inline; }
  .schedule-editor .schedule-row input[type=time] { margin-top:4px; }
  .shift-assignment-tools { grid-template-columns:1fr 1fr; }
  .shift-bulk-actions { margin-left:0; }
  .shift-assignment-tools > label:last-child { grid-column:auto; }
}
@media (max-width:700px) {
  .shift-day-row { grid-template-columns:1fr 1fr; }
  .shift-day-toggle { grid-column:1/-1; }
  .shift-summary-chip { flex:1 1 calc(50% - 10px); min-width:0; }
  .shift-bulk-bar { position:static; }
  .shift-assignment-section .shift-people-list { height:auto; max-height:70vh; }
  .shift-assignment-tools { grid-template-columns:1fr; }
}
