/* ═══════════════════════════════════════════════════════════════════════════
   GED HEADER DOCUMENTS — 3 DOSSIERS 7000.pro (LAYOUT CORRIGÉ)
   ═════════════════════════════════════════════════════════════════════════ */

/* PAGE GÉNÉRALE */
.ged-page {
  padding: 0;
}

/* EN-TÊTE */
.ged-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 40px;
  background: linear-gradient(135deg, #f5f7fa 0%, #f0f3fa 100%);
  border-bottom: 2px solid #0BAE9F;
  margin: 0 -40px 30px -40px;
}

.ged-header h1 {
  margin: 0;
  font-size: 1.8em;
  color: #044a52;
  font-weight: 700;
}

.ged-stat {
  display: inline-block;
  padding: 10px 18px;
  background: #067A72;
  color: white;
  border-radius: 24px;
  font-size: 0.95em;
  font-weight: 600;
}

.ged-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  color: #999;
  text-align: center;
}

.ged-empty-icon {
  font-size: 4em;
  margin-bottom: 20px;
  opacity: 0.4;
}

.ged-empty-text {
  font-size: 1.1em;
  color: #999;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ONGLETS (RESPONSIVE)
   ═════════════════════════════════════════════════════════════════════════ */

.ged-tabs-container {
  display: none;  /* Hidden par défaut (desktop 3-colonnes) */
  margin: 20px -40px 0 -40px;
  padding: 0 40px;
  border-bottom: 1px solid #e0e6f2;
  background: white;
}

.ged-tabs {
  gap: 0;
  margin: 0;
  padding: 0;
}

.ged-tab {
  flex: 1;
  padding: 16px 20px;
  border: none;
  background: transparent;
  color: #666;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  text-align: center;
}

.ged-tab:hover {
  color: #0BAE9F;
  background: #f8f9fb;
}

.ged-tab.active {
  color: #0BAE9F;
  border-bottom-color: #0BAE9F;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTAINER 3-COLONNES
   ═════════════════════════════════════════════════════════════════════════ */

.ged-container {
  display: grid;
  grid-template-columns: 280px 1fr 350px;
  gap: 20px;
  padding: 20px 40px;
  min-height: 600px;
  height: auto;
}
/* 21/09 (contrôle visuel) : les largeurs en % de l'ancien bloc « GED 3COL » de 7000pro.css écrasaient les colonnes de
   la grille ; ici, chaque colonne prend sa case. */
.ged-container > .ged-sidebar, .ged-container > .ged-list, .ged-container > .ged-preview { width: auto; min-width: 0; }
/* les onglets Dossiers / Documents / Aperçu sont ceux du téléphone */
.ged-tabs { display: none; }
@media (max-width: 767px) { .ged-tabs { display: flex; } }

/* ─────────────────────────────────────────────────────────────────────── */
/* COLONNE 1 : DOSSIERS (SIDEBAR)                                          */
/* ─────────────────────────────────────────────────────────────────────── */

.ged-sidebar {
  background: white;
  border: 1px solid #e0e6f2;
  border-radius: 8px;
  padding: 20px 15px;
  overflow-y: auto;
  max-height: 600px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ged-sidebar-title {
  font-size: 0.95em;
  font-weight: 700;
  color: #044a52;
  margin: 0 0 15px 0;
  padding: 0;
}

.ged-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  margin-bottom: 8px;
  background: #f8f9fb;
  border: 1px solid #e0e6f2;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9em;
}

.ged-folder:hover {
  background: #f0f3fa;
  border-color: #0BAE9F;
  color: #0BAE9F;
}

.ged-folder.ged-folder-selected {
  background: #067A72;
  color: white;
  border-color: #0BAE9F;
}

.ged-folder-toggle {
  width: 16px;
  text-align: center;
  font-size: 0.85em;
  font-weight: 700;
  flex-shrink: 0;
}

.ged-folder-icon {
  font-size: 1.1em;
  flex-shrink: 0;
}

.ged-folder-name {
  flex: 1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ged-folder-count {
  background: rgba(0, 0, 0, 0.15);
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: 600;
  flex-shrink: 0;
}

.ged-folder-items {
  margin: 8px 0 8px 24px;
  padding: 8px;
  background: rgba(11, 174, 159, 0.08);
  border-left: 2px solid #0BAE9F;
  border-radius: 4px;
  max-height: 150px;
  overflow-y: auto;
}

.ged-folder-item {
  padding: 8px 10px;
  margin-bottom: 4px;
  background: white;
  border: 1px solid #e0e6f2;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.2s;
}

.ged-folder-item:hover {
  background: #f0f3fa;
  border-color: #0BAE9F;
  color: #0BAE9F;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* COLONNE 2 : LISTE DOCUMENTS                                             */
/* ─────────────────────────────────────────────────────────────────────── */

.ged-list {
  background: white;
  border: 1px solid #e0e6f2;
  border-radius: 8px;
  padding: 20px;
  overflow-y: auto;
  max-height: 600px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ged-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e6f2;
}

.ged-list-title {
  font-size: 0.95em;
  font-weight: 700;
  color: #044a52;
  margin: 0;
}

.ged-sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85em;
  white-space: nowrap;
}

.ged-sort-control label {
  font-weight: 600;
  color: #666;
  margin: 0;
}

.ged-sort-select {
  padding: 6px 10px;
  border: 1px solid #e0e6f2;
  border-radius: 4px;
  background: white;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s;
}

.ged-sort-select:hover,
.ged-sort-select:focus {
  border-color: #0BAE9F;
  outline: none;
}

.ged-list-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ged-document-item {
  padding: 12px 14px;
  background: #f8f9fb;
  border: 2px solid #e0e6f2;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.ged-document-item:hover {
  border-color: #0BAE9F;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.ged-document-item.ged-document-item-selected {
  border-color: #0BAE9F;
  background: #f0f3fa;
  box-shadow: 0 2px 8px rgba(11, 174, 159, 0.15);
}

.ged-doc-code {
  font-size: 0.9em;
  font-weight: 700;
  color: #0BAE9F;
  margin-bottom: 4px;
}

.ged-doc-title {
  font-size: 0.95em;
  font-weight: 600;
  color: #044a52;
  margin-bottom: 3px;
  word-break: break-word;
}

.ged-doc-meta {
  font-size: 0.85em;
  color: #999;
}

/* ─────────────────────────────────────────────────────────────────────── */
/* COLONNE 3 : APERÇU                                                      */
/* ─────────────────────────────────────────────────────────────────────── */

.ged-preview {
  background: white;
  border: 1px solid #e0e6f2;
  border-radius: 8px;
  padding: 20px;
  overflow-y: auto;
  max-height: 600px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ged-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: #999;
  text-align: center;
}

.ged-preview-empty-icon {
  font-size: 3.5em;
  margin-bottom: 15px;
  opacity: 0.3;
}

.ged-preview-empty-text {
  font-size: 0.95em;
  color: #999;
}

.ged-preview-label {
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  color: #0BAE9F;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.ged-preview-title {
  margin: 0 0 12px 0;
  font-size: 1.2em;
  font-weight: 700;
  color: #044a52;
  word-break: break-word;
}

.ged-preview-meta {
  font-size: 0.85em;
  color: #666;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e6f2;
  line-height: 1.5;
}

.ged-preview-meta-iso {
  color: #0BAE9F;
  font-weight: 600;
  margin-top: 8px;
}

.ged-preview-body {
  font-size: 0.9em;
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
  word-break: break-word;
}

.ged-preview-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ged-button {
  padding: 12px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}

.ged-button-primary {
  background: #067A72;
  color: white;
}

.ged-button-primary:hover {
  background: #06747D;
  box-shadow: 0 4px 12px rgba(4, 74, 82, 0.2);
}

.ged-button-secondary {
  background: white;
  color: #0BAE9F;
  border: 2px solid #0BAE9F;
}

.ged-button-secondary:hover {
  background: #f0f3fa;
}

.ged-button-tertiary {
  background: transparent;
  color: #666;
  border: 1px solid #e0e6f2;
}

.ged-button-tertiary:hover {
  border-color: #0BAE9F;
  color: #0BAE9F;
  background: #f8f9fb;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE (<768px)
   ═════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  /* Afficher les onglets */
  .ged-tabs-container {
    display: block;
  }

  /* Container : une seule colonne */
  .ged-container {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    min-height: auto;
  }

  /* Colonnes cachées par défaut */
  .ged-sidebar,
  .ged-list,
  .ged-preview {
    display: none;
    padding: 20px 40px;
    border: none;
    border-radius: 0;
    max-height: none;
    overflow-y: visible;
  }

  /* Colonne active visible */
  .ged-sidebar.active,
  .ged-list.active,
  .ged-preview.active {
    display: block;
  }

  /* Réajuster hauteur min */
  .ged-sidebar.active,
  .ged-list.active {
    min-height: 400px;
  }

  .ged-preview.active {
    min-height: 500px;
  }
}

@media (max-width: 1200px) {
  .ged-container {
    grid-template-columns: 240px 1fr 300px;
    gap: 15px;
    padding: 15px 20px;
  }

  .ged-sidebar,
  .ged-list,
  .ged-preview {
    max-height: 500px;
  }
}
