.service-details-button {
  font-size: 10px;
  padding: 7px 10px;
  margin-top: 8px;
  background: #152942;
  border-color: #304d71;
  color: #9fbcdf;
}
.summary-card {
  text-align: left;
  min-width: 0;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
  cursor: pointer;
}
.summary-card:hover {
  transform: translateY(-3px);
  border-color: #5b84b7;
  box-shadow: 0 9px 30px #0003;
}
.summary-card:before {
  content: "↗";
  position: absolute;
  right: 14px;
  bottom: 13px;
  color: #7597c0;
  font-size: 13px;
}
.summary-card small {
  display: block;
  padding-right: 10px;
  line-height: 1.6;
}
.summary-card:after {
  pointer-events: none;
}
.metrics-section {
  margin: 0 0 38px;
  border: 1px solid #2b455b;
  border-radius: 12px;
  background: linear-gradient(125deg, #122331, #0c1727);
  overflow: hidden;
}
.metrics-section > summary {
  cursor: pointer;
  list-style-position: inside;
  padding: 18px 23px;
  font-size: 10px;
  letter-spacing: 1.8px;
  color: #a2bbda;
}
.metrics-section > summary span {
  float: right;
  font-size: 9px;
  letter-spacing: 0;
  color: #7699ae;
}
.metrics-section[open] > summary {
  border-bottom: 1px solid #294355;
}
.metrics-section summary:focus-visible {
  outline: 2px solid #639ade;
  outline-offset: -4px;
}
#metricsPanel {
  padding: 25px;
}
.metrics-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.metrics-heading h2 {
  font-size: 24px;
  margin: 10px 0 7px;
  font-weight: 500;
}
.metrics-heading p {
  font-size: 11px;
  color: #8da8bf;
  margin: 0;
  line-height: 1.7;
}
.metrics-controls {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.metrics-controls select {
  max-width: 185px;
  font-size: 10px;
  color: #bbd0e4;
  background: #102232;
  border: 1px solid #35526b;
  border-radius: 6px;
  padding: 10px;
}
.metrics-notice {
  color: #7899ae;
  font-size: 10px;
  line-height: 1.8;
  margin: 17px 0 22px;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.metric-chart {
  background: #0c192b;
  border: 1px solid #2c4056;
  border-radius: 10px;
  padding: 21px;
  min-width: 0;
}
.metric-chart h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 8px;
  color: #d5e6f3;
}
.chart-caption {
  font-size: 10px;
  color: #7896ae;
  line-height: 1.7;
  margin: 0 0 13px;
}
.donut-layout {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.donut-layout svg {
  width: 100%;
  max-height: 190px;
  overflow: visible;
}
.donut-layout circle[role="button"] {
  cursor: pointer;
  transition:
    stroke-width 0.2s,
    filter 0.2s;
}
.donut-layout circle[role="button"]:hover,
.donut-layout circle[role="button"]:focus {
  stroke-width: 23;
  filter: brightness(1.2);
  outline: none;
}
.donut-number {
  fill: #e5f3ff;
  font:
    400 34px "Segoe UI",
    sans-serif;
}
.donut-label {
  fill: #7f9bb6;
  font:
    8px "Segoe UI",
    sans-serif;
  letter-spacing: 2px;
}
.chart-legend {
  display: grid;
  gap: 5px;
}
.legend-button {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  background: transparent;
  padding: 8px;
  font-size: 10px;
  color: #aac4da;
  text-align: left;
  min-width: 0;
}
.legend-button i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-button b {
  margin-left: auto;
  font-weight: 500;
  font-size: 12px;
  color: #d5eaf5;
}
.legend-button:hover {
  background: #20364a;
  border-color: #45627c;
}
.department-chart-button,
.service-chart-button {
  display: block;
  width: 100%;
  text-align: left;
  margin-top: 9px;
  padding: 11px 10px;
  background: #142438;
  border: 1px solid transparent;
  border-radius: 6px;
}
.department-chart-button:hover,
.service-chart-button:hover {
  border-color: #537a93;
  background: #1b3046;
}
.metric-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 9px;
  color: #a8c7d9;
  line-height: 1.5;
}
.metric-line span {
  overflow-wrap: anywhere;
}
.metric-line b {
  font-weight: 400;
  color: #d0e6f4;
  white-space: nowrap;
}
.task-stack,
.service-chart-track {
  display: flex;
  height: 7px;
  background: #26384c;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 4px;
}
.task-stack span {
  height: 100%;
  transition: width 0.5s;
}
.service-chart-track i {
  height: 100%;
  background: linear-gradient(90deg, #3872b8, #679ee1);
  transition: width 0.5s;
}
.service-chart-button small {
  display: block;
  font-size: 9px;
  color: #7797ae;
  margin-top: 7px;
}
.event-histogram {
  display: grid;
  grid-template-columns: repeat(var(--bars), minmax(0, 1fr));
  height: 142px;
  gap: 3px;
  margin: 27px 0 8px;
  align-items: stretch;
}
.event-bar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  background: transparent;
  border: 0;
  border-radius: 3px;
  padding: 0 1px;
  min-width: 0;
}
.event-bar:hover {
  background: #33557166;
}
.event-bar b {
  font-size: 8px;
  font-weight: 400;
  color: #86a3c6;
  margin-bottom: 5px;
}
.event-bar i {
  display: block;
  width: 100%;
  max-height: 115px;
  background: linear-gradient(#75aaea, #346baf);
  border-radius: 3px 3px 0 0;
  transition:
    height 0.5s,
    filter 0.2s;
  min-height: 2px;
}
.event-bar i.empty-bar {
  background: #345267;
}
.event-bar:hover i {
  filter: brightness(1.3);
}
.event-axis {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #678ca4;
  font-size: 8px;
  margin-bottom: 16px;
}
.metrics-empty {
  font-size: 12px;
  color: #91acc2;
  padding: 22px 0;
  line-height: 1.8;
}
#metricsDialog {
  width: min(740px, 94vw);
  max-height: 85vh;
  padding: 27px;
  border: 1px solid #42617b;
  background: #111f32;
  color: #dceaf6;
  border-radius: 14px;
}
#metricsDialog::backdrop {
  background: #030b15bb;
  backdrop-filter: blur(6px);
}
#metricsTitle {
  font-size: 25px;
  font-weight: 500;
  margin: 22px 0 10px;
}
#metricsDetailNote {
  line-height: 1.8;
}
.metric-detail-row {
  padding: 17px 2px;
  border-top: 1px solid #2b4056;
  font-size: 12px;
  line-height: 1.7;
}
.metric-detail-row strong {
  display: block;
  color: #d6e9f6;
  font-weight: 500;
}
.metric-detail-row p {
  color: #8eacc1;
  margin: 7px 0;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.metric-detail-row > span {
  font-size: 10px;
  color: #9eb3cc;
  display: block;
}
.metric-detail-row small {
  font-size: 10px;
  color: #7899b5;
}
.detail-status {
  display: inline-block !important;
  padding: 3px 8px;
  border: 1px solid #31516a;
  border-radius: 5px;
}
.detail-person {
  font-size: 11px;
  padding: 8px 11px;
  border: 1px solid #32546a;
  background: #162e40;
  color: #9abae0;
}
.metric-detail-row .detail-person:first-child {
  font-size: 12px;
  margin-bottom: 7px;
}
.metric-detail-row .detail-person:hover {
  background: #24485b;
  color: #e5fff7;
}
@media (max-width: 900px) {
  .metrics-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .metrics-controls {
    justify-content: flex-start;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  #metricsPanel {
    padding: 16px;
  }
  .metrics-section > summary {
    padding: 15px;
    font-size: 8px;
  }
  .metrics-section > summary span {
    font-size: 8px;
  }
  .metric-chart {
    padding: 16px;
  }
  .donut-layout {
    grid-template-columns: minmax(90px, 125px) minmax(0, 1fr);
    gap: 8px;
  }
  .legend-button {
    padding: 7px 3px;
    font-size: 9px;
    gap: 6px;
  }
  .metrics-heading h2 {
    font-size: 21px;
  }
  .metrics-controls {
    gap: 6px;
  }
  .metrics-controls select {
    font-size: 9px;
    padding: 8px;
    max-width: 160px;
  }
  .event-histogram {
    gap: 2px;
  }
  .event-bar b {
    font-size: 6px;
  }
  .metric-line {
    font-size: 8px;
  }
  #metricsDialog {
    padding: 20px;
  }
}
