.docs-tab { padding: 0; height: 100%; display: flex; flex-direction: column; }

.docs-toolbar {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .55rem .9rem;
  background: rgba(24, 24, 27, .22);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  flex-wrap: wrap;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.docs-toolbar label { font-size: .82rem; color: #d4d4d8; display: flex; align-items: center; gap: .3rem; }
.docs-toolbar select, .docs-toolbar button, .docs-toolbar input {
  background: rgba(39, 39, 42, .45); color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px; padding: .25rem .55rem; font-size: .82rem;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.docs-toolbar input[type="search"] { min-width: 260px; font-family: inherit; }
.docs-toolbar input[type="search"]:focus { outline: none; border-color: rgba(var(--p-base-rgb), .55); box-shadow: 0 0 0 3px rgba(var(--p-base-rgb), .12); }
.docs-toolbar .docs-count { margin-left: auto; color: var(--p-light); font-size: .78rem; font-family: 'Menlo', 'Consolas', monospace; }

/* ===== Layout grille sidebar + main, comme Chat ===== */
.docs-layout { display: grid; grid-template-columns: 280px 1fr; flex: 1; min-height: 0; transition: grid-template-columns .2s; }
.docs-layout.sidebar-hidden { grid-template-columns: 0 1fr; }
.docs-layout.sidebar-hidden #docs-sidebar { visibility: hidden; border-right: none; }

#docs-sidebar {
  background: rgba(20, 20, 23, .25);
  border-right: 1px solid rgba(255, 255, 255, .1);
  overflow-y: auto;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
#docs-tree { list-style: none; margin: 0; padding: .3rem 0; }

/* ===== Treeview : groupe rétractable ===== */
#docs-tree .group { padding: 0; margin: 0; background: none; border: none; }
#docs-tree .group .g-toggle {
  display: flex;
  align-items: center;
  gap: .4rem;
  width: 100%;
  padding: .35rem .75rem;
  background: transparent;
  border: none;
  color: var(--p-base);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  cursor: pointer;
  text-align: left;
  font-family: 'Menlo', 'Consolas', monospace;
  font-weight: 600;
  transition: background .12s, color .12s;
  border-bottom: 1px solid rgba(var(--p-base-rgb), .1);
}
#docs-tree .group .g-toggle:hover { background: rgba(var(--p-base-rgb), .07); }
#docs-tree .group .g-chevron {
  display: inline-block;
  width: 12px;
  font-size: .75rem;
  color: var(--p-base);
  transition: transform .15s;
  text-align: center;
  line-height: 1;
}
#docs-tree .group.collapsed .g-chevron { transform: rotate(-90deg); }
/* Standard sidebar : .tc-icon — aligné sur surveillance/access (width 22px, opacity .75/.95/1) */
#docs-tree .tc-icon {
  flex-shrink: 0; opacity: .75;
  width: 22px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--p-base);
}
#docs-tree .group .g-toggle:hover .tc-icon { opacity: .95; }
#docs-tree .group .g-name { flex: 1; color: var(--p-base); }
#docs-tree .group .g-count { color: #64748b; font-size: .64rem; font-weight: normal; }
/* ===== Items (titre uniquement, 1 ligne, ellipsis) ===== */
#docs-tree .doc-item {
  padding: .32rem .75rem .32rem 1.9rem;
  cursor: pointer;
  display: block;
  position: relative;
  transition: background .12s, color .12s;
}
#docs-tree .doc-item::before {
  content: '';
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #475569;
  transition: background .15s;
}
#docs-tree .doc-item:hover { background: rgba(255, 255, 255, .04); }
#docs-tree .doc-item:hover::before { background: var(--p-light); }
#docs-tree .doc-item.active {
  background: rgba(var(--p-glow-rgb), .15);
  box-shadow: inset 2px 0 0 var(--p-base), inset 0 0 18px rgba(var(--p-glow-rgb), .08);
}
#docs-tree .doc-item.active::before { background: var(--p-base); box-shadow: 0 0 6px var(--p-base); }
#docs-tree .doc-item.is-hidden { display: none; }

#docs-tree .di-title {
  color: #e4e4e7;
  font-size: .83rem;
  line-height: 1.35;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#docs-tree .doc-item.active .di-title { color: var(--p-base); font-weight: 600; }

/* ===== Main panel ===== */
#docs-main { display: flex; flex-direction: column; background: transparent; position: relative; overflow: hidden; min-height: 0; }

/* [hidden] doit forcer display:none car nos règles flex l'écrasent sinon */
#docs-empty[hidden], #docs-viewer[hidden] { display: none !important; }

.docs-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-style: italic;
  font-size: .88rem;
  padding: 1rem;
}

#docs-viewer { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.docs-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .6rem .9rem;
  background: rgba(24, 24, 27, .3);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  flex-wrap: wrap;
}
.dv-info { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.dv-category {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: .15rem .5rem;
  background: rgba(var(--p-base-rgb), .15);
  color: var(--p-base);
  border-radius: 999px;
  font-family: 'Menlo', 'Consolas', monospace;
  border: 1px solid rgba(var(--p-base-rgb), .3);
}
.dv-path { color: #64748b; font-size: .72rem; font-family: 'Menlo', 'Consolas', monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dv-actions { display: flex; gap: .4rem; align-items: center; flex-shrink: 0; }
.dv-actions .t-btn {
  background: rgba(39, 39, 42, .5);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  padding: .3rem .65rem;
  font-size: .78rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: background .15s, border-color .15s;
}
.dv-actions .t-btn:hover { background: rgba(63, 63, 70, .65); border-color: rgba(var(--p-base-rgb), .3); }
.dv-actions .t-btn.primary {
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .85), rgba(var(--p-glow-rgb), .75));
  color: var(--p-text-on);
  border-color: rgba(var(--p-soft-rgb), .8);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(var(--p-glow-rgb), .3);
}
.dv-actions .t-btn.primary:hover { box-shadow: 0 0 18px rgba(var(--p-glow-rgb), .5); }

#dv-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: rgba(10, 10, 12, .4);
}

/* Handle sidebar (repris de Chat) */
#docs-main .sidebar-handle {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 12px; height: 64px;
  background: rgba(39, 39, 42, .55);
  border: 1px solid rgba(255, 255, 255, .08);
  border-left: none;
  border-radius: 0 6px 6px 0;
  color: var(--p-light);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1; padding: 0; z-index: 10;
  transition: background .15s, color .15s;
  backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
}
#docs-main .sidebar-handle:hover { background: rgba(var(--p-base-rgb), .18); color: var(--p-base); }

/* ============================================================================
   STANDARD TOOLBAR — uniforme reference Biometrie sante (Vincent 2026-05-10)
   Zone figee (min-height 3.15rem) + controls cohérents (bg .45, radius 6, h 28).
   ============================================================================ */
.docs-toolbar {
  min-height: 3.15rem !important;
  box-sizing: border-box !important;
}
.docs-toolbar input[type="search"],
.docs-toolbar input[type="text"],
.docs-toolbar input[type="date"],
.docs-toolbar input[type="number"],
.docs-toolbar select,
.docs-toolbar button.t-btn {
  background: rgba(39, 39, 42, .45);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px;
  padding: .22rem .55rem;
  font-size: .82rem;
  font-family: 'Menlo','Consolas',monospace;
  height: 28px;
  box-sizing: border-box;
  line-height: 1.2;
}
.docs-toolbar button.t-btn:hover:not(:disabled) {
  background: rgba(var(--p-base-rgb), .18);
  color: var(--p-base);
  border-color: rgba(var(--p-base-rgb), .35);
}
.docs-toolbar label {
  font-size: .82rem;
  color: #d4d4d8;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  line-height: 1.2;
}
