:root {
  --navy: #0f1b2d; --navy-2: #172840; --navy-3: #22385a;
  --bg: #f3f5f9; --card: #fff; --line: #e3e8ef; --line-2: #eef1f6;
  --text: #142033; --muted: #66748a; --faint: #98a3b5;
  --accent: #1f6feb; --accent-2: #1659c2; --accent-bg: #e8f0fe;
  --green: #12805c; --green-bg: #e3f5ee; --red: #c4302b; --red-bg: #fdecea;
  --amber: #a15c00; --amber-bg: #fff4dc; --orange: #c2410c; --orange-bg: #ffedd5;
  --violet: #6d3fd1; --violet-bg: #efe8fd; --teal: #0e7490; --teal-bg: #def4f8;
  --grey: #5b6577; --grey-bg: #eceff3;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); } .small { font-size: 12px; } .text-danger { color: var(--red); font-weight: 600; }
.pre { white-space: pre-wrap; margin: 0; }
.spacer { flex: 1; }

/* ---------- Boutons & champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: #f7f9fc; } .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; } .btn-primary:hover { background: var(--accent-2); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; } .btn-success:hover { background: #0d6b4c; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; } .btn-danger-ghost { background: transparent; color: var(--red); border-color: #f3c7c4; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; } .btn-lg { height: 48px; font-size: 15px; } .btn-block { width: 100%; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 20px; line-height: 1; color: var(--muted); padding: 6px; border-radius: 6px; }
.icon-btn:hover { background: var(--line-2); }
input, select, textarea { font: inherit; color: inherit; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; min-height: 38px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31,111,235,.25); border-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.hint { font-size: 12px; color: var(--faint); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.span-2 { grid-column: span 2; }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0 14px; font-size: 13px; cursor: pointer; }
.check input { width: auto; min-height: 0; }
.switch { display: flex; align-items: center; gap: 8px; } .switch input { width: 18px; min-height: 18px; }
.search { max-width: 340px; }
.select-sm { width: auto; min-width: 140px; }

/* ---------- Pastilles ---------- */
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-blue { background: var(--accent-bg); color: var(--accent-2); } .pill-green { background: var(--green-bg); color: var(--green); }
.pill-red { background: var(--red-bg); color: var(--red); } .pill-amber { background: var(--amber-bg); color: var(--amber); }
.pill-orange { background: var(--orange-bg); color: var(--orange); } .pill-violet { background: var(--violet-bg); color: var(--violet); }
.pill-teal { background: var(--teal-bg); color: var(--teal); } .pill-grey { background: var(--grey-bg); color: var(--grey); }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% 0%, #1d3557 0%, var(--navy) 60%); padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.brand-lg { display: flex; gap: 12px; align-items: center; margin-bottom: 26px; }
.brand-lg b { display: block; font-size: 20px; } .brand-lg small { color: var(--muted); }
.logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #2f80ff, #1659c2); color: #fff; font-weight: 800; letter-spacing: -.03em; flex: none; }
.logo.sm { width: 34px; height: 34px; font-size: 13px; }

/* ---------- Coque back-office ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #c9d4e5; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px; border-bottom: 1px solid var(--navy-3); }
.brand b { color: #fff; display: block; } .brand small { color: #8fa1bd; font-size: 12px; }
nav { padding: 8px; flex: 1; }
.nav-group { margin-bottom: 10px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6f83a3; padding: 10px 10px 6px; font-weight: 600; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #c9d4e5; font-weight: 500; }
.nav-link:hover { background: var(--navy-2); text-decoration: none; color: #fff; }
.nav-link.active { background: var(--navy-3); color: #fff; }
.nav-ico { width: 18px; text-align: center; opacity: .8; }
.sidebar-foot { padding: 8px; border-top: 1px solid var(--navy-3); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; gap: 12px; align-items: center; height: 60px; padding: 0 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.hamburger { display: none; }
.user-chip { display: flex; gap: 10px; align-items: center; }
.user-chip b { display: block; font-size: 13px; } .user-chip small { color: var(--muted); font-size: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.content { padding: 24px; max-width: 1480px; width: 100%; }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header h1 { font-size: 22px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.subtitle { color: var(--muted); margin-top: 4px; }
.back { font-size: 13px; display: inline-block; margin-bottom: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 14px; font-weight: 700; }
.card-body { padding: 16px; }
.card-sub { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 16px 0 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; }
.dl dt { color: var(--muted); font-size: 12px; padding-top: 2px; } .dl dd { margin: 0; }

.tabs { display: flex; gap: 2px; background: #e8ecf2; padding: 3px; border-radius: 9px; flex-wrap: wrap; }
.tabs button, .seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; display: flex; gap: 6px; align-items: center; }
.tabs button.active, .seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.seg { display: flex; background: #e8ecf2; padding: 3px; border-radius: 9px; }
.count { background: var(--line); color: var(--muted); border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 700; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.card .table-wrap { border: 0; margin: -16px; border-radius: 0 0 var(--radius) var(--radius); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfd; white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; } .table tr.clickable:hover td { background: #f6f9ff; }
.empty { padding: 24px; text-align: center; color: var(--faint); }
.loading { padding: 40px; text-align: center; color: var(--muted); display: flex; gap: 10px; justify-content: center; align-items: center; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { padding: 10px 14px; border-radius: 8px; background: var(--accent-bg); color: var(--accent-2); margin-bottom: 14px; }
.alert-error { background: var(--red-bg); color: var(--red); }

/* ---------- KPI & graphiques ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); border-top: 3px solid var(--accent); }
.kpi-warn { border-top-color: #f59e0b; } .kpi-ok { border-top-color: var(--green); }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 28px; font-weight: 750; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; color: var(--muted); margin-left: 3px; font-weight: 600; }
.kpi-hint { font-size: 12px; color: var(--faint); margin-top: 2px; }
.chart { width: 100%; height: auto; }
.chart .grid { stroke: var(--line-2); } .chart .axis { font-size: 10px; fill: var(--faint); } .chart .bar { fill: var(--accent); }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 40%) 1fr 36px; gap: 10px; align-items: center; font-size: 13px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.hbar-fill.alt { background: #7c5cff; } .hbar-fill.alt2 { background: #14a37f; }
.hbar-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.split, .funnel { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.split > div, .funnel > div { flex: 1; min-width: 90px; background: #f7f9fc; border-radius: 8px; padding: 10px 12px; }
.split b, .funnel b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; } .split span, .funnel span { font-size: 12px; color: var(--muted); }
.funnel { margin-top: 0; }

/* ---------- Dossier / WO ---------- */
.pick-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.pick { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font: inherit; }
.pick:hover { border-color: var(--accent); background: #f6f9ff; } .pick span { color: var(--muted); font-size: 12px; }
.selected { display: flex; justify-content: space-between; align-items: center; background: #f6f9ff; border: 1px solid #cfe0ff; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.entitlement-box { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 8px; font-size: 13px; flex-wrap: wrap; }
.entitlement-box.ok { background: var(--green-bg); } .entitlement-box.warn { background: var(--orange-bg); }
.prio-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.prio-pick button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font: inherit; }
.prio-pick button.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31,111,235,.2); }
.prio-pick small { font-size: 11px; color: var(--muted); }
.note-form { display: flex; gap: 8px; margin-bottom: 14px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding-bottom: 14px; position: relative; }
.timeline li:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--line-2); }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: #c7d2e3; margin-top: 3px; border: 2px solid #fff; box-shadow: 0 0 0 1px #c7d2e3; }
.tl-OFFER_ACCEPTED .tl-dot, .tl-CASE_CLOSED .tl-dot, .tl-REPORT_SUBMITTED .tl-dot { background: var(--green); box-shadow: 0 0 0 1px var(--green); }
.tl-OFFER_DECLINED .tl-dot, .tl-OFFER_EXPIRED .tl-dot, .tl-DISPATCH_FAILED .tl-dot { background: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.tl-OFFER_SENT .tl-dot, .tl-DISPATCH_START .tl-dot { background: var(--violet); box-shadow: 0 0 0 1px var(--violet); }
.tl-NOTE .tl-dot { background: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.tl-msg { font-size: 13px; } .tl-meta { font-size: 11px; color: var(--faint); margin-top: 2px; }
.milestones { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.milestones > div { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; position: relative; color: var(--faint); font-size: 12px; }
.milestones .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.milestones .done { color: var(--text); } .milestones .done .dot { background: var(--green); }
.milestones small { font-size: 11px; color: var(--muted); }
.cascade { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cascade li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: #f7f9fc; border: 1px solid transparent; }
.cascade .rank { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.cascade .who b { display: block; font-size: 13px; } .cascade .who small { color: var(--muted); font-size: 11px; }
.cascade .state { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cascade-PENDING { border-color: #c9b5f5 !important; background: #f8f4ff !important; }
.cascade-ACCEPTED { border-color: #a7e0c9 !important; background: #f0fbf6 !important; }
.cascade-CANCELED, .cascade-QUEUED { opacity: .6; }
.countdown { font-family: ui-monospace, Menlo, monospace; font-weight: 700; font-size: 13px; color: var(--violet); }
.countdown.urgent { color: var(--red); }
.outcomes { display: flex; flex-direction: column; gap: 8px; }
.outcome { display: grid; grid-template-columns: 20px 1fr; gap: 2px 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; }
.outcome input { width: 18px; min-height: 18px; grid-row: span 2; }
.outcome small { color: var(--muted); grid-column: 2; }
.outcome.active { border-color: var(--accent); background: #f6f9ff; }
.parts-lines { display: flex; flex-direction: column; gap: 8px; }
.part-line { display: grid; grid-template-columns: 1fr 1.4fr 70px auto; gap: 6px; }
.sigpad { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sigpad canvas { width: 100%; height: 160px; border: 1px dashed #b8c3d4; border-radius: 10px; background: #fcfdff; touch-action: none; }
.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin: 6px 0 10px; }
.checklist .check { margin: 6px 0; }

/* ---------- Dispatch ---------- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; align-items: start; }
.board-col { background: #e9edf3; border-radius: 12px; padding: 10px; min-height: 140px; display: flex; flex-direction: column; gap: 10px; }
.board-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; padding: 2px 4px; }
.wo-card { background: #fff; border-radius: 10px; padding: 12px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 6px; border-left: 4px solid var(--accent); }
.wo-card:hover { box-shadow: 0 4px 12px rgba(16,24,40,.12); }
.wo-card-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .wo-card-title { font-weight: 600; }
.prio-P1 { border-left-color: var(--red) !important; } .prio-P2 { border-left-color: #f59e0b !important; } .prio-P4 { border-left-color: #b8c3d4 !important; }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.tech { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.tech b { display: block; font-size: 13px; } .tech small { color: var(--muted); font-size: 11px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); display: inline-block; }
.tech.on .status-dot, .avail.on .status-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.tech-load { font-size: 12px; font-weight: 700; color: var(--muted); }

/* ---------- Notifications, modales, toasts ---------- */
.bell-wrap { position: relative; }
.bell { position: relative; }
.badge { position: absolute; top: 0; right: 0; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }
.bell-panel { position: absolute; right: 0; top: 42px; width: 360px; max-height: 480px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(16,24,40,.18); }
.bell-head { padding: 12px 14px; font-weight: 700; border-bottom: 1px solid var(--line-2); }
.notif { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; padding: 10px 14px; cursor: pointer; font: inherit; }
.notif.unread { background: #f6f9ff; } .notif span { font-size: 13px; color: var(--muted); } .notif small { font-size: 11px; color: var(--faint); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,27,45,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-wide { max-width: 780px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: calc(100vw - 40px); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-weight: 500; animation: pop .2s ease-out; max-width: 380px; }
.toast-success { background: var(--green); } .toast-error { background: var(--red); } .toast-urgent { background: var(--violet); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Application mobile ---------- */
.mobile { min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.m-top { position: sticky; top: 0; z-index: 10; background: var(--navy); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
.m-brand { display: flex; gap: 10px; align-items: center; } .m-brand b { display: block; } .m-brand small { color: #8fa1bd; font-size: 12px; }
.avail { display: flex; gap: 8px; align-items: center; border: 1px solid var(--navy-3); background: var(--navy-2); color: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-weight: 600; cursor: pointer; }
.m-content { flex: 1; padding: 14px 14px 90px; }
.m-h2 { font-size: 15px; margin: 6px 2px 10px; display: flex; gap: 8px; align-items: center; }
.m-tabs { position: fixed; bottom: 0; left: 0; right: 0; max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.m-tabs a, .m-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 0; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; border: 0; background: none; cursor: pointer; text-decoration: none !important; }
.m-tabs span { font-size: 18px; } .m-tabs .active { color: var(--accent); }
.offer { background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 12px; box-shadow: 0 6px 20px rgba(109,63,209,.15); border: 2px solid #c9b5f5; border-left-width: 6px; display: flex; flex-direction: column; gap: 10px; animation: pop .25s ease-out; }
.offer-top { display: flex; justify-content: space-between; align-items: center; }
.offer-tag { font-size: 12px; font-weight: 700; color: var(--violet); text-transform: uppercase; letter-spacing: .04em; }
.offer .countdown { font-size: 20px; }
.offer-title { font-size: 18px; font-weight: 700; } .offer-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.offer-where { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); } .offer-where b { color: var(--text); font-size: 14px; }
.offer-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.offer-decline { display: flex; flex-direction: column; gap: 8px; }
.m-wo { display: flex; flex-direction: column; gap: 4px; background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); border-left: 4px solid var(--accent); color: var(--text); text-decoration: none !important; }
.m-wo-top { display: flex; justify-content: space-between; align-items: center; }
.back-btn { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; padding: 4px 0 10px; cursor: pointer; }
.m-detail h2 { font-size: 20px; margin: 6px 0; }
.m-detail-head { display: flex; gap: 6px; align-items: center; }
.m-actions { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.m-block { background: #fff; border-radius: 12px; padding: 14px; margin-top: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.m-block h3 { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; margin-bottom: 4px; }
.m-block .btn { align-self: flex-start; margin-top: 6px; }
.m-links { display: flex; gap: 8px; flex-wrap: wrap; }
.note { background: var(--amber-bg); padding: 8px 10px; border-radius: 8px; font-size: 13px; margin-top: 6px; }
.m-part { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
.m-report { background: #fff; border-radius: 12px; padding: 14px; }
.mobile .alert { margin: 10px 14px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2-1, .grid-2, .board { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .menu-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(15,27,45,.4); }
  .hamburger { display: block; }
  .user-chip div:last-child { display: none; }
  .content { padding: 16px; }
  .info-grid, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
  .milestones { grid-template-columns: repeat(3, 1fr); row-gap: 12px; }
  .bell-panel { position: fixed; left: 8px; right: 8px; width: auto; top: 60px; }
}
@media (max-width: 640px) {
  .toasts { bottom: auto; top: calc(64px + env(safe-area-inset-top)); left: 12px; right: 12px; }
  .toast { max-width: none; }
}

/* ===================== V2 ===================== */
.center { text-align: center; } .num { text-align: right; font-variant-numeric: tabular-nums; }
.btn.disabled { opacity: .55; pointer-events: none; }
.grid-2.tight { gap: 8px 24px; margin: 12px 0; }

/* Rapport d'intervention */
.report-form { display: flex; flex-direction: column; gap: 14px; }
.rf-section { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.rf-section h3 { font-size: 14px; margin-bottom: 12px; }
.sys-cards { display: grid; gap: 8px; margin-bottom: 12px; }
.sys-card { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 2px 10px; align-items: center; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; }
.sys-card input { position: absolute; opacity: 0; pointer-events: none; }
.sys-card small { grid-column: 2; color: var(--muted); }
.sys-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; grid-row: span 2; }
.sys-OPERATIONAL { color: var(--green); } .sys-RESTRICTED { color: #b45309; } .sys-DOWN { color: var(--red); }
.sys-card b { color: var(--text); }
.sys-card.active.sys-OPERATIONAL { background: var(--green-bg); border-color: var(--green); }
.sys-card.active.sys-RESTRICTED { background: var(--amber-bg); border-color: #f59e0b; }
.sys-card.active.sys-DOWN { background: var(--red-bg); border-color: var(--red); }
.sys-card.active .sys-dot { background: currentColor; box-shadow: inset 0 0 0 3px #fff; }
.choice-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer; font-size: 13px; background: #fff; }
.chip input { display: none; }
.chip.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-2); font-weight: 600; }
.labor-lines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.labor-line { display: grid; grid-template-columns: 130px 1fr 1fr auto; gap: 6px; align-items: center; }
.part-line.used { grid-template-columns: 1.3fr 1fr 64px 120px auto; }
.part-search { position: relative; }
.part-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(16,24,40,.15); max-height: 260px; overflow-y: auto; min-width: 260px; }
.part-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; padding: 8px 10px; text-align: left; font: inherit; cursor: pointer; }
.part-list button:hover { background: #f6f9ff; } .part-list span { font-size: 12px; color: var(--muted); } .part-list small { font-size: 11px; color: var(--faint); } .part-list small.ok { color: var(--green); font-weight: 600; }
.checklist-v2 { display: flex; flex-direction: column; gap: 8px; }
.cl-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.cl-row input { grid-column: span 2; }
.seg-sm button { padding: 5px 9px; font-size: 12px; }
.seg-sm button.active.r-OK { color: var(--green); } .seg-sm button.active.r-NOK { color: var(--red); }
.photos { display: flex; flex-direction: column; gap: 10px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photo-grid figure { margin: 0; position: relative; border-radius: 10px; overflow: hidden; background: var(--line-2); }
.photo-grid img { width: 100%; height: 110px; object-fit: cover; display: block; }
.photo-grid figcaption { font-size: 11px; padding: 4px 6px; color: var(--muted); }
.photo-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(15,27,45,.7); color: #fff; cursor: pointer; font-size: 16px; line-height: 1; }
.photo-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.sys-banner { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; margin-bottom: 4px; font-size: 13px; border-left: 4px solid currentColor; }
.sys-banner b { color: inherit; } .sys-banner span { color: var(--text); }
.sys-banner.sys-OPERATIONAL { background: var(--green-bg); } .sys-banner.sys-RESTRICTED { background: var(--amber-bg); } .sys-banner.sys-DOWN { background: var(--red-bg); }
.remarks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
.remarks h4 { font-size: 12px; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; letter-spacing: .03em; }
.remarks p { margin: 0 0 4px; font-size: 13px; }

/* Facturation */
.inv-lines input { min-height: 32px; padding: 4px 8px; }
.inv-lines td { padding: 6px 8px; }
.totals { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-top: 14px; }
.totals div { display: flex; gap: 24px; min-width: 260px; justify-content: space-between; font-variant-numeric: tabular-nums; }
.totals .ttc { font-size: 17px; border-top: 1px solid var(--line); padding-top: 6px; }

/* Stock */
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 16px; }
.loc-card { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; cursor: pointer; font: inherit; box-shadow: var(--shadow); }
.loc-card small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.loc-card span { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.loc-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(31,111,235,.2); }

/* Mobile V2 */
.m-tabs.cols-4 { grid-template-columns: repeat(4, 1fr); }
.m-stock { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); border-left: 4px solid var(--green); }
.m-stock.low { border-left-color: var(--red); }
.m-stock span { display: block; font-size: 13px; color: var(--muted); }
.m-stock-qty { text-align: right; } .m-stock-qty b { font-size: 22px; display: block; } .m-stock-qty small { font-size: 11px; color: var(--muted); }
.m-checklist { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.m-detail .sys-banner { margin-top: 10px; }

.labor-line > *, .part-line > *, .part-search input { min-width: 0; }
.labor-line.invalid input { border-color: var(--red); background: #fff7f7; }
.mobile, .m-content, .rf-section { min-width: 0; max-width: 100%; }
@media (max-width: 640px) {
  .labor-line { grid-template-columns: 1fr auto; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
  .labor-line input { grid-column: 1 / -1; }
  .labor-line .icon-btn { grid-row: 1; grid-column: 2; }
  .part-line, .part-line.used { grid-template-columns: 1fr 1fr; }
  .part-line > :first-child { grid-column: span 2; }
  .remarks { grid-template-columns: 1fr; }
  .photo-add { grid-template-columns: 1fr; }
}
.card-body .dl + .field { margin-top: 16px; }

/* Champ signature + pavé plein écran */
.sig-field { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 130px; border: 2px dashed #b8c3d4; border-radius: 12px; background: #fcfdff; cursor: pointer; font: inherit; padding: 6px; }
.sig-field:hover { border-color: var(--accent); background: #f6f9ff; }
.sig-field.signed { border-style: solid; border-color: var(--green); background: #fff; }
.sig-field img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sig-placeholder { color: var(--muted); font-weight: 600; font-size: 15px; }
.sig-edit { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: var(--accent); font-weight: 600; }
.sig-modal { position: fixed; inset: 0; z-index: 200; background: #fff; display: flex; flex-direction: column; }
.sig-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
.sig-modal-head b { display: block; font-size: 16px; } .sig-modal-head small { color: var(--muted); }
.sig-modal-body { flex: 1; display: flex; flex-direction: column; padding: 16px; min-height: 0; }
.sigpad-big { flex: 1; min-height: 0; align-items: stretch; }
.sigpad-big canvas { flex: 1; width: 100%; height: auto; min-height: 220px; border: 2px solid #b8c3d4; border-radius: 14px; background: #fff; }
.sigpad-big .btn { align-self: flex-start; }
.sig-modal-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
@media (min-width: 900px) { .sig-modal { inset: 5vh 15vw; border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(15,27,45,.5); } }

/* Planification de l'intervention */
.schedule { border-radius: 12px; padding: 12px 14px; margin: 12px 0; border: 1px solid; }
.schedule.planned { background: var(--green-bg); border-color: #a7e0c9; }
.schedule.todo { background: var(--amber-bg); border-color: #f5d48a; }
.schedule-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.schedule-head b { display: block; } .schedule-head small { color: var(--muted); }
.schedule-ico { font-size: 22px; }
.schedule-form { margin-top: 12px; background: #fff; border-radius: 10px; padding: 12px; }
.plan-badge { display: inline-block; align-self: flex-start; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; }
.plan-badge.ok { background: var(--green-bg); color: var(--green); } .plan-badge.todo { background: var(--amber-bg); color: var(--amber); }

/* =================== V3 =================== */
/* Arborescence du parc installé */
.tree-child { padding-left: 18px; position: relative; color: var(--muted); }
.tree-child::before { content: '└'; position: absolute; left: 4px; color: var(--faint); }

/* Barre d'avancement (campagnes) */
.progress { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.progress-bar { flex: 1; height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; min-width: 60px; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 99px; transition: width .3s; }
.progress b { font-size: 12px; } .progress small { color: var(--muted); font-size: 11px; }
.kpi .progress { margin-top: 10px; }

/* Planning FSE */
.planning-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: start; }
.planning { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.plan-row { display: grid; grid-template-columns: 150px repeat(7, minmax(88px, 1fr)); border-bottom: 1px solid var(--line-2); min-width: 780px; }
.plan-row:last-child { border-bottom: 0; }
.plan-head { position: sticky; top: 0; background: #f8fafc; z-index: 1; }
.plan-day { padding: 10px 8px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: capitalize; border-left: 1px solid var(--line-2); }
.plan-day.today { color: var(--accent); background: var(--accent-bg); }
.plan-day.we, .plan-cell.we { background: #fafbfd; }
.plan-tech { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.plan-tech b { font-size: 13px; } .plan-tech small { color: var(--muted); font-size: 11px; }
.plan-cell { border-left: 1px solid var(--line-2); padding: 5px; min-height: 66px; display: flex; flex-direction: column; gap: 4px; transition: background .12s; }
.plan-cell.today { background: rgba(31,111,235,.04); }
.plan-cell.over { background: var(--accent-bg); outline: 2px dashed var(--accent); outline-offset: -3px; }
.plan-cell.absent { background: repeating-linear-gradient(135deg, #f6f7f9 0 6px, #eceff3 6px 12px); }
.abs-tag { font-size: 11px; font-weight: 700; color: var(--grey); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; align-self: flex-start; }
.plan-chip { display: block; text-align: left; width: 100%; border: 0; border-left: 3px solid var(--accent); background: var(--accent-bg); color: var(--text); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 11px; line-height: 1.3; cursor: grab; }
.plan-chip b { display: block; font-size: 11px; } .plan-chip small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-chip:hover { filter: brightness(.97); box-shadow: var(--shadow); }
.plan-chip:active { cursor: grabbing; }
.plan-chip.act-pm { border-left-color: var(--teal); background: var(--teal-bg); }
.plan-chip.act-fco { border-left-color: var(--violet); background: var(--violet-bg); }
.plan-chip.prio-P1 { box-shadow: inset 0 0 0 1px var(--red); }
.plan-chip.done { opacity: .55; cursor: pointer; }
.plan-chip.wide { padding: 8px 10px; font-size: 12px; }
.plan-side { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; position: sticky; top: 76px; }
.plan-side-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 4px; }
.plan-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.plan-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.plan-legend .lg::before { content: ''; width: 12px; height: 12px; border-radius: 3px; background: var(--accent-bg); border-left: 3px solid var(--accent); }
.plan-legend .lg.pm::before { background: var(--teal-bg); border-color: var(--teal); }
.plan-legend .lg.fco::before { background: var(--violet-bg); border-color: var(--violet); }
@media (max-width: 1100px) { .planning-layout { grid-template-columns: 1fr; } .plan-side { position: static; max-height: none; } }

/* Feuilles de temps */
.week-days { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 14px; }
.week-days div { background: var(--bg); border-radius: 8px; padding: 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.week-days small { color: var(--muted); font-size: 11px; text-transform: capitalize; } .week-days b { font-size: 13px; }
.week-days .on { background: var(--accent-bg); } .week-days .over { background: var(--red-bg); color: var(--red); }
.week-days .total { background: var(--navy); color: #fff; } .week-days .total small { color: #8fa1bd; }

/* Mobile : mes heures + hors ligne */
.m-week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 12px; }
.m-week-nav > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.m-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.m-week div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 2px; text-align: center; display: flex; flex-direction: column; }
.m-week small { color: var(--muted); font-size: 11px; text-transform: capitalize; } .m-week b { font-size: 14px; }
.m-week .on { border-color: var(--accent); background: var(--accent-bg); }
.m-week-total { text-align: right; margin: 8px 2px 12px; color: var(--muted); } .m-week-total b { color: var(--text); font-size: 16px; }
.m-entry { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.m-entry > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.m-entry-d { font-weight: 700; white-space: nowrap; }
.m-form { grid-template-columns: 1fr 1fr; }
.offline-bar { background: var(--navy); color: #fff; padding: 9px 14px; font-size: 13px; text-align: center; position: sticky; top: 0; z-index: 15; }
.offline-bar.sync { background: var(--accent); }

/* Portail client */
.portal { min-height: 100vh; background: var(--bg); }
.p-top { display: flex; align-items: center; gap: 14px; padding: 0 28px; height: 64px; background: var(--navy); color: #fff; }
.p-top .brand { border: 0; padding: 0; }
.p-top .user-chip small { color: #8fa1bd; } .p-top .user-chip b { color: #fff; }
.p-top .btn-ghost { color: #fff; border-color: rgba(255,255,255,.25); background: transparent; }
.p-content { max-width: 1180px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.p-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.p-hero h1 { font-size: 24px; margin-bottom: 4px; }
.p-alert { background: var(--amber-bg); border: 1px solid #f5d38a; border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.p-quote { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border-radius: 8px; padding: 8px 12px; }
.p-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.p-stats div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.p-stats b { font-size: 26px; } .p-stats span { color: var(--muted); font-size: 13px; }
.p-equip { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.p-eq { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.p-eq > div { display: flex; flex-direction: column; gap: 2px; }
.cov { display: inline-flex; flex-direction: column; font-weight: 700; font-size: 12px; padding: 5px 10px; border-radius: 8px; }
.cov small { font-weight: 500; font-size: 11px; }
.cov-ok { background: var(--green-bg); color: var(--green); } .cov-war { background: var(--teal-bg); color: var(--teal); } .cov-none { background: var(--orange-bg); color: var(--orange); }
.p-head { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; } .p-head h1 { font-size: 22px; }
.p-wo { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.p-wo:last-child { border-bottom: 0; }
.p-wo-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.seg .seg-btn { flex: 1; padding: 9px 10px; font-size: 13px; text-align: center; justify-content: center; }
.seg .seg-btn.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.seg .seg-btn.on-down { color: var(--red); } .seg .seg-btn.on-degraded { color: var(--amber); } .seg .seg-btn.on-ok { color: var(--green); }
@media (max-width: 760px) {
  .p-stats { grid-template-columns: repeat(2, 1fr); } .p-top { padding: 0 14px; } .p-top .user-chip { display: none; }
  .p-content { padding: 14px; } .seg { flex-direction: column; } .week-days { grid-template-columns: repeat(4, 1fr); }
}
.m-tabs.cols-5 { grid-template-columns: repeat(5, 1fr); } .m-tabs.cols-5 a, .m-tabs.cols-5 button { font-size: 11px; }

/* =================== V4 : feuille de temps calendrier =================== */
.tc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.tc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #f8fafc; }
.tc-week { display: inline-flex; align-items: center; gap: 2px; background: #eef1f5; border-radius: 10px; padding: 3px; }
.tc-range { font-size: 17px; font-weight: 600; padding: 4px 8px; font-variant-numeric: tabular-nums; }
.tc-nav { border: 0; background: transparent; font-size: 22px; line-height: 1; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; color: var(--text); }
.tc-nav:hover { background: #fff; }
.tc-add { border: 0; background: var(--accent); color: #fff; width: 38px; height: 38px; border-radius: 50%; font-size: 22px; cursor: pointer; box-shadow: var(--shadow); }
.tc-status { text-align: center; color: #fff; font-size: 13px; letter-spacing: .06em; padding: 7px; font-weight: 600; }
.ts-draft { background: #64748b; } .ts-submitted { background: #1f6feb; } .ts-approved { background: #2f7a50; } .ts-rejected { background: #b91c1c; }
.tc-reject { background: var(--red-bg); color: var(--red); font-size: 13px; padding: 8px 12px; }
.tc-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 8px 6px 6px; border-bottom: 1px solid var(--line); box-shadow: 0 2px 6px rgba(15,27,45,.06); position: relative; z-index: 2; background: #fff; }
.tc.tc-mode-week .tc-days { grid-template-columns: 56px repeat(7, 1fr); }
.tc-days-gutter { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); }
.tc-days-gutter b { color: var(--text); font-size: 12px; }
.tc-day { border: 0; background: transparent; border-radius: 12px; padding: 6px 0 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; color: var(--text); font: inherit; }
.tc-day small { font-size: 12px; color: #475569; letter-spacing: .02em; }
.tc-day b { font-size: 21px; font-weight: 400; line-height: 1.2; }
.tc-day.we small, .tc-day.we b { color: #94a3b8; }
.tc-day.today b { color: var(--accent); font-weight: 700; }
.tc-day.on { background: #e3f0ff; }
.tc-day em { font-style: normal; font-size: 11px; color: var(--muted); }
.tc-dots { display: flex; gap: 4px; height: 6px; } .tc-dots span { width: 5px; height: 5px; border-radius: 50%; background: #94a3b8; }
.tc-day.on .tc-dots span:first-child { background: var(--accent); }
.tc-sum { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; font-size: 13px; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line-2); }
.tc-sum span:first-child { text-transform: capitalize; color: var(--text); font-weight: 600; }
.tc-sum b { color: var(--text); }
.tc-scroll { overflow-y: auto; position: relative; -webkit-overflow-scrolling: touch; height: 520px; overscroll-behavior: contain; }
.tc-grid { display: grid; grid-template-columns: 56px 1fr; position: relative; }
.tc.tc-mode-week .tc-grid { grid-template-columns: 56px repeat(7, 1fr); }
.tc-gutter { position: relative; border-right: 1px solid var(--line-2); }
.tc-gutter span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 12px; color: #64748b; font-variant-numeric: tabular-nums; }
.tc-col { position: relative; border-left: 1px solid transparent; }
.tc.tc-mode-week .tc-col { border-left: 1px solid var(--line-2); }
.tc-slot { position: absolute; left: 0; right: 0; border-top: 1px solid #e8ecf1; }
.tc-col.addable .tc-slot:hover { background: rgba(31,111,235,.05); }
.tc-col.addable { cursor: copy; }
.tc-block { position: absolute; border: 0; border-left: 4px solid; border-radius: 6px; padding: 5px 8px; text-align: left; font: inherit; font-size: 13px; line-height: 1.35; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; z-index: 1; }
.tc-block b { font-size: 13px; } .tc-block span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #475569; }
.tc-block .tc-time { font-variant-numeric: tabular-nums; }
.tc-block.tight { padding: 2px 6px; flex-direction: row; gap: 6px; align-items: center; font-size: 12px; }
.tc-block.tight span:not(.tc-time) { display: none; }
.tc-block:hover { filter: brightness(.97); box-shadow: 0 2px 8px rgba(15,27,45,.12); z-index: 3; }
.k-work { background: #dde8f7; border-color: #3b7ddd !important; } .k-travel { background: #fdf0d5; border-color: #d99a1e !important; }
.k-waiting { background: #eceef2; border-color: #8b95a5 !important; } .k-nonwo { background: #ece6fb; border-color: #7c5cd6 !important; }
.tc.tc-mode-week .tc-block { font-size: 11px; padding: 3px 5px; } .tc.tc-mode-week .tc-block b { font-size: 11px; }
.tc-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid #e5484d; z-index: 4; pointer-events: none; }
.tc-now span { position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: #e5484d; }
.tc-legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); }
.tc-legend span { display: inline-flex; align-items: center; gap: 6px; background: none !important; }
.tc-legend span::before { content: ''; width: 12px; height: 12px; border-radius: 3px; border-left: 4px solid; border-color: inherit; }
.tc-legend .k-work::before { background: #dde8f7; } .tc-legend .k-travel::before { background: #fdf0d5; } .tc-legend .k-waiting::before { background: #eceef2; } .tc-legend .k-nonwo::before { background: #ece6fb; }
.tc-chip { display: inline-block; border-left: 4px solid; border-radius: 6px; padding: 2px 8px; font-weight: 600; font-size: 12px; }
.tc-detail { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-top: 10px; background: #fafbfc; }
.tc-detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tc-list-title { margin: 16px 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* Mobile : plein écran, comme l'application FSE native */
.m-hours { margin: -4px -14px 0; }
.m-hours .tc { border: 0; border-radius: 0; }
.m-hours .tc-scroll { height: calc(100dvh - 400px); min-height: 260px; }
.m-hours .tc-legend { display: none; }
.m-hours-foot { padding: 10px 14px 4px; display: flex; flex-direction: column; gap: 6px; }
.chip-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-pick button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip-pick button.on { background: #ece6fb; border-color: #7c5cd6; color: #4c2fb0; font-weight: 600; }

/* E-mails des rapports */
.mail-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mail-log li { display: flex; gap: 10px; align-items: flex-start; }
.mail-log li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .mail-log b { font-size: 13px; word-break: break-word; } .mail-log small { color: var(--muted); }
.mail-ico { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; }
.mail-sent .mail-ico { background: var(--green-bg); color: var(--green); }
.mail-failed .mail-ico, .mail-skipped .mail-ico { background: var(--red-bg); color: var(--red); }
.mail-presets { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mail-test { display: flex; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 12px; } .mail-test input { flex: 1; }
@media (max-width: 760px) { .tc-range { font-size: 15px; } }

/* ---------- Double authentification ---------- */
.alert-warn { background: #fff7e6; border: 1px solid #f5d38a; color: #7a4b00; }
.btn-link { background: none; border: none; color: var(--blue, #2563eb); text-decoration: underline; box-shadow: none; padding: 4px 0; }
.row.gap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.mfa-card { max-width: 440px; }
.mfa-steps { padding-left: 20px; margin: 8px 0; font-size: 14px; line-height: 1.5; }
.mfa-steps li { margin: 4px 0; }
.mfa-qr-box { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 8px 0 12px; }
.mfa-qr { width: 200px; height: 200px; border: 1px solid var(--line, #e5e7eb); border-radius: 8px; }
.mfa-key { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mfa-key code { font-size: 15px; letter-spacing: 1px; background: #f3f4f6; padding: 6px 10px; border-radius: 6px; user-select: all; word-break: break-all; text-align: center; }
.mfa-input { font-size: 22px !important; letter-spacing: 4px; text-align: center; max-width: 220px; margin: 4px 0 10px; }
.login-card .mfa-input { max-width: none; width: 100%; }
.mfa-code-list { columns: 2; padding-left: 26px; font-size: 15px; line-height: 1.9; margin: 10px 0; }
.mfa-codes .alert { margin-bottom: 8px; }
.pill-2fa { font-size: 11px; }
.login-card .btn-link { white-space: normal; line-height: 1.35; text-align: center; }
.login-card { min-width: 0; }
.btn-link { height: auto; min-height: 36px; }

/* ---------- Journal d'audit ---------- */
.audit-ok { background: #ecfdf3; border: 1px solid #a6e3bf; color: #14532d; margin-bottom: 14px; }
.audit-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.audit-filters label { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted, #64748b); }
.audit-filters input[type=date], .audit-filters select { width: auto; }
.audit-dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0 0 14px; font-size: 14px; }
.audit-dl dt { color: var(--muted, #64748b); }
.audit-dl dd { margin: 0; }
.audit-diff td { vertical-align: top; word-break: break-word; }
.audit-old { color: #9f1239; background: #fff1f2; }
.audit-new { color: #14532d; background: #f0fdf4; }
.audit-pre { background: #f8fafc; border: 1px solid var(--line, #e5e7eb); padding: 10px; border-radius: 8px; font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.nowrap { white-space: nowrap; }

/* ---------- Import / Export ---------- */
.ie-steps { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ie-step { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; background: #fff; }
.ie-step.open { border-color: #93c5fd; box-shadow: 0 1px 6px rgba(37, 99, 235, .08); }
.ie-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.ie-num { width: 28px; height: 28px; border-radius: 50%; background: #1f4e79; color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.ie-title { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ie-chev { color: var(--muted, #64748b); }
.ie-body { padding: 0 14px 14px 54px; }
.ie-drop { display: block; border: 2px dashed #cbd5e1; border-radius: 10px; padding: 18px; text-align: center; cursor: pointer; margin: 10px 0; color: #475569; background: #f8fafc; }
.ie-drop:hover { border-color: #60a5fa; background: #eff6ff; }
.ie-drop input { display: none; }
.ie-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.ie-preview .table-wrap { max-height: 360px; overflow: auto; margin-bottom: 8px; }
.ie-rows td, .ie-errors td { font-size: 13px; vertical-align: top; }
.ie-bad { background: #fff1f2; }
@media (max-width: 700px) { .ie-body { padding-left: 14px; } }

/* ---------- Rapport papier signé et cacheté ---------- */
.signed-report { display: flex; flex-direction: column; gap: 10px; }
.sr-status { padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.sr-status.ok { background: var(--green-bg); color: var(--green); }
.sr-status.wait { background: var(--amber-bg); color: var(--amber); }
.sr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sr-files { display: flex; flex-wrap: wrap; gap: 10px; }
.sr-file { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); }
.sr-file img, .sr-pdf { width: 84px; height: 112px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.sr-pdf { display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--red); }
.sig-mode { margin: 6px 0 12px; }
.sig-mode button { flex: 1; justify-content: center; white-space: normal; text-align: center; }
.paper-note { display: flex; flex-direction: column; gap: 8px; }
.paper-note p { margin: 0; }

/* ---------- Performance des techniciens ---------- */
.kpi-none { border-top-color: var(--line); }
.tk-table th { white-space: normal; min-width: 64px; font-size: 11.5px; cursor: help; }
.tk-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-table td.tk-ok, .tk-cmp.tk-ok b, .tk-ok { color: var(--green); font-weight: 650; }
.tk-table td.tk-warn, .tk-cmp.tk-warn b { color: var(--amber); font-weight: 650; }
.tk-table td.tk-bad, .tk-cmp.tk-bad b, .tk-bad { color: var(--red); font-weight: 650; }
.tk-table td.tk-bad { background: var(--red-bg); }
.tk-team td { background: #f6f8fb; border-top: 2px solid var(--line); }
.tk-compare { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.tk-cmp { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.tk-cmp span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tk-cmp b { font-size: 18px; }
.tk-cmp small { color: var(--faint); font-size: 11px; }
.tk-list { max-height: 340px; overflow: auto; }
.tk-defs { display: grid; grid-template-columns: 200px 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.tk-defs dt { font-weight: 650; } .tk-defs dt small { color: var(--muted); font-weight: 500; } .tk-defs dd { margin: 0; color: var(--text); }
.timebar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line-2); }
.timebar span { display: block; height: 100%; }
.tb-work { background: var(--accent); } .tb-travel { background: #f59e0b; } .tb-wait { background: #94a3b8; }
.timebar-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.timebar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
@media (max-width: 760px) { .tk-defs { grid-template-columns: 1fr; } }
.tk-note { margin-top: 12px; }
.sr-next { margin: 0; font-size: 13.5px; background: var(--accent-bg); color: var(--accent-2); padding: 8px 10px; border-radius: 8px; }
.sr-big { flex-direction: column; } .sr-big .btn { width: 100%; justify-content: center; }
.sr-fp { margin: 0; } .m-paper { border: 2px solid var(--accent); }
.sig-mode button { flex-direction: column; gap: 2px; padding: 8px 6px; font-size: 12.5px; line-height: 1.2; }
.sig-mode .sig-ico { font-size: 16px; }
.sig-default { margin: -6px 0 10px; }
.seg.sig-mode { flex-direction: row; } .sig-mode button { flex: 1 1 0; min-width: 0; }

/* Intégrations : clé affichée une seule fois */
.keybox { padding: 12px 14px; margin: 12px 0; background: var(--grey-bg); border: 1px dashed var(--border); border-radius: 8px; word-break: break-all; font-size: 13px; user-select: all; }
.doc-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.doc-list a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }

.text-warning { color: #b45309; font-weight: 600; } .row-end { display: flex; gap: 8px; justify-content: flex-end; }
.todo-banner { display: flex; flex-wrap: wrap; gap: 8px 24px; background: #fffbeb; border: 1px solid #fcd34d; border-radius: var(--radius); padding: 10px 16px; margin-bottom: 16px; }
.todo-banner a { color: #92400e; text-decoration: none; } .todo-banner a:hover { text-decoration: underline; }
.photo-grid figure.pending { outline: 2px dashed #f59e0b; } .photo-grid figure.pending img { opacity: .75; }
