
  /* ================================================================
     Design system
     ================================================================ */
  :root {
    --primary: #2563eb; --primary-600: #1d4ed8; --primary-700: #1e40af; --primary-50: #eff6ff; --primary-100: #dbeafe;
    --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --faint: #94a3b8;
    --line: #e5e7eb; --line-2: #eef0f4; --bg: #f5f7fb; --card: #ffffff;
    --blue: #2563eb;   --blue-bg: #eff6ff;
    --orange: #c2410c; --orange-bg: #ffedd5; --amber: #f59e0b;
    --green: #15803d;  --green-bg: #dcfce7; --green-500: #16a34a;
    --red: #b91c1c;    --red-bg: #fee2e2;   --red-500: #ef4444;
    --grey: #475569;   --grey-bg: #f1f5f9;
    --violet: #6d28d9; --violet-bg: #ede9fe;
    --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px;
    --sh-1: 0 1px 2px rgba(16, 24, 40, .05);
    --sh-2: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
    --sh-3: 0 12px 24px -6px rgba(16, 24, 40, .12), 0 4px 8px -4px rgba(16, 24, 40, .06);
    --nav-w: 248px; --bottom-nav: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    font-family: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg);
    -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
    font-feature-settings: "cv11", "ss01";
  }
  h1, h2, h3, h4, p { margin: 0; }
  h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
  h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
  h3 { font-size: 1rem; font-weight: 700; }
  a { color: var(--primary); text-decoration: none; }
  input, select, textarea, button { font: inherit; color: inherit; }
  button { -webkit-appearance: none; }
  svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
  svg.i.sm { width: 15px; height: 15px; }
  svg.i.lg { width: 22px; height: 22px; }
  svg.i.xl { width: 40px; height: 40px; stroke-width: 1.5; }
  .muted { color: var(--muted); }
  .small { font-size: .85rem; }
  .hidden { display: none !important; }
  .grow { flex: 1; min-width: 0; }
  .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .nowrap { white-space: nowrap; }
  .ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  :focus-visible { outline: 3px solid var(--primary-100); outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

  /* ================================================================
     Structure : barre latérale (≥1024), onglets (720–1023), barre du bas (<720)
     ================================================================ */
  .topbar {
    position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; gap: 12px;
    padding: 0 16px; background: rgba(255, 255, 255, .9); backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line);
  }
  .logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 4px 10px -2px rgba(37, 99, 235, .45); }
  .logo svg.i { width: 19px; height: 19px; }
  .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; font-size: 1.02rem; }
  .brand small { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
  .topbar .avatar-btn { margin-left: auto; }
  .avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }

  .nav { display: flex; background: #fff; }
  .nav-item {
    border: 0; background: none; cursor: pointer; color: var(--muted); font-weight: 600; display: flex; align-items: center;
    gap: 10px; position: relative; transition: color .15s, background .15s; white-space: nowrap;
  }
  .nav-item:hover { color: var(--ink); }
  .nav-item.on { color: var(--primary); }
  .nav-count { background: var(--red-500); color: #fff; border-radius: 99px; font-size: .7rem; font-weight: 700; padding: 1px 6px; line-height: 1.4; min-width: 18px; text-align: center; }
  .nav-brand, .nav-user, .nav-sync { display: none; }
  .sync { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; color: var(--primary-700);
    background: var(--primary-50); border-radius: 99px; padding: 4px 10px 4px 8px; white-space: nowrap; }
  .sync .spin { width: 12px; height: 12px; border-width: 2px; margin: 0; }
  .topbar .sync { margin-left: auto; }
  .topbar .sync + .avatar-btn { margin-left: 8px; }
  @media (min-width: 1024px) { .nav-sync { display: block; padding: 0 8px 10px; } }

  .main { max-width: 1240px; margin: 0 auto; padding: 20px 16px calc(var(--bottom-nav) + 32px + var(--safe-b)); }

  /* Mobile */
  @media (max-width: 719px) {
    .nav {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--bottom-nav) + var(--safe-b));
      padding-bottom: var(--safe-b); border-top: 1px solid var(--line); justify-content: space-around;
      box-shadow: 0 -4px 16px rgba(16, 24, 40, .05);
    }
    .nav-item { flex: 1; flex-direction: column; justify-content: center; gap: 3px; font-size: .7rem; padding: 6px 2px; }
    .nav-item svg.i { width: 22px; height: 22px; }
    .nav-item.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 4px 4px; background: var(--primary); }
    .nav-count { position: absolute; top: 5px; left: 50%; margin-left: 6px; }
    .main { padding-top: 16px; }
  }
  /* Tablette */
  @media (min-width: 720px) and (max-width: 1023px) {
    .nav { position: sticky; top: 56px; z-index: 25; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; gap: 4px; }
    .nav-item { padding: 14px 14px 12px; border-bottom: 2px solid transparent; }
    .nav-item.on { border-bottom-color: var(--primary); }
    .main { padding-bottom: 48px; }
  }
  /* Bureau */
  @media (min-width: 1024px) {
    .topbar { display: none; }
    .nav {
      position: fixed; top: 0; left: 0; bottom: 0; width: var(--nav-w); flex-direction: column; padding: 18px 14px;
      border-right: 1px solid var(--line); gap: 2px; z-index: 30;
    }
    .nav-brand { display: flex; padding: 4px 8px 22px; }
    .nav-item { padding: 10px 12px; border-radius: 10px; font-size: .94rem; }
    .nav-item:hover { background: var(--grey-bg); }
    .nav-item.on { background: var(--primary-50); }
    .nav-item .nav-count { margin-left: auto; }
    .nav-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--line); }
    .nav-user .who { line-height: 1.25; font-size: .9rem; font-weight: 600; }
    .nav-user .who small { display: block; color: var(--muted); font-weight: 500; font-size: .78rem; }
    .main { margin-left: var(--nav-w); max-width: none; padding: 28px 32px 48px; }
    .main > * { max-width: 1240px; }
  }

  /* ================================================================
     En-tête de page
     ================================================================ */
  .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
  .page-head .sub { color: var(--muted); margin-top: 2px; font-size: .92rem; }
  .first-up { display: inline-block; }
  .first-up::first-letter { text-transform: uppercase; }
  .page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .back { display: inline-flex; align-items: center; gap: 2px; margin: -4px 0 10px -6px; padding: 6px 8px 6px 2px; border-radius: 8px;
    font-weight: 600; font-size: .92rem; cursor: pointer; background: none; border: 0; color: var(--muted); max-width: 100%; }
  .back:hover { color: var(--ink); background: var(--grey-bg); }
  .back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .section { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 26px 0 10px; }
  .section h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }

  /* ================================================================
     Cartes, boutons, badges, formulaires
     ================================================================ */
  .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px; display: block; color: inherit; }
  .card + .card { margin-top: 10px; }
  .card.clickable { cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s; }
  .card.clickable:hover { box-shadow: var(--sh-3); border-color: #d6dbe4; }
  .card.clickable:active { transform: scale(.995); }
  .card-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 12px; }
  .card-title .count { color: var(--muted); font-weight: 600; }

  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line);
    background: #fff; color: var(--ink-2); padding: 0 16px; height: 42px; border-radius: 11px; cursor: pointer;
    font-weight: 600; font-size: .93rem; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, opacity .15s, transform .1s;
    box-shadow: var(--sh-1); text-decoration: none; user-select: none;
  }
  .btn:hover { background: #f8fafc; border-color: #d1d5db; }
  .btn:active { transform: translateY(1px); }
  .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
  .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .3), inset 0 1px 0 rgba(255,255,255,.12); }
  .btn.primary:hover { background: var(--primary-600); }
  .btn.success { background: var(--green-500); border-color: var(--green-500); color: #fff; }
  .btn.success:hover { background: var(--green); }
  .btn.danger { color: var(--red); }
  .btn.danger:hover { background: var(--red-bg); border-color: #fecaca; }
  .btn.danger.solid { background: #dc2626; border-color: #dc2626; color: #fff; }
  .btn.soft { background: var(--primary-50); border-color: transparent; color: var(--primary-700); box-shadow: none; }
  .btn.soft:hover { background: var(--primary-100); }
  .btn.ghost { background: none; border-color: transparent; box-shadow: none; }
  .btn.ghost:hover { background: var(--grey-bg); }
  .btn.small { height: 34px; padding: 0 12px; font-size: .86rem; border-radius: 9px; gap: 6px; }
  .btn.big { height: 54px; font-size: 1.02rem; border-radius: 14px; padding: 0 20px; }
  .btn.block { width: 100%; }
  .btn.icon { width: 42px; padding: 0; }
  .btn.icon.small { width: 34px; }
  .btn .spin { width: 16px; height: 16px; border-width: 2px; margin: 0; }

  .badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; line-height: 1.3; }
  .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .badge.blue { background: var(--blue-bg); color: var(--blue); }
  .badge.orange { background: var(--orange-bg); color: var(--orange); }
  .badge.green { background: var(--green-bg); color: var(--green); }
  .badge.red { background: var(--red-bg); color: var(--red); }
  .badge.grey { background: var(--grey-bg); color: var(--grey); }
  .badge.violet { background: var(--violet-bg); color: var(--violet); }
  .badge.plain::before { display: none; }
  .prio { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--red); }
  .prio.HAUTE { color: var(--orange); }
  .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }

  .field { display: block; margin-bottom: 14px; }
  .field > span { display: block; font-weight: 600; font-size: .86rem; color: var(--ink-2); margin-bottom: 6px; }
  .field > span em { color: var(--red); font-style: normal; }
  .input, .field input:not([type=checkbox]):not([type=color]), .field select, .field textarea {
    display: block; width: 100%; padding: 0 13px; height: 44px; border: 1px solid #d5dae2; border-radius: 11px;
    background: #fff; font-size: 16px; transition: border-color .15s, box-shadow .15s; box-shadow: var(--sh-1);
  }
  .field textarea, textarea.input { height: auto; min-height: 92px; padding: 11px 13px; resize: vertical; line-height: 1.45; }
  .input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-100); }
  .field select { appearance: none; -webkit-appearance: none; padding-right: 36px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center; }
  .field input[type=color] { width: 64px; height: 44px; padding: 4px; border: 1px solid #d5dae2; border-radius: 11px; background: #fff; }
  .field .help { font-size: .8rem; color: var(--muted); margin-top: 5px; }
  .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 14px; }
  .switch { display: flex; align-items: center; gap: 12px; font-weight: 600; cursor: pointer; padding: 6px 0; }
  .switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 99px; background: #cbd5e1; position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
  .switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--sh-2); transition: transform .2s; }
  .switch input:checked { background: var(--green-500); }
  .switch input:checked::after { transform: translateX(18px); }
  .form-error { color: var(--red); font-size: .88rem; font-weight: 500; }
  .form-error:empty { display: none; }
  .form-error:not(:empty) { background: var(--red-bg); padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
  .input-icon { position: relative; }
  .input-icon svg.i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
  .input-icon .input { padding-left: 40px; }
  .pwd { position: relative; }
  .pwd input { padding-right: 46px !important; }
  .pwd button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 8px 10px; cursor: pointer; border-radius: 8px; font-size: .78rem; font-weight: 600; }

  .seg { display: inline-flex; background: #e9edf3; border-radius: 12px; padding: 4px; gap: 2px; }
  .seg button { border: 0; background: none; height: 34px; padding: 0 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
  .seg button.on { background: #fff; color: var(--ink); box-shadow: var(--sh-2); }
  .seg button .n { font-size: .74rem; background: var(--grey-bg); color: var(--muted); padding: 0 6px; border-radius: 99px; }
  .seg button.on .n { background: var(--primary-50); color: var(--primary); }
  .seg.full { display: flex; width: 100%; }
  .seg.full button { flex: 1; justify-content: center; padding: 0 6px; }

  .chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .fchip { border: 1px solid var(--line); background: #fff; height: 34px; padding: 0 13px; border-radius: 99px; cursor: pointer; font-weight: 600; font-size: .85rem; color: var(--ink-2); white-space: nowrap; flex: none; }
  .fchip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

  .progress { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
  .progress > div { height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 99px; transition: width .4s; }
  .progress-row { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); font-weight: 600; }
  .progress-row .progress { flex: 1; }

  .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .88rem; }
  .meta > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
  .meta svg.i { width: 15px; height: 15px; color: var(--faint); }

  .empty { text-align: center; padding: 44px 20px; color: var(--muted); }
  .empty .ico { width: 64px; height: 64px; border-radius: 20px; background: var(--grey-bg); color: var(--faint); display: grid; place-items: center; margin: 0 auto 14px; }
  .empty .ico svg.i { width: 30px; height: 30px; }
  .empty b { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 4px; }
  .empty.error .ico { background: var(--red-bg); color: var(--red); }

  .spinner, .spin { width: 32px; height: 32px; border: 3px solid var(--primary-100); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; margin: 48px auto; }
  .splash { min-height: 100vh; display: grid; place-items: center; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .sk { background: linear-gradient(90deg, #eceff4 0%, #f6f7fa 50%, #eceff4 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; }
  @keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
  .sk-card { height: 112px; border-radius: var(--r-lg); margin-bottom: 10px; }
  .sk-title { height: 30px; width: 45%; margin-bottom: 20px; }

  .avatar { width: 40px; height: 40px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex: none; letter-spacing: .02em; }
  .avatar.sm { width: 32px; height: 32px; font-size: .78rem; }
  .avatar.lg { width: 56px; height: 56px; font-size: 1.15rem; }

  /* ================================================================
     Connexion
     ================================================================ */
  .login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background: radial-gradient(1200px 600px at 10% -10%, #dbeafe 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e0e7ff 0%, transparent 55%), var(--bg); }
  .login { width: 100%; max-width: 400px; padding: 32px 26px; border-radius: var(--r-xl); box-shadow: var(--sh-3); }
  .login .logo { width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 18px; }
  .login .logo svg.i { width: 26px; height: 26px; }
  .login h1 { text-align: center; }
  .login p.muted { text-align: center; margin: 6px 0 26px; }

  /* ================================================================
     Planning
     ================================================================ */
  .plan-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
  .plan-bar .navgrp { display: flex; gap: 6px; }
  .plan-bar .date-in { width: auto; height: 42px; padding: 0 10px; }
  .plan-bar .spacer { flex: 1; }
  .plan-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); max-height: calc(100vh - 210px); }
  table.plan { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1020px; table-layout: fixed; }
  .plan th, .plan td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); vertical-align: top; }
  .plan thead th { padding: 10px 8px; font-size: .8rem; font-weight: 600; color: var(--muted); background: #fafbfc; cursor: pointer; position: sticky; top: 0; z-index: 3; text-align: left; }
  .plan thead th b { display: block; font-size: 1.15rem; color: var(--ink); font-weight: 700; line-height: 1.2; }
  .plan thead th:hover { background: var(--grey-bg); }
  .plan thead th.today { color: var(--primary); }
  .plan thead th.today b { color: #fff; background: var(--primary); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .95rem; }
  .plan th.tech-col { width: 170px; text-align: left; padding: 12px; font-size: .88rem; background: #fff; position: sticky; left: 0; z-index: 2; cursor: default; color: var(--ink); }
  .plan thead th.tech-col { z-index: 4; background: #fafbfc; }
  .plan .tech-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
  .plan .tech-cell small { display: block; color: var(--muted); font-weight: 500; font-size: .75rem; }
  .plan td.today { background: #f8faff; }
  .plan td.weekend { background: #fbfbfc; }
  .plan .cell { min-height: 96px; padding: 6px; display: flex; flex-direction: column; gap: 5px; height: 100%; }
  .plan .add { border: 1px dashed transparent; background: none; border-radius: 8px; color: var(--faint); cursor: pointer; height: 28px; margin-top: auto; display: grid; place-items: center; transition: all .15s; }
  .plan td:hover .add { border-color: #cbd5e1; }
  .plan .add:hover { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100) !important; }
  .pchip { border-radius: 9px; background: var(--blue-bg); border-left: 3px solid var(--blue); padding: 6px 8px; font-size: .78rem; cursor: pointer; line-height: 1.3; position: relative; transition: transform .1s, box-shadow .15s; }
  .pchip:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
  .pchip .t { font-weight: 700; color: var(--ink); }
  .pchip .h { font-size: .72rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 4px; }
  .pchip small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pchip.st-EN_COURS { background: #fff7ed; }
  .pchip.st-TERMINEE { background: #f0fdf4; }
  .pchip.st-TERMINEE .t { color: var(--muted); }
  .pchip.st-ANNULEE { background: var(--grey-bg); opacity: .65; }
  .pchip.st-ANNULEE .t { text-decoration: line-through; }
  .pchip .alert { position: absolute; top: -5px; right: -5px; background: var(--red-500); color: #fff; border-radius: 99px; font-size: .65rem; min-width: 18px; height: 18px; display: grid; place-items: center; font-weight: 700; border: 2px solid #fff; }
  /* Missions sur plusieurs jours */
  .pchip .h { white-space: nowrap; overflow: hidden; }
  .span-tag { background: rgba(15, 23, 42, .08); color: var(--ink-2); border-radius: 5px; padding: 0 5px; font-size: .68rem; font-weight: 700; margin-right: 2px; }
  .pchip.goes-on { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: -7px; }
  .pchip.cont { border-left-style: dashed; }
  .span-line { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--primary-700); background: var(--primary-50); border-radius: 8px; padding: 3px 8px; align-self: flex-start; }
  .span-line svg.i { width: 14px; height: 14px; }
  /* Poignées pour rallonger / raccourcir */
  .grip { position: absolute; top: 0; right: 0; bottom: 0; width: 10px; cursor: ew-resize; border-radius: 0 9px 9px 0; touch-action: none; }
  .grip::after { content: ""; position: absolute; right: 3px; top: 50%; width: 3px; height: 16px; margin-top: -8px; border-radius: 2px; background: currentColor; opacity: 0; color: var(--primary); transition: opacity .15s; }
  .pchip:hover .grip::after { opacity: .55; }
  .grip:hover::after { opacity: 1 !important; }
  .plan td.span-preview { background: var(--primary-50) !important; box-shadow: inset 0 0 0 2px var(--primary-100); }
  .tl-h { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; touch-action: none; z-index: 3; }
  .tl-h.l { left: 0; } .tl-h.r { right: 0; }
  .tl-h::after { content: ""; position: absolute; top: 50%; height: 18px; width: 3px; margin-top: -9px; border-radius: 2px; background: #fff; opacity: 0; transition: opacity .15s; }
  .tl-h.l::after { left: 3px; } .tl-h.r::after { right: 3px; }
  .tl-block:hover .tl-h::after { opacity: .8; }
  body.resizing, body.resizing * { cursor: ew-resize !important; user-select: none !important; }
  .dur-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 14px; padding: 10px 12px; background: #f8fafc; border: 1px solid var(--line-2); border-radius: 12px; }
  .dur-ctl .lbl { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: auto; }
  .dur-ctl .grp { display: flex; gap: 4px; }
  .dur-ctl .btn { box-shadow: none; }
  .legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: .8rem; color: var(--muted); }
  .legend span { display: inline-flex; align-items: center; gap: 6px; }
  .legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

  /* Frise horaire (jour) */
  .timeline { min-width: 980px; }
  .tl-row { display: flex; border-bottom: 1px solid var(--line-2); }
  .tl-row:last-child { border-bottom: 0; }
  .tl-name { width: 170px; flex: none; padding: 12px; font-weight: 600; font-size: .88rem; border-right: 1px solid var(--line-2); background: #fff; position: sticky; left: 0; z-index: 2; display: flex; align-items: center; gap: 10px; }
  .tl-track { position: relative; flex: 1; min-height: 76px; cursor: copy;
    background-image: repeating-linear-gradient(to right, var(--line-2) 0 1px, transparent 1px calc(100% / var(--hours))); }
  .tl-track:hover { background-color: #fafcff; }
  .tl-head .tl-track { min-height: 36px; cursor: default; background-color: #fafbfc; }
  .tl-head .tl-name { background: #fafbfc; color: var(--muted); font-size: .8rem; }
  .tl-head .tl-track span { position: absolute; top: 9px; font-size: .74rem; color: var(--muted); padding-left: 5px; font-weight: 600; }
  .tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red-500); z-index: 1; pointer-events: none; }
  .tl-now::before { content: ""; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red-500); }
  .tl-block { position: absolute; top: 8px; bottom: 8px; border-radius: 10px; color: #fff; padding: 6px 9px; font-size: .76rem; overflow: hidden; cursor: pointer; line-height: 1.3; box-shadow: var(--sh-2); min-width: 26px; transition: transform .1s, box-shadow .15s; }
  .tl-block:hover { box-shadow: var(--sh-3); transform: translateY(-1px); z-index: 2; }
  .tl-block b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .8rem; }
  .tl-block span { opacity: .9; white-space: nowrap; }
  .tl-block.st-TERMINEE { opacity: .55; }
  .tl-block.st-ANNULEE { opacity: .3; text-decoration: line-through; }
  .tl-block.st-EN_COURS { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--amber); }

  /* Agenda mobile */
  .daystrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px; margin-bottom: 14px; box-shadow: var(--sh-1); }
  .daypill { border: 0; background: none; border-radius: 12px; padding: 7px 0 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--muted); font-size: .7rem; font-weight: 600; text-transform: uppercase; }
  .daypill b { font-size: 1.05rem; color: var(--ink); font-weight: 700; }
  .daypill i { width: 5px; height: 5px; border-radius: 50%; background: transparent; margin-top: 2px; }
  .daypill i.has { background: var(--primary); }
  .daypill.today b { color: var(--primary); }
  .daypill.on { background: var(--primary); color: rgba(255,255,255,.8); }
  .daypill.on b { color: #fff; }
  .daypill.on i.has { background: #fff; }
  .agenda-tech { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-weight: 700; font-size: .92rem; }
  .agenda-tech .n { color: var(--muted); font-weight: 600; font-size: .82rem; }
  .agenda-tech .btn { margin-left: auto; }
  .agenda-empty { font-size: .86rem; color: var(--faint); padding: 10px 14px; border: 1px dashed var(--line); border-radius: 12px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
  .agenda-empty:hover { color: var(--primary); border-color: var(--primary-100); background: var(--primary-50); }

  /* ================================================================
     Cartes de mission (style agenda)
     ================================================================ */
  .mlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
  @media (max-width: 719px) { .mlist { grid-template-columns: 1fr; gap: 10px; } }
  .mlist > .card { margin: 0; }
  .mcard { display: flex; gap: 14px; padding: 14px; position: relative; overflow: hidden; }
  .mcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, transparent); }
  .mcard-time { width: 54px; flex: none; text-align: center; padding-top: 2px; }
  .mcard-time b { display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
  .mcard-time span { font-size: .76rem; color: var(--muted); font-weight: 600; }
  .mcard-time .dur { display: block; margin-top: 4px; font-size: .7rem; color: var(--faint); }
  .mcard-body { flex: 1; min-width: 0; border-left: 1px solid var(--line-2); padding-left: 14px; display: flex; flex-direction: column; gap: 6px; }
  .mcard-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .mcard-title { font-weight: 700; font-size: 1rem; line-height: 1.3; letter-spacing: -.01em; }
  .mcard .meta { font-size: .84rem; }
  .mcard .meta > span { max-width: 100%; }
  .mcard .meta .ellipsis { max-width: 230px; }
  .day-head { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 10px; font-weight: 700; font-size: .95rem; }
  .day-head:first-child { margin-top: 4px; }
  .day-head .today-tag { font-size: .72rem; background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 99px; font-weight: 700; }

  /* ================================================================
     Détail mission
     ================================================================ */
  .hero { padding: 20px; }
  .hero h1 { margin: 8px 0 6px; font-size: 1.45rem; }
  .hero .meta { margin-top: 8px; font-size: .92rem; }
  .hero .meta > span { color: var(--ink-2); }
  .hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
  .hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  .kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 24px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
  .kv > div > small { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--faint); margin-bottom: 3px; }
  .kv .full { grid-column: 1 / -1; }
  .kv .with-ico { display: flex; align-items: center; gap: 8px; }
  .quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
  .quick a, .quick button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: var(--primary-50); color: var(--primary-700); font-weight: 600; font-size: .82rem; border: 0; cursor: pointer; text-decoration: none; }
  .quick a:active, .quick button:active { transform: scale(.97); }
  .quick svg.i { width: 22px; height: 22px; }
  .note { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; border-radius: 10px; padding: 10px 12px; font-size: .9rem; white-space: pre-wrap; }
  .note.info { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary-700); }
  .note.warn { display: flex; gap: 8px; align-items: flex-start; }

  .task { padding: 0; overflow: hidden; }
  .task-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
  .task-body { padding: 0 16px 16px; }
  .num { width: 32px; height: 32px; border-radius: 50%; background: var(--grey-bg); color: var(--grey); display: grid; place-items: center; font-weight: 700; font-size: .88rem; flex: none; }
  .num svg.i { width: 16px; height: 16px; stroke-width: 3; }
  .st-EN_COURS .num { background: var(--orange-bg); color: var(--orange); }
  .st-TERMINEE .num { background: var(--green-500); color: #fff; }
  .task-title { font-weight: 700; line-height: 1.3; }
  .task-meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 2px; }
  .task-meta > span { display: inline-flex; align-items: center; gap: 4px; }
  .tag { font-size: .68rem; font-weight: 700; background: var(--violet-bg); color: var(--violet); padding: 2px 7px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; vertical-align: 2px; }
  .ba { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  @media (max-width: 640px) { .ba { grid-template-columns: 1fr; } }
  .ba h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; font-weight: 700; }

  /* Photos */
  .photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
  .ph { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--grey-bg); border: 0; padding: 0; cursor: zoom-in; }
  .ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .3s; }
  .ph img:not([src]) { opacity: 0; }
  .ph:has(img:not([src]))::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #eceff4 0%, #f6f7fa 50%, #eceff4 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
  .ph .del { position: absolute; top: 5px; right: 5px; background: rgba(15, 23, 42, .65); color: #fff; border: 0; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; display: grid; place-items: center; z-index: 2; backdrop-filter: blur(4px); }
  .ph .del svg.i { width: 14px; height: 14px; }
  .ph.pending img { opacity: .5; }
  .ph.pending::before { content: ""; position: absolute; z-index: 2; inset: 0; margin: auto; width: 26px; height: 26px; border: 3px solid rgba(255,255,255,.6); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
  .ph-add { aspect-ratio: 1; border-radius: 12px; border: 2px dashed #c7d2fe; background: var(--primary-50); color: var(--primary); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-size: .74rem; font-weight: 700; text-align: center; transition: background .15s; }
  .ph-add:hover { background: var(--primary-100); }
  .ph-add svg.i { width: 26px; height: 26px; }
  .ph-add.alt { border-color: var(--line); background: #fff; color: var(--muted); }
  .photos-empty { font-size: .85rem; color: var(--faint); padding: 4px 0; }
  .viewer { position: relative; }
  .viewer img { width: 100%; max-height: 78vh; object-fit: contain; display: block; background: #0b1220; border-radius: 12px; }

  /* ================================================================
     Espace technicien
     ================================================================ */
  .greet { margin-bottom: 18px; }
  .greet .date { color: var(--muted); font-weight: 600; font-size: .88rem; }
  .greet .date::first-letter { text-transform: uppercase; }
  .greet h1 { margin-top: 2px; }
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
  .stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--sh-1); }
  .stat b { display: block; font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
  .stat span { font-size: .76rem; color: var(--muted); font-weight: 600; }
  .current { background: linear-gradient(135deg, #1d4ed8, #2563eb 55%, #3b82f6); color: #fff; border: 0; border-radius: var(--r-xl); padding: 18px; margin-bottom: 18px; box-shadow: 0 12px 24px -10px rgba(37, 99, 235, .6); cursor: pointer; }
  .current .label { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; opacity: .85; display: flex; align-items: center; gap: 6px; }
  .current .label i { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .3); animation: pulse 1.6s infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); } }
  .current h2 { margin: 6px 0 4px; color: #fff; }
  .current .meta, .current .meta svg.i { color: rgba(255, 255, 255, .85); }
  .current .progress { background: rgba(255, 255, 255, .25); margin-top: 14px; }
  .current .progress > div { background: #fff; }
  .current .btn { margin-top: 14px; background: #fff; color: var(--primary-700); border: 0; }

  .tlist .tech-task { display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; }
  .tlist .tech-task + .tech-task { margin-top: 8px; }
  .tech-task .chev { color: var(--faint); }
  .tech-task.next { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
  .next-tag { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); }

  /* Stepper */
  .stepper { display: flex; align-items: center; margin: 4px 0 16px; padding: 14px 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
  .stp { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .72rem; font-weight: 600; color: var(--faint); position: relative; text-align: center; }
  .stp .c { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; z-index: 1; font-weight: 700; font-size: .8rem; }
  .stp .c svg.i { width: 15px; height: 15px; stroke-width: 3; }
  .stp:not(:first-child)::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--line); }
  .stp.done { color: var(--green); }
  .stp.done .c { background: var(--green-500); border-color: var(--green-500); color: #fff; }
  .stp.done::before, .stp.cur::before { background: var(--green-500) !important; }
  .stp.cur { color: var(--primary); }
  .stp.cur .c { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }

  .block-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 700; }
  .block-title .count { color: var(--muted); font-weight: 600; font-size: .9rem; }
  .block-title .right { margin-left: auto; }
  .save-state { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
  .save-state.ok { color: var(--green); }
  .locked-hint { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: .88rem; padding: 6px 0; }

  /* Barre d'action fixe (pouce) */
  .actionbar-space { height: 84px; }
  .actionbar { position: fixed; left: 0; right: 0; z-index: 35; padding: 12px 16px; bottom: calc(var(--bottom-nav) + var(--safe-b));
    background: linear-gradient(to top, var(--bg) 70%, rgba(245, 247, 251, 0)); }
  .actionbar .inner { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; }
  .actionbar .btn { box-shadow: var(--sh-3); }
  .actionbar .hint { text-align: center; font-size: .78rem; color: var(--muted); margin-top: 6px; }
  @media (min-width: 720px) { .actionbar { bottom: 0; padding-bottom: 20px; } }
  @media (min-width: 1024px) { .actionbar { left: var(--nav-w); } }

  /* ================================================================
     Formulaire de mission
     ================================================================ */
  .form-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  @media (min-width: 1100px) { .form-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } .form-layout .span2 { grid-column: 1 / -1; } }
  .form-layout .card + .card { margin-top: 0; }
  .dur-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 14px; }
  .dur-chips button { border: 1px solid var(--line); background: #fff; border-radius: 99px; height: 30px; padding: 0 11px; font-size: .8rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
  .dur-chips button:hover, .dur-chips button.on { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
  .avail { border-radius: 12px; background: #f8fafc; border: 1px solid var(--line-2); padding: 10px 12px; font-size: .84rem; }
  .avail b { display: flex; align-items: center; gap: 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
  .avail .slot { display: flex; gap: 8px; padding: 3px 0; }
  .avail .slot.clash { color: var(--red); font-weight: 600; }
  .avail.ok { background: var(--green-bg); border-color: #bbf7d0; color: var(--green); font-weight: 600; display: flex; align-items: center; gap: 6px; }
  .trow { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: box-shadow .15s; }
  .trow + .trow { margin-top: 8px; }
  .trow:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
  .trow .num { margin-top: 6px; width: 28px; height: 28px; font-size: .8rem; }
  .trow .t-titre { border: 0; outline: 0; width: 100%; font-weight: 600; padding: 7px 2px; font-size: 16px; background: none; }
  .trow .t-desc { border: 0; outline: 0; width: 100%; resize: none; font-size: .9rem; color: var(--muted); padding: 2px; background: none; min-height: 22px; overflow: hidden; line-height: 1.4; }
  .trow .tbtns { display: flex; gap: 2px; }
  .trow .tbtns button { border: 0; background: none; color: var(--faint); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
  .trow .tbtns button:hover:not(:disabled) { background: var(--grey-bg); color: var(--ink); }
  .trow .tbtns button:disabled { opacity: .3; cursor: not-allowed; }
  .trow.locked { background: #fafafa; }
  .add-task { width: 100%; margin-top: 8px; border: 1.5px dashed #cbd5e1; background: none; border-radius: 12px; height: 46px; color: var(--muted); font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
  .add-task:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
  .form-foot { position: sticky; bottom: calc(var(--bottom-nav) + var(--safe-b)); z-index: 20; margin: 16px -16px 0; padding: 12px 16px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
  @media (max-width: 719px) { .form-foot .btn { flex: 1; } }
  @media (min-width: 720px) { .form-foot { bottom: 0; margin: 16px 0 0; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); } }

  /* Filtres */
  .filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
  .filters .line { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .filters .line > .input-icon { flex: 1 1 240px; }
  .filters select.input, .filters input[type=date].input { width: auto; flex: 1 1 140px; height: 40px; font-size: .9rem; }
  .count-line { color: var(--muted); font-size: .85rem; font-weight: 600; margin: 6px 0 2px; }

  /* Équipe */
  .ucard { display: flex; align-items: center; gap: 12px; padding: 14px; }
  .ucard .info { flex: 1; min-width: 0; }
  .ucard .info b { display: block; }
  .ucard .info .meta { font-size: .82rem; margin-top: 2px; }
  .ucard.off { opacity: .6; }

  /* ================================================================
     Modales et notifications
     ================================================================ */
  .modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .18s; }
  .modal { background: #fff; border-radius: var(--r-xl); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 24px 48px -12px rgba(16, 24, 40, .35); animation: pop .2s cubic-bezier(.2, .9, .3, 1.2); }
  .modal.wide { max-width: 960px; }
  .modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 8px; gap: 10px; }
  .modal-head h3 { font-size: 1.08rem; }
  .modal-body { padding: 8px 18px 16px; overflow-y: auto; }
  .modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line-2); }
  .modal-x { border: 0; background: var(--grey-bg); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: var(--muted); flex: none; }
  .modal-x svg.i { width: 16px; height: 16px; }
  .modal.dark { background: #0b1220; color: #fff; }
  .modal.dark .modal-x { background: rgba(255,255,255,.12); color: #fff; }
  @media (max-width: 719px) {
    .modal-backdrop { align-items: flex-end; padding: 0; }
    .modal { border-radius: 22px 22px 0 0; max-height: 92vh; animation: sheet .25s cubic-bezier(.2, .9, .3, 1); padding-bottom: var(--safe-b); }
    .modal-head::before { content: ""; position: absolute; left: 50%; top: 7px; width: 38px; height: 4px; border-radius: 4px; background: #d5dae2; transform: translateX(-50%); }
    .modal-head { position: relative; padding-top: 22px; }
    .modal-foot .btn { flex: 1; height: 48px; }
  }
  @keyframes fade { from { opacity: 0; } }
  @keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }
  @keyframes sheet { from { transform: translateY(100%); } }
  #toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-nav) + var(--safe-b) + 92px); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
  @media (min-width: 720px) { #toast { bottom: 28px; } }
  .toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--sh-3); font-weight: 500; font-size: .92rem; animation: toastIn .25s cubic-bezier(.2, .9, .3, 1.2); }
  .toast svg.i { width: 18px; height: 18px; }
  .toast.success svg.i { color: #4ade80; }
  .toast.error { background: #b91c1c; }
  .toast.out { opacity: 0; transform: translateY(6px); transition: all .25s; }
  @keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }

  /* ================================================================
     Tableau de bord
     ================================================================ */
  .kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
  @media (max-width: 719px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
  @media (min-width: 1280px) { .kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
  .kpi { position: relative; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--sh-1); cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: box-shadow .15s, border-color .15s; min-width: 0; }
  .kpi:hover { box-shadow: var(--sh-3); border-color: #d6dbe4; }
  .kpi b { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; }
  .kpi > span:not(.kpi-ico) { font-weight: 600; font-size: .86rem; color: var(--ink-2); }
  .kpi small { color: var(--muted); font-size: .76rem; }
  .kpi-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
  .kpi.danger .kpi-ico { background: var(--red-bg); color: var(--red); }
  .kpi.danger b { color: var(--red); }
  .kpi.warn .kpi-ico { background: var(--orange-bg); color: var(--orange); }
  .dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .dash-grid .card + .card { margin-top: 0; }
  @media (max-width: 960px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
  .dlist { display: flex; flex-direction: column; }
  .drow { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 10px; cursor: pointer; min-width: 0; }
  .drow + .drow { border-top: 1px solid var(--line-2); }
  .drow:hover { background: #f8fafc; }
  .drow.static { cursor: default; }
  .drow.static:hover { background: none; }
  .drow .grow { display: flex; flex-direction: column; min-width: 0; }
  .drow small { color: var(--muted); font-size: .78rem; }
  .dtime { width: 46px; flex: none; font-weight: 700; font-size: .86rem; display: flex; flex-direction: column; line-height: 1.2; }
  .dtime small { font-weight: 600; }
  .dtime.late { color: var(--red); }
  .bars { display: flex; flex-direction: column; gap: 10px; }
  .bar-row { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 54px; align-items: center; gap: 10px; }
  @media (max-width: 719px) { .bar-row { grid-template-columns: minmax(0, 120px) minmax(0, 1fr) 46px; } }
  .bar-label { display: flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600; min-width: 0; }
  .bar-track { position: relative; height: 14px; background: var(--line-2); border-radius: 4px; }
  .bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); border-radius: 0 4px 4px 0; }
  .bar-fill.over { background: var(--orange); }
  .bar-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); opacity: .45; }
  .bar-val { font-size: .84rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
  .stack { display: flex; gap: 2px; height: 16px; border-radius: 4px; overflow: hidden; background: var(--line-2); }
  .stack span { display: block; height: 100%; }
  .stack-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: .84rem; color: var(--ink-2); }
  .stack-legend span { display: inline-flex; align-items: center; gap: 6px; }
  .stack-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
  .stack-legend b { font-variant-numeric: tabular-nums; }

  /* ================================================================
     Missions, tâches, techniciens
     ================================================================ */
  .avatar.xs { width: 24px; height: 24px; font-size: .62rem; border: 2px solid #fff; }
  .avatar.empty { background: var(--grey-bg); color: var(--muted); border: 1px dashed #cbd5e1; }
  .avatars { display: inline-flex; }
  .avatars .avatar + .avatar { margin-left: -6px; }
  .aff { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; font-weight: 700; color: var(--muted); background: var(--grey-bg); border-radius: 6px; padding: 2px 7px; }
  .mcard2 { display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 14px 18px; position: relative; overflow: hidden; }
  .mcard2::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, transparent); }
  .mcard-foot2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
  .mcard-sub { font-size: .84rem; color: var(--muted); font-weight: 600; margin-top: -2px; }
  .span-line.todo { background: var(--orange-bg); color: var(--orange); }
  .warn-line { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--orange); }
  .warn { color: var(--orange); font-weight: 600; }
  .today-tag.warn { background: var(--orange); }
  .today-tag.grey { background: var(--grey); }
  .grp-head { margin: 20px 0 4px; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
  .plan tr.grp th { background: #f1f5f9; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 6px 12px; position: sticky; left: 0; }
  .tl-grp { padding: 6px 12px; background: #f1f5f9; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line-2); position: sticky; left: 0; }
  .pchip.st-TERMINEE { background: #f0fdf4; }
  .task-head .task-actions { display: flex; gap: 2px; margin-left: 4px; }
  .task-meta .avatar.xs { margin-right: 4px; }
  .task-when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .86rem; color: var(--ink-2); font-weight: 600; }
  .task-when > span { display: inline-flex; align-items: center; gap: 6px; }
  .task-when svg.i { color: var(--faint); }
  .task-when .qrs { gap: 4px; margin-left: auto; }
  .task-when .qrs .btn { box-shadow: none; height: 30px; padding: 0 9px; font-size: .78rem; }
  .h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; font-weight: 700; }
  .mini-mission { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #f8fafc; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; }
  .mini-mission .grow { display: flex; flex-direction: column; min-width: 0; }
  .mini-mission small { color: var(--muted); font-size: .8rem; }
  .mini-mission + .quick { margin-top: 10px; }
  .block-title .req { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--red); background: var(--red-bg); padding: 2px 8px; border-radius: 99px; }
  .ideas { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; }
  .ideas button { border: 1px dashed #cbd5e1; background: #fff; border-radius: 99px; height: 28px; padding: 0 10px; font-size: .78rem; font-weight: 600; color: var(--ink-2); cursor: pointer; }
  .ideas button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
  .form-layout2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
  @media (max-width: 719px) { .form-layout2 { grid-template-columns: minmax(0, 1fr); } }
  optgroup { font-weight: 700; }
  .sm-only { display: none; }
  @media (max-width: 719px) {
    .hide-mobile { display: none !important; }
    .nav-item .lg { display: none; }
    .nav-item .sm-only { display: inline; }
  }

  /* Suggestions personnalisées sous les champs */
  .sg-wrap { position: relative; }

  /* Cartes (OpenStreetMap / Leaflet) */
  .map-box { height: 220px; margin-top: 14px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line, #e2e8f0); background: var(--grey-bg); position: relative; z-index: 0; }
  .map-box.tall { height: 340px; margin-top: 4px; }
  .map-box.big { height: min(58vh, 460px); margin-top: 0; }
  .map-empty { display: grid; place-items: center; height: 100%; color: var(--muted, #64748b); font-size: 14px; padding: 16px; text-align: center; }
  .map-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--muted, #64748b); }
  .map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
  .addr-row { display: flex; gap: 8px; align-items: stretch; }
  .addr-row .grow { flex: 1; min-width: 0; }
  .addr-row .btn { flex: none; }
  #gpsState { display: flex; gap: 6px; align-items: center; }
  #gpsState.ok { color: #15803d; }
  .mp-results { display: grid; gap: 6px; margin-bottom: 8px; }
  .mp-results:empty { display: none; }
  .mp-result { display: flex; gap: 8px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line, #e2e8f0); background: var(--card, #fff); color: inherit; font: inherit; cursor: pointer; }
  .mp-result:hover { border-color: #2563eb; }
  .ph .ph-far { position: absolute; left: 5px; bottom: 5px; z-index: 2; display: inline-flex; gap: 3px; align-items: center; background: #dc2626; color: #fff; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 999px; }
  .ph .ph-far svg.i { width: 12px; height: 12px; }
  @media (max-width: 600px) { .addr-row .btn span { display: none; } .map-box.tall { height: 260px; } }
  .sg-box { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: var(--sh-3); padding: 4px; max-height: 260px; overflow-y: auto; }
  .sg-head { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 6px 10px 4px; }
  .sg-item { padding: 9px 10px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: .92rem; color: var(--ink-2); }
  .sg-item b { color: var(--primary); font-weight: 700; }
  .sg-item:hover, .sg-item.on { background: var(--primary-50); color: var(--ink); }

  /* Bon de fin, signature, entreprise */
  .bon-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--green-bg); color: var(--green); display: grid; place-items: center; flex: none; }
  .sig-wrap { position: relative; border: 2px dashed #cbd5e1; border-radius: 12px; overflow: hidden; background: #fff; }
  .sig-wrap.off { opacity: .35; pointer-events: none; }
  .sig-canvas { display: block; width: 100%; height: auto; aspect-ratio: 900 / 340; touch-action: none; cursor: crosshair; }
  .sig-hint { position: absolute; left: 0; right: 0; bottom: 18%; text-align: center; color: var(--faint); font-size: .85rem; pointer-events: none; border-top: 1px solid var(--line); margin: 0 12%; padding-top: 4px; }
  .ent-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
  .ent-logo img { height: 64px; max-width: 180px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
  .ent-logo label.btn { margin: 0; }

  /* Tâches interrompues : état d'avancement / à replanifier */
  .replan-box { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--red-bg); border: 1px solid #fecaca; color: #7f1d1d; }
  .replan-box > svg.i { color: var(--red); margin-top: 2px; }
  .replan-box .btn { flex: none; align-self: center; }
  .replan-card { border-color: #fecaca; margin-bottom: 14px; }
  .replan-card .card-title { color: var(--red); }
  .report { padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fafbfc; font-size: .88rem; display: flex; flex-direction: column; gap: 4px; }
  .report + .report { margin-top: 8px; }
  .report small { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
  .tag.replan { background: var(--red-bg); color: var(--red); }
  .pchip .tag { display: inline-block; white-space: nowrap; margin-top: 3px; font-size: .6rem; letter-spacing: .02em; padding: 1px 6px; }
  .pchip.st-A_REPLANIFIER { background: repeating-linear-gradient(135deg, #fef2f2 0 6px, #fee2e2 6px 12px); border-left-color: var(--red) !important; }
  .pchip.st-A_REPRENDRE { background: var(--violet-bg); }
  .tl-block.st-A_REPLANIFIER { opacity: .55; outline: 2px dashed var(--red); outline-offset: -2px; }
  .report-btn { margin-top: 8px; height: 44px; background: rgba(255,255,255,.95) !important; border: 1px solid var(--line) !important; }
  .ideas button.on { border-style: solid; border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
  input.range { padding: 0 !important; height: 32px !important; box-shadow: none !important; border: 0 !important; accent-color: var(--primary); }
  @media (min-width: 1280px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

  /* ================================================================
     Maquette (dessin)
     ================================================================ */
  .sk-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
  .sk-grp { display: flex; gap: 3px; background: var(--grey-bg); border-radius: 12px; padding: 3px; align-items: center; }
  .sk-btn { border: 0; background: none; height: 38px; min-width: 38px; padding: 0 9px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
  .sk-btn.on { background: #fff; box-shadow: var(--sh-2); color: var(--primary); }
  @media (max-width: 719px) { .sk-btn span { display: none; } }
  .sk-color { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; background: var(--c); cursor: pointer; margin: 4px; box-shadow: 0 0 0 1px var(--line); }
  .sk-color.on { box-shadow: 0 0 0 2px var(--primary); }
  .sk-w { width: 38px; height: 38px; border: 0; background: none; border-radius: 9px; cursor: pointer; display: grid; place-items: center; }
  .sk-w i { display: block; width: 20px; background: var(--ink); border-radius: 4px; }
  .sk-w.on { background: #fff; box-shadow: var(--sh-2); }
  .sk-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
  .sk-canvas { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; touch-action: none; cursor: crosshair; }
  button.ph-add { font: inherit; }

  /* ================================================================
     Impression (rapport d'intervention)
     ================================================================ */

  /* ================================================================
     RETA, équipes, facturation, carte des techniciens
     ================================================================ */
  /* Choix de plusieurs techniciens (puces) */
  .tpick { display: flex; flex-direction: column; gap: 8px; }
  .tp-grp small { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
  .tp-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .tp { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 4px; border-radius: 99px; border: 1px solid var(--line); background: #fff;
    font: inherit; font-size: .86rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background .15s, border-color .15s; }
  .tp i { width: 28px; height: 28px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-style: normal; font-size: .7rem; font-weight: 700; opacity: .55; }
  .tp:hover { border-color: var(--primary); }
  .tp.on { background: var(--primary-50); border-color: var(--primary); color: var(--primary-700); }
  .tp.on i { opacity: 1; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); }
  .tp-sum { font-size: .82rem; color: var(--ink-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 20px; }
  .team-n { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; color: var(--ink-2); vertical-align: -2px; }
  .team-n svg.i { width: 12px; height: 12px; }
  .span-tag.reta { background: var(--violet-bg); color: var(--violet); }
  .mcard-time .day-l { font-size: .82rem; }
  .tag.supp { background: var(--orange-bg); color: var(--orange); }
  small.ok { color: var(--green); font-weight: 600; }
  small.warn { color: var(--orange); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
  .kv-comp { font-size: .86rem; color: var(--ink-2); margin-top: 2px; }
  .kv-remp { background: #fff7ed; border-radius: 10px; padding: 8px 10px; margin: -8px -10px 0; }
  .mini-mission small.remp { color: var(--orange); font-weight: 600; }
  .mini-mission small { display: flex; align-items: center; gap: 4px; }
  /* Formulaire mission : type et planification RETA */
  .type-seg button { height: 40px; }
  .reta-plan { border-color: #ddd6fe; background: linear-gradient(180deg, #faf5ff, #fff 120px); }
  .mtype-line { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
  /* Liste RETA (bureau) */
  .rlist { display: flex; flex-direction: column; margin: -4px 0 12px; }
  .ritem { display: flex; gap: 12px; align-items: flex-start; padding: 10px 2px; border-bottom: 1px solid var(--line-2); }
  .ritem .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .ritem .rtitle { font-weight: 600; }
  .ritem.done .rtitle { color: var(--muted); text-decoration: line-through; text-decoration-color: #94a3b8; }
  .ritem.pending { opacity: .6; }
  .rbox { width: 24px; height: 24px; flex: none; border-radius: 7px; border: 2px solid #cbd5e1; display: grid; place-items: center; margin-top: 1px; color: #fff; }
  .ritem.done .rbox { background: var(--green-500); border-color: var(--green-500); }
  .rbox svg.i { width: 15px; height: 15px; stroke-width: 3; }
  .rphotos { margin-top: 6px; }
  .rphotos .photos { grid-template-columns: repeat(auto-fill, minmax(64px, 72px)); }
  .radd { display: flex; gap: 8px; align-items: flex-end; }
  .radd textarea { flex: 1; min-height: 44px; resize: none; overflow: hidden; padding: 11px 13px; border: 1px solid #d5dae2; border-radius: 11px; font: inherit; line-height: 1.4; background: #fff; }
  .radd textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-100); }
  /* Liste RETA à cocher (téléphone) */
  .rcheck { padding: 6px 14px; }
  .rcheck > .progress-row { margin: 10px 0 4px; }
  .citem { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
  .citem:last-child { border-bottom: 0; }
  .citem .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: pointer; padding-top: 4px; }
  .citem .ctitle { font-weight: 600; font-size: 1rem; }
  .citem.done .ctitle { color: var(--muted); text-decoration: line-through; text-decoration-color: #94a3b8; }
  .cbox { width: 36px; height: 36px; flex: none; border-radius: 10px; border: 2px solid #cbd5e1; background: #fff; display: grid; place-items: center; cursor: pointer; color: transparent;
    transition: background .15s, border-color .15s, transform .1s; }
  .cbox:active { transform: scale(.92); }
  .cbox svg.i { width: 22px; height: 22px; stroke-width: 3; }
  .citem.done .cbox { background: var(--green-500); border-color: var(--green-500); color: #fff; }
  .cbox:disabled { cursor: default; opacity: .6; }
  .citem .cam { flex: none; align-self: center; }
  .reta-where { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; font-size: .92rem; }
  .reta-where > div { display: flex; gap: 8px; align-items: flex-start; }
  .reta-where svg.i { margin-top: 3px; color: var(--muted); }
  .reta-where small { display: block; color: var(--muted); font-size: .8rem; }
  .reta-where .remp { color: var(--orange); font-weight: 600; }
  .reta-where .remp svg.i { color: var(--orange); }
  /* Facturation dans la liste des missions */
  .bill-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
  .bill-line > span { display: inline-flex; align-items: center; gap: 5px; color: var(--orange); font-weight: 700; font-size: .84rem; }
  .fsep { width: 1px; background: var(--line); margin: 4px 2px; flex: none; }
  .fchip.bill { display: inline-flex; align-items: center; gap: 5px; }
  .fchip.bill.on { background: var(--green); border-color: var(--green); }
  /* Priorité « Urgent » et filtre « À planifier » */
  .fchip.aplan { display: inline-flex; align-items: center; gap: 5px; }
  .fchip.aplan.on { background: var(--orange); border-color: var(--orange); }
  .span-tag.urgent { background: var(--red); color: #fff; }
  .seg button.urgent.on { background: var(--red); color: #fff; }
  .bill-box.grey { background: var(--grey-bg); color: var(--ink-2); }
  .bon-ico.warn { background: var(--orange-bg); color: var(--orange); }
  .bon-ico.grey { background: var(--grey-bg); color: var(--grey); }
  .bill-steps { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: .8rem; font-weight: 600; color: var(--faint); flex-wrap: wrap; }
  .bill-steps span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: var(--grey-bg); }
  .bill-steps span.done { background: var(--green-bg); color: var(--green); }
  .bill-steps span.cur { background: var(--primary); color: #fff; }
  .bill-steps i { width: 14px; height: 2px; background: var(--line); }
  /* Carte : chantiers (ronds) et regroupements (nombre) */
  .site-pin { background: none; border: 0; }
  .site-pin span { display: block; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, .4); }
  .site-cluster { background: none; border: 0; }
  .site-cluster span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff;
    font: 800 13px/1 "Inter Variable", Inter, system-ui, sans-serif; border: 3px solid #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .25), 0 2px 8px rgba(15, 23, 42, .3); }
  /* Carte : techniciens (pastilles à leurs initiales) */
  .tech-pin { background: none; border: 0; }
  .tech-pin span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font: 700 12px/1 "Inter Variable", Inter, system-ui, sans-serif;
    border: 3px solid #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .35); }
  .map-legend .tech-dot { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: .62rem; margin-right: 6px; vertical-align: middle; }
  .map-legend small { color: var(--faint); margin-left: 3px; }
  .map-box.xl { height: min(64vh, 560px); margin-top: 0; }
  /* Export / facturation */
  .bill-box { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--green-bg); color: #14532d; }
  .bill-box.hidden { display: none; }
  .bon-ico.ok { background: var(--green-bg); color: var(--green); }

  /* ---------------- Ajouts de la version RENOV MULTI SERVICES ---------------- */
  /* Priorité URGENT : badge rouge bien visible partout */
  .badge.urgent { background: #dc2626; color: #fff; letter-spacing: .04em; }
  .badge.urgent::before { display: none; }
  .badge.urgent svg.i { width: 12px; height: 12px; }
  .card.is-urgent { box-shadow: inset 4px 0 0 #dc2626, var(--sh-1); }
  .fchip.urgent { display: inline-flex; align-items: center; gap: 5px; }
  .fchip.urgent.on { background: #dc2626; border-color: #dc2626; color: #fff; }
  .drow .badge.urgent { flex: none; }
  /* Carte : mission à planifier (losange « ! »), rouge si urgente ; chantier urgent cerclé de rouge */
  .todo-pin { background: none; border: 0; }
  .todo-pin span { display: grid; place-items: center; width: 22px; height: 22px; margin: 3px; transform: rotate(45deg); border-radius: 5px;
    background: #f59e0b; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(15, 23, 42, .45); }
  .todo-pin span b { transform: rotate(-45deg); color: #fff; font: 800 13px/1 "Inter Variable", Inter, system-ui, sans-serif; }
  .todo-pin.urgent span { background: #dc2626; box-shadow: 0 0 0 4px rgba(220, 38, 38, .25), 0 1px 5px rgba(15, 23, 42, .45); }
  .site-pin.urgent span { box-shadow: 0 0 0 3px #dc2626, 0 1px 4px rgba(15, 23, 42, .4); }
  .map-legend i.todo { border-radius: 2px; transform: rotate(45deg); }
  .map-legend i.ring { background: #fff; box-shadow: 0 0 0 2px #dc2626; }
  /* Carte des interventions à planifier : liste à côté de la carte */
  .carte-plan { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 14px; align-items: start; }
  .carte-plan .map-box { height: min(70vh, 620px); margin-top: 0; }
  .cp-list { display: flex; flex-direction: column; gap: 8px; max-height: min(70vh, 620px); overflow-y: auto; padding-right: 2px; }
  .cp-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 6px 2px 0; }
  .cp-item { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; color: inherit;
    display: flex; flex-direction: column; gap: 4px; }
  .cp-item:hover, .cp-item.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
  .cp-item.todo { border-left: 4px solid #f59e0b; }
  .cp-item.todo.urgent { border-left-color: #dc2626; background: #fff7f7; }
  .cp-item .cp-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .cp-item b { font-size: .95rem; }
  .cp-item small { color: var(--muted); }
  .cp-item .cp-manque { color: #b45309; font-weight: 600; font-size: .8rem; }
  .cp-item .cp-nopos { color: var(--faint); font-size: .78rem; }
  .cp-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .cp-toggles .fchip { display: inline-flex; align-items: center; gap: 6px; }
  .cp-toggles .fchip i { width: 10px; height: 10px; display: inline-block; }
  .cp-toggles .fchip i.todo { background: #f59e0b; transform: rotate(45deg); border-radius: 2px; }
  .cp-toggles .fchip i.dot { background: #3b82f6; border-radius: 50%; }
  @media (max-width: 899px) {
    .carte-plan { grid-template-columns: minmax(0, 1fr); }
    .carte-plan .map-box { height: 52vh; }
    .cp-list { max-height: none; overflow: visible; }
  }
  /* Signature manquante (clôture du bureau) */
  .note.danger { background: var(--red-bg); border-color: #fecaca; color: var(--red); display: flex; gap: 8px; align-items: flex-start; }
  /* Équipe, compte, double authentification */
  .ucard-tags { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
  .sec-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2); }
  .sec-actions .row { flex-wrap: wrap; gap: 8px; }
  .compte { max-width: 560px; }
  .trust-row { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
  .switch.trust { margin: 4px 0 2px; }
  .login .help { margin-bottom: 14px; }
  .login .qr { display: block; margin: 8px auto 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
  .login .steps-list { padding-left: 18px; text-align: left; margin: 6px 0 4px; }
  .login .btn.ghost.block { margin-top: 8px; }
  code.cle { font-size: .8rem; word-break: break-all; background: var(--grey-bg); padding: 2px 6px; border-radius: 6px; }
  pre.codes-secours { background: var(--grey-bg); border-radius: 10px; padding: 12px 14px; font-size: 1rem; letter-spacing: .06em; text-align: center; margin: 10px 0 14px; user-select: all; }
  .login-brand { text-align: center; font-size: .78rem; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin-top: 2px; }

  @media print {
    .topbar, .nav, .back, .no-print, .ph .del, .actionbar, #toast { display: none !important; }
    body { background: #fff; font-size: 12px; }
    .main { margin: 0 !important; padding: 0 !important; }
    .card { box-shadow: none; break-inside: avoid; }
    .photos { grid-template-columns: repeat(4, 1fr); }
  }
