/* =========================================================
   Climat Elec — Fiches d'intervention
   Design tokens
   ========================================================= */
:root{
  --ce-navy: #16303f;
  --ce-navy-2: #1f4356;
  --ce-blue: #2f86b4;
  --ce-orange: #e8792a;
  --ce-orange-dark: #c85f16;
  --ce-bg: #f3f5f6;
  --ce-card: #ffffff;
  --ce-border: #e1e6e9;
  --ce-text: #16303f;
  --ce-text-muted: #5c6b74;
  --ce-success: #2f9e5b;
  --ce-success-bg: #e7f5ec;
  --ce-pending: #c85f16;
  --ce-pending-bg: #fdf0e6;
  --ce-danger: #c0392b;
  /* BP-05 : variantes « texte » (contraste ≥ 4.5:1 sur fond clair) — les teintes d'origine restent pour les fonds et pastilles. */
  --ce-pending-text: #a84d0f;
  --ce-success-text: #1f7a43;
  --ce-blue-text: #2a6f97;
  --ce-radius: 14px;
  --ce-radius-sm: 9px;
  --ce-gradient: linear-gradient(135deg, var(--ce-blue), var(--ce-orange));
  --ce-shadow: 0 1px 2px rgba(22,48,63,.06), 0 4px 14px rgba(22,48,63,.08);
  --ce-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ce-font-mono: "SF Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family:var(--ce-font);
  background:var(--ce-bg);
  color:var(--ce-text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
button,input,textarea,select{font-family:inherit;}

h1,h2,h3{margin:0;font-weight:700;letter-spacing:-.01em;}

/* ---------- App shell ---------- */
#app{
  max-width:560px;
  margin:0 auto;
  min-height:100%;
  display:flex;
  flex-direction:column;
  background:var(--ce-bg);
}

.topbar{
  position:sticky;
  top:0;
  z-index:20;
  padding-top:calc(10px + var(--safe-top));
  background:var(--ce-navy);
  color:#fff;
  box-shadow:var(--ce-shadow);
}
.topbar-row{
  display:flex;
  align-items:center;
  gap:10px;
  padding:2px 14px 12px;
}
.brand-mark{
  height:32px;width:auto;flex:none;
  background:#fff;
  border-radius:7px;
  padding:3px 7px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
  object-fit:contain;
}
.topbar h1{font-size:16px;color:#fff;}
.topbar .subtitle{font-size:11.5px;color:#b9cbd6;font-family:var(--ce-font-mono);letter-spacing:.02em;}
.icon-btn{
  margin-left:auto;
  width:44px;height:44px; /* cible tactile ≥ 44 px (BP-05) */border-radius:10px;
  background:rgba(255,255,255,.1);
  border:none;color:#fff;
  display:flex;align-items:center;justify-content:center;
}
.topbar-actions{
  margin-left:auto;
  display:flex;align-items:center;gap:8px;
}
.topbar-actions .icon-btn{margin-left:0;}
.icon-btn:active{background:rgba(255,255,255,.22);}
.back-btn{
  width:34px;height:34px;border-radius:9px;border:none;
  background:rgba(255,255,255,.1);color:#fff;flex:none;
  display:flex;align-items:center;justify-content:center;
}

.offline-pill{
  display:none;
  align-items:center;gap:6px;
  font-size:11.5px;font-family:var(--ce-font-mono);
  background:#2a1607;color:#ffd9b0;
  padding:4px 14px;
}
.offline-pill.show{display:flex;}
.offline-dot{width:6px;height:6px;border-radius:50%;background:var(--ce-orange);}

main{flex:1;padding:14px 14px calc(90px + var(--safe-bottom));}

/* ---------- Cards / lists ---------- */
.card{
  background:var(--ce-card);
  border:1px solid var(--ce-border);
  border-radius:var(--ce-radius);
  box-shadow:var(--ce-shadow);
  overflow:hidden;
}
.card + .card{margin-top:12px;}

.section-label{
  font-size:11px;
  font-family:var(--ce-font-mono);
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--ce-text-muted);
  margin:20px 2px 8px;
}
.section-label:first-child{margin-top:2px;}

.intervention-item{
  display:flex;
  gap:12px;
  align-items:flex-start;
  width:100%;
  text-align:left;
  padding:14px;
  background:var(--ce-card);
  border:1px solid var(--ce-border);
  border-radius:var(--ce-radius);
  box-shadow:var(--ce-shadow);
}
.intervention-item + .intervention-item{margin-top:10px;}
.intervention-item svg{width:18px;height:18px;color:var(--ce-text-muted);flex:none;margin-left:4px;opacity:.6;}
.status-dot{
  width:34px;height:34px;border-radius:50%;flex:none;margin-top:1px;
  background:var(--ce-gradient);
  display:flex;align-items:center;justify-content:center;color:#fff;
}
.status-dot svg{width:16px;height:16px;}
.status-dot.pending{background:var(--ce-pending-bg);color:var(--ce-pending-text);}
.status-dot.done{background:var(--ce-success-bg);color:var(--ce-success-text);}
.status-dot.blue{background:#eaf3f9;color:var(--ce-blue-text);}
.status-dot.violet{background:#efedfb;color:#6a5fc1;}
.status-dot.orange{background:var(--ce-pending-bg);color:var(--ce-pending-text);}
.status-dot.muted{background:#eef2f4;color:var(--ce-text-muted);}
.ii-body{flex:1;min-width:0;}
.ii-top{display:flex;justify-content:space-between;gap:8px;align-items:baseline;}
.ii-client{font-weight:700;font-size:15px;color:var(--ce-navy);}
.ii-date{font-size:11.5px;color:var(--ce-text-muted);font-family:var(--ce-font-mono);white-space:nowrap;}
.ii-type{font-size:13px;color:var(--ce-text-muted);margin-top:2px;}
.ii-tags{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap;}
.tag{
  font-size:10.5px;font-family:var(--ce-font-mono);
  padding:3px 8px;border-radius:100px;
  background:#eef2f4;color:var(--ce-text-muted);
}
.tag.done{background:var(--ce-success-bg);color:var(--ce-success-text);}
.tag.pending{background:var(--ce-pending-bg);color:var(--ce-pending-text);}

.empty-state{
  text-align:center;
  padding:52px 20px;
  color:var(--ce-text-muted);
}
.empty-state .glyph{
  width:56px;height:56px;border-radius:50%;
  background:var(--ce-gradient);
  margin:0 auto 16px;
  display:flex;align-items:center;justify-content:center;color:#fff;
  opacity:.85;
}
.empty-state .glyph svg{width:26px;height:26px;}
.empty-state h3{color:var(--ce-navy);font-size:16px;margin-bottom:6px;}
.empty-state p{font-size:13.5px;line-height:1.5;margin:0;}

/* ---------- Search ---------- */
.search-wrap{position:relative;margin-bottom:14px;}
.search-wrap svg{position:absolute;left:13px;top:50%;transform:translateY(-50%);width:16px;height:16px;color:var(--ce-text-muted);}
.search-wrap input{
  width:100%;padding:12px 12px 12px 38px;
  border-radius:var(--ce-radius-sm);border:1px solid var(--ce-border);
  background:#fff;font-size:15px;color:var(--ce-text);
}
.search-wrap input:focus{outline:2px solid var(--ce-blue);outline-offset:-1px;}

/* Filtres (Planning / Tâches) */
.filter-row{display:flex;gap:8px;margin-bottom:14px;}
.filter-select{
  flex:1;min-width:0;padding:10px 12px;
  border:1px solid var(--ce-border);border-radius:var(--ce-radius-sm);
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c6b74' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance:none;-webkit-appearance:none;
  font-size:14px;color:var(--ce-text);
}
.filter-select:focus{outline:2px solid var(--ce-blue);outline-offset:-1px;}

/* ---------- FAB ---------- */
.fab{
  position:fixed;
  left:50%;
  transform:translateX(calc(-50% + 240px));
  bottom:calc(20px + var(--safe-bottom));
  width:58px;height:58px;border-radius:50%;
  background:var(--ce-gradient);
  border:none;color:#fff;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 6px 18px rgba(200,95,22,.4), 0 2px 6px rgba(22,48,63,.2);
  z-index:25;
}
.fab svg{width:24px;height:24px;}
.fab:active{transform:translateX(calc(-50% + 240px)) scale(.94);}
@media (max-width:600px){
  .fab{transform:translateX(0);right:18px;left:auto;}
  .fab:active{transform:scale(.94);}
}

/* ---------- Forms ---------- */
.field{margin-bottom:16px;}
.field label{
  display:block;font-size:12.5px;font-weight:600;
  color:var(--ce-navy-2);margin-bottom:6px;
}
.field .hint{font-size:11.5px;color:var(--ce-text-muted);margin-top:5px;}
.field input[type=text],
.field input[type=email],
.field input[type=tel],
.field input[type=date],
.field input[type=time],
.field input[type=number],
.field select,
.field textarea{
  width:100%;
  padding:12px 12px;
  border:1px solid var(--ce-border);
  border-radius:var(--ce-radius-sm);
  font-size:15.5px;
  background:#fff;
  color:var(--ce-text);
}
.field textarea{resize:vertical;min-height:88px;line-height:1.45;}

/* ---------- Descriptif de la demande (étape 3) ---------- */
#f-descriptif{
  width:100%;
  padding:12px 14px;
  border:1px solid var(--ce-border);
  border-radius:var(--ce-radius-sm);
  font-size:15.5px;
  line-height:1.5;
  background:#fff;
  color:var(--ce-text);
  resize:none;
  overflow:hidden;
  min-height:100px;
  transition:border-color .15s;
}
#f-descriptif:focus{
  outline:2px solid var(--ce-blue);outline-offset:-1px;border-color:var(--ce-blue);
}
#f-descriptif::placeholder{color:var(--ce-text-muted);opacity:.7;}

#f-action,
#f-devis-com{
  width:100%;
  padding:12px 14px;
  border:1px solid var(--ce-border);
  border-radius:var(--ce-radius-sm);
  font-size:15.5px;
  line-height:1.5;
  background:#fff;
  color:var(--ce-text);
  resize:none;
  overflow:hidden;
  min-height:100px;
  transition:border-color .15s;
}
#f-action:focus,
#f-devis-com:focus{
  outline:2px solid var(--ce-blue);outline-offset:-1px;border-color:var(--ce-blue);
}
#f-action::placeholder,
#f-devis-com::placeholder{color:var(--ce-text-muted);opacity:.7;}
.field input:focus,.field select:focus,.field textarea:focus{
  outline:2px solid var(--ce-blue);outline-offset:-1px;border-color:var(--ce-blue);
}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.row3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;}

.toggle-row{
  display:flex;align-items:center;justify-content:space-between;
  padding:13px 14px;border:1px solid var(--ce-border);border-radius:var(--ce-radius-sm);
  background:#fff;margin-bottom:12px;
}
.toggle-row .t-label{font-size:14.5px;font-weight:600;color:var(--ce-navy);}
.toggle-row .t-hint{font-size:11.5px;color:var(--ce-text-muted);margin-top:2px;}
.switch{
  position:relative;width:46px;height:27px;flex:none;border-radius:100px;
  background:#d7dee2;border:none;
}
.switch::after{
  content:"";position:absolute;top:2px;left:2px;width:23px;height:23px;border-radius:50%;
  background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .15s ease;
}
.switch.on{background:var(--ce-blue);}
.switch.on::after{transform:translateX(19px);}

.segmented{
  display:flex;background:#eef1f3;border-radius:var(--ce-radius-sm);padding:3px;gap:2px;
}
.segmented button{
  flex:1;border:none;background:transparent;padding:9px 6px;border-radius:8px;
  font-size:13px;font-weight:600;color:var(--ce-text-muted);
}
.segmented button.active{background:#fff;color:var(--ce-navy);box-shadow:0 1px 3px rgba(0,0,0,.12);}

/* Combobox / client search suggestions */
.combo{position:relative;}
.combo-list{
  position:absolute;left:0;right:0;top:calc(100% + 4px);
  background:#fff;border:1px solid var(--ce-border);border-radius:var(--ce-radius-sm);
  box-shadow:var(--ce-shadow);max-height:230px;overflow:auto;z-index:30;
}
.combo-item{padding:11px 13px;border-bottom:1px solid var(--ce-border);}
.combo-item:last-child{border-bottom:none;}
.combo-item .c-name{font-weight:700;font-size:14px;color:var(--ce-navy);}
.combo-item .c-sub{font-size:12px;color:var(--ce-text-muted);margin-top:1px;}
.combo-item.new{
  color:var(--ce-blue-text);
  font-weight:600;
  font-size:13.5px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:13px 14px;
  background:linear-gradient(135deg, rgba(47,134,180,0.08), rgba(232,121,42,0.05));
  border-top:2px dashed var(--ce-border);
}
.combo-item.new svg{
  width:20px;
  height:20px;
  flex:none;
  background:var(--ce-blue);
  color:#fff;
  border-radius:50%;
  padding:3px;
}

/* Dynamic line groups (équipements / pièces) */
.line-group{border:1px solid var(--ce-border);border-radius:var(--ce-radius-sm);padding:12px;margin-bottom:10px;background:#fbfcfc;}
.line-group-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;}
.line-group-head span{font-size:12px;font-weight:700;color:var(--ce-navy-2);}
.remove-line{border:none;background:none;color:var(--ce-danger);font-size:12px;font-weight:600;padding:4px;}
.add-line-btn{
  width:100%;padding:12px;border:1.5px dashed #c3cdd2;border-radius:var(--ce-radius-sm);
  background:transparent;color:var(--ce-text-muted);font-size:13.5px;font-weight:600;
  display:flex;align-items:center;justify-content:center;gap:6px;
}
.add-line-btn svg{width:15px;height:15px;}
.add-line-btn:active{background:#eef2f4;}
/* Fin d'intervention commune (§3.2.14) : signatures verrouillées tant que le
   statut d'intervention est « À effectuer » — boutons de signature désactivés. */
.add-line-btn:disabled{opacity:.45;cursor:not-allowed;}
.reuse-block{display:flex;align-items:center;gap:10px;background:#fff8e6;border:1px solid #f2d98a;border-radius:var(--ce-radius-sm);padding:10px 12px;margin-bottom:12px;}
.reuse-block .reuse-info{flex:1;font-size:13px;color:#8a6d1a;font-weight:600;}
.reuse-block .btn{width:auto;padding:10px 12px;font-size:13px;white-space:nowrap;}
.reuse-block .btn svg{width:15px;height:15px;}

/* ---------- Buttons ---------- */
.btn{
  display:flex;align-items:center;justify-content:center;gap:8px;
  width:100%;padding:14px;border-radius:var(--ce-radius-sm);border:none;
  font-size:15px;font-weight:700;
}
.btn svg{width:17px;height:17px;}
.btn-primary{background:var(--ce-navy);color:#fff;}
.btn-primary:active{background:#0f2431;}
.btn-accent{background:var(--ce-gradient);color:#fff;}
.btn-accent:active{opacity:.9;}
.btn-ghost{background:#fff;color:var(--ce-navy);border:1px solid var(--ce-border);}
.btn-ghost:active{background:#f0f3f4;}
.btn-text{background:none;color:var(--ce-blue-text);font-weight:600;padding:10px;}
.btn[disabled]{opacity:.45;}

/* ---------- Wizard ---------- */
.steps-bar{display:flex;gap:5px;padding:12px 14px 0;}
.steps-bar span{flex:1;height:4px;border-radius:100px;background:#dde3e6;}
.steps-bar span.active{background:var(--ce-gradient);}
.steps-bar span.filled{background:var(--ce-navy-2);}
.step-title{padding:14px 14px 2px;}
.step-title .step-eyebrow{font-size:11px;font-family:var(--ce-font-mono);color:var(--ce-orange-dark);text-transform:uppercase;letter-spacing:.06em;}
.step-title h2{font-size:19px;color:var(--ce-navy);margin-top:3px;}

.wizard-footer{
  position:sticky;bottom:0;left:0;right:0;
  padding:12px 14px calc(12px + var(--safe-bottom));
  background:linear-gradient(180deg, rgba(243,245,246,0), var(--ce-bg) 22%);
  display:flex;gap:10px;
}
.wizard-footer .btn{flex:1;}

/* ---------- Client fiche / detail ---------- */
.detail-header{padding:6px 2px 2px;}
.detail-header h2{font-size:20px;color:var(--ce-navy);}
.detail-header .meta{font-size:12.5px;color:var(--ce-text-muted);font-family:var(--ce-font-mono);margin-top:4px;}
.kv{display:flex;padding:11px 14px;border-bottom:1px solid var(--ce-border);font-size:14px;gap:10px;}
.kv:last-child{border-bottom:none;}
.kv .k{width:120px;flex:none;color:var(--ce-text-muted);font-size:12.5px;padding-top:1px;}
.kv .v{color:var(--ce-text);font-weight:500;word-break:break-word;}
.block-title{font-weight:700;font-size:13px;color:var(--ce-navy-2);padding:12px 14px 6px;}
.block-text{padding:0 14px 14px;font-size:14px;line-height:1.55;color:var(--ce-text);white-space:pre-wrap;}

/* ---------- Mesures des fiches d'entretien (refonte 18/09) ---------- */
.mesure-field{
  width:100%;
  padding:8px 9px;
  border:1px solid var(--ce-border);
  border-radius:8px;
  font-size:13.5px;
  color:var(--ce-text);
  background:#fff;
}
.kv .k .hint{font-size:10.5px;color:var(--ce-text-muted);margin-top:0;}
/* Unité affichée AVANT le champ de saisie (refonte 09/10, arb. 6.8 —
   convention tous formulaires) : à côté du libellé, jamais en placeholder. */
.kv .k .unite{font-size:10.5px;color:var(--ce-navy-2);margin-top:0;font-weight:600;white-space:nowrap;}

/* ---------- Toast ---------- */
.toast{
  position:fixed;left:50%;bottom:calc(30px + var(--safe-bottom));transform:translateX(-50%) translateY(20px);
  background:var(--ce-navy);color:#fff;padding:12px 18px;border-radius:100px;
  font-size:13.5px;font-weight:600;box-shadow:0 6px 20px rgba(0,0,0,.25);
  display:flex;align-items:center;gap:8px;opacity:0;pointer-events:none;transition:.22s ease;z-index:60;
  max-width:88%;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0);}
.toast svg{width:16px;height:16px;flex:none;color:var(--ce-orange);}

/* ---------- Signature ---------- */
.sig-box{border:1px solid var(--ce-border);border-radius:var(--ce-radius-sm);background:#fff;}
.sig-name-preview{
  padding:22px 14px;text-align:center;font-family: "Segoe Script","Bradley Hand", cursive;
  font-size:26px;color:var(--ce-navy);border-bottom:1px dashed var(--ce-border);
}
.sig-note{padding:10px 14px;font-size:12px;color:var(--ce-text-muted);text-align:center;}

/* ---------- Views ---------- */
.view{display:none;}
.view.active{display:block;}

/* scrollbars minimal */
::-webkit-scrollbar{width:0;height:0;}

/* ---------- Auth (V2) ---------- */
.auth-view{
  display:flex;flex-direction:column;
  min-height:100vh;
  padding:calc(40px + var(--safe-top)) 20px calc(30px + var(--safe-bottom));
  background:linear-gradient(180deg, var(--ce-navy) 0%, var(--ce-navy-2) 100%);
}
.auth-view .auth-logo{margin:0 auto 8px;height:54px;background:#fff;border-radius:12px;padding:6px 10px;}
.auth-view .auth-title{color:#fff;text-align:center;font-size:22px;margin-bottom:4px;}
.auth-view .auth-sub{color:#b9cbd6;text-align:center;font-size:13.5px;margin-bottom:28px;}
.auth-card{background:#fff;border-radius:var(--ce-radius);padding:22px;box-shadow:0 12px 40px rgba(0,0,0,.3);}
.auth-card .field{margin-bottom:14px;}
.auth-hint{font-size:12.5px;color:var(--ce-text-muted);margin:10px 0 0;line-height:1.5;}
.auth-divider{text-align:center;color:var(--ce-text-muted);font-size:12px;margin:16px 0;}
.auth-link{background:none;border:none;color:var(--ce-blue-text);font-weight:600;font-size:13.5px;}

/* ---------- Sync / account panel ---------- */
.sync-status{display:flex;align-items:center;gap:8px;font-size:13px;padding:10px 14px;border-radius:var(--ce-radius-sm);margin-bottom:6px;}
.sync-status.ok{background:var(--ce-success-bg);color:var(--ce-success-text);}
.sync-status.warn{background:var(--ce-pending-bg);color:var(--ce-pending-text);}
.sync-status .dot{width:8px;height:8px;border-radius:50%;background:currentColor;flex:none;}

/* ---------- Signature tactile (V2) ---------- */
.sig-overlay{
  position:fixed;inset:0;z-index:100;background:rgba(22,48,63,.55);
  display:flex;align-items:center;justify-content:center;padding:16px;
}
.sig-modal{background:#fff;border-radius:var(--ce-radius);width:100%;max-width:420px;padding:16px;box-shadow:0 20px 60px rgba(0,0,0,.35);}
.sig-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;}
.sig-head h3{font-size:16px;color:var(--ce-navy);}
.sig-head .icon-btn{margin-left:0;background:#eef2f4;color:var(--ce-navy);}
.sig-canvas-wrap{position:relative;}
#sig-canvas{width:100%;height:180px;border:1px solid var(--ce-border);border-radius:var(--ce-radius-sm);background:#fff;touch-action:none;}
.sig-hint{text-align:center;font-size:11.5px;color:var(--ce-text-muted);margin:6px 0 12px;}
.sig-actions{display:flex;gap:10px;}
.sig-actions .btn{flex:1;}
.sig-preview{border:1px solid var(--ce-border);border-radius:var(--ce-radius-sm);overflow:hidden;background:#fff;}
.sig-preview img{width:100%;max-height:120px;object-fit:contain;display:block;}
.sig-placeholder{padding:12px;text-align:center;font-size:13px;color:var(--ce-text-muted);}

/* ---------- Équipements historique ---------- */
.eq-history-item{display:flex;justify-content:space-between;align-items:center;gap:10px;}
.eq-history-item .eh-name{font-size:14px;font-weight:600;color:var(--ce-navy);}
.eq-history-item .eh-sub{font-size:12px;color:var(--ce-text-muted);margin-top:2px;}

@media (prefers-reduced-motion: reduce){
  *{transition:none !important;animation:none !important;}
}

/* =========================================================
   V3 — Planning / Tâches / Dossiers
   ========================================================= */
.home-tabs{
  display:flex;gap:4px;background:#0f2431;padding:8px 14px 0;
}
/* 4 onglets (Tableau de bord / Planning / Tâches / Dossiers) : libellés
   pouvant passer sur deux lignes sur petits écrans */
.home-tab{
  flex:1;border:none;background:transparent;color:#b9cbd6;
  padding:9px 2px 11px;font-size:12.5px;line-height:1.2;font-weight:600;border-bottom:2px solid transparent;
}
.home-tab.active{color:#fff;border-bottom-color:var(--ce-orange);}

.rdv-item{
  display:flex;gap:12px;align-items:flex-start;width:100%;text-align:left;
  padding:13px 14px;font:inherit;color:var(--ce-text);cursor:pointer;
  background:var(--ce-card);border:1px solid var(--ce-border);border-radius:var(--ce-radius);
  box-shadow:var(--ce-shadow);
}
.rdv-item:active{background:#f0f3f4;}
.rdv-item + .rdv-item{margin-top:8px;}
.rdv-time{
  flex:none;width:44px;font-family:var(--ce-font-mono);font-size:13px;font-weight:700;
  color:var(--ce-blue-text);padding-top:2px;
}
.rdv-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;}
.rdv-name{font-weight:700;font-size:14.5px;color:var(--ce-navy);}
.rdv-sub{font-size:12px;color:var(--ce-text-muted);}
.rdv-body .ii-tags{margin-top:4px;}

/* Dossiers (statuts) — en-têtes d'accordéon visibles (cartes cliquables),
   badge de nombre, chevron dédié, dépliage au clic */
.status-block{margin-bottom:14px;}
.status-head{
  display:flex;align-items:center;gap:10px;margin:0;padding:13px 14px;
  background:var(--ce-card);border:1px solid var(--ce-border);
  border-radius:var(--ce-radius);box-shadow:var(--ce-shadow);
  cursor:pointer;user-select:none;
  transition:background .12s ease;
}
.status-head:active{background:#f0f3f4;}
.status-head .sw{width:10px;height:10px;border-radius:50%;flex:none;}
.status-head h3{font-size:14px;color:var(--ce-navy);flex:1;margin:0;}
.status-head .n{font-size:11px;line-height:1;min-width:24px;text-align:center;padding:5px 8px;border-radius:999px;background:#eef2f4;color:var(--ce-text-muted);font-family:var(--ce-font-mono);}
.status-head .chev{
  width:24px;height:24px;flex:none;border-radius:50%;
  background:#eef2f4;color:var(--ce-text-muted);
  display:flex;align-items:center;justify-content:center;
  transform:rotate(90deg);transition:transform .18s ease;
}
.status-head .chev svg{width:14px;height:14px;}
.status-items{display:none;padding:10px 9px 0;}
.status-block.open .status-items{display:block;}
.status-block.open .status-head .chev{transform:rotate(-90deg);}
.sw-muted{background:#8a94a0;}
.sw-pending{background:var(--ce-pending);}
.sw-blue{background:var(--ce-blue);}
.sw-violet{background:#6a5fc1;}
.sw-orange{background:var(--ce-orange);}
.sw-done{background:var(--ce-success);}
.sw-appel{background:#14b8a6;}

.tag.blue{background:#eaf3f9;color:var(--ce-blue-text);}
.tag.violet{background:#efedfb;color:#6a5fc1;}
.tag.orange{background:var(--ce-pending-bg);color:var(--ce-pending-text);}
.tag.muted{background:#eef2f4;color:var(--ce-text-muted);}

/* Bouton "+" action sheet */
.sheet-overlay{
  position:fixed;inset:0;z-index:90;background:rgba(22,48,63,.55);
  display:flex;align-items:flex-end;justify-content:center;
}
.sheet{
  width:100%;max-width:560px;background:var(--ce-bg);border-radius:20px 20px 0 0;
  padding:14px 14px calc(18px + var(--safe-bottom));
  box-shadow:0 -10px 40px rgba(0,0,0,.3);
  animation:sheetUp .18s ease;
}
@keyframes sheetUp{from{transform:translateY(40px);opacity:0;}to{transform:translateY(0);opacity:1;}}
.sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;}
.sheet-head h3{font-size:17px;color:var(--ce-navy);}
.sheet-head .icon-btn{margin-left:0;background:#eef2f4;color:var(--ce-navy);}
.sheet-item{
  display:flex;gap:12px;align-items:center;width:100%;text-align:left;
  padding:13px 14px;background:var(--ce-card);border:1px solid var(--ce-border);
  border-radius:var(--ce-radius);box-shadow:var(--ce-shadow);margin-bottom:9px;
}
.sheet-item:active{background:#f0f3f4;}
.sheet-icon{
  width:40px;height:40px;border-radius:11px;flex:none;background:var(--ce-gradient);
  display:flex;align-items:center;justify-content:center;color:#fff;
}
.sheet-icon svg{width:20px;height:20px;}
.sheet-body{flex:1;min-width:0;}
.sheet-label{font-weight:700;font-size:14.5px;color:var(--ce-navy);display:block;}
.sheet-sub{font-size:12px;color:var(--ce-text-muted);}
.sheet-item > svg{width:18px;height:18px;color:var(--ce-text-muted);flex:none;}

/* Photos (US-21) */
.photo-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.photo-card{
  position:relative;background:var(--ce-card);border:1px solid var(--ce-border);
  border-radius:var(--ce-radius-sm);overflow:hidden;padding:8px;
}
.photo-card img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:8px;display:block;}
.photo-card input{margin-top:8px;width:100%;padding:8px;border:1px solid var(--ce-border);border-radius:8px;font-size:13px;}
.photo-card .remove-line{margin-top:4px;width:100%;}
.photo-legende{font-size:12px;color:var(--ce-text-muted);padding:8px 2px 2px;}
.photo-add{
  aspect-ratio:1;border:1.5px dashed #c3cdd2;border-radius:var(--ce-radius-sm);
  background:transparent;color:var(--ce-text-muted);font-size:13px;font-weight:600;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
}
.photo-add svg{width:22px;height:22px;}
.photo-add:active{background:#eef2f4;}

/* Workflow actions */
.wf-actions{display:flex;flex-direction:column;gap:9px;}

/* Statistiques */
.stat-big{
  background:var(--ce-gradient);color:#fff;border-radius:var(--ce-radius);
  padding:22px;text-align:center;box-shadow:var(--ce-shadow);
}
.stat-num{font-size:40px;font-weight:800;letter-spacing:-.02em;}
.stat-label{font-size:13px;opacity:.9;margin-top:2px;}
.stat-row{display:flex;align-items:center;gap:10px;padding:9px 0;}
.stat-row + .stat-row{border-top:1px solid var(--ce-border);}
.stat-row-label{flex:none;width:120px;font-size:12.5px;color:var(--ce-text-muted);}
.stat-bar{flex:1;height:8px;background:#eef2f4;border-radius:100px;overflow:hidden;}
.stat-bar-fill{height:100%;background:var(--ce-gradient);border-radius:100px;}
.stat-row-num{flex:none;width:26px;text-align:right;font-family:var(--ce-font-mono);font-weight:700;color:var(--ce-navy);}

/* Note bleue */
.note{
  background:#fff8ea;border:1px solid #f0dfad;border-radius:var(--ce-radius-sm);
  padding:10px 12px;font-size:12px;color:#8a6a1f;line-height:1.5;margin-bottom:14px;
}
.note.blue{background:#eaf3f9;border-color:#cfe3ee;color:#1f5c7a;}
.note strong{font-weight:700;}

/* BP-05 — focus clavier / lecteur d'écran visible partout (n'apparaît pas au toucher). */
:focus-visible{outline:3px solid var(--ce-blue);outline-offset:2px;}
.topbar :focus-visible,.home-tabs :focus-visible{outline-color:#fff;}
/* Respect de la préférence « réduire les animations ». */
@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important;}}
