/* Arrivée et départ d'un salarié (/outils-pratiques/arrivee-depart-salarie)
   et page « C'est fait » (/arrivee/tache/). Même socle que le Suivi des temps
   (jetons de satellite.css : --ink, --soft, --muted, --card, --card-2, --hair,
   --gold, --w ; composants .panel, .btn-ghost, .sim-field). Noir et blanc ;
   la couleur ne sert qu'aux états (vert fait, orange en retard, rouge bloqué),
   toujours doublée d'un texte. */
/* Connecté : l'outil passe avant la présentation. */
body.ar-signed .grid-hero { display: none; }
body.ar-signed #parcours { scroll-margin-top: 80px; }

.ar-root { min-height: 320px; min-width: 0; }
.ar-root > * { min-width: 0; }
.ar-loading { padding: 40px 0; color: var(--muted); text-align: center; }
.ar-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ar-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ar-muted { color: var(--muted); }
.ar-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ar-copy { margin: 0 0 14px; color: var(--soft); line-height: 1.6; max-width: 62ch; }
.ar-h2 { margin: 0 0 4px; color: var(--ink); font-size: clamp(1.3rem, 4vw, 1.6rem); line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ar-h3 { margin: 22px 0 10px; color: var(--ink); font-size: 1rem; }
.ar-sub { margin: 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }

/* Boutons : ceux du site (.btn-ghost, .btn-ghost.is-cta), plus une taille. */
.ar-root .btn-ghost, .ar-dialog .btn-ghost { min-height: 44px; justify-content: center; font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; }
.ar-root .btn-ghost:disabled, .ar-dialog .btn-ghost:disabled { opacity: .5; cursor: progress; transform: none; }
.ar-big { min-height: 52px !important; font-size: 1rem !important; padding: 0 22px !important; }
.ar-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 0; }
.ar-actions.is-main > .is-cta { flex: 1 1 220px; }
.ar-actions.is-main > .btn-ghost:not(.is-cta) { flex: 0 1 auto; }
.ar-link { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ar-link:hover { text-decoration-thickness: 2px; }
.ar-link.is-danger { color: var(--ar-danger); }
.ar-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; color: var(--soft); font-size: .9rem; text-decoration: none; }
.ar-back:hover { color: var(--ink); text-decoration: underline; }
.ar-icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--soft); cursor: pointer; flex: none; }
.ar-icon-btn:hover { border-color: var(--hair); color: var(--ink); background: rgba(var(--w), .04); }
.ar-root :focus-visible, .ar-dialog :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Messages */
:root { --ar-danger: #ff8a80; --ar-ok: #9fd6a6; }
:root[data-theme="light"] { --ar-danger: #a3271c; --ar-ok: #1f6b2c; }
.ar-alert { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--hair); border-left: 3px solid var(--ink); border-radius: 10px; background: var(--card-2); color: var(--ink); line-height: 1.5; }
.ar-alert.is-bad { border-left-color: var(--ar-danger); }
.ar-alert.is-ok { border-left-color: var(--ar-ok); }
.ar-alert strong { display: block; }
.ar-alert .ar-actions { margin-top: 8px; }
.ar-toast { position: fixed; z-index: 60; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(520px, calc(100vw - 24px)); padding: 12px 16px; border: 1px solid rgba(var(--w), .2); border-left: 3px solid var(--ar-ok); border-radius: 10px; background: var(--card); color: var(--ink); box-shadow: 0 14px 40px rgba(0, 0, 0, .35); line-height: 1.45; }
.ar-toast[hidden] { display: none; }
.ar-field-error { margin: 2px 0 0; color: var(--ar-danger); font-size: .84rem; }

/* Formulaires (champs .sim-field du site) */
.ar-form { display: grid; gap: 14px; }
.ar-label { color: var(--soft); font-size: .86rem; font-weight: 600; line-height: 1.35; }
.ar-form .sim-field input, .ar-form .sim-field select { font-size: 1rem; }
.ar-form input[aria-invalid="true"], .ar-form select[aria-invalid="true"] { border-color: var(--ar-danger) !important; }
.ar-duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ar-duo .sim-field > span { font-weight: 500; color: var(--muted); }
.ar-dur-total { margin: 2px 0 0; color: var(--soft); font-size: .9rem; }
.ar-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ar-chip { min-height: 40px; padding: 0 14px; border: 1px solid rgba(var(--w), .22); border-radius: 999px; background: none; color: var(--ink); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.ar-chip:hover { background: rgba(var(--w), .07); }
.ar-chip[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); }
.ar-chip.is-quiet { border-style: dashed; color: var(--soft); font-weight: 500; }
fieldset.ar-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; }
fieldset.ar-fieldset > legend { padding: 0; margin-bottom: 6px; color: var(--soft); font-size: .86rem; font-weight: 600; }
.ar-opt { color: var(--muted); font-weight: 500; font-size: .8rem; }

/* Totaux */
.ar-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.ar-stats .sim-stat-value { font-size: clamp(1.3rem, 5vw, 1.7rem); }
.ar-stats .sim-stat small { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; }

/* Barre de progression : seulement si un volume est prévu. */
.ar-bar { position: relative; height: 8px; margin: 10px 0 4px; border-radius: 99px; background: rgba(var(--w), .12); overflow: hidden; }
.ar-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--gold); }
:root[data-theme="light"] .ar-bar > span { background: var(--gold-ink); }
.ar-bar.is-over > span { background: var(--ar-danger); }
.ar-over { color: var(--ar-danger); font-weight: 700; }
.ar-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border: 1px solid rgba(var(--w), .25); border-radius: 999px; color: var(--soft); font-size: .76rem; font-weight: 700; white-space: nowrap; vertical-align: 2px; }
.ar-badge.is-over { border-color: var(--ar-danger); color: var(--ar-danger); }

/* Liste des projets : cartes sur mobile, tableau sur ordinateur. */
.ar-list-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px; margin: 24px 0 10px; }
.ar-list-head .ar-h3 { margin: 0; }
.ar-search { flex: 1 1 220px; max-width: 360px; }
.ar-search input { height: 44px !important; }
.ar-cards { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ar-card { position: relative; display: block; padding: 14px 16px; border: 1px solid var(--hair); border-radius: 12px; background: var(--card-2); color: var(--ink); text-decoration: none; transition: border-color .15s ease; }
.ar-card:hover { border-color: rgba(var(--w), .3); }
.ar-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ar-card-name { font-weight: 800; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.ar-card-total { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ar-card-client { margin: 2px 0 0; color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.ar-card-meta { margin: 6px 0 0; color: var(--soft); font-size: .86rem; }
.ar-card-add { position: relative; z-index: 1; margin-top: 10px; min-height: 40px !important; }
.ar-card .ar-cover { position: absolute; inset: 0; border-radius: 12px; }
.ar-table-wrap { display: none; }
.ar-table { width: 100%; }
.ar-table td .ar-bar { width: 120px; margin: 6px 0 0; }
.ar-table a { color: var(--ink); font-weight: 700; text-decoration: none; }
.ar-table a:hover { text-decoration: underline; }
.ar-table tfoot td { font-weight: 800; border-bottom: 0; }
.ar-empty { padding: 18px 16px; border: 1px dashed rgba(var(--w), .25); border-radius: 12px; color: var(--soft); line-height: 1.5; }
.ar-more { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 0; }
@media (min-width: 760px) {
  .ar-cards.is-adaptive { display: none; }
  .ar-table-wrap { display: block; }
}

/* Détail d'un projet */
.ar-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ar-days { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.ar-day { border: 1px solid var(--hair); border-radius: 12px; background: var(--card-2); overflow: hidden; }
.ar-day-head { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--hair); color: var(--soft); font-size: .88rem; font-weight: 700; }
.ar-day-head .ar-num { color: var(--ink); }
.ar-entries { margin: 0; padding: 0; list-style: none; }
.ar-entry { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-top: 1px solid var(--hair); }
.ar-entry:first-child { border-top: 0; }
.ar-entry-dur { font-weight: 800; font-variant-numeric: tabular-nums; }
.ar-entry-com { color: var(--soft); font-size: .92rem; overflow-wrap: anywhere; }
.ar-entry-com.is-empty { color: var(--muted); font-style: italic; }
.ar-entry-proj { display: block; color: var(--muted); font-size: .8rem; }
.ar-entry-actions { display: flex; }
.ar-danger-zone { margin: 26px 0 0; padding-top: 14px; border-top: 1px solid var(--hair); }

/* Vue semaine */
.ar-filters { display: grid; gap: 12px; margin: 14px 0; }
.ar-filters-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.ar-filters-row .sim-field { flex: 1 1 200px; }
.ar-nav { display: flex; align-items: center; gap: 6px; }
.ar-period { font-weight: 700; color: var(--ink); }
.ar-period-total { margin: 12px 0; }
.ar-matrix { min-width: 640px; }
.ar-matrix th.num, .ar-matrix td.num { width: 4.4rem; }
.ar-matrix td.is-zero { color: var(--muted); }
.ar-matrix .is-today { background: rgba(var(--w), .05); }
.ar-matrix tfoot td, .ar-matrix tfoot th { font-weight: 800; border-bottom: 0; color: var(--ink); }
.ar-week-mobile { display: grid; gap: 10px; }
.ar-week-desktop { display: none; }
@media (min-width: 760px) {
  .ar-week-mobile.is-adaptive { display: none; }
  .ar-week-desktop { display: block; }
}
.ar-per-project { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ar-per-project li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--hair); border-radius: 10px; background: var(--card-2); }
.ar-per-project small { display: block; color: var(--muted); font-size: .78rem; }

/* Fenêtres (formulaires, confirmations) : feuille en bas sur mobile. */
.ar-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid rgba(var(--w), .18); border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); overflow: auto; }
.ar-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.ar-dialog-body { padding: 20px; }
.ar-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.ar-dialog-head h2 { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.ar-dialog .ar-actions { position: sticky; bottom: -20px; margin: 18px -20px -20px; padding: 14px 20px; border-top: 1px solid var(--hair); background: var(--card); }
.ar-dialog .ar-actions > .btn-ghost { flex: 1 1 auto; }
@media (max-width: 620px) {
  .ar-dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; border-bottom: 0; max-height: 92dvh; }
}
.ar-checks { display: grid; gap: 6px; max-height: 240px; overflow: auto; padding: 4px 2px; }
.ar-check { display: flex; align-items: flex-start; gap: 10px; min-height: 36px; padding: 6px 0; color: var(--ink); cursor: pointer; line-height: 1.35; }
.ar-check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--ink); }
.ar-check small { display: block; color: var(--muted); }
.ar-account { margin: 30px 0 0; padding-top: 14px; border-top: 1px solid var(--hair); color: var(--muted); font-size: .86rem; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }

@media (prefers-reduced-motion: reduce) { .ar-card, .ar-chip { transition: none; } }

/* ------------------------------------------------------------ états */
:root { --ar-late: #ffb74d; }
:root[data-theme="light"] { --ar-late: #8a4b00; }
.ar-state { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border: 1px solid rgba(var(--w), .25); border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; color: var(--soft); }
.ar-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .5; }
.ar-state.is-fait { color: var(--ar-ok); border-color: var(--ar-ok); }
.ar-state.is-fait::before, .ar-state.is-retard::before, .ar-state.is-bloque::before { opacity: 1; }
.ar-state.is-retard { color: var(--ar-late); border-color: var(--ar-late); }
.ar-state.is-bloque { color: var(--ar-danger); border-color: var(--ar-danger); }

/* Compteur et barre */
.ar-progress { display: grid; gap: 6px; margin: 14px 0 4px; }
.ar-progress-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; color: var(--soft); font-size: .92rem; }
.ar-progress-line strong { color: var(--ink); font-size: 1.05rem; }
.ar-meter { display: flex; height: 8px; border-radius: 99px; background: rgba(var(--w), .12); overflow: hidden; }
.ar-meter > span { display: block; height: 100%; }
.ar-meter .is-fait { background: var(--ar-ok); }
.ar-meter .is-retard { background: var(--ar-late); }
.ar-meter .is-bloque { background: var(--ar-danger); }

/* Frise J-15 … J+30 : un point par tâche, posé à sa date. */
.ar-frise { position: relative; margin: 18px 0 16px; padding: 26px 0 30px; }
.ar-frise-axis { position: absolute; left: 0; right: 0; top: 34px; height: 2px; background: rgba(var(--w), .18); }
.ar-frise-j { position: absolute; top: 18px; width: 2px; height: 20px; background: var(--ink); }
.ar-frise-j span { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: .74rem; font-weight: 800; white-space: nowrap; color: var(--ink); }
.ar-frise-dot { position: absolute; top: 29px; width: 12px; height: 12px; margin-left: -6px; border: 2px solid var(--card); border-radius: 50%; background: var(--muted); }
.ar-frise-dot.is-fait { background: var(--ar-ok); }
.ar-frise-dot.is-retard { background: var(--ar-late); }
.ar-frise-dot.is-bloque { background: var(--ar-danger); }
.ar-frise-dot.is-today { outline: 2px solid var(--ink); }
.ar-frise-ticks { position: absolute; left: 0; right: 0; top: 46px; display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.ar-frise-today { position: absolute; top: 26px; width: 0; height: 18px; border-left: 2px dashed var(--soft); }

/* Checklist groupée par semaine */
.ar-weeks { display: grid; gap: 14px; margin: 10px 0 0; padding: 0; list-style: none; }
.ar-week-title { margin: 0 0 6px; color: var(--soft); font-size: .84rem; font-weight: 700; text-transform: none; }
.ar-tasks { margin: 0; padding: 0; list-style: none; border: 1px solid var(--hair); border-radius: 12px; background: var(--card-2); overflow: hidden; }
.ar-task { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 10px 12px 14px; border-top: 1px solid var(--hair); }
.ar-task:first-child { border-top: 0; }
.ar-task.is-fait .ar-task-label { color: var(--soft); text-decoration: line-through; text-decoration-thickness: 1px; }
.ar-task-when { color: var(--soft); font-size: .8rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.ar-task-when small { display: block; color: var(--muted); font-weight: 500; }
.ar-task-label { margin: 0; color: var(--ink); font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.ar-task-meta { margin: 4px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.4; overflow-wrap: anywhere; }
.ar-task-meta .is-missing { color: var(--ar-late); font-weight: 700; }
.ar-task-note { margin: 6px 0 0; padding: 6px 10px; border-left: 2px solid var(--hair); color: var(--soft); font-size: .86rem; }
.ar-task-side { display: grid; justify-items: end; gap: 6px; }
.ar-task-btns { display: flex; gap: 4px; }
.ar-add-task { margin: 10px 0 0; }

/* Cartes de la liste des parcours */
.ar-card .ar-meter { margin: 10px 0 0; }
.ar-card-status { margin: 6px 0 0; color: var(--soft); font-size: .86rem; }
.ar-start { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 16px 0 0; }
.ar-start .btn-ghost { min-height: 56px !important; justify-content: flex-start; gap: 10px; padding: 0 18px; }

/* Blocs d'information */
.ar-section { margin: 26px 0 0; }
.ar-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.ar-section-head .ar-h3 { margin: 0; }
.ar-kv { display: grid; gap: 0; margin: 0; border: 1px solid var(--hair); border-radius: 12px; background: var(--card-2); overflow: hidden; }
.ar-kv > div { display: grid; grid-template-columns: minmax(7rem, 36%) minmax(0, 1fr); gap: 10px; padding: 9px 14px; border-top: 1px solid var(--hair); }
.ar-kv > div:first-child { border-top: 0; }
.ar-kv dt { color: var(--muted); font-size: .86rem; }
.ar-kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.ar-kv dd.is-empty { color: var(--muted); font-style: italic; }
.ar-log { margin: 0; padding: 0; list-style: none; color: var(--soft); font-size: .86rem; display: grid; gap: 4px; }
.ar-log time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }

/* Formulaire de création et de modification */
.ar-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 12px; }
.ar-form legend { padding: 0; margin: 0 0 4px; color: var(--ink); font-size: 1rem; font-weight: 800; }
.ar-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .ar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ar-grid .is-wide { grid-column: 1 / -1; } }
.ar-form textarea { min-height: 76px; resize: vertical; font: inherit; }
.ar-role { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 12px; background: var(--card-2); }
.ar-role-title { margin: 0; color: var(--ink); font-weight: 700; }
.ar-role-title small { color: var(--muted); font-weight: 500; }
.ar-more-btn { justify-self: start; }
.ar-warn { color: var(--ar-late); font-weight: 700; }
.ar-secret-hint { margin: 0; color: var(--muted); font-size: .84rem; }

/* Aperçu des emails */
.ar-mail { margin: 0 0 12px; border: 1px solid var(--hair); border-radius: 12px; background: var(--card-2); overflow: hidden; }
.ar-mail-head { padding: 10px 14px; border-bottom: 1px solid var(--hair); font-size: .88rem; color: var(--soft); }
.ar-mail-head strong { color: var(--ink); }
.ar-mail-body { padding: 12px 14px; display: grid; gap: 10px; }
.ar-mail-task { padding: 10px 12px; border: 1px solid var(--hair); border-radius: 8px; }
.ar-mail-task p { margin: 0 0 4px; }
.ar-mail-task .ar-kv { margin-top: 6px; }
.ar-fake-btn { display: inline-block; margin-top: 6px; padding: 6px 14px; border-radius: 4px; background: var(--ink); color: var(--card); font-size: .84rem; font-weight: 700; }
.ar-later { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: .9rem; }
.ar-later li { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); gap: 10px; color: var(--soft); }
.ar-later li strong { color: var(--ink); font-weight: 700; }

/* Page « C'est fait » (sans compte) */
.ar-page { max-width: 640px; margin: 0 auto; padding: 18px 16px 48px; }
.ar-page .ar-root { min-height: 260px; }
.ar-taskcard { padding: 18px; border: 1px solid var(--hair); border-radius: 14px; background: var(--card-2); }
.ar-taskcard h2 { margin: 0 0 4px; font-size: 1.25rem; line-height: 1.3; }
.ar-done-banner { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--ar-ok); border-radius: 10px; color: var(--ink); }
.ar-done-banner svg { color: var(--ar-ok); width: 24px; height: 24px; }

/* Un élément masqué le reste, même s'il porte une classe de mise en page. */
.ar-root [hidden], .ar-dialog [hidden] { display: none !important; }
.ar-dialog .ar-actions { z-index: 2; }
.ar-check { display: flex; align-items: flex-start; gap: 10px; min-height: 36px; padding: 6px 0; color: var(--ink); cursor: pointer; line-height: 1.35; }
.ar-check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--ink); }
.ar-check small { color: var(--muted); }
.ar-dialog .ar-checks { max-height: none; overflow: visible; }
.ar-dialog { box-sizing: border-box; }
.ar-dialog *, .ar-dialog *::before, .ar-dialog *::after { box-sizing: border-box; }
