/* Split fiche (gauche) + liste clients (droite) */
#view-detail.active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.detail-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.detail-main {
  flex: 1;
  min-width: 0;
  overflow: auto;
  height: 100%;
  background: var(--bg, #f4f6f9);
}

.detail-side {
  flex: 0 1 300px;
  width: 300px;
  min-width: 240px;
  max-width: 360px;
  border-left: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #fff);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.detail-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
  background: linear-gradient(180deg, #f8fafc, #fff);
}

.detail-side-header strong {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.detail-side-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary, #1d4ed8);
  background: var(--primary-soft, #eff6ff);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.detail-side-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  flex-shrink: 0;
  background: #fafbfd;
}

.detail-side-filter-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 5px;
}

.detail-side-filters select,
.detail-side-filter-full,
.detail-side-search {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  min-width: 0;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  color: var(--text, #0f172a);
}

.detail-side-filters select:focus,
.detail-side-search:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.15);
}

.detail-side-search {
  margin-top: 2px;
}

.detail-side-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 4px 8px 14px;
}

.detail-side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  margin: 0 0 3px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.detail-side-item:hover {
  background: var(--bg-hover, #f1f5f9);
}

.detail-side-item.active {
  background: var(--primary-soft, #eff6ff);
  border-color: #bfdbfe;
}

.detail-side-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #64748b;
}

.detail-side-meta {
  flex: 1;
  min-width: 0;
}

.detail-side-name {
  display: block;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-side-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.detail-side-empty {
  padding: 28px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

.detail-nav-btns {
  display: flex;
  gap: 4px;
}

.detail-nav-btn {
  min-width: 34px;
  padding: 6px 8px !important;
  font-size: 14px !important;
  line-height: 1.2;
}

@media (max-width: 1100px) {
  .detail-layout {
    flex-direction: column;
  }
  .detail-side {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: min(280px, 38vh);
    border-left: none;
    border-top: 1px solid var(--border, #e2e8f0);
  }
}
