/* Client Detail Page — Sidebar Layout */

/* Desktop: 240px sticky sidebar + scrolling main content */
.detail-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}

.detail-sidebar {
  width: 240px;
  min-width: 240px;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  border-right: 1px solid rgba(51, 65, 85, 0.5);
  background: rgba(15, 23, 42, 0.6);
  padding: 1rem 0;
  flex-shrink: 0;
}

.detail-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
}

/* Sidebar items */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  color: #94a3b8;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}

.sidebar-item:hover {
  color: #e2e8f0;
  background: rgba(51, 65, 85, 0.3);
}

.sidebar-item.active {
  color: #e2e8f0;
  background: rgba(99, 102, 241, 0.08);
  border-left-color: #6366f1;
  font-weight: 500;
}

.sidebar-item i,
.sidebar-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Detail header */
.detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.detail-header-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: #94a3b8;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: color 0.15s;
  text-decoration: none;
  flex-shrink: 0;
}

.detail-header-back:hover {
  color: #e2e8f0;
}

.detail-header-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-header-domain {
  font-size: 0.8125rem;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
}

.detail-header-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  flex-shrink: 0;
}

/* Mobile tabs (< 1024px) */
.detail-mobile-tabs {
  display: none;
  overflow-x: auto;
  white-space: nowrap;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  background: rgba(15, 23, 42, 0.6);
  padding: 0 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.detail-mobile-tabs::-webkit-scrollbar {
  display: none;
}

.detail-mobile-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.75rem;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.detail-mobile-tab:hover {
  color: #94a3b8;
}

.detail-mobile-tab.active {
  color: #e2e8f0;
  border-bottom-color: #6366f1;
}

/* Section cards */
.detail-section-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.detail-section-title {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Metric card in overview */
.metric-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
}

.metric-card-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.metric-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  color: #f1f5f9;
  line-height: 1.2;
}

.metric-card-delta {
  font-size: 0.6875rem;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 1023px) {
  .detail-sidebar {
    display: none;
  }

  .detail-mobile-tabs {
    display: flex;
  }

  .detail-main {
    padding: 1rem;
  }

  .detail-layout {
    flex-direction: column;
  }
}

/* Score ring */
.score-ring-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.score-ring-text {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.25rem;
}

/* Loading skeleton */
.detail-skeleton {
  background: linear-gradient(90deg, rgba(51,65,85,0.3) 25%, rgba(71,85,105,0.3) 50%, rgba(51,65,85,0.3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
  height: 1rem;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Breakdown bar */
.breakdown-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(51, 65, 85, 0.5);
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
