/* ============================================================
   PROSPECTION - Suivi de prospection commerciale
   ============================================================ */

.page_prospection {
  padding: 10px 16px;
  font-size: 10pt;
}

.header-prospection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.header-prospection h1 {
  font-size: 16pt;
  color: var(--main-bg-color);
  margin: 0;
}

/* ---- KPI Cards ---- */

.prosp-kpi-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.prosp-kpi-card {
  flex: 1;
  min-width: 140px;
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow 0.2s;
}

.prosp-kpi-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.prosp-kpi-clickable {
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.prosp-kpi-active {
  border-color: var(--main-bg-color);
}

.prosp-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.prosp-kpi-icon.kpi-total { background: #5c6bc0; }
.prosp-kpi-icon.kpi-new { background: #1e88e5; }
.prosp-kpi-icon.kpi-cold { background: #78909c; }
.prosp-kpi-icon.kpi-warm { background: #ff9800; }
.prosp-kpi-icon.kpi-hot { background: #e53935; }
.prosp-kpi-icon.kpi-semaine { background: #00acc1; }
.prosp-kpi-icon.kpi-action { background: #ab47bc; }

.prosp-kpi-content {
  display: flex;
  flex-direction: column;
}

.prosp-kpi-value {
  font-size: 18pt;
  font-weight: 700;
  color: #222;
  line-height: 1.1;
}

.prosp-kpi-label {
  font-size: 8.5pt;
  color: #888;
  font-weight: 500;
  margin-top: 2px;
}

/* ---- Toolbar ---- */

.prosp-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.prosp-toolbar-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.prosp-toolbar input[type="text"] {
  padding: 5px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 9pt;
  min-width: 220px;
}

.prosp-btn {
  padding: 5px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 9pt;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
  white-space: nowrap;
}

.prosp-btn:hover {
  background: #e0e0e0;
}

.prosp-btn-primary {
  background: var(--main-bg-color);
  color: #fff;
  border-color: var(--main-bg-color);
}

.prosp-btn-primary:hover {
  opacity: 0.85;
}

.prosp-btn-success {
  background: #43a047;
  color: #fff;
  border-color: #388e3c;
}

.prosp-btn-success:hover {
  background: #388e3c;
}

.prosp-btn-block {
  width: 100%;
  justify-content: center;
  padding: 10px 14px;
  font-size: 10pt;
  font-weight: 600;
}

.prosp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Compteurs température ---- */

.prosp-temp-counts {
  display: flex;
  gap: 6px;
  align-items: center;
}

.prosp-temp-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 8pt;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid;
}

.prosp-temp-count:hover {
  opacity: 0.8;
}

/* ---- Barre actions mobile (cachée par défaut) ---- */

.prosp-mobile-actions-row {
  display: none;
}

.prosp-mobile-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  background: #f8f9fa;
}

.prosp-mobile-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8pt;
  color: #888;
}

.prosp-mobile-actions-btns {
  display: flex;
  gap: 6px;
}

.prosp-mobile-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-size: 8pt;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.prosp-mobile-action-btn:active {
  background: #eee;
}

.prosp-mobile-action-dolibarr {
  background: #e3f2fd;
  color: #1565c0;
  border-color: #90caf9;
}

/* ---- Layout principal ---- */

.prosp-main-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.prosp-table-container {
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  overflow: hidden;
}

.prosp-table-scroll {
  max-height: calc(100vh - 340px);
  overflow-y: auto;
}

/* ---- Table prospects ---- */

.prosp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9pt;
}

.prosp-table thead th {
  background: #f8f9fa;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 8.5pt;
  color: #555;
  border-bottom: 2px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.prosp-table thead th:hover {
  background: #eef;
}

.prosp-sort-arrow {
  font-size: 8pt;
  margin-left: 3px;
  color: var(--main-bg-color);
}

.prosp-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.1s;
  cursor: pointer;
}

.prosp-table tbody tr:hover {
  background: rgba(92, 107, 192, 0.06);
}

.prosp-table tbody tr.prosp-row-selected {
  background: rgba(92, 107, 192, 0.12);
}

.prosp-table tbody td {
  padding: 7px 10px;
  vertical-align: middle;
}

.prosp-prospect-name a {
  color: var(--main-bg-color);
  text-decoration: none;
  font-weight: 600;
}

.prosp-prospect-name a:hover {
  text-decoration: underline;
}

.prosp-alias {
  color: #999;
  font-size: 8pt;
}

.prosp-prospect-sub {
  font-size: 8pt;
  color: #888;
  margin-top: 2px;
  display: flex;
  gap: 10px;
}

.prosp-prospect-sub .fa {
  font-size: 7pt;
}

.prosp-days-ago {
  font-size: 7.5pt;
  color: #aaa;
}

.prosp-overdue {
  color: #e53935 !important;
  font-weight: 600;
}

/* ---- Catégorie dot ---- */

.prosp-cat-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

/* ---- Photo commercial ---- */

.prosp-commercial-photo {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 4px;
}

.prosp-commercial-photo .profileUserPhoto {
  width: 22px;
  height: 22px;
}

.prosp-commercial-photo .profileUserPhoto img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.prosp-commercial-photo .profileUserPhoto .fa {
  font-size: 10px;
  color: #999;
}

.prosp-sub-cat {
  font-weight: 600;
  font-size: 7.5pt;
}

.prosp-sub-segment {
  font-size: 7.5pt;
  color: #aaa;
}

/* Pastille devis mobile (cachée par défaut, visible sur mobile) */
.prosp-show-mobile-only {
  display: none !important;
}

.prosp-devis-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  font-size: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- Segment badges (panel détail) ---- */

.prosp-segment-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 7.5pt;
  font-weight: 600;
  white-space: nowrap;
}

.prosp-segment-particulier { background: #e8f5e9; color: #2e7d32; }
.prosp-segment-tpe { background: #e3f2fd; color: #1565c0; }
.prosp-segment-pme { background: #fce4ec; color: #c62828; }
.prosp-segment-liberal { background: #f3e5f5; color: #7b1fa2; }
.prosp-segment-autre { background: #f5f5f5; color: #666; }

/* ---- Client type toggle ---- */

.prosp-client-type-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.prosp-client-type-label {
  font-size: 9pt;
  font-weight: 600;
  color: #333;
}

.prosp-btn-sm {
  padding: 3px 8px;
  font-size: 8.5pt;
}

.prosp-btn-convert {
  background: #43a047;
  color: #fff;
  border-color: #388e3c;
  font-weight: 600;
  padding: 5px 12px;
}

.prosp-btn-convert:hover {
  background: #388e3c;
}

.prosp-btn-convert-only {
  background: #5c6bc0;
  color: #fff;
  border-color: #3f51b5;
  font-size: 8.5pt;
}

.prosp-btn-convert-only:hover {
  background: #3f51b5;
}

.prosp-convert-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.prosp-btn-danger {
  background: #e53935;
  color: #fff;
  border-color: #c62828;
  font-weight: 600;
}

.prosp-btn-danger:hover {
  background: #c62828;
}

/* ---- Popup confirmation ---- */

.prosp-confirm {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  padding: 28px 24px 20px;
  width: 380px;
  max-width: 90vw;
  text-align: center;
  animation: prospModalSlideIn 0.2s ease;
}

.prosp-confirm-icon {
  font-size: 28pt;
  color: #ff9800;
  margin-bottom: 10px;
}

.prosp-confirm-title {
  font-size: 12pt;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.prosp-confirm-text {
  font-size: 9.5pt;
  color: #666;
  margin-bottom: 18px;
  line-height: 1.5;
}

.prosp-confirm-btns {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.prosp-client-type-selector {
  display: flex;
  gap: 6px;
}

/* ---- Modal nouveau prospect ---- */

.prosp-modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: prospModalFadeIn 0.15s ease;
}

@keyframes prospModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.prosp-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  animation: prospModalSlideIn 0.2s ease;
}

@keyframes prospModalSlideIn {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.prosp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.prosp-modal-header h3 {
  margin: 0;
  font-size: 12pt;
  color: #333;
}

.prosp-modal-close {
  width: 30px;
  height: 30px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.prosp-modal-close:hover {
  background: #e0e0e0;
}

.prosp-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prosp-modal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.prosp-modal-tab {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 9pt;
  font-weight: 600;
  color: #666;
  text-align: center;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.prosp-modal-tab:hover {
  background: #f5f5f5;
}

.prosp-modal-tab.active {
  background: var(--main-bg-color);
  color: #fff;
  border-color: var(--main-bg-color);
}

.prosp-new-tiers-info {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  min-height: 120px;
}

.prosp-new-tiers-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 100px;
  color: #bbb;
  font-size: 9pt;
}

.prosp-new-tiers-placeholder .fa {
  font-size: 20pt;
}

.prosp-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #eee;
}

.prosp-form-row-2 {
  display: flex;
  gap: 10px;
}

.prosp-form-row-2 .prosp-form-group {
  flex: 1;
}

.prosp-form-select {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 9.5pt;
  font-family: inherit;
  min-height: 36px;
  background: #fff;
  width: 100%;
}

/* ---- Toolbar select ---- */

.prosp-toolbar select {
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 9pt;
  background: #fff;
}

/* ---- Badge devis ---- */

.prosp-devis-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 8pt;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

.prosp-devis-ref {
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
}

.prosp-devis-ref:hover {
  text-decoration: underline;
}

/* ---- Liste devis dans panel détail ---- */

.prosp-devis-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prosp-devis-item {
  padding: 8px 10px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid #ddd;
}

.prosp-devis-item-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.prosp-devis-badge-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 9px;
  flex-shrink: 0;
}

.prosp-devis-item-ref {
  font-weight: 600;
  font-size: 9pt;
  color: var(--main-bg-color);
  text-decoration: none;
}

.prosp-devis-item-ref:hover {
  text-decoration: underline;
}

.prosp-devis-item-statut {
  font-size: 8pt;
  color: #888;
  margin-left: auto;
}

.prosp-devis-item-details {
  display: flex;
  gap: 8px;
  font-size: 8.5pt;
  color: #555;
  margin-top: 3px;
  padding-left: 26px;
}

.prosp-devis-item-date {
  color: #999;
}

/* ---- Badges température ---- */

.prosp-temp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 8pt;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

/* ---- Pagination ---- */

.prosp-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid #eee;
  font-size: 8.5pt;
  color: #888;
}

.prosp-pagination-controls {
  display: flex;
  gap: 4px;
}

.prosp-pagination-btn {
  padding: 3px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 8.5pt;
}

.prosp-pagination-btn:hover {
  background: #f0f0f0;
}

.prosp-pagination-btn.active {
  background: var(--main-bg-color);
  color: #fff;
  border-color: var(--main-bg-color);
}

.prosp-pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- Panel latéral ---- */

.prosp-panel {
  width: 400px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  max-height: calc(100vh - 220px);
  display: flex;
  flex-direction: column;
}

.prosp-panel-tabs {
  display: flex;
  border-bottom: 2px solid #eee;
}

.prosp-panel-tab {
  padding: 8px 16px;
  font-size: 9pt;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.prosp-panel-tab:hover {
  color: #555;
}

.prosp-panel-tab.active {
  color: var(--main-bg-color);
  border-bottom-color: var(--main-bg-color);
}

.prosp-panel-swipe {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.prosp-panel-body {
  padding: 14px 16px;
  flex: 1;
  overflow-y: auto;
}

.prosp-panel-empty {
  text-align: center;
  padding: 40px 20px;
  color: #aaa;
  font-size: 10pt;
}

.prosp-panel-empty .fa {
  font-size: 28pt;
  display: block;
  margin-bottom: 10px;
}

/* ---- Détail prospect ---- */

.prosp-detail-section {
  margin-bottom: 14px;
}

.prosp-detail-section-title {
  font-size: 8.5pt;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.prosp-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 9pt;
}

.prosp-detail-row-label {
  color: #888;
}

.prosp-detail-row-value {
  font-weight: 600;
  color: #333;
}

.prosp-detail-row-value a {
  color: var(--main-bg-color);
  text-decoration: none;
}

.prosp-detail-row-value a:hover {
  text-decoration: underline;
}

.prosp-note-content {
  font-size: 9pt;
  color: #555;
  background: #f8f9fa;
  padding: 8px 10px;
  border-radius: 6px;
  white-space: pre-wrap;
}

/* ---- Sélecteur de température ---- */

.prosp-temp-selector {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.prosp-temp-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 2px solid;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 8.5pt;
  font-weight: 600;
  transition: all 0.15s;
}

.prosp-temp-btn:hover {
  opacity: 0.8;
}

.prosp-temp-btn.active {
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ---- Historique interactions ---- */

.prosp-history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.prosp-history-item {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.prosp-history-item.prosp-history-next {
  background: #fff8e1;
  margin: 0 -16px;
  padding: 10px 16px;
  border-left: 3px solid #ff9800;
}

.prosp-history-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.prosp-history-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--main-bg-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
}

.prosp-history-next .prosp-history-icon {
  background: #ff9800;
}

.prosp-history-channel {
  font-weight: 600;
  font-size: 9pt;
  color: #333;
}

.prosp-history-date {
  font-size: 8pt;
  color: #999;
  margin-left: auto;
}

.prosp-history-note {
  font-size: 9pt;
  color: #555;
  margin-left: 32px;
  white-space: pre-wrap;
}

.prosp-history-user {
  font-size: 8pt;
  color: #aaa;
  margin-left: 32px;
  margin-top: 2px;
}

/* ---- Formulaire interaction ---- */

.prosp-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prosp-form-title {
  font-size: 10pt;
  color: #333;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.prosp-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prosp-form-group label {
  font-size: 8.5pt;
  font-weight: 600;
  color: #555;
}

.prosp-form-group input[type="text"],
.prosp-form-group input[type="date"],
.prosp-form-group textarea {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 9.5pt;
  font-family: inherit;
  min-height: 36px;
}

.prosp-form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.prosp-form-group input:focus,
.prosp-form-group textarea:focus {
  outline: none;
  border-color: var(--main-bg-color);
  box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.15);
}

.prosp-form-separator {
  height: 1px;
  background: #eee;
  margin: 4px 0;
}

/* ---- Sélecteur canal ---- */

.prosp-channel-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prosp-channel-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 8.5pt;
  font-weight: 500;
  color: #555;
  transition: all 0.15s;
}

.prosp-channel-btn:hover {
  background: #f0f0f0;
}

.prosp-channel-btn.active {
  background: var(--main-bg-color);
  color: #fff;
  border-color: var(--main-bg-color);
}

/* ---- Sélecteur intérêt (étoiles) ---- */

.prosp-interest-selector {
  display: flex;
  align-items: center;
  gap: 2px;
}

.prosp-interest-btn {
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: #ddd;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prosp-interest-btn.active {
  color: #ff9800;
}

.prosp-interest-btn:hover {
  transform: scale(1.2);
}

.prosp-interest-label {
  margin-left: 8px;
  font-size: 8.5pt;
  color: #888;
  font-weight: 500;
}

/* ---- Bouton retour mobile (caché par défaut) ---- */

.prosp-mobile-back {
  display: none;
}

/* ---- Responsive ---- */

@media (max-width: 1200px) {
  .prosp-panel {
    width: 340px;
  }
}

@media (max-width: 992px) {
  .prosp-main-layout {
    flex-direction: column;
  }
  .prosp-panel {
    width: 100%;
    max-height: none;
    display: none;
  }

  /* Panel en overlay plein écran sur tablette aussi */
  body.prosp-mobile-panel-open .prosp-panel {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    border-radius: 0;
    max-height: 100vh;
    max-height: 100dvh;
  }

  body.prosp-mobile-panel-open .prosp-table-container,
  body.prosp-mobile-panel-open .prosp-kpi-row,
  body.prosp-mobile-panel-open .prosp-toolbar,
  body.prosp-mobile-panel-open .header-prospection {
    display: none !important;
  }

  .prosp-mobile-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--main-bg-color);
    color: #fff;
    font-size: 10pt;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
  }

  .prosp-mobile-actions-row {
    display: table-row;
  }

  .prosp-mobile-actions-row td {
    padding: 0 !important;
    border-bottom: 2px solid #e8e8e8 !important;
  }

  /* Panel tabs tablette */
  .prosp-panel-tabs {
    flex-shrink: 0;
  }

  .prosp-panel-tab {
    flex: 1;
    text-align: center;
  }

  /* Panel body scrollable */
  .prosp-panel-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* KPI compacts sur tablette */
  .prosp-kpi-row {
    gap: 8px;
    margin-bottom: 10px;
  }

  .prosp-kpi-card {
    padding: 8px 10px;
    gap: 8px;
    min-width: 120px;
  }

  .prosp-kpi-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
  }

  .prosp-kpi-value {
    font-size: 14pt;
  }

  .prosp-kpi-label {
    font-size: 7.5pt;
  }

  /* Boutons conversion empilés */
  .prosp-convert-btns {
    flex-direction: column;
  }

  /* Température selector wrap */
  .prosp-temp-selector {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {

  .page_prospection {
    padding: 6px 8px;
  }

  /* ---- KPI mini en grille 3 colonnes ---- */
  .prosp-kpi-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    margin-bottom: 6px;
  }

  .prosp-kpi-card {
    min-width: unset;
    padding: 4px 6px;
    gap: 5px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  }

  .prosp-kpi-icon {
    width: 22px;
    height: 22px;
    font-size: 10px;
    border-radius: 5px;
  }

  .prosp-kpi-value {
    font-size: 10pt;
    line-height: 1;
  }

  .prosp-kpi-label {
    font-size: 6.5pt;
    margin-top: 0;
  }

  /* ---- Toolbar ---- */
  .prosp-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .prosp-toolbar-main {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .prosp-toolbar-main input[type="text"] {
    flex: 1;
    min-width: 0;
  }

  .prosp-temp-counts {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* ---- Table ---- */
  .prosp-hide-mobile {
    display: none !important;
  }

  .prosp-show-mobile-only {
    display: inline-flex !important;
  }

  .prosp-mobile-actions-row {
    display: table-row;
  }

  .prosp-mobile-actions-row td {
    padding: 0 !important;
    border-bottom: 2px solid #e8e8e8 !important;
  }

  .prosp-table {
    font-size: 8.5pt;
  }

  .prosp-table thead th {
    padding: 6px 6px;
    font-size: 7.5pt;
  }

  .prosp-table tbody td {
    padding: 6px 6px;
  }

  .prosp-table-scroll {
    max-height: calc(100vh - 400px);
  }

  /* Header mobile */
  .header-prospection {
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-prospection h1 {
    font-size: 13pt;
  }

  /* Panel tab mobile */
  .prosp-panel-tab {
    padding: 10px 8px;
    font-size: 8.5pt;
  }

  .prosp-mobile-back:active {
    opacity: 0.8;
  }

  /* Formulaire mobile : targets tactiles larges */
  .prosp-form-group input[type="text"],
  .prosp-form-group input[type="date"],
  .prosp-form-group textarea {
    min-height: 44px;
    font-size: 10pt;
  }

  .prosp-channel-btn {
    padding: 8px 14px;
    font-size: 9pt;
  }

  .prosp-interest-btn {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .prosp-btn-block {
    min-height: 44px;
  }

  /* Pagination mobile */
  .prosp-pagination {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  /* Modal mobile plein écran */
  .prosp-modal {
    width: 100%;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .prosp-modal-body {
    flex: 1;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
  }

  .prosp-modal-footer {
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .prosp-modal-footer .prosp-btn {
    min-height: 44px;
    flex: 1;
    justify-content: center;
  }

  .prosp-form-row-2 {
    flex-direction: column;
    gap: 10px;
  }

  .prosp-form-select {
    min-height: 44px;
  }

  .prosp-modal-tab {
    padding: 10px 8px;
    font-size: 8.5pt;
  }

  /* Boutons conversion empilés */
  .prosp-convert-btns {
    flex-direction: column;
  }

  .prosp-convert-btns .prosp-btn {
    min-height: 44px;
    justify-content: center;
  }

  /* Toolbar select mobile */
  .prosp-toolbar select {
    width: 100%;
  }

  /* Popup confirmation mobile */
  .prosp-confirm {
    width: 90vw;
  }

  .prosp-confirm-btns .prosp-btn {
    min-height: 44px;
    flex: 1;
    justify-content: center;
  }

  /* Client type toggle mobile */
  .prosp-client-type-toggle {
    flex-direction: column;
    gap: 8px;
  }

  /* Temp selector mobile */
  .prosp-temp-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .prosp-temp-btn {
    justify-content: center;
    min-height: 40px;
  }
}
