/**
 * BAT.PROCRM.FR — Design System "Atelier & Ingénierie BTP" (Édition Chaleureuse, Lumineuse & Moderne)
 */
:root {
  --bg-page: #f8fafc;
  --bg-warm: #fffaf5;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Palette Bâtiment & Énergie Chaleureuse */
  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-light: #ffedd5;
  --accent-soft: rgba(249, 115, 22, 0.12);

  --blue-pro: #0284c7;
  --blue-dark: #0369a1;
  --blue-light: #e0f2fe;
  --blue-soft: rgba(2, 132, 199, 0.1);

  --green-ok: #059669;
  --green-light: #d1fae5;
  --green-soft: rgba(5, 150, 105, 0.12);

  --amber-gold: #d97706;
  --amber-light: #fef3c7;

  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 12px 32px -6px rgba(15, 23, 42, 0.08), 0 4px 12px -3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 45px -10px rgba(15, 23, 42, 0.12);
  --shadow-orange: 0 10px 25px -5px rgba(249, 115, 22, 0.35);

  --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: #f4f7fb;
  background-image:
    radial-gradient(at 0% 0%, rgba(249, 115, 22, 0.06) 0px, transparent 45%),
    radial-gradient(at 100% 0%, rgba(2, 132, 199, 0.07) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================================
   1. BARRE DE NAVIGATION SUPÉRIEURE (GLASSMORPHISM LUMINEUX & CHALEUREUX)
   ============================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.05);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: var(--text-main);
  transition: transform 0.2s;
}

.brand-logo:hover {
  transform: translateY(-1px);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 55%, #c2410c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 6px 16px -3px rgba(249, 115, 22, 0.45);
  position: relative;
}

.brand-text strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 18px;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: #0f172a;
}

.brand-pro-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  color: #ea580c;
  border: 1px solid #fed7aa;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.brand-text span {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-search-wrap {
  flex: 1;
  max-width: 460px;
  position: relative;
}

.header-search-input {
  width: 100%;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  color: var(--text-main);
  padding: 10px 18px 10px 38px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
}

.header-search-input::placeholder {
  color: #64748b;
}

.header-search-input:focus {
  background-color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-profile-header {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1.5px solid #fdba74;
  color: #c2410c;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.12);
}

.btn-profile-header:hover,
.btn-profile-header.active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  border-color: #ea580c;
  box-shadow: var(--shadow-orange);
  transform: translateY(-1px);
}

/* ============================================================================
   2. HERO ARCHITECTURAL & VITRINE BENTO DES 12 OUTILS
   ============================================================================ */
.hero-banner {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 20%, rgba(249, 115, 22, 0.14) 0%, transparent 40%),
    radial-gradient(circle at 88% 15%, rgba(2, 132, 199, 0.14) 0%, transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 32px 24px 28px;
  border-bottom: 1px solid #e2e8f0;
}

/* Motif subtil plan d'architecte en arrière-plan */
.hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.hero-container {
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-top-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(90deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(249, 115, 22, 0.08);
}

.hero-title {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: #0f172a;
}

.hero-subtitle {
  color: #475569;
  font-size: 15px;
  max-width: 780px;
  margin-top: 8px;
  line-height: 1.6;
}

.hero-trust-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 640px) {
  .hero-trust-pills {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
}

.trust-pill {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e2e8f0;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  color: #1e293b;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-xs);
}

/* Barre de filtres par métier */
.cat-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: thin;
}

.cat-pill {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #475569;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-xs);
}

.cat-pill:hover {
  border-color: #fdba74;
  color: #ea580c;
  transform: translateY(-1px);
}

.cat-pill.active {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-color: #0f172a;
  color: #ffffff;
  box-shadow: 0 6px 16px -3px rgba(15, 23, 42, 0.25);
}

/* Grille Bento des 12 Outils */
.tools-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.tool-selector-card {
  position: relative;
  text-align: left;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 15px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.tool-selector-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: var(--card-color, var(--accent));
  opacity: 0.35;
  transition: opacity 0.2s, height 0.2s;
}

.tool-selector-card:hover {
  border-color: var(--card-color, var(--accent));
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.tool-selector-card:hover::before {
  opacity: 1;
}

.tool-selector-card.active {
  background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
  border: 2px solid var(--card-color, var(--accent));
  box-shadow: 0 10px 25px -5px rgba(249, 115, 22, 0.18);
  transform: translateY(-2px);
}

.tool-selector-card.active::before {
  opacity: 1;
  height: 4px;
}

.tsc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tsc-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg-soft, #fff7ed);
  color: var(--card-color, #f97316);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.tool-selector-card:hover .tsc-icon-box,
.tool-selector-card.active .tsc-icon-box {
  transform: scale(1.08);
}

.tsc-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 3px 8px;
  border-radius: 999px;
}

.tool-selector-card.active .tsc-badge {
  background: var(--card-bg-soft, #ffedd5);
  color: var(--card-color, #ea580c);
  border-color: transparent;
}

.tsc-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.tsc-desc {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================================
   3. STUDIO DE CALCUL ACTIF (HEADER + COLONNES SAISIE & RÉSULTATS)
   ============================================================================ */
.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.active-tool-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 65%, #334155 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.active-tool-header::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.ath-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ath-icon-hero {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fdba74;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.ath-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(249, 115, 22, 0.22);
  border: 1px solid rgba(249, 115, 22, 0.45);
  color: #fed7aa;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.ath-title {
  font-size: clamp(20px, 2.2vw, 25px);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.ath-desc {
  font-size: 13.5px;
  color: #cbd5e1;
  margin-top: 3px;
}

.ath-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.ath-actions .btn-outline {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
}

.ath-actions .btn-outline:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Barre de bascule Mode Simple / Avancé */
.mode-switch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.mode-tabs {
  display: flex;
  gap: 6px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 12px;
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-tab:hover {
  color: #0f172a;
}

.mode-tab.active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* Grille Principale : Formulaire à gauche, Dashboard Sticky à droite */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1.06fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1060px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

.calc-form-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}

.calc-results-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 84px;
}

@media (max-width: 1060px) {
  .calc-results-card {
    position: static;
  }
}

/* Titres de section de formulaire avec pastille icône colorée */
.form-section-title {
  font-size: 15.5px;
  font-weight: 800;
  color: #0f172a;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%);
  border-left: 4px solid var(--accent);
  border-radius: 6px 10px 10px 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section-title i,
.form-section-title svg {
  color: var(--accent);
  width: 19px;
  height: 19px;
}

.form-section-title:not(:first-child) {
  margin-top: 24px;
}

.form-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  background: #f8fafc;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px dashed #cbd5e1;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #0f172a;
  background-color: #f8fafc;
  transition: all 0.18s;
}

.form-group input:hover,
.form-group select:hover {
  border-color: #94a3b8;
  background-color: #ffffff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.14);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr;
  }
}

/* Tableaux de saisie avancée parois & pièces */
.paroi-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 4px;
}

.paroi-input-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.paroi-input-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 9px 8px;
  text-align: left;
  border-bottom: 1px solid #cbd5e1;
}

.paroi-input-table td {
  padding: 7px 6px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.paroi-input-table input,
.paroi-input-table select {
  width: 100%;
  padding: 7px 9px;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
}

.rooms-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-item-row {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 0.8fr 34px;
  gap: 8px;
  align-items: center;
  background: #f8fafc;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
}

.room-item-row input {
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  width: 100%;
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-unit span {
  position: absolute;
  right: 9px;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  pointer-events: none;
}

.btn-icon-danger {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #dc2626;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s;
}

.btn-icon-danger:hover {
  background: #dc2626;
  color: #fff;
}

/* ============================================================================
   4. COLONNE RÉSULTATS : DASHBOARD VISUEL & GRAPHIQUES
   ============================================================================ */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid #f1f5f9;
}

.results-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--blue-pro);
  background: var(--blue-light);
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.results-main-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.btn-pdf-export {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  border: none;
  padding: 11px 18px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-orange);
  transition: all 0.2s;
}

.btn-pdf-export:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(249, 115, 22, 0.5);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0369a1;
  border: 1px solid #7dd3fc;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-secondary:hover {
  background: #0284c7;
  color: #fff;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  color: var(--text-main);
  border: 1.5px solid var(--border-strong);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* KPI Hero Card avec relief et halo lumineux */
.kpi-hero-box {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 20%, rgba(249, 115, 22, 0.32) 0%, transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  box-shadow: 0 12px 28px -6px rgba(15, 23, 42, 0.25);
}

.kpi-hero-solar {
  background:
    radial-gradient(circle at 90% 20%, rgba(245, 158, 11, 0.38) 0%, transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

.kpi-hero-label {
  font-size: 11.5px;
  color: #fdba74;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
}

.kpi-hero-value {
  font-size: clamp(26px, 2.8vw, 34px);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  margin: 5px 0;
  letter-spacing: -0.02em;
}

.kpi-hero-sub {
  font-size: 13px;
  color: #e2e8f0;
  font-weight: 500;
}

.dpe-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dpe-a { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.dpe-b { background: linear-gradient(135deg, #0ea5e9, #0284c7); color: #fff; }
.dpe-c { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.dpe-d { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; }
.dpe-f { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }

/* Grille des 4 Mini KPIs avec teintes colorées subtiles */
.kpi-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-mini {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1.5px solid #e2e8f0;
  border-left: 4px solid #0284c7;
  padding: 12px 15px;
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.15s;
}

.kpi-mini:nth-child(1) { border-left-color: #f97316; }
.kpi-mini:nth-child(2) { border-left-color: #0284c7; }
.kpi-mini:nth-child(3) { border-left-color: #10b981; }
.kpi-mini:nth-child(4) { border-left-color: #8b5cf6; }

.kpi-mini:hover {
  transform: translateY(-1px);
}

.kpi-mini-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
}

.kpi-mini-val {
  display: block;
  font-size: 15.5px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 3px;
}

/* Cartes Graphiques & Tableaux Résultats */
.chart-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.breakdown-bars {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.breakdown-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.breakdown-track {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.breakdown-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

/* Barres mensuelles PV */
.monthly-bars-wrap {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 7px;
  height: 155px;
  align-items: end;
  padding: 18px 6px 4px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.m-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.m-bar-val {
  font-size: 10px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}

.m-bar-track {
  width: 100%;
  max-width: 26px;
  height: 100px;
  background: #f1f5f9;
  border-radius: 6px 6px 2px 2px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.m-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 50%, #ea580c 100%);
  border-radius: 6px 6px 0 0;
  transition: height 0.35s ease;
}

.m-bar-lbl {
  font-size: 10.5px;
  color: #64748b;
  margin-top: 5px;
  font-weight: 700;
}

/* Tableaux résultats */
.table-responsive {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.results-table th,
.results-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.results-table tr:last-child td {
  border-bottom: none;
}

.results-table th {
  background: #f1f5f9;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  font-weight: 800;
}

.row-highlight {
  background: #ecfdf5 !important;
}

.badge-ok {
  background: var(--green-light);
  color: #065f46;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
}

.badge-warn {
  background: var(--amber-light);
  color: #92400e;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
}

.badge-pro {
  background: var(--blue-light);
  color: #0369a1;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
}

/* Bandeaux CEE & Normes */
.cee-banner {
  background: linear-gradient(90deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1.5px solid #93c5fd;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-xs);
}

.cee-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cee-banner-text strong {
  display: block;
  font-size: 15px;
  color: #1e3a8a;
  margin-bottom: 2px;
}

.cee-banner-text span {
  font-size: 13px;
  color: #334155;
}

.cee-status-box {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cee-status-box.cee-ok {
  background: linear-gradient(90deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1.5px solid #6ee7b7;
  color: #065f46;
}

.cee-status-box.cee-warn {
  background: linear-gradient(90deg, #fffbeb 0%, #fef3c7 100%);
  border: 1.5px solid #fcd34d;
  color: #92400e;
}

.normative-box {
  background: linear-gradient(90deg, #f0f9ff 0%, #f8fafc 100%);
  border: 1px solid #bae6fd;
  border-left: 4px solid var(--blue-pro);
  padding: 12px 16px;
  font-size: 12.5px;
  color: #334155;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.bivalence-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* ============================================================================
   5. GUIDES TECHNIQUES & CONTENU SEO PAR OUTIL
   ============================================================================ */
.seo-content-section {
  margin-top: 44px;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 26px;
}

@media (max-width: 960px) {
  .seo-content-section {
    grid-template-columns: 1fr;
  }
}

.seo-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.seo-card h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 14px;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.seo-card h3 {
  font-size: 15.5px;
  font-weight: 800;
  margin: 18px 0 6px;
  color: #1e293b;
}

.seo-card p,
.seo-card li {
  font-size: 13.5px;
  color: #475569;
  margin-bottom: 8px;
  line-height: 1.6;
}

.seo-card ul {
  padding-left: 18px;
}

.seo-card a {
  color: var(--blue-pro);
  font-weight: 600;
  text-decoration: none;
}

.seo-card a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.faq-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 13px 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
  margin-bottom: 5px;
}

/* ============================================================================
   6. TIROIR LATÉRAL : PROFIL ARTISAN / CLIENT (SANS INSCRIPTION)
   ============================================================================ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  justify-content: flex-end;
}

.drawer-backdrop.open {
  display: flex;
}

.profile-drawer {
  width: 100%;
  max-width: 500px;
  background: #fff;
  height: 100%;
  overflow-y: auto;
  padding: 26px;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1.5px solid #e2e8f0;
}

.logo-upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-preview-box {
  width: 92px;
  height: 58px;
  border: 1.5px dashed #94a3b8;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  background: #f8fafc;
}

.logo-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ============================================================================
   7. MODAL D'APERÇU & D'ÉDITION DU RAPPORT PDF A4
   ============================================================================ */
.pdf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px;
}

.pdf-modal-backdrop.open {
  display: flex;
}

.pdf-modal-container {
  width: 100%;
  max-width: 940px;
  background: #1e293b;
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
}

.pdf-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
}

.pdf-quick-custom-bar {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .pdf-quick-custom-bar {
    grid-template-columns: 1fr 1fr;
  }
}

.pdf-quick-custom-bar input {
  width: 100%;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 12.5px;
}

.pdf-quick-custom-bar label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 4px;
}

/* FEUILLE A4 DU RAPPORT PDF */
.pdf-a4-sheet {
  background: #ffffff;
  color: #0f172a;
  width: 100%;
  max-width: 794px;
  margin: 0 auto;
  padding: 34px 38px;
  border-radius: 8px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
  font-size: 12.5px;
}

.pdf-top-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 2px solid #0f172a;
}

.pdf-brand-col {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pdf-company-logo {
  max-width: 110px;
  max-height: 60px;
  object-fit: contain;
}

.pdf-company-name {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.pdf-company-line {
  font-size: 11.5px;
  color: #475569;
}

.pdf-company-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
}

.pdf-legal-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.pdf-pill-rge {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.pdf-meta-col {
  text-align: right;
}

.pdf-doc-date {
  font-size: 11.5px;
  color: #64748b;
}

.pdf-doc-ref {
  font-size: 12.5px;
  color: #0f172a;
  margin-bottom: 6px;
}

.pdf-client-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 12px;
  text-align: left;
  min-width: 210px;
}

.pdf-client-label {
  font-size: 9.5px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
}

.pdf-client-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.pdf-client-line {
  font-size: 11px;
  color: #475569;
}

.pdf-title-banner {
  background: #0f172a;
  color: #fff;
  padding: 14px 18px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.pdf-norm-tag {
  font-size: 10px;
  color: #fdba74;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.pdf-title-banner h1 {
  font-size: 16px;
  font-weight: 800;
  margin-top: 2px;
}

.pdf-main-highlight {
  text-align: right;
  background: rgba(249, 115, 22, 0.2);
  border: 1px solid #f97316;
  padding: 6px 12px;
  border-radius: 6px;
}

.pdf-main-highlight span {
  display: block;
  font-size: 10px;
  color: #fed7aa;
}

.pdf-main-highlight strong {
  font-size: 18px;
  color: #fff;
}

.pdf-compliance-stamp {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 11.5px;
  margin-bottom: 14px;
}

.stamp-ok {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #14532d;
}

.stamp-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
}

.pdf-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.pdf-kpi-cell {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 7px 9px;
  border-radius: 6px;
}

.pdf-kpi-cell span {
  display: block;
  font-size: 9.5px;
  color: #64748b;
}

.pdf-kpi-cell strong {
  font-size: 12px;
  color: #0f172a;
}

.pdf-sec-heading {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  margin: 14px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #cbd5e1;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  margin-bottom: 12px;
}

.pdf-table th,
.pdf-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 9px;
  text-align: left;
}

.pdf-table th {
  background: #f1f5f9;
  font-weight: 700;
}

.pdf-row-total {
  background: #fff7ed;
}

.pdf-svg-box {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px;
  margin-bottom: 12px;
}

.pdf-notes-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 11.5px;
}

.pdf-signatures-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.pdf-sig-box {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
  height: 78px;
}

.pdf-sig-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #334155;
}

.pdf-sig-sub {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}

.pdf-footer-legal {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: #64748b;
}

/* Toast Notification */
.app-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #fff;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  z-index: 400;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.25s;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Pied de page SEO */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 48px 24px;
  font-size: 13px;
  border-top: 1px solid #1e293b;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

.footer-col h4 {
  color: #fff;
  font-size: 14.5px;
  font-weight: 800;
  margin-bottom: 12px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 7px;
}

.footer-col a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: #fdba74;
}

/* ============================================================================
   IMPRESSION VECTORIELLE HAUTE DÉFINITION (@media print)
   ============================================================================ */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }
  body {
    background: #fff !important;
  }
  .site-header,
  .hero-banner,
  .main-container,
  .site-footer,
  .drawer-backdrop,
  .pdf-modal-toolbar,
  .pdf-quick-custom-bar,
  .app-toast {
    display: none !important;
  }
  .pdf-modal-backdrop {
    position: static !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
  }
  .pdf-modal-container {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  .pdf-a4-sheet {
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
}
