/* ═══════════════════════════════════════════════════════════════════════════
   tf-module.css — Dossier Technique (PR-7N)
   ═══════════════════════════════════════════════════════════════════════════ */

.tf-shell { display: flex; flex-direction: column; height: 100%; }

.tf-topbar { display: flex; align-items: center; gap: 12px; padding: 0 20px; height: 56px;
  background: #e72c85 !important; flex-shrink: 0; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.tf-topbar-title { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: .02em; flex: 1; }
.tf-topbar-project { color: #fdeaf1; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.tf-topbar-project b { color: #fff; }

.tf-btn, .tf-btn-ghost, .tf-btn-export, .tf-btn-sm { cursor: pointer; border: none; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; transition: opacity .15s; }
.tf-btn-ghost { background: rgba(255,255,255,.15); color: #fff; padding: 6px 12px; }
.tf-btn-ghost:hover { background: rgba(255,255,255,.26); }
.tf-btn-xs { padding: 3px 7px; font-size: 11px; }
.tf-btn-export { background: #fff; color: #e72c85; padding: 7px 16px; }
.tf-btn-export:hover { opacity: .88; }
.tf-btn { background: #f3b2d0; color: #7a1f44; padding: 7px 14px; margin-right: 8px; }
.tf-btn:hover { opacity: .85; }
.tf-btn-sm { background: #eee; color: #333; padding: 4px 10px; font-size: 11.5px; }
.tf-btn-sm:hover { background: #ddd; }
.tf-btn-danger { background: #fde2e2; color: #e72c85; }

/* ── Bandeau "version soumise, lecture seule" ────────────────────────────── */
.tf-readonly-banner { flex-shrink: 0; background: #fef3c7; color: #92400e; font-size: 12.5px;
  font-weight: 600; padding: 7px 20px; text-align: center; border-bottom: 1px solid #fde68a; }

.tf-body { flex: 1; display: flex; min-height: 0; overflow: hidden; background: #fafafa; }

.tf-tree { width: 420px; flex-shrink: 0; overflow-y: auto; border-right: 1px solid #e5e7eb;
  background: #fff; padding: 10px 0; }
.tf-empty { padding: 24px; color: #9ca3af; font-style: italic; text-align: center; }

/* ── Item "Dashboard" en tête de l'arbre ─────────────────────────────────── */
.tf-dash-nav { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: #7a1040; border-bottom: 1px solid #f1f1f1;
  border-left: 3px solid transparent; }
.tf-dash-nav:hover { background: #fdf2f8; }
.tf-dash-nav-selected { background: #fdeaf1; border-left-color: #e72c85; }
.tf-dash-nav-icon { font-size: 15px; }
.tf-dash-nav-label { flex: 1; }

.tf-section { border-bottom: 1px solid #f1f1f1; }
.tf-section-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: #faf0f4; font-weight: 700; font-size: 13px; color: #7a1f44; }
.tf-section-num { font-family: monospace; }
.tf-section-title { flex: 1; }

.tf-group-head { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 22px;
  cursor: pointer; font-size: 12.5px; font-weight: 600; color: #444; }
.tf-group-head:hover { background: #f7f7f7; }
.tf-group-caret { width: 12px; color: #999; }
.tf-group-title { flex: 1; }

.tf-count-badge { font-size: 10.5px; font-family: monospace; color: #888; background: #f0f0f0;
  border-radius: 10px; padding: 1px 7px; }

.tf-items { padding-bottom: 4px; }
.tf-item { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 32px; cursor: pointer;
  font-size: 12.5px; border-left: 3px solid transparent; }
.tf-item:hover { background: #f7f7f7; }
.tf-item-selected { background: #fdeaf1; border-left-color: #e72c85; }
.tf-item-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px;
  height: 18px; border-radius: 5px; font-size: 10px; font-weight: 700; padding: 0 3px; }
.tf-st-approved { background: #dcfce7; color: #15803d; }
.tf-st-progress { background: #dbeafe; color: #1d4ed8; }
.tf-st-missing  { background: #fee2e2; color: #991b1b; }
.tf-st-update   { background: #fef9c3; color: #a16207; }
.tf-st-na       { background: #f3f4f6; color: #6b7280; }
.tf-item-code { font-family: monospace; font-weight: 700; color: #e72c85; flex-shrink: 0; }
.tf-item-title { flex: 1; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-item-linkcount { font-size: 10.5px; color: #888; flex-shrink: 0; }

.tf-detail { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.tf-detail-empty { color: #9ca3af; font-style: italic; text-align: center; margin-top: 60px; }
.tf-detail-inner { display: flex; flex-direction: column; flex: 1; overflow: hidden; min-height: 0; }

/* ── Barre compacte au-dessus du document (code/titre/statut/actions) ──── */
.tf-detail-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 16px; background: #fff; border-bottom: 1px solid #e5e7eb; flex-shrink: 0; flex-wrap: wrap; }
.tf-detail-bar-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; overflow: hidden; }
.tf-detail-bar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tf-detail-code { font-family: monospace; font-weight: 800; color: #e72c85; font-size: 13px; cursor: help; flex-shrink: 0; }
.tf-detail-title-sm { font-size: 13px; font-weight: 600; color: #1e1b4b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-detail-linkref { font-family: monospace; font-size: 11px; color: #e72c85; background: #fdeaf1; border-radius: 5px;
  padding: 1px 6px; flex-shrink: 0; }

.tf-na-toggle { font-size: 12px; color: #555; display: flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.tf-na-toggle input { accent-color: #e72c85; cursor: pointer; }

.tf-detail-na { background: #fef9c3; padding: 10px 16px; flex-shrink: 0; }
.tf-detail-na textarea { width: 100%; border-radius: 8px; border: 1px solid #ddd; padding: 8px;
  font-size: 13px; margin: 6px 0; resize: vertical; }

/* ── Zone document : remplit tout l'espace restant jusqu'en bas ─────────── */
.tf-detail-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; background: #f9f9f9; }
.tf-doc-embed { display: block; width: 100%; flex: 1; border: none; min-height: 0; background: #f9f9f9; }
.tf-preview-loading, .tf-preview-empty, .tf-search-loading, .tf-search-empty {
  padding: 16px; color: #9ca3af; font-size: 12.5px; text-align: center; }

.tf-detail-empty-doc { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: #9ca3af; text-align: center; padding: 40px; overflow-y: auto; }
.tf-empty-icon { font-size: 32px; opacity: .6; }
.tf-empty-title { font-size: 14px; }

.tf-detail-actions { margin: 10px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tf-link-picker { margin-top: 10px; background: #fff; border: 1px solid #eee; border-radius: 10px; padding: 12px;
  text-align: left; width: 100%; max-width: 480px; }
.tf-link-picker input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid #ddd; font-size: 13px; }
.tf-search-results { margin-top: 8px; max-height: 260px; overflow-y: auto; }
.tf-search-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 12.5px;
  border-bottom: 1px solid #f5f5f5; }
.tf-search-ref { font-family: monospace; font-weight: 700; color: #e72c85; flex-shrink: 0; }
.tf-search-title { flex: 1; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Menu déroulant "Documents de référence" ─────────────────────────────── */
.tf-refmenu-wrap { position: relative; }
.tf-refmenu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; background: #fff; color: #333;
  border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.22); min-width: 340px; max-width: 480px;
  max-height: 60vh; overflow-y: auto; padding: 6px; }
.tf-refmenu-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px;
  cursor: pointer; font-size: 12.5px; }
.tf-refmenu-row:hover { background: #fdeaf1; }
.tf-refmenu-row-disabled { opacity: .45; cursor: not-allowed; }
.tf-version-row-current { background: #fdf2f8; font-weight: 700; }
.tf-refmenu-icon { flex-shrink: 0; }
.tf-refmenu-ref { font-family: monospace; font-weight: 700; color: #e72c85; flex-shrink: 0; }
.tf-refmenu-title { flex: 1; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-refmenu-status { color: #888; font-size: 11px; flex-shrink: 0; }
.tf-refmenu-empty { padding: 14px; color: #9ca3af; font-style: italic; font-size: 12.5px; text-align: center; }

.tf-form-pending { background: #fef3f0; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: #7a1f44;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 480px; }

/* ── Dashboard KPI ────────────────────────────────────────────────────────── */
.tf-dashboard { flex: 1; overflow-y: auto; padding: 28px 32px; max-width: 900px; }

.tf-kpi-hero { display: flex; align-items: center; gap: 24px; margin-bottom: 32px;
  background: #fff; border: 1px solid #f0d7e3; border-radius: 14px; padding: 20px 26px; }
.tf-kpi-hero-ring { width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: conic-gradient(#e72c85 calc(var(--pct) * 1%), #f0f0f0 0); }
.tf-kpi-hero-ring::before { content: ""; position: absolute; inset: 9px; background: #fff; border-radius: 50%; }
.tf-kpi-hero-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 800; color: #e72c85; }
.tf-kpi-hero-title { font-size: 15px; font-weight: 700; color: #1e1b4b; margin-bottom: 4px; }
.tf-kpi-hero-sub { font-size: 13px; color: #555; }
.tf-kpi-hero-sub2 { font-size: 12px; color: #9ca3af; margin-top: 2px; }

.tf-kpi-section { margin-bottom: 28px; }
.tf-kpi-section-title { font-size: 13px; font-weight: 700; color: #7a1040; margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: .03em; }

.tf-kpi-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12.5px; }
.tf-kpi-row-label { width: 230px; flex-shrink: 0; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-kpi-secnum { font-family: monospace; font-weight: 700; color: #e72c85; width: 42px; flex-shrink: 0; }
.tf-kpi-bar-track { flex: 1; height: 8px; background: #f0f0f0; border-radius: 5px; overflow: hidden; }
.tf-kpi-bar-fill { height: 100%; border-radius: 5px; transition: width .3s; }
.tf-kpi-bar-fill.tf-st-approved { background: #22c55e; }
.tf-kpi-bar-fill.tf-st-progress { background: #3b82f6; }
.tf-kpi-bar-fill.tf-st-missing  { background: #ef4444; }
.tf-kpi-bar-fill.tf-st-update   { background: #eab308; }
.tf-kpi-bar-fill.tf-st-na       { background: #9ca3af; }
.tf-kpi-row-count { width: 80px; flex-shrink: 0; text-align: right; color: #888; font-family: monospace; font-size: 11.5px; }

.tf-kpi-docbadges { display: flex; flex-wrap: wrap; gap: 8px; }
.tf-kpi-docbadge { background: #f7f7f7; border: 1px solid #eee; border-radius: 8px; padding: 6px 12px;
  font-size: 12px; color: #444; }
.tf-kpi-docbadge b { color: #1e1b4b; }
.tf-kpi-docbadge-approved { background: #dcfce7; border-color: #bbf7d0; color: #15803d; }
.tf-kpi-docbadge-draft, .tf-kpi-docbadge-under_change { background: #dbeafe; border-color: #bfdbfe; color: #1d4ed8; }
.tf-kpi-docbadge-in_review, .tf-kpi-docbadge-pending_approval { background: #fef9c3; border-color: #fde68a; color: #a16207; }
.tf-kpi-docbadge-obsolete { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.tf-kpi-docbadge-empty { color: #9ca3af; font-style: italic; font-size: 12.5px; }
