/* BatiSpot App — PWA suivi de chantier
   v2 — alignée design system Claude Design (palette #1A6B45 / charte client unifiée)
   Le teal #0A7265 reste pour les CTA (différenciation pro) */

:root {
  /* Palette principale (charte officielle BatiSpot) */
  --g1: #1A6B45;          /* vert principal — header, titres */
  --g2: #228B5B;          /* vert secondaire — accents */
  --g3: #4CAF82;          /* vert clair — surfaces actives */
  --g4: #4CAF82;
  --g-soft: #EBF7F1;      /* fond doux cards */
  --g-cream: #F7FBF8;     /* fond sections alt */

  /* Teal CTA (action principale, différenciation pro) */
  --t1: #0F4A2F;          /* teal hover */
  --t2: #166534;          /* teal CTA */
  --t3: #14B8A6;
  --t-soft: #CCFBF1;

  /* Texte / surfaces */
  --text: #1C2B22;
  --sub: #3D5A4E;
  --muted: #6B7F72;
  --border: rgba(34,139,91,0.14);
  --border-soft: #E8F3EC;
  --white: #FFFFFF;
  --bg: #F7FBF8;

  /* Status */
  --danger: #DC2626;
  --warn: #F59E0B;
  --ok: #16A34A;
  --info: #2563EB;

  /* Radius (un peu plus arrondis pour matcher Claude Design) */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;

  /* Shadows (plus douces et diffuses) */
  --shadow: 0 4px 16px rgba(26,107,69,.08);
  --shadow-lg: 0 12px 40px rgba(26,107,69,.14);

  /* Type scale */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;

  /* iOS safe area */
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
}

/* ──────────────────────────────────────────────────────
   Composants Claude Design — chips multi-select
   Utilisé sur inscription-pro.html (métiers + zones IDF)
   ────────────────────────────────────────────────────── */
.chip-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid #D1E7DB;
  color: var(--sub);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.chip:hover {
  border-color: var(--g3);
  background: var(--g-cream);
  color: var(--g1);
}
.chip.active {
  background: var(--g1);
  border-color: var(--g1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26,107,69,.18);
}
.chip.active::before {
  content: '✓';
  font-weight: 900;
  margin-right: 2px;
  font-size: 12px;
}
.chip:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.chip:disabled:hover {
  border-color: #D1E7DB;
  background: #fff;
  color: var(--sub);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
}

a { color: var(--t2); text-decoration: none; }
a:hover { color: var(--t1); text-decoration: underline; }

button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: var(--text); }

/* ── Layout ── */

.app-shell { max-width: 720px; margin: 0 auto; min-height: 100vh; background: var(--white); box-shadow: 0 0 0 1px var(--border-soft); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--g1); color: var(--white);
  position: sticky; top: var(--safe-top); z-index: 10;
}
.topbar h1 { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -.01em; }
.topbar .brand { display: flex; align-items: center; gap: 10px; }
.topbar .brand-mark { width: 28px; height: 28px; border-radius: 6px; display: block; }
.brand-mark { display: inline-block; border-radius: 10px; object-fit: contain; background: transparent; }
.topbar .topbar-actions { display: flex; gap: 8px; }

.container { padding: 18px; }
.section { margin-bottom: 28px; }

.page-title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.page-sub { color: var(--sub); font-size: var(--fs-sm); margin-bottom: 22px; }

/* ── Cards ── */

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 12px; }
.card-title { font-size: var(--fs-lg); font-weight: 700; margin-bottom: 4px; }
.card-sub { color: var(--sub); font-size: var(--fs-sm); }

/* ── Buttons ── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: var(--fs-base);
  transition: background .15s, transform .05s;
  min-height: 44px; /* tap target */
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--t2); color: var(--white); }
.btn-primary:hover { background: var(--t1); }
.btn-secondary { background: var(--g-soft); color: var(--g1); }
.btn-secondary:hover { background: var(--t-soft); }
.btn-ghost { background: transparent; color: var(--t2); }
.btn-ghost:hover { background: var(--t-soft); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: var(--fs-sm); min-height: 36px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forms ── */

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: var(--fs-sm); font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 11px 14px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--t2);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .12);
}
textarea.form-control { min-height: 90px; resize: vertical; }
.form-hint { color: var(--muted); font-size: var(--fs-xs); margin-top: 4px; }
.form-error { color: var(--danger); font-size: var(--fs-sm); margin-top: 6px; }

/* ── Status badges ── */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 600;
  background: var(--g-soft); color: var(--g1);
}
.badge.status-en_cours { background: #DBEAFE; color: #1E40AF; }
.badge.status-en_attente { background: #F3F4F6; color: #4B5563; }
.badge.status-retard { background: #FEE2E2; color: #991B1B; }
.badge.status-termine { background: #DCFCE7; color: #166534; }
/* Statuts demandes_devis */
.badge.status-nouvelle { background: #DBEAFE; color: #1E40AF; }
.badge.status-en_traitement { background: #FEF3C7; color: #92400E; }
.badge.status-matchee { background: #DCFCE7; color: #166534; }
.badge.status-chantier_cree { background: #DCFCE7; color: #166534; }
.badge.status-abandonnee { background: #F3F4F6; color: #6B7280; }
/* Statuts artisan_leads */
.badge.status-actif { background: #DCFCE7; color: #166534; }
.badge.status-documents_valides { background: #CCFBF1; color: #0F766E; }
.badge.status-refuse { background: #FEE2E2; color: #991B1B; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Chantier list item ── */

.chantier-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: transform .1s, box-shadow .15s;
  cursor: pointer;
}
.chantier-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.chantier-item .info { flex: 1; min-width: 0; }
.chantier-item h3 { font-size: var(--fs-base); font-weight: 700; margin-bottom: 2px; }
.chantier-item .meta { color: var(--sub); font-size: var(--fs-sm); }

/* ── Empty state ── */
.empty {
  text-align: center; padding: 48px 20px;
  color: var(--sub);
}
.empty h3 { font-size: var(--fs-lg); font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: var(--fs-sm); margin-bottom: 18px; }

/* ── Toasts ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--g1); color: var(--white);
  padding: 12px 20px; border-radius: var(--radius);
  font-size: var(--fs-sm); font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: toastIn .2s ease-out;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--ok); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ── Photos grid ── */
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.photo-tile {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--border-soft); cursor: pointer;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile .caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 6px 8px; background: linear-gradient(transparent, rgba(0,0,0,.6));
  color: var(--white); font-size: var(--fs-xs);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-tile .remove-btn {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: var(--white);
  display: grid; place-items: center; font-size: 14px;
}

/* ── Tabs ── */
.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 18px; overflow-x: auto;
}
.tab {
  padding: 10px 16px; font-size: var(--fs-sm); font-weight: 600;
  color: var(--sub); border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab.active { color: var(--t2); border-bottom-color: var(--t2); }

/* ── Messages ── */
.msg-list { display: flex; flex-direction: column; gap: 10px; }
.msg {
  max-width: 80%; padding: 10px 14px;
  border-radius: 14px;
  font-size: var(--fs-sm);
  word-wrap: break-word;
}
.msg .author { font-size: var(--fs-xs); color: var(--sub); margin-bottom: 3px; font-weight: 600; }
.msg .time { font-size: var(--fs-xs); color: var(--muted); margin-top: 3px; }
.msg.from-pro { align-self: flex-end; background: var(--t-soft); color: var(--g1); border-bottom-right-radius: 4px; }
.msg.from-client { align-self: flex-start; background: var(--border-soft); color: var(--text); border-bottom-left-radius: 4px; }

.msg-compose {
  display: flex; gap: 8px; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--border-soft);
}
.msg-compose textarea { flex: 1; min-height: 44px; }

/* ── Loading ── */
.loading {
  display: inline-block; width: 18px; height: 18px;
  border: 2.5px solid var(--border); border-top-color: var(--t2);
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-center { display: grid; place-items: center; padding: 48px; color: var(--sub); }

/* ── Modal léger ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 81, 50, .5);
  display: grid; place-items: center; padding: 20px; z-index: 100;
  animation: fadeIn .15s;
}
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg);
}
.modal h2 { font-size: var(--fs-xl); font-weight: 800; margin-bottom: 16px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── FAB ── */
.fab {
  position: fixed; bottom: calc(20px + var(--safe-bottom)); right: 20px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--t2); color: var(--white);
  display: grid; place-items: center;
  font-size: 28px; font-weight: 300;
  box-shadow: var(--shadow-lg);
  z-index: 20;
}
.fab:hover { background: var(--t1); }

/* ── Client view ── */
.client-hero {
  padding: 28px 22px;
  background: linear-gradient(135deg, var(--g1) 0%, var(--t1) 100%);
  color: var(--white);
}
.client-hero h1 { font-size: var(--fs-2xl); font-weight: 800; margin-bottom: 4px; }
.client-hero .sub { opacity: .9; font-size: var(--fs-sm); }

/* ── Utils ── */
.text-sub { color: var(--sub); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

@media (max-width: 480px) {
  .container { padding: 14px; }
  .page-title { font-size: 24px; }
}

/* ═══════════════════════════════════════════════════════════
   CLAUDE DESIGN — Composants PWA artisan
   Ajouts additifs : tous les selectors existants restent valides.
   ═══════════════════════════════════════════════════════════ */

/* — Bande gradient (top of every card/header) — */
.gradient-band {
  height: 4px;
  background: linear-gradient(90deg, #1A6B45 0%, #228B5B 50%, #4CAF82 100%);
}
.gradient-band-thin { height: 3px; }
.gradient-band-thick { height: 6px; }

/* — Header sombre branded (dashboard, profil) — */
.app-header-dark {
  background: var(--g1);
  color: var(--white);
  padding-top: var(--safe-top);
}
.app-header-dark .ah-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}
.app-header-dark .ah-icon-btn {
  background: none;
  border: none;
  color: inherit;
  padding: 6px;
  cursor: pointer;
  position: relative;
}
.app-header-dark .ah-icon-btn .ah-bell-count {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  background: #FCD34D;
  color: #3F2A06;
  font-size: 10px; font-weight: 800;
  border-radius: 999px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--g1);
}
.app-header-dark .ah-greeting {
  padding: 0 20px 18px;
}
.app-header-dark .ah-subtitle {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  letter-spacing: -0.01em;
}
.app-header-dark .ah-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 2px;
}

/* — Header clair (sous-pages) — */
.app-header-light {
  background: var(--white);
  border-bottom: 1px solid var(--border-soft);
  padding-top: var(--safe-top);
}
.app-header-light .ah-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.app-header-light .ah-back {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--text);
}
.app-header-light .ah-step {
  font-size: 12px;
  color: var(--sub);
  font-weight: 600;
}
.app-header-light .ah-step-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.app-header-light .ah-progress {
  height: 4px;
  background: var(--border-soft);
  position: relative;
}
.app-header-light .ah-progress-fill {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--g1), var(--g3));
}

/* — Métier badge (catégorie colorée) — */
.metier-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--border-soft);
  color: var(--sub);
}
.metier-badge[data-metier="Plomberie"]    { background: #DBEAFE; color: #1E40AF; }
.metier-badge[data-metier="Électricité"]  { background: #FEF3C7; color: #92400E; }
.metier-badge[data-metier="Maçonnerie"]   { background: #E5E7EB; color: #374151; }
.metier-badge[data-metier="Menuiserie"]   { background: #FED7AA; color: #9A3412; }
.metier-badge[data-metier="Couverture"]   { background: #DDD6FE; color: #5B21B6; }
.metier-badge[data-metier="Peinture"]     { background: #FBCFE8; color: #9D174D; }
.metier-badge[data-metier="Cuisine"]      { background: #FED7AA; color: #9A3412; }
.metier-badge[data-metier="Énergie"]      { background: #DBEAFE; color: #1E40AF; }
.metier-badge[data-metier="DPE"]          { background: #FEF3C7; color: #92400E; }

/* — Status pill (Nouveau, En attente, Validé…) — */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.status-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: currentColor;
}
.status-pill.s-new       { background: #FEF3C7; color: #92400E; }
.status-pill.s-pending   { background: #DBEAFE; color: #1E40AF; }
.status-pill.s-accepted  { background: #D1FAE5; color: #065F46; }
.status-pill.s-inprogress{ background: #FEF3C7; color: #854D0E; }
.status-pill.s-validated { background: #D1FAE5; color: #065F46; }
.status-pill.s-refused   { background: #FEE2E2; color: #991B1B; }
.status-pill.s-urgent    { background: #FEE2E2; color: #991B1B; }

/* — Chantier card riche (feed dashboard) — */
.chantier-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  box-shadow: 0 1px 3px rgba(15,31,23,.04);
  cursor: pointer;
  transition: transform .12s, box-shadow .15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.chantier-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,107,69,.10);
}
.chantier-card-body {
  display: flex;
  gap: 12px;
  padding: 14px;
}
.chantier-card-thumb {
  width: 88px; height: 88px;
  border-radius: 12px;
  flex-shrink: 0;
  background: var(--border-soft) center/cover;
  display: grid;
  place-items: center;
  color: var(--g3);
  font-size: 28px;
  font-weight: 900;
}
.chantier-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chantier-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.chantier-card-title {
  font-weight: 800;
  font-size: 16px;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.chantier-card-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--sub);
  font-size: 13px;
  font-weight: 500;
}
.chantier-card-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
}
.chantier-card-budget {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.chantier-card-budget strong {
  font-weight: 900;
  font-size: 18px;
  color: var(--g1);
  letter-spacing: -0.02em;
}
.chantier-card-budget span {
  font-size: 12px;
  color: var(--sub);
  font-weight: 600;
}
.chantier-card-time {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--sub);
  font-size: 12px;
  font-weight: 600;
}

/* — Filter chips (horizontal scroll) — */
.filter-chips {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--white);
  border-bottom: 1px solid var(--border-soft);
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--white);
  color: var(--text);
  border: 1.5px solid var(--border-soft);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
  transition: all .15s;
}
.filter-chip:hover {
  border-color: var(--g3);
  background: var(--g-cream);
}
.filter-chip.active {
  background: var(--g1);
  color: var(--white);
  border-color: var(--g1);
}
.filter-chip-count {
  margin-left: 6px;
  opacity: 0.7;
}

/* — Section label (Disponibles · 4) — */
.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--sub);
  text-transform: uppercase;
  margin: 4px 0 8px;
}

/* — Document upload row (statuts) — */
.doc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1.5px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: transform .1s, box-shadow .15s;
}
.doc-row:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.doc-row.s-pending  { background: var(--bg); border-color: var(--border-soft); }
.doc-row.s-uploaded { background: #FEF3C7; border-color: #FDE68A; }
.doc-row.s-validated{ background: #D1FAE5; border-color: #A7F3D0; }
.doc-row.s-rejected { background: #FEE2E2; border-color: #FECACA; }
.doc-row-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid var(--border-soft);
  color: var(--sub);
  font-size: 22px;
}
.doc-row.s-validated .doc-row-icon {
  background: var(--ok);
  color: var(--white);
  border: none;
}
.doc-row.s-uploaded .doc-row-icon { color: #92400E; border-color: #FDE68A; }
.doc-row.s-rejected .doc-row-icon { color: var(--danger); border-color: #FECACA; }
.doc-row-info { flex: 1; min-width: 0; }
.doc-row-label {
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.doc-row-status {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}
.doc-row.s-pending  .doc-row-status { color: var(--sub); }
.doc-row.s-uploaded .doc-row-status { color: #92400E; }
.doc-row.s-validated.doc-row-status,
.doc-row.s-validated .doc-row-status { color: #065F46; }
.doc-row.s-rejected .doc-row-status { color: #991B1B; }
.doc-row-chevron {
  color: var(--sub);
  font-size: 18px;
  flex-shrink: 0;
}

/* — KPI grid (mini stats) — */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kpi-card {
  background: var(--white);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--border-soft);
}
.kpi-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.kpi-card-value {
  font-size: 24px;
  font-weight: 900;
  color: var(--g1);
  letter-spacing: -0.025em;
  margin-top: 6px;
}
.kpi-card-trend {
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}
.kpi-card-trend.up   { color: var(--ok); }
.kpi-card-trend.down { color: var(--danger); }
.kpi-card-trend.flat { color: var(--sub); }

/* — Detail card (fiche chantier sections) — */
.detail-grid {
  background: var(--bg);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  border: 1px solid var(--border-soft);
}
.detail-grid-cell-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.detail-grid-cell-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-top: 4px;
}
.detail-grid-cell-value.highlight {
  font-size: 22px;
  font-weight: 900;
  color: var(--g1);
  letter-spacing: -0.02em;
  margin-top: 2px;
}

/* — Avatar circle — */
.avatar {
  border-radius: 999px;
  background: var(--g3);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-md { width: 44px; height: 44px; font-size: 16px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; border: 3px solid rgba(255,255,255,0.2); }

/* — Footer CTA (sticky bas de page sous-pages) — */
.footer-cta {
  position: sticky;
  bottom: 0;
  padding: 14px 16px calc(14px + var(--safe-bottom));
  background: var(--white);
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 10px;
}

/* — Hero image header (fiche chantier) — */
.hero-image {
  position: relative;
  height: 220px;
  overflow: hidden;
  flex-shrink: 0;
}
.hero-image::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,31,23,0.55) 0%, transparent 40%, rgba(15,31,23,0.5) 100%);
}
.hero-image-img {
  position: absolute; inset: 0;
  background: var(--g2) center/cover;
}
.hero-image-back {
  position: absolute;
  top: calc(8px + var(--safe-top));
  left: 14px;
  width: 40px; height: 40px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 20px;
  z-index: 2;
}
.hero-image-tags {
  position: absolute;
  top: calc(8px + var(--safe-top));
  right: 14px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.hero-image-bottom {
  position: absolute;
  bottom: 16px;
  left: 20px;
  right: 20px;
  z-index: 2;
}
.hero-content {
  background: var(--white);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  margin-top: -16px;
  position: relative;
  z-index: 1;
  padding: 20px;
}

/* — Bottom nav (4 onglets) — */
.bottom-nav {
  position: sticky;
  bottom: 0;
  left: 0; right: 0;
  background: rgba(255,255,255,0.94);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border-soft);
  padding: 8px 0 calc(8px + var(--safe-bottom));
  display: flex;
  z-index: 5;
}
.bottom-nav-item {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--sub);
  padding: 6px 0;
  position: relative;
  text-decoration: none;
}
.bottom-nav-item.active { color: var(--g1); }
.bottom-nav-item .bn-icon {
  font-size: 22px;
  line-height: 1;
}
.bottom-nav-item .bn-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.bottom-nav-item.active .bn-label { font-weight: 700; }
.bottom-nav-item .bn-badge {
  position: absolute;
  top: 2px; right: 50%;
  transform: translateX(16px);
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--danger);
  color: var(--white);
  font-size: 10px; font-weight: 800;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
}

/* — Tags onboarding (essai gratuit) — */
.pill-on-dark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(252,211,77,0.18);
  color: #FCD34D;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pill-on-dark::before {
  content: "";
  width: 6px; height: 6px;
  background: #FCD34D;
  border-radius: 999px;
}

/* — Buttons large (Claude Design size: lg) — */
.btn-lg {
  height: 60px;
  padding: 0 22px;
  font-size: 17px;
  font-weight: 700;
  border-radius: 14px;
  letter-spacing: -0.01em;
}
.btn-yellow {
  background: #FCD34D;
  color: #3F2A06;
  box-shadow: 0 4px 14px rgba(252,211,77,.4);
}
.btn-yellow:hover { background: #F5C73B; }
.btn-dark {
  background: var(--g1);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(15,81,50,.32);
}
.btn-dark:hover { background: #0F4A2F; }

/* — Notification list item — */
.notif-row {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
  background: var(--white);
}
.notif-row.unread { background: #F0FDF4; }
.notif-row.unread::before {
  content: "";
  position: absolute;
  left: 6px; top: 22px;
  width: 6px; height: 6px;
  background: var(--t2);
  border-radius: 999px;
}
.notif-row-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(26,107,69,0.10);
  color: var(--g1);
}
.notif-row-icon.success { background: rgba(22,163,74,0.10); color: var(--ok); }
.notif-row-icon.info    { background: rgba(37,99,235,0.10); color: var(--info); }
.notif-row-icon.warn    { background: rgba(245,158,11,0.10); color: var(--warn); }
.notif-row-info { flex: 1; min-width: 0; }
.notif-row-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.notif-row-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.notif-row-time {
  font-size: 11px;
  color: var(--sub);
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
  padding-top: 2px;
}
.notif-row-body {
  font-size: 13px;
  color: var(--sub);
  font-weight: 500;
  margin-top: 2px;
  line-height: 1.4;
}

/* — Espace bottom-nav (compense la hauteur sticky) — */
.bn-spacer { height: 80px; }

/* ═══════════════════════════════════════════════════════════
   CLAUDE DESIGN V3 — Composants additifs
   Source : social/claude_design_export/v3_scraped/css/app.css
   Aucun selector existant écrasé — convivez avec les classes V2.
   ═══════════════════════════════════════════════════════════ */

/* — Tokens V3 supplémentaires — */
:root {
  --g-deep: #0F5132;          /* Vert très foncé — header dark V3, charte stricte */
  --g4-cta-hover: #166534;    /* CTA hover/pressed V3 */

  /* Métiers color-coded (V3) */
  --m-plomberie: #2563EB;
  --m-elec: #F59E0B;
  --m-maconnerie: #6B7280;
  --m-cuisine: #EA580C;
  --m-couverture: #7C3AED;
  --m-peinture: #DB2777;
  --m-energie: #0891B2;
  --m-dpe: #CA8A04;

  /* Statuts (V3) */
  --status-new: #FCD34D;
  --status-pending: #3B82F6;
  --status-accepted: #22C55E;
  --status-inprogress: #F59E0B;
  --status-validated: #15803D;
  --status-refused: #EF4444;
  --status-urgent: #DC2626;

  /* A11y floors — gants / plein soleil */
  --tap-min: 48px;
  --body-min: 16px;

  /* Spacing scale 4px V3 */
  --s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 20px; --s-6: 24px;  --s-8: 32px;  --s-10: 40px;
  --s-12: 48px;
}

/* — Theme variants V3 (dark + high-contrast plein soleil) — */
[data-theme="dark"] {
  --bg: #0a1612;
  --white: #111e18;
  --text: #E6F0EA;
  --sub: #9DB5A8;
  --muted: #6B7F73;
  --border-soft: #1f2e26;
}
[data-contrast="high"] {
  --text: #000;
  --sub: #1C2B22;
  --border-soft: #1C2B22;
  --shadow: 0 4px 16px rgba(0,0,0,.20);
}

/* — Tap targets minimaux (a11y) — */
.tap-min { min-height: var(--tap-min); }

/* — Generic Card BEM (V3) — coexiste avec .card existant — */
.card-bem {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  overflow: hidden;
}
.card-bem--lift { box-shadow: var(--shadow); border: none; }
.card-bem__header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.card-bem__label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sub);
}
.card-bem__body { padding: 16px; }

/* — Field BEM (form, V3) — pour pages V3-style sans toucher .form-control — */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.field__hint { font-size: 12px; color: var(--sub); }
.field__input,
.field__textarea,
.field__select {
  font-family: inherit;
  font-size: 15px;
  padding: 14px;
  border: 1.5px solid var(--border-soft);
  border-radius: 12px;
  background: var(--white);
  color: var(--text);
  transition: border-color 120ms;
}
.field__input:focus,
.field__textarea:focus,
.field__select:focus {
  outline: none;
  border-color: var(--g2);
}
.field__textarea { resize: vertical; min-height: 100px; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════
   HOT LEAD CARD — Demandes entrantes en hero (ROI #1 du 39€)
   Animation pulse rouge pour attirer l'œil de l'artisan en chantier.
   ═══════════════════════════════════════════════════════════ */
.hot-lead {
  position: relative;
  background: linear-gradient(180deg, #FFF1F0 0%, #FFFFFF 60%);
  border: 2px solid #FCA5A5;
  border-radius: 16px;
  padding: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}
.hot-lead::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #DC2626 0%, #F97316 100%);
}
.hot-lead__count-badge {
  position: absolute; top: 14px; right: 14px;
  min-width: 28px; height: 28px; padding: 0 8px;
  border-radius: 999px;
  background: #DC2626;
  color: #fff;
  font-size: 13px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(220,38,38,.4);
  animation: hot-pulse 2s ease-in-out infinite;
}
@keyframes hot-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
.hot-lead__eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: #DC2626;
}
.hot-lead__eyebrow-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: #DC2626;
  animation: hot-pulse 1.4s ease-in-out infinite;
}
.hot-lead__title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-top: 8px;
}
.hot-lead__sub { font-size: 14px; color: var(--sub); margin-top: 4px; }
.hot-lead__list { display: grid; gap: 8px; margin-top: 12px; }
.hot-lead__item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  min-height: var(--tap-min);
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms;
}
.hot-lead__item:hover { border-color: var(--g3); }
.hot-lead__item-meta { flex: 1; min-width: 0; }
.hot-lead__item-title { font-size: 14px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.hot-lead__item-loc { font-size: 12px; color: var(--sub); margin-top: 2px; }
.hot-lead__item-fresh {
  font-size: 11px; font-weight: 800;
  color: #DC2626;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   INSTALL PROMPT — PWA install (iOS / Android)
   ═══════════════════════════════════════════════════════════ */
.install-prompt {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(26,107,69,.12);
  padding: 16px;
  display: flex; gap: 12px;
  z-index: 100;
  animation: install-slide-up 320ms cubic-bezier(.2,.8,.2,1);
}
@keyframes install-slide-up {
  from { transform: translateY(120%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.install-prompt__icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--g1);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(26,107,69,.32);
}
.install-prompt__body { flex: 1; min-width: 0; }
.install-prompt__title {
  font-size: 15px; font-weight: 800; color: var(--text);
  letter-spacing: -0.01em;
}
.install-prompt__text {
  font-size: 13px; color: var(--sub); margin-top: 2px;
  line-height: 1.4;
}
.install-prompt__steps {
  margin-top: 12px;
  padding: 12px;
  background: var(--g-cream);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.install-prompt__steps strong { color: var(--g1); font-weight: 800; }
.install-prompt__actions { display: flex; gap: 8px; margin-top: 12px; }
.install-prompt__close {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 999px;
  border: none; background: var(--border-soft);
  color: var(--sub);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.install-prompt--ios { padding-right: 40px; }

/* ═══════════════════════════════════════════════════════════
   RGE CARD — Certifications (QualiPV, QualiPAC, QualiBat, Qualifelec)
   Card avec icône Lucide qui colle au métier (sun/thermometer/building/zap).
   ═══════════════════════════════════════════════════════════ */
.rge-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  border: 1.5px solid var(--border-soft);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
  width: 100%;
  font-family: inherit;
  text-align: left;
}
.rge-card:hover { border-color: var(--g3); }
.rge-card--active { border-color: var(--g1); background: var(--g-cream); }
.rge-card__icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rge-card__icon--pv  { background: #FEF3C7; color: #B45309; }   /* QualiPV — soleil */
.rge-card__icon--pac { background: #DBEAFE; color: #1E40AF; }   /* QualiPAC — thermomètre */
.rge-card__icon--bat { background: var(--border-soft); color: var(--sub); } /* QualiBat — building */
.rge-card__icon--elec{ background: #FEF3C7; color: #92400E; }   /* Qualifelec — zap */
.rge-card__body { flex: 1; min-width: 0; }
.rge-card__name { font-size: 14px; font-weight: 800; color: var(--text); }
.rge-card__desc { font-size: 12px; color: var(--sub); margin-top: 2px; }
.rge-card__check {
  width: 22px; height: 22px;
  border-radius: 999px;
  border: 2px solid var(--border-soft);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--white);
  color: transparent;
}
.rge-card--active .rge-card__check {
  background: var(--g1); border-color: var(--g1); color: #fff;
}

/* — Helper pour utiliser les icônes du sprite (<svg class="i"><use href="/app/icons/icons.svg#name"/></svg>) — */
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 16px; height: 16px; }
.i-lg { width: 28px; height: 28px; }
.i-xl { width: 40px; height: 40px; }
