/* +--------------------------------------------------------------------------+
// 2026 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// Mise en page de l'ecran Administration > Outils > Gestion des fichiers,
// remplace la disposition dijit/BorderContainer de l'ancien rendu Dojo. */
/*------------------------------------------------------------------------------------------*/

.misc-files {
  display: flex;
  height: 800px;
  width: 100%;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.misc-files-left {
  flex: 0 0 20%;
  min-width: 220px;
  overflow: auto;
  border-right: 1px solid #ccc;
  box-sizing: border-box;
}

.misc-files-tree-toolbar {
  display: flex;
  gap: 8px;
  padding: 4px 8px;
  border-bottom: 1px solid #eee;
}

.misc-files-tree-toolbar i {
  cursor: pointer;
  color: #6b7280;
  font-size: 1.1em;
}

.misc-files-tree-toolbar i:hover {
  color: #374151;
}

.misc-files-right {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.misc-files-tabs {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.misc-files-tabs-nav {
  display: flex;
  border-bottom: 1px solid #ccc;
  flex-shrink: 0;
}

.misc-files-tabs-nav button {
  padding: 6px 14px;
  border: none;
  background: #f2f2f2;
  cursor: pointer;
  border-right: 1px solid #ccc;
}

.misc-files-tabs-nav button.is-active {
  background: #fff;
  font-weight: bold;
  border-bottom: 2px solid #4472c4;
}

.misc-files-tabs-panel {
  flex: 1 1 auto;
  overflow: auto;
  padding: 8px;
}

.misc-files-bottom {
  flex: 0 0 auto;
  border-top: 1px solid #ccc;
  overflow: hidden;
}

.misc-files-bottom.is-expanded {
  flex: 0 0 30%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.misc-files-bottom-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: #f8f9fb;
  cursor: pointer;
  font-weight: 600;
  text-align: left;
  flex-shrink: 0;
}

.misc-files-bottom-header:hover {
  background: #eef1f5;
}

.misc-files-bottom-header i {
  color: #9ca3af;
  transition: transform 0.15s ease;
}

.misc-files-bottom-panel {
  overflow: auto;
  padding: 8px;
}

/* Arbre des fichiers substituables */
.files-tree {
  padding: 6px;
}

.files-tree-root,
.files-tree-node-children {
  list-style: none;
  margin: 0;
  padding-left: 10px;
}

.files-tree-root {
  padding-left: 0;
  margin: 5px 0 5px 5px!important;
}

.files-tree-node-label {
  display: block;
  padding: 3px 6px;
  border-radius: 10px;
  cursor: default;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.files-tree-node-label.is-folder,
.files-tree-node-label.is-selectable {
  cursor: pointer;
}

.files-tree-node-label.is-folder:hover,
.files-tree-node-label.is-selectable:hover {
  background: #eef4fb;
  transform: translateX(2px);
}

.files-tree-node-label.is-current {
  background: #fdf0d5;
  box-shadow: inset 3px 0 0 #f2a154;
  font-weight: 600;
}

.files-tree-node-icon {
  display: inline-block;
  width: 16px;
  text-align: center;
  margin-right: 4px;
  color: #6b7280;
}

/* Palette pastel par type de noeud : dossier (ambre), fichier (bleu), fichier de substitution (lavande). */
.files-tree-node-icon.fa-folder,
.files-tree-node-icon.fa-folder-open {
  color: #e8b563;
}

.files-tree-node-icon.fa-file-text-o {
  color: #7fb0e0;
}

.files-tree-node-icon.fa-copy {
  color: #c79fe0;
}

.files-tree-node-expand {
  cursor: pointer;
  width: 12px;
  color: #9ca3af;
  transition: transform 0.15s ease;
}

.files-tree-node-expand.is-expanded {
  transform: rotate(90deg);
}

.files-tree-node-slide-enter-active,
.files-tree-node-slide-leave-active {
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.files-tree-node-slide-enter,
.files-tree-node-slide-leave-to {
  opacity: 0;
  transform: translateY(-4px);
}

/* Onglet reglages : formulaire injecte tel quel + glisser-deposer */
.file-settings table {
  width: 100%;
  border-collapse: collapse;
}

.file-settings th,
.file-settings td {
  padding: 4px 8px;
  border-bottom: 1px solid #eee;
}

.file-settings-dnd-row {
  cursor: move;
}

.file-settings-dnd-row.is-dragging {
  opacity: 0.4;
}

/* Editeur Ace (onglet code source + panneau bas) */
.ace-viewer h3 {
  margin: 4px 0;
  font-size: 0.95em;
  word-break: break-all;
}

.ace-viewer .ace_editor {
  border: 1px solid #ccc;
}
