/* ═══════════════════════════════════════
   DFS — Enterprise light theme
   ═══════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  height: 100vh;
  overflow: hidden;
}

/* ── Layout deux colonnes ────────────────────────────────────────────────── */
.layout {
  display: flex;
  height: calc(100vh - 38px);  /* 38px = topnav */
  margin-top: 38px;
}

/* ── Panneau arbre ───────────────────────────────────────────────────────── */
#tree-panel {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surf);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text3);
  flex-shrink: 0;
  background: var(--surf2);
}

.tree-controls { display: flex; gap: 5px; }

button {
  background: var(--surf);
  color: var(--text2);
  border: 1px solid var(--border2);
  border-radius: 2px;
  padding: 2px 8px;
  font-family: var(--sans);
  font-size: 10px;
  cursor: pointer;
  transition: all .12s;
}

button:hover { background: var(--surf3); color: var(--text); border-color: var(--blue-dim); }

.search-box {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.search-box input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 2px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
  transition: border-color .15s;
}

.search-box input:focus { border-color: var(--blue-dim); }
.search-box input::placeholder { color: var(--text3); }

#treeContainer {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

/* ── Namespace root ──────────────────────────────────────────────────────── */
.ns-root { margin-bottom: 8px; }

.ns-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: var(--surf2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ns-icon { font-size: 13px; }

.ns-path {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  flex: 1;
}

.ns-type {
  font-family: var(--mono);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--teal-bg);
  border: 1px solid var(--teal-bd);
  color: var(--teal);
  text-transform: uppercase;
}

/* ── Arbre ───────────────────────────────────────────────────────────────── */
ul.tree, ul.tree-children {
  list-style: none;
  padding-left: 0;
}

ul.tree-children { padding-left: 16px; }
ul.tree-children.collapsed { display: none; }

.tree-item { white-space: nowrap; }

.tree-line {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 14px;
  cursor: pointer;
  user-select: none;
  transition: background .08s;
  border-radius: 1px;
}

.tree-line:hover { background: var(--surf3); }
.tree-line.active {
  background: var(--blue-bg);
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}

.tree-toggle {
  font-size: 8px;
  color: var(--text3);
  width: 12px;
  flex-shrink: 0;
  transition: transform .1s;
}

.tree-icon { font-size: 11px; flex-shrink: 0; }

.tree-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text3);
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-label.has-target {
  color: var(--text);
  font-weight: 600;
}

.tree-warn {
  font-size: 10px;
  margin-left: 4px;
  color: var(--orange);
}

/* ── Panneau détail ──────────────────────────────────────────────────────── */
#detail-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#detail-panel .panel-header {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text3);
}

#detailContent {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text3);
  font-size: 13px;
  gap: 10px;
}

.detail-empty .empty-icon { font-size: 32px; }

.detail-name {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-icon { font-size: 18px; }

.detail-path {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  background: var(--blue-bg);
  border: 1px solid var(--blue-bd);
  border-radius: 4px;
  padding: 6px 10px;
  margin: 10px 0 16px;
  word-break: break-all;
}

.detail-section-title {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.detail-count {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text2);
  background: var(--surf2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 0 6px;
}

/* Cibles */
.target-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 6px;
  background: var(--surf);
}

.target-row.target-offline {
  background: var(--red-bg);
  border-color: var(--red-bd);
}

.target-state { font-size: 13px; flex-shrink: 0; margin-top: 1px; }

.target-path {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.target-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
}

.no-target {
  font-style: italic;
  color: var(--text3);
  font-size: 12px;
}

/* Sous-dossiers */
.children-list { display: flex; flex-direction: column; gap: 3px; }

.child-item {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text2);
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: background .1s;
  border: 1px solid transparent;
}

.child-item:hover { background: var(--surf3); border-color: var(--border2); color: var(--text); }
