/* Fiches des employeurs et des établissements. */
.org-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 34px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.org-page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 8px;
}

/* Les blocs gardent leur hauteur : la fiche défile au lieu de les écraser. */
.org-scroll > *,
.org-page > *,
.org-body > * {
  flex-shrink: 0;
}

/* En-tête d’identité */
.org-hero {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 22px 26px;
  border-radius: 18px;
  background: linear-gradient(115deg, #ffffff 0%, #f4f8ef 55%, #e7f0dc 100%);
  border: 1px solid #dfe7d8;
  overflow: hidden;
  isolation: isolate;
}
.org-hero::after {
  content: '';
  position: absolute;
  right: -90px;
  top: -140px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 46px solid #b8d29426;
  z-index: -1;
}
.org-mono {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  color: #fff;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 1px;
  box-shadow: 0 14px 30px #183b3833;
  overflow: hidden;
}
.org-mono span {
  position: relative;
  z-index: 2;
}
.org-id h1 {
  font-size: 25px;
  line-height: 1.18;
  letter-spacing: -0.5px;
  margin: 6px 0 12px;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.org-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.org-tags > span:not(.status) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #ffffffcc;
  border: 1px solid #dfe7d8;
  font-size: 11px;
  color: #5e7059;
}
.org-tags .icon {
  width: 13px;
  height: 13px;
}
.org-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

/* Onglets, avec un trait qui glisse */
.org-tabs {
  position: relative;
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.org-tabs button {
  padding: 12px 15px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  border-radius: 8px 8px 0 0;
  transition: color 0.15s, background-color 0.15s;
}
.org-tabs button:hover {
  color: var(--ink);
  background: #ffffff8c;
}
.org-tabs button.active {
  color: var(--green);
  font-weight: 600;
}
.org-ink {
  position: absolute;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, #2f6c59, #75965c);
  transform-origin: 0 50%;
  pointer-events: none;
}
.org-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

/* Indicateurs */
.org-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.org-kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  min-width: 0;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.org-kpi[onclick]:hover {
  box-shadow: 0 4px 12px #183b3810;
  border-color: #c9d8bd;
}
.org-kpi-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.org-kpi small {
  font-size: 11px;
  color: var(--muted);
}
.org-kpi b {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.6px;
  color: var(--ink);
  white-space: nowrap;
}
.org-kpi-text > span {
  font-size: 11px;
  color: #7c8a85;
  line-height: 1.4;
}
.org-ring {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
}
.org-ring circle {
  fill: none;
  stroke-width: 5;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}
.org-ring .track {
  stroke: #edf2e8;
}
.org-ring .val {
  stroke: #4f8a6a;
  stroke-linecap: round;
  stroke-dasharray: 119.4;
}
.org-ring text {
  font-size: 10.5px;
  font-weight: 600;
  fill: var(--ink);
  text-anchor: middle;
}
.org-spark {
  width: 84px;
  height: 42px;
  flex-shrink: 0;
}
.org-spark rect {
  fill: #75965c;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}
.org-spark rect:last-child {
  fill: #2f6c59;
}
.org-meter {
  display: block;
  width: 74px;
  height: 7px;
  border-radius: 4px;
  background: #edf2e8;
  overflow: hidden;
  flex-shrink: 0;
}
.org-meter i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #75965c, #2f6c59);
  transform-origin: 0 50%;
}

/* Cartes */
.org-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 14px;
}
.org-grid > .org-card:nth-child(3) {
  grid-column: 1 / -1;
}
.org-grid > .org-card:nth-child(3) .profile-dl {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.org-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 20px 20px;
  min-width: 0;
}
.org-card.flat {
  padding: 0;
  overflow: hidden;
}
.org-card > header {
  margin-bottom: 14px;
}
.org-card.flat > header {
  padding: 18px 20px 4px;
}
.org-card > header.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.org-card h3 {
  font-size: 14px;
  color: var(--ink);
  margin: 0 0 4px;
}
.org-card header small {
  font-size: 11px;
  color: var(--muted);
}
.org-search {
  margin: 14px 16px 8px;
}
.org-bars {
  display: flex;
  align-items: stretch;
  gap: 10px;
  height: var(--h);
}
.org-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
  cursor: default;
}
.org-bar-stack {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  border-bottom: 1px solid #edf2e8;
}
.org-bar-stack i {
  display: block;
  width: 36%;
  max-width: 22px;
  min-height: 2px;
  border-radius: 5px 5px 1px 1px;
  transform-origin: 50% 100%;
  transition: filter 0.2s;
}
.org-bar-col:hover .org-bar-stack i {
  filter: brightness(1.12) saturate(1.1);
}
.org-bar-col small {
  font-size: 10px;
  color: var(--muted);
  text-transform: capitalize;
}
.org-bars .soft,
.org-legend .soft {
  background: #d9e7cc;
}
.org-bars .strong,
.org-legend .strong {
  background: linear-gradient(180deg, #4f8a6a, #2f6c59);
}
.org-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
}
.org-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.org-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.org-calm {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 7px;
  padding: 26px 16px;
  color: var(--muted);
  font-size: 11px;
}
.org-calm b {
  font-size: 13px;
  color: var(--ink);
}
.org-calm .icon {
  width: 42px;
  height: 42px;
  padding: 11px;
  border-radius: 50%;
  background: var(--soft);
  stroke: var(--green);
}
.org-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.org-chips span {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--soft);
  font-size: 11px;
  color: #4c6a45;
}
.org-docs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding: 14px 18px 18px;
}
.org-doc {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  min-width: 0;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.org-doc:hover {
  box-shadow: 0 4px 12px #183b3810;
  border-color: #c9d8bd;
}
.org-doc > span {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.org-doc b {
  font-size: 12px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.org-doc small {
  font-size: 10.5px;
  color: var(--muted);
}
.org-card .tablefoot {
  padding: 10px 18px 14px;
}

@media (max-width: 1180px) {
  .org-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .org-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .org-grid > .org-card:nth-child(3) .profile-dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .org-scroll {
    padding: 16px;
  }
  .org-hero {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 18px;
    gap: 14px;
  }
  .org-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .org-mono {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    font-size: 20px;
  }
  .org-id h1 {
    font-size: 19px;
  }
  .org-kpis {
    grid-template-columns: minmax(0, 1fr);
  }
  .org-grid > .org-card:nth-child(3) .profile-dl {
    grid-template-columns: minmax(0, 1fr);
  }
}
