/* Suivi des temps (/outils-pratiques/suivi-des-temps).
   S'appuie sur les jetons de satellite.css (--ink, --soft, --muted, --card,
   --card-2, --hair, --gold, --gold-ink, --w) et les composants des outils
   pratiques (.panel, .btn-ghost, .sim-field, .sim-stat, .sim-table, .sim-switch).
   Noir et blanc ; la couleur ne sert qu'aux indicateurs (progression,
   dépassement), toujours doublés d'un texte. */

/* Connecté : l'outil passe avant la présentation. */
body.st-signed .grid-hero { display: none; }
body.st-signed #suivi { scroll-margin-top: 80px; }

.st-root { min-height: 320px; min-width: 0; }
.st-root > * { min-width: 0; }
.st-loading { padding: 40px 0; color: var(--muted); text-align: center; }
.st-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.st-ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.st-muted { color: var(--muted); }
.st-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-copy { margin: 0 0 14px; color: var(--soft); line-height: 1.6; max-width: 62ch; }
.st-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; }
.st-h3 { margin: 22px 0 10px; color: var(--ink); font-size: 1rem; }
.st-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. */
.st-root .btn-ghost, .st-dialog .btn-ghost { min-height: 44px; justify-content: center; font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer; }
.st-root .btn-ghost:disabled, .st-dialog .btn-ghost:disabled { opacity: .5; cursor: progress; transform: none; }
.st-big { min-height: 52px !important; font-size: 1rem !important; padding: 0 22px !important; }
.st-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 0; }
.st-actions.is-main > .is-cta { flex: 1 1 220px; }
.st-actions.is-main > .btn-ghost:not(.is-cta) { flex: 0 1 auto; }
.st-link { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.st-link:hover { text-decoration-thickness: 2px; }
.st-link.is-danger { color: var(--st-danger); }
.st-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; color: var(--soft); font-size: .9rem; text-decoration: none; }
.st-back:hover { color: var(--ink); text-decoration: underline; }
.st-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; }
.st-icon-btn:hover { border-color: var(--hair); color: var(--ink); background: rgba(var(--w), .04); }
.st-root :focus-visible, .st-dialog :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Messages */
:root { --st-danger: #ff8a80; --st-ok: #9fd6a6; }
:root[data-theme="light"] { --st-danger: #a3271c; --st-ok: #1f6b2c; }
.st-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; }
.st-alert.is-bad { border-left-color: var(--st-danger); }
.st-alert.is-ok { border-left-color: var(--st-ok); }
.st-alert strong { display: block; }
.st-alert .st-actions { margin-top: 8px; }
.st-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(--st-ok); border-radius: 10px; background: var(--card); color: var(--ink); box-shadow: 0 14px 40px rgba(0, 0, 0, .35); line-height: 1.45; }
.st-toast[hidden] { display: none; }
.st-field-error { margin: 2px 0 0; color: var(--st-danger); font-size: .84rem; }

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

/* Totaux */
.st-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; }
.st-stats .sim-stat-value { font-size: clamp(1.3rem, 5vw, 1.7rem); }
.st-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. */
.st-bar { position: relative; height: 8px; margin: 10px 0 4px; border-radius: 99px; background: rgba(var(--w), .12); overflow: hidden; }
.st-bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--gold); }
:root[data-theme="light"] .st-bar > span { background: var(--gold-ink); }
.st-bar.is-over > span { background: var(--st-danger); }
.st-over { color: var(--st-danger); font-weight: 700; }
.st-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; }
.st-badge.is-over { border-color: var(--st-danger); color: var(--st-danger); }

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

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

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

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