body { background: #f6f7f9; }
.login-page { min-height: 100vh; display:flex; align-items:center; justify-content:center; background:#f2f3f5; }
.login-card { width:min(420px, 92vw); background:#fff; padding:38px; border-radius:18px; box-shadow:0 15px 50px rgba(0,0,0,.10); text-align:center; }
.logo-placeholder { width:110px; height:110px; border-radius:18px; background:#111; color:#fff; display:flex; align-items:center; justify-content:center; flex-direction:column; margin:0 auto 20px; font-weight:800; letter-spacing:1px; }
.logo-placeholder span { font-size:9px; opacity:.7; }
.stat { background:#fff; border-radius:14px; padding:22px; box-shadow:0 5px 20px rgba(0,0,0,.05); }
.stat span { display:block; color:#6c757d; }
.stat strong { font-size:2rem; }
.status-box { border:1px solid #e4e7eb; border-radius:10px; padding:12px; display:flex; justify-content:space-between; background:#fff; }
.note { background:#fff; border-left:4px solid #222; padding:14px; margin-bottom:10px; border-radius:6px; }
.permission-box { border:1px solid #e5e7eb; border-radius:10px; padding:12px; }

.status-editor { border:1px solid #e5e7eb; border-radius:10px; overflow:hidden; }
.status-editor-head, .status-row { display:grid; grid-template-columns:1.35fr 1.1fr 1fr; gap:12px; align-items:center; padding:10px 12px; }
.status-editor-head { background:#f8f9fa; font-size:.8rem; font-weight:700; color:#6c757d; }
.status-row + .status-row { border-top:1px solid #edf0f2; }
.color-control { display:flex; align-items:center; gap:8px; }
.status-color-picker { width:44px; height:38px; padding:3px; border:1px solid #dee2e6; border-radius:6px; cursor:pointer; }
.status-hex { max-width:120px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.status-preview { display:inline-flex; align-items:center; justify-content:center; min-height:32px; width:max-content; max-width:100%; padding:5px 10px; border-radius:7px; font-size:.82rem; font-weight:700; white-space:nowrap; }
@media (max-width:800px) {
  .status-editor-head { display:none; }
  .status-row { grid-template-columns:1fr; }
}

.status-name-wrap { display:flex; align-items:center; gap:8px; }
.drag-handle { border:0; background:transparent; color:#6b7280; cursor:grab; font-size:18px; padding:4px; }
.status-actions { display:flex; align-items:center; gap:8px; min-width:0; }
.delete-status-btn { flex:0 0 auto; }


.password-dialog { border:0; border-radius:14px; padding:0; width:min(460px, 92vw); box-shadow:0 20px 60px rgba(0,0,0,.22); }
.password-dialog::backdrop { background:rgba(15,23,42,.45); }
.password-dialog form { padding:22px; }
@media (max-width:576px) { .password-dialog { width:calc(100vw - 24px); } }



/* Custom CRM branding settings */
.admin-branding-card {
  overflow: hidden;
}
.admin-branding-card .card-header {
  background: #fff;
  padding: 0.8rem 1rem;
}
.branding-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #e8f4ff;
  font-size: 18px;
}
.admin-branding-card .card-body {
  padding: 1rem;
}
.branding-panel {
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}
.branding-panel h5 {
  font-size: 1.05rem;
  margin-bottom: 0.2rem !important;
}
.branding-preview {
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  min-height: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 10px;
  margin-bottom: 10px;
}
.branding-preview-logo img {
  max-width: 94%;
  max-height: 100px;
  object-fit: contain;
}
.branding-preview-favicon {
  min-height: 120px;
  height: 120px;
}
.branding-preview-favicon img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.branding-upload {
  min-height: 78px;
  border: 1.5px dashed #b9c7d4;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 5px;
  align-items: center;
  padding: 10px 11px;
  cursor: pointer;
  background: #fff;
}
.branding-upload:hover {
  border-color: #6c8da8;
  background: #f8fbfd;
}
.branding-upload input {
  display: none;
}
.branding-upload .upload-symbol {
  grid-row: 1 / span 2;
  font-size: 24px;
  line-height: 1;
  color: #52677a;
  text-align: center;
}
.branding-upload span:nth-child(2) {
  min-width: 0;
}
.branding-upload strong,
.branding-upload small {
  display: block;
}
.branding-upload strong {
  font-size: 0.92rem;
}
.branding-upload small {
  color: #6c757d;
  margin-top: 2px;
  font-size: 0.78rem;
  line-height: 1.25;
}
.branding-upload .btn {
  grid-column: 2;
  justify-self: start;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
}
.branding-tips {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.84rem;
}
.branding-tips ul {
  padding-left: 18px;
  margin-top: 5px !important;
}
.admin-branding-card .btn-success {
  background-color: #212529;
  border-color: #212529;
}
.admin-branding-card .btn-success:hover {
  background-color: #000;
  border-color: #000;
}
@media (max-width: 767px) {
  .admin-branding-card .row {
    --bs-gutter-y: 0.75rem;
  }
  .branding-panel {
    padding: 12px;
  }
}



/* Status editor — compact, readable and no overflow */
.status-editor {
  width: 100%;
  overflow: hidden;
}
.status-editor .status-editor-head,
.status-editor .status-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1.25fr) minmax(145px, .85fr) minmax(150px, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}
.status-editor .status-editor-head {
  padding: 8px 10px;
}
.status-editor .status-row {
  padding: 7px 10px !important;
}
.status-editor .status-row > *,
.status-editor .status-editor-head > * {
  min-width: 0;
}
.status-editor .status-name-wrap,
.status-editor .color-control,
.status-editor .status-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.status-editor .status-name-wrap {
  width: 100%;
}
.status-editor .status-name {
  flex: 1 1 auto;
  min-width: 0 !important;
  width: auto !important;
  padding: .38rem .55rem;
  font-size: .86rem;
}
.status-editor .drag-handle {
  flex: 0 0 28px;
  width: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 18px;
  text-align: center;
  cursor: grab;
  color: #52677a;
}
.status-editor .color-control {
  width: 100%;
}
.status-editor .status-color-picker {
  flex: 0 0 42px;
  width: 42px !important;
  min-width: 42px !important;
  height: 38px;
  padding: 3px;
}
.status-editor .status-hex {
  flex: 1 1 auto;
  min-width: 0 !important;
  width: auto !important;
  padding: .38rem .55rem;
  font-size: .84rem;
}
.status-editor .status-actions {
  width: 100%;
}
.status-editor .status-preview {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: .38rem .55rem !important;
  font-size: .76rem !important;
  text-align: center;
}
.status-editor .delete-status-btn {
  flex: 0 0 36px;
  width: 36px !important;
  min-width: 36px !important;
  height: 36px;
  padding: 0 !important;
}
@media (max-width: 760px) {
  .status-editor .status-editor-head,
  .status-editor .status-row {
    grid-template-columns: minmax(0, 1.15fr) minmax(125px, .85fr) minmax(125px, .9fr);
    gap: 6px;
    padding-left: 7px !important;
    padding-right: 7px !important;
  }
  .status-editor .status-name,
  .status-editor .status-hex {
    font-size: .8rem;
  }
  .status-editor .drag-handle {
    flex-basis: 24px;
    width: 24px;
  }
  .status-editor .status-color-picker {
    flex-basis: 38px;
    width: 38px !important;
    min-width: 38px !important;
  }
  .status-editor .delete-status-btn {
    flex-basis: 34px;
    width: 34px !important;
    min-width: 34px !important;
    height: 34px;
  }
}
@media (max-width: 560px) {
  .status-editor .status-editor-head {
    display: none !important;
  }
  .status-editor .status-row {
    grid-template-columns: minmax(0, 1fr) minmax(105px, .9fr);
    gap: 6px;
  }
  .status-editor .status-name-wrap {
    grid-column: 1 / 3;
  }
  .status-editor .color-control {
    grid-column: 1;
  }
  .status-editor .status-actions {
    grid-column: 2;
  }
}

/* Global CRM branding */
.header-logo {
    height: 68px;
    width: auto;
    max-width: 220px;
    display: block;
    object-fit: contain;
}
.login-brand {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 18px;
}
.login-logo {
    display: block;
    width: min(330px, 88%);
    max-height: 150px;
    height: auto;
    object-fit: contain;
}

/* Login branding — client logo clearly visible on a soft gray card */
.login-page {
    background: #f1f3f5;
}
.login-card {
    background: #e9ecef;
}
.login-brand {
    margin-bottom: 22px;
}
.login-logo {
    width: min(360px, 90%);
    max-height: 165px;
    object-fit: contain;
}
.login-powered-by {
    margin-top: 20px;
    text-align: center;
    color: #5f6670;
    font-size: 0.92rem;
}

/* Login card — darker client block */
.login-card {
    background: #d6d9dd;
    border: 1px solid #c4c8cd;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* Import wizard */
.import-page {
  max-width: 1100px;
  margin: 0 auto;
}
.import-card {
  overflow: hidden;
}
.import-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.import-step {
  flex: 1 0 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #8a929a;
  font-size: .85rem;
  font-weight: 600;
  padding: 9px 10px;
  border-bottom: 2px solid #dee2e6;
}
.import-step span {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e9ecef;
  color: #6c757d;
  font-size: .78rem;
}
.import-step.active {
  color: #212529;
  border-bottom-color: #212529;
}
.import-step.active span {
  background: #212529;
  color: #fff;
}
.import-dropzone {
  min-height: 280px;
  border: 2px dashed #c6ced6;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  background: #f8f9fa;
  text-align: center;
  transition: .15s ease;
}
.import-dropzone:hover {
  border-color: #6c757d;
  background: #f1f3f5;
}
.import-dropzone input {
  display: none;
}
.import-upload-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e9ecef;
  color: #212529;
  font-size: 32px;
  line-height: 1;
}
.import-dropzone strong {
  font-size: 1.1rem;
}
.import-dropzone small {
  color: #6c757d;
}
.selected-file {
  min-height: 22px;
  font-weight: 600;
}
.import-preview {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  overflow: hidden;
}
.import-preview .table {
  font-size: .82rem;
}
.import-preview td,
.import-preview th {
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.import-metric {
  height: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 13px;
  background: #fff;
}
.import-metric span {
  display: block;
  color: #6c757d;
  font-size: .78rem;
  margin-bottom: 4px;
}
.import-metric strong {
  display: block;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.import-assignment-box,
.import-duplicate-box {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 15px;
  background: #f8f9fa;
}
.import-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.import-summary > div {
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  padding: 12px;
}
.import-summary span {
  display: block;
  color: #6c757d;
  font-size: .78rem;
}
.import-success {
  text-align: center;
  padding: 12px 0 20px;
}
.import-success-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #212529;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
@media (max-width: 700px) {
  .import-summary {
    grid-template-columns: 1fr;
  }
  .import-dropzone {
    min-height: 220px;
  }
  .import-step {
    flex-basis: 100px;
    font-size: .78rem;
  }
}

/* Telepro weekly agenda */
.agenda-page {
  width: 100%;
}
.agenda-summary {
  display: flex;
  gap: 12px;
}
.agenda-summary > div {
  min-width: 150px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 14px;
}
.agenda-summary strong,
.agenda-summary span {
  display: block;
}
.agenda-summary strong {
  font-size: 1.25rem;
}
.agenda-summary span {
  color: #6c757d;
  font-size: .8rem;
}
.agenda-calendar {
  min-width: 920px;
  background: #fff;
  border: 1px solid #dfe3e7;
  border-radius: 12px;
  overflow: hidden;
}
.agenda-grid-header,
.agenda-grid-row {
  display: grid;
  grid-template-columns: 62px repeat(7, minmax(118px, 1fr));
}
.agenda-grid-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8f9fa;
  border-bottom: 1px solid #dfe3e7;
}
.agenda-time-head,
.agenda-day-head {
  min-height: 52px;
  padding: 8px 7px;
  border-right: 1px solid #edf0f2;
}
.agenda-day-head {
  text-align: center;
}
.agenda-day-head span {
  display: block;
  color: #6c757d;
  font-size: .74rem;
  text-transform: uppercase;
}
.agenda-day-head strong {
  display: block;
  font-size: .92rem;
  margin-top: 2px;
}
.agenda-day-head.is-today {
  background: #e9ecef;
  color: #111827;
}
.agenda-grid-row {
  min-height: 72px;
  border-bottom: 1px solid #edf0f2;
}
.agenda-grid-row:last-child {
  border-bottom: 0;
}
.agenda-time {
  padding: 8px 6px;
  color: #6c757d;
  font-size: .72rem;
  text-align: center;
  border-right: 1px solid #edf0f2;
}
.agenda-slot {
  position: relative;
  padding: 4px;
  border-right: 1px solid #edf0f2;
  background: #fff;
}
.agenda-slot.is-today {
  background: #fbfbfc;
}
.agenda-event {
  display: block;
  width: 100%;
  min-height: 60px;
  padding: 6px 7px;
  border-radius: 7px;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.agenda-event:hover {
  opacity: .9;
}
.agenda-event strong,
.agenda-event span,
.agenda-event small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agenda-event strong {
  font-size: .74rem;
}
.agenda-event span {
  font-size: .7rem;
  margin-top: 2px;
}
.agenda-event small {
  font-size: .63rem;
  margin-top: 2px;
  opacity: .9;
}
@media (max-width: 900px) {
  .agenda-calendar {
    overflow-x: auto;
  }
  .agenda-page .btn {
    font-size: .78rem;
  }
}

/* Agenda télépro : les rendez-vous restent neutres.
   Le statut/couleur est déterminé ensuite par le confirmateur. */
.agenda-event-neutral {
  background: #f1f3f5;
  color: #212529;
  border: 1px solid #d8dde2;
}
.agenda-event-neutral:hover {
  background: #e9ecef;
  color: #212529;
}
.agenda-event-neutral small {
  color: #6c757d;
}

/* Workflow agenda :
   - RDV à confirmer = neutre, en attente du confirmateur
   - tout autre statut = couleur définie dans Administration */
.agenda-event-confirmed {
  border: 1px solid rgba(0, 0, 0, .08);
}
.agenda-event-confirmed:hover {
  opacity: .9;
}

/* Autocomplétion d'adresse BAN / Géoplateforme */
.address-autocomplete-wrap {
  position: relative;
}
.address-status {
  margin-top: 5px;
  font-size: .76rem;
}
.address-suggestions {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1000;
  background: #fff;
  border: 1px solid #d7dce1;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
  overflow: hidden;
}
.address-suggestions.is-open {
  display: block;
}
.address-suggestion {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.address-suggestion:last-child {
  border-bottom: 0;
}
.address-suggestion:hover,
.address-suggestion:focus {
  background: #f1f3f5;
  outline: none;
}
.address-suggestion-main {
  display: block;
  color: #111827;
  font-size: .9rem;
}
.address-suggestion-type {
  display: block;
  margin-top: 2px;
  color: #6c757d;
  font-size: .72rem;
}

/* Filtres de la page Rendez-vous */
.rdv-filter { min-width: 92px; }
.rdv-filter.active { font-weight: 600; }

/* Fonctions Télépro */
.mini-stat { background:#f8f9fa; border:1px solid #e9ecef; border-radius:12px; padding:14px; }
.mini-stat span { display:block; color:#6c757d; font-size:.85rem; }
.mini-stat strong { display:block; font-size:1.65rem; margin-top:3px; }
.telepro-day-card .progress { background:#e9ecef; border-radius:999px; }
.agenda-event-callback { background:#fff3cd; color:#212529; border:1px solid #f0d98c; }
.agenda-event-callback:hover { color:#212529; }

/* Paramètres du site — gestion des rôles */
.role-setting-row .role-profile { min-width: 0; }
.role-setting-row .delete-role-btn { white-space: nowrap; min-width: 112px; }
@media (max-width: 767px) {
  .role-setting-row .delete-role-btn { min-width: 100%; }
}

/* Paramètres du site : sauvegarde explicite des rôles */
#save-roles-btn { white-space: nowrap; }
#roles-save-state { min-width: 190px; text-align: right; }
@media (max-width: 767px) {
  #roles-save-state { display: none; }
  #save-roles-btn { width: 100%; }
}

/* Planification Confirmateur */
.planning-page { width: 100%; }
.planning-toolbar { border: 1px solid #dee2e6; }
.planning-day-block { border: 1px solid #e5e7eb; border-radius: 12px; margin-bottom: 12px; overflow: hidden; background: #fff; }
.planning-day-block:last-child { margin-bottom: 0; }
.planning-day-selected { box-shadow: 0 0 0 2px rgba(33,37,41,.08); }
.planning-day-title { display:flex; justify-content:space-between; align-items:center; padding:10px 14px; background:#f8f9fa; border-bottom:1px solid #edf0f2; }
.planning-day-title span:first-child { display:block; color:#6c757d; font-size:.78rem; text-transform:uppercase; }
.planning-day-title strong { display:block; font-size:1rem; margin-top:2px; }
.planning-appointment-list { display:flex; flex-direction:column; }
.planning-appointment-card { display:grid; grid-template-columns:72px 1fr auto; gap:14px; align-items:center; padding:12px 14px; border-bottom:1px solid #edf0f2; }
.planning-appointment-card:last-child { border-bottom:0; }
.planning-time { font-size:1.1rem; font-weight:700; text-align:center; }
.planning-meta { display:flex; flex-wrap:wrap; gap:10px 16px; margin-top:4px; color:#6c757d; font-size:.78rem; }
.planning-address { margin-top:5px; color:#495057; font-size:.8rem; }
.planning-actions { display:flex; gap:5px; flex-wrap:wrap; justify-content:flex-end; }
.travel-table td { vertical-align:middle; }
.travel-table small { max-width:250px; }
@media (max-width: 900px) {
  .planning-appointment-card { grid-template-columns:58px 1fr; }
  .planning-actions { grid-column:2; justify-content:flex-start; }
}
@media (max-width: 700px) {
  .planning-day-title { padding:9px 10px; }
  .planning-appointment-card { grid-template-columns:1fr; gap:7px; padding:10px; }
  .planning-time { text-align:left; }
  .planning-actions { grid-column:auto; }
}


/* Pilotage Confirmateur */
.priority-action-row { display:flex; align-items:center; gap:12px; padding:11px 14px; border-bottom:1px solid #edf0f2; }
.priority-action-row:last-child { border-bottom:0; }
.priority-dot { width:9px; height:9px; border-radius:50%; flex:0 0 auto; }
.priority-danger { background:#dc3545; }
.priority-warning { background:#f0ad00; }
.compact-rdv-row { display:grid; grid-template-columns:52px 1fr auto; gap:8px; padding:8px 0; border-bottom:1px solid #edf0f2; font-size:.86rem; }
.compact-rdv-row:last-child { border-bottom:0; }
.planning-map { height:360px; border-radius:10px; overflow:hidden; border:1px solid #dee2e6; }
.assistant-step { border-left:3px solid #212529; padding-left:12px; margin-bottom:12px; }
.assistant-step:last-child { margin-bottom:0; }
.conflict-row { background:#fff7f7; }
@media (max-width: 700px) { .compact-rdv-row { grid-template-columns:48px 1fr; } .compact-rdv-row .text-muted { grid-column:2; } }


/* Planning commercial simple */
.commercial-planning-board { overflow: hidden; }
.commercial-planning-table { min-width: 1050px; }
.commercial-planning-table th,
.commercial-planning-table td { border-color: #e5e7eb; }
.commercial-name-col,
.commercial-name-cell { width: 170px; min-width: 170px; }
.commercial-day-cell { vertical-align: top; min-width: 125px; height: 110px; background: #fff; }
.planning-today-col,
.planning-today-cell { background: #f6f8fb !important; }
.commercial-rdv-card {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 6px;
  padding: 7px 8px;
  border: 1px solid #d7dce2;
  border-left: 4px solid #198754;
  border-radius: 6px;
  background: #fff;
  color: #17202a;
  text-decoration: none;
  font-size: 12px;
}
.commercial-rdv-card:hover { border-color: #343a40; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.commercial-rdv-card.rdv-pending { border-left-color: #f0ad00; }
.commercial-rdv-card span { font-weight: 600; line-height: 1.15; }
.commercial-rdv-card small { color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.commercial-free-slot { color: #9ca3af; font-size: 12px; }


/* Fiche client simplifiée */
.lead-page { max-width: 1180px; margin: 0 auto; }
.lead-page-header { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:18px; }
.lead-page-header h2 { font-size:28px; font-weight:700; }
.lead-section-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.lead-card { background:#fff; border:1px solid #dfe3e8; border-radius:9px; overflow:hidden; }
.lead-card-wide { grid-column:1 / -1; }
.lead-card-title { padding:12px 15px; font-weight:700; border-bottom:1px solid #e7eaee; background:#fafbfc; }
.lead-card-body { padding:15px; }
.lead-info-box { display:flex; flex-direction:column; gap:3px; padding:11px 13px; border-left:4px solid #0d6efd; background:#f5f9ff; color:#344054; font-size:14px; }
.lead-save-bar { display:flex; justify-content:space-between; align-items:center; gap:15px; margin-top:14px; padding:12px 15px; background:#fff; border:1px solid #dfe3e8; border-radius:9px; }
.lead-details > summary { list-style:none; cursor:pointer; }
.lead-details > summary::-webkit-details-marker { display:none; }
.lead-details > summary:after { content:"＋"; float:right; color:#6c757d; }
.lead-details[open] > summary:after { content:"−"; }
.lead-details[open] > summary { border-bottom:1px solid #e7eaee; }
.lead-details > .lead-card-body { border-top:0; }
.lead-last-call { padding:9px 11px; border-radius:6px; background:#f7f8fa; font-size:14px; }
.callback-current { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:11px 13px; border:1px solid #e2e6ea; border-radius:7px; background:#fafbfc; }
@media (max-width: 850px) {
  .lead-section-grid { grid-template-columns:1fr; }
  .lead-card-wide { grid-column:auto; }
  .lead-page-header { flex-direction:column; }
  .call-result-grid { grid-template-columns:repeat(2,1fr); }
  .lead-save-bar { flex-direction:column; align-items:stretch; }
}
@media (max-width: 500px) { .call-result-grid { grid-template-columns:1fr; } }


.lead-sub-actions { border-top:1px solid #edf0f2; padding-top:10px; }
.lead-details-inline > summary { cursor:pointer; color:#495057; font-size:14px; font-weight:600; list-style:none; }
.lead-details-inline > summary::-webkit-details-marker { display:none; }
.lead-details-inline > summary:after { content:"＋"; float:right; color:#6c757d; }
.lead-details-inline[open] > summary:after { content:"−"; }
.compact-callback { display:flex; justify-content:space-between; align-items:center; gap:15px; }
@media (max-width:650px) { .compact-callback { flex-direction:column; align-items:stretch; } }

/* Boutons fiche lead : compacts et cohérents */
.lead-page .btn { white-space: nowrap; }
.lead-page .lead-save-bar .btn { min-height: 40px; }
.lead-page .compact-callback .btn,
.lead-page .compact-callback button,
.lead-page .lead-details-inline .btn {
  min-height: 38px;
  padding: .48rem .85rem;
  font-size: .92rem;
  line-height: 1.2;
  border-radius: 6px;
}
.lead-page .compact-callback .btn { width: auto !important; }

.leads-day-actions { min-width: 310px; }

/* Leads du jour : tableau épuré, sans informations secondaires */
.leads-day-table { width:100%; table-layout:fixed; }
.leads-day-table .lead-day-name { width:20%; }
.leads-day-table .lead-day-phone { width:14%; }
.leads-day-table .lead-day-city { width:13%; }
.leads-day-table .lead-day-project { width:20%; }
.leads-day-table .lead-day-status { width:21%; }
.leads-day-table .lead-day-actions-head,
.leads-day-table td:last-child { width:12%; }
.leads-day-table td, .leads-day-table th { vertical-align:middle; }
.leads-day-table td:last-child .d-flex { justify-content:flex-end; }
.leads-day-table .form-select { width:100%; }
@media (max-width: 900px) {
  .leads-day-table { table-layout:auto; }
  .leads-day-table .lead-day-actions-head,
  .leads-day-table td:last-child { min-width:145px; }
}

/* Repérage visuel des leads du jour */
.leads-day-table .lead-day-number { width:5%; text-align:center; }
.leads-day-table .lead-day-number-cell {
  width:5%;
  text-align:center;
  font-weight:800;
  font-size:1rem;
  color:#343a40;
  background:#f4f5f6;
  border-right:2px solid #cfd3d7;
}
.leads-day-table tbody tr {
  border-bottom:2px solid #c5c9cd;
}
.leads-day-table tbody tr:last-child {
  border-bottom:0;
}
.leads-day-table tbody tr:hover .lead-day-number-cell {
  background:#e9ecef;
}

.telepro-primary-nav {
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(25,135,84,.25);
}
.telepro-primary-nav:hover {
  filter: brightness(.95);
}

.notification-actions{border-top:1px solid #e9ecef;margin-top:6px;padding:8px;display:grid;gap:6px}
.notification-actions .btn{min-height:34px;font-size:12px;white-space:normal}
.notification-seen{opacity:.65}
.notification-list{max-height:320px;overflow-y:auto}


/* Questionnaire client : afficher les rubriques deux par deux pour alléger la fiche lead. */
.qcm-section-accordion {
  border:1px solid #dfe3e8;
  border-radius:10px;
  background:#f8fafc;
  overflow:hidden;
}
.qcm-section-summary {
  display:flex;
  align-items:center;
  gap:12px;
  min-height:72px;
  padding:12px 16px;
  cursor:pointer;
  list-style:none;
  background:#fff;
}
.qcm-section-summary::-webkit-details-marker { display:none; }
.qcm-section-summary::marker { content:""; }
.qcm-section-summary:hover { background:#f8fafc; }
.qcm-section-summary-icon {
  width:42px;
  min-width:42px;
  height:42px;
  display:grid;
  place-items:center;
  font-size:1.55rem;
  border:1px solid #e1e5ea;
  border-radius:9px;
  background:#fff;
}
.qcm-section-summary-main { flex:1; min-width:0; }
.qcm-section-toggle {
  font-size:1.25rem;
  line-height:1;
  color:#667085;
  transition:transform .15s ease;
}
.qcm-section-accordion[open] .qcm-section-toggle { transform:rotate(180deg); }
.qcm-section-content {
  padding:14px 16px 16px;
  border-top:1px solid #e1e5ea;
  background:#f8fafc;
}

.qcm-sections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.qcm-section-card {
  min-width: 0;
}
@media (max-width: 991.98px) {
  .qcm-section-accordion {
  border:1px solid #dfe3e8;
  border-radius:10px;
  background:#f8fafc;
  overflow:hidden;
}
.qcm-section-summary {
  display:flex;
  align-items:center;
  gap:12px;
  min-height:72px;
  padding:12px 16px;
  cursor:pointer;
  list-style:none;
  background:#fff;
}
.qcm-section-summary::-webkit-details-marker { display:none; }
.qcm-section-summary::marker { content:""; }
.qcm-section-summary:hover { background:#f8fafc; }
.qcm-section-summary-icon {
  width:42px;
  min-width:42px;
  height:42px;
  display:grid;
  place-items:center;
  font-size:1.55rem;
  border:1px solid #e1e5ea;
  border-radius:9px;
  background:#fff;
}
.qcm-section-summary-main { flex:1; min-width:0; }
.qcm-section-toggle {
  font-size:1.25rem;
  line-height:1;
  color:#667085;
  transition:transform .15s ease;
}
.qcm-section-accordion[open] .qcm-section-toggle { transform:rotate(180deg); }
.qcm-section-content {
  padding:14px 16px 16px;
  border-top:1px solid #e1e5ea;
  background:#f8fafc;
}

.qcm-sections-grid {
    grid-template-columns: 1fr;
  }
}

/* Zone de précision QCM : même format compact qu'une réponse à cocher. */
.qcm-question-options-row {
  align-items: flex-start;
}
.qcm-precision-textarea {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: .5rem .75rem;
  border: 1px solid #dee2e6;
  border-radius: .375rem;
  background: #fff;
  resize: none;
  line-height: 1.4;
  box-sizing: border-box;
}

/* Confirmation renforcée pour la suppression d'un compte. */
.delete-user-dialog .alert {
  border-radius: 10px;
}
.delete-confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.delete-confirm-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

/* Agenda popup de choix de créneau pour tous les Télépros. */
.telepros-agenda-dialog{width:min(1200px,96vw);max-width:1200px;border:0;padding:0;border-radius:14px;box-shadow:0 18px 60px rgba(0,0,0,.25)}
.telepros-agenda-dialog::backdrop{background:rgba(10,20,30,.58)}
.telepros-agenda-modal{background:#fff;padding:18px}
.telepros-agenda-header,.telepros-agenda-toolbar,.telepros-agenda-footer{display:flex;align-items:center;gap:10px}
.telepros-agenda-header{justify-content:space-between;padding-bottom:12px;border-bottom:1px solid #e4e9ee}
.telepros-agenda-toolbar{justify-content:center;flex-wrap:wrap;padding:12px 0 8px}
.telepros-agenda-scroll{overflow:auto;max-height:62vh;border:1px solid #dbe3ea;border-radius:10px}
.telepros-agenda-grid{display:grid;grid-template-columns:72px repeat(var(--telepro-count,1),minmax(150px,1fr));min-width:680px}
.agenda-corner,.agenda-telepro-head,.agenda-time,.agenda-slot{min-height:42px;border-right:1px solid #e3e8ed;border-bottom:1px solid #e3e8ed}
.agenda-corner,.agenda-telepro-head{position:sticky;top:0;z-index:2;background:#f4f7fa;font-weight:700;padding:10px 8px}
.agenda-corner{left:0;z-index:3}.agenda-telepro-head{text-align:center}
.agenda-time{position:sticky;left:0;z-index:1;background:#fafbfd;font-size:12px;font-weight:700;text-align:center;padding:12px 4px}
.agenda-slot{display:flex;align-items:center;gap:6px;width:100%;padding:6px 8px;text-align:left;font-size:12px;box-sizing:border-box}
button.agenda-slot{cursor:pointer}.agenda-slot-free{background:#f4fbf7;color:#187447;border-top:0;border-left:0}
.agenda-slot-free:hover{background:#dff5e8}.agenda-slot-free span{font-size:15px}
.agenda-slot-busy{background:#fff0f0;color:#8b2525;flex-wrap:wrap}
.agenda-slot-busy strong,.agenda-slot-busy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.agenda-slot-busy small{width:100%;padding-left:21px;color:#7b5a5a}.telepros-agenda-footer{justify-content:flex-end;padding-top:12px}
@media(max-width:800px){.telepros-agenda-dialog{width:98vw}.telepros-agenda-modal{padding:10px}}

/* Agenda hebdomadaire : 7 jours avec positionnement des RDV selon l'heure. */
.telepros-week-grid{display:grid;grid-template-columns:repeat(7,minmax(190px,1fr));min-width:1330px;background:#fff}.telepros-week-day{border-right:1px solid #dfe6ec;min-width:190px}.telepros-week-day.is-selected{box-shadow:inset 0 0 0 2px #8bb8ff}.telepros-day-head{position:sticky;top:0;z-index:4;width:100%;min-height:58px;border:0;border-bottom:1px solid #dfe6ec;background:#f4f7fa;padding:8px;text-align:left;cursor:pointer}.telepros-day-head:hover{background:#e9f2fb}.telepros-day-head strong,.telepros-day-head small{display:block}.telepros-day-head small{color:#667085;margin-top:2px}.telepros-day-timeline{position:relative;height:993px;background:repeating-linear-gradient(to bottom,#fff 0,#fff 30px,#e8edf2 30px,#e8edf2 31px)}.week-free-slot{position:relative;display:block;width:100%;height:31px;padding:0;border:0;border-bottom:1px dashed #eef1f4;background:transparent;text-align:left;color:#a0aab4;cursor:pointer}.week-free-slot span{display:inline-block;padding-left:5px;font-size:10px;opacity:.7}.week-free-slot:hover{background:#eaf8ef}.week-free-slot.is-current-slot{background:#dceeff;box-shadow:inset 0 0 0 2px #4c9aff}.week-appointment{position:absolute;left:4px;right:4px;min-height:29px;padding:4px 6px;border-radius:6px;border-left:4px solid #dc3545;background:#fff0f0;color:#7f1d1d;z-index:2;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.08);font-size:10px;line-height:1.15}.week-appointment b,.week-appointment span,.week-appointment small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.week-appointment small{color:#8b5a5a}

/* Repère visuel du jour courant dans le sélecteur hebdomadaire. */
.telepros-week-day.is-today .telepros-day-head {
  box-shadow: inset 0 -3px 0 #198754;
}

/* Modification rapide du statut depuis la liste des leads. */
.lead-inline-status{min-width:145px;font-size:.82rem;padding-top:.3rem;padding-bottom:.3rem;transition:border-color .15s ease,box-shadow .15s ease}
.lead-inline-save{white-space:nowrap;min-width:92px}

.lead-status-control{display:flex;align-items:center;gap:7px;min-width:180px}
.lead-status-color{display:inline-block;width:13px;height:13px;min-width:13px;border-radius:50%;border:1px solid rgba(0,0,0,.22);box-shadow:0 0 0 1px rgba(255,255,255,.8)}

/* Le statut et le bouton Enregistrer utilisent un vrai formulaire POST,
   donc la sauvegarde fonctionne même si JavaScript est désactivé ou bloqué. */
.lead-status-form{margin:0}
.lead-status-control{display:flex;align-items:center;gap:7px;min-width:180px}
.lead-status-color{display:inline-block;width:13px;height:13px;min-width:13px;border-radius:50%;border:1px solid rgba(0,0,0,.22);box-shadow:0 0 0 1px rgba(255,255,255,.8)}
.lead-inline-save{white-space:nowrap;min-width:92px}

/* Agenda : couleur des RDV par département. */
.agenda-department-legend{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center}
.agenda-dept-item{display:inline-flex;align-items:center;gap:4px;font-size:11px;color:#475467;background:#f8fafc;border:1px solid #e4e7ec;border-radius:999px;padding:3px 7px}
.agenda-dept-item i{display:inline-block;width:10px;height:10px;border-radius:50%;border:1px solid rgba(0,0,0,.18)}
.week-appointment span{color:inherit}
.week-appointment small{color:inherit;opacity:.72}

/* Palette département : couleurs volontairement très espacées sur le cercle chromatique. */
.agenda-dept-item i{width:11px;height:11px;min-width:11px}
.week-appointment{font-weight:500}
.week-appointment b{font-weight:700}

/* Planning commercial : même palette départementale que la popup de choix de créneau. */
.planning-department-legend{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center}
.planning-dept-item{display:inline-flex;align-items:center;gap:4px;font-size:11px;color:#475467;background:#f8fafc;border:1px solid #e4e7ec;border-radius:999px;padding:3px 7px}
.planning-dept-item i{display:inline-block;width:10px;height:10px;border-radius:50%;border:1px solid rgba(0,0,0,.18)}
.commercial-rdv-card{border-left-width:4px !important}
.commercial-rdv-card small{color:inherit;opacity:.72}


/* =========================================================
   ENERGY CRM — FUTURE PROFESSIONAL UI
   Visual redesign only: existing blocks/routes remain intact.
   ========================================================= */

:root{
  --crm-ink:#0b1726;
  --crm-muted:#64748b;
  --crm-surface:#ffffff;
  --crm-bg:#f4f8fb;
  --crm-line:#dce6ee;
  --crm-accent:#11b8d4;
  --crm-accent-2:#0d7ee8;
  --crm-success:#16a765;
  --crm-shadow:0 12px 35px rgba(12,31,48,.08);
  --crm-radius:16px;
}
body.crm-role-boss{--crm-accent:#f2b84b;--crm-accent-2:#12b9d5}
body.crm-role-confirmateur{--crm-accent:#28c58a;--crm-accent-2:#13a7c7}
body.crm-role-telepro,body.crm-role-commercial{--crm-accent:#20b8e6;--crm-accent-2:#287be8}
body{
  background:
    radial-gradient(circle at 8% 0%,rgba(24,190,220,.08),transparent 28%),
    radial-gradient(circle at 94% 15%,rgba(35,120,235,.06),transparent 25%),
    var(--crm-bg);
  color:var(--crm-ink);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}
.container{max-width:1320px}
.crm-navbar{
  background:linear-gradient(110deg,#08131f 0%,#0e1e2d 58%,#102c38 100%) !important;
  border-bottom:1px solid rgba(91,211,233,.20);
  box-shadow:0 5px 24px rgba(3,15,27,.20);
}
.crm-navbar .container-fluid{padding-left:26px;padding-right:26px}
.header-logo{height:42px;filter:drop-shadow(0 3px 8px rgba(17,205,230,.22))}
.header-menu{gap:7px}
.header-menu-btn,.header-notification-btn{
  min-height:38px;padding:8px 12px;border-radius:10px !important;
  background:rgba(255,255,255,.055) !important;
  border:1px solid rgba(255,255,255,.13) !important;
  color:#eef8fb !important;
  box-shadow:none !important;
}
.header-menu-btn:hover,.header-menu-btn:focus,.header-notification-btn:hover{
  background:rgba(255,255,255,.12) !important;
  border-color:rgba(97,215,236,.42) !important;
  transform:translateY(-1px);
}
.header-menu-btn.telepro-primary-nav{
  background:linear-gradient(135deg,#0ba878,#16c98b) !important;
  border-color:#23d89b !important;
}
.header-logout-btn{
  min-height:38px;border-radius:10px !important;
  background:linear-gradient(135deg,#ef5362,#d83247) !important;
  border:0 !important;
}
.header-user{color:#c6d6df;font-size:13px}
.header-dropdown{
  background:#fff;border:1px solid var(--crm-line);border-radius:13px;
  box-shadow:0 18px 45px rgba(9,30,48,.18);padding:7px;
}
.header-dropdown a:hover{background:#eef8fb;color:#087e9d}
.notification-item{border-radius:9px !important}
main.container{padding-top:24px !important}

/* Renewable banner */
.energy-page-banner{
  max-width:1320px;margin:16px auto 0;border-radius:18px;overflow:hidden;
  position:relative;min-height:112px;color:#fff;
  box-shadow:0 14px 38px rgba(9,37,56,.15);
  background:#0b2534;
}
.energy-page-banner-bg{
  position:absolute;inset:0;background:
    linear-gradient(90deg,rgba(4,19,30,.90) 0%,rgba(7,43,55,.73) 45%,rgba(7,42,52,.25) 100%),
}
.energy-page-banner-content{
  position:relative;z-index:1;min-height:112px;padding:20px 28px;
  display:flex;align-items:center;justify-content:space-between;gap:20px;
}
.energy-eyebrow{font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:#82dce9;font-weight:800}
.energy-banner-title{font-size:25px;font-weight:800;letter-spacing:-.02em;margin-top:4px}
.energy-banner-subtitle{font-size:13px;color:#d6edf1;margin-top:3px}
.energy-banner-icons{display:flex;gap:12px;font-size:30px;filter:drop-shadow(0 5px 8px rgba(0,0,0,.2))}
.energy-banner-icons span{display:grid;place-items:center;width:50px;height:50px;border-radius:15px;background:rgba(255,255,255,.10);backdrop-filter:blur(5px);border:1px solid rgba(255,255,255,.18)}
@media(max-width:700px){.energy-page-banner{margin:8px 10px 0}.energy-banner-title{font-size:20px}.energy-banner-icons{display:none}.energy-page-banner-content{padding:18px}}

/* Typography / cards */
h1,h2,h3,h4,h5{color:var(--crm-ink);letter-spacing:-.025em}
h2{font-weight:800}
.card,.stat,.stat-card,.planning-toolbar{
  border:1px solid var(--crm-line) !important;
  border-radius:var(--crm-radius) !important;
  background:rgba(255,255,255,.93) !important;
  box-shadow:var(--crm-shadow);
}
.card-header{
  background:linear-gradient(180deg,#fff,#f8fbfd) !important;
  border-bottom:1px solid #e5edf2 !important;
  border-radius:var(--crm-radius) var(--crm-radius) 0 0 !important;
  padding:14px 17px;
}
.card-body{padding:18px}
.stat,.stat-card{
  padding:17px 18px !important;
  position:relative;overflow:hidden;
}
.stat:before,.stat-card:before{
  content:"";position:absolute;left:0;top:0;bottom:0;width:4px;
  background:linear-gradient(180deg,var(--crm-accent),var(--crm-accent-2));
}
.stat strong,.stat-card strong{font-size:30px;color:var(--crm-ink);font-weight:850}
.text-muted{color:#6c7e8c !important}

/* Buttons / controls */
.btn{
  border-radius:10px !important;font-weight:650;transition:.18s ease;
}
.btn-dark{
  background:linear-gradient(135deg,#0c1824,#172b3c) !important;border-color:#102233 !important;
}
.btn-dark:hover{transform:translateY(-1px);box-shadow:0 7px 16px rgba(10,27,42,.16)}
.btn-success{background:linear-gradient(135deg,#10a46e,#18c78a) !important;border:0 !important}
.btn-primary{background:linear-gradient(135deg,#0c91d0,#287be8) !important;border:0 !important}
.form-control,.form-select{
  border-color:#d5e0e8 !important;border-radius:10px !important;min-height:40px;
  color:#182b3b;background:#fff;
}
.form-control:focus,.form-select:focus{
  border-color:var(--crm-accent) !important;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--crm-accent) 18%,transparent) !important;
}

/* Tables */
.table{--bs-table-bg:transparent;margin-bottom:0}
.table thead th{
  background:#f3f8fb;color:#173044;border-bottom:1px solid #d9e5ec;
  font-size:12px;text-transform:uppercase;letter-spacing:.045em;
}
.table tbody td{border-color:#e6edf2;padding:11px 10px}
.table-hover tbody tr:hover{background:#f5fbfd}
.table-responsive{border-radius:var(--crm-radius)}

/* Lead / planning / agenda surfaces */
.lead-page-header{
  background:linear-gradient(135deg,rgba(255,255,255,.98),rgba(240,249,251,.96)) !important;
  border:1px solid var(--crm-line);border-radius:18px;padding:18px 20px;
  box-shadow:var(--crm-shadow);margin-bottom:16px;
}
.lead-page-header h2{margin:0}
.lead-main-form > .card{margin-bottom:14px}
.status-preview{border-radius:999px !important;padding:5px 10px !important;font-weight:750 !important}
.week-appointment,.commercial-rdv-card{
  border-radius:10px !important;
  box-shadow:0 4px 10px rgba(12,34,51,.07);
}
.planning-page .table,.agenda-page .table{background:#fff;border-radius:16px;overflow:hidden}

/* Section headers inside lead */
.lead-main-form .card-header,.lead-page .card-header{
  font-weight:750;
}

/* Alerts */
.alert{border-radius:12px;border-width:1px;box-shadow:0 5px 16px rgba(12,35,52,.05)}

/* Login */
body.login-page{
  min-height:100vh;
  background:
    linear-gradient(90deg,rgba(3,19,30,.84),rgba(3,29,42,.48)),
}
.login-card{
  border:1px solid rgba(255,255,255,.20) !important;
  border-radius:22px !important;
  background:rgba(255,255,255,.96) !important;
  box-shadow:0 28px 80px rgba(0,0,0,.35) !important;
  backdrop-filter:blur(12px);
}
.login-brand{padding-bottom:8px}
.login-logo{max-height:74px}

/* Admin / configuration */
.admin-page .card,.settings-page .card{box-shadow:var(--crm-shadow)}
details summary{border-radius:10px}

/* Responsive */
@media(max-width:900px){
  .crm-navbar .container-fluid{padding-left:12px;padding-right:12px}
  .energy-page-banner{border-radius:13px}
  .card-body{padding:14px}
}

/* =========================================================
   LOGIN VECTORIEL RESPONSIVE — aucune image de fond requise
   ========================================================= */
body.login-vector-page{
  margin:0 !important;
  min-height:100svh !important;
  width:100%;
  overflow:hidden;
  background:#06335f !important;
  color:#fff;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.login-vector-page *{box-sizing:border-box}
.login-scene,.login-landscape,.login-scene-shade{position:fixed;inset:0;width:100%;height:100%;}
.login-scene{z-index:0;overflow:hidden;background:#06335f}
.login-landscape{display:block}
.login-scene-shade{background:linear-gradient(90deg,rgba(3,28,53,.18),rgba(2,39,65,.03) 55%,rgba(3,20,33,.12));pointer-events:none}
.login-corner-top{position:fixed;z-index:4;top:clamp(22px,5vh,58px);right:clamp(24px,5vw,78px);display:flex;gap:18px;align-items:stretch;text-transform:uppercase;letter-spacing:.18em;font-size:clamp(9px,.72vw,12px);line-height:1.65;text-align:left;text-shadow:0 2px 12px rgba(0,0,0,.28)}
.login-corner-top span{width:4px;background:#36efbd;border-radius:3px;box-shadow:0 0 14px rgba(54,239,189,.5)}
.login-slogan{position:fixed;z-index:4;left:clamp(30px,5.4vw,88px);top:clamp(155px,27vh,245px);max-width:min(440px,34vw);text-shadow:0 3px 20px rgba(0,0,0,.25)}
.login-slogan h1{margin:0;font-size:clamp(32px,3.15vw,52px);line-height:1.08;font-weight:800;letter-spacing:-.035em;color:#fff}
.login-slogan h1 strong{color:#21f0bd}
.login-slogan p{margin:26px 0 0;font-size:clamp(15px,1.2vw,20px);line-height:1.45;color:rgba(255,255,255,.9)}
.login-slogan i{display:block;width:76px;height:4px;margin-top:24px;background:linear-gradient(90deg,#23f0bd,#19a7ee);border-radius:5px}
.login-layout{position:fixed;z-index:5;inset:0;display:flex;align-items:center;justify-content:center;padding:clamp(80px,8vh,110px) 24px 120px;pointer-events:none}
.login-panel{width:min(410px,31vw);min-width:330px;padding:4px 0 0;text-align:center;pointer-events:auto}
.login-brand{display:flex;justify-content:center;margin-bottom:22px}
.login-logo{display:block;width:min(190px,52%);height:auto;max-height:100px;object-fit:contain;filter:drop-shadow(0 5px 14px rgba(0,0,0,.22))}
.login-alert{margin:0 0 12px!important;border-radius:10px!important;background:rgba(255,255,255,.9)!important;color:#10253a!important;font-size:13px}
.login-form{display:flex;flex-direction:column;gap:10px;align-items:center}
.login-form label{width:min(365px,100%);font-size:14px;font-weight:700;margin-top:1px;text-shadow:0 2px 8px rgba(0,0,0,.35);text-align:center}
.login-input-wrap{position:relative;display:flex;align-items:center;width:min(365px,100%);border:1px solid rgba(255,255,255,.62);border-radius:11px;background:rgba(240,249,255,.22);box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 8px 24px rgba(0,0,0,.13);backdrop-filter:blur(14px);height:52px;overflow:hidden}
.login-input-wrap>span.login-input-icon{width:48px;flex:0 0 48px;height:100%;display:grid;place-items:center;border-right:1px solid rgba(255,255,255,.38);font-size:18px;color:#fff;opacity:.98}
.login-input-wrap input{width:100%;height:100%;border:0;outline:0;background:transparent;color:#fff;font-size:15px;padding:0 14px 0 14px;min-width:0}
.login-input-wrap input::placeholder{color:rgba(255,255,255,.88)}
.login-input-wrap:focus-within{border-color:#46eac4;box-shadow:0 0 0 2px rgba(55,231,190,.2),inset 0 1px 0 rgba(255,255,255,.18)}
.password-toggle{border:0;background:transparent;color:#fff;width:42px;height:100%;cursor:pointer;font-size:17px;opacity:.9}
.login-submit{width:min(365px,100%);height:54px;margin-top:5px;border:1px solid rgba(80,245,205,.72);border-radius:11px;background:linear-gradient(100deg,#062f59 0%,#0a5476 48%,#11c59d 100%);color:#fff;font-weight:800;font-size:16px;box-shadow:0 8px 24px rgba(0,0,0,.25),0 0 20px rgba(28,223,180,.18);transition:transform .18s ease,filter .18s ease}
.login-submit:hover{transform:translateY(-1px);filter:brightness(1.08)}
.login-submit span{font-size:23px;line-height:0;margin-left:18px;vertical-align:-2px}
.login-powered{display:flex;align-items:center;justify-content:center;gap:13px;margin-top:23px;font-size:13px;color:rgba(255,255,255,.9);text-shadow:0 2px 10px rgba(0,0,0,.35)}
.login-powered b{display:block;width:58px;height:1px;background:rgba(255,255,255,.72)}
.login-features{position:fixed;z-index:4;left:clamp(26px,4.7vw,76px);bottom:clamp(20px,4vh,42px);display:flex;gap:0;text-transform:uppercase;letter-spacing:.18em;text-align:center;text-shadow:0 2px 12px rgba(0,0,0,.35)}
.login-features>div{min-width:105px;padding:0 24px;border-right:1px solid rgba(255,255,255,.45)}
.login-features>div:first-child{padding-left:0}.login-features>div:last-child{border-right:0}
.login-features span{display:block;color:#23f0bd;font-size:35px;line-height:1;margin-bottom:8px}
.login-features small{font-size:9px;line-height:1.55;color:#fff}
.login-corner-bottom{position:fixed;z-index:4;right:clamp(24px,5vw,78px);bottom:clamp(24px,4vh,42px);display:flex;align-items:center;gap:14px;text-transform:uppercase;letter-spacing:.18em;font-size:clamp(9px,.7vw,11px);line-height:1.6;text-align:right;text-shadow:0 2px 12px rgba(0,0,0,.3)}
.login-corner-bottom i{display:block;width:4px;height:52px;background:#35efbd;border-radius:4px}
@media (max-width: 1050px){
  .login-panel{width:min(360px,39vw)}
  .login-slogan{max-width:38vw}
  .login-slogan h1{font-size:clamp(29px,3.5vw,44px)}
}
@media (max-width: 800px){
  body.login-vector-page{overflow:auto}
  .login-landscape{min-width:900px;left:50%;transform:translateX(-50%)}
  .login-scene-shade{background:linear-gradient(180deg,rgba(2,22,39,.2),rgba(2,28,47,.2) 50%,rgba(2,18,32,.45))}
  .login-layout{position:relative;min-height:100svh;height:auto;padding:132px 20px 150px;align-items:flex-start}
  .login-panel{width:min(430px,calc(100vw - 32px));min-width:0;padding:0}
  .login-slogan{position:relative;left:auto;top:auto;margin:0 auto;max-width:430px;text-align:center;padding:82px 20px 0;z-index:4}
  .login-slogan h1{font-size:clamp(27px,7vw,38px)}
  .login-slogan p,.login-slogan i{display:none}
  .login-corner-top{top:20px;right:20px;font-size:8px}
  .login-corner-bottom{display:none}
  .login-features{left:50%;transform:translateX(-50%);bottom:20px;width:calc(100% - 30px);justify-content:center}
  .login-features>div{min-width:0;flex:1;padding:0 10px}
  .login-features span{font-size:27px}
  .login-features small{font-size:7px;letter-spacing:.12em}
  .login-brand{margin-bottom:14px}.login-logo{width:155px}
}
@media (max-width: 480px){
  .login-corner-top{display:none}
  .login-layout{padding-top:92px;padding-bottom:118px}
  .login-slogan{padding-top:0;margin-bottom:18px}
  .login-slogan h1{font-size:29px}
  .login-panel{width:calc(100vw - 28px)}
  .login-input-wrap{height:48px}.login-submit{height:50px;font-size:15px}
  .login-features>div{padding:0 4px}.login-features span{font-size:24px}.login-features small{font-size:6.5px}
}
@media (prefers-reduced-motion: reduce){.login-submit{transition:none}}

/* Restriction d'accès des statuts — administration */
.status-editor-head, .status-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(190px, 1.25fr);
  gap: 10px;
  align-items: center;
}
.status-access { min-width: 0; }
.status-restrict-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
  padding: 7px 9px;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  background: #f8fafc;
  white-space: nowrap;
}
.status-restrict-toggle input { accent-color: #0f766e; width: 16px; height: 16px; }
.status-restrict-toggle:has(input:checked) { background: #ecfdf5; border-color: #5eead4; color: #065f46; }
@media (max-width: 1050px) {
  .status-editor-head { display: none; }
  .status-row {
    grid-template-columns: minmax(0, 1.35fr) minmax(125px, .9fr) minmax(190px, 1.25fr);
    gap: 9px;
  }
  .status-access { grid-column: 3; }
  .status-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 2px;
  }
  .status-preview { max-width: calc(100% - 44px); }
}
@media (max-width: 760px) {
  .status-row {
    grid-template-columns: minmax(0, 1.15fr) minmax(120px, .85fr);
  }
  .status-access { grid-column: 1 / -1; }
  .status-actions { grid-column: 1 / -1; }
  .status-restrict-toggle { width: 100%; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .status-row { grid-template-columns: 1fr; }
  .status-name-wrap, .color-control, .status-access, .status-actions { grid-column: auto; }
  .status-restrict-toggle { white-space: normal; }
}

/* =========================================================
   GRC ÉNERGIES — RESPONSIVE OVERHAUL v33
   Mobile / tablette : priorité à la lisibilité, pas aux blocs géants.
   ========================================================= */
html, body { max-width:100%; overflow-x:hidden; }
img, svg, video, canvas { max-width:100%; }
*, *::before, *::after { min-width:0; }
.container, .container-fluid { width:100%; }
.card, .stat-card, .lead-card, .planning-toolbar, .energy-page-banner { max-width:100%; }
.card-header, .card-body, .card-footer { overflow-wrap:anywhere; }
.btn, .form-control, .form-select { max-width:100%; }

@media (max-width: 991.98px) {
  main.container { padding-left:14px !important; padding-right:14px !important; }
  .crm-navbar .container-fluid { padding:7px 10px !important; }
  .crm-navbar .navbar-brand { flex:0 0 auto; }
  .header-logo { height:34px; max-width:120px; }
  .header-menu {
    flex:1 1 auto; min-width:0; max-width:100%;
    display:flex; flex-wrap:nowrap; overflow-x:auto; overflow-y:visible;
    -webkit-overflow-scrolling:touch; scrollbar-width:none; padding-bottom:2px;
  }
  .header-menu::-webkit-scrollbar { display:none; }
  .header-menu-btn, .header-logout-btn, .header-notification-btn {
    flex:0 0 auto; min-height:34px; padding:6px 9px !important;
    font-size:12px !important; white-space:nowrap;
  }
  .header-menu-group { flex:0 0 auto; }
  .header-menu-group summary { white-space:nowrap; }
  .header-dropdown { position:fixed; right:10px; left:auto; top:62px; max-width:calc(100vw - 20px); }
  .notification-dropdown { width:min(340px,calc(100vw - 20px)); min-width:0; }
  .energy-page-banner-content { padding:14px 16px !important; }
  .energy-banner-title { font-size:19px !important; line-height:1.2; }
  .energy-banner-subtitle { font-size:12px !important; }
  .card-header { padding:12px 14px !important; }
  .card-body { padding:13px !important; }
  .stat strong, .stat-card strong { font-size:24px !important; }
  .lead-page-header { padding:13px 14px !important; border-radius:14px; }
  .lead-page-header h2 { font-size:22px !important; }
  .planning-toolbar { padding:0 !important; }
  .planning-toolbar .card-body { padding:12px !important; }
  .form-label { font-size:12px; margin-bottom:4px; }
  .form-control, .form-select { font-size:13px; min-height:38px; }
  .btn { font-size:13px; }
  .table { font-size:12px; }
  .table thead th { font-size:10px; padding:8px 7px !important; }
  .table tbody td { padding:8px 7px !important; }
  .table-responsive { max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .table-responsive > .table { margin-bottom:0; }
  .lead-section-grid { gap:10px; }
  .qcm-section-card { border-radius:12px; }
  .qcm-question-grid { gap:8px !important; }
}

@media (max-width: 767.98px) {
  main.container { padding-left:10px !important; padding-right:10px !important; padding-top:14px !important; }
  .crm-navbar { min-height:50px !important; }
  .crm-navbar .container-fluid { min-height:50px !important; gap:6px; }
  .header-logo { height:30px; max-width:105px; }
  .header-menu { gap:4px; }
  .header-menu-btn, .header-logout-btn, .header-notification-btn { font-size:11px !important; padding:6px 8px !important; border-radius:8px !important; }
  .header-menu-btn.telepro-primary-nav { padding-inline:8px !important; }
  .energy-page-banner { margin:6px 0 0 !important; border-radius:12px !important; }
  .energy-page-banner-content { padding:12px 13px !important; }
  .energy-eyebrow { font-size:9px !important; }
  .energy-banner-title { font-size:17px !important; }
  .energy-banner-subtitle { font-size:11px !important; }

  .row { --bs-gutter-x: .65rem; --bs-gutter-y: .65rem; }
  .card { border-radius:12px !important; }
  .card-header { padding:10px 12px !important; font-size:13px; }
  .card-body { padding:11px !important; }
  .card-footer { padding:9px 11px !important; }
  .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 { font-size:1.5rem !important; }
  h1 { font-size:24px !important; }
  h2 { font-size:21px !important; }
  h3 { font-size:18px !important; }
  h4 { font-size:16px !important; }
  h5 { font-size:14px !important; }
  h6 { font-size:13px !important; }
  p { margin-bottom:.55rem; }
  .lead-page-header h2 { font-size:20px !important; }

  /* Les tableaux restent utilisables sans casser la page : défilement horizontal
     contenu uniquement dans le tableau, jamais dans toute la page. */
  .table-responsive { border-radius:10px; width:100%; }
  .table-responsive .table { min-width:560px; }
  .leads-day-table { min-width:720px !important; }
  .commercial-planning-table { min-width:850px !important; }
  .travel-table { min-width:600px !important; }

  /* Blocs de planning : compacts et empilés. */
  .planning-appointment-card { grid-template-columns:48px 1fr !important; gap:7px !important; padding:9px !important; }
  .planning-time { font-size:.95rem !important; }
  .planning-meta { gap:5px 9px !important; font-size:.72rem !important; }
  .planning-address { font-size:.72rem !important; }
  .planning-appointment-card .btn { grid-column:1 / -1; width:100%; }
  .compact-rdv-row { grid-template-columns:42px 1fr !important; gap:6px !important; font-size:.78rem !important; padding:6px 0 !important; }
  .commercial-name-cell { width:120px !important; min-width:120px !important; }
  .commercial-day-cell { min-width:105px !important; height:90px !important; }
  .commercial-rdv-card { padding:6px !important; font-size:11px !important; }
  .commercial-rdv-card small { font-size:9px !important; }

  /* Leads / fiches : pas de gigantesques zones inutiles. */
  .lead-card-title { padding:9px 11px !important; font-size:13px; }
  .lead-card-body { padding:10px !important; }
  .lead-info-box { padding:8px 9px !important; font-size:12px !important; }
  .lead-last-call { padding:7px 8px !important; font-size:12px !important; }
  .lead-status-control { min-width:0 !important; width:100%; }
  .lead-inline-status { min-width:0 !important; flex:1 1 auto; }
  .lead-inline-save { min-width:0 !important; }
  .leads-day-actions { min-width:0 !important; }

  /* QCM : une seule colonne et contrôles courts sur téléphone. */
  .qcm-section-card .card-body { padding:9px !important; }
  .qcm-question-grid { grid-template-columns:1fr !important; }
  .qcm-section-summary-main { font-size:14px !important; }
  .qcm-section-summary-icon { width:34px !important; height:34px !important; font-size:19px !important; }

  /* Administration / statuts */
  .status-row { padding:9px !important; gap:7px !important; }
  .status-name-wrap { gap:4px !important; }
  .status-restrict-toggle { font-size:.75rem !important; padding:6px 8px !important; }
  .status-actions { gap:6px !important; }
  .status-preview { font-size:.72rem !important; min-height:28px !important; padding:4px 7px !important; }

  /* Modales / agendas : taille écran, sans débordement du document. */
  .telepros-agenda-dialog { width:calc(100vw - 14px) !important; max-width:none !important; }
  .telepros-agenda-modal { padding:7px !important; }
  .telepros-agenda-grid { min-width:620px; }
  .telepros-week-grid { min-width:1100px !important; }
  .telepros-week-day { min-width:155px !important; }
  .telepros-day-timeline { height:900px !important; }
  .week-appointment { font-size:9px !important; padding:3px 4px !important; }
  .week-free-slot { height:29px !important; }

  /* Notifications et menus */
  .notification-dropdown { max-height:70vh; overflow:auto; }
  .notification-actions { padding:7px !important; }
  .notification-actions .btn { font-size:11px !important; }
}

@media (max-width: 480px) {
  main.container { padding-left:8px !important; padding-right:8px !important; }
  .header-logo { max-width:92px; }
  .header-menu-btn, .header-logout-btn, .header-notification-btn { font-size:10px !important; padding:5px 7px !important; }
  .card-header { padding:9px 10px !important; }
  .card-body { padding:9px !important; }
  .btn { font-size:12px; }
  .form-control, .form-select { font-size:12px; min-height:36px; }
  .table { font-size:11px; }
  .table-responsive .table { min-width:520px; }
  .leads-day-table { min-width:680px !important; }
  .commercial-planning-table { min-width:800px !important; }
  .lead-page-header { padding:11px !important; }
  .lead-page-header h2 { font-size:18px !important; }
  .stat strong, .stat-card strong { font-size:21px !important; }
  .stat, .stat-card { padding:9px !important; }
  .planning-map { height:250px !important; }
  .status-restrict-toggle { width:auto !important; }
}

/* Accessibilité tactile */
@media (pointer:coarse) {
  .btn, button, summary, input[type="checkbox"], input[type="radio"] { min-height:34px; }
}

/* Statuts système protégés */
.status-row-protected { background:linear-gradient(90deg,#f8fafc,#f0fdf4); }
.status-row-protected .status-name { font-weight:800; color:#14532d; }
.status-row-protected .drag-handle:disabled,
.status-row-protected .status-color-picker:disabled,
.status-row-protected .status-restricted:disabled,
.status-row-protected .delete-status-btn:disabled { opacity:.72; cursor:not-allowed; }

/* =========================================================
   Responsive final polish — v33
   ========================================================= */
@media (max-width: 767.98px) {
  .container-fluid, .container { --bs-gutter-x: .75rem; }
  .d-flex.justify-content-between.align-items-center.flex-wrap { row-gap:8px !important; }
  .btn-group, .btn-toolbar { max-width:100%; flex-wrap:wrap; }
  .btn-group > .btn { flex:0 1 auto; }
  .input-group { max-width:100%; }
  .input-group > .form-control, .input-group > .form-select { min-width:0; }
  .dropdown-menu { max-width:calc(100vw - 16px); }
  .modal-dialog { margin:.5rem auto; max-width:calc(100vw - 16px); }
  .modal-content { border-radius:12px; }
  .modal-body { max-height:72vh; overflow-y:auto; }
  .status-editor { width:100%; }
  .status-row-protected .status-actions { justify-content:space-between; }
}

/* =========================================================
   GRC ÉNERGIES — MOBILE / TABLETTE REBUILD v34
   Objectif : aucune navigation horizontale parasite, des cartes
   lisibles et des actions faciles à toucher.
   ========================================================= */

.mobile-header-actions { display:none; }
.mobile-nav-menu { position:relative; }
.mobile-nav-trigger {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  min-height:36px; padding:7px 11px; border-radius:9px;
  color:#fff; background:#17364f; border:1px solid rgba(255,255,255,.22);
  font-size:12px; font-weight:800; cursor:pointer; list-style:none;
}
.mobile-nav-trigger::-webkit-details-marker { display:none; }
.mobile-nav-trigger-icon { font-size:15px; line-height:1; }
.mobile-nav-panel {
  position:fixed; z-index:1200; top:58px; right:8px; left:8px;
  width:auto; max-height:calc(100dvh - 68px); overflow-y:auto; overflow-x:hidden;
  padding:10px; border:1px solid #dbe5ec; border-radius:15px;
  background:#fff; box-shadow:0 18px 50px rgba(5,25,40,.25);
  -webkit-overflow-scrolling:touch;
}
.mobile-nav-panel-head {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:8px 8px 10px; margin-bottom:4px; border-bottom:1px solid #e8edf2;
}
.mobile-nav-panel-head strong { color:#08365a; font-size:13px; }
.mobile-nav-panel-head span { color:#64748b; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mobile-nav-panel > a {
  display:flex; align-items:center; min-height:42px; width:100%; padding:9px 10px;
  margin:2px 0; border-radius:10px; color:#17324a; text-decoration:none;
  font-size:13px; font-weight:700; overflow-wrap:anywhere;
}
.mobile-nav-panel > a:hover, .mobile-nav-panel > a:focus { background:#eef8fb; color:#0a5775; }
.mobile-nav-panel > a.mobile-nav-primary { background:#e8f8ef; color:#146c43; border:1px solid #bfe7d0; }
.mobile-nav-section {
  margin:10px 7px 4px; padding-top:8px; border-top:1px solid #edf1f4;
  color:#738396; font-size:9px; font-weight:900; letter-spacing:.14em;
}
.mobile-nav-logout-form { margin:8px 0 0; padding-top:8px; border-top:1px solid #edf1f4; }
.mobile-nav-logout {
  width:100%; min-height:42px; border:1px solid #efb6bd; border-radius:10px;
  background:#fff1f2; color:#b42318; font-size:13px; font-weight:800;
}
.mobile-header-notification { position:relative; }
.mobile-header-notification .notification-dropdown { position:fixed; top:58px; right:8px; left:8px; width:auto; max-width:none; }
.mobile-header-notification .notification-list { max-height:45dvh; overflow-y:auto; }

/* Generic data tables become compact cards on phones. The JS below supplies labels. */
@media (max-width: 767.98px) {
  .stack-on-mobile { display:block; width:100% !important; }
  .stack-on-mobile thead { display:none; }
  .stack-on-mobile tbody,
  .stack-on-mobile tbody tr,
  .stack-on-mobile tbody td { display:block; width:100% !important; }
  .stack-on-mobile tbody tr {
    margin:0 0 9px; padding:8px 9px; border:1px solid #dfe7ed;
    border-radius:11px; background:#fff; box-shadow:0 2px 8px rgba(20,45,65,.05);
  }
  .stack-on-mobile tbody tr:last-child { margin-bottom:0; }
  .stack-on-mobile tbody td {
    display:grid !important; grid-template-columns:minmax(82px, 30%) minmax(0, 1fr);
    align-items:center; gap:8px; min-height:34px; padding:6px 0 !important;
    border:0 !important; border-bottom:1px solid #eef2f5 !important;
    text-align:left !important; overflow-wrap:anywhere;
  }
  .stack-on-mobile tbody td:last-child { border-bottom:0 !important; }
  .stack-on-mobile tbody td::before {
    content:attr(data-mobile-label); display:block; color:#718096;
    font-size:10px; line-height:1.25; font-weight:800; text-transform:uppercase;
    letter-spacing:.04em;
  }
  .stack-on-mobile tbody td > * { min-width:0; max-width:100%; }
  .stack-on-mobile tbody td .d-flex,
  .stack-on-mobile tbody td .d-inline-flex { flex-wrap:wrap; }
  .stack-on-mobile tbody td .btn { white-space:normal !important; min-height:34px; }
  .stack-on-mobile tbody td .form-select { width:100%; min-width:0; }
  .stack-on-mobile tbody td[colspan] { display:block !important; text-align:center !important; }
  .stack-on-mobile tbody td[colspan]::before { display:none; }
  .stack-on-mobile .progress { min-width:0; }
  .stack-on-mobile .status-preview,
  .stack-on-mobile .status-badge { max-width:100%; white-space:normal; text-align:center; }

  /* Leads du jour: no 680px table on a 360px phone. */
  .leads-day-table { min-width:0 !important; table-layout:auto !important; }
  .leads-day-table tbody td:last-child { min-width:0 !important; }
  .leads-day-table .lead-day-number-cell { display:none !important; }
  .leads-day-table tbody td:nth-child(1) { display:none !important; }
  .leads-day-table tbody td:nth-child(2)::before { content:"Nom"; }
  .leads-day-table tbody td:nth-child(3)::before { content:"Téléphone"; }
  .leads-day-table tbody td:nth-child(4)::before { content:"Ville"; }
  .leads-day-table tbody td:nth-child(5)::before { content:"Projet"; }
  .leads-day-table tbody td:nth-child(6)::before { content:"Statut"; }
  .leads-day-table tbody td:nth-child(7)::before { content:"Actions"; }
  .leads-day-table tbody td:nth-child(7) .d-flex { justify-content:flex-start !important; width:100%; }
  .leads-day-table tbody td:nth-child(7) .btn { flex:1 1 120px; }

  /* Keep the commercial 7-day board readable; a dedicated mobile board is shown below. */
  .commercial-planning-board > .table-responsive { display:none; }
  .commercial-planning-mobile { display:block !important; }

  /* Agenda desktop grid is replaced by a vertical day-by-day agenda. */
  .agenda-calendar { display:none; }
  .agenda-mobile-days { display:block !important; }
}

@media (min-width: 768px) {
  .commercial-planning-mobile, .agenda-mobile-days { display:none !important; }
}

/* Mobile page headers and filters */
@media (max-width: 767.98px) {
  .page-heading,
  .lead-page-header,
  .planning-page > .d-flex:first-child,
  .agenda-page > .d-flex:first-child {
    gap:10px !important; margin-bottom:12px !important;
  }
  .page-heading > .d-flex,
  .lead-page-header > .d-flex,
  .planning-page > .d-flex:first-child > .d-flex,
  .agenda-page > .d-flex:first-child > .d-flex {
    width:100%; flex-wrap:wrap; gap:7px !important;
  }
  .page-heading .btn,
  .lead-page-header .btn,
  .planning-page > .d-flex:first-child .btn,
  .agenda-page > .d-flex:first-child .btn { flex:1 1 140px; }
  .planning-toolbar .row > [class*="col-"],
  .planning-page .planning-toolbar .row > [class*="col-"] { width:100%; }
  .planning-toolbar .row > [class*="col-"] .btn { flex:1 1 0; }
  .lead-page-header h2 { line-height:1.12; overflow-wrap:anywhere; }
  .lead-page-header > div:first-child { width:100%; }
  .lead-page-header > .d-flex { width:100%; }
  .lead-page-header > .d-flex .btn { flex:1 1 0; }
  .lead-save-bar { gap:8px !important; padding:9px 10px !important; }
  .lead-save-bar .btn { width:100%; }
  .callback-current { flex-direction:column; align-items:stretch; gap:9px; }
  .compact-callback .lead-details-inline { width:100%; }
  .lead-page .row { --bs-gutter-x:.55rem; --bs-gutter-y:.55rem; }
  .lead-page .form-control, .lead-page .form-select { min-height:40px; }

  .energy-page-banner { box-shadow:0 5px 18px rgba(5,35,55,.08); }
  .energy-page-banner-content > div:first-child { min-width:0; }
  .energy-banner-title, .energy-banner-subtitle, .energy-eyebrow { overflow-wrap:anywhere; }

  .card-header.d-flex { align-items:flex-start !important; }
  .card-header.d-flex > * { min-width:0; }
  .card-header.d-flex .btn,
  .card-header.d-flex .btn-group,
  .card-header.d-flex form { flex:0 1 auto; max-width:100%; }
  .card-header.d-flex form .form-select { min-width:125px; }

  .alert { padding:9px 11px; font-size:12px; overflow-wrap:anywhere; }
  .badge { white-space:normal; overflow-wrap:anywhere; }
  .status-preview { white-space:normal !important; overflow-wrap:anywhere; }
  .form-text { overflow-wrap:anywhere; }
  .note { padding:10px; }
}

/* Small-phone precision */
@media (max-width: 480px) {
  .mobile-nav-panel { top:55px; max-height:calc(100dvh - 63px); }
  .mobile-header-notification .notification-dropdown { top:55px; }
  main.container { padding-top:10px !important; }
  .energy-page-banner-content { padding:10px 11px !important; }
  .energy-banner-title { font-size:16px !important; }
  .energy-banner-subtitle { font-size:10px !important; }
  .energy-eyebrow { font-size:8px !important; }
  .card-header { min-height:40px; }
  .card-header.d-flex { gap:7px !important; }
  .card-header.d-flex > div:first-child { flex:1 1 100%; }
  .card-header.d-flex > .btn,
  .card-header.d-flex > form,
  .card-header.d-flex > .btn-group { width:100%; }
  .card-header.d-flex > form .form-select { width:100%; }
  .btn { min-height:36px; }
  .stack-on-mobile tbody tr { padding:7px 8px; }
  .stack-on-mobile tbody td { grid-template-columns:76px minmax(0,1fr); font-size:12px; }
  .stack-on-mobile tbody td::before { font-size:9px; }
  .stack-on-mobile tbody td .btn { flex:1 1 100px; }
  .qcm-section-summary { padding:8px 9px !important; }
  .qcm-section-summary-main { min-width:0; }
  .qcm-section-content { padding:9px !important; }
  .qcm-question-options-row .form-check { padding:9px 10px !important; }
  .status-editor-head { display:none !important; }
  .status-row { grid-template-columns:1fr !important; }
  .status-row .status-actions { justify-content:flex-start !important; flex-wrap:wrap; }
  .status-row .status-actions > * { flex:1 1 110px; }
}

/* Login v34: true viewport layout, no hidden 900px canvas on phones. */
body.login-vector-page {
  width:100%; min-width:0; max-width:100vw; overflow:hidden;
}
.login-scene { width:100%; height:100%; overflow:hidden; }
.login-landscape { width:100%; height:100%; max-width:none; display:block; }
@media (max-width: 800px) {
  body.login-vector-page { min-height:100svh; height:auto; overflow-x:hidden; overflow-y:auto; }
  .login-scene { position:fixed; inset:0; width:100vw; height:100svh; }
  .login-landscape { position:absolute; inset:0; width:100%; height:100%; min-width:0 !important; transform:none !important; }
  .login-scene-shade { position:absolute; inset:0; }
  .login-layout {
    position:relative; inset:auto; z-index:5; min-height:100svh; height:auto;
    display:flex; align-items:center; justify-content:center;
    padding:72px 14px 92px; pointer-events:none;
  }
  .login-panel {
    width:min(390px,100%); min-width:0; max-width:100%; padding:18px 15px 16px;
    border:1px solid rgba(255,255,255,.28); border-radius:18px;
    background:rgba(3,28,50,.30); box-shadow:0 18px 55px rgba(0,0,0,.20);
    backdrop-filter:blur(9px);
  }
  .login-slogan { display:block; position:absolute; left:14px; right:14px; top:18px; z-index:6; margin:0; padding:0; max-width:none; text-align:center; }
  .login-slogan h1 { font-size:clamp(24px,7vw,31px); line-height:1.03; text-shadow:0 3px 14px rgba(0,0,0,.32); }
  .login-slogan p, .login-slogan i { display:none; }
  .login-brand { margin-bottom:11px; }
  .login-logo { width:min(165px,62vw); max-height:72px; }
  .login-form { gap:8px; }
  .login-form label { width:100%; font-size:12px; }
  .login-input-wrap, .login-submit { width:100%; }
  .login-input-wrap { height:46px; }
  .login-input-wrap>span.login-input-icon { width:42px; flex-basis:42px; font-size:16px; }
  .login-input-wrap input { font-size:14px; }
  .login-submit { height:48px; font-size:14px; }
  .login-powered { margin-top:15px; font-size:10px; gap:8px; }
  .login-powered b { width:30px; }
  .login-features { position:fixed; left:8px; right:8px; bottom:10px; width:auto; transform:none; }
  .login-features>div { min-width:0; flex:1; padding:0 5px; }
  .login-features span { font-size:21px; margin-bottom:4px; }
  .login-features small { font-size:6px; letter-spacing:.08em; }
  .login-corner-top, .login-corner-bottom { display:none; }
}
@media (max-width: 380px) {
  .login-layout { padding:64px 10px 82px; }
  .login-panel { padding:14px 11px 13px; border-radius:15px; }
  .login-slogan { top:13px; }
  .login-slogan h1 { font-size:23px; }
  .login-logo { width:145px; }
  .login-features { bottom:7px; }
  .login-features span { font-size:19px; }
  .login-features small { font-size:5.5px; }
}

/* Mobile agenda / commercial planning views */
.agenda-mobile-days { display:none; }
.agenda-mobile-day {
  margin-bottom:9px; border:1px solid #dfe7ed; border-radius:12px;
  overflow:hidden; background:#fff; box-shadow:0 2px 8px rgba(20,45,65,.05);
}
.agenda-mobile-day > header,
.commercial-mobile-day > header {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 11px; background:#f5f8fa; border-bottom:1px solid #e7edf1;
}
.agenda-mobile-day > header span,
.commercial-mobile-day > header span { display:block; font-size:10px; color:#708090; text-transform:uppercase; font-weight:800; letter-spacing:.06em; }
.agenda-mobile-day > header strong,
.commercial-mobile-day > header strong { display:block; font-size:15px; color:#17364f; }
.agenda-mobile-day > header small,
.commercial-mobile-day > header small { color:#718096; font-size:10px; }
.agenda-mobile-day.is-today > header,
.commercial-mobile-day.is-today > header { background:#eaf8f4; }
.agenda-mobile-events { padding:8px; }
.agenda-mobile-event {
  display:block; margin-bottom:7px; padding:9px 10px; border-radius:9px;
  text-decoration:none; border-left:4px solid #0d6efd; overflow:hidden;
}
.agenda-mobile-event:last-child { margin-bottom:0; }
.agenda-mobile-event strong,
.agenda-mobile-event span,
.agenda-mobile-event small { display:block; overflow-wrap:anywhere; }
.agenda-mobile-event strong { font-size:12px; line-height:1.25; }
.agenda-mobile-event span { margin-top:2px; font-size:11px; }
.agenda-mobile-event small { margin-top:2px; font-size:10px; opacity:.8; }
.agenda-mobile-event.is-neutral { background:#f1f3f5; color:#212529; border:1px solid #d8dde2; border-left-width:4px; }
.agenda-mobile-event.is-callback { background:#fff8e7; color:#684b00; border-left-color:#e4a11b; }
.agenda-mobile-empty { padding:12px 4px; color:#8a97a5; text-align:center; font-size:11px; }

.commercial-planning-mobile { display:none; }
.commercial-mobile-day { margin-bottom:9px; border:1px solid #dfe7ed; border-radius:12px; overflow:hidden; background:#fff; }
.commercial-mobile-day-body { padding:8px; }
.commercial-mobile-person { padding:8px; margin-bottom:7px; border:1px solid #e5ebef; border-radius:10px; background:#fbfcfd; }
.commercial-mobile-person:last-child { margin-bottom:0; }
.commercial-mobile-person-head { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:7px; }
.commercial-mobile-person-head strong { color:#17364f; font-size:12px; overflow-wrap:anywhere; }
.commercial-mobile-person-head span { flex:0 0 auto; font-size:9px; color:#64748b; background:#eef2f5; border-radius:999px; padding:3px 7px; }
.commercial-mobile-rdv { display:grid; grid-template-columns:48px minmax(0,1fr); column-gap:7px; padding:7px 8px; margin-top:5px; border:1px solid #dfe7ed; border-left:4px solid #198754; border-radius:8px; text-decoration:none; }
.commercial-mobile-rdv strong { grid-row:1 / span 2; font-size:12px; }
.commercial-mobile-rdv span { font-size:11px; font-weight:700; overflow-wrap:anywhere; }
.commercial-mobile-rdv small { grid-column:2; font-size:9px; opacity:.75; overflow-wrap:anywhere; }
.commercial-mobile-empty { padding:13px 5px; text-align:center; color:#8a97a5; font-size:11px; }

@media (max-width: 991.98px) {
  .desktop-header-menu { display:none !important; }
  .mobile-header-actions {
    display:flex; align-items:center; justify-content:flex-end; gap:6px;
    margin-left:auto; flex:0 0 auto;
  }
  .mobile-header-actions .header-notification-btn { min-width:36px; width:36px; padding:6px !important; }
  .mobile-nav-trigger { min-width:68px; }
  .crm-navbar .container-fluid { flex-wrap:nowrap !important; }
  .crm-navbar .navbar-brand { min-width:0; max-width:calc(100vw - 160px); }
}
@media (max-width: 480px) {
  .crm-navbar .navbar-brand { max-width:calc(100vw - 146px); }
  .mobile-header-actions { gap:4px; }
  .mobile-nav-trigger { min-width:62px; padding-inline:8px; }
}
.header-logo, .login-logo, .branding-preview-logo img {
  display:block; object-fit:contain; object-position:center;
}
.header-logo { width:auto; max-height:42px; }

@media (max-width: 767.98px) {
  main.container > .d-flex.justify-content-between.align-items-center:first-child {
    flex-wrap:wrap !important; align-items:flex-start !important; gap:9px !important;
  }
  main.container > .d-flex.justify-content-between.align-items-center:first-child > :first-child { min-width:0; flex:1 1 100%; }
  main.container > .d-flex.justify-content-between.align-items-center:first-child > .btn,
  main.container > .d-flex.justify-content-between.align-items-center:first-child > a.btn { flex:1 1 100%; width:100%; }
  .lead-page-header > .d-flex { flex-wrap:wrap; }
  .lead-page-header > .d-flex .btn { min-width:0; }
  .role-setting-row .row { row-gap:8px !important; }
  .role-setting-row .col-md-5,
  .role-setting-row .col-md-4,
  .role-setting-row .col-md-3 { width:100%; }
  #roles-save-state { min-width:0 !important; width:100%; text-align:left !important; }
  #save-roles-btn { width:100%; }
  .import-card .d-flex.justify-content-between { flex-wrap:wrap; }
  .import-card .d-flex.justify-content-between > * { width:100%; }
  .import-card .d-flex.justify-content-end { flex-direction:column; }
  .import-card .d-flex.justify-content-end .btn { width:100%; }
}

/* Final visibility order: mobile alternatives win over desktop grids. */
@media (max-width: 767.98px) {
  .agenda-calendar { display:none !important; }
  .agenda-mobile-days { display:block !important; }
  .commercial-planning-board > .table-responsive { display:none !important; }
  .commercial-planning-mobile { display:block !important; }
}
@media (min-width: 768px) {
  .agenda-mobile-days, .commercial-planning-mobile { display:none !important; }
}
@media (max-width: 767.98px) {
  .table-responsive > .stack-on-mobile,
  .table-responsive > table.stack-on-mobile,
  .stack-on-mobile { min-width:0 !important; width:100% !important; }
}
.branding-preview-logo { background:linear-gradient(135deg,#071d31,#0d4264) !important; }


/* =========================================================
   GRC ÉNERGIES — RESPONSIVE PREMIUM v35
   Final corrective layer based on real mobile screenshots.
   ========================================================= */

/* Branding: use the verified raster fallback, with a stable intrinsic ratio. */
.header-logo,
.login-logo,
.branding-preview-logo img {
  display:block;
  object-fit:contain;
  object-position:center;
}
.header-logo { width:150px; height:auto; max-height:42px; }

/* Mobile navbar: fixed 3-zone layout, never a horizontally scrolling menu. */
@media (max-width: 991.98px) {
  .crm-navbar,
  .crm-navbar .container-fluid { overflow:visible !important; }
  .crm-navbar .container-fluid {
    display:flex !important;
    align-items:center !important;
    flex-wrap:nowrap !important;
    gap:8px !important;
    padding:7px 10px !important;
  }
  .crm-navbar .navbar-brand {
    flex:1 1 auto !important;
    min-width:0 !important;
    max-width:none !important;
    margin-right:0 !important;
    overflow:hidden;
  }
  .header-logo { width:124px !important; height:auto !important; max-width:100% !important; max-height:34px !important; }
  .mobile-header-actions {
    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    gap:7px !important;
    flex:0 0 auto !important;
    width:auto !important;
    margin-left:auto !important;
  }
  .mobile-header-actions .header-notifications,
  .mobile-header-actions .mobile-nav-menu { flex:0 0 auto !important; }
  .mobile-header-actions .header-notification-btn,
  .mobile-nav-trigger {
    width:42px !important;
    min-width:42px !important;
    height:42px !important;
    min-height:42px !important;
    padding:0 !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    line-height:1 !important;
    font-size:18px !important;
    border-radius:11px !important;
  }
  .mobile-nav-trigger { width:68px !important; min-width:68px !important; gap:5px !important; font-size:12px !important; }
  .mobile-nav-trigger-icon { font-size:18px !important; }
  .notification-count { top:-5px !important; right:-5px !important; min-width:19px !important; height:19px !important; }

  .mobile-nav-panel {
    top:56px !important;
    left:10px !important;
    right:10px !important;
    width:auto !important;
    max-height:none !important;
    overflow:visible !important;
    padding:8px !important;
    border-radius:14px !important;
  }
  .mobile-nav-panel-head { padding:6px 7px 8px !important; margin-bottom:3px !important; }
  .mobile-nav-panel > a {
    min-height:36px !important;
    padding:7px 9px !important;
    margin:2px 0 !important;
    font-size:12px !important;
    line-height:1.2 !important;
  }
  .mobile-nav-section { margin:7px 5px 3px !important; padding-top:6px !important; font-size:8px !important; }
  .mobile-nav-logout-form { margin-top:6px !important; padding-top:6px !important; }
  .mobile-nav-logout { min-height:38px !important; }
}

@media (max-width:480px) {
  .crm-navbar .container-fluid { gap:6px !important; padding:6px 8px !important; }
  .header-logo { width:112px !important; max-height:30px !important; }
  .mobile-header-actions { gap:5px !important; }
  .mobile-header-actions .header-notification-btn { width:40px !important; min-width:40px !important; height:40px !important; min-height:40px !important; }
  .mobile-nav-trigger { width:62px !important; min-width:62px !important; height:40px !important; min-height:40px !important; }
  .mobile-nav-panel { top:52px !important; left:8px !important; right:8px !important; }
}

/* Planning global: mobile is one selected day at a time, not seven huge blocks. */
.planning-mobile-day-tabs { display:none; }
@media (max-width:767.98px) {
  .planning-mobile-day-tabs {
    display:grid !important;
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:4px;
    padding:8px 9px 7px;
    border-bottom:1px solid #e7edf1;
    background:#fbfcfd;
  }
  .planning-mobile-day-tab {
    min-width:0;
    min-height:44px;
    padding:5px 2px;
    border:1px solid #d9e2e9;
    border-radius:9px;
    background:#fff;
    color:#5f7081;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    line-height:1.05;
    cursor:pointer;
  }
  .planning-mobile-day-tab span { font-size:8px; font-weight:800; text-transform:uppercase; }
  .planning-mobile-day-tab strong { font-size:14px; margin-top:3px; color:#17364f; }
  .planning-mobile-day-tab.is-active { background:#0d314d; border-color:#0d314d; color:#fff; box-shadow:0 3px 8px rgba(13,49,77,.18); }
  .planning-mobile-day-tab.is-active strong { color:#fff; }
  .planning-day-block.mobile-day-hidden { display:none !important; }
  .planning-page .planning-appointment-card {
    grid-template-columns:56px minmax(0,1fr) !important;
    gap:8px !important;
    padding:10px !important;
    align-items:start !important;
  }
  .planning-page .planning-main { min-width:0 !important; }
  .planning-page .planning-main > .d-flex { align-items:flex-start !important; }
  .planning-page .planning-main > .d-flex > a { min-width:0; overflow-wrap:anywhere; line-height:1.2; }
  .planning-page .planning-meta { display:flex !important; flex-direction:column !important; align-items:flex-start !important; gap:3px !important; margin-top:6px !important; font-size:11px !important; }
  .planning-page .planning-meta span { max-width:100%; overflow-wrap:anywhere; }
  .planning-page .planning-address { font-size:11px !important; line-height:1.3; overflow-wrap:anywhere; }
  .planning-page .planning-actions {
    grid-column:1 / -1 !important;
    width:100% !important;
    min-width:0 !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,auto) minmax(0,auto) !important;
    gap:6px !important;
    align-items:stretch !important;
  }
  .planning-page .planning-actions form {
    display:flex !important;
    min-width:0 !important;
    width:100% !important;
    gap:5px !important;
  }
  .planning-page .planning-actions form .form-select { min-width:0 !important; flex:1 1 auto !important; width:100% !important; font-size:11px !important; }
  .planning-page .planning-actions .btn { min-width:0 !important; width:auto !important; min-height:36px !important; padding:7px 9px !important; white-space:normal !important; line-height:1.1 !important; }
  .planning-page .planning-actions form .btn { flex:0 0 auto !important; }
  .planning-page .planning-actions > a.btn { align-self:stretch; }
}

/* Lead action journal: stack author/date instead of pushing the date off-screen. */
.lead-action-log-row { min-width:0; }
.lead-action-log-main { min-width:0; overflow-wrap:anywhere; }
.lead-action-log-meta { flex:0 0 auto; max-width:45%; text-align:right; white-space:normal; overflow-wrap:anywhere; }
@media (max-width:767.98px) {
  .lead-action-log-row {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:4px !important;
    padding:9px 0 !important;
  }
  .lead-action-log-meta {
    max-width:none !important;
    text-align:left !important;
    font-size:10px !important;
    line-height:1.25;
  }
  .lead-action-log-main { font-size:12px !important; line-height:1.35; }
  .lead-action-log-main .small { font-size:10px !important; }
}

/* All checkboxes: visible, centered, tappable controls instead of Bootstrap's negative-margin checkbox. */
.qcm-choice,
.qcm-admin-check,
.permission-check,
.delete-confirm-check,
.status-restrict-toggle {
  position:relative;
}
.qcm-choice,
.qcm-admin-check,
.permission-check {
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  min-width:0 !important;
  min-height:42px !important;
  padding:9px 12px !important;
  cursor:pointer;
}
.qcm-choice .form-check-input,
.qcm-admin-check .form-check-input,
.permission-check .form-check-input {
  float:none !important;
  margin:0 !important;
  flex:0 0 24px !important;
  width:24px !important;
  height:24px !important;
  min-width:24px !important;
  min-height:24px !important;
  border:2px solid #aebdca !important;
  border-radius:7px !important;
  accent-color:#2563eb;
  box-shadow:none !important;
  cursor:pointer;
}
.qcm-choice .form-check-input:checked,
.qcm-admin-check .form-check-input:checked,
.permission-check .form-check-input:checked {
  background-color:#2563eb !important;
  border-color:#2563eb !important;
}
.qcm-choice .form-check-label,
.qcm-admin-check .form-check-label,
.permission-check .form-check-label { min-width:0; overflow-wrap:anywhere; }
@media (max-width:767.98px) {
  .qcm-choice,
  .qcm-admin-check,
  .permission-check { min-height:44px !important; padding:9px 10px !important; gap:9px !important; }
  .qcm-choice .form-check-input,
  .qcm-admin-check .form-check-input,
  .permission-check .form-check-input {
    flex-basis:26px !important; width:26px !important; height:26px !important; min-width:26px !important; min-height:26px !important;
  }
  .qcm-choice { font-size:13px !important; }
  .qcm-admin-check { font-size:12px !important; }
  .permission-check { font-size:13px !important; }
}

/* Admin employees: compact closed drawer on phones, open by default on larger screens. */
.admin-employees-details { width:100%; }
.admin-employees-summary {
  list-style:none;
  cursor:pointer;
  display:flex !important;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.admin-employees-summary::-webkit-details-marker { display:none; }
.admin-employees-summary::after { content:'＋'; color:#64748b; font-size:20px; line-height:1; }
.admin-employees-details[open] .admin-employees-summary::after { content:'−'; }
.admin-employees-count { font-size:11px; color:#64748b; font-weight:600; margin-left:auto; }
@media (min-width:768px) {
  .admin-employees-details[open] .admin-employees-summary::after { content:'−'; }
}
@media (max-width:767.98px) {
  .admin-employees-card { overflow:hidden; }
  .admin-employees-summary { min-height:48px; padding:12px !important; }
  .admin-employees-details > .table-responsive { max-height:none; }
  .admin-employees-details .table { font-size:11px; }
}

/* Installation list: the extra Telepro column remains useful on desktop and stacks cleanly on phones. */
.installations-table { width:100%; }
@media (max-width:767.98px) {
  .installations-table .status-preview { display:inline-flex; max-width:100%; }
}

/* Login: genuinely centered on the viewport; no sideways page movement on iPhone/iPad. */
@media (max-width:800px) {
  html:has(body.login-vector-page),
  body.login-vector-page {
    width:100% !important;
    max-width:100vw !important;
    min-width:0 !important;
    height:100% !important;
    min-height:100dvh !important;
    overflow:hidden !important;
  }
  .login-scene {
    position:fixed !important;
    inset:0 !important;
    width:100vw !important;
    height:100dvh !important;
  }
  .login-landscape {
    position:absolute !important;
    inset:0 !important;
    width:100% !important;
    height:100% !important;
    min-width:0 !important;
    max-width:none !important;
    transform:none !important;
  }
  .login-layout {
    position:fixed !important;
    inset:0 !important;
    width:100vw !important;
    height:100dvh !important;
    min-height:0 !important;
    padding:74px 14px 72px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    overflow:hidden !important;
  }
  .login-panel {
    width:min(390px,100%) !important;
    max-width:100% !important;
    min-width:0 !important;
    max-height:calc(100dvh - 146px) !important;
    padding:15px 14px 14px !important;
    overflow:hidden !important;
  }
  .login-slogan { top:16px !important; left:10px !important; right:10px !important; padding:0 !important; }
  .login-slogan h1 { font-size:clamp(22px,6.5vw,30px) !important; }
  .login-brand { margin-bottom:9px !important; }
  .login-logo { width:min(160px,58vw) !important; max-width:100% !important; max-height:60px !important; }
  .login-form { gap:7px !important; }
  .login-form label { font-size:11px !important; }
  .login-input-wrap { height:44px !important; }
  .login-submit { height:46px !important; }
  .login-powered { margin-top:10px !important; font-size:9px !important; }
  .login-features { left:7px !important; right:7px !important; bottom:7px !important; width:auto !important; }
}
@media (max-width:380px) {
  .login-layout { padding:68px 9px 65px !important; }
  .login-panel { padding:12px 10px !important; max-height:calc(100dvh - 133px) !important; }
  .login-slogan { top:11px !important; }
  .login-slogan h1 { font-size:22px !important; }
  .login-logo { width:142px !important; max-height:54px !important; }
}

/* Generic long-content protection on mobile. */
@media (max-width:767.98px) {
  main.container { width:100% !important; max-width:100% !important; }
  .card, .lead-card, .stat-card, .mini-stat, .permission-box, .status-editor, .qcm-section-card { min-width:0 !important; }
  .card-header, .card-body, .card-footer, .lead-card-body { overflow-wrap:anywhere; }
  .btn { max-width:100%; overflow-wrap:anywhere; }
  input, select, textarea { max-width:100%; }
  .table-responsive { max-width:100vw !important; }
}

/* =========================================================
   GRC INTELLIGENCE — responsive product layer
   ========================================================= */
.ai-nav-btn { background: linear-gradient(135deg,#0b7a75,#116c91) !important; border-color:#2a9eb1 !important; }
.mobile-nav-ai { background:linear-gradient(135deg,#0b7a75,#116c91) !important; color:#fff !important; border-color:#2a9eb1 !important; font-weight:800; }
.ai-engine-status { display:inline-flex; align-items:center; gap:7px; padding:7px 10px; border:1px solid #d9e3eb; border-radius:999px; background:#f8fbfd; font-size:12px; color:#526579; }
.ai-status-dot { width:9px; height:9px; border-radius:50%; background:#94a3b8; flex:none; }
.ai-status-dot.is-on { background:#10b981; box-shadow:0 0 0 4px rgba(16,185,129,.12); }
.ai-page-head { display:flex; justify-content:space-between; align-items:center; gap:18px; margin-bottom:18px; }
.ai-page-head h2 { font-weight:850; letter-spacing:-.02em; }
.ai-briefing-card, .ai-dashboard-card, .ai-admin-card, .ai-lead-card { border-color:#d8e3ec !important; box-shadow:0 8px 28px rgba(14,35,55,.06); }
.ai-briefing-observations > div { padding:7px 10px; border-radius:10px; background:#f4f8fb; margin-bottom:6px; overflow-wrap:anywhere; }
.ai-panel { height:100%; border:1px solid #dbe5ec; border-radius:14px; padding:14px; background:#fff; }
.ai-panel-success { background:linear-gradient(180deg,#f8fffc,#fff); }
.ai-panel-danger { background:linear-gradient(180deg,#fffafa,#fff); }
.ai-panel h5 { font-size:15px; margin-bottom:10px; font-weight:800; }
.ai-lead-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 0; border-top:1px solid #e7edf2; text-decoration:none; color:#172235; }
.ai-lead-row:first-of-type { border-top:0; }
.ai-lead-row span { min-width:0; display:flex; flex-direction:column; }
.ai-lead-row small { color:#718096; margin-top:2px; overflow-wrap:anywhere; }
.ai-lead-row b { flex:none; min-width:46px; text-align:center; padding:6px 8px; border-radius:10px; background:#132132; color:#fff; }
.ai-anomaly-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.ai-anomaly-card { border:1px solid #e0e8ef; border-radius:12px; padding:12px; min-width:0; background:#fbfdff; }
.ai-anomaly-card span,.ai-anomaly-card small { display:block; color:#718096; overflow-wrap:anywhere; }
.ai-anomaly-value { font-size:24px; font-weight:850; margin:8px 0 4px; }
.ai-feature { height:100%; border:1px solid #e1e8ee; border-radius:12px; padding:14px; background:#fbfdff; }
.ai-feature b,.ai-feature span { display:block; }
.ai-feature span { margin-top:5px; color:#6b7d8e; font-size:13px; line-height:1.45; overflow-wrap:anywhere; }
.ai-score-badge { display:inline-flex; align-items:center; justify-content:center; padding:7px 11px; border-radius:999px; background:#122235; color:#fff; font-size:12px; font-weight:800; }
.ai-lead-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.ai-list { list-style:none; padding:0; margin:0; }
.ai-list li { padding:7px 9px; border-radius:8px; background:#f5faf7; margin-bottom:5px; overflow-wrap:anywhere; }
.ai-list-risk li { background:#fff8f7; }
.ai-memory-box { border:1px solid #dce6ed; background:#f8fbfd; border-radius:10px; padding:10px 12px; color:#405466; overflow-wrap:anywhere; }
.ai-prewrap { white-space:pre-wrap; line-height:1.5; }
.ai-call-row { display:flex; justify-content:space-between; gap:14px; padding:12px 0; border-bottom:1px solid #e5ebf0; }
.ai-call-row:last-child { border-bottom:0; }
.ai-call-main { min-width:0; flex:1 1 auto; }
.ai-call-main > div { overflow-wrap:anywhere; }
.ai-call-actions { flex:0 0 auto; display:flex; flex-wrap:wrap; gap:6px; align-items:flex-start; }

/* Make the existing navigation genuinely compact on narrow screens. */
@media (max-width:767.98px) {
  .crm-navbar { min-height:58px !important; }
  .crm-navbar .container-fluid { min-height:58px !important; padding:5px 9px !important; gap:7px; }
  .crm-navbar .navbar-brand { flex:1 1 auto; min-width:0; max-width:48%; overflow:hidden; }
  .crm-navbar .header-logo { max-width:150px !important; width:auto !important; height:auto !important; max-height:36px !important; object-fit:contain; }
  .mobile-header-actions { flex:0 0 auto !important; display:flex !important; align-items:center !important; gap:7px !important; }
  .mobile-header-notification, .mobile-nav-menu { display:block !important; }
  .header-notification-btn, .mobile-nav-trigger { min-width:52px !important; min-height:44px !important; width:52px !important; padding:0 !important; display:flex !important; align-items:center !important; justify-content:center !important; line-height:1 !important; }
  .header-notification-btn { font-size:21px !important; }
  .mobile-nav-trigger { gap:0 !important; font-size:0 !important; }
  .mobile-nav-trigger-icon { font-size:24px !important; line-height:1 !important; }
  .notification-count { top:-4px !important; right:-4px !important; }
  .mobile-nav-panel { right:0 !important; left:auto !important; width:min(320px,calc(100vw - 18px)) !important; max-height:calc(100dvh - 72px) !important; overflow-y:auto !important; overflow-x:hidden !important; }
  .mobile-nav-panel a, .mobile-nav-logout { min-height:44px !important; display:flex !important; align-items:center !important; }
  .ai-nav-btn { display:none !important; }
  .ai-page-head { align-items:flex-start; flex-direction:column; gap:10px; }
  .ai-engine-status { max-width:100%; overflow-wrap:anywhere; }
  .ai-anomaly-grid { grid-template-columns:1fr 1fr; }
  .ai-lead-grid { grid-template-columns:1fr; gap:8px; }
  .ai-call-row { flex-direction:column; gap:9px; }
  .ai-call-actions { width:100%; }
  .ai-call-actions form { flex:1 1 140px; }
  .ai-call-actions .btn { width:100%; }
  .ai-score-badge { max-width:100%; }
}
@media (max-width:480px) {
  .ai-anomaly-grid { grid-template-columns:1fr; }
  .ai-feature { padding:11px; }
  .ai-panel { padding:11px; }
  .ai-lead-row { align-items:flex-start; }
  .ai-lead-row b { min-width:42px; }
}

.ai-prep-grid,.ai-coaching-grid,.ai-geo-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.ai-prep-card,.ai-coaching-card,.ai-geo-card{display:block;border:1px solid #dfe8ee;border-radius:12px;padding:12px;background:#fbfdff;color:#172235;text-decoration:none;min-width:0}.ai-prep-card:hover{border-color:#7aaebe}.ai-prep-card span,.ai-coaching-card span,.ai-coaching-card small,.ai-geo-card span{display:block;color:#718096;overflow-wrap:anywhere}.ai-prep-card>div,.ai-coaching-card>*,.ai-geo-card>*{overflow-wrap:anywhere}.ai-coaching-card small{margin-top:7px;line-height:1.4}.ai-geo-card{display:flex;flex-direction:column;gap:3px}.ai-geo-card b{font-size:22px}
@media (max-width:767.98px){.ai-prep-grid,.ai-coaching-grid,.ai-geo-grid{grid-template-columns:1fr}.ai-prep-card,.ai-coaching-card,.ai-geo-card{padding:11px}}
.ai-dashboard-list { border:1px solid #e0e8ef; border-radius:12px; padding:10px 12px; background:#fbfdff; }
.ai-dashboard-list > a { display:flex; justify-content:space-between; gap:10px; padding:8px 0; border-top:1px solid #e8eef3; text-decoration:none; color:#172235; min-width:0; }
.ai-dashboard-list > a:first-of-type { border-top:0; }
.ai-dashboard-list > a strong { min-width:0; overflow-wrap:anywhere; }
.ai-dashboard-list > a span { flex:none; font-weight:800; color:#0f5f68; }
@media (max-width:767.98px) { .ai-dashboard-list { padding:9px 10px; } }

/* GRC v37 — adresse : afficher proprement plusieurs homonymes */
.address-suggestions {
  max-height: min(420px, 58vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.address-suggestion-main,
.address-suggestion-type {
  overflow-wrap: anywhere;
}

/* V38 — menus d'en-tête : un seul sous-menu ouvert à la fois,
   et empilement déterministe pour éviter tout croisement Planning/Admin. */
.header-menu-group { position:relative; z-index:20; }
.header-menu-group[open] { z-index:2050; }
.header-menu-group[open] > .header-dropdown { z-index:2051; }
.header-menu-group > .header-dropdown { white-space:nowrap; }
.header-menu-group + .header-menu-group { margin-left:2px; }

/* V38 — la liste d'adresses doit pouvoir sortir de la carte sans être rognée. */
.lead-card:has(.address-autocomplete-wrap) {
  overflow:visible !important;
  position:relative;
  z-index:30;
}
.lead-card:has(.address-autocomplete-wrap) .lead-card-body,
.lead-card:has(.address-autocomplete-wrap) .row,
.lead-card:has(.address-autocomplete-wrap) .address-autocomplete-wrap {
  overflow:visible !important;
}
.address-autocomplete-wrap { z-index:40; }
.address-suggestions {
  z-index:5000 !important;
  max-height:min(420px, 55vh);
  overflow-y:auto;
  overscroll-behavior:contain;
}
.address-suggestion { min-height:46px; }
@media (max-width:767.98px) {
  .address-suggestions {
    position:fixed;
    left:10px; right:10px;
    top:auto;
    max-height:46vh;
    border-radius:12px;
  }
  .address-suggestion { padding:11px 12px; }
}

/* V39 — Planning global : boutons d'action propres, compacts et non cassés. */
.planning-page .planning-actions {
  display:grid !important;
  grid-template-columns:minmax(165px,1fr) 76px 76px !important;
  gap:6px !important;
  align-items:stretch !important;
  min-width:290px;
}
.planning-page .planning-action-form {
  display:grid !important;
  grid-template-columns:minmax(120px,1fr) 76px !important;
  gap:6px !important;
  min-width:0;
  margin:0;
}
.planning-page .planning-action-form .form-select,
.planning-page .planning-action-btn {
  min-width:0 !important;
  width:100% !important;
  height:44px !important;
  min-height:44px !important;
  margin:0 !important;
  border-radius:10px !important;
  font-size:12px !important;
  font-weight:800 !important;
  line-height:1.1 !important;
  white-space:nowrap !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:7px 8px !important;
}
.planning-page .planning-action-form .form-select {
  border:1px solid #cfdbe5 !important;
  background:#f8fbfd !important;
  color:#17364f !important;
  text-overflow:ellipsis;
}
.planning-page .planning-action-assign { background:#102b40 !important; color:#fff !important; border:1px solid #102b40 !important; }
.planning-page .planning-action-file { background:#fff !important; color:#102b40 !important; border:1px solid #102b40 !important; }
.planning-page .planning-action-maps { background:#f4f8fb !important; color:#466175 !important; border:1px solid #aebdca !important; }
.planning-page .planning-action-btn:hover { transform:translateY(-1px); box-shadow:0 3px 8px rgba(16,43,64,.12); }

/* V39 — Les suggestions d'adresse sont ancrées au champ par JS, hors des conteneurs qui pourraient les rogner. */
.address-suggestions {
  position:fixed !important;
  display:none;
  z-index:100000 !important;
  max-height:min(440px,52vh) !important;
  overflow-y:auto !important;
  overscroll-behavior:contain;
  background:#fff !important;
  border:1px solid #cbd8e2 !important;
  border-radius:12px !important;
  box-shadow:0 14px 36px rgba(15,42,61,.22) !important;
}
.address-suggestions.is-open { display:block !important; }
.address-suggestion-header {
  position:sticky; top:0; z-index:1;
  display:flex; flex-direction:column; gap:2px;
  padding:10px 12px;
  background:#f6f9fb;
  border-bottom:1px solid #e2e9ee;
  color:#17364f;
  font-size:12px;
}
.address-suggestion-header span { color:#718096; font-weight:500; }
.address-suggestion { min-height:52px !important; padding:9px 12px !important; }
.address-suggestion-main { font-weight:700; line-height:1.25; }
.address-suggestion-type { font-size:.76rem; margin-top:3px; }

@media (max-width:767.98px) {
  .planning-page .planning-actions {
    grid-template-columns:1fr 1fr 1fr !important;
    gap:6px !important;
    min-width:0 !important;
  }
  .planning-page .planning-action-form {
    grid-column:1 / -1 !important;
    grid-template-columns:minmax(0,1fr) minmax(92px,110px) !important;
    gap:6px !important;
  }
  .planning-page .planning-action-form .form-select,
  .planning-page .planning-action-btn {
    height:42px !important;
    min-height:42px !important;
    font-size:11px !important;
    padding:6px 7px !important;
  }
  .planning-page .planning-action-file,
  .planning-page .planning-action-maps { grid-column:auto !important; }
  .address-suggestions {
    max-height:50vh !important;
    border-radius:12px !important;
  }
}
@media (max-width:480px) {
  .planning-page .planning-actions { grid-template-columns:1fr 1fr !important; }
  .planning-page .planning-action-form { grid-column:1 / -1 !important; grid-template-columns:1fr !important; }
  .planning-page .planning-action-form .planning-action-assign { width:100% !important; }
  .planning-page .planning-action-file, .planning-page .planning-action-maps { min-width:0 !important; }
}

/* V40 — Poste Commercial : journée, rapport de vente et progression */
.commercial-command-center{
  border:1px solid #d8e4ec;
  border-radius:16px;
  background:linear-gradient(180deg,#ffffff,#f8fbfd);
  padding:18px;
  box-shadow:0 8px 26px rgba(14,35,55,.06);
}
.commercial-command-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:14px}
.commercial-command-head h3{margin:2px 0 4px;font-weight:850;letter-spacing:-.02em}
.commercial-command-head p{margin:0;color:#6b7d8e;font-size:14px}
.commercial-command-head.compact{margin-bottom:12px}
.commercial-day-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.commercial-day-card{display:grid;grid-template-columns:58px minmax(0,1fr) auto;align-items:center;gap:10px;padding:11px 12px;border:1px solid #dce7ee;border-radius:12px;background:#fff;color:#172235;text-decoration:none;min-width:0}
.commercial-day-card:hover{border-color:#7eb9cb;box-shadow:0 4px 14px rgba(16,43,64,.08)}
.commercial-day-time{font-size:18px;font-weight:850;color:#0d5872}
.commercial-day-main{min-width:0;display:flex;flex-direction:column;gap:2px}
.commercial-day-main strong,.commercial-day-main span,.commercial-day-main small{overflow-wrap:anywhere}
.commercial-day-main span{font-size:12px;color:#566c7e}
.commercial-day-main small{font-size:11px;color:#7a8a98}
.commercial-day-score{flex:none;min-width:48px;text-align:center;border-radius:999px;padding:6px 7px;background:#122235;color:#fff;font-size:11px;font-weight:800}
.commercial-day-empty{grid-column:1/-1;text-align:center;padding:18px;color:#7a8a98;border:1px dashed #cbd9e3;border-radius:12px}
.commercial-route-result{margin-top:12px;padding:12px;border:1px solid #dbe7ee;border-radius:12px;background:#f8fbfd;overflow-wrap:anywhere}
.commercial-route-list{margin:8px 0 6px;padding-left:22px}
.commercial-route-list li{padding:4px 0}
.commercial-route-list small{display:block;color:#718096;font-size:11px}
.commercial-profile-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.commercial-profile-stat{padding:13px;border:1px solid #dfe8ee;border-radius:12px;background:#fff;text-align:center}
.commercial-profile-stat span{display:block;color:#6d7e8e;font-size:11px;font-weight:700}
.commercial-profile-stat strong{display:block;font-size:25px;margin-top:3px;color:#122235}
.commercial-strengths-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
.commercial-strengths-grid>div{display:flex;flex-direction:column;gap:5px;padding:12px;border-radius:12px;border:1px solid #dfe8ee;background:#fff;min-width:0}
.commercial-strengths-grid strong{font-size:13px}
.commercial-strengths-grid span{font-size:12px;color:#617486;overflow-wrap:anywhere}
.sales-report-card{border-color:#d8e4ec!important}
.sales-report-form .form-label{font-size:13px}
.sales-report-form textarea{min-height:120px;resize:vertical}
.sales-report-hint{font-size:12px;color:#708191}
.sales-report-status{display:inline-flex;align-items:center;justify-content:center;color:#fff;border-radius:999px;padding:7px 11px;font-size:12px;font-weight:800;white-space:nowrap}
.sales-report-meta{display:grid;grid-template-columns:auto 1fr auto 1fr;gap:4px 10px;align-items:center;padding-bottom:10px;border-bottom:1px solid #e5edf2}
.sales-report-meta span{font-size:11px;color:#718096;text-transform:uppercase;letter-spacing:.05em;font-weight:800}
.sales-report-meta strong{font-size:13px;overflow-wrap:anywhere}
.sales-report-summary,.sales-report-next{margin-top:12px;padding:11px 12px;border:1px solid #e1e9ee;border-radius:10px;background:#fbfdff;overflow-wrap:anywhere}
.sales-report-summary strong,.sales-report-next strong{display:block;margin-bottom:4px}
.sales-report-summary div,.sales-report-next div{white-space:pre-wrap;line-height:1.5;color:#43586a}
.sales-status-editor{margin-top:8px}
.sales-status-editor .status-row{grid-template-columns:minmax(0,1.4fr) minmax(180px,1fr) auto}
.sales-status-editor .status-access{display:none}
.sales-status-editor .status-actions{min-width:150px}

@media(max-width:767.98px){
  .commercial-command-center{padding:13px;border-radius:13px}
  .commercial-command-head{align-items:stretch;flex-direction:column;gap:10px}
  .commercial-command-head .btn{width:100%}
  .commercial-day-grid{grid-template-columns:1fr}
  .commercial-day-card{grid-template-columns:50px minmax(0,1fr) auto;padding:10px}
  .commercial-day-time{font-size:16px}
  .commercial-profile-grid{grid-template-columns:1fr 1fr 1fr;gap:6px}
  .commercial-profile-stat{padding:10px 5px}
  .commercial-profile-stat strong{font-size:21px}
  .commercial-strengths-grid{grid-template-columns:1fr}
  .sales-report-meta{grid-template-columns:1fr 1fr}
  .sales-status-editor .status-row{grid-template-columns:1fr;gap:8px}
  .sales-status-editor .status-actions{min-width:0;display:grid;grid-template-columns:1fr auto}
  .sales-status-editor .status-actions .status-preview{min-width:0}
}
@media(max-width:480px){
  .commercial-profile-grid{grid-template-columns:1fr}
  .commercial-day-card{grid-template-columns:48px minmax(0,1fr);}
  .commercial-day-score{grid-column:2;justify-self:start}
  .sales-report-meta{grid-template-columns:1fr}
  .sales-report-status{max-width:100%;overflow-wrap:anywhere;white-space:normal;text-align:center}
}

/* V40 — cases à cocher administratives : vraie cible tactile, sans découpe */
.permission-check,.status-restrict-toggle,.delete-confirm-check{
  display:flex!important;align-items:center;gap:10px;min-height:46px;padding:8px 10px!important;border:1px solid #d7e1e8;border-radius:10px;background:#fff;cursor:pointer;overflow-wrap:anywhere;
}
.permission-check .form-check-input,.status-restrict-toggle input,.delete-confirm-check input{
  float:none!important;margin:0!important;flex:0 0 26px;width:26px!important;height:26px!important;min-width:26px;min-height:26px;accent-color:#287be8;cursor:pointer;
}
.permission-check{font-size:14px}
.permission-box .row{row-gap:7px}
.sales-status-editor .drag-handle{width:34px;height:34px;flex:none}
@media(max-width:767.98px){
  .permission-check,.status-restrict-toggle{min-height:52px;font-size:15px;padding:9px 10px!important}
  .permission-check .form-check-input,.status-restrict-toggle input{flex-basis:28px;width:28px!important;height:28px!important;min-width:28px;min-height:28px}
  .sales-status-editor .status-row{padding:10px}
  .sales-status-editor .status-name-wrap{min-width:0}
  .sales-status-editor .status-name{min-width:0}
}

/* Aperçu du créneau en cours d'édition : le RDV enregistré est exclu de l'API
   et cette carte représente la nouvelle date/heure avant l'enregistrement. */
.week-appointment-draft{
  border:2px dashed #2563eb !important;
  border-left:5px solid #2563eb !important;
  background:#eff6ff !important;
  color:#1e3a8a !important;
  z-index:3;
  box-shadow:0 2px 6px rgba(37,99,235,.16);
}
.week-appointment-draft small{color:#315b9d !important}

/* V43 — Mode sombre global, persistant et responsive */
.theme-toggle{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  min-height:38px;padding:7px 11px;border-radius:9px;border:1px solid #4e5965;
  background:#202a34;color:#fff;font-weight:700;font-size:13px;line-height:1;cursor:pointer;
  white-space:nowrap;box-shadow:none;
}
.theme-toggle:hover,.theme-toggle:focus{background:#2d3946;color:#fff;border-color:#718096;outline:none}
.theme-toggle.is-dark{background:#f2c94c;color:#17202a;border-color:#d8a900}
.header-theme-toggle{margin:0 2px}
.mobile-theme-toggle{width:100%;min-height:46px;margin:8px 0;background:#1d2a38}
.login-theme-toggle{position:fixed;top:18px;right:18px;z-index:50}

html[data-theme="dark"],html[data-theme="dark"] body{background:#0d141b;color:#e6edf3}
html[data-theme="dark"] body{color:#e6edf3}
html[data-theme="dark"] .crm-navbar{background:#08121c!important;border-bottom-color:#244050!important}
html[data-theme="dark"] .energy-page-banner{border-bottom-color:#244050}
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .status-box,
html[data-theme="dark"] .note,
html[data-theme="dark"] .permission-box,
html[data-theme="dark"] .planning-day-block,
html[data-theme="dark"] .commercial-profile-stat,
html[data-theme="dark"] .commercial-strengths-grid>div,
html[data-theme="dark"] .sales-report-card,
html[data-theme="dark"] .branding-panel,
html[data-theme="dark"] .branding-preview,
html[data-theme="dark"] .branding-upload,
html[data-theme="dark"] .admin-branding-card .card-header,
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .header-dropdown,
html[data-theme="dark"] .notification-dropdown,
html[data-theme="dark"] .week-grid-wrap,
html[data-theme="dark"] .agenda-modal,
html[data-theme="dark"] .login-card{
  background:#151e27!important;color:#e6edf3!important;border-color:#30404e!important;
}
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .status-editor-head,
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .bg-light{
  background:#1b2732!important;color:#e6edf3!important;border-color:#30404e!important;
}
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] small,
html[data-theme="dark"] .mini-stat span,
html[data-theme="dark"] .sales-report-hint,
html[data-theme="dark"] .notification-empty,
html[data-theme="dark"] .form-text,
html[data-theme="dark"] .text-secondary{color:#9fb0bf!important}
html[data-theme="dark"] label,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .form-check-label{color:#dce6ee!important}
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select{
  background:#0f1821!important;color:#e8f0f6!important;border-color:#3a4d5d!important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#8193a3!important}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus{border-color:#5aa9e6!important;box-shadow:0 0 0 .2rem rgba(90,169,230,.16)!important}
html[data-theme="dark"] .btn-outline-dark{color:#e6edf3!important;border-color:#718096!important}
html[data-theme="dark"] .btn-outline-secondary{color:#b8c6d1!important;border-color:#718096!important}
html[data-theme="dark"] .btn-light{background:#263441!important;color:#e6edf3!important;border-color:#435666!important}
html[data-theme="dark"] .dropdown-item{color:#dfe8ef!important}
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus{background:#263746!important;color:#fff!important}
html[data-theme="dark"] .header-user{color:#b9c7d2!important}
html[data-theme="dark"] .notification-item{background:transparent!important;color:#dce6ee!important}
html[data-theme="dark"] .notification-item:hover{background:#202e3a!important}
html[data-theme="dark"] .status-row + .status-row{border-top-color:#30404e}
html[data-theme="dark"] .status-editor{border-color:#30404e}
html[data-theme="dark"] .branding-upload:hover{background:#1d2a35}
html[data-theme="dark"] .commercial-profile-stat strong{color:#e9f2f8}
html[data-theme="dark"] .commercial-strengths-grid span,
html[data-theme="dark"] .sales-report-summary div,
html[data-theme="dark"] .sales-report-next div{color:#b9c8d3}
html[data-theme="dark"] .sales-report-summary,
html[data-theme="dark"] .sales-report-next{background:#101922;border-color:#30404e}
html[data-theme="dark"] .table,
html[data-theme="dark"] .table> :not(caption)>*>*{color:#dce6ee;border-color:#30404e;background-color:transparent}
html[data-theme="dark"] .table-striped>tbody>tr:nth-of-type(odd)>*{background:#18232d;color:#e6edf3}
html[data-theme="dark"] .table-hover>tbody>tr:hover>*{background:#22313d;color:#fff}
html[data-theme="dark"] a{color:#69b7ff}
html[data-theme="dark"] .mobile-nav-panel{background:#121d27!important;color:#e6edf3;border-color:#33495a!important}
html[data-theme="dark"] .mobile-nav-panel a{color:#e1ebf2!important}
html[data-theme="dark"] .mobile-nav-panel a:hover{background:#21313e!important}
html[data-theme="dark"] .mobile-nav-section{color:#7fa0b8!important}
html[data-theme="dark"] .mobile-nav-panel-head{border-bottom-color:#30404e!important}
html[data-theme="dark"] .login-page{background:#09121a!important}
html[data-theme="dark"] .login-card{box-shadow:0 20px 60px rgba(0,0,0,.42)!important}
html[data-theme="dark"] .login-vector-page:before{opacity:.82}
html[data-theme="dark"] .login-vector-page .login-card{background:rgba(12,20,28,.94)!important}
html[data-theme="dark"] .password-dialog{background:#151e27;color:#e6edf3}
html[data-theme="dark"] .password-dialog::backdrop{background:rgba(0,0,0,.68)}
html[data-theme="dark"] .week-appointment-draft{background:#102b45!important;color:#b9dcff!important;border-color:#3d91e8!important}
html[data-theme="dark"] .week-appointment-draft small{color:#9fc9f2!important}

@media(max-width:767.98px){
  .header-theme-toggle{display:none}
  .login-theme-toggle{top:12px;right:12px;min-height:42px;padding:8px 10px}
  .mobile-theme-toggle{display:flex}
}
@media(min-width:768px){.mobile-theme-toggle{display:none}}

/* V44 — Refonte complète du thème sombre.
   Objectif : aucun texte sombre sur surface sombre/blanche accidentelle,
   tout en conservant les couleurs métier (statuts, départements, alertes). */
html[data-theme="dark"] {
  color-scheme: dark;
  --dark-bg: #0a1118;
  --dark-surface: #121c25;
  --dark-surface-2: #17232e;
  --dark-surface-3: #1d2b37;
  --dark-border: #304454;
  --dark-border-soft: #263846;
  --dark-text: #f2f7fb;
  --dark-text-2: #d6e2ea;
  --dark-muted: #9eb0bf;
  --dark-link: #73c0ff;
}

html[data-theme="dark"] body,
html[data-theme="dark"] main,
html[data-theme="dark"] .container,
html[data-theme="dark"] .container-fluid,
html[data-theme="dark"] .content,
html[data-theme="dark"] .page-content {
  color: var(--dark-text) !important;
}

/* Titres et textes génériques : priorité haute contre les anciennes couleurs claires. */
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] p,
html[data-theme="dark"] li,
html[data-theme="dark"] dt,
html[data-theme="dark"] dd,
html[data-theme="dark"] strong,
html[data-theme="dark"] b,
html[data-theme="dark"] .fw-bold,
html[data-theme="dark"] .fw-semibold,
html[data-theme="dark"] .fw-medium {
  color: var(--dark-text) !important;
}

html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .text-body,
html[data-theme="dark"] .text-black,
html[data-theme="dark"] [class*="text-dark"] {
  color: var(--dark-text) !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-secondary,
html[data-theme="dark"] .text-body-secondary,
html[data-theme="dark"] .form-text,
html[data-theme="dark"] small,
html[data-theme="dark"] .small {
  color: var(--dark-muted) !important;
}

html[data-theme="dark"] a:not(.btn):not(.header-menu-btn):not(.header-notification-btn) {
  color: var(--dark-link) !important;
}

/* Toutes les surfaces principales */
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .status-box,
html[data-theme="dark"] .note,
html[data-theme="dark"] .permission-box,
html[data-theme="dark"] .planning-toolbar,
html[data-theme="dark"] .planning-day-block,
html[data-theme="dark"] .lead-card,
html[data-theme="dark"] .lead-save-bar,
html[data-theme="dark"] .lead-info-box,
html[data-theme="dark"] .lead-last-call,
html[data-theme="dark"] .commercial-profile-stat,
html[data-theme="dark"] .commercial-strengths-grid > div,
html[data-theme="dark"] .commercial-mobile-day,
html[data-theme="dark"] .commercial-mobile-person,
html[data-theme="dark"] .sales-report-card,
html[data-theme="dark"] .ai-panel,
html[data-theme="dark"] .ai-feature,
html[data-theme="dark"] .ai-anomaly-card,
html[data-theme="dark"] .ai-dashboard-list,
html[data-theme="dark"] .ai-memory-box,
html[data-theme="dark"] .ai-prep-card,
html[data-theme="dark"] .ai-coaching-card,
html[data-theme="dark"] .ai-geo-card,
html[data-theme="dark"] .branding-panel,
html[data-theme="dark"] .branding-preview,
html[data-theme="dark"] .branding-upload,
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .week-grid-wrap,
html[data-theme="dark"] .agenda-modal,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .password-dialog {
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}

html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .lead-card-title,
html[data-theme="dark"] .status-editor-head,
html[data-theme="dark"] .status-editor > header,
html[data-theme="dark"] .admin-section-head,
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-white {
  background: var(--dark-surface-2) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}

/* Les zones qui étaient encore blanches dans les captures Boss. */
html[data-theme="dark"] .mini-stat,
html[data-theme="dark"] .ai-briefing-observations > div,
html[data-theme="dark"] .ai-list li,
html[data-theme="dark"] .ai-list-risk li,
html[data-theme="dark"] .commercial-mobile-rdv,
html[data-theme="dark"] .commercial-route-result,
html[data-theme="dark"] .commercial-day-card,
html[data-theme="dark"] .commercial-mobile-person-head span,
html[data-theme="dark"] .planning-dept-item,
html[data-theme="dark"] .notification-list,
html[data-theme="dark"] .notification-actions,
html[data-theme="dark"] .address-suggestion,
html[data-theme="dark"] .address-suggestion-list,
html[data-theme="dark"] .address-results,
html[data-theme="dark"] .address-autocomplete-results {
  background: var(--dark-surface-2) !important;
  color: var(--dark-text-2) !important;
  border-color: var(--dark-border) !important;
}

html[data-theme="dark"] .ai-panel-success { background: linear-gradient(180deg,#102b27,#121c25) !important; }
html[data-theme="dark"] .ai-panel-danger { background: linear-gradient(180deg,#301b21,#121c25) !important; }
html[data-theme="dark"] .ai-briefing-observations > div { color: var(--dark-text-2) !important; }
html[data-theme="dark"] .ai-lead-row,
html[data-theme="dark"] .ai-dashboard-list > a {
  color: var(--dark-text) !important;
  border-color: var(--dark-border-soft) !important;
}
html[data-theme="dark"] .ai-lead-row small,
html[data-theme="dark"] .ai-dashboard-list > a span,
html[data-theme="dark"] .ai-feature span,
html[data-theme="dark"] .ai-anomaly-card span,
html[data-theme="dark"] .ai-anomaly-card small,
html[data-theme="dark"] .commercial-day-main span,
html[data-theme="dark"] .commercial-day-main small,
html[data-theme="dark"] .commercial-mobile-day > header span,
html[data-theme="dark"] .commercial-mobile-day > header small,
html[data-theme="dark"] .commercial-mobile-empty,
html[data-theme="dark"] .commercial-route-list small {
  color: var(--dark-muted) !important;
}
html[data-theme="dark"] .ai-score-badge,
html[data-theme="dark"] .ai-lead-row b,
html[data-theme="dark"] .commercial-day-score {
  background: #0b1722 !important;
  color: #f7fbff !important;
}

/* Dashboard : chiffres, titres et cartes doivent rester lisibles. */
html[data-theme="dark"] .dashboard-title,
html[data-theme="dark"] .dashboard-subtitle,
html[data-theme="dark"] .dashboard-section-title,
html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .mini-stat strong,
html[data-theme="dark"] .mini-stat span {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .mini-stat {
  background: var(--dark-surface-2) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .mini-stat span { color: var(--dark-muted) !important; }

/* Fiches leads : les champs et textes ne doivent jamais reprendre les couleurs claires. */
html[data-theme="dark"] .lead-card-body,
html[data-theme="dark"] .lead-main-form,
html[data-theme="dark"] .lead-section-grid,
html[data-theme="dark"] .lead-details-inline,
html[data-theme="dark"] .lead-details,
html[data-theme="dark"] .lead-sub-actions,
html[data-theme="dark"] .lead-action-log-row,
html[data-theme="dark"] .lead-action-log-main,
html[data-theme="dark"] .lead-action-log-meta {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .lead-card-title,
html[data-theme="dark"] .lead-details-inline > summary,
html[data-theme="dark"] .lead-details > summary,
html[data-theme="dark"] .lead-info-box {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .lead-info-box {
  background: #102332 !important;
  border-color: #2f82b8 !important;
}
html[data-theme="dark"] .lead-last-call { background: #18252f !important; color: var(--dark-text-2) !important; }

/* Formulaires : labels, champs, selects et checkboxes. */
html[data-theme="dark"] label,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .form-check-label,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] legend {
  color: var(--dark-text-2) !important;
}
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  background: #0d1720 !important;
  color: #f1f6fa !important;
  border-color: #3b5263 !important;
  caret-color: #fff !important;
}
html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"] {
  accent-color: #4aa3ff !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #8196a7 !important; opacity: 1 !important; }
html[data-theme="dark"] input:disabled,
html[data-theme="dark"] select:disabled,
html[data-theme="dark"] textarea:disabled {
  background: #18232d !important;
  color: #9eb0bf !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus {
  background: #0e1a24 !important;
  color: #fff !important;
  border-color: #5eb4ff !important;
  box-shadow: 0 0 0 .2rem rgba(94,180,255,.18) !important;
}

/* Boutons : le texte ne doit plus hériter d'un noir invisible. */
html[data-theme="dark"] .btn,
html[data-theme="dark"] button:not(.theme-toggle),
html[data-theme="dark"] .header-menu-btn,
html[data-theme="dark"] .header-notification-btn {
  text-shadow: none;
}
html[data-theme="dark"] .btn-outline-dark,
html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] .btn-outline-info,
html[data-theme="dark"] .btn-outline-success,
html[data-theme="dark"] .btn-outline-warning,
html[data-theme="dark"] .btn-outline-danger {
  background: transparent !important;
}
html[data-theme="dark"] .btn-outline-dark { color:#f2f7fb !important; border-color:#8195a5 !important; }
html[data-theme="dark"] .btn-outline-secondary { color:#dce7ef !important; border-color:#718596 !important; }
html[data-theme="dark"] .btn-outline-primary { color:#73c0ff !important; border-color:#438fc7 !important; }
html[data-theme="dark"] .btn-outline-success { color:#63e6b1 !important; border-color:#2b9c72 !important; }
html[data-theme="dark"] .btn-outline-warning { color:#ffd66b !important; border-color:#b48b22 !important; }
html[data-theme="dark"] .btn-outline-danger { color:#ff8f9b !important; border-color:#c94d5b !important; }
html[data-theme="dark"] .btn-light { background:#263542 !important; color:#f2f7fb !important; border-color:#465c6d !important; }
html[data-theme="dark"] .btn-dark { background:#07111a !important; color:#fff !important; border-color:#3c5263 !important; }
html[data-theme="dark"] .btn-link { color:#73c0ff !important; }

/* Tables : en particulier journal de contrôle et listes admin. */
html[data-theme="dark"] .table,
html[data-theme="dark"] .table caption,
html[data-theme="dark"] .table thead,
html[data-theme="dark"] .table tbody,
html[data-theme="dark"] .table tfoot {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .table > :not(caption) > * > * {
  color: var(--dark-text-2) !important;
  background-color: transparent !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .table > thead > * > * {
  color: #f4f8fb !important;
  background: var(--dark-surface-2) !important;
}
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background: #15212b !important;
  color: #f0f5f8 !important;
}
html[data-theme="dark"] .table-hover > tbody > tr:hover > * {
  background: #20313e !important;
  color: #fff !important;
}

/* Administration / éditeur de statuts. */
html[data-theme="dark"] .status-editor,
html[data-theme="dark"] .status-row,
html[data-theme="dark"] .status-editor-head {
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .status-row { background: var(--dark-surface) !important; }
html[data-theme="dark"] .status-row-protected { background: linear-gradient(90deg,#17242d,#123126) !important; }
html[data-theme="dark"] .status-row-protected .status-name { color:#9ff0bd !important; }
html[data-theme="dark"] .status-editor .status-name,
html[data-theme="dark"] .status-editor .status-hex,
html[data-theme="dark"] .status-editor .permission-check,
html[data-theme="dark"] .status-editor .status-restrict-toggle,
html[data-theme="dark"] .status-access,
html[data-theme="dark"] .permission-box,
html[data-theme="dark"] .permission-box * {
  color: var(--dark-text-2) !important;
}
html[data-theme="dark"] .status-restrict-toggle:has(input:checked),
html[data-theme="dark"] .permission-check:has(input:checked) {
  background:#12352e !important;
  border-color:#2f9e7a !important;
  color:#b9f4dc !important;
}
html[data-theme="dark"] .drag-handle { color:#a9bfce !important; }

/* Employés / admin : éviter les textes noirs dans les cartes repliables. */
html[data-theme="dark"] .admin-employees-details,
html[data-theme="dark"] .admin-employees-summary,
html[data-theme="dark"] .admin-employees-count {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .admin-employees-summary { background:var(--dark-surface-2) !important; border-color:var(--dark-border) !important; }
html[data-theme="dark"] .admin-employees-count { color:var(--dark-muted) !important; }

/* Menus et notifications. */
html[data-theme="dark"] .header-dropdown,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .notification-dropdown,
html[data-theme="dark"] .mobile-nav-panel {
  background:#111c25 !important;
  color:#eef5f9 !important;
  border-color:#3b5364 !important;
  box-shadow:0 16px 40px rgba(0,0,0,.45) !important;
}
html[data-theme="dark"] .header-dropdown a,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .notification-item,
html[data-theme="dark"] .mobile-nav-panel a {
  color:#eaf2f7 !important;
}
html[data-theme="dark"] .header-dropdown a:hover,
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .notification-item:hover,
html[data-theme="dark"] .mobile-nav-panel a:hover {
  background:#213542 !important;
  color:#fff !important;
}
html[data-theme="dark"] .dropdown-title { color:#f4f8fb !important; }
html[data-theme="dark"] .notification-empty { color:#9eb0bf !important; }

/* Planning et agendas : textes, jours, cellules et créneaux. */
html[data-theme="dark"] .planning-day-title,
html[data-theme="dark"] .planning-day-title span,
html[data-theme="dark"] .planning-day-title strong,
html[data-theme="dark"] .planning-time,
html[data-theme="dark"] .planning-meta,
html[data-theme="dark"] .planning-address,
html[data-theme="dark"] .commercial-name-col,
html[data-theme="dark"] .commercial-name-cell {
  color: var(--dark-text-2) !important;
}
html[data-theme="dark"] .planning-day-title { background:#17232e !important; border-color:var(--dark-border) !important; }
html[data-theme="dark"] .planning-appointment-card { border-color:var(--dark-border-soft) !important; }
html[data-theme="dark"] .commercial-day-cell,
html[data-theme="dark"] .planning-today-cell,
html[data-theme="dark"] .planning-today-col {
  background:#101a23 !important;
  color:#eaf2f7 !important;
}
html[data-theme="dark"] .commercial-planning-table th,
html[data-theme="dark"] .commercial-planning-table td { border-color:#2d414f !important; }
html[data-theme="dark"] .commercial-rdv-card { color:#f4f8fb !important; background:#182630 !important; }
html[data-theme="dark"] .commercial-rdv-card small { color:#b1c1cd !important; }
html[data-theme="dark"] .commercial-free-slot { color:#8da1b0 !important; }

/* Les badges de statut/RDV gardent leur couleur métier et leur contraste calculé inline. */
html[data-theme="dark"] .status-preview,
html[data-theme="dark"] .sales-report-status,
html[data-theme="dark"] .badge,
html[data-theme="dark"] .status-pill,
html[data-theme="dark"] [class*="status-badge"] {
  filter:none !important;
}

/* Address autocomplete : résultats visibles, sans blanc parasite. */
html[data-theme="dark"] .address-suggestions,
html[data-theme="dark"] .address-suggestion-list {
  background:#111c25 !important;
  border-color:#3b5364 !important;
  box-shadow:0 14px 32px rgba(0,0,0,.38) !important;
}
html[data-theme="dark"] .address-suggestion,
html[data-theme="dark"] .address-suggestion-header {
  color:#eaf2f7 !important;
  background:#111c25 !important;
  border-color:#2d414f !important;
}
html[data-theme="dark"] .address-suggestion:hover { background:#1e3340 !important; }
html[data-theme="dark"] .address-suggestion-header span { color:#9eb0bf !important; }

/* Modal / dialog */
html[data-theme="dark"] dialog,
html[data-theme="dark"] dialog::backdrop {
  color-scheme:dark;
}
html[data-theme="dark"] dialog,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .agenda-modal {
  background:#121c25 !important;
  color:#f2f7fb !important;
  border-color:#344b5c !important;
}
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer { border-color:#304454 !important; }

/* Évite les anciennes règles inline de couleur de texte des composants non sémantiques. */
html[data-theme="dark"] .crm-role-public .card,
html[data-theme="dark"] .crm-role-boss .card,
html[data-theme="dark"] .crm-role-confirmateur .card,
html[data-theme="dark"] .crm-role-telepro .card,
html[data-theme="dark"] .crm-role-commercial .card {
  color:var(--dark-text) !important;
}

/* Bannière et navigation restent contrastées. */
html[data-theme="dark"] .crm-navbar {
  background:#061019 !important;
  color:#fff !important;
  border-bottom-color:#294454 !important;
}
html[data-theme="dark"] .header-user { color:#cbd9e2 !important; }
html[data-theme="dark"] .header-menu-btn,
html[data-theme="dark"] .header-notification-btn { color:#fff !important; }

/* Login : texte et champs lisibles sur le fond sombre. */
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .login-card h1,
html[data-theme="dark"] .login-card h2,
html[data-theme="dark"] .login-card h3,
html[data-theme="dark"] .login-card p,
html[data-theme="dark"] .login-card label,
html[data-theme="dark"] .login-card .form-label {
  color:#f3f8fb !important;
}
html[data-theme="dark"] .login-card .form-control,
html[data-theme="dark"] .login-card input {
  background:#0b151e !important;
  color:#f4f8fb !important;
  border-color:#425a6b !important;
}

/* Lien/texte de confirmation dans les zones colorées */
html[data-theme="dark"] .alert { color:#edf5f8 !important; border-color:#405767 !important; }
html[data-theme="dark"] .alert-light { background:#1c2a34 !important; color:#eaf2f7 !important; }
html[data-theme="dark"] .alert-info { background:#102b3a !important; color:#bce8ff !important; }
html[data-theme="dark"] .alert-success { background:#123128 !important; color:#baf2d9 !important; }
html[data-theme="dark"] .alert-warning { background:#382d12 !important; color:#ffe49a !important; }
html[data-theme="dark"] .alert-danger { background:#3b1820 !important; color:#ffb0ba !important; }

/* Petites finitions mobile : aucun composant ne force un fond clair. */
@media(max-width:767.98px){
  html[data-theme="dark"] .mobile-nav-panel,
  html[data-theme="dark"] .mobile-header-actions,
  html[data-theme="dark"] .mobile-nav-menu,
  html[data-theme="dark"] .mobile-header-notification { color:#f2f7fb !important; }
  html[data-theme="dark"] .theme-toggle.is-dark { color:#17202a !important; }
}

/* =========================================================
   V45 — DARK MODE FINAL / MOBILE HARDENING
   Contrat visuel pour les prochaines fonctionnalités :
   - surface sombre, texte clair, bordure contrastée
   - aucun fond Bootstrap clair ne doit rester visible
   - contrôles tactiles >= 42px sur mobile
   - couleurs métier (statuts/départements) conservées
   ========================================================= */
html[data-theme="dark"] .lead-page-header {
  background: linear-gradient(135deg, #16232d, #12212b) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .lead-page-header h2,
html[data-theme="dark"] .lead-page-header .small,
html[data-theme="dark"] .lead-page-header p {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .planning-page .table,
html[data-theme="dark"] .agenda-page .table {
  background: var(--dark-surface) !important;
}

/* Import wizard : la dropzone et les métriques ne doivent jamais redevenir blanches. */
html[data-theme="dark"] .import-card,
html[data-theme="dark"] .import-preview,
html[data-theme="dark"] .import-assignment-box,
html[data-theme="dark"] .import-duplicate-box,
html[data-theme="dark"] .import-summary > div {
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .import-step {
  color: var(--dark-muted) !important;
  border-bottom-color: var(--dark-border) !important;
}
html[data-theme="dark"] .import-step span,
html[data-theme="dark"] .import-upload-icon {
  background: var(--dark-surface-3) !important;
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .import-step.active {
  color: var(--dark-text) !important;
  border-bottom-color: #73c0ff !important;
}
html[data-theme="dark"] .import-step.active span {
  background: #e6edf3 !important;
  color: #0b1620 !important;
}
html[data-theme="dark"] .import-dropzone {
  background: #0e1821 !important;
  color: var(--dark-text) !important;
  border-color: #4b6476 !important;
}
html[data-theme="dark"] .import-dropzone:hover {
  background: #142531 !important;
  border-color: #73c0ff !important;
}
html[data-theme="dark"] .import-dropzone small,
html[data-theme="dark"] .import-summary span,
html[data-theme="dark"] .import-metric span {
  color: var(--dark-muted) !important;
}
html[data-theme="dark"] .import-metric {
  background: var(--dark-surface-2) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .import-success-icon {
  background: #e6edf3 !important;
  color: #0b1620 !important;
}

/* QCM administration : structure verticale fiable sur tablette + téléphone. */
html[data-theme="dark"] .qcm-questions > [data-question] {
  background: var(--dark-surface) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .qcm-questions > [data-question] .bg-white,
html[data-theme="dark"] .qcm-questions > [data-question] .bg-light {
  background: var(--dark-surface-2) !important;
  color: var(--dark-text) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .qcm-admin-check {
  background: #1b2a35 !important;
  color: var(--dark-text-2) !important;
  border-color: #4b6171 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 46px !important;
  justify-content: flex-start !important;
  white-space: normal !important;
}
html[data-theme="dark"] .qcm-admin-check:hover {
  background: #223542 !important;
  border-color: #6a8799 !important;
}
html[data-theme="dark"] .qcm-admin-check .form-check-label {
  color: var(--dark-text-2) !important;
  flex: 1 1 auto;
}
html[data-theme="dark"] .qcm-admin-check:has(input:checked) {
  background: #123a31 !important;
  border-color: #2fbf91 !important;
  color: #c8f7e7 !important;
}
html[data-theme="dark"] .qcm-admin-check:has(input:checked) .form-check-label {
  color: #c8f7e7 !important;
}

/* Statuts : l'état NON coché était blanc avec un texte clair. */
html[data-theme="dark"] .status-restrict-toggle {
  background: #1a2731 !important;
  color: #dce7ef !important;
  border-color: #4a6070 !important;
}
html[data-theme="dark"] .status-restrict-toggle:hover {
  background: #223440 !important;
  border-color: #6b8495 !important;
}
html[data-theme="dark"] .status-restrict-toggle input {
  accent-color: #4aa3ff !important;
}
html[data-theme="dark"] .status-restrict-toggle:has(input:checked) {
  background: #123a31 !important;
  border-color: #2fbf91 !important;
  color: #c8f7e7 !important;
}
html[data-theme="dark"] .status-restrict-toggle:has(input:checked) span {
  color: #c8f7e7 !important;
}

/* Permissions génériques : même logique que le toggle des statuts. */
html[data-theme="dark"] .permission-check,
html[data-theme="dark"] .delete-confirm-check {
  background: #1a2731 !important;
  color: #dce7ef !important;
  border-color: #4a6070 !important;
}
html[data-theme="dark"] .permission-check:has(input:checked),
html[data-theme="dark"] .delete-confirm-check:has(input:checked) {
  background: #123a31 !important;
  color: #c8f7e7 !important;
  border-color: #2fbf91 !important;
}

/* QCM admin : à <= 991px, chaque champ occupe toute la ligne. */
@media (max-width: 991.98px) {
  .qcm-questions > [data-question] .row > [class*="col-"] {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  .qcm-questions > [data-question] .qcm-admin-check,
  .qcm-questions > [data-question] .qcm-delete-question {
    width: 100% !important;
  }
}

@media (max-width: 767.98px) {
  .qcm-questions > [data-question] { padding: 10px !important; }
  .qcm-questions > [data-question] .row { --bs-gutter-x: .5rem; --bs-gutter-y: .5rem; }
  .qcm-questions > [data-question] .qcm-admin-check {
    min-height: 44px !important;
    padding: 9px 10px !important;
    font-size: 12px !important;
  }
  .qcm-questions > [data-question] .qcm-admin-check .form-check-input {
    flex: 0 0 24px !important;
    width: 24px !important;
    height: 24px !important;
  }
  .qcm-questions > [data-question] .qcm-delete-question { min-height: 40px !important; }
  .status-restrict-toggle { min-height: 44px !important; width: 100% !important; }
}

/* Bootstrap helpers fréquemment utilisés dans les futures pages. */
html[data-theme="dark"] .bg-body,
html[data-theme="dark"] .bg-body-tertiary,
html[data-theme="dark"] .bg-body-secondary,
html[data-theme="dark"] .bg-secondary-subtle,
html[data-theme="dark"] .bg-primary-subtle,
html[data-theme="dark"] .bg-info-subtle,
html[data-theme="dark"] .bg-success-subtle,
html[data-theme="dark"] .bg-warning-subtle,
html[data-theme="dark"] .bg-danger-subtle {
  color: var(--dark-text) !important;
}
html[data-theme="dark"] .bg-body,
html[data-theme="dark"] .bg-body-tertiary,
html[data-theme="dark"] .bg-body-secondary {
  background-color: var(--dark-surface) !important;
}
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-end,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start {
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .list-group-item {
  background: var(--dark-surface) !important;
  color: var(--dark-text-2) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .list-group-item-action:hover,
html[data-theme="dark"] .list-group-item-action:focus {
  background: var(--dark-surface-3) !important;
  color: #fff !important;
}
html[data-theme="dark"] .nav-tabs,
html[data-theme="dark"] .nav-pills {
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .nav-link {
  color: var(--dark-text-2) !important;
}
html[data-theme="dark"] .nav-link.active {
  background: #1e3a4b !important;
  color: #fff !important;
}
html[data-theme="dark"] .pagination .page-link {
  background: var(--dark-surface) !important;
  color: var(--dark-link) !important;
  border-color: var(--dark-border) !important;
}
html[data-theme="dark"] .pagination .page-item.active .page-link {
  background: #1d6fa5 !important;
  color: #fff !important;
  border-color: #1d6fa5 !important;
}
html[data-theme="dark"] .pagination .page-item.disabled .page-link {
  background: #18232d !important;
  color: #718596 !important;
}

/* Désactivés : conserver une vraie lisibilité, notamment les boutons d'action. */
html[data-theme="dark"] .btn:disabled,
html[data-theme="dark"] .btn.disabled,
html[data-theme="dark"] fieldset:disabled .btn {
  color: #9eafbd !important;
  border-color: #455a69 !important;
  background: #1a252e !important;
  opacity: .78 !important;
}

/* Fallback pour les éléments HTML natifs utilisés par certaines pages. */
html[data-theme="dark"] hr { border-color: var(--dark-border) !important; opacity:1 !important; }
html[data-theme="dark"] code,
html[data-theme="dark"] pre,
html[data-theme="dark"] kbd {
  background: #0b151e !important;
  color: #bfe4ff !important;
  border-color: var(--dark-border) !important;
}

/* =========================================================
   V46 — DARK MODE CONTRASTE / QCM / NOTIFICATIONS
   Dernière passe ciblée sur les zones encore trop claires
   et les contrôles qui perdaient leur lisibilité.
   ========================================================= */
html[data-theme="dark"] .qcm-section-accordion {
  background:#111c25 !important;
  border-color:#344b5c !important;
}
html[data-theme="dark"] .qcm-section-summary {
  background:#1b2732 !important;
  color:#f2f7fb !important;
  border-color:#344b5c !important;
}
html[data-theme="dark"] .qcm-section-summary:hover {
  background:#223440 !important;
}
html[data-theme="dark"] .qcm-section-summary-icon {
  background:#101a23 !important;
  border-color:#405565 !important;
  color:#f4f8fb !important;
}
html[data-theme="dark"] .qcm-section-summary-main,
html[data-theme="dark"] .qcm-section-summary-main > span:first-child {
  color:#f2f7fb !important;
}
html[data-theme="dark"] .qcm-section-summary-main .text-muted,
html[data-theme="dark"] .qcm-section-summary-main .small {
  color:#aebfcb !important;
}
html[data-theme="dark"] .qcm-section-toggle {
  color:#d7e4ec !important;
}
html[data-theme="dark"] .qcm-section-content {
  background:#111c25 !important;
  border-top-color:#344b5c !important;
}
html[data-theme="dark"] .qcm-section-content .fw-semibold,
html[data-theme="dark"] .qcm-section-content .fw-bold {
  color:#eef5f9 !important;
}
html[data-theme="dark"] .qcm-choice {
  background:#172633 !important;
  color:#eef5f9 !important;
  border-color:#405767 !important;
}
html[data-theme="dark"] .qcm-choice:hover {
  background:#203542 !important;
  border-color:#5b7485 !important;
}
html[data-theme="dark"] .qcm-choice .form-check-label {
  color:#eef5f9 !important;
}
html[data-theme="dark"] .qcm-section-content .qcm-precision-textarea {
  background:#0f1821 !important;
  color:#eef5f9 !important;
}

/* QCM administration : vraie grille, sans écraser le bloc "réponse écrite". */
html[data-theme="dark"] .qcm-questions > [data-question] {
  overflow:hidden !important;
}
html[data-theme="dark"] .qcm-questions > [data-question] > .row {
  display:grid !important;
  grid-template-columns:minmax(0,1.35fr) minmax(0,1.35fr) minmax(220px,.9fr) minmax(120px,.55fr) !important;
  gap:12px !important;
  margin:0 !important;
  align-items:end !important;
}
html[data-theme="dark"] .qcm-questions > [data-question] > .row > [class*="col-"] {
  width:auto !important;
  max-width:none !important;
  flex:none !important;
  padding:0 !important;
  min-width:0 !important;
}
html[data-theme="dark"] .qcm-questions > [data-question] .qcm-admin-check {
  min-width:0 !important;
  width:100% !important;
  box-sizing:border-box !important;
  overflow:visible !important;
}
html[data-theme="dark"] .qcm-questions > [data-question] .qcm-admin-check .form-check-label {
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
  line-height:1.3 !important;
}
html[data-theme="dark"] .qcm-questions > [data-question] .qcm-delete-question {
  width:100% !important;
  min-height:46px !important;
}

/* Les helpers Bootstrap clairs utilisés par certaines anciennes zones. */
html[data-theme="dark"] .bg-light-subtle {
  background:#17232e !important;
  color:#e6edf3 !important;
  border-color:#304454 !important;
}
html[data-theme="dark"] .bg-light-subtle .text-muted,
html[data-theme="dark"] .bg-light-subtle small {
  color:#aebfcb !important;
}
html[data-theme="dark"] .bg-light.text-dark,
html[data-theme="dark"] .badge.bg-light.text-dark,
html[data-theme="dark"] .text-bg-light {
  background:#253541 !important;
  color:#edf5f9 !important;
  border-color:#4a6070 !important;
}
html[data-theme="dark"] .card-footer.bg-white {
  background:#151e27 !important;
  color:#aebfcb !important;
  border-color:#30404e !important;
}

/* Notifications : respiration visuelle + zone de lecture confortable. */
html[data-theme="dark"] .notification-list {
  padding:5px 6px !important;
}
html[data-theme="dark"] .notification-item {
  display:block !important;
  margin:6px 0 !important;
  padding:10px 11px !important;
  min-height:44px !important;
  line-height:1.35 !important;
  border:1px solid #344b5c !important;
  border-left-width:3px !important;
  border-radius:9px !important;
  background:#111c25 !important;
  color:#eaf2f7 !important;
}
html[data-theme="dark"] .notification-item:first-child { margin-top:2px !important; }
html[data-theme="dark"] .notification-item:last-child { margin-bottom:2px !important; }
html[data-theme="dark"] .notification-item:hover {
  background:#1d303d !important;
  border-color:#496477 !important;
}
html[data-theme="dark"] .notification-actions {
  margin-top:8px !important;
  padding:9px !important;
  gap:8px !important;
  border-top:1px solid #344b5c !important;
}
html[data-theme="dark"] .notification-actions .btn {
  min-height:38px !important;
}

@media (max-width:1100px) {
  html[data-theme="dark"] .qcm-questions > [data-question] > .row {
    grid-template-columns:1fr !important;
    gap:10px !important;
  }
  html[data-theme="dark"] .qcm-questions > [data-question] .qcm-admin-check,
  html[data-theme="dark"] .qcm-questions > [data-question] .qcm-delete-question {
    width:100% !important;
  }
}

@media (max-width:767.98px) {
  html[data-theme="dark"] .qcm-section-summary {
    min-height:60px !important;
    padding:9px 10px !important;
    gap:9px !important;
  }
  html[data-theme="dark"] .qcm-section-summary-icon {
    width:36px !important;
    min-width:36px !important;
    height:36px !important;
    font-size:20px !important;
  }
  html[data-theme="dark"] .qcm-section-content {
    padding:10px !important;
  }
  html[data-theme="dark"] .qcm-questions > [data-question] {
    padding:10px !important;
  }
  html[data-theme="dark"] .qcm-questions > [data-question] .qcm-admin-check {
    min-height:48px !important;
    padding:10px 11px !important;
    font-size:13px !important;
  }
  html[data-theme="dark"] .qcm-questions > [data-question] .qcm-admin-check .form-check-input {
    flex:0 0 24px !important;
    width:24px !important;
    height:24px !important;
    min-width:24px !important;
  }
  html[data-theme="dark"] .notification-list {
    padding:5px !important;
  }
  html[data-theme="dark"] .notification-item {
    margin:7px 0 !important;
    padding:10px !important;
    font-size:12px !important;
  }
}

html[data-theme="dark"] .travel-explanation {
  background:#17232e !important;
  color:#b9c9d5 !important;
  border-color:#304454 !important;
}
html[data-theme="dark"] .travel-explanation strong { color:#eef5f9 !important; }


/* =========================================================
   V47 — CONTRAT DARK MODE GLOBAL / MOBILE + TABLETTE
   Objectif : zéro surface blanche accidentelle, contraste lisible,
   composants mobiles réellement dimensionnés et contrôles stables.
   ========================================================= */
html[data-theme="dark"] {
  --dark-bg:#09121a;
  --dark-surface:#121c25;
  --dark-surface-2:#182530;
  --dark-surface-3:#1e2d39;
  --dark-border:#385061;
  --dark-border-strong:#50697a;
  --dark-text:#f3f7fb;
  --dark-text-2:#dbe6ee;
  --dark-muted:#9fb2c1;
  --dark-link:#72bfff;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  background-color:var(--dark-bg) !important;
  color:var(--dark-text) !important;
}

/* Neutralise les helpers clairs Bootstrap et les anciennes surfaces métier. */
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .bg-light-subtle,
html[data-theme="dark"] .text-bg-light,
html[data-theme="dark"] .card.bg-white,
html[data-theme="dark"] .card-body.bg-white,
html[data-theme="dark"] .card-header.bg-white,
html[data-theme="dark"] .card-footer.bg-white {
  background:var(--dark-surface-2) !important;
  color:var(--dark-text) !important;
  border-color:var(--dark-border) !important;
}
html[data-theme="dark"] .bg-white *,
html[data-theme="dark"] .bg-light *,
html[data-theme="dark"] .bg-light-subtle * {
  color:inherit;
}

/* Tables : desktop et cartes mobiles. */
html[data-theme="dark"] .table-responsive {
  background:var(--dark-surface) !important;
  color:var(--dark-text) !important;
}
html[data-theme="dark"] .table,
html[data-theme="dark"] .table > :not(caption) > * > * {
  --bs-table-bg:transparent !important;
  --bs-table-accent-bg:transparent !important;
  background-color:transparent !important;
  color:var(--dark-text-2) !important;
  border-color:var(--dark-border) !important;
}
html[data-theme="dark"] .table thead th {
  background:var(--dark-surface-3) !important;
  color:#f6f9fb !important;
  border-color:var(--dark-border-strong) !important;
}
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > *,
html[data-theme="dark"] .table-hover > tbody > tr:hover > * {
  background:var(--dark-surface-2) !important;
  color:var(--dark-text) !important;
}
html[data-theme="dark"] .stack-on-mobile tbody tr {
  background:var(--dark-surface) !important;
  border-color:var(--dark-border) !important;
  box-shadow:0 4px 14px rgba(0,0,0,.18) !important;
}
html[data-theme="dark"] .stack-on-mobile tbody td {
  background:transparent !important;
  color:var(--dark-text-2) !important;
  border-bottom-color:var(--dark-border) !important;
}
html[data-theme="dark"] .stack-on-mobile tbody td::before {
  color:var(--dark-muted) !important;
}
html[data-theme="dark"] .stack-on-mobile tbody td a:not(.btn) {
  color:var(--dark-link) !important;
}

/* Dashboard : toutes les petites cartes internes passent en sombre. */
html[data-theme="dark"] .ai-dashboard-card,
html[data-theme="dark"] .ai-dashboard-card .card-header,
html[data-theme="dark"] .ai-dashboard-card .card-body,
html[data-theme="dark"] .ai-dashboard-list,
html[data-theme="dark"] .ai-dashboard-list > a,
html[data-theme="dark"] .ai-briefing-observations > div,
html[data-theme="dark"] .ai-panel,
html[data-theme="dark"] .ai-list li,
html[data-theme="dark"] .ai-list-risk li,
html[data-theme="dark"] .ai-feature,
html[data-theme="dark"] .ai-anomaly-card,
html[data-theme="dark"] .ai-dashboard-list .text-muted {
  background:var(--dark-surface-2) !important;
  color:var(--dark-text-2) !important;
  border-color:var(--dark-border) !important;
}
html[data-theme="dark"] .ai-dashboard-list > a {
  border-top-color:var(--dark-border) !important;
}
html[data-theme="dark"] .ai-dashboard-list > a strong,
html[data-theme="dark"] .ai-dashboard-list > a span {
  color:#f0f6fa !important;
}
html[data-theme="dark"] .ai-dashboard-list > a span {
  color:#7fe1d0 !important;
}
html[data-theme="dark"] .ai-briefing-observations > div {
  background:#17232e !important;
  color:#dce8ef !important;
}
html[data-theme="dark"] .stat,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .mini-stat,
html[data-theme="dark"] .commercial-profile-stat,
html[data-theme="dark"] .commercial-strengths-grid > div,
html[data-theme="dark"] .commercial-command-center,
html[data-theme="dark"] .commercial-day-card,
html[data-theme="dark"] .commercial-route-result {
  background:var(--dark-surface) !important;
  color:var(--dark-text) !important;
  border-color:var(--dark-border) !important;
}
html[data-theme="dark"] .stat span,
html[data-theme="dark"] .stat-card .text-muted,
html[data-theme="dark"] .commercial-command-center .text-muted,
html[data-theme="dark"] .commercial-profile-stat span,
html[data-theme="dark"] .commercial-strengths-grid span {
  color:var(--dark-muted) !important;
}
html[data-theme="dark"] .stat strong,
html[data-theme="dark"] .stat-card strong,
html[data-theme="dark"] .mini-stat strong,
html[data-theme="dark"] .commercial-profile-stat strong {
  color:#f3f8fb !important;
}

/* Planning global : aucun en-tête de jour ne doit revenir au blanc. */
html[data-theme="dark"] .planning-mobile-day-tabs {
  background:#0f1922 !important;
  border-color:var(--dark-border) !important;
}
html[data-theme="dark"] .planning-mobile-day-tab {
  background:#17232e !important;
  color:#aebfcb !important;
  border-color:#435b6b !important;
  box-shadow:none !important;
}
html[data-theme="dark"] .planning-mobile-day-tab span,
html[data-theme="dark"] .planning-mobile-day-tab strong {
  color:#dbe6ee !important;
}
html[data-theme="dark"] .planning-mobile-day-tab.is-active {
  background:#12466b !important;
  border-color:#4aa8df !important;
  color:#fff !important;
  box-shadow:0 3px 10px rgba(0,0,0,.28) !important;
}
html[data-theme="dark"] .planning-mobile-day-tab.is-active span,
html[data-theme="dark"] .planning-mobile-day-tab.is-active strong {
  color:#fff !important;
}
html[data-theme="dark"] .planning-day-block {
  background:#111b24 !important;
  border-color:var(--dark-border) !important;
}
html[data-theme="dark"] .planning-day-title {
  background:#1a2833 !important;
  color:#f2f7fb !important;
  border-color:var(--dark-border) !important;
}
html[data-theme="dark"] .planning-day-title span,
html[data-theme="dark"] .planning-day-title strong {
  color:#f2f7fb !important;
}
html[data-theme="dark"] .planning-appointment-card {
  background:#16232d !important;
  color:var(--dark-text) !important;
  border-color:#385264 !important;
}
html[data-theme="dark"] .planning-main,
html[data-theme="dark"] .planning-meta,
html[data-theme="dark"] .planning-address,
html[data-theme="dark"] .planning-time {
  color:#dce8ef !important;
}
html[data-theme="dark"] .planning-main a:not(.btn) { color:#76bdff !important; }
html[data-theme="dark"] .planning-meta span,
html[data-theme="dark"] .planning-address { color:#b6c7d2 !important; }

/* Sélecteur commercial + bouton : dimensions stables sur iPhone/Android. */
html[data-theme="dark"] .planning-page .planning-action-form {
  display:grid !important;
  grid-template-columns:minmax(0,1fr) minmax(96px,112px) !important;
  width:100% !important;
  min-width:0 !important;
  gap:7px !important;
}
html[data-theme="dark"] .planning-page .planning-action-form .form-select,
html[data-theme="dark"] .planning-page .planning-action-form .planning-action-assign {
  min-width:0 !important;
  width:100% !important;
  height:42px !important;
  min-height:42px !important;
  box-sizing:border-box !important;
}
html[data-theme="dark"] .planning-page .planning-action-form .form-select {
  background:#0d1821 !important;
  color:#f0f6fa !important;
  border:1px solid #486174 !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}
html[data-theme="dark"] .planning-page .planning-action-assign {
  background:#123957 !important;
  color:#fff !important;
  border:1px solid #4388b8 !important;
  white-space:nowrap !important;
}
html[data-theme="dark"] .planning-page .planning-action-file {
  background:#182733 !important;
  color:#eaf2f7 !important;
  border-color:#526b7b !important;
}
html[data-theme="dark"] .planning-page .planning-action-maps {
  background:#20313d !important;
  color:#eaf2f7 !important;
  border-color:#526b7b !important;
}
@media(max-width:767.98px){
  html[data-theme="dark"] .planning-page .planning-action-form {
    grid-column:1 / -1 !important;
    grid-template-columns:minmax(0,1fr) minmax(96px,112px) !important;
  }
}
@media(max-width:390px){
  html[data-theme="dark"] .planning-page .planning-action-form {
    grid-template-columns:minmax(0,1fr) 96px !important;
  }
  html[data-theme="dark"] .planning-page .planning-action-form .form-select,
  html[data-theme="dark"] .planning-page .planning-action-form .planning-action-assign {
    font-size:11px !important;
  }
}

/* Planning commercial : jours et cartes mobiles. */
html[data-theme="dark"] .commercial-mobile-day {
  background:#101a23 !important;
  border-color:var(--dark-border) !important;
}
html[data-theme="dark"] .commercial-mobile-day > header {
  background:#1a2833 !important;
  color:#f2f7fb !important;
  border-color:var(--dark-border) !important;
}
html[data-theme="dark"] .commercial-mobile-day > header * {
  color:inherit !important;
}
html[data-theme="dark"] .commercial-mobile-person {
  background:#121d26 !important;
  border-color:#385163 !important;
}
html[data-theme="dark"] .commercial-mobile-person-head,
html[data-theme="dark"] .commercial-mobile-rdv {
  color:#f2f7fb !important;
}
html[data-theme="dark"] .commercial-mobile-rdv {
  background:#172632 !important;
  border-color:#405a6b !important;
}
html[data-theme="dark"] .commercial-mobile-rdv strong,
html[data-theme="dark"] .commercial-mobile-rdv b {
  color:#f3f8fb !important;
}

/* Trajets : les cartes mobiles étaient encore rendues avec le fond clair. */
html[data-theme="dark"] .travel-explanation,
html[data-theme="dark"] .travel-table,
html[data-theme="dark"] .travel-table tbody,
html[data-theme="dark"] .travel-table tbody tr,
html[data-theme="dark"] .travel-table tbody td {
  background:var(--dark-surface) !important;
  color:var(--dark-text-2) !important;
  border-color:var(--dark-border) !important;
}
html[data-theme="dark"] .travel-explanation {
  background:#172631 !important;
  color:#bcd0dc !important;
}
html[data-theme="dark"] .travel-table tbody tr {
  box-shadow:0 4px 14px rgba(0,0,0,.18) !important;
}
html[data-theme="dark"] .travel-table tbody td::before {
  color:#9eb1c0 !important;
}
html[data-theme="dark"] .travel-table small,
html[data-theme="dark"] .travel-table .text-muted {
  color:#a7bac7 !important;
}
html[data-theme="dark"] .travel-table strong {
  color:#f1f7fa !important;
}
html[data-theme="dark"] .travel-table a:not(.btn) { color:#76bdff !important; }

/* Les boutons d'action ne doivent jamais redevenir blancs par une règle ancienne. */
html[data-theme="dark"] .planning-page .btn,
html[data-theme="dark"] .planning-page button,
html[data-theme="dark"] .planning-page a.btn {
  text-shadow:none !important;
}
html[data-theme="dark"] .planning-page .btn-outline-dark,
html[data-theme="dark"] .planning-page .btn-outline-secondary {
  background:#172530 !important;
  color:#eaf2f7 !important;
  border-color:#61798a !important;
}
html[data-theme="dark"] .planning-page .btn-dark {
  background:#123957 !important;
  color:#fff !important;
  border-color:#4388b8 !important;
}

/* QCM / formulaires : texte clair partout, y compris les labels injectés. */
html[data-theme="dark"] .qcm-questions,
html[data-theme="dark"] .qcm-questions > [data-question],
html[data-theme="dark"] .qcm-questions > [data-question] * {
  color:var(--dark-text-2);
}
html[data-theme="dark"] .qcm-questions > [data-question] input,
html[data-theme="dark"] .qcm-questions > [data-question] textarea {
  background:#0d1821 !important;
  color:#f1f7fa !important;
  border-color:#40596a !important;
}
html[data-theme="dark"] .qcm-admin-check,
html[data-theme="dark"] .qcm-delete-question {
  color:#eaf2f7 !important;
}
html[data-theme="dark"] .qcm-admin-check:not(:has(input:checked)) {
  background:#172631 !important;
  border-color:#4a6475 !important;
}
html[data-theme="dark"] .qcm-admin-check:not(:has(input:checked)) .form-check-label {
  color:#eaf2f7 !important;
}

/* Menus / notifications : vraie respiration. */
html[data-theme="dark"] .notification-dropdown {
  background:#111c25 !important;
  border-color:#40586a !important;
}
html[data-theme="dark"] .notification-list {
  background:#111c25 !important;
  padding:7px 8px !important;
}
html[data-theme="dark"] .notification-item {
  margin:7px 0 !important;
  padding:10px 12px !important;
  background:#182630 !important;
  color:#eaf2f7 !important;
  border:1px solid #3b5364 !important;
  border-left:3px solid #e84c5b !important;
  border-radius:9px !important;
}
html[data-theme="dark"] .notification-actions {
  background:#111c25 !important;
  border-top-color:#40586a !important;
  padding:10px 8px !important;
  gap:8px !important;
}

/* Login : suppression réelle du voile, et panneau sans halo opaque autour du logo. */
.login-scene-shade { display:none !important; }
.login-logo {
  filter:none !important;
  mix-blend-mode:normal !important;
}
.login-brand { background:transparent !important; box-shadow:none !important; }
@media(max-width:800px){
  .login-panel { backdrop-filter:none !important; -webkit-backdrop-filter:none !important; }
}

/* Fallback générique pour les futures pages : toute surface explicitement blanche
   reçoit automatiquement la palette sombre lorsque le thème est actif. */
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: white"] {
  background:var(--dark-surface-2) !important;
  color:var(--dark-text) !important;
}

/* Mobile : typographie et contrôles lisibles, sans surfaces géantes. */
@media(max-width:767.98px){
  html[data-theme="dark"] .card,
  html[data-theme="dark"] .stat,
  html[data-theme="dark"] .stat-card,
  html[data-theme="dark"] .commercial-command-center {
    border-radius:12px !important;
  }
  html[data-theme="dark"] .card-header,
  html[data-theme="dark"] .card-body,
  html[data-theme="dark"] .card-footer {
    color:var(--dark-text) !important;
  }
  html[data-theme="dark"] .card-header strong,
  html[data-theme="dark"] .card-header h1,
  html[data-theme="dark"] .card-header h2,
  html[data-theme="dark"] .card-header h3,
  html[data-theme="dark"] .card-header h4 {
    color:#f4f8fb !important;
  }
  html[data-theme="dark"] .btn,
  html[data-theme="dark"] button,
  html[data-theme="dark"] select,
  html[data-theme="dark"] input,
  html[data-theme="dark"] textarea {
    font-size:13px !important;
  }
  html[data-theme="dark"] .btn,
  html[data-theme="dark"] button {
    min-height:40px;
  }
}

/* V47 logo propre : SVG transparent, sans fond ni voile. */
.header-logo,
.login-logo,
.branding-preview-logo img {
  background:transparent !important;
  box-shadow:none !important;
  filter:none !important;
  mix-blend-mode:normal !important;
}
.header-logo { object-fit:contain !important; }
.login-logo { object-fit:contain !important; }

/* ================================================================
   V49 — personnalisation client + planning commercial départemental
   ================================================================ */
html[data-theme="dark"] .commercial-rdv-card,
html[data-theme="dark"] .commercial-mobile-rdv {
  background: color-mix(in srgb, var(--rdv-dept-color, #38bdf8) 18%, #111c25) !important;
  border: 1px solid color-mix(in srgb, var(--rdv-dept-color, #38bdf8) 45%, #304657) !important;
  border-left: 4px solid var(--rdv-dept-color, #38bdf8) !important;
  color: #f4f8fb !important;
}
html[data-theme="dark"] .commercial-rdv-card:hover,
html[data-theme="dark"] .commercial-mobile-rdv:hover {
  background: color-mix(in srgb, var(--rdv-dept-color, #38bdf8) 25%, #111c25) !important;
}
html[data-theme="dark"] .commercial-rdv-card span,
html[data-theme="dark"] .commercial-mobile-rdv span,
html[data-theme="dark"] .commercial-rdv-card strong,
html[data-theme="dark"] .commercial-mobile-rdv strong {
  color: #f7fbff !important;
}
html[data-theme="dark"] .commercial-rdv-card small,
html[data-theme="dark"] .commercial-mobile-rdv small {
  color: #b9cad6 !important;
}

/* Aucun branding natif imposé : avant import, l'espace reste neutre. */
.branding-empty-state {
  min-height: 100px;
  display: grid;
  place-items: center;
  color: var(--dark-muted, #8ea1b1);
  font-size: 13px;
  text-align: center;
  border: 1px dashed currentColor;
  border-radius: 10px;
  padding: 16px;
}
html[data-theme="dark"] .branding-empty-state {
  color: #8fa5b5 !important;
  background: #101b24 !important;
}

/* Les cartes de notifications ont un vrai espacement visuel. */
html[data-theme="dark"] .notification-list {
  padding: 8px !important;
  background: #101b24 !important;
}
html[data-theme="dark"] .notification-item {
  display: block !important;
  padding: 10px 11px !important;
  margin: 0 0 7px !important;
  border: 1px solid #334b5c !important;
  border-left: 3px solid #64748b !important;
  border-radius: 9px !important;
  background: #16242f !important;
}
html[data-theme="dark"] .notification-item:last-child { margin-bottom: 0 !important; }

/* Le header ne réserve aucun fond derrière un logo client absent. */
.header-logo { background: transparent !important; box-shadow: none !important; filter: none !important; }
.login-logo { background: transparent !important; box-shadow: none !important; filter: none !important; }

/* ================================================================
   V50 — cockpit dashboard + hero slider premium
   Référence visuelle : maquette dashboard fournie par GRC Énergies.
   Tout est fluide desktop / tablette / mobile, sans surfaces blanches.
   ================================================================ */

html[data-theme="dark"] .boss-dashboard{color:#eaf2f7}
.boss-welcome{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin:4px 0 20px}
.boss-welcome h1{font-size:30px;line-height:1.1;margin:0 0 6px;color:#f6fbff;font-weight:800;letter-spacing:-.03em}
.boss-welcome p{margin:0;color:#9db1c0;font-size:15px}.boss-now{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.boss-now span{display:inline-flex;align-items:center;gap:7px;padding:9px 12px;border:1px solid #203c4d;background:#0d202d;border-radius:9px;color:#d9e6ed;font-size:12px;font-weight:700}
.boss-kpi-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:18px}
.boss-kpi{min-width:0;display:flex;align-items:center;gap:11px;padding:13px 12px;border-radius:11px;border:1px solid #1f3b4d;background:#0e202c;box-shadow:0 10px 26px rgba(0,0,0,.13)}
.boss-kpi-icon{width:42px;height:42px;flex:0 0 42px;border-radius:9px;display:grid;place-items:center;font-size:20px;background:#0c3150;border:1px solid #16547b}.boss-kpi>div{min-width:0}.boss-kpi span:not(.boss-kpi-icon){display:block;color:#b7c8d4;font-size:11px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.boss-kpi strong{display:block;color:#f5fbff;font-size:22px;line-height:1.15;margin:3px 0}.boss-kpi small{display:block;color:#45e19b;font-size:10px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kpi-green .boss-kpi-icon,.kpi-teal .boss-kpi-icon{background:#073a34;border-color:#0a6e62}.kpi-green small,.kpi-teal small{color:#42e0a0}.kpi-cyan .boss-kpi-icon{background:#10385b;border-color:#2a78b6}.kpi-yellow .boss-kpi-icon{background:#3b3008;border-color:#80640a}.kpi-yellow small{color:#ffd34d}.kpi-purple .boss-kpi-icon{background:#242047;border-color:#5b50a7}
.boss-main-grid,.boss-bottom-grid{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);gap:14px;margin-bottom:14px}
.boss-panel{min-width:0;border:1px solid #203e50;background:#0e1d28;border-radius:11px;overflow:hidden;box-shadow:0 12px 30px rgba(0,0,0,.14)}
.boss-panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 15px;border-bottom:1px solid #203d4d;background:#102633}.boss-panel-head>div{min-width:0}.boss-panel-head strong{display:block;color:#f2f8fb;font-size:14px;font-weight:800}.boss-panel-head span{display:block;color:#90a6b5;font-size:11px;margin-top:3px}.boss-panel-link{color:#55baff!important;text-decoration:none;font-size:11px;font-weight:800;border:1px solid #1c5679;background:#082034;border-radius:7px;padding:6px 9px;white-space:nowrap}.boss-panel-link:hover{background:#0d3150;color:#fff!important}
.boss-ai-columns{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px}.boss-ai-list{border:1px solid #203c4d;background:#0a1822;border-radius:9px;padding:9px}.boss-ai-list h3{font-size:11px;color:#dce9ef;margin:0 0 5px;display:flex;align-items:center;gap:7px}.boss-ai-list h3 i{width:8px;height:8px;border-radius:50%;background:#17cf5f}.boss-ai-list.risk h3 i{background:#ef4444}.boss-ai-list a{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 4px;border-top:1px solid #193240;text-decoration:none;color:#66baff}.boss-ai-list a:first-of-type{border-top:0}.boss-ai-list a strong{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.boss-ai-list a b{font-size:10px;color:#fff;background:#247d4b;border-radius:5px;padding:3px 6px}.boss-ai-list.risk a b{background:#a92832}.boss-ai-list p{margin:8px 2px;color:#8399a8;font-size:11px}
.boss-dashboard-map{height:235px;margin:12px;border:1px solid #234556;border-radius:9px;overflow:hidden;background:#082131}.boss-map-legend{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;padding:0 12px 12px}.boss-map-legend span{display:flex;align-items:center;gap:6px;color:#b9c9d3;font-size:10px;min-width:0}.boss-map-legend b{margin-left:auto;color:#f5fbff;background:#07141e;border-radius:6px;padding:4px 6px}.dot{width:9px;height:9px;border-radius:50%;display:inline-block;flex:0 0 9px}.dot.blue{background:#2186f3}.dot.yellow{background:#f7c323}.dot.green{background:#16d64f}
.boss-rdv-list{padding:2px 0}.boss-rdv-row{display:grid;grid-template-columns:55px 78px minmax(160px,1.2fr) minmax(110px,.8fr) minmax(110px,.7fr) auto;align-items:center;gap:10px;padding:10px 13px;border-bottom:1px solid #193341;text-decoration:none;color:#dbe8ef;position:relative}.boss-rdv-row:last-child{border-bottom:0}.boss-rdv-row:hover{background:#112a38}.boss-rdv-time{font-size:16px;color:#f3f8fb}.boss-rdv-status{font-size:9px;font-weight:800;border-radius:5px;padding:5px 6px;text-align:center;background:#6b7280;color:#fff}.boss-rdv-status.is-pending{background:#f6b915;color:#111}.boss-rdv-status.is-ok{background:#0e9f67;color:#fff}.boss-rdv-client{min-width:0}.boss-rdv-client b{display:block;color:#64b9ff;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.boss-rdv-client small{display:block;color:#91a8b7;font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}.boss-rdv-commercial,.boss-rdv-project{font-size:10px;color:#b6c8d3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.boss-rdv-actions{font-size:9px;color:#9db2c0;white-space:nowrap}.boss-empty{padding:18px;color:#879cab;font-size:12px;text-align:center}
.boss-activity-list{padding:4px 13px 8px}.boss-activity-row{display:grid;grid-template-columns:8px 42px minmax(0,1fr);align-items:start;gap:8px;padding:8px 0;border-bottom:1px solid #193341;text-decoration:none;color:#b8c9d3;font-size:10px}.boss-activity-row:last-child{border-bottom:0}.boss-activity-row i{width:7px;height:7px;margin-top:4px;border-radius:50%;background:#2388f2}.boss-activity-row:nth-child(2n) i{background:#19d366}.boss-activity-row time{color:#7f96a5;font-weight:700}.boss-activity-row span{line-height:1.35}.boss-activity-row b{color:#e5f0f5}
.boss-summary-panel{margin-bottom:20px}.boss-summary-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;padding:12px}.boss-summary-grid>div{padding:12px;border:1px solid #203b4b;border-radius:9px;background:#0a1822}.boss-summary-grid span,.boss-summary-grid small{display:block;color:#8fa5b4;font-size:10px}.boss-summary-grid strong{display:block;color:#f3f8fb;font-size:21px;margin:4px 0}.boss-summary-grid strong.danger{color:#ff6470}

html[data-theme="dark"] .boss-dashboard .leaflet-container{background:#09202e}.boss-dashboard .leaflet-control-attribution{background:rgba(5,16,24,.82)!important;color:#a7bac6!important}.boss-dashboard .leaflet-control-attribution a{color:#6ec4ff!important}

@media(max-width:1200px){.boss-kpi-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.boss-main-grid,.boss-bottom-grid{grid-template-columns:1fr}}
@media(max-width:767.98px){
  .boss-welcome{display:block;margin:10px 0 14px}.boss-welcome h1{font-size:23px}.boss-welcome p{font-size:12px}.boss-now{justify-content:flex-start;margin-top:9px}.boss-now span{padding:7px 9px;font-size:10px}
  .boss-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:10px}.boss-kpi{padding:10px 9px;gap:8px;border-radius:9px}.boss-kpi-icon{width:34px;height:34px;flex-basis:34px;font-size:16px}.boss-kpi span:not(.boss-kpi-icon){font-size:9px}.boss-kpi strong{font-size:18px}.boss-kpi small{font-size:8px}
  .boss-main-grid,.boss-bottom-grid{display:block;margin-bottom:10px}.boss-panel{margin-bottom:10px;border-radius:9px}.boss-panel-head{padding:10px 11px;gap:8px}.boss-panel-head strong{font-size:12px}.boss-panel-head span{font-size:9px}.boss-panel-link{font-size:9px;padding:5px 7px}
  .boss-ai-columns{grid-template-columns:1fr;gap:7px;padding:8px}.boss-ai-list{padding:7px}.boss-ai-list a{padding:6px 3px}.boss-ai-list a strong{font-size:10px}.boss-ai-list h3{font-size:10px}
  .boss-dashboard-map{height:190px;margin:8px}.boss-map-legend{grid-template-columns:1fr;padding:0 8px 8px;gap:4px}.boss-map-legend span{font-size:9px}
  .boss-rdv-row{grid-template-columns:52px minmax(0,1fr) auto;gap:6px;padding:9px 10px}.boss-rdv-status{grid-column:3;grid-row:1}.boss-rdv-client{grid-column:2;grid-row:1}.boss-rdv-commercial,.boss-rdv-project,.boss-rdv-actions{grid-column:2 / -1}.boss-rdv-commercial{font-size:9px}.boss-rdv-project{font-size:9px}.boss-rdv-actions{display:none}.boss-rdv-client small{font-size:8px}
  .boss-summary-grid{grid-template-columns:repeat(2,1fr);padding:8px;gap:7px}.boss-summary-grid>div{padding:9px}.boss-summary-grid strong{font-size:18px}
}

/* V51 — carte dashboard 100% locale et nette, sans dépendance à une tuile externe. */
.dashboard-france-map{display:block;width:100%;height:100%;min-height:0;background:#071b2a}
.dashboard-map-marker{cursor:pointer;outline:none}
.dashboard-map-marker:hover circle:nth-child(2),.dashboard-map-marker:focus circle:nth-child(2){stroke:#fff;stroke-width:5}
.dashboard-map-overlay{position:absolute;left:18px;top:18px;display:flex;flex-direction:column;gap:2px;pointer-events:none;padding:7px 9px;border:1px solid rgba(95,221,244,.25);border-radius:8px;background:rgba(4,17,27,.78);backdrop-filter:blur(6px)}
.dashboard-map-overlay strong{font-size:11px;color:#f4fbff}.dashboard-map-overlay span{font-size:9px;color:#91adbb}
.boss-dashboard .boss-map-panel{position:relative}

.dashboard-rdv-pin-wrap{background:transparent!important;border:0!important}
.dashboard-rdv-pin{position:relative;display:block;width:24px;height:30px;margin:0 auto;box-sizing:border-box;background:#e53945;border:2px solid #fff;border-radius:50% 50% 50% 0;transform:rotate(-45deg);box-shadow:0 2px 7px rgba(0,0,0,.45)}
.dashboard-rdv-pin>span{position:absolute;left:6px;top:6px;width:8px;height:8px;border-radius:50%;background:#fff;border:1px solid rgba(0,0,0,.12)}
.dashboard-map-popup{min-width:150px;line-height:1.35}
.dashboard-map-popup-name{display:block!important;color:#18232b!important;font-size:13px!important;font-weight:800!important;margin:0 0 4px!important}
.dashboard-map-popup-meta{color:#344852!important;font-size:11px!important;margin-top:2px}
html[data-theme="dark"] .dashboard-map-popup-name{color:#17242d!important}
html[data-theme="dark"] .dashboard-map-popup-meta{color:#344852!important}
html[data-theme="dark"] .leaflet-popup-content-wrapper{background:#f7fbfd!important;color:#17242d!important}
html[data-theme="dark"] .leaflet-popup-tip{background:#f7fbfd!important}

  .dashboard-map-overlay{left:10px;top:10px;padding:5px 7px}.dashboard-map-overlay strong{font-size:9px}.dashboard-map-overlay span{font-size:7px}
}

/* V52 — header desktop : navigation centrée, actions de session à droite. */
@media (min-width: 901px) {
  .crm-navbar .container-fluid {
    position: relative;
    display: flex;
    align-items: center;
  }
  .crm-navbar .desktop-header-menu {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    min-width: 0;
  }
  .crm-navbar .header-primary-links {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: nowrap;
  }
  .crm-navbar .header-right-actions {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    margin-left: auto;
  }
  .crm-navbar .header-user { margin-left: 2px; }
}

/* V53 — centrage réel du menu principal dans toute la largeur du header.
   Le bloc de navigation est centré par rapport à la fenêtre, indépendamment
   de la largeur du logo à gauche et des actions de session à droite. */
@media (min-width: 901px) {
  .crm-navbar .container-fluid {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }
  .crm-navbar .desktop-header-menu {
    position: static !important;
    flex: 1 1 auto !important;
    display: block !important;
    min-width: 0 !important;
  }
  .crm-navbar .header-primary-links {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
  }
  .crm-navbar .header-right-actions {
    position: absolute !important;
    right: 26px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 7px !important;
    margin: 0 !important;
    z-index: 2 !important;
  }
}

/* V55 — dashboard : même carte Leaflet que la planification, sans toucher au reste du dashboard. */
.boss-dashboard .dashboard-planning-map{height:200px !important;min-height:200px;border:1px solid #234556;border-radius:9px;overflow:hidden;background:#082131}
.boss-dashboard .dashboard-planning-map .leaflet-container{height:100%;width:100%;background:#09202e}
@media (max-width:768px){.boss-dashboard .dashboard-planning-map{height:180px !important;min-height:180px}}

/* V57 — mobile navigation: all primary links are real, centered touch buttons. */
@media (max-width: 767.98px) {
  .mobile-nav-panel {
    padding: 12px !important;
  }
  .mobile-nav-panel > a {
    width: 100% !important;
    min-height: 48px !important;
    margin: 6px 0 !important;
    padding: 10px 14px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    border: 1px solid #4a5b6a !important;
    border-radius: 10px !important;
    background: #30343b !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
  }
  .mobile-nav-panel > a:hover,
  .mobile-nav-panel > a:focus {
    background: #454b54 !important;
    color: #fff !important;
    border-color: #6f7b87 !important;
  }
  .mobile-nav-panel > a.mobile-nav-ai {
    background: linear-gradient(135deg,#347f83,#337ea7) !important;
    border-color: #4c99a6 !important;
    color: #fff !important;
  }
  .mobile-nav-panel > a.mobile-nav-primary {
    background: #198754 !important;
    border-color: #198754 !important;
    color: #fff !important;
  }
  .mobile-nav-section {
    width: 100% !important;
    margin: 14px 0 7px !important;
    padding: 9px 6px 4px !important;
    text-align: center !important;
    border-top: 1px solid #4b5965 !important;
    color: #8aa8bd !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: .18em !important;
  }
  .mobile-nav-panel-head {
    text-align: center !important;
  }
  .mobile-nav-panel-head strong,
  .mobile-nav-panel-head span {
    display: block !important;
    text-align: center !important;
  }
  .mobile-theme-toggle {
    width: 100% !important;
    min-height: 48px !important;
    margin: 12px 0 8px !important;
    border-radius: 10px !important;
    justify-content: center !important;
  }
  .mobile-nav-logout-form {
    margin-top: 8px !important;
    padding-top: 8px !important;
    border-top: 1px solid #4b5965 !important;
  }
  .mobile-nav-logout {
    width: 100% !important;
    min-height: 48px !important;
    border-radius: 10px !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

/* V57 — light theme: dashboard hero/KPI text remains readable in light mode. */
html[data-theme="light"] .boss-dashboard {
  color: #17212b !important;
}
html[data-theme="light"] .boss-welcome h1 {
  color: #17212b !important;
}
html[data-theme="light"] .boss-welcome p {
  color: #536575 !important;
}
html[data-theme="light"] .boss-now span {
  background: #fff !important;
  border-color: #cbd8e2 !important;
  color: #263746 !important;
}
html[data-theme="light"] .boss-kpi {
  background: #fff !important;
  border-color: #cbd8e2 !important;
  box-shadow: 0 8px 20px rgba(30,55,75,.08) !important;
}
html[data-theme="light"] .boss-kpi span:not(.boss-kpi-icon) {
  color: #536575 !important;
}
html[data-theme="light"] .boss-kpi strong {
  color: #17212b !important;
}
html[data-theme="light"] .boss-panel {
  background: #fff !important;
  border-color: #cbd8e2 !important;
  box-shadow: 0 8px 20px rgba(30,55,75,.07) !important;
}
html[data-theme="light"] .boss-panel-head {
  background: #f2f7fa !important;
  border-bottom-color: #d4e0e7 !important;
}
html[data-theme="light"] .boss-panel-head strong {
  color: #17212b !important;
}
html[data-theme="light"] .boss-panel-head span {
  color: #607483 !important;
}
html[data-theme="light"] .boss-ai-list {
  background: #f7fafc !important;
  border-color: #d4e0e7 !important;
}
html[data-theme="light"] .boss-ai-list h3 {
  color: #263746 !important;
}
html[data-theme="light"] .boss-ai-list a {
  color: #1769a8 !important;
  border-top-color: #dce5eb !important;
}
html[data-theme="light"] .boss-rdv-row,
html[data-theme="light"] .boss-activity-row {
  color: #263746 !important;
  border-bottom-color: #dce5eb !important;
}
html[data-theme="light"] .boss-rdv-time,
html[data-theme="light"] .boss-rdv-client b,
html[data-theme="light"] .boss-activity-row b {
  color: #1769a8 !important;
}
html[data-theme="light"] .boss-rdv-client small,
html[data-theme="light"] .boss-rdv-commercial,
html[data-theme="light"] .boss-rdv-project,
html[data-theme="light"] .boss-rdv-actions,
html[data-theme="light"] .boss-activity-row,
html[data-theme="light"] .boss-activity-row time,
html[data-theme="light"] .boss-empty {
  color: #607483 !important;
}
html[data-theme="light"] .boss-summary-grid > div {
  background: #f7fafc !important;
  border-color: #d4e0e7 !important;
}
html[data-theme="light"] .boss-summary-grid span,
html[data-theme="light"] .boss-summary-grid small {
  color: #607483 !important;
}
html[data-theme="light"] .boss-summary-grid strong {
  color: #17212b !important;
}

@media (max-width: 767.98px) {
  html[data-theme="light"] .mobile-nav-panel {
    background: #f5f8fa !important;
    border-color: #bccbd5 !important;
  }
  html[data-theme="light"] .mobile-nav-panel > a {
    background: #fff !important;
    border-color: #c8d5de !important;
    color: #173b5c !important;
    box-shadow: 0 2px 8px rgba(31,61,82,.06) !important;
  }
  html[data-theme="light"] .mobile-nav-panel > a:hover,
  html[data-theme="light"] .mobile-nav-panel > a:focus {
    background: #edf5fa !important;
    color: #0f5f8f !important;
  }
  html[data-theme="light"] .mobile-nav-panel > a.mobile-nav-ai {
    background: linear-gradient(135deg,#347f83,#337ea7) !important;
    color: #fff !important;
    border-color: #4c99a6 !important;
  }
  html[data-theme="light"] .mobile-nav-panel > a.mobile-nav-primary {
    background: #198754 !important;
    color: #fff !important;
    border-color: #198754 !important;
  }
  html[data-theme="light"] .mobile-nav-panel-head strong {
    color: #253746 !important;
  }
  html[data-theme="light"] .mobile-nav-panel-head span {
    color: #637787 !important;
  }
  html[data-theme="light"] .mobile-nav-section,
  html[data-theme="light"] .mobile-nav-logout-form {
    border-top-color: #ccd9e1 !important;
  }
}


/* V58 — Planning commercial : couleurs de départements conservées en mode sombre.
   La teinte est injectée depuis le serveur via --rdv-dept-color, sans dépendre
   de color-mix() pour le fond des cartes. */
html[data-theme="dark"] .commercial-rdv-card,
html[data-theme="dark"] .commercial-mobile-rdv {
  background: var(--rdv-dept-bg-dark, #182630) !important;
  border-color: var(--rdv-dept-color, #38bdf8) !important;
  border-left-color: var(--rdv-dept-color, #38bdf8) !important;
  color: #f7fbff !important;
}
html[data-theme="dark"] .commercial-rdv-card:hover,
html[data-theme="dark"] .commercial-mobile-rdv:hover {
  background: var(--rdv-dept-bg-dark, #1d303d) !important;
  border-color: var(--rdv-dept-color, #38bdf8) !important;
  border-left-color: var(--rdv-dept-color, #38bdf8) !important;
}
html[data-theme="dark"] .commercial-rdv-card small,
html[data-theme="dark"] .commercial-mobile-rdv small {
  color: #c8d6df !important;
}


/* AGENDA TELEPRO — V2 responsive/theme final fix */
.agenda-calendar{
  width:100%;max-width:100%;min-width:0;background:#fff;color:#172b3a;
  border-color:#dfe3e7;overflow-x:auto;overflow-y:hidden;
}
.agenda-grid-header{background:#f8f9fa;color:#172b3a;border-bottom-color:#dfe3e7}
.agenda-time-head,.agenda-day-head,.agenda-time,.agenda-slot{border-color:#e1e6ea}
.agenda-day-head span,.agenda-time{color:#607487}
.agenda-day-head strong,.agenda-time-head{color:#172b3a}
.agenda-day-head.is-today{background:#e9ecef;color:#172b3a}
.agenda-slot{background:#fff}
.agenda-slot.is-today{background:#f7fafc}

.agenda-event-neutral{
  background:#f1f3f5!important;color:#17212b!important;border-color:#cfd7df!important;
}
.agenda-event-neutral strong,.agenda-event-neutral span{color:#17212b!important}
.agenda-event-neutral small{color:#5c6b78!important}
.agenda-event-neutral:hover{background:#e7ebee!important;color:#17212b!important}

.agenda-event-callback{
  background:#fff3cd!important;color:#5f4300!important;border-color:#e1c56b!important;
}
.agenda-event-callback strong,.agenda-event-callback span,.agenda-event-callback small{color:#5f4300!important}
.agenda-event-callback:hover{background:#ffedb0!important;color:#5f4300!important}

.agenda-mobile-day{background:#fff;color:#172b3a;border-color:#dfe7ed}
.agenda-mobile-day>header{background:#f5f8fa;border-bottom-color:#e7edf1}
.agenda-mobile-day>header span{color:#607487}
.agenda-mobile-day>header strong{color:#17364f}
.agenda-mobile-day>header small{color:#718096}
.agenda-mobile-day.is-today>header{background:#eaf8f4}
.agenda-mobile-event.is-neutral{
  background:#f1f3f5!important;color:#17212b!important;border-color:#cfd7df!important;
}
.agenda-mobile-event.is-neutral strong,
.agenda-mobile-event.is-neutral span,
.agenda-mobile-event.is-neutral small{color:#17212b!important}
.agenda-mobile-event.is-callback{
  background:#fff8e7!important;color:#684b00!important;border-color:#e4a11b!important;
}
.agenda-mobile-event.is-callback strong,
.agenda-mobile-event.is-callback span,
.agenda-mobile-event.is-callback small{color:#684b00!important}
.agenda-mobile-empty{color:#718096!important}

html[data-theme="dark"] .agenda-calendar{
  background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-border)!important;
}
html[data-theme="dark"] .agenda-grid-header{
  background:var(--dark-surface-2)!important;color:var(--dark-text)!important;border-bottom-color:var(--dark-border)!important;
}
html[data-theme="dark"] .agenda-time-head,
html[data-theme="dark"] .agenda-day-head,
html[data-theme="dark"] .agenda-time,
html[data-theme="dark"] .agenda-slot{border-color:var(--dark-border-soft)!important}
html[data-theme="dark"] .agenda-time-head,
html[data-theme="dark"] .agenda-day-head strong{color:var(--dark-text)!important}
html[data-theme="dark"] .agenda-day-head span,
html[data-theme="dark"] .agenda-time{color:var(--dark-muted)!important}
html[data-theme="dark"] .agenda-day-head.is-today{
  background:var(--dark-surface-3)!important;color:var(--dark-text)!important
}
html[data-theme="dark"] .agenda-slot{background:var(--dark-surface)!important}
html[data-theme="dark"] .agenda-slot.is-today{background:#14232e!important}

html[data-theme="dark"] .agenda-event-neutral{
  background:#1d2a35!important;color:#f2f7fb!important;border-color:#405463!important;
}
html[data-theme="dark"] .agenda-event-neutral strong,
html[data-theme="dark"] .agenda-event-neutral span{color:#f2f7fb!important}
html[data-theme="dark"] .agenda-event-neutral small{color:#b9c9d5!important}
html[data-theme="dark"] .agenda-event-neutral:hover{background:#263845!important;color:#fff!important}

html[data-theme="dark"] .agenda-event-callback{
  background:#3a3015!important;color:#ffe9a3!important;border-color:#a57c20!important;
}
html[data-theme="dark"] .agenda-event-callback strong,
html[data-theme="dark"] .agenda-event-callback span,
html[data-theme="dark"] .agenda-event-callback small{color:#ffe9a3!important}

html[data-theme="dark"] .agenda-mobile-day{
  background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-border)!important;
}
html[data-theme="dark"] .agenda-mobile-day>header{
  background:var(--dark-surface-2)!important;border-bottom-color:var(--dark-border)!important;
}
html[data-theme="dark"] .agenda-mobile-day>header span,
html[data-theme="dark"] .agenda-mobile-day>header small{color:var(--dark-muted)!important}
html[data-theme="dark"] .agenda-mobile-day>header strong{color:var(--dark-text)!important}
html[data-theme="dark"] .agenda-mobile-day.is-today>header{background:#12302c!important}
html[data-theme="dark"] .agenda-mobile-event.is-neutral{
  background:#1d2a35!important;color:#f2f7fb!important;border-color:#405463!important;
}
html[data-theme="dark"] .agenda-mobile-event.is-neutral strong,
html[data-theme="dark"] .agenda-mobile-event.is-neutral span,
html[data-theme="dark"] .agenda-mobile-event.is-neutral small{color:#f2f7fb!important}
html[data-theme="dark"] .agenda-mobile-event.is-callback{
  background:#3a3015!important;color:#ffe9a3!important;border-color:#a57c20!important;
}
html[data-theme="dark"] .agenda-mobile-event.is-callback strong,
html[data-theme="dark"] .agenda-mobile-event.is-callback span,
html[data-theme="dark"] .agenda-mobile-event.is-callback small{color:#ffe9a3!important}
html[data-theme="dark"] .agenda-mobile-empty{color:var(--dark-muted)!important}

.agenda-summary>div{color:#172b3a;background:#fff;border-color:#dfe3e7}
.agenda-summary strong{color:#172b3a}
.agenda-summary span{color:#607487}
html[data-theme="dark"] .agenda-summary>div{
  background:var(--dark-surface)!important;color:var(--dark-text)!important;border-color:var(--dark-border)!important
}
html[data-theme="dark"] .agenda-summary strong{color:var(--dark-text)!important}
html[data-theme="dark"] .agenda-summary span{color:var(--dark-muted)!important}

@media (max-width:1100px) and (min-width:768px){
  .agenda-calendar{overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  .agenda-grid-header,.agenda-grid-row{min-width:920px}
}
@media (max-width:767.98px){
  .agenda-page{width:100%;max-width:100%;min-width:0;overflow-x:hidden}
  .agenda-mobile-days{width:100%;max-width:100%}
  .agenda-mobile-event{width:100%;box-sizing:border-box}
}


/* Administration — modification du rôle, desktop + mobile */
.role-dialog{max-width:520px;width:calc(100% - 24px)}
.role-dialog form{width:100%}
.change-role-btn{white-space:nowrap}
@media (max-width:767.98px){
  .admin-employees-card .table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .admin-employees-card table{min-width:720px}
  .admin-employees-card td:last-child .d-flex{
    flex-direction:column;
    align-items:stretch;
  }
  .admin-employees-card td:last-child .btn{
    width:100%;
    min-height:42px;
  }
  .role-dialog{
    width:calc(100% - 20px);
    max-width:none;
    padding:18px;
    border-radius:18px;
  }
  .role-dialog-actions{
    flex-direction:column-reverse;
  }
  .role-dialog-actions .btn{
    width:100%;
    min-height:44px;
  }
}
