/* =========================================================================
   STECS – feuille de style de l'application (style shadcn/ui, sans build)
   Pensée d'abord pour la tablette : gros boutons, cartes claires.
   ========================================================================= */

:root {
  --background: #f7f7f8;
  --foreground: #18181b;
  --card: #ffffff;
  --card-foreground: #18181b;
  --muted: #f1f1f3;
  --muted-foreground: #6b6b74;
  --border: #e4e4e7;
  --input: #d4d4d8;
  --ring: rgba(230, 38, 47, .35);

  --primary: #e6262f;
  --primary-hover: #cf1f28;
  --primary-foreground: #ffffff;
  --primary-soft: #fdecec;
  --primary-soft-foreground: #b01b23;

  --secondary: #f1f1f3;
  --secondary-foreground: #27272a;

  --accent: #2590c0;
  --accent-soft: #e6f3f9;
  --accent-soft-foreground: #186a8f;

  --success: #16a34a;
  --success-soft: #e7f6ec;
  --success-soft-foreground: #11743a;
  --warning: #d97706;
  --warning-soft: #fdf3e1;
  --warning-soft-foreground: #9a5606;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --danger-soft-foreground: #b01b23;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 4px 14px rgba(0, 0, 0, .04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .16);

  --sidebar-width: 256px;
  --topbar-height: 64px;
  --control-height: 48px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --background: #0d0d0f;
  --foreground: #f4f4f5;
  --card: #17171a;
  --card-foreground: #f4f4f5;
  --muted: #222226;
  --muted-foreground: #a1a1aa;
  --border: #2a2a2f;
  --input: #3a3a41;
  --ring: rgba(239, 68, 76, .45);

  --primary: #ef4444;
  --primary-hover: #f05a5a;
  --primary-foreground: #ffffff;
  --primary-soft: #3a1518;
  --primary-soft-foreground: #fca5a5;

  --secondary: #26262b;
  --secondary-foreground: #f4f4f5;

  --accent: #4fb3df;
  --accent-soft: #10303f;
  --accent-soft-foreground: #8fd2f0;

  --success: #22c55e;
  --success-soft: #0f2e1b;
  --success-soft-foreground: #86efac;
  --warning: #f59e0b;
  --warning-soft: #36260a;
  --warning-soft-foreground: #fcd34d;
  --danger: #ef4444;
  --danger-soft: #3a1518;
  --danger-soft-foreground: #fca5a5;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.25rem; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; font-weight: 600; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--primary); font-weight: 500; }
a.link:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.2em; }
.icon-sm { width: 1em; height: 1em; }
.icon-lg { width: 1.75em; height: 1.75em; }
.icon-xl { width: 2.5rem; height: 2.5rem; }

/* ---------- Utilitaires ---------- */
.muted { color: var(--muted-foreground); }
.small { font-size: .875rem; }
.xs { font-size: .78rem; }
.bold { font-weight: 600; }
.big { font-size: 1.15rem; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.center { text-align: center; }
.right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: .5rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.5rem; }
.row { display: flex; align-items: center; gap: .75rem; }
.row-wrap { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.ml-auto { margin-left: auto; }
.mt { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mb { margin-bottom: 1rem; }
.w-full { width: 100%; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.split { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .hide-mobile { display: none !important; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--control-height); padding: 0 1.1rem;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 1rem; line-height: 1; white-space: nowrap;
  background: var(--primary); color: var(--primary-foreground);
  cursor: pointer; user-select: none; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-outline { background: var(--card); color: var(--foreground); border-color: var(--input); }
.btn-outline:hover { background: var(--muted); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); box-shadow: none; }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; color: var(--foreground); box-shadow: none; }
.btn-ghost:hover { background: var(--muted); }
.btn-danger { background: var(--danger-soft); color: var(--danger-soft-foreground); box-shadow: none; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success); filter: brightness(.93); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent); filter: brightness(.93); }
.btn-sm { min-height: 38px; padding: 0 .8rem; font-size: .9rem; border-radius: 8px; }
.btn-lg { min-height: 60px; padding: 0 1.6rem; font-size: 1.1rem; border-radius: var(--radius); }
.btn-xl { min-height: 76px; padding: 0 1.8rem; font-size: 1.25rem; border-radius: var(--radius); }
.btn-icon { width: var(--control-height); padding: 0; }
.btn-icon.btn-sm { width: 38px; }
.btn-block { width: 100%; }

/* ---------- Cartes ---------- */
.card {
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header { padding: 1.1rem 1.25rem 0; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card-title { font-size: 1.1rem; font-weight: 650; display: flex; align-items: center; gap: .5rem; }
.card-desc { color: var(--muted-foreground); font-size: .9rem; margin-top: .15rem; }
.card-body { padding: 1.25rem; }
.card-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: .75rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
a.card, .card-link { display: block; transition: border-color .15s, box-shadow .15s, transform .1s; }
a.card:hover, .card-link:hover { border-color: var(--primary); box-shadow: var(--shadow); }
a.card:active { transform: scale(.995); }
.card-accent { border-left: 5px solid var(--primary); }
.card-accent.is-info { border-left-color: var(--accent); }
.card-accent.is-success { border-left-color: var(--success); }
.card-accent.is-warning { border-left-color: var(--warning); }
.card-accent.is-danger { border-left-color: var(--danger); }
.card-accent.is-muted { border-left-color: var(--input); }

/* Carte « chiffre clé » */
.stat { padding: 1.1rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px; flex: none;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-soft-foreground);
}
.stat-icon.is-info { background: var(--accent-soft); color: var(--accent-soft-foreground); }
.stat-icon.is-success { background: var(--success-soft); color: var(--success-soft-foreground); }
.stat-icon.is-warning { background: var(--warning-soft); color: var(--warning-soft-foreground); }
.stat-icon.is-muted { background: var(--muted); color: var(--muted-foreground); }
.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat-label { color: var(--muted-foreground); font-size: .9rem; }

/* Grosse tuile d'action (accueil ouvrier) */
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  min-height: 130px; padding: 1.25rem; text-align: center; font-weight: 650; font-size: 1.1rem;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  cursor: pointer; transition: border-color .15s, transform .05s;
}
.tile:hover { border-color: var(--primary); }
.tile:active { transform: scale(.98); }
.tile .icon { width: 2.4rem; height: 2.4rem; color: var(--primary); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .65rem;
  border-radius: 999px; font-size: .8rem; font-weight: 600; line-height: 1.3; white-space: nowrap;
  background: var(--muted); color: var(--muted-foreground);
}
.badge-primary, .badge-danger { background: var(--danger-soft); color: var(--danger-soft-foreground); }
.badge-info { background: var(--accent-soft); color: var(--accent-soft-foreground); }
.badge-success { background: var(--success-soft); color: var(--success-soft-foreground); }
.badge-warning { background: var(--warning-soft); color: var(--warning-soft-foreground); }
.badge-muted { background: var(--muted); color: var(--muted-foreground); }
.badge-lg { font-size: .95rem; padding: .35rem .85rem; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; flex: none; display: inline-block; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: .4rem; }
.label { font-weight: 600; font-size: .95rem; }
.label .req { color: var(--primary); }
.help { color: var(--muted-foreground); font-size: .85rem; }
.error-text { color: var(--danger); font-size: .88rem; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: var(--control-height); padding: .6rem .85rem;
  background: var(--card); color: var(--foreground);
  border: 1px solid var(--input); border-radius: var(--radius-sm);
  font: inherit; font-size: 1rem; transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-foreground); opacity: .8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; tab-size: 4; }
.select {
  padding-right: 2.4rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center;
}
select[multiple].select { background-image: none; padding-right: .85rem; min-height: 140px; }
.input-lg { min-height: 60px; font-size: 1.15rem; padding: .8rem 1rem; border-radius: var(--radius); }
.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.25rem; }

/* Case à cocher / radio / interrupteur */
.check { display: flex; align-items: center; gap: .7rem; min-height: 44px; cursor: pointer; font-weight: 500; }
.check input[type="checkbox"], .check input[type="radio"] { width: 1.5rem; height: 1.5rem; accent-color: var(--primary); flex: none; cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; gap: .75rem; cursor: pointer; font-weight: 500; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 54px; height: 32px; border-radius: 999px; background: var(--input); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked + .track { background: var(--success); }
.switch input:checked + .track::after { transform: translateX(22px); }
.switch input:focus-visible + .track { outline: 3px solid var(--ring); outline-offset: 2px; }

/* Choix sous forme de grosses cartes (radio) */
.choice-cards { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.choice-card { position: relative; }
.choice-card input { position: absolute; opacity: 0; inset: 0; }
.choice-card > span, .choice-card > label {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center;
  min-height: 96px; padding: 1rem; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--card); font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s;
}
.choice-card input:checked + span, .choice-card input:checked + label { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-soft-foreground); }
.choice-card input:focus-visible + span, .choice-card input:focus-visible + label { outline: 3px solid var(--ring); outline-offset: 2px; }

/* Contrôle segmenté (ex. avancement 0 / 25 / 50 / 75 / 100) */
.segmented { display: inline-flex; background: var(--muted); border-radius: var(--radius-sm); padding: 4px; gap: 2px; max-width: 100%; }
.segmented button, .segmented a, .segmented label {
  min-height: 42px; min-width: 56px; padding: 0 .75rem; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 7px; font-weight: 600; font-size: .95rem; color: var(--muted-foreground); cursor: pointer;
}
.segmented .is-active, .segmented input:checked + label { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm); }
.segmented .is-active.is-done { background: var(--success); color: #fff; }
.segmented.is-block { display: flex; }
.segmented.is-block > * { flex: 1; }

/* Barre de recherche */
.search { position: relative; }
.search .icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.search .input { padding-left: 2.9rem; }
.search .input-lg { padding-left: 3.2rem; }

/* Compteur +/- */
.stepper-qty { display: inline-flex; align-items: center; gap: .4rem; }
.stepper-qty .input { width: 90px; text-align: center; font-weight: 700; font-size: 1.1rem; }

/* ---------- Tableaux & listes ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted-foreground); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; padding: .75rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: .9rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--border); min-height: 64px; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, button.list-item:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); }
button.list-item { width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; }
.list-item .chevron { color: var(--muted-foreground); margin-left: auto; flex: none; }
.list-title { font-weight: 600; }
.list-sub { color: var(--muted-foreground); font-size: .9rem; }

.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-weight: 700; font-size: .9rem; letter-spacing: .02em;
}
.avatar-sm { width: 30px; height: 30px; font-size: .72rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--card); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.icon-chip { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--muted); color: var(--muted-foreground); }
.icon-chip.is-primary { background: var(--primary-soft); color: var(--primary-soft-foreground); }
.icon-chip.is-info { background: var(--accent-soft); color: var(--accent-soft-foreground); }
.icon-chip.is-success { background: var(--success-soft); color: var(--success-soft-foreground); }
.icon-chip.is-warning { background: var(--warning-soft); color: var(--warning-soft-foreground); }

.empty { padding: 2.5rem 1.25rem; text-align: center; color: var(--muted-foreground); display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.empty .icon { width: 2.6rem; height: 2.6rem; opacity: .6; }
.empty strong { color: var(--foreground); font-size: 1.05rem; }

/* Définitions clé → valeur */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1.25rem; margin: 0; }
.dl dt { color: var(--muted-foreground); font-size: .92rem; }
.dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Progression ---------- */
.progress { height: 10px; background: var(--muted); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }
.progress.is-done > span { background: var(--success); }
.progress-lg { height: 14px; }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: .25rem; background: var(--muted); padding: 4px; border-radius: var(--radius-sm); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; min-height: 42px; padding: 0 1rem; display: inline-flex; align-items: center; gap: .45rem;
  border-radius: 7px; font-weight: 600; font-size: .95rem; color: var(--muted-foreground); border: 0; background: none; cursor: pointer; white-space: nowrap;
}
.tab.is-active { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm); }
.tab .count { background: var(--border); color: var(--foreground); border-radius: 999px; padding: 0 .5rem; font-size: .78rem; line-height: 1.5; }

/* ---------- Assistant pas-à-pas (stepper) ---------- */
.steps { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.5rem; }
.step-dot { display: flex; align-items: center; gap: .6rem; color: var(--muted-foreground); font-weight: 600; font-size: .95rem; flex: none; background: none; border: 0; padding: 0; cursor: pointer; }
.step-dot .n { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--muted); border: 2px solid var(--border); font-weight: 700; }
.step-dot.is-active { color: var(--foreground); }
.step-dot.is-active .n { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-dot.is-done .n { background: var(--success); border-color: var(--success); color: #fff; }
.step-line { flex: 1; height: 2px; background: var(--border); min-width: 12px; }
@media (max-width: 700px) { .step-dot .t { display: none; } .step-dot.is-active .t { display: inline; } }
.step-panel { display: none; }
.step-panel.is-active { display: block; animation: fade-in .2s; }

/* ---------- Alertes & messages ---------- */
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card); }
.alert .icon { margin-top: .1rem; }
.alert-info { background: var(--accent-soft); color: var(--accent-soft-foreground); border-color: transparent; }
.alert-success { background: var(--success-soft); color: var(--success-soft-foreground); border-color: transparent; }
.alert-warning { background: var(--warning-soft); color: var(--warning-soft-foreground); border-color: transparent; }
.alert-danger, .alert-error { background: var(--danger-soft); color: var(--danger-soft-foreground); border-color: transparent; }

.toasts { position: fixed; z-index: 100; top: 1rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; width: min(520px, calc(100vw - 2rem)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: .7rem; padding: .9rem 1.1rem;
  background: var(--foreground); color: var(--background); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  font-weight: 500; animation: toast-in .25s ease-out;
}
.toast.is-success .icon { color: #4ade80; }
.toast.is-error .icon, .toast.is-danger .icon { color: #f87171; }
.toast.is-warning .icon { color: #fbbf24; }
.toast.is-leaving { opacity: 0; transform: translateY(-8px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- Boîte de dialogue (<dialog class="dialog">) ---------- */
.dialog {
  border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); padding: 0;
  background: var(--card); color: var(--card-foreground); box-shadow: var(--shadow-lg);
  width: min(560px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem);
}
.dialog.dialog-lg { width: min(820px, calc(100vw - 2rem)); }
.dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px); }
.dialog[open] { animation: fade-in .18s; display: flex; flex-direction: column; }
.dialog-header { padding: 1.25rem 1.25rem .5rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dialog-title { font-size: 1.2rem; font-weight: 650; }
.dialog-body { padding: .5rem 1.25rem 1.25rem; overflow-y: auto; }
.dialog-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; }

/* ---------- Structure : espace gérant ---------- */
.app { display: flex; min-height: 100dvh; }
.sidebar {
  width: var(--sidebar-width); flex: none; background: var(--card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; z-index: 40;
}
.sidebar-brand { padding: 1.1rem 1.25rem; display: flex; align-items: center; gap: .75rem; }
.brand-logo { background: #fff; border-radius: 10px; padding: 6px 10px; display: inline-flex; border: 1px solid var(--border); }
.brand-logo img { height: 34px; width: auto; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .25rem .75rem 1rem; display: flex; flex-direction: column; gap: 2px; }
.nav-section { padding: 1rem .75rem .35rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground); }
.nav-link {
  display: flex; align-items: center; gap: .8rem; min-height: 46px; padding: 0 .8rem; border-radius: var(--radius-sm);
  font-weight: 550; color: var(--muted-foreground); transition: background .12s, color .12s;
}
.nav-link:hover { background: var(--muted); color: var(--foreground); }
.nav-link.is-active { background: var(--primary-soft); color: var(--primary-soft-foreground); }
.nav-link .badge { margin-left: auto; }
.sidebar-footer { border-top: 1px solid var(--border); padding: .75rem; }
.user-chip { display: flex; align-items: center; gap: .7rem; padding: .5rem; border-radius: var(--radius-sm); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-height); display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem;
  background: color-mix(in srgb, var(--background) 85%, transparent); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 650; font-size: 1.05rem; }
.content { padding: 1.5rem; width: 100%; max-width: 1280px; margin: 0 auto; flex: 1; }
.content-narrow { max-width: 860px; }
.menu-toggle { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 1023px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 35; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 1rem; }
  .content { padding: 1rem; }
}

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-header .sub { color: var(--muted-foreground); margin-top: .2rem; }
.page-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted-foreground); font-weight: 550; margin-bottom: .6rem; min-height: 36px; }
.back-link:hover { color: var(--foreground); }

/* ---------- Structure : espace ouvrier ---------- */
.terrain { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.terrain .content { max-width: 980px; }
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; display: flex; justify-content: center;
  background: var(--card); border-top: 1px solid var(--border); padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav-inner { display: flex; width: 100%; max-width: 720px; gap: 4px; }
.bottom-link {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 62px; border-radius: 12px; font-size: .8rem; font-weight: 600; color: var(--muted-foreground);
}
.bottom-link .icon { width: 1.6rem; height: 1.6rem; }
.bottom-link.is-active { color: var(--primary); background: var(--primary-soft); }

/* ---------- Connexion & code ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; background:
  radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%),
  radial-gradient(800px 500px at 110% 110%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
  var(--background); }
.auth-card { width: min(440px, 100%); }
.auth-logo { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.auth-logo .brand-logo { padding: 12px 18px; border-radius: 16px; box-shadow: var(--shadow); }
.auth-logo img { height: 64px; }
.pin-dots { display: flex; justify-content: center; gap: 1rem; margin: 1.25rem 0; }
.pin-dots span { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--input); transition: .12s; }
.pin-dots span.is-filled { background: var(--primary); border-color: var(--primary); transform: scale(1.1); }
.pin-dots.is-error { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; max-width: 320px; margin: 0 auto; }
.keypad button {
  height: 72px; border-radius: 18px; border: 1px solid var(--border); background: var(--card);
  font-size: 1.7rem; font-weight: 600; cursor: pointer; transition: background .1s, transform .05s; box-shadow: var(--shadow-sm);
  display: grid; place-items: center;
}
.keypad button:active { background: var(--muted); transform: scale(.96); }
.keypad button.is-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted-foreground); }

/* ---------- Planning ---------- */
.planning { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: auto; }
.planning-grid { display: grid; grid-template-columns: 170px repeat(var(--days, 7), minmax(140px, 1fr)); min-width: 900px; }
.planning-head { position: sticky; top: 0; z-index: 2; background: var(--card); padding: .7rem .6rem; text-align: center; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); font-weight: 600; }
.planning-head small { display: block; color: var(--muted-foreground); font-weight: 500; text-transform: capitalize; }
.planning-head.is-today { color: var(--primary); }
.planning-head.is-today .daynum { background: var(--primary); color: #fff; border-radius: 999px; padding: 0 .55rem; }
.planning-corner { border-left: 0; text-align: left; }
.planning-worker { position: sticky; left: 0; z-index: 1; background: var(--card); padding: .75rem .7rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.planning-cell {
  position: relative; min-height: 96px; padding: 6px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 5px; cursor: pointer; transition: background .1s;
}
.planning-cell:hover { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.planning-cell.is-weekend { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.planning-cell.is-today { background: color-mix(in srgb, var(--primary-soft) 35%, transparent); }
.planning-cell .add { position: absolute; right: 6px; bottom: 6px; opacity: 0; color: var(--primary); transition: opacity .1s; }
.planning-cell:hover .add { opacity: 1; }
.planning-grid > .is-last-row { border-bottom: 0; }
.event {
  display: block; padding: .4rem .55rem; border-radius: 8px; font-size: .82rem; line-height: 1.3;
  background: color-mix(in srgb, var(--ev, var(--primary)) 14%, var(--card)); border-left: 4px solid var(--ev, var(--primary));
  color: var(--foreground); cursor: pointer; overflow: hidden;
}
.event:hover { background: color-mix(in srgb, var(--ev, var(--primary)) 24%, var(--card)); }
.event b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event span { color: var(--muted-foreground); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event.is-done { opacity: .6; }
.event.is-cancelled { text-decoration: line-through; opacity: .5; }

/* Calendrier mensuel */
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-grid .dow { padding: .6rem; text-align: center; font-weight: 600; font-size: .82rem; color: var(--muted-foreground); text-transform: uppercase; border-bottom: 1px solid var(--border); }
.month-day { min-height: 118px; padding: 6px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.month-day:nth-child(7n + 1) { border-left: 0; }
.month-day:hover { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
.month-day.is-out { opacity: .45; }
.month-day .daynum { font-weight: 600; font-size: .9rem; align-self: flex-start; padding: 0 .4rem; border-radius: 999px; }
.month-day.is-today .daynum { background: var(--primary); color: #fff; }

/* ---------- Photos ---------- */
.photo-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.photo { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--muted); border: 1px solid var(--border); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .photo-del { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo-add { aspect-ratio: 1; border: 2px dashed var(--input); border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: var(--muted-foreground); font-weight: 600; cursor: pointer; background: none; text-align: center; padding: .5rem; }
.photo-add:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Signature ---------- */
.signature-pad { border: 2px dashed var(--input); border-radius: var(--radius); background: #fff; touch-action: none; width: 100%; height: 200px; display: block; cursor: crosshair; }

/* ---------- Scanner ---------- */
.scanner { border-radius: var(--radius); overflow: hidden; background: #000; position: relative; min-height: 260px; }
.scanner video { width: 100% !important; height: auto !important; display: block; }
.scanner-hint { position: absolute; inset: auto 0 0 0; padding: .6rem; text-align: center; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); font-weight: 500; font-size: .9rem; }

/* ---------- Chrono ---------- */
.timer { font-variant-numeric: tabular-nums; font-size: 2.4rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.pulse { width: .7rem; height: .7rem; border-radius: 50%; background: var(--success); display: inline-block; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }

/* ---------- Tâches (ouvrier) ---------- */
.task { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .7rem; }
.task:last-child { border-bottom: 0; }
.task-label { font-weight: 600; font-size: 1.05rem; display: flex; align-items: center; gap: .6rem; }
.task.is-done .task-label { color: var(--success); }
.task-check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--input); display: grid; place-items: center; flex: none; color: transparent; }
.task.is-done .task-check { background: var(--success); border-color: var(--success); color: #fff; }

/* ---------- Impression ---------- */
@media print {
  .sidebar, .topbar, .bottom-nav, .no-print, .toasts { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Première lettre en majuscule (dates : « vendredi 13 novembre » → « Vendredi 13 novembre ») */
[data-cap] { display: block; }
span[data-cap], small[data-cap] { display: inline-block; }
[data-cap]::first-letter { text-transform: uppercase; }

/* ---------- Menu latéral repliable (mémorisé sur l'appareil) ---------- */
.sidebar { transition: width .18s ease, transform .22s ease; }
.brand-mini { display: none; }
@media (min-width: 1024px) {
  .menu-toggle { display: inline-flex; }
  html.nav-collapsed .sidebar { width: 76px; }
  html.nav-collapsed .sidebar-brand { padding: 1.1rem 0; justify-content: center; }
  html.nav-collapsed .brand-full { display: none; }
  html.nav-collapsed .brand-mini { display: block; width: 40px; height: 40px; }
  html.nav-collapsed .sidebar-nav { padding: .25rem .6rem 1rem; }
  html.nav-collapsed .nav-link { justify-content: center; padding: 0; position: relative; }
  html.nav-collapsed .nav-link > span:not(.badge) { display: none; }
  html.nav-collapsed .nav-link .badge { position: absolute; top: 4px; right: 4px; margin: 0; padding: 0 .35rem; font-size: .68rem; }
  html.nav-collapsed .nav-section { font-size: 0; padding: .5rem 0 .4rem; border-top: 1px solid var(--border); margin-top: .5rem; }
  html.nav-collapsed .user-chip { justify-content: center; padding: .25rem 0; }
  html.nav-collapsed .user-chip .grow { display: none; }
}

/* ---------- Tableaux de bord : une seule colonne, une section sous l'autre ---------- */
.dash { display: flex; flex-direction: column; gap: 2rem; max-width: 980px; margin: 0 auto; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; flex-wrap: wrap; }
.section-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: .6rem; }
.section-title .icon { width: 1.5rem; height: 1.5rem; color: var(--primary); }
.section-title .count { font-size: .9rem; font-weight: 700; background: var(--muted); color: var(--muted-foreground); border-radius: 999px; padding: .1rem .65rem; }
.section-title.is-danger, .section-title.is-danger .icon { color: var(--danger); }

/* Ligne d'intervention : heure à gauche, texte, état à droite */
.irow { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); min-height: 84px; }
.irow:last-child { border-bottom: 0; }
a.irow:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); }
.irow-time { flex: none; width: 78px; text-align: center; border-right: 2px solid var(--border); padding-right: 1rem; }
.irow-time b { display: block; font-size: 1.25rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.irow-time span { font-size: .82rem; color: var(--muted-foreground); }
.irow-time.is-day b { font-size: 1.5rem; }
.irow-main { flex: 1; min-width: 0; }
.irow-title { font-weight: 650; font-size: 1.1rem; }
.irow-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
@media (max-width: 600px) { .irow { flex-wrap: wrap; } .irow-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; } }

/* Semaine en 7 colonnes */
.week { display: grid; grid-template-columns: repeat(7, minmax(112px, 1fr)); min-width: 780px; }
.week-day { border-left: 1px solid var(--border); min-height: 150px; display: flex; flex-direction: column; cursor: pointer; }
.week-day:first-child { border-left: 0; }
.week-day:hover { background: color-mix(in srgb, var(--primary-soft) 45%, transparent); }
.week-day.is-weekend { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.week-day-head { padding: .6rem .4rem; text-align: center; border-bottom: 1px solid var(--border); font-weight: 600; }
.week-day-head small { display: block; color: var(--muted-foreground); font-weight: 500; }
.week-day-head .daynum { display: inline-block; min-width: 2rem; font-size: 1.15rem; border-radius: 999px; padding: 0 .4rem; }
.week-day.is-today .week-day-head { color: var(--primary); }
.week-day.is-today .daynum { background: var(--primary); color: #fff; }
.week-day-body { padding: 6px; display: flex; flex-direction: column; gap: 5px; flex: 1; }

/* Lieu / mission dans la liste des tâches */
.place { padding: .9rem 1.25rem; background: var(--muted); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.place:first-child { border-top: 0; }
.place-n { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: grid; place-items: center; flex: none; }
html.nav-collapsed .brand-logo { padding: 0; border: 0; background: none; }

/* =========================================================================
   Densité « shadcn/ui » : boutons de même taille partout, interface plus fine.
   (Ce bloc ajuste les tailles définies plus haut.)
   ========================================================================= */
:root { --control-height: 40px; --radius: 10px; --radius-sm: 8px; --topbar-height: 56px; --sidebar-width: 240px; }
body { font-size: 15px; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }

/* Une seule hauteur de bouton (40 px), une variante compacte (34 px). */
.btn, .btn-lg, .btn-xl {
  min-height: var(--control-height); padding: 0 1rem; font-size: .9rem; font-weight: 500;
  border-radius: var(--radius-sm); box-shadow: none; gap: .45rem;
}
.btn-outline { box-shadow: var(--shadow-sm); border-color: var(--border); }
.btn-sm { min-height: 34px; padding: 0 .7rem; font-size: .85rem; border-radius: 7px; }
.btn-icon, .btn-icon.btn-lg, .btn-icon.btn-xl { width: var(--control-height); padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn .icon { width: 1.1em; height: 1.1em; }

.input, .select, .textarea { font-size: .95rem; padding: .5rem .75rem; }
.input-lg { min-height: 44px; font-size: 1rem; padding: .55rem .85rem; border-radius: var(--radius-sm); }
.search .input-lg { padding-left: 2.7rem; }
.label { font-size: .875rem; font-weight: 500; }

.card { box-shadow: none; }
.card-header { padding: 1rem 1.1rem 0; }
.card-body { padding: 1.1rem; }
.card-footer { padding: .85rem 1.1rem; }
.card-title { font-size: 1rem; font-weight: 600; }
.stat { padding: .9rem 1.1rem; gap: .8rem; }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; }
.stat-value { font-size: 1.35rem; }
.stat-label { font-size: .85rem; }
.tile { min-height: 96px; font-size: 1rem; font-weight: 600; box-shadow: none; }
.tile .icon { width: 1.8rem; height: 1.8rem; }
.badge { font-size: .75rem; font-weight: 500; padding: .15rem .55rem; }
.badge-lg { font-size: .85rem; padding: .25rem .7rem; }
.big { font-size: 1.05rem; }

.nav-link { min-height: 38px; font-weight: 500; font-size: .92rem; gap: .65rem; }
.sidebar-brand { padding: .9rem 1rem; }
.brand-logo img { height: 30px; }
.tab, .segmented button, .segmented a, .segmented label { min-height: 34px; font-size: .875rem; font-weight: 500; }
.task .segmented button { min-height: 40px; }
.list-item { min-height: 56px; padding: .75rem 1.1rem; }
.task { padding: .9rem 1.1rem; }
.task-label { font-size: 1rem; }
.table th { padding: .6rem .9rem; font-size: .75rem; }
.table td { padding: .7rem .9rem; }
.step-dot .n { width: 32px; height: 32px; font-size: .9rem; }
.choice-card > span, .choice-card > label { min-height: 80px; border-width: 1px; font-weight: 500; }
.choice-card input:checked + span, .choice-card input:checked + label { box-shadow: 0 0 0 1px var(--primary); }
.avatar { width: 36px; height: 36px; font-size: .8rem; }
.avatar-sm { width: 26px; height: 26px; font-size: .66rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
.icon-chip { width: 38px; height: 38px; border-radius: 9px; }
.timer { font-size: 2rem; }
.bottom-link { min-height: 54px; font-size: .75rem; }
.bottom-link .icon { width: 1.4rem; height: 1.4rem; }
.section-title { font-size: 1.15rem; font-weight: 600; }
.section-title .icon { width: 1.25rem; height: 1.25rem; }
.irow { min-height: 68px; padding: .8rem 1.1rem; }
.irow-title { font-size: 1rem; font-weight: 600; }
.irow-time b { font-size: 1.1rem; }
.irow-time.is-day b { font-size: 1.3rem; }
.dialog-title { font-size: 1.05rem; font-weight: 600; }
.auth-logo img { height: 52px; }

/* Carte chiffre cliquable : le chiffre reste à côté de l'icône */
a.card.stat { display: flex; }

/* Logo sans cadre (fond blanc discret uniquement en thème sombre, pour rester lisible) */
.brand-logo, .auth-logo .brand-logo { border: 0; background: transparent; padding: 0; box-shadow: none; border-radius: 8px; }
:root[data-theme="dark"] .brand-logo { background: #fff; padding: 5px 9px; }
:root[data-theme="dark"] .auth-logo .brand-logo { padding: 10px 16px; }
:root[data-theme="dark"].nav-collapsed .brand-logo { background: none; padding: 0; }

/* Résultats de recherche du stock (ouvrier) : lignes compactes pour en voir plus à l'écran */
a.card.stock-card { display: flex; align-items: center; gap: .75rem; padding: .55rem .9rem; min-height: 52px; }
.stock-card > :first-child { flex: 1; min-width: 0; }
.stock-card .name { font-size: .98rem; font-weight: 600; line-height: 1.2; }
.stock-card .meta { font-size: .82rem; margin-top: .1rem; gap: .2rem .8rem; }
#stock-results { gap: .4rem; }
.stock-card .qty-side { display: flex; flex-direction: row-reverse; align-items: center; gap: .6rem; white-space: nowrap; }
.stock-card .qty-side b { font-size: 1.05rem; }

/* Documents dans la grille de photos */
.photo.is-doc { background: var(--card); }
.doc-tile { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; padding: .5rem; font-size: 1.8rem; text-align: center; }
.doc-tile span { font-size: .75rem; font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.photo-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: .2rem .4rem; font-size: .7rem; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); }
.photo.is-doc .photo-meta { color: var(--muted-foreground); background: none; text-align: center; }
.task-check[role="button"] { cursor: pointer; }
.task[data-locked] .segmented button { cursor: not-allowed; opacity: .7; }

/* ---------- Écran ouvrier : Go / Fin de mission, raccourcis ---------- */
.btn.btn-go { min-height: 56px; font-size: 1.1rem; font-weight: 600; }
.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.quick-actions .tile { min-height: 84px; font-size: .9rem; padding: .75rem .5rem; }
.quick-actions .tile .icon { width: 1.6rem; height: 1.6rem; }
.place.is-done .place-n { background: var(--success); }
.place.is-current { background: var(--primary-soft); }
.place-action { padding: .9rem 1.1rem 1.1rem; }

/* Liste à choix unique (ex. client d'une intervention) : lignes tactiles, fonctionne sur téléphone. */
.pick-list { position: relative; border: 1px solid var(--input); border-radius: var(--radius-sm); background: var(--card); max-height: 264px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: .25rem; }
.pick-item { position: relative; display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: .45rem .7rem; border-radius: 8px; cursor: pointer; }
.pick-item[hidden] { display: none; }
.pick-item input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pick-item .icon { margin-left: auto; flex: none; color: var(--primary); visibility: hidden; }
.pick-item:hover { background: var(--muted); }
.pick-item:has(input:checked) { background: var(--primary-soft); }
.pick-item:has(input:checked) .icon { visibility: visible; }
.pick-item:has(input:checked) .pick-title { font-weight: 600; }
.pick-item:has(input:focus-visible) { outline: 3px solid var(--ring); outline-offset: -2px; }
.pick-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pick-title { overflow-wrap: anywhere; }
.pick-sub { color: var(--muted-foreground); font-size: .85rem; }
.pick-empty { margin: 0; padding: .9rem .7rem; color: var(--muted-foreground); font-size: .9rem; }
