/* Compléments au thème Tailwind — BDO light */
:root {
  --color-brand: #5b6e7f;
  --color-accent: #e81a3b;
  --chart-gold: #5b6e7f;
  --chart-gold-fill: rgba(91, 110, 127, 0.22);
  --chart-gold-strong: rgba(91, 110, 127, 0.88);
  --chart-gold-mid: rgba(91, 110, 127, 0.45);
  --chart-muted: #64748b;
  --chart-muted-bar: rgba(91, 110, 127, 0.35);
  --chart-ok: #059669;
  --chart-warn: #d97706;
  --chart-bad: #e81a3b;
}

html {
  scroll-behavior: smooth;
}

/* Ancres sous header + barre d’outils sticky */
#page-garde,
#section-kpis,
#person-summary-wrap,
#section-insights,
#section-visualisations,
#section-los,
#section-comp-rank,
#section-action-plan,
#section-detail {
  scroll-margin-top: 7rem;
}

#dashboard-toolbar {
  scroll-margin-top: 0;
}

/* Grille barres compétences (générée en JS) */
.insight-bar {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr auto;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.875rem;
}

@media (max-width: 640px) {
  .insight-bar {
    grid-template-columns: 1fr;
  }
}

.insight-bar-label {
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-bar-track {
  height: 10px;
  background: rgba(91, 110, 127, 0.12);
  border-radius: 6px;
  overflow: hidden;
}

.insight-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(91, 110, 127, 0.35), #5b6e7f);
  transition: width 0.45s ease;
}

.insight-bar-val {
  font-variant-numeric: tabular-nums;
  color: #1e293b;
  white-space: nowrap;
}

.insight-bar-val small {
  color: #64748b;
  font-weight: 400;
}

/* Pastilles notes (tableau) */
.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: rgba(91, 110, 127, 0.1);
}

.pill-risk {
  color: #e81a3b;
  background: rgba(232, 26, 59, 0.1);
}

.pill-warn {
  color: #d97706;
  background: rgba(217, 119, 6, 0.12);
}

.pill-ok {
  color: #059669;
  background: rgba(5, 150, 105, 0.12);
}

.td-comment {
  max-width: 280px;
  color: #64748b;
  word-break: break-word;
}

.td-eval {
  max-width: 220px;
  font-size: 0.82rem;
  color: #334155;
  word-break: break-word;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.kpi-mega {
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}

/* KPI tiles */
.kpi-tile {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.kpi-tile-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.35rem;
}

.kpi-tile-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1e293b;
}

.kpi-tile-dual {
  font-size: 1.25rem !important;
}

.kpi-tile-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.kpi-accent .kpi-tile-value,
.kpi-accent-soft .kpi-tile-value {
  color: #5b6e7f;
}

.kpi-warn .kpi-tile-value {
  color: #d97706;
}

.kpi-ok .kpi-tile-value {
  color: #059669;
}

.insight-list-ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.insight-list-ul li {
  padding: 0.45rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.insight-list-ul li:last-child {
  border-bottom: none;
}

.insight-list-ul strong {
  color: #5b6e7f;
  font-variant-numeric: tabular-nums;
}

.insight-summary {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #334155;
}

.card-desc {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

/* Tags insights */
.tag-pill {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(91, 110, 127, 0.08);
  color: #64748b;
  border: 1px solid rgba(91, 110, 127, 0.2);
}

/* Plan d’action */
.action-plan-intro {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: #64748b;
}

.action-grade-card {
  padding: 1rem 1.15rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.action-grade-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: #5b6e7f;
}

.action-grade-meta {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: #64748b;
}

.action-list {
  margin: 0;
  padding-left: 1.2rem;
}

.action-list li {
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #334155;
}

.action-list li:last-child {
  margin-bottom: 0;
}

/* Zone de drop */
#dropzone.dragover {
  border-color: #5b6e7f !important;
  background: rgba(91, 110, 127, 0.08) !important;
}

/* Graphiques Chart.js */
.chart-canvas-wrap {
  position: relative;
  height: 280px;
}

.chart-doughnut {
  max-width: 360px;
  margin: 0 auto;
}

.chart-bands-wrap,
.chart-people-wrap {
  height: 260px;
}

.chart-bar-wrap {
  height: min(420px, 55vh);
}

.chart-bar-wrap-sm {
  height: min(320px, 45vh);
}

.chart-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: #64748b;
  font-size: 0.9rem;
}

.table-scroll {
  overflow: auto;
  max-height: min(65vh, 560px);
  margin-top: 0.5rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  -webkit-overflow-scrolling: touch;
}

.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f1f5f9;
  color: #64748b;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 0 #e2e8f0;
}

.table-scroll th,
.table-scroll td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.table-scroll tbody tr:hover td {
  background: #f8fafc;
}

/* Vue synthèse collaborateurs (maquette) */
.person-dot {
  display: inline-block;
  height: 0.55rem;
  width: 0.55rem;
  border-radius: 9999px;
  vertical-align: middle;
}

.person-dot-ok {
  background: #10b981;
}

.person-dot-brand {
  background: #5b6e7f;
}

.person-dot-risk {
  background: #e81a3b;
}

.person-dot-muted {
  background: #cbd5e1;
}

.person-pill {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.person-pill-sp {
  margin-left: 0.35rem;
}

.person-pill-excel {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}

.person-pill-ok {
  background: rgba(91, 110, 127, 0.12);
  color: #5b6e7f;
}

.person-pill-risk {
  background: rgba(232, 26, 59, 0.1);
  color: #e81a3b;
}

.person-pill-neutral {
  background: #f1f5f9;
  color: #64748b;
}

.person-perf-track {
  height: 8px;
  border-radius: 9999px;
  background: rgba(91, 110, 127, 0.15);
  overflow: hidden;
  margin-bottom: 0.15rem;
}

.person-perf-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #5b6e7f, #8a9bab);
  min-width: 0;
}

#person-summary-table .ps-th,
#person-summary-table .ps-td {
  padding: 0.5rem 0.5rem;
  vertical-align: middle;
  font-size: 0.8125rem;
}

#person-summary-table .ps-th {
  font-weight: 600;
  white-space: nowrap;
  color: #475569;
}

#person-summary-table .ps-th-dot {
  width: 2rem;
}

#person-summary-table .ps-th-comp {
  text-align: center;
}

#person-summary-table .ps-name {
  font-weight: 500;
  color: #0f172a;
}

#person-summary-table .ps-grade {
  color: #475569;
}

#person-summary-table .ps-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

#person-summary-table .ps-comp-low {
  font-weight: 600;
  color: #e81a3b;
}

#person-summary-table .ps-pct {
  font-size: 0.7rem;
  color: #64748b;
}

#person-summary-table .person-perf-track {
  max-width: 140px;
}

.person-summary-row:hover td {
  background: #f8fafc;
}

.niveau-chip,
.grade-chip {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.niveau-chip:hover,
.grade-chip:hover {
  border-color: #94a3b8;
}

.niveau-chip-active,
.grade-chip-active {
  border-color: #5b6e7f;
  background: #5b6e7f;
  color: #fff;
}

.grade-chip-ellipsis {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media print {
  body {
    background: #fff;
  }

  .panel-upload,
  #parse-error,
  #empty-state {
    display: none !important;
  }

  #dashboard-main {
    display: block !important;
  }

  header {
    position: relative !important;
    box-shadow: none !important;
  }

  .print\:hidden {
    display: none !important;
  }
}
