/* ==========================================================================
   Executive Admin Dashboard (/Admin/Dashboard).
   Owning feature: admin dashboard
   Load order is defined in Views/Shared/_CssIncludes.cshtml — do not reorder.
   ========================================================================== */

/* Main page layout */
.fh-admin-dashboard {
  max-width: min(100%, 82rem);
  width: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --- System Health Live Pulse & Header Toolbar --- */
.fh-dashboard-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.fh-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: var(--fh-text-xs);
  font-weight: var(--fh-weight-medium);
  letter-spacing: var(--fh-tracking-wide);
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.fh-health-pill.is-degraded {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.fh-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--fh-success);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  animation: fh-pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}
.fh-health-pill.is-degraded .fh-pulse-dot {
  background-color: var(--fh-danger);
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
  animation: fh-pulse-red 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes fh-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(22, 163, 74, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

@keyframes fh-pulse-red {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 5px rgba(220, 38, 38, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

.fh-toolbar-sep {
  width: 1px;
  height: 1.25rem;
  background-color: var(--fh-border);
  margin-inline: 0.15rem;
}

.fh-dashboard-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.fh-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  border: 1px solid var(--fh-border);
  background: var(--fh-surface, #ffffff);
  color: var(--fh-text);
  font-size: var(--fh-text-xs);
  font-weight: var(--fh-weight-medium);
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: var(--fh-shadow-sm);
  cursor: pointer;
}
.fh-action-pill:hover {
  background: var(--fh-soft);
  color: var(--fh-primary);
  border-color: color-mix(in srgb, var(--fh-primary) 30%, var(--fh-border));
  transform: translateY(-1px);
}
.fh-action-pill i {
  font-size: 0.75rem;
}
.fh-action-pill.fh-action-pill-primary {
  background: var(--fh-primary);
  color: #ffffff;
  border-color: var(--fh-primary);
}
.fh-action-pill.fh-action-pill-primary:hover {
  background: var(--fh-primary-dark);
  color: #ffffff;
  border-color: var(--fh-primary-dark);
}

/* --- Compact Alert Strip --- */
.fh-alert-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: var(--fh-radius-lg, 0.75rem);
  background: var(--fh-soft, #f7f8fa);
  border: 1px solid var(--fh-border);
}
.fh-alert-strip-items {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.fh-alert-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  font-size: var(--fh-text-xs);
  font-weight: var(--fh-weight-medium);
  text-decoration: none;
  transition: all 0.15s ease;
}
.fh-alert-pill.is-danger {
  background: #fef2f2;
  color: var(--fh-danger);
  border: 1px solid #fecaca;
}
.fh-alert-pill.is-danger:hover {
  background: #fee2e2;
  color: var(--fh-danger);
}
.fh-alert-pill.is-warning {
  background: #fffbeb;
  color: var(--fh-warning);
  border: 1px solid #fde68a;
}
.fh-alert-pill.is-warning:hover {
  background: #fef3c7;
  color: var(--fh-warning);
}
.fh-alert-pill.is-neutral {
  background: var(--fh-surface, #ffffff);
  color: var(--fh-muted);
  border: 1px solid var(--fh-border);
}
.fh-alert-pill.is-neutral:hover {
  background: var(--fh-soft);
  color: var(--fh-text);
}

/* --- Standardized 3-Element KPI Grid --- */
.fh-admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.fh-admin-kpi-card {
  background: var(--fh-surface, #ffffff);
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-xl, 0.85rem);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
  box-shadow: var(--fh-shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  color: inherit;
  cursor: pointer;
}
.fh-admin-kpi-card:hover {
  border-color: color-mix(in srgb, var(--fh-primary) 35%, var(--fh-border));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
  color: inherit;
}

.fh-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.fh-kpi-label {
  font-size: var(--fh-text-xs);
  font-weight: var(--fh-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--fh-tracking-wider, 0.05em);
  color: var(--fh-muted);
}

.fh-kpi-icon {
  font-size: 0.95rem;
  color: var(--fh-muted);
}

.fh-kpi-value {
  font-family: var(--fh-font-sans);
  font-size: 1.85rem;
  font-weight: var(--fh-weight-bold);
  letter-spacing: var(--fh-tracking-tight);
  color: var(--fh-text);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fh-kpi-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: auto;
}

.fh-kpi-progress {
  height: 5px;
  background-color: var(--fh-soft, #f4f5f7);
  border-radius: 9999px;
  overflow: hidden;
  width: 100%;
}
.fh-kpi-progress-bar {
  height: 100%;
  background-color: var(--fh-primary);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.fh-kpi-status-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fh-text-xs);
  color: var(--fh-muted);
}

.fh-kpi-pct {
  margin-left: auto;
  font-weight: var(--fh-weight-semibold);
  color: var(--fh-text);
}

.fh-status-dot-sep {
  color: var(--fh-muted);
  font-size: 0.85rem;
  line-height: 1;
}

/* --- Side-by-Side Lower Sections (2-Column Grid) --- */
.fh-admin-sections {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.fh-admin-section-card {
  background: var(--fh-surface, #ffffff);
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius-xl, 0.85rem);
  box-shadow: var(--fh-shadow-sm);
  display: flex;
  flex-direction: column;
}

.fh-section-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--fh-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.fh-section-title {
  margin: 0;
  font-size: var(--fh-text-sm);
  font-weight: var(--fh-weight-semibold);
  color: var(--fh-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.fh-section-title i {
  color: var(--fh-primary);
  font-size: var(--fh-text-sm);
}

.fh-section-action {
  font-size: var(--fh-text-xs);
  font-weight: var(--fh-weight-medium);
  color: var(--fh-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s ease;
}
.fh-section-action:hover {
  color: var(--fh-primary);
}

.fh-section-body {
  padding: 1.25rem 1.5rem;
  flex: 1 1 auto;
}

/* --- Department Storage Bar List --- */
.fh-dept-storage-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fh-dept-storage-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fh-dept-storage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.fh-dept-name {
  font-size: var(--fh-text-sm);
  font-weight: var(--fh-weight-semibold);
  color: var(--fh-text);
  text-decoration: none;
}
.fh-dept-name:hover {
  color: var(--fh-primary);
  text-decoration: underline;
}

.fh-dept-code {
  font-size: 0.6875rem;
  font-weight: var(--fh-weight-medium);
  color: var(--fh-muted);
  background: var(--fh-soft);
  border: 1px solid var(--fh-border);
  padding: 0.1rem 0.35rem;
  border-radius: var(--fh-radius-sm);
}

.fh-status-dot-warning {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--fh-warning);
  display: inline-block;
  flex-shrink: 0;
}

.fh-dept-storage-values {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.fh-dept-bytes {
  font-size: var(--fh-text-sm);
  font-weight: var(--fh-weight-semibold);
  color: var(--fh-text);
}

.fh-dept-pct {
  font-size: var(--fh-text-xs);
  color: var(--fh-muted);
}

.fh-dept-bar-track {
  height: 6px;
  background-color: var(--fh-soft);
  border-radius: 9999px;
  overflow: hidden;
  width: 100%;
}

.fh-dept-bar-fill {
  height: 100%;
  background-color: var(--fh-primary);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* --- Minimalist Activity Timeline --- */
.fh-timeline-feed {
  display: flex;
  flex-direction: column;
}

.fh-timeline-item {
  border-bottom: 1px solid var(--fh-border);
}
.fh-timeline-item:last-child {
  border-bottom: 0;
}

details.fh-timeline-item summary {
  list-style: none;
}
details.fh-timeline-item summary::-webkit-details-marker {
  display: none;
}

.fh-timeline-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  cursor: pointer;
  user-select: none;
}
.fh-timeline-summary.static-item {
  cursor: default;
}

.fh-timeline-point {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--fh-border);
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}
.fh-timeline-point.is-fail {
  background-color: var(--fh-danger);
}

.fh-timeline-main {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
}

.fh-timeline-action {
  font-size: var(--fh-text-sm);
  font-weight: var(--fh-weight-medium);
  color: var(--fh-text);
}

.fh-timeline-user {
  font-size: var(--fh-text-xs);
  color: var(--fh-muted);
}

.fh-timeline-time {
  font-size: var(--fh-text-xs);
  color: var(--fh-muted);
  white-space: nowrap;
}

.fh-timeline-drawer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 0 0.65rem 1.15rem;
}

.fh-timeline-detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: var(--fh-text-2xs);
  color: var(--fh-muted);
  background: var(--fh-soft);
  border: 1px solid var(--fh-border);
}
.fh-timeline-detail-chip.is-danger {
  color: var(--fh-danger);
  background: #fef2f2;
  border-color: #fecaca;
}

/* --- Empty state helper --- */
.fh-empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
}

/* --- Responsive Ladder --- */
@media (max-width: 1199.98px) {
  .fh-admin-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .fh-admin-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .fh-admin-kpi-grid {
    grid-template-columns: 1fr;
  }
  .fh-dashboard-toolbar {
    gap: 0.5rem;
  }
  .fh-toolbar-sep {
    display: none;
  }
  .fh-section-header,
  .fh-section-body {
    padding-inline: 1.15rem;
  }
}
