:root {
  --brand: #a21934;
  --brand-dark: #7f1128;
  --brand-deep: #670c20;
  --brand-soft: #fff1f4;
  --brand-pale: #f8dfe5;
  --accent: #ef7900;
  --accent-soft: #fff3e4;
  --ink: #1f2024;
  --muted: #70747c;
  --muted-2: #9a9da3;
  --border: #e4e5e8;
  --border-strong: #d7d9dd;
  --surface: #ffffff;
  --background: #f6f6f7;
  --success: #2f9d56;
  --success-soft: #eaf7ee;
  --warning: #d77a00;
  --warning-soft: #fff4df;
  --danger: #cf3348;
  --danger-soft: #fdecef;
  --info: #3e6f9f;
  --info-soft: #edf4fa;
  --violet: #8b4bb2;
  --violet-soft: #f5eafb;
  --shadow-sm: 0 2px 8px rgba(37, 37, 42, .05);
  --shadow-md: 0 10px 30px rgba(37, 37, 42, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body { margin: 0; color: var(--ink); background: var(--background); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 5px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

/* Connexion */
.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 44%) 1fr; background: #fff; }
.login-brand-panel { position: relative; min-height: 100vh; padding: 58px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: #fff; background: var(--brand); }
.login-brand-panel::after { content: ""; position: absolute; width: 440px; height: 440px; right: -245px; bottom: -210px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; box-shadow: 0 0 0 68px rgba(255,255,255,.025), 0 0 0 138px rgba(255,255,255,.02); }
.login-brand-inner, .login-hours { position: relative; z-index: 1; }
.login-logo { width: min(390px, 86%); height: auto; }
.login-brand-copy { max-width: 460px; margin-top: 64px; }
.login-brand-rule { display: block; width: 54px; height: 4px; margin-bottom: 22px; border-radius: 99px; background: var(--accent); }
.login-brand-copy p { margin: 0; font-size: clamp(22px, 2.3vw, 34px); line-height: 1.25; font-weight: 650; letter-spacing: -.02em; }
.login-planiteam-logo { display: block; width: min(220px, 60%); max-width: 100%; height: auto; margin-top: 14px; object-fit: contain; opacity: .62; filter: drop-shadow(0 4px 12px rgba(82, 4, 26, .08)); }
.login-hours { display: grid; gap: 5px; font-size: 13px; color: rgba(255,255,255,.75); }
.login-hours strong { color: #fff; font-size: 16px; }
.login-form-panel { min-height: 100vh; display: grid; place-items: center; padding: 44px; background: #fafafa; }
.login-card { width: min(440px, 100%); padding: 42px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: var(--shadow-md); }
.login-heading h1 { margin: 5px 0 8px; font-size: 38px; line-height: 1.1; letter-spacing: -.035em; }
.login-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.stack-lg { display: grid; gap: 18px; margin-top: 30px; }
label { display: grid; gap: 7px; color: #3a3c41; font-size: 13px; font-weight: 720; }
input, select, textarea { width: 100%; padding: 12px 13px; color: var(--ink); border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; outline: none; transition: border-color .18s, box-shadow .18s; }
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #aaadb2; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(162,25,52,.10); }
.form-error { min-height: 18px; margin: -7px 0 0; color: var(--danger); font-size: 12px; }
.otp-intro { display: grid; gap: 6px; }
.otp-intro h2 { margin: 0; color: var(--ink); font-size: 25px; letter-spacing: -.025em; }
.otp-intro p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 13px; }
.otp-code { text-align: center; font-size: 25px; font-weight: 800; letter-spacing: .42em; padding-left: calc(13px + .42em); }
.otp-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--brand); font-size: 12px; font-weight: 750; }
.text-button:disabled { cursor: default; color: var(--muted); opacity: .75; }
.muted-link { color: var(--muted); }

/* Structure générale */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 272px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; color: #fff; background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%); }
.sidebar-brand { min-height: 112px; display: flex; align-items: center; padding: 24px 28px 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-brand img { width: 200px; max-width: 100%; height: auto; }
.navigation { display: grid; gap: 5px; padding: 18px 13px; }
.nav-item { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 13px; padding: 11px 15px; color: rgba(255,255,255,.88); border: 0; border-radius: 8px; background: transparent; text-align: left; font-weight: 650; transition: background .16s, color .16s; }
.nav-item svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.active { color: #fff; background: rgba(255,255,255,.14); box-shadow: inset 3px 0 0 var(--accent); }
.sidebar-account { margin-top: auto; padding: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-user-chip { padding: 11px 10px; border-radius: 9px; background: rgba(90,0,20,.22); }
.user-chip { display: flex; gap: 10px; align-items: center; }
.user-chip > div { min-width: 0; display: grid; gap: 2px; }
.user-chip strong { overflow: hidden; color: inherit; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.user-chip span:not(.avatar) { color: rgba(255,255,255,.72); font-size: 11px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--brand); background: #fff; font-size: 12px; font-weight: 850; border: 1px solid rgba(162,25,52,.08); }
.sidebar-logout { width: 100%; display: flex; align-items: center; gap: 13px; margin-top: 9px; padding: 11px 13px; color: rgba(255,255,255,.88); border: 0; background: transparent; text-align: left; font-weight: 650; }
.sidebar-logout:hover { color: #fff; }
.sidebar-logout svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.workspace { min-width: 0; }
.topbar { position: sticky; z-index: 20; top: 0; min-height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 10px 28px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.96); box-shadow: 0 2px 9px rgba(30,30,35,.035); backdrop-filter: blur(10px); }
.topbar-left { display: flex; align-items: center; gap: 17px; }
.topbar-title { display: flex; align-items: baseline; gap: 10px; }
.topbar-title .eyebrow { order: 2; margin: 0; color: var(--muted); font-size: 10px; }
.topbar h2 { margin: 0; color: var(--brand); font-size: 17px; letter-spacing: .01em; }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.top-icon, .icon-button { position: relative; width: 39px; height: 39px; display: grid; place-items: center; color: #383a3e; border: 0; border-radius: 50%; background: transparent; }
.top-icon:hover, .icon-button:hover { background: #f2f2f3; }
.top-icon svg, .icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notification-badge { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; color: #fff; border: 2px solid #fff; border-radius: 999px; background: var(--brand); font-size: 9px; font-weight: 850; }
.mobile-only { display: none; }
.content { padding: 28px; }

/* Éléments communs */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 9px 15px; border: 1px solid transparent; border-radius: 7px; font-weight: 720; transition: transform .14s, box-shadow .14s, background .14s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button.primary { color: #fff; background: var(--brand); box-shadow: 0 5px 12px rgba(162,25,52,.16); }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { color: var(--brand); border-color: var(--brand-pale); background: var(--brand-soft); }
.button.success { color: var(--success); background: var(--success-soft); }
.button.danger { color: var(--danger); background: var(--danger-soft); }
.button.ghost { color: #45474d; border-color: var(--border); background: #fff; }
.button.full { width: 100%; min-height: 45px; }
.grid { display: grid; gap: 18px; }
.grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-sm); }
.card.pad { padding: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 62px; padding: 17px 20px; border-bottom: 1px solid var(--border); }
.card-header h3, .card h3 { margin: 0; font-size: 16px; }
.card-body { padding: 20px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin: 28px 0 14px; }
.section-heading:first-child { margin-top: 0; }
.section-heading h3 { margin: 0 0 4px; font-size: 18px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Tableau de bord proche de la maquette */
.dashboard-intro { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.dashboard-intro h1 { margin: 0 0 6px; font-size: 27px; letter-spacing: -.03em; }
.dashboard-intro p { margin: 0; color: var(--muted); }
.dashboard-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 9px; }
.dashboard-month { min-width: 138px; padding: 0 6px; text-align: center; font-size: 14px; font-weight: 760; text-transform: capitalize; }
.dashboard-summary { grid-template-columns: 1.13fr 1.13fr .94fr; gap: 18px; }
.summary-card { min-height: 238px; }
.summary-card-header { display: flex; align-items: center; gap: 10px; padding: 18px 19px 13px; }
.summary-card-header svg { width: 21px; height: 21px; fill: none; stroke: var(--accent); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.summary-card-header h3 { font-size: 15px; }
.count-pill { min-width: 27px; height: 27px; display: grid; place-items: center; margin-left: auto; padding: 0 7px; color: var(--accent); border-radius: 50px; background: var(--accent-soft); font-size: 12px; font-weight: 850; }
.summary-list { display: grid; padding: 0 18px; }
.summary-row { min-height: 54px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid #eeeeef; }
.summary-row:last-child { border-bottom: 0; }
.summary-avatar { width: 32px; height: 32px; display: grid; place-items: center; color: var(--brand); border-radius: 50%; background: var(--brand-soft); font-size: 10px; font-weight: 850; }
.summary-copy { min-width: 0; }
.summary-copy strong { display: block; overflow: hidden; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.summary-copy span { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.summary-date { color: #51545a; font-size: 10px; text-align: right; }
.summary-status { display: inline-flex; margin-top: 4px; padding: 2px 6px; color: var(--warning); border-radius: 4px; background: var(--warning-soft); font-size: 9px; font-weight: 800; }
.summary-empty { min-height: 148px; display: grid; place-items: center; padding: 22px; color: var(--muted); font-size: 12px; text-align: center; }
.summary-footer { display: flex; justify-content: flex-start; padding: 12px 19px 17px; }
.summary-link { padding: 0; color: var(--brand); border: 0; background: transparent; font-size: 11px; font-weight: 760; }
.presence-list { display: grid; padding: 0 20px; }
.presence-row { display: flex; align-items: center; justify-content: space-between; min-height: 38px; border-bottom: 1px solid #eeeeef; font-size: 12px; }
.presence-row:last-child { border-bottom: 0; }
.presence-label { display: flex; align-items: center; gap: 9px; }
.presence-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.presence-dot.green { background: var(--success); }
.presence-dot.orange { background: var(--accent); }
.presence-dot.red { background: var(--danger); }
.presence-dot.grey { background: #9da0a6; }
.dashboard-planning-card { margin-top: 18px; overflow: hidden; }
.planning-scroll { overflow-x: auto; }
.dashboard-planning { min-width: 860px; display: grid; grid-template-columns: 190px repeat(5, minmax(135px,1fr)); }
.plan-head, .plan-label, .plan-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.plan-head { min-height: 61px; display: grid; place-items: center; padding: 10px; background: #fbfbfc; text-align: center; }
.plan-head:first-child { place-items: center start; padding-left: 19px; color: #414348; font-size: 11px; font-weight: 780; }
.plan-head strong { display: block; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.plan-head span { display: block; margin-top: 5px; color: #2e3034; font-size: 13px; font-weight: 720; }
.plan-label { min-height: 116px; display: flex; align-items: flex-start; gap: 10px; padding: 17px 16px; background: #fff; }
.plan-label svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--brand); stroke-width: 1.8; }
.plan-label strong { display: block; color: var(--brand); font-size: 13px; }
.plan-label span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.plan-cell { min-height: 116px; padding: 12px 10px; background: #fff; }
.plan-cell.is-today { background: #fffafb; box-shadow: inset 0 3px 0 var(--brand); }
.plan-person { position: relative; padding: 9px 9px 9px 12px; border-radius: 6px; background: #f7f7f8; }
.plan-person + .plan-person { margin-top: 7px; }
.plan-person::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 6px 0 0 6px; background: #d3d4d7; }
.plan-person strong { display: block; overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.plan-person span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.plan-person.replacement { background: var(--accent-soft); }
.plan-person.replacement::before { background: var(--accent); }
.plan-person.replacement-confirmed { background: var(--success-soft); }
.plan-person.replacement-confirmed::before { background: var(--success); }
.plan-person.uncovered { color: var(--danger); background: var(--danger-soft); }
.plan-person.uncovered::before { background: var(--danger); }
.plan-closed { padding-top: 32px; color: var(--muted-2); font-size: 11px; text-align: center; }
.planning-legend { display: flex; flex-wrap: wrap; gap: 20px; padding: 14px 19px 17px; color: var(--muted); font-size: 10px; }
.legend-item { display: flex; align-items: center; gap: 7px; }
.legend-swatch { width: 13px; height: 13px; border-radius: 3px; background: #ededee; }
.legend-swatch.replacement { background: var(--accent-soft); border: 1px solid #f2c88e; }
.legend-swatch.replacement-confirmed { background: var(--success-soft); border: 1px solid #a9dfb9; }
.legend-swatch.uncovered { background: var(--danger-soft); border: 1px solid #efb6bf; }

/* Planning détaillé */
.schedule-row { display: grid; grid-template-columns: 112px 1fr 1fr; gap: 12px; align-items: stretch; }
.schedule-row + .schedule-row { margin-top: 10px; }
.period-label { display: grid; align-content: center; padding: 13px; border: 1px solid var(--border); border-radius: 8px; background: #fafafa; }
.period-label strong { font-size: 13px; }
.period-label span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.office-card { padding: 13px; border: 1px solid var(--border); border-radius: 8px; }
.office-card .office-label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.office-card strong { display: block; margin-top: 4px; }
.office-card.replacement { border-color: #f2ce99; background: var(--accent-soft); }
.office-card.replacement-confirmed { border-color: #a9dfb9; background: var(--success-soft); }
.office-card.uncovered { border-color: #efb9c1; background: var(--danger-soft); }
.office-card small { display: block; margin-top: 4px; color: var(--muted); }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 820; }
.badge.pending { color: var(--warning); background: var(--warning-soft); }
.badge.approved { color: var(--success); background: var(--success-soft); }
.badge.rejected { color: var(--danger); background: var(--danger-soft); }
.badge.replacement { color: var(--warning); background: var(--accent-soft); }
.badge.swap { color: var(--violet); background: var(--violet-soft); }
.badge.neutral { color: #5f6268; background: #f0f1f2; }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
.segmented button { min-width: 74px; padding: 7px 12px; color: var(--muted); border: 0; border-radius: 5px; background: transparent; font-size: 12px; font-weight: 720; }
.segmented button.active { color: #fff; background: var(--brand); }
.calendar-title { min-width: 220px; text-align: center; font-size: 14px; font-weight: 790; text-transform: capitalize; }
.calendar-wrapper { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-grid.week { grid-template-columns: repeat(5, minmax(190px, 1fr)); overflow-x: auto; }
.weekday { padding: 11px; color: var(--muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #fafafa; font-size: 10px; font-weight: 830; text-align: center; text-transform: uppercase; }
.day-cell { min-height: 148px; padding: 9px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #fff; }
.day-cell.outside { color: #a7a9ae; background: #fbfbfc; }
.day-cell.today { box-shadow: inset 0 3px 0 var(--brand); background: #fffafb; }
.day-number { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 11px; font-weight: 850; }
.day-number span:last-child { color: var(--muted); font-weight: 600; }
.calendar-slot { margin-bottom: 6px; padding: 7px; border-radius: 6px; background: #f4f4f5; font-size: 10px; }
.calendar-slot strong { display: block; margin-bottom: 3px; color: var(--brand); }
.calendar-slot span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.calendar-slot.replacement { background: var(--accent-soft); }
.calendar-slot.replacement-confirmed { background: var(--success-soft); border: 1px solid #b7e3c3; }
.calendar-slot.replacement-confirmed strong { color: var(--success); }
.calendar-slot.uncovered { color: var(--danger); background: var(--danger-soft); }
.calendar-absence { margin-top: 4px; color: var(--warning); font-size: 9px; font-weight: 800; }
.calendar-absence.confirmed { color: var(--success); }
.week-day-column { min-height: 360px; border-right: 1px solid var(--border); background: #fff; }
.week-day-column .week-head { padding: 13px; border-bottom: 1px solid var(--border); background: #fafafa; text-align: center; }
.week-day-column .week-head strong { display: block; text-transform: capitalize; }
.week-day-column .week-head span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.week-day-column .week-content { padding: 12px; }

/* Formulaires, listes et équipe */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .full-span { grid-column: 1 / -1; }
.approval-option { display: flex; grid-template-columns: auto 1fr; align-items: flex-start; gap: 11px; padding: 13px 14px; border: 1px solid #ead7dc; border-radius: 8px; background: #fff8fa; cursor: pointer; }
.approval-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); }
.approval-option span { display: grid; gap: 3px; }
.approval-option strong { color: var(--ink); font-size: 13px; }
.approval-option small { color: var(--muted); font-size: 11px; font-weight: 550; line-height: 1.45; }
.list { display: grid; gap: 9px; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.list-main { min-width: 0; }
.list-main strong { display: block; }
.list-main p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.list-meta { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.empty { padding: 30px 20px; color: var(--muted); text-align: center; }
.team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.person-card { display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.person-card .avatar { color: #fff; background: var(--brand); }
.person-card div:last-child { min-width: 0; }
.person-card strong, .person-card span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.person-card span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: 360px; padding: 13px 16px; color: #fff; border-radius: 8px; background: #303137; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }

@media (max-width: 1180px) {
  .dashboard-summary { grid-template-columns: 1fr 1fr; }
  .summary-card:last-child { grid-column: 1 / -1; min-height: auto; }
  .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-grid.month { min-width: 900px; }
  .calendar-wrapper { overflow-x: auto; }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 40; left: -290px; width: 272px; transition: left .2s ease; }
  .sidebar.open { left: 0; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
  .mobile-only { display: grid; }
  .topbar { padding: 10px 16px; }
  .content { padding: 20px 16px; }
  .dashboard-intro { align-items: flex-start; flex-direction: column; }
  .dashboard-controls { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .login-view { grid-template-columns: 1fr; }
  .login-brand-panel { min-height: 260px; padding: 34px 28px; }
  .login-brand-copy { margin-top: 28px; }
  .login-brand-copy p { font-size: 22px; }
  .login-planiteam-logo { width: min(190px, 58%); margin-top: 12px; }
  .login-hours { display: none; }
  .login-form-panel { min-height: auto; padding: 28px 16px 44px; }
  .login-card { padding: 28px 22px; }
  .topbar-title .eyebrow { display: none; }
  .dashboard-summary, .grid.stats, .grid.two, .grid.three, .team-grid, .form-grid { grid-template-columns: 1fr; }
  .summary-card:last-child { grid-column: auto; }
  .form-grid .full-span { grid-column: auto; }
  .schedule-row { grid-template-columns: 1fr; }
  .period-label { display: flex; justify-content: space-between; }
  .list-item { align-items: flex-start; flex-direction: column; }
  .list-meta { justify-content: flex-start; }
  .dashboard-controls .dashboard-month { order: -1; width: 100%; text-align: left; }
}

/* Alertes et validation des remplacements */
.replacement-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #f0c78b;
  border-left: 4px solid var(--accent);
  border-radius: 9px;
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}
.replacement-alert > div { display: grid; gap: 4px; }
.replacement-alert strong { color: #6e3900; font-size: 14px; }
.replacement-alert span { color: #815427; font-size: 12px; line-height: 1.45; }
.replacement-item.needs-response { border-color: #edbd76; background: #fffaf3; box-shadow: inset 4px 0 0 var(--accent); }
.replacement-note { color: var(--warning) !important; font-weight: 700; }
.danger-text { color: var(--danger) !important; }
.replacement-admin-edit { display: grid; gap: 5px; min-width: 240px; }
.replacement-admin-edit > span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.replacement-select { min-width: 240px; }
.replacement-note.admin-info { color: var(--brand) !important; font-weight: 650; }

@media (max-width: 700px) {
  .replacement-alert { align-items: stretch; flex-direction: column; }
  .replacement-alert .button { width: 100%; }
  .list-item { align-items: stretch; flex-direction: column; }
  .list-meta { justify-content: flex-start; }
  .replacement-admin-edit, .replacement-select { width: 100%; min-width: 0; }
}

/* Suivi des droits et de l'historique de congés */
.leave-tracking-heading { align-items: center; }
.year-filter, .history-user-filter { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.year-filter select { min-width: 112px; }
.history-user-filter select { min-width: 220px; }
.leave-balance-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.leave-balance-grid.single { grid-template-columns: minmax(0, 560px); }
.leave-balance-card { padding: 17px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .16s, transform .16s, box-shadow .16s; }
.leave-balance-card:hover { border-color: #d9b7c0; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.leave-balance-card.overbooked { border-color: #efb9c1; background: #fffafb; }
.leave-balance-head { display: flex; align-items: center; gap: 11px; }
.leave-balance-head .avatar { color: #fff; background: var(--brand); }
.leave-balance-head > div { min-width: 0; }
.leave-balance-head strong, .leave-balance-head span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.leave-balance-head strong { font-size: 13px; }
.leave-balance-head span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.leave-balance-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 17px; }
.leave-balance-main span { color: var(--muted); font-size: 11px; }
.leave-balance-main strong { color: var(--brand); font-size: 24px; line-height: 1; }
.leave-balance-card.overbooked .leave-balance-main strong { color: var(--danger); }
.leave-progress { height: 7px; margin-top: 11px; overflow: hidden; border-radius: 999px; background: #eeeef0; }
.leave-progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.leave-balance-card.overbooked .leave-progress span { background: var(--danger); }
.leave-balance-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.leave-balance-stats div { min-width: 0; padding: 9px; border-radius: 7px; background: #f8f8f9; }
.leave-balance-stats span, .leave-balance-stats strong { display: block; }
.leave-balance-stats span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .03em; }
.leave-balance-stats strong { margin-top: 4px; font-size: 12px; }
.leave-pending-note { margin: 11px 0 0; padding: 8px 10px; color: var(--warning); border-radius: 6px; background: var(--warning-soft); font-size: 10px; font-weight: 750; }
.entitlement-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--border); cursor: default; }
.entitlement-form label { gap: 5px; color: var(--muted); font-size: 10px; }
.entitlement-form input { min-height: 39px; }
.entitlement-form .button { white-space: nowrap; }
.leave-history-card { margin-top: 18px; }
.leave-history-list { display: grid; }
.leave-history-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 66px; padding: 10px 0; border-bottom: 1px solid #eeeeef; }
.leave-history-row:last-child { border-bottom: 0; }
.leave-history-date strong, .leave-history-date span, .leave-history-copy strong, .leave-history-copy span { display: block; }
.leave-history-date strong { font-size: 12px; }
.leave-history-date span, .leave-history-copy span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.leave-history-copy strong { font-size: 12px; }

@media (max-width: 1180px) {
  .leave-balance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .leave-tracking-heading, .card-header { align-items: stretch; flex-direction: column; }
  .year-filter select, .history-user-filter select { width: 100%; min-width: 0; }
  .leave-balance-grid, .leave-balance-grid.single { grid-template-columns: 1fr; }
  .leave-history-row { grid-template-columns: 1fr auto; }
  .leave-history-copy { grid-column: 1 / -1; grid-row: 2; }
  .entitlement-form { grid-template-columns: 1fr; }
}

/* Présence par défaut de l'ensemble de l'équipe */
.presence-person-card { position: relative; align-items: flex-start; padding-right: 132px; }
.person-card-copy small { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.4; white-space: normal; }
.presence-badge { position: absolute; top: 14px; right: 14px; display: inline-flex !important; align-items: center; justify-content: center; max-width: 118px; min-height: 25px; padding: 5px 8px; border-radius: 999px; font-size: 9px !important; font-weight: 800; line-height: 1.15; text-align: center; white-space: normal !important; }
.presence-badge.present { color: #167044 !important; background: #eaf7f0; }
.presence-badge.partial { color: #9a5800 !important; background: #fff2df; }
.presence-badge.absent { color: #a52b3d !important; background: #fdecef; }
.presence-badge.pending { color: #656870 !important; background: #f0f1f3; }

@media (max-width: 700px) {
  .presence-person-card { padding-right: 15px; }
  .presence-badge { position: static; max-width: none; margin-left: auto; }
}

/* Version 2.5 — périodes de congé clairement séparées par collaborateur */
.leave-person-groups { display: grid; gap: 10px; }
.leave-person-group { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.leave-person-group[open] { border-color: #d8b3bd; box-shadow: var(--shadow-sm); }
.leave-person-group summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; min-height: 70px; padding: 12px 15px; cursor: pointer; list-style: none; background: #fff; }
.leave-person-group summary::-webkit-details-marker { display: none; }
.leave-person-group summary:hover { background: #fcf8f9; }
.leave-person-group[open] summary { border-bottom: 1px solid var(--border); background: #fcf8f9; }
.leave-person-group .avatar, .leave-team-summary-row .avatar { color: #fff; background: var(--brand); }
.leave-person-identity { min-width: 0; }
.leave-person-identity strong, .leave-person-identity small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.leave-person-identity strong { font-size: 13px; }
.leave-person-identity small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.leave-person-totals { display: grid; grid-template-columns: repeat(2, minmax(68px, auto)); gap: 8px; }
.leave-person-totals > span { padding: 7px 10px; border-radius: 7px; background: #f7f7f8; text-align: right; }
.leave-person-totals small, .leave-person-totals strong { display: block; }
.leave-person-totals small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.leave-person-totals strong { margin-top: 3px; color: var(--brand); font-size: 12px; }
.leave-person-chevron { color: var(--brand); font-size: 20px; transition: transform .16s ease; }
.leave-person-group[open] .leave-person-chevron { transform: rotate(180deg); }
.leave-person-periods { padding: 0 16px 5px; }
.empty.compact { min-height: 70px; padding: 22px 8px; }
.leave-team-summary { display: grid; gap: 7px; }
.leave-team-summary-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 1px solid transparent; border-radius: 8px; color: inherit; background: #f8f8f9; text-align: left; cursor: pointer; }
.leave-team-summary-row:hover { border-color: #d9b7c0; background: #fcf8f9; }
.leave-team-summary-name { min-width: 0; }
.leave-team-summary-name strong, .leave-team-summary-name small, .leave-team-summary-numbers strong, .leave-team-summary-numbers small { display: block; }
.leave-team-summary-name strong { overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.leave-team-summary-name small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.leave-team-summary-numbers { min-width: 54px; text-align: right; }
.leave-team-summary-numbers strong { color: var(--brand); font-size: 11px; }
.leave-team-summary-numbers small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.leave-team-summary-numbers.remaining strong { color: #167044; }

@media (max-width: 700px) {
  .leave-person-group summary { grid-template-columns: auto minmax(0, 1fr) auto; }
  .leave-person-totals { grid-column: 2 / -1; grid-row: 2; width: 100%; }
  .leave-person-chevron { grid-column: 3; grid-row: 1; }
  .leave-person-periods { padding: 0 12px 5px; }
  .leave-team-summary-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .leave-team-summary-numbers.remaining { grid-column: 3; grid-row: 2; }
}

/* Version 2.7 — modification des congés et absences */
.button.small { min-height: 30px; padding: 6px 10px; font-size: 10px; }
.leave-history-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.complete-leave-history .leave-person-periods { padding-top: 12px; padding-bottom: 12px; }
.complete-leave-history .list-item { background: #fcfcfd; }
.edit-leave-information { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px; background: #f8f8f9; }
.edit-leave-information > span:last-child { color: var(--muted); font-size: 11px; line-height: 1.45; }
.modal-backdrop { position: fixed; z-index: 250; inset: 0; display: grid; align-items: center; justify-items: center; overflow-y: auto; padding: 24px; background: rgba(29, 22, 24, .56); backdrop-filter: blur(2px); }
.modal-card { width: min(680px, 100%); overflow: hidden; border: 1px solid #dbc9ce; border-radius: 12px; background: #fff; box-shadow: 0 24px 70px rgba(49, 20, 28, .28); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px 17px; color: #fff; background: var(--brand); }
.modal-header .eyebrow { color: #ffd3a0; }
.modal-header h3 { margin: 4px 0 0; color: #fff; font-size: 20px; }
.modal-close { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; color: #fff; border: 1px solid rgba(255,255,255,.32); border-radius: 8px; background: rgba(255,255,255,.08); font-size: 24px; line-height: 1; cursor: pointer; }
.modal-close:hover { background: rgba(255,255,255,.17); }
.modal-body { padding: 22px; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 4px; }

@media (max-width: 700px) {
  .modal-backdrop { align-items: end; padding: 0; }
  .modal-card { width: 100%; max-height: 94vh; overflow-y: auto; border-radius: 14px 14px 0 0; }
  .modal-body { grid-template-columns: 1fr; padding: 18px; }
  .modal-body .full-span { grid-column: 1; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
  .leave-history-actions { align-items: flex-end; flex-direction: column; }
}


/* Signalement explicite des anciennes périodes saisies uniquement le week-end. */
.leave-history-row.non-working-leave {
  background: #fff8e8;
  border-left: 3px solid #f39a1e;
  padding-left: 12px;
}
.leave-history-row.non-working-leave .leave-history-copy span {
  color: #9a5b00;
  font-weight: 600;
}

.modal-subtitle{margin:.35rem 0 0;color:#667085;font-size:.9rem;max-width:620px}.leave-type-editor{padding:14px;border:1px solid #f0c4ce;border-radius:12px;background:#fff8fa}.leave-type-editor strong{display:block;margin-bottom:8px;color:#9f1634}.leave-type-editor small{display:block;margin-top:7px;color:#667085;font-weight:400}
.day-cell.holiday,
.week-day-column.holiday { background: #fff7f3; }
.day-cell.holiday { border-color: #f1c7b1; }
.holiday-label { margin-top: 8px; padding: 9px; border: 1px solid #f3c4a9; border-radius: 9px; background: #fff; }
.holiday-label strong,
.holiday-label span { display: block; }
.holiday-label strong { color: var(--brand); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.holiday-label span { margin-top: 3px; font-size: 12px; font-weight: 700; }
.holiday-week { padding: 18px 12px; border: 1px solid #f3c4a9; border-radius: 10px; background: #fff; text-align: center; }
.holiday-week strong,
.holiday-week span,
.holiday-week small { display: block; }
.holiday-week strong { color: var(--brand); text-transform: uppercase; font-size: 12px; }
.holiday-week span { margin-top: 6px; font-weight: 800; }
.holiday-week small { margin-top: 8px; color: var(--muted); line-height: 1.4; }

/* Version 3.2 — espaces personnels des collaborateurs */
.photo-avatar { overflow: hidden; padding: 0 !important; background: #f2e7ea !important; }
.photo-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.sidebar-user-chip .avatar.photo-avatar { border: 2px solid rgba(255,255,255,.45); }
.clickable-profile { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.clickable-profile:hover { transform: translateY(-1px); border-color: #d9aeb9; box-shadow: var(--shadow-sm); }
.profile-selector { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.profile-selector label { width: min(360px, 100%); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.profile-selector select { margin-top: 6px; text-transform: none; letter-spacing: normal; }
.profile-hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 26px; overflow: hidden; background: linear-gradient(110deg, #fff 0%, #fff 62%, #fff5f1 100%); }
.profile-hero-main { display: flex; align-items: center; gap: 18px; min-width: 0; }
.profile-avatar { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 92px; height: 92px; overflow: hidden; border: 4px solid #fff; border-radius: 50%; color: #fff; background: var(--brand); box-shadow: 0 7px 22px rgba(126, 20, 48, .18); font-size: 27px; font-weight: 850; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero-main h3 { margin: 5px 0 4px; color: var(--brand); font-size: 27px; }
.profile-hero-main p { margin: 0; color: var(--muted); font-size: 13px; }
.profile-quick-info { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); min-width: min(590px, 54%); overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.86); }
.profile-quick-info > div { min-width: 0; padding: 15px 16px; border-left: 1px solid var(--border); }
.profile-quick-info > div:first-child { border-left: 0; }
.profile-quick-info small, .profile-quick-info strong, .profile-quick-info span { display: block; }
.profile-quick-info small { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.profile-quick-info strong { margin-top: 6px; overflow-wrap: anywhere; color: #27252a; font-size: 12px; }
.profile-quick-info span { margin-top: 5px; color: var(--orange); font-size: 9px; font-weight: 800; }
.profile-grid { margin-top: 16px; align-items: start; }
.profile-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-details > div { min-height: 72px; padding: 14px; border: 1px solid var(--border); border-radius: 9px; background: #fafafa; }
.profile-details small, .profile-details strong { display: block; }
.profile-details small { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.profile-details strong { margin-top: 8px; overflow-wrap: anywhere; font-size: 12px; }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1.4; }
.profile-form-actions { display: flex; align-items: center; gap: 9px; }
textarea { width: 100%; resize: vertical; }

@media (max-width: 1050px) {
  .profile-hero { align-items: stretch; flex-direction: column; }
  .profile-quick-info { width: 100%; min-width: 0; }
}
@media (max-width: 650px) {
  .profile-hero { padding: 18px; }
  .profile-avatar { width: 72px; height: 72px; font-size: 22px; }
  .profile-hero-main h3 { font-size: 21px; }
  .profile-quick-info { grid-template-columns: 1fr; }
  .profile-quick-info > div { border-top: 1px solid var(--border); border-left: 0; }
  .profile-quick-info > div:first-child { border-top: 0; }
  .profile-details { grid-template-columns: 1fr; }
  .profile-form-actions { align-items: stretch; flex-direction: column; }
  .profile-form-actions .button { width: 100%; }
}
.birthday-strip { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; padding: 13px 16px; border: 1px solid #f0c9ab; border-radius: 10px; background: #fff8f1; }
.birthday-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; background: #fff; font-size: 20px; }
.birthday-strip strong, .birthday-strip span { display: block; }
.birthday-strip strong { color: var(--brand); font-size: 12px; }
.birthday-strip span { margin-top: 4px; color: #6f5a50; font-size: 10px; line-height: 1.5; }

/* Version 3.5 — informations familiales et contact d'urgence */
.form-subsection { margin-top: 8px; padding-top: 15px; border-top: 1px solid var(--border); }
.form-subsection h4 { margin: 0; color: var(--brand); font-size: 13px; }
.form-subsection p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.family-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.children-list { display: grid; gap: 10px; }
.family-child-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; align-items: end; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fafafa; }
.profile-details span { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.55; }
@media (max-width: 760px) {
  .family-child-row { grid-template-columns: 1fr; }
  .family-heading { align-items: stretch; flex-direction: column; }
}

/* Version 3.6 — bandeau des anniversaires à venir */
.birthday-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px 24px;
  border: 1px solid #efbf9f;
  border-radius: 14px;
  background: #fff9f4;
  box-shadow: 0 1px 2px rgba(71, 25, 12, .03);
}
.birthday-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
  font-size: 25px;
  box-shadow: 0 1px 4px rgba(55, 25, 10, .05);
}
.birthday-content { min-width: 0; }
.birthday-strip .birthday-content > strong {
  display: block;
  color: #18589d;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.25;
}
.birthday-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 7px;
  color: #745f55;
  font-size: 13px;
  line-height: 1.45;
}
.birthday-list > i { color: #a98d7e; font-style: normal; }
.birthday-item { display: inline-flex; align-items: baseline; gap: 4px; }
.birthday-item b { color: #654f45; font-weight: 600; }
.birthday-item small {
  margin-left: 4px;
  color: #9a8073;
  font-size: 10px;
  font-weight: 500;
}
@media (max-width: 760px) {
  .birthday-strip { align-items: flex-start; padding: 15px; }
  .birthday-icon { width: 42px; height: 42px; font-size: 22px; }
  .birthday-list { display: grid; gap: 7px; }
  .birthday-list > i { display: none; }
  .birthday-item { display: flex; flex-wrap: wrap; }
  .birthday-item small { flex-basis: 100%; margin-left: 0; }
}


/* Version 3.7 — compteur annuel des remplacements */
.replacement-counter-card { margin-bottom: 22px; }
.replacement-counter-header { align-items: flex-start; gap: 20px; }
.replacement-year-label { min-width: 112px; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.replacement-year-label select { margin-top: 6px; min-width: 110px; padding: 9px 32px 9px 11px; background: #fff; }
.replacement-counter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.replacement-counter-item { display: grid; grid-template-columns: 30px 44px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.replacement-counter-item.is-current-user { border-color: rgba(176, 20, 55, .38); background: #fff9fa; box-shadow: inset 3px 0 0 var(--primary); }
.replacement-counter-rank { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: #f5f5f6; color: var(--muted); font-size: 12px; font-weight: 800; }
.replacement-counter-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; }
.replacement-counter-avatar img { width: 100%; height: 100%; object-fit: cover; }
.replacement-counter-copy { min-width: 0; }
.replacement-counter-copy strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.replacement-counter-copy > span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.replacement-counter-bar { height: 5px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #f0f0f1; }
.replacement-counter-bar i { display: block; height: 100%; min-width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.replacement-counter-value { min-width: 76px; text-align: right; }
.replacement-counter-value strong { display: block; color: var(--primary); font-size: 22px; line-height: 1; }
.replacement-counter-value span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
@media (max-width: 860px) { .replacement-counter-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .replacement-counter-header { flex-direction: column; } .replacement-counter-item { grid-template-columns: 26px 38px minmax(0, 1fr) auto; padding: 11px; gap: 8px; } .replacement-counter-avatar { width: 36px; height: 36px; } .replacement-counter-value { min-width: 58px; } .replacement-counter-value strong { font-size: 19px; } }


/* Version 3.8 — gestion des collaborateurs dans Paramètres */
.admin-users-card { overflow: hidden; }
.admin-users-list { display: grid; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.admin-user-row { display: grid; grid-template-columns: minmax(240px, 1fr) 170px 150px auto; gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.admin-user-identity { display: flex; align-items: center; gap: 11px; align-self: center; min-width: 0; }
.admin-user-identity .avatar { flex: 0 0 auto; }
.admin-user-identity strong, .admin-user-identity span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-user-identity span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.admin-user-row label { margin: 0; font-size: 11px; color: var(--muted); }
.admin-user-row select { margin-top: 5px; }
.admin-user-actions { display: flex; gap: 7px; justify-content: flex-end; }
button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 1050px) { .admin-user-row { grid-template-columns: 1fr 1fr; } .admin-user-identity { grid-column: 1 / -1; } .admin-user-actions { grid-column: 1 / -1; justify-content: flex-start; } }
@media (max-width: 620px) { .admin-user-row { grid-template-columns: 1fr; } .admin-user-identity, .admin-user-actions { grid-column: auto; } .admin-user-actions { flex-wrap: wrap; } }


/* Version 4.0 — documents personnels sécurisés */
.documents-layout { align-items: start; }
.document-list { display: grid; gap: 10px; }
.document-row { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.document-row.expired { border-color: #efb4bd; background: #fff8f9; }
.document-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #f6edf0; font-size: 20px; }
.document-copy { min-width: 0; }
.document-copy strong, .document-copy span, .document-copy small { display: block; }
.document-copy span { margin-top: 3px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.document-copy small { margin-top: 5px; color: #8a747a; font-size: 11px; }
.document-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) { .document-row { grid-template-columns: 42px minmax(0,1fr); } .document-actions { grid-column: 1 / -1; justify-content: flex-start; } }

/* v5.0 — Pilotage RH */
.metric-card{padding:22px;display:flex;flex-direction:column;gap:5px}.metric-card>span{font-size:.8rem;text-transform:uppercase;letter-spacing:.06em;color:#7a6c70;font-weight:700}.metric-card>strong{font-size:2rem;color:#9f1734}.metric-card>small{color:#7a6c70}.pilotage-grid{align-items:start}.compact-form{margin-bottom:20px}.agenda-list{display:grid;gap:10px}.agenda-item{display:grid;grid-template-columns:110px 1fr auto;align-items:center;gap:14px;padding:12px;border:1px solid #eadfe2;border-radius:10px}.agenda-date{display:flex;flex-direction:column}.agenda-date span,.agenda-item p{margin:3px 0 0;color:#7a6c70;font-size:.84rem}.search-form{display:flex;gap:10px}.search-form input{flex:1}.search-results{display:grid;gap:8px;margin-top:16px}.search-result{width:100%;text-align:left;border:1px solid #eadfe2;background:#fff;border-radius:10px;padding:12px 90px 12px 14px;position:relative;cursor:pointer}.search-result:hover{border-color:#a21934;background:#fff8fa}.search-result strong,.search-result span{display:block}.search-result span{color:#7a6c70;font-size:.86rem;margin-top:3px}.search-result small{position:absolute;right:12px;top:50%;transform:translateY(-50%);text-transform:uppercase;color:#a21934;font-weight:700}.analytics-table{min-width:720px}.card-body:has(.analytics-table){overflow-x:auto}.analytics-head,.analytics-row{display:grid;grid-template-columns:38px minmax(180px,1.5fr) repeat(4,minmax(90px,1fr));gap:10px;align-items:center;padding:11px 8px}.analytics-head{grid-template-columns:minmax(218px,1.5fr) repeat(4,minmax(90px,1fr));border-bottom:1px solid #e9dfe2;font-size:.77rem;text-transform:uppercase;color:#7a6c70;font-weight:700}.analytics-row{border-bottom:1px solid #f0e8ea}.analytics-row:last-child{border-bottom:0}.mini-avatar{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#a21934;color:#fff;font-size:.72rem;font-weight:800;overflow:hidden}.mini-avatar img{width:100%;height:100%;object-fit:cover}.mini-bar{display:block;height:5px;background:#eee4e6;border-radius:99px;margin-top:5px;overflow:hidden}.mini-bar em{display:block;height:100%;background:#a21934;border-radius:99px}.assistant-answer{margin-top:14px;padding:16px;border-left:4px solid #e78a22;background:#fff8ee;border-radius:8px;line-height:1.5}.checkbox-row{display:flex!important;align-items:center;gap:9px}.checkbox-row input{width:auto}.navigation{overflow-y:auto}
@media(max-width:760px){.agenda-item{grid-template-columns:1fr}.search-form{flex-direction:column}.analytics-table{min-width:650px}.metric-card>strong{font-size:1.65rem}}


/* Agenda des poubelles */
.trash-strip { display:flex; align-items:flex-start; gap:14px; margin-bottom:18px; padding:15px 18px; border:1px solid #f0d6aa; border-left:4px solid #f3a735; border-radius:9px; background:#fff9ef; box-shadow:var(--shadow-sm); }
.trash-strip-icon { font-size:24px; line-height:1; }
.trash-strip > div:last-child { display:grid; gap:7px; }
.trash-strip strong { font-size:13px; }
.trash-strip small { color:var(--muted); font-size:11px; }
.trash-badges { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.trash-badges.compact { display:grid; gap:5px; margin:6px 0 8px; }
.trash-badge { display:inline-flex; align-items:center; width:fit-content; max-width:100%; padding:4px 8px; color:#7a4c0c; border:1px solid #f0d19b; border-radius:999px; background:#fff4dd; font-size:9px; font-weight:800; line-height:1.25; }
.trash-plan-label { min-height:84px; }
.trash-plan-icon { font-size:18px; line-height:1; }
.trash-plan-cell { min-height:84px; }
.trash-settings-note { margin-top:16px; padding:12px 14px; border-radius:8px; color:#65522f; background:#fff8ea; font-size:11px; line-height:1.5; }
.trash-settings-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px; }
.week-content > .trash-badges { margin:0 0 14px; }
.day-cell > .trash-badges { margin:5px 0 8px; }
@media (max-width:760px) { .trash-settings-actions { justify-content:flex-start; } }
