/* ============================================================
   PaysagePro — 90-compat.css
   Couche de compatibilite de la refonte v1.41.0.

   Contient UNIQUEMENT les composants specifiques a une vue qui
   n'ont pas d'equivalent dans le nouveau socle : aide, chatbot,
   widgets de tableau de bord, page SMTP, modules tenant, planning,
   catalogue, page de connexion, interrupteur, captcha, TOTP.

   Tout ce qui etait couvert par 10-reset et 30-components a ete
   SUPPRIME : boutons, champs, cards, tableaux, badges, alertes,
   topbar, coque, et les 263 de zip15.css.

   Ce fichier a vocation a disparaitre : chaque bloc doit soit
   rejoindre 30-components.css comme composant a part entiere, soit
   etre supprime avec la vue qui l'utilise.
   ============================================================ */


/* ############ Origine : app.css ############ */


/* ============================================================
   LAYOUT MINIMAL
   ============================================================ */
.minimal {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--pp-green-900) 0%, var(--pp-green-500) 100%);
}
[data-theme="dark"] .minimal,
[data-theme="auto"] .minimal {
  background: linear-gradient(135deg, #0b1810 0%, #1e3a2a 100%);
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .minimal { background: linear-gradient(135deg, #0b1810 0%, #1e3a2a 100%); }
}
.minimal .minimal-card {
  background: var(--pp-card-bg);
  border-radius: var(--pp-radius-lg);
  padding: 40px;
  box-shadow: var(--pp-shadow-lg);
  max-width: 440px;
  width: 100%;
}
.minimal .minimal-card .brand { text-align: center; margin-bottom: 28px; }
.minimal .minimal-card .brand h1 { margin-bottom: 4px; font-size: 1.6rem; }
.minimal .minimal-card .brand .tagline { color: var(--pp-muted); font-size: 0.9rem; }
.minimal .minimal-card .brand .leaf { display: inline-block; font-size: 2.5rem; margin-bottom: 8px; }

/* ============================================================

/* ============================================================
   SWITCH (interrupteur on/off)
   ============================================================ */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
/* Le composant doit resister aux regles contextuelles plus specifiques
   (ex : `.form-group label { display: block }` ci-dessus), sinon le label
   n'est plus flex, les spans restent inline, le slider perd ses dimensions
   et seul le knob absolu s'affiche par-dessus le libelle. */
.form-group label.switch,
.form-row label.switch,
fieldset label.switch,
label.switch {
  display: inline-flex;
}
.switch input { display: none; }
.switch-slider {
  display: inline-block;
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--pp-border);
  border-radius: 999px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.switch-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-slider { background: var(--pp-green-500); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch-label { color: var(--pp-text); font-size: 0.95rem; }

/* ============================================================

/* ============================================================
   CAPTCHA
   ============================================================ */
.captcha-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.captcha-img {
  /* L'image est generee en 260x90 : on garde le ratio et on laisse
     retrecir sur mobile plutot que de deformer les caracteres. */
  width: 100%;
  max-width: 260px;
  height: auto;
  aspect-ratio: 26 / 9;
  display: block;
  border-radius: var(--pp-radius);
  border: 1px solid var(--pp-border);
  background: #fff;
  box-shadow: var(--pp-shadow);
}
.captcha-reload {
  padding: 0 14px;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.captcha-reload:hover { background: var(--pp-green-100); }
.captcha-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--pp-muted);
}
.captcha-input {
  text-transform: uppercase;
  letter-spacing: 6px;
  font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  font-size: 1.05rem;
  text-align: center;
}
.captcha-input::placeholder { letter-spacing: 2px; text-transform: none; font-size: 0.9rem; }

/* ============================================================
   THEME CARDS (profil)
   ============================================================ */
.theme-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.theme-option { cursor: pointer; }
.theme-option input { display: none; }
.theme-card {
  padding: 14px 10px;
  text-align: center;
  border: 2px solid var(--pp-border);
  border-radius: var(--pp-radius);
  transition: all 0.15s;
  background: var(--pp-card-bg);
}
.theme-option input:checked + .theme-card {
  border-color: var(--pp-green-500);
  background: var(--pp-success-bg);
}
.theme-icon { font-size: 1.8rem; display: block; margin-bottom: 4px; }
.theme-card small { display: block; color: var(--pp-muted); font-size: 0.75rem; }

/* ============================================================
   TOTP — affichage valeurs
   ============================================================ */
.totp-value {
  padding: 10px 12px;
  background: var(--pp-bg);
  border-radius: var(--pp-radius);
  font-family: monospace;
  border: 1px dashed var(--pp-border);
  color: var(--pp-text);
  font-size: 0.95rem;
  user-select: all;
}
.totp-secret { font-size: 1.1rem; letter-spacing: 1px; font-weight: 600; }

/* ============================================================
   VALIDATION PAR CHAMP  (v1.38.1)

   Minimum vital pour que l'etat d'erreur soit visible des maintenant,
   avant la bascule visuelle. Ces deux regles existent en version
   complete dans /css/pp/30-components.css et disparaitront d'ici
   quand ce fichier sera demantele.
   ============================================================ */
.is-invalid,
[aria-invalid="true"] {
  border-color: var(--pp-danger);
  background: var(--pp-danger-bg);
}
.is-invalid:focus,
[aria-invalid="true"]:focus {
  outline: none;
  border-color: var(--pp-danger);
  box-shadow: 0 0 0 3px rgba(184, 37, 27, 0.25);
}
.field-error {
  display: block;
  margin-top: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pp-danger);
}

/* ############ Origine : zip09.css ############ */


/* ---------- ICÔNES TOPBAR (aide, chatbot, cloche) ---------- */
.topbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  text-decoration: none;
  border-radius: 8px;
  color: inherit;
  transition: background 0.15s ease;
  line-height: 1;
  background: transparent;
  border: none;
  cursor: pointer;
}
.topbar-icon:hover {
  background: rgba(127, 127, 127, 0.15);
}

/* ---------- SÉLECTEUR DE THÈME ---------- */
.theme-switcher {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(127, 127, 127, 0.35);
  border-radius: 8px;
}
.theme-switcher button {
  padding: 4px 9px;
  font-size: 0.95rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: inherit;
  line-height: 1;
}
.theme-switcher button.active {
  background: rgba(45, 106, 79, 0.25);
  font-weight: 700;
}
.theme-switcher button:hover {
  background: rgba(127, 127, 127, 0.15);
}

/* ---------- CLOCHE NOTIFICATIONS ---------- */
.topbar-bell-wrap { position: relative; }
.bell-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #c0392b;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px currentColor;
}

/* ---------- MENU BURGER : TOUJOURS VISIBLE ---------- */
/* CORRECTIF ZIP 09b : le burger était caché en desktop, ce qui empêchait
   de cacher/afficher la sidebar. Il doit rester visible à toute taille. */
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 4px 10px;
  border-radius: 6px;
  color: inherit;
  line-height: 1;
}
.menu-toggle:hover {
  background: rgba(127, 127, 127, 0.15);
}

/* ---------- SIDEBAR TOGGLE : comportement ---------- */
/* Desktop (>= 901px) : sidebar toujours visible, sauf si body.sidebar-hidden */
/* ---------- AIDE : contenu lisible quoi qu'il arrive ---------- */
.help-article-card {
  background: #ffffff;
  color: #1a1a1a;
  border: 1px solid #e0e0e0;
}
html[data-theme="dark"] .help-article-card {
  background: #2a2a2a;
  color: #f0f0f0;
  border-color: #444;
}

.help-content {
  color: inherit;
  line-height: 1.7;
  font-size: 0.98rem;
}
.help-content h1,
.help-content h2,
.help-content h3 {
  color: #2d6a4f;
  margin: 1.2em 0 0.5em;
  font-weight: 600;
}
.help-content h1 { font-size: 1.6rem; border-bottom: 2px solid #eaf5ef; padding-bottom: 8px; }
.help-content h2 { font-size: 1.3rem; }
.help-content h3 { font-size: 1.1rem; }
.help-content p { margin: 0.6em 0; }
.help-content ul, .help-content ol { margin: 0.5em 0; padding-left: 1.8em; }
.help-content li { margin: 0.3em 0; }
.help-content code {
  background: rgba(45, 106, 79, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.88em;
  color: #2d6a4f;
}
.help-content pre {
  background: #f4f4f4;
  padding: 12px 16px;
  border-radius: 6px;
  overflow-x: auto;
  border-left: 3px solid #2d6a4f;
}
.help-content pre code { background: transparent; padding: 0; color: #333; }
.help-content strong { font-weight: 700; }

html[data-theme="dark"] .help-content code {
  background: rgba(116, 198, 157, 0.15);
  color: #74c69d;
}
html[data-theme="dark"] .help-content pre {
  background: #1e1e1e;
  border-left-color: #74c69d;
}
html[data-theme="dark"] .help-content pre code { color: #e0e0e0; }

/* ---------- CATALOGUE MATÉRIEL ---------- */
.equipment-import-box {
  background: #eaf5ef;
  border: 1px solid #40916c;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  color: #1a1a1a;
}
.equipment-import-box h3 { margin: 0 0 8px; color: #1b4332; }

html[data-theme="dark"] .equipment-import-box {
  background: #233a2e;
  border-color: #74c69d;
  color: #e0e0e0;
}
html[data-theme="dark"] .equipment-import-box h3 { color: #74c69d; }

.catalog-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  cursor: default;
  transition: all 0.15s;
  background: inherit;
  color: inherit;
}
.catalog-card:hover {
  border-color: #40916c;
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.12);
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

#scanner-video {
  width: 100%;
  max-width: 420px;
  background: #000;
  border-radius: 8px;
}
.scanner-result {
  padding: 10px 14px;
  background: #fff3cd;
  color: #1a1a1a;
  border: 1px solid #ffc107;
  border-radius: 6px;
  margin-top: 10px;
  font-family: monospace;
}


/* ############ Origine : zip10.css ############ */


/* ---------- BULLE CHATBOT FLOTTANTE (bas-droite) ---------- */
.pp-chatbot-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 998;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  background: linear-gradient(135deg, #2d6a4f 0%, #40916c 100%);
  color: #fff;
  border-radius: 30px;
  box-shadow: 0 4px 16px rgba(45, 106, 79, 0.35);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
  border: none;
  outline: none;
}
.pp-chatbot-bubble:hover,
.pp-chatbot-bubble:focus {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(45, 106, 79, 0.5);
}
.pp-chatbot-bubble:active {
  transform: translateY(0);
}
.pp-chatbot-bubble-icon {
  font-size: 1.4rem;
  line-height: 1;
  animation: pp-chatbot-pulse 2.5s ease-in-out infinite;
}
.pp-chatbot-bubble-label {
  line-height: 1;
}
@keyframes pp-chatbot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
@media (max-width: 600px) {
  .pp-chatbot-bubble-label { display: none; }
  .pp-chatbot-bubble {
    padding: 12px;
    border-radius: 50%;
  }
}

/* ---------- CHANTIERS : planning calendaire ---------- */
.planning-cell {
  min-width: 80px;
  text-align: center;
  padding: 8px 4px;
}
.planning-cell a {
  display: block;
  padding: 6px;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
}

/* ---------- CHANTIERS : grid résumé couts ---------- */
.cost-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 768px) {
  .cost-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Badges statuts chantier */
.chantier-statut-brouillon { background: #6c757d20; color: #6c757d; border: 1px solid #6c757d; }
.chantier-statut-planifie  { background: #17a2b820; color: #17a2b8; border: 1px solid #17a2b8; }
.chantier-statut-en_cours  { background: #28a74520; color: #28a745; border: 1px solid #28a745; }
.chantier-statut-suspendu  { background: #ffc10720; color: #856404; border: 1px solid #ffc107; }
.chantier-statut-termine   { background: #2d6a4f20; color: #2d6a4f; border: 1px solid #2d6a4f; }
.chantier-statut-archive   { background: #6c757d20; color: #6c757d; border: 1px solid #6c757d; }
.chantier-statut-annule    { background: #dc354520; color: #dc3545; border: 1px solid #dc3545; }


/* ############ Origine : zip14.css ############ */

/* ==================== 3. MENU ADMIN MODULES COMPACT ==================== */
.sidebar-admin-modules {
  margin-top: 4px;
  padding-left: 32px;
}
.sidebar-admin-modules .nav-item-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: inherit;
  opacity: 0.8;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.12s;
}
.sidebar-admin-modules .nav-item-sub:hover {
  background: rgba(255,255,255,0.08);
  opacity: 1;
}
.sidebar-admin-modules .nav-item-sub.active {
  background: rgba(64, 145, 108, 0.25);
  opacity: 1;
  font-weight: 600;
}

/* ==================== 4. DASHBOARD WIDGETS ==================== */
.dash-profile-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
  padding: 10px 14px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.9rem;
}
html[data-theme="dark"] .dash-profile-bar {
  background: #1f1f1f;
  border-color: #333;
  color: #e0e0e0;
}
.dash-profile-bar label { font-weight: 600; margin-right: 6px; }
.dash-profile-bar select {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
  color: #1a1a1a;
}
html[data-theme="dark"] .dash-profile-bar select {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: #444;
}

.dash-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.dash-widget {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s, transform 0.15s;
}
.dash-widget:hover {
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.1);
  transform: translateY(-1px);
}
html[data-theme="dark"] .dash-widget {
  background: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

.dash-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.dash-widget-title {
  font-size: 0.78rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
html[data-theme="dark"] .dash-widget-title { color: #aaa; }

.dash-widget-icon {
  font-size: 1.2rem;
  opacity: 0.7;
}

.dash-widget-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2d6a4f;
  line-height: 1.1;
  margin-bottom: 4px;
}
html[data-theme="dark"] .dash-widget-value { color: #74c69d; }

.dash-widget-sub {
  font-size: 0.82rem;
  color: #666;
  margin-top: 4px;
}
html[data-theme="dark"] .dash-widget-sub { color: #9ab; }

.dash-widget-trend-up { color: #28a745; font-weight: 600; }
.dash-widget-trend-down { color: #dc3545; font-weight: 600; }
.dash-widget-trend-warn { color: #ffc107; font-weight: 600; }

.dash-widget-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.82rem;
  color: #2d6a4f;
  text-decoration: none;
}
.dash-widget-link:hover { text-decoration: underline; }
html[data-theme="dark"] .dash-widget-link { color: #95d5b2; }

/* Cartes compactes */
.dash-widget-compact {
  padding: 12px 14px;
}
.dash-widget-compact .dash-widget-value {
  font-size: 1.4rem;
}

/* Alerte importante */
.dash-widget.dash-widget-alert {
  background: #fff4e1;
  border-color: #ffc107;
}
html[data-theme="dark"] .dash-widget.dash-widget-alert {
  background: #3a2f0e;
  border-color: #b8860b;
}
.dash-widget.dash-widget-alert .dash-widget-value { color: #B8860B; }
html[data-theme="dark"] .dash-widget.dash-widget-alert .dash-widget-value { color: #ffd76b; }

.dash-widget.dash-widget-ok {
  border-left: 4px solid #28a745;
}
.dash-widget.dash-widget-danger {
  border-left: 4px solid #dc3545;
}
.dash-widget.dash-widget-info {
  border-left: 4px solid #0B3D91;
}

/* Listes dans widgets */
.dash-widget-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  font-size: 0.88rem;
}
.dash-widget-list li {
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.dash-widget-list li:last-child { border-bottom: none; }
html[data-theme="dark"] .dash-widget-list li { border-bottom-color: #3a3a3a; }

.dash-widget-list a {
  color: inherit;
  text-decoration: none;
}
.dash-widget-list a:hover { color: #2d6a4f; }
html[data-theme="dark"] .dash-widget-list a:hover { color: #95d5b2; }

/* ==================== 5. RECHERCHE AIDE : résultats masqués ==================== */
.help-article-tile.help-hidden {
  display: none;
}
.help-module-section.help-hidden {
  display: none;
}
.help-no-results {
  padding: 20px;
  background: #fff4e1;
  border: 1px solid #ffc107;
  border-radius: 8px;
  text-align: center;
  color: #8a6d3b;
  margin-top: 12px;
  font-size: 0.95rem;
}
html[data-theme="dark"] .help-no-results {
  background: #3a2f0e;
  color: #ffd76b;
  border-color: #b8860b;
}

/* Texte surligné sur recherche */
.help-article-tile .help-highlight {
  background: #fff4a3;
  padding: 0 2px;
  border-radius: 2px;
}
html[data-theme="dark"] .help-article-tile .help-highlight {
  background: #6b5d1a;
  color: #fff;
}

/* Indication "X résultats" dans la sidebar */
.help-sidebar-stats.active-search {
  color: #2d6a4f;
  font-weight: 600;
}


/* ############ Origine : zip15.css ############ */

/* ==================== 12. BULLE CHATBOT ==================== */
.pp-chatbot-bubble,
#pp-chatbot-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 12px 14px;
  background: linear-gradient(135deg, var(--pp-green-700) 0%, var(--pp-green-500) 100%);
  color: #fff;
  border-radius: 30px;
  box-shadow: 0 4px 20px rgba(45, 106, 79, 0.45);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  border: none;
}


/* ==================== 13. AIDE (help) ==================== */
/* Tuiles articles et sidebar */
.help-article-tile {
  background: var(--pp-card-bg);
  border: 1px solid var(--pp-border);
  color: var(--pp-text);
}
.help-article-tile-title { color: var(--pp-green-700); }
.help-article-tile-summary { color: var(--pp-muted); }

.help-sidebar-card {
  background: var(--pp-card-bg);
  border: 1px solid var(--pp-border);
  color: var(--pp-text);
}
.help-sidebar-card h3 { color: var(--pp-green-700); }
.help-sidebar-card a { color: var(--pp-green-700); }
.help-sidebar-card a:hover {
  background: var(--pp-success-bg);
}
.help-sidebar-search input {
  background: var(--pp-input-bg);
  color: var(--pp-text);
  border: 1px solid var(--pp-border);
}
.help-article-tile.help-hidden,
.help-module-section.help-hidden { display: none; }
.help-no-results {
  background: var(--pp-warning-bg);
  color: var(--pp-text);
  border: 1px solid var(--pp-warning);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}


/* ==================== 14. DASHBOARD WIDGETS ==================== */
.dash-widget {
  background: var(--pp-card-bg);
  border: 1px solid var(--pp-border);
  color: var(--pp-text);
}
.dash-widget-title { color: var(--pp-muted); }
.dash-widget-value { color: var(--pp-green-700); }
.dash-widget-sub { color: var(--pp-muted); }
.dash-widget-link { color: var(--pp-green-700); }
.dash-profile-bar {
  background: var(--pp-card-bg);
  border: 1px solid var(--pp-border);
  color: var(--pp-text);
}
.dash-profile-bar select {
  background: var(--pp-input-bg);
  color: var(--pp-text);
  border: 1px solid var(--pp-border);
}
.dash-widget.dash-widget-alert {
  background: var(--pp-warning-bg);
  border-color: var(--pp-warning);
}
.dash-widget-list li { border-bottom: 1px solid var(--pp-border); }
.dash-widget-list a { color: var(--pp-text); }


/* ==================== 15. ADMIN DASHBOARD PROFILES ==================== */
.dashboard-profile-editor {
  background: var(--pp-card-bg);
  border: 1px solid var(--pp-border);
  color: var(--pp-text);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.dashboard-profile-editor h3 { color: var(--pp-green-700); }
.dashboard-profile-editor .widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.dashboard-profile-editor .widget-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--pp-border);
  border-radius: 6px;
  background: var(--pp-bg);
  color: var(--pp-text);
  cursor: pointer;
  transition: background 0.12s;
}
.dashboard-profile-editor .widget-check:hover {
  background: var(--pp-success-bg);
}
.dashboard-profile-editor .widget-check-label {
  font-weight: 600;
  color: var(--pp-text);
  display: block;
}
.dashboard-profile-editor .widget-check-desc {
  font-size: 0.82rem;
  color: var(--pp-muted);
  margin-top: 2px;
}


/* ==================== 16. SMTP STATUS PAGE ==================== */
.smtp-status-card {
  background: var(--pp-card-bg);
  border: 1px solid var(--pp-border);
  color: var(--pp-text);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}
.smtp-status-ok { color: var(--pp-success); font-weight: 700; }
.smtp-status-ko { color: var(--pp-danger); font-weight: 700; }
.smtp-status-missing { color: var(--pp-warning); font-weight: 600; }

.smtp-source-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 10px;
  background: var(--pp-info-bg);
  color: var(--pp-info);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.smtp-source-badge.env  { background: var(--pp-green-100); color: var(--pp-green-900); }
.smtp-source-badge.db   { background: var(--pp-info-bg); color: var(--pp-info); }
.smtp-source-badge.none { background: var(--pp-warning-bg); color: var(--pp-warning); }

.smtp-kv-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.smtp-kv-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--pp-border);
  vertical-align: top;
  color: var(--pp-text);
  background: transparent;
}
.smtp-kv-table td:first-child {
  font-weight: 600;
  width: 200px;
  color: var(--pp-muted);
}


/* ==================== 17. PLANNING CHANTIERS ==================== */
.planning-no-tables {
  background: var(--pp-warning-bg);
  border: 1px solid var(--pp-warning);
  color: var(--pp-text);
  padding: 12px 16px;
  border-radius: 8px;
  margin: 12px 0;
}
.planning-no-tables strong { color: var(--pp-text); }
.planning-no-tables code,
.planning-no-tables small {
  color: var(--pp-text);
}


/* ==================== 18. CHATBOT ==================== */
.chatbot-msg-user {
  background: var(--pp-green-100);
  color: var(--pp-green-900);
  border: 1px solid var(--pp-border);
}
.chatbot-msg-assistant {
  background: var(--pp-card-bg);
  color: var(--pp-text);
  border: 1px solid var(--pp-border);
}
html[data-theme="dark"] .chatbot-msg-assistant {
  background: rgba(255,255,255,0.03);
}


/* ==================== 19. SCROLLBAR DARK ==================== */
html[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--pp-bg); }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--pp-border); border-radius: 5px; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: var(--pp-muted); }


/* ==================== 23. CODE / PRE ==================== */
code, pre, kbd, samp {
  background: var(--pp-input-bg);
  color: var(--pp-text);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}
pre {
  padding: 12px;
  border: 1px solid var(--pp-border);
  overflow-x: auto;
}


/* ==================== 25. AIDE /help index : LAYOUT 2 COLONNES (override zip12) ==================== */
/* Le zip12.css avait un breakpoint 1100px qui faisait passer la sidebar en dessous trop tôt.
   On remet le grid proprement et on descend le breakpoint à 900px. */

.help-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.help-main {
  min-width: 0;
}

.help-sidebar {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 900px) {
  .help-layout {
    grid-template-columns: 1fr;
  }
  .help-sidebar {
    position: static;
    order: 2;
  }
}

/* Tuiles articles : fond card visible en dark comme en sun */
.help-article-tile {
  display: block;
  padding: 14px;
  background: var(--pp-card-bg);
  border: 1px solid var(--pp-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--pp-text);
  transition: all 0.15s;
}
.help-article-tile:hover {
  border-color: var(--pp-green-500);
  box-shadow: 0 3px 10px rgba(45, 106, 79, 0.12);
  transform: translateY(-1px);
}
.help-article-tile-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
  display: block;
}
.help-article-tile-title {
  font-weight: 600;
  color: var(--pp-green-700);
  margin: 4px 0;
  font-size: 0.95rem;
}
.help-article-tile-summary {
  font-size: 0.82rem;
  color: var(--pp-muted);
  line-height: 1.4;
}

/* Grille d'articles */
.help-article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

/* Sections module */
.help-module-section {
  margin-bottom: 28px;
}
.help-module-section h2 {
  font-size: 1.1rem;
  color: var(--pp-green-700);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--pp-border);
  margin-bottom: 12px;
}

/* Sidebar aide : cards cohérentes */
.help-sidebar-card {
  background: var(--pp-card-bg);
  border: 1px solid var(--pp-border);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--pp-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.help-sidebar-card h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--pp-green-700);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--pp-border);
}
.help-sidebar-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.help-sidebar-card li { margin: 6px 0; }
.help-sidebar-card a {
  color: var(--pp-green-700);
  text-decoration: none;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  line-height: 1.3;
  font-size: 0.9rem;
  transition: background 0.12s;
}
.help-sidebar-card a:hover {
  background: var(--pp-success-bg);
  color: var(--pp-green-900);
}

/* Barre de recherche aide */
.help-sidebar-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--pp-border);
  background: var(--pp-input-bg);
  color: var(--pp-text);
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
}
.help-sidebar-search input::placeholder {
  color: var(--pp-muted);
  opacity: 0.7;
}
.help-sidebar-stats {
  font-size: 0.8rem;
  color: var(--pp-muted);
}



/* ==================== 26. CTA "Une question ?" / "Besoin d'aide ?" (dark ET sun) ==================== */
.help-sidebar-card.help-cta-chatbot {
  background: var(--pp-success-bg);
  border: 1px solid var(--pp-success);
  color: var(--pp-text);
}
.help-sidebar-card.help-cta-chatbot h3 {
  color: var(--pp-success);
  border-bottom-color: var(--pp-success);
  margin-top: 0;
}
.help-sidebar-card.help-cta-chatbot p {
  color: var(--pp-text);
  font-size: 0.88rem;
  margin: 6px 0;
  line-height: 1.5;
}
/* Bouton primary DANS cette card : forcer le texte blanc quel que soit le thème */
.help-cta-chatbot-btn.btn-primary,
.help-cta-chatbot .btn-primary,
a.help-cta-chatbot-btn {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.88rem;
  padding: 8px 16px;
  background: var(--pp-green-700);
  color: #ffffff;
  border: 1px solid var(--pp-green-700);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s;
}
.help-cta-chatbot-btn.btn-primary:hover,
a.help-cta-chatbot-btn:hover {
  background: var(--pp-green-900);
  color: #ffffff;
}
html[data-theme="dark"] .help-cta-chatbot-btn.btn-primary,
html[data-theme="dark"] a.help-cta-chatbot-btn {
  background: var(--pp-green-500);
  color: #0d1310;
  border-color: var(--pp-green-500);
}
html[data-theme="dark"] .help-cta-chatbot-btn.btn-primary:hover,
html[data-theme="dark"] a.help-cta-chatbot-btn:hover {
  background: var(--pp-green-300);
  color: #0d1310;
}



/* ==================== 27. MODULES TENANT (admin/tenant_modules) ==================== */
/* Fix dark : les cards modules avaient background:#fff hardcodé en PHP */

.module-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--pp-border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--pp-card-bg);
  color: var(--pp-text);
  transition: background 0.12s, border-color 0.12s;
}
.module-card:hover {
  border-color: var(--pp-green-500);
}
.module-card-enabled {
  background: var(--pp-success-bg);
  border-color: var(--pp-success);
}
.module-card-core {
  cursor: not-allowed;
  opacity: 0.85;
}
.module-card .muted,
.module-card .badge,
.module-card code,
.module-card a {
  color: var(--pp-text);
}
.module-card .muted {
  color: var(--pp-muted);
}
.module-card code {
  background: var(--pp-input-bg);
  color: var(--pp-muted);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.75rem;
}
.module-card a {
  color: var(--pp-green-700);
  text-decoration: none;
}
.module-card a:hover {
  color: var(--pp-green-900);
  text-decoration: underline;
}



/* ==================== 28. CHATBOT - Liste conversations (dark/sun) ==================== */
.chatbot-conv-item {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid var(--pp-border);
  text-decoration: none;
  color: var(--pp-text);
  background: transparent;
  transition: background 0.12s;
}
.chatbot-conv-item:hover {
  background: var(--pp-input-bg);
  color: var(--pp-text);
}
.chatbot-conv-item strong {
  font-size: 0.9rem;
  color: var(--pp-text);
  display: block;
}
.chatbot-conv-item .muted {
  font-size: 0.75rem;
  color: var(--pp-muted);
}
.chatbot-conv-item-active {
  background: var(--pp-success-bg);
}
.chatbot-conv-item-active strong {
  color: var(--pp-green-700);
}
html[data-theme="dark"] .chatbot-conv-item-active strong {
  color: var(--pp-green-300);
}


/* ==================== 29. CHATBOT — Suppression conversation ==================== */
.chatbot-conv-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--pp-border);
  position: relative;
  transition: background 0.12s;
}
.chatbot-conv-row:hover {
  background: var(--pp-input-bg);
}
.chatbot-conv-row-active {
  background: var(--pp-success-bg);
}

.chatbot-conv-row .chatbot-conv-item {
  flex: 1;
  border-bottom: none;
  min-width: 0;
}

.chatbot-conv-delete-form {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}
.chatbot-conv-delete-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 12px;
  font-size: 1rem;
  opacity: 0.35;
  color: var(--pp-muted);
  transition: opacity 0.12s, color 0.12s;
  height: 100%;
}
.chatbot-conv-row:hover .chatbot-conv-delete-btn {
  opacity: 0.75;
}
.chatbot-conv-delete-btn:hover {
  opacity: 1;
  color: var(--pp-danger);
}
