/* Lauriol Suivi — feuille de style unique, mobile d'abord, sans dépendance externe. */
:root {
    --brand: #0f3550;
    --brand-2: #e8700a;
    --brand-l: #e6eef5;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f4f6f8;
    --card: #fff;
    --focus: #2563eb;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .04);
    --tabbar: 64px;
    --c-slate: #475569; --l-slate: #e2e8f0;
    --c-blue: #1d4ed8;  --l-blue: #dbeafe;
    --c-violet: #6d28d9; --l-violet: #ede9fe;
    --c-green: #15803d; --l-green: #dcfce7;
    --c-amber: #b45309; --l-amber: #fef3c7;
    --c-teal: #0f766e;  --l-teal: #ccfbf1;
    --c-red: #b91c1c;   --l-red: #fee2e2;
    --c-orange: #c2410c; --l-orange: #ffedd5;
    --c-gray: #475569;  --l-gray: #f1f5f9;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--ink);
    font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body.app { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 22px; margin: 0; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Icônes */
.i { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -3px; }
.chev { margin-left: auto; color: var(--muted); }
.c-red { color: var(--c-red); } .c-amber { color: var(--c-amber); }

/* Barre supérieure */
.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
    height: 56px; padding: 0 12px; padding-top: env(safe-area-inset-top);
    background: var(--brand); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; min-width: 0; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-mark {
    display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0;
    border-radius: 9px; background: var(--brand-2); color: #fff; font-weight: 800; font-size: 18px;
}
.top-search { display: none; }
.icon-btn { margin-left: auto; display: grid; place-items: center; width: 44px; height: 44px; color: #fff; border-radius: 10px; }
.icon-btn .i { width: 22px; height: 22px; }
.top-user { display: none; }

/* Navigation */
.sidenav { display: none; }
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: #fff; border-top: 1px solid var(--line);
}
.tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600;
}
.tabbar a .i { width: 22px; height: 22px; }
.tabbar a.active { color: var(--brand); }
.tabbar a.active .i { color: var(--brand-2); }
.main { max-width: 1180px; margin: 0 auto; padding: 16px 14px 24px; }
.main-auth { padding-top: 0; }
.only-desktop { display: none !important; }

@media (min-width: 960px) {
    body.app { padding-bottom: 0; }
    .tabbar, .only-mobile { display: none !important; }
    .only-desktop { display: flex !important; }
    .top-search {
        display: flex; align-items: center; gap: 8px; flex: 1; max-width: 520px; margin-left: 24px;
        padding: 0 12px; background: rgba(255, 255, 255, .12); border-radius: 10px;
    }
    .top-search input { flex: 1; border: 0; background: transparent; color: #fff; padding: 9px 0; font-size: 15px; outline: none; }
    .top-search input::placeholder { color: rgba(255, 255, 255, .7); }
    .top-user { margin-left: auto; align-items: center; gap: 12px; }
    .top-user small { opacity: .7; }
    .top-user .btn-ghost { color: #fff; }
    .shell { display: grid; grid-template-columns: 228px 1fr; min-height: calc(100vh - 56px); }
    .sidenav {
        display: flex; flex-direction: column; gap: 2px; padding: 16px 10px; position: sticky; top: 56px;
        height: calc(100vh - 56px); background: #fff; border-right: 1px solid var(--line);
    }
    .sidenav a {
        display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
        color: var(--ink-2); text-decoration: none; font-weight: 600;
    }
    .sidenav a:hover { background: var(--l-gray); }
    .sidenav a.active { background: var(--brand-l); color: var(--brand); }
    .main { padding: 22px 26px 40px; width: 100%; }
}

/* En-têtes de page */
.page-head, .dash-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 22px 2px 8px; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.sub-title { margin: 20px 0 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.count {
    display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; text-align: center;
    background: var(--l-slate); color: var(--ink-2); font-size: 12px; font-weight: 700; line-height: 20px;
}

/* Cartes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
.card-pad { padding: 16px; }
.card-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; font-weight: 700; cursor: default; }
details > summary.card-title { cursor: pointer; margin: 0; list-style: none; }
details[open] > summary.card-title { margin-bottom: 12px; }
.card-head {
    display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 16px; font-size: 15px;
    border-bottom: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.card-head-green { border-left-color: var(--c-green); } .card-head-green .i { color: var(--c-green); }
.card-head-red { border-left-color: var(--c-red); } .card-head-red .i { color: var(--c-red); }
.card-head-amber { border-left-color: var(--c-amber); } .card-head-amber .i { color: var(--c-amber); }
.grid-2, .grid-3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.dash-grid { margin-top: 14px; }
@media (min-width: 680px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.list-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px;
    color: inherit; text-decoration: none;
}
a.list-item:hover { background: #f8fafc; }
.list-item > .i { color: var(--muted); }
.list-compact .list-item { padding: 10px 0; min-height: 0; }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-title { font-weight: 650; overflow-wrap: anywhere; }
.item-title small { font-weight: 500; color: var(--muted); }
.item-sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.item-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.item-right { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.avatar {
    display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%;
    background: var(--brand-l); color: var(--brand); font-weight: 800;
}
.code { font: 600 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--l-gray); color: var(--ink-2); padding: 1px 6px; border-radius: 6px; }
.mat-row, li.rl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; }
.list-compact .mat-row { padding: 10px 0; }

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 700; line-height: 1.3; white-space: nowrap;
    background: var(--l-gray); color: var(--c-gray);
}
.badge .i { width: 13px; height: 13px; vertical-align: 0; }
.badge-slate { background: var(--l-slate); color: var(--c-slate); }
.badge-blue { background: var(--l-blue); color: var(--c-blue); }
.badge-violet { background: var(--l-violet); color: var(--c-violet); }
.badge-green { background: var(--l-green); color: var(--c-green); }
.badge-amber { background: var(--l-amber); color: var(--c-amber); }
.badge-teal { background: var(--l-teal); color: var(--c-teal); }
.badge-red { background: var(--l-red); color: var(--c-red); }
.badge-orange { background: var(--l-orange); color: var(--c-orange); }
.week {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 600; background: var(--l-gray); color: var(--c-gray); white-space: nowrap;
}
.week .i { width: 13px; height: 13px; vertical-align: 0; }
.week b { font-weight: 800; }
.week-late { background: var(--l-red); color: var(--c-red); }
.week-now { background: var(--l-orange); color: var(--c-orange); }
.week-soon { background: var(--l-amber); color: var(--c-amber); }
.week-none { background: transparent; border: 1px dashed #cbd5e1; }
.tag { font-size: 11px; background: var(--l-gray); padding: 1px 6px; border-radius: 6px; }

/* Boutons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 14px;
    border: 1px solid transparent; border-radius: 10px; font: inherit; font-weight: 650; font-size: 15px;
    text-decoration: none; cursor: pointer; background: #fff; color: var(--ink); -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.btn:disabled, .btn[aria-busy="true"] { opacity: .55; cursor: progress; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #0b2a40; }
.btn-secondary { background: #fff; border-color: #cbd5e1; color: var(--ink); }
.btn-secondary:hover { background: #f8fafc; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-l); }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-warn { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
.btn-link { background: none; border: 0; padding: 0 4px; min-height: 0; color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: underline; }
.btn-sm { min-height: 34px; padding: 5px 11px; font-size: 14px; }
.btn-lg { min-height: 50px; padding: 12px 18px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.inline-form { display: inline-flex; margin: 0; }
details > summary.btn { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Formulaires */
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 650; color: var(--ink-2); }
input, select, textarea {
    width: 100%; font: inherit; font-size: 16px; font-weight: 400; color: var(--ink);
    padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff;
}
textarea { resize: vertical; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--brand); margin: 0; }
input[type="file"] { padding: 8px; background: #f8fafc; }
.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
.check span { display: flex; flex-direction: column; }
.check small { color: var(--muted); font-weight: 400; }
.stack { display: flex; flex-direction: column; gap: 14px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.hint { margin: 4px 0 0; font-size: 13px; font-weight: 400; color: var(--muted); }
.radio-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-chips label { position: relative; display: block; font-weight: 500; }
.radio-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-chips span {
    display: inline-block; padding: 9px 14px; border: 1px solid #cbd5e1; border-radius: 999px;
    background: #fff; color: var(--ink); cursor: pointer;
}
.radio-chips input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.radio-chips input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.radio-inline { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 8px; }
.radio-inline label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.radio-cards { display: grid; gap: 8px; }
@media (min-width: 680px) { .radio-cards { grid-template-columns: repeat(3, 1fr); } }
.radio-cards label { position: relative; display: block; }
.radio-cards input { position: absolute; opacity: 0; }
.radio-cards span {
    display: flex; align-items: center; gap: 10px; padding: 14px; border: 2px solid var(--line);
    border-radius: 12px; background: #fff; font-weight: 650; cursor: pointer;
}
.radio-cards span .i { width: 22px; height: 22px; }
.radio-cards input:focus-visible + span { outline: 3px solid var(--focus); }
.rc-ok input:checked + span { border-color: var(--c-teal); background: var(--l-teal); color: var(--c-teal); }
.rc-part input:checked + span { border-color: var(--c-amber); background: var(--l-amber); color: var(--c-amber); }
.rc-ko input:checked + span { border-color: var(--c-red); background: var(--l-red); color: var(--c-red); }
.file-btn { position: relative; flex-direction: row; align-self: flex-start; }
.file-btn input[type="file"] { display: block !important; position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.previews { display: flex; flex-wrap: wrap; gap: 6px; }
.previews:empty { display: none; }
.previews img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.previews .pv-file { font-size: 12px; padding: 4px 8px; background: var(--l-gray); border-radius: 6px; align-self: center; }
.previews .pv-busy { font-size: 13px; color: var(--muted); align-self: center; }
.rows .row-inputs, .free-line {
    display: grid; gap: 6px; padding: 8px; margin-bottom: 8px; border: 1px dashed #cbd5e1; border-radius: 10px; background: #fbfcfe;
}
@media (min-width: 720px) {
    .rows .row-inputs { grid-template-columns: 170px 1fr 80px 150px; }
    .free-line { grid-template-columns: 1.3fr 150px 1.3fr 120px 1fr; align-items: start; }
}
.w-qty { max-width: 100px; }
.inline-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; }
.inline-row input:not([type="checkbox"]) { flex: 1; min-width: 150px; width: auto; }
.inline-row .w-qty { flex: 0 0 90px; min-width: 0; }
.filters { margin-bottom: 12px; max-width: 360px; }
.sticky-actions {
    position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 5; display: flex; flex-wrap: wrap; gap: 8px;
    padding: 10px 0; background: rgba(244, 246, 248, .94); backdrop-filter: blur(4px);
}
@media (min-width: 960px) { .sticky-actions { bottom: 0; } }

/* Recherche */
.search-big {
    display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 0 14px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.search-big .i { color: var(--muted); }
.search-big input { border: 0; padding: 13px 4px; background: transparent; }
.search-big input:focus { outline: none; }
.search-big:focus-within { outline: 2px solid var(--focus); }

/* Autocomplétion */
.ac-wrap { position: relative; }
.ac-list {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 40; margin: 4px 0 0; padding: 4px; list-style: none;
    max-height: 320px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
}
.ac-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.ac-item small { display: block; color: var(--muted); font-size: 13px; }
.ac-item.active, .ac-item:hover { background: var(--l-blue); }
.ac-empty { padding: 10px 12px; color: var(--muted); font-size: 14px; }

/* Filtres en pastilles */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin-bottom: 10px; scrollbar-width: thin; }
.chip {
    display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; padding: 7px 12px; border-radius: 999px;
    border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none;
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .count { background: rgba(15, 23, 42, .08); color: inherit; }
.chip.active .count { background: rgba(255, 255, 255, .22); }

/* Tuiles du tableau de bord */
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 680px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tiles-5 { margin-bottom: 14px; }
@media (min-width: 1100px) { .tiles-5 { grid-template-columns: repeat(5, 1fr); } }
.tile {
    --c: var(--c-gray); --l: var(--l-gray);
    display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--radius);
    background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--c); color: var(--ink);
    text-decoration: none; box-shadow: var(--shadow);
}
a.tile:hover { background: var(--l); }
.tile .i { color: var(--c); }
.tile-num { font-size: 28px; font-weight: 800; line-height: 1.1; }
.tile-label { font-size: 13px; font-weight: 650; color: var(--muted); }
.tile-zero { opacity: .55; box-shadow: none; }
.tile-slate { --c: var(--c-slate); --l: var(--l-slate); }
.tile-blue { --c: var(--c-blue); --l: var(--l-blue); }
.tile-violet { --c: var(--c-violet); --l: var(--l-violet); }
.tile-green { --c: var(--c-green); --l: var(--l-green); }
.tile-amber { --c: var(--c-amber); --l: var(--l-amber); }
.tile-teal { --c: var(--c-teal); --l: var(--l-teal); }
.tile-red { --c: var(--c-red); --l: var(--l-red); }
.tile-orange { --c: var(--c-orange); --l: var(--l-orange); }
.tile-hero {
    grid-column: span 2; border: 0; color: #fff; opacity: 1;
    background: linear-gradient(135deg, #15803d, #16a34a 60%, #22c55e);
}
.tile-hero .i, .tile-hero .tile-label { color: rgba(255, 255, 255, .92); }
.tile-hero .tile-num { font-size: 40px; }
a.tile-hero:hover { background: linear-gradient(135deg, #166534, #15803d); }

/* Fiche chantier */
.ch-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ch-client { font-weight: 700; text-decoration: none; font-size: 15px; }
.ch-head h1 { margin: 4px 0 8px; }
.ch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; }
.quick-adr { color: var(--muted); font-size: 14px; flex-basis: 100%; }
@media (min-width: 680px) { .quick-adr { flex-basis: auto; } }
.actions-bar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin: 12px 0 16px; }
.signal-box[open] { flex-basis: 100%; }
.menu-more { position: relative; }
.menu-pop {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: flex; flex-direction: column; gap: 2px;
    min-width: 210px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
}
.menu-pop .btn { justify-content: flex-start; }
.menu-pop .inline-form, .menu-pop .inline-form .btn { width: 100%; }
.tabs {
    position: sticky; top: 56px; z-index: 10; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
    margin: 0 -14px 14px; padding: 0 8px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
    display: inline-flex; align-items: center; gap: 6px; padding: 12px 10px; white-space: nowrap; color: var(--muted);
    font-size: 14px; font-weight: 650; text-decoration: none; border-bottom: 3px solid transparent;
}
.tab.active { color: var(--brand); border-bottom-color: var(--brand-2); }
@media (min-width: 960px) { .tabs { margin: 0 0 14px; padding: 0; } }
.tab-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.panel-title { margin: 0 0 12px; font-size: 17px; }
.js .tab-panel { display: none; }
.js .tab-panel.active { display: block; }
.js .panel-title { display: none; }
.fiche-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }

/* Signalements */
.signals { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.signal {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; padding: 12px;
    border-radius: 12px; background: var(--l-amber); border: 1px solid #fcd34d; color: #78350f;
}
.signal > .i { width: 22px; height: 22px; margin-top: 1px; }
.signal-block { background: var(--l-red); border-color: #fca5a5; color: #7f1d1d; }
.signal-body { flex: 1; min-width: 180px; }
.signal-body p { margin: 4px 0; color: var(--ink); }
.signal-body small { color: inherit; opacity: .8; }
.signal-resolve[open] { flex-basis: 100%; }
.signal-resolve form { margin-top: 8px; }

/* Étapes */
.stepper { display: flex; list-style: none; gap: 4px; padding: 0; margin: 4px 0 8px; overflow-x: auto; }
.step {
    position: relative; flex: 1; min-width: 86px; display: flex; flex-direction: column; align-items: center; gap: 6px;
    text-align: center; font-size: 12px; color: var(--muted);
}
.step + .step::before {
    content: ""; position: absolute; top: 14px; right: calc(50% + 18px); width: calc(100% - 36px); height: 2px; background: var(--line);
}
.step.done + .step::before, .step.done + .step.current::before { background: var(--c-green); }
.dot {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: var(--l-slate); color: var(--ink-2); font-weight: 800; position: relative; z-index: 1;
}
.dot .i { width: 16px; height: 16px; vertical-align: 0; }
.step.done .dot { background: var(--c-green); color: #fff; }
.step.current .dot { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-l); }
.step.current > span:last-child { color: var(--ink); font-weight: 700; }

/* Liste de contrôle Prêt à poser */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist li .i { width: 22px; height: 22px; }
.checklist li span { display: flex; flex-direction: column; }
.checklist small { color: var(--muted); }
.ck-ok > .i { color: var(--c-green); }
.ck-ko > .i { color: var(--c-red); }
.ck-soft > .i { color: var(--c-amber); }
.pret-form { margin-top: 14px; padding: 14px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px; }

/* Documents */
.docs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.doc { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.doc-main { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.doc-main > .i { width: 30px; height: 30px; color: var(--brand); }
.doc-main > span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.doc-main small { color: var(--muted); font-size: 13px; }
.versions, .doc-new-version { margin-top: 8px; font-size: 13px; }
.versions summary, .doc-new-version summary { cursor: pointer; color: var(--muted); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.versions ul { margin: 6px 0 0; padding-left: 20px; }
.doc-new-version form { margin-top: 8px; }
.card-sub { margin-top: 12px; }
.note-8sens { margin-top: 14px; padding: 10px 12px; background: #fffbeb; border-left: 3px solid #f59e0b; border-radius: 8px; font-size: 14px; }

/* Remarques & fil d'activité */
.note-form { padding: 8px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.note-form textarea { border: 0; background: transparent; padding: 6px; }
.note-form textarea:focus { outline: none; }
.note-form:focus-within { outline: 2px solid var(--focus); }
.note-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-end; }
.note-actions .file-btn { margin-right: auto; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.tl-item { display: flex; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.tl-item:first-child { border-top: 0; }
.tl-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: var(--l-gray); color: var(--muted); }
.tl-icon .i { width: 16px; height: 16px; vertical-align: 0; }
.tl-statut .tl-icon { background: var(--l-blue); color: var(--c-blue); }
.tl-signalement .tl-icon { background: var(--l-red); color: var(--c-red); }
.tl-resolution .tl-icon { background: var(--l-green); color: var(--c-green); }
.tl-intervention .tl-icon { background: var(--l-teal); color: var(--c-teal); }
.tl-reception .tl-icon, .tl-materiel .tl-icon { background: var(--l-violet); color: var(--c-violet); }
.tl-sav .tl-icon, .tl-reclamation .tl-icon { background: var(--l-orange); color: var(--c-orange); }
.tl-body { flex: 1; min-width: 0; }
.tl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.tl-meta strong { color: var(--ink); }
.tl-meta .inline-form { margin-left: auto; }
.tl-text { margin-top: 2px; overflow-wrap: anywhere; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin-top: 8px; }
.thumb img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--l-gray); }
.file-chip {
    grid-column: span 2; display: flex; align-items: center; gap: 8px; padding: 8px 10px; min-width: 0;
    background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 13px;
}
.file-chip span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip small { color: var(--muted); }
.interventions { display: flex; flex-direction: column; gap: 10px; }
.interv { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.interv header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.interv footer { margin-top: 8px; }

/* Réceptions */
.pending { display: flex; flex-direction: column; }
.pend-line { display: grid; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pend-etat { display: flex; gap: 6px; }
.pend-etat select { max-width: 150px; }
@media (min-width: 760px) { .pend-line { grid-template-columns: 1fr 380px; align-items: center; } }
.identify { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.identify .ac-wrap { flex: 1; min-width: 200px; }

/* Valeurs clé / valeur */
.kv { display: grid; grid-template-columns: minmax(96px, 32%) 1fr; gap: 7px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; font-weight: 650; padding-top: 1px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.tel { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }

/* Messages */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: 12px; border-radius: 12px; font-size: 14px; }
.alert .i { margin-top: 1px; }
.alert-ok { background: var(--l-green); color: #14532d; }
.alert-err { background: var(--l-red); color: #7f1d1d; }
.alert-warn { background: var(--l-amber); color: #78350f; }
.alert-info { background: var(--l-blue); color: #1e3a8a; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty .i { width: 34px; height: 34px; opacity: .55; }
.empty p { margin: 8px 0 0; }
.offline-banner {
    position: sticky; top: 0; z-index: 50; padding: 7px 12px; text-align: center; font-size: 13px; font-weight: 600;
    background: #7c2d12; color: #fff;
}

/* Tableaux */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 10px 12px; color: var(--muted); font-weight: 650; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.num { text-align: right; }
.row-off { opacity: .55; }
.steps { padding-left: 20px; margin: 0 0 14px; }
.steps li { margin-bottom: 6px; }
.compact { margin: 0; padding-left: 18px; font-size: 14px; }
.compact > li { margin: 4px 0; }
.diff { padding-left: 16px; font-size: 13px; color: var(--muted); }
.diff del { color: var(--c-red); }
.diff ins { color: var(--c-green); text-decoration: none; font-weight: 600; }
.debug { white-space: pre-wrap; overflow: auto; padding: 12px; border-radius: 8px; background: #0f172a; color: #e2e8f0; font-size: 12px; }

/* Connexion */
.auth-card {
    max-width: 400px; margin: 8vh auto 0; padding: 28px 22px; background: #fff;
    border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-brand strong { display: block; font-size: 18px; }
.auth-brand small { color: var(--muted); }

/* Visionneuse photo */
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .92); }
.lightbox img { max-width: 96vw; max-height: 88vh; border-radius: 6px; }
.lb-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; width: 48px; height: 48px; border: 0; background: transparent; color: #fff; cursor: pointer; }
.lb-close .i { width: 30px; height: 30px; }

/* Utilitaires */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.mt { margin-top: 12px; }

/* Impression : fiche chantier complète, sans navigation */
@media print {
    .topbar, .sidenav, .tabbar, .tabs, .actions-bar, .note-form, .quick, .btn, .menu-more, .offline-banner, .signal-resolve { display: none !important; }
    body.app { padding: 0; background: #fff; }
    .js .tab-panel, .js .panel-title { display: block !important; }
    .card, .tab-panel { box-shadow: none; break-inside: avoid; }
}
