/* ============================================================
   COMMERCIAL - Gestion des Devis
   ============================================================ */

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

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

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

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

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

.cgd-kpi-card {
  flex: 1;
  min-width: 160px;
  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;
}

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

.cgd-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;
}

.cgd-kpi-icon.kpi-encours { background: #5c6bc0; }
.cgd-kpi-icon.kpi-conversion { background: #43a047; }
.cgd-kpi-icon.kpi-recurrent { background: #ff9800; }
.cgd-kpi-icon.kpi-relance { background: #e53935; }
.cgd-kpi-icon.kpi-prospects { background: #00acc1; }

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

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

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

.cgd-kpi-sub {
  font-size: 8pt;
  color: #aaa;
  margin-top: 1px;
}

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

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

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

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

.cgd-mobile-filters-toggle {
  display: none;
}

.cgd-mobile-filters-count {
  background: #e53935;
  color: #fff;
  font-size: 7pt;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
}

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

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

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

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

.cgd-relance-badge-sm {
  width: 18px;
  height: 18px;
  font-size: 7pt;
}

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

.cgd-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;
}

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

.cgd-mobile-action-relance {
  background: #fff3e0;
  color: #e65100;
  border-color: #ffcc80;
}

.cgd-mobile-action-relance:active {
  background: #ffe0b2;
}

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

.cgd-mobile-action-dolibarr:active {
  background: #bbdefb;
}

.cgd-mobile-action-close {
  background: #ffebee;
  color: #c62828;
  border-color: #ef9a9a;
}

.cgd-mobile-action-close:active {
  background: #ffcdd2;
}

.cgd-mobile-action-billed {
  background: #fff9c4;
  color: #f57f17;
  border-color: #fff176;
}

.cgd-mobile-action-billed:active {
  background: #fff59d;
}

.cgd-toolbar label {
  font-weight: 600;
  font-size: 9pt;
  color: #555;
}

.cgd-toolbar input[type="date"] {
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 9pt;
}

.cgd-toolbar input[type="text"] {
  padding: 4px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 9pt;
  min-width: 180px;
}

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

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

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

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

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

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

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

.cgd-btn-warning {
  background: #ff9800;
  color: #fff;
  border-color: #f57c00;
}

.cgd-btn-warning:hover {
  background: #f57c00;
}

.cgd-btn-danger {
  background: #e53935;
  color: #fff;
  border-color: #c62828;
}

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

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

.cgd-toolbar-separator {
  width: 1px;
  height: 24px;
  background: #ddd;
}

/* ---- Layout principal (table + panel) ---- */

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

.cgd-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;
}

.cgd-panel {
  width: 380px;
  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;
}

/* ---- Table devis ---- */

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

.cgd-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;
}

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

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

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

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

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

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

.cgd-table .cgd-col-ref a {
  color: var(--main-bg-color);
  text-decoration: none;
  font-weight: 600;
}

.cgd-table .cgd-col-ref a:hover {
  text-decoration: underline;
}

.cgd-table .cgd-col-montant {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- Statuts ---- */

.cgd-statut {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 8pt;
  font-weight: 600;
  white-space: nowrap;
}

.cgd-statut-0 { background: #e0e0e0; color: #555; }
.cgd-statut-1 { background: #bbdefb; color: #1565c0; }
.cgd-statut-2 { background: #c8e6c9; color: #2e7d32; }
.cgd-statut-3 { background: #ffcdd2; color: #c62828; }
.cgd-statut-4 { background: #fff9c4; color: #f57f17; }

/* ---- Indicateur relance ---- */

.cgd-relance-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 8pt;
  font-weight: 700;
  color: #fff;
}

.cgd-relance-vert { background: #43a047; }
.cgd-relance-orange { background: #ff9800; }
.cgd-relance-rouge { background: #e53935; }

/* ---- Tiers category dot ---- */

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

/* ---- Panel détail ---- */

.cgd-panel-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cgd-panel-header h3 {
  margin: 0;
  font-size: 11pt;
  color: #333;
}

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

.cgd-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;
}

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

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

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

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

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

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

/* ---- Détail devis ---- */

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

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

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

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

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

/* ---- Lignes produits ---- */

.cgd-lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5pt;
  margin-top: 6px;
}

.cgd-lines-table th {
  background: #f8f9fa;
  padding: 5px 8px;
  text-align: left;
  font-weight: 600;
  color: #666;
  font-size: 8pt;
}

.cgd-lines-table td {
  padding: 4px 8px;
  border-bottom: 1px solid #f0f0f0;
}

/* ---- Commande liée ---- */

.cgd-linked-order {
  padding: 8px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 6px;
}

.cgd-order-ecart {
  margin-top: 6px;
  padding: 5px 8px;
  background: #fff3e0;
  color: #e65100;
  border-radius: 6px;
  font-size: 8.5pt;
  font-weight: 600;
}

.cgd-order-ecart .fa {
  margin-right: 4px;
}

.cgd-order-link {
  text-decoration: none;
}

.cgd-order-link:hover .cgd-statut {
  opacity: 0.8;
}

.cgd-order-ecart-icon {
  color: #e65100;
  font-size: 8pt;
  margin-left: 3px;
}

/* ---- Relances ---- */

.cgd-relance-list {
  max-height: 200px;
  overflow-y: auto;
}

.cgd-relance-item {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 9pt;
}

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

.cgd-relance-date {
  font-size: 8pt;
  color: #888;
}

.cgd-relance-note {
  margin-top: 2px;
  color: #333;
}

.cgd-relance-form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.cgd-relance-form input {
  flex: 1;
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 9pt;
}

/* ---- Motif refus dropdown ---- */

.cgd-motif-select {
  padding: 3px 6px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 8.5pt;
  background: #fff;
  max-width: 130px;
}

/* ---- Stats panel ---- */

.cgd-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cgd-stat-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px;
}

.cgd-stat-card-title {
  font-size: 8pt;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.cgd-stat-bar {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
}

.cgd-stat-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cgd-stat-bar-fill {
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s;
}

.cgd-stat-bar-label {
  font-size: 7pt;
  color: #999;
  text-align: center;
}

.cgd-stat-bar-value {
  font-size: 7.5pt;
  font-weight: 600;
  color: #555;
}

/* ---- Camembert motifs ---- */

.cgd-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.cgd-pie-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8.5pt;
}

.cgd-pie-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cgd-pie-legend-count {
  color: #888;
  margin-left: auto;
}

/* ---- Segment badges ---- */

.cgd-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;
}

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

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

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

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

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

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

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

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

/* ---- Table scrollable ---- */

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

/* ---- Actions rapides ---- */

.cgd-actions-cell {
  white-space: nowrap;
  display: flex;
  gap: 4px;
}

.cgd-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #666;
  transition: all 0.15s;
}

.cgd-action-btn:hover {
  background: #f0f0f0;
  color: #333;
}

.cgd-action-btn.action-relance:hover {
  background: #fff3e0;
  color: #e65100;
  border-color: #ffcc80;
}

.cgd-action-btn.action-convert:hover {
  background: #e8f5e9;
  color: #2e7d32;
  border-color: #a5d6a7;
}

.cgd-action-btn.action-close:hover {
  background: #ffebee;
  color: #c62828;
  border-color: #ef9a9a;
}

.cgd-action-btn.action-billed:hover {
  background: #fff9c4;
  color: #f57f17;
  border-color: #fff176;
}

.cgd-action-btn.action-detail:hover {
  background: #e3f2fd;
  color: #1565c0;
  border-color: #90caf9;
}

/* ---- Compteurs statut dans toolbar ---- */

.cgd-statut-counts {
  display: flex;
  gap: 6px;
  align-items: center;
}

.cgd-statut-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 transparent;
}

.cgd-statut-count:hover {
  opacity: 0.8;
}

.cgd-statut-count.selected {
  border-color: #333;
}

/* ---- Panel relance footer fixe ---- */

.cgd-panel-relance-footer {
  padding: 10px 16px;
  border-top: 2px solid #eee;
  background: #fafafa;
  border-radius: 0 0 10px 10px;
  flex-shrink: 0;
}

.cgd-panel-relance-footer .cgd-relance-form {
  margin-top: 0;
}

/* ---- Popup relance rapide ---- */

.cgd-relance-rapide-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 8px 0;
  z-index: 200;
  min-width: 280px;
  animation: cgdDropdownFadeIn 0.15s ease;
}

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

.cgd-relance-rapide-title {
  font-size: 8.5pt;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 4px 14px 6px;
  border-bottom: 1px solid #eee;
  margin-bottom: 4px;
}

.cgd-relance-rapide-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 9pt;
  color: #333;
  text-align: left;
  transition: background 0.1s;
}

.cgd-relance-rapide-item:hover {
  background: #fff3e0;
}

.cgd-relance-rapide-item .fa {
  color: #ff9800;
  font-size: 9pt;
  width: 14px;
  text-align: center;
}

.cgd-relance-rapide-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

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

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

@media (max-width: 1200px) {
  .cgd-panel {
    width: 320px;
  }
}

@media (max-width: 992px) {
  .cgd-main-layout {
    flex-direction: column;
  }
  .cgd-panel {
    width: 100%;
    max-height: 50vh;
  }

  /* Fold6 déplié et tablettes : actions inline visibles */
  .cgd-mobile-actions-row {
    display: table-row;
  }

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

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

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

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

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

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

  .cgd-kpi-sub {
    font-size: 7pt;
  }
}

@media (max-width: 768px) {

  .page_commercial_gestion_devis {
    padding: 6px 8px;
  }

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

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

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

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

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

  .cgd-kpi-sub {
    font-size: 6pt;
  }

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

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

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

  .cgd-toolbar-main label {
    display: none;
  }

  .cgd-mobile-filters-toggle {
    display: flex;
  }

  .cgd-toolbar-filters {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
  }

  .cgd-toolbar-filters input[type="text"] {
    min-width: unset;
    width: 100%;
  }

  .cgd-toolbar-filters select {
    width: 100%;
  }

  .cgd-toolbar-filters.cgd-toolbar-filters-open {
    display: flex;
  }

  .cgd-toolbar-separator {
    display: none;
  }

  .cgd-statut-counts {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* ---- Table colonnes cachées + actions mobile visibles ---- */
  .cgd-hide-mobile {
    display: none !important;
  }

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

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

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

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

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

  .cgd-col-montant {
    font-size: 8pt;
  }

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

  /* ---- Panel en overlay plein écran ---- */
  .cgd-main-layout {
    flex-direction: column;
  }

  .cgd-panel {
    display: none;
    width: 100%;
    max-height: none;
  }

  body.cgd-mobile-panel-open .cgd-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.cgd-mobile-panel-open .cgd-table-container,
  body.cgd-mobile-panel-open .cgd-kpi-row,
  body.cgd-mobile-panel-open .cgd-toolbar,
  body.cgd-mobile-panel-open .header-commercial-gestion-devis {
    display: none !important;
  }

  /* Bouton retour mobile visible */
  .cgd-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;
  }

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

  /* Panel tabs mobile */
  .cgd-panel-tabs {
    flex-shrink: 0;
  }

  .cgd-panel-tab {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
  }

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

  /* Relance footer mobile */
  .cgd-panel-relance-footer {
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .cgd-relance-rapide-dropdown {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    top: auto;
    min-width: unset;
    border-radius: 12px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
  }

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

  /* Stats grid mobile */
  .cgd-stats-grid {
    grid-template-columns: 1fr;
  }
}
