/* ============================================================
   CLIENTS & RESSOURCES
   ============================================================ */

.clients-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  gap: 0;
}
.clients-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 11px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text3);
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
}
.clients-tab:hover  { color: var(--text2); }
.clients-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.clients-tab-content.hidden { display: none; }

.clients-form-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}
.clients-form-row select {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.clients-form-row select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }

.q-link-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30,158,107,0.05);
  border: 1px solid rgba(30,158,107,0.25);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.q-link-label { font-size: 10px; font-family: var(--font-mono); color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.q-link-url   { flex: 1; font-family: var(--font-mono); font-size: 11px; color: var(--green); word-break: break-all; }

/* Modèles de mails */
.mail-cat-section     { margin-bottom: 22px; }
.mail-templates-list  { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.mail-template-card   {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}
.mail-template-card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(232,49,42,0.08); }
.mail-tpl-titre { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.mail-tpl-sujet { font-size: 11px; font-family: var(--font-mono); color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Base prévention */
.prevention-grid      { display: flex; flex-direction: column; gap: 20px; }
.prev-cat-section     { }
.prev-cat-title {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.prev-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.prev-card-header  { display: flex; justify-content: space-between; align-items: flex-start; }
.prev-card-titre   { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.prev-card-desc    { font-size: 12px; color: var(--text2); margin-bottom: 6px; line-height: 1.55; }
.prev-card-lien    { font-size: 11px; font-family: var(--font-mono); color: var(--blue); text-decoration: none; word-break: break-all; }
.prev-card-lien:hover { text-decoration: underline; }



/* ============================================================
   CRM CLIENTS
   ============================================================ */

.crm-client-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg3);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 8px;
}
.crm-client-row:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(232,49,42,0.08); }
.crm-client-nom {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.crm-notes-badge { font-size: 12px; opacity: 0.7; }
.crm-client-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text3);
  flex-wrap: wrap;
}

.crm-fiche-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.crm-fiche-titre { margin: 0; font-size: 18px; font-weight: 700; flex: 1; }

.crm-fiche-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.crm-fiche-contact a { color: var(--accent); text-decoration: none; }

.crm-fiche-section { margin-top: 20px; }
.crm-fiche-section-title {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text2);
  margin-bottom: 10px;
}

.crm-notes-text {
  font-size: 13px;
  color: var(--text1);
  line-height: 1.6;
  white-space: pre-wrap;
  padding: 10px 14px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.crm-client-surnom {
  font-size: 11px;
  color: var(--text3);
  margin-left: 6px;
}

.crm-fiche-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 600px) { .crm-fiche-cols { grid-template-columns: 1fr; } }

.crm-fiche-col { display: flex; flex-direction: column; gap: 4px; }

.crm-fiche-info-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.crm-fiche-info-row:last-child { border-bottom: none; }
.crm-info-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  min-width: 70px;
  flex-shrink: 0;
}
.crm-fiche-info-row a { color: var(--accent); text-decoration: none; }
.mono { font-family: var(--font-mono); font-size: 12px; }

/* Contacts dans la fiche */
.crm-contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.crm-contact-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.crm-contact-card.crm-contact-referent {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.crm-contact-poste {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.crm-referent-badge {
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.crm-contact-nom  { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.crm-contact-info { font-size: 12px; color: var(--text2); }
.crm-contact-info a { color: var(--accent); text-decoration: none; }

/* Contacts dans le formulaire d'édition */
.crm-contact-form-row {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}
.crm-contact-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 600px) { .crm-contact-form-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .crm-contact-form-grid { grid-template-columns: 1fr; } }
.crm-contact-form-grid label { font-size: 11px; color: var(--text2); margin-bottom: 3px; display: block; }




/* ============================================================
   CHARTS SATISFACTION
   ============================================================ */

.sat-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text3);
  padding: 0 0 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.sat-summary-sep { color: var(--border2); }
.sat-summary-total { font-weight: 600; color: var(--text2); }

.sat-chart {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 18px;
}
.sat-chart-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.sat-chart-avg {
  font-size: 32px;
  font-weight: 700;
  color: var(--text1);
  line-height: 1;
}
.sat-chart-sep {
  width: 1px;
  height: 40px;
  background: var(--border);
}
.sat-rating-bars {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sat-rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.sat-rating-label {
  width: 28px;
  text-align: right;
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 11px;
}
.sat-rating-track {
  flex: 1;
  height: 9px;
  background: var(--bg3);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.sat-rating-fill {
  height: 100%;
  border-radius: 5px;
  background: #f5a623;
  transition: width 0.5s ease;
  min-width: 2px;
}
.sat-rating-fill.empty { background: transparent; min-width: 0; }
.sat-rating-count {
  width: 28px;
  text-align: right;
  font-weight: 600;
  color: var(--text1);
  font-size: 12px;
}
.sat-rating-pct {
  width: 34px;
  color: var(--text3);
  font-size: 11px;
  font-family: var(--font-mono);
}
