.serverMonitorFrame {
  width: min(
    var(--page-content-width-desktop),
    calc(100vw - var(--page-content-gutter-desktop))
  );
  max-width: none;
  margin: var(--page-content-margin-top-desktop) auto 0;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.serverMonitorFrame .dash {
  width: 100%;
  margin: 0;
}

@media (max-width: 720px) {
  .serverMonitorFrame {
    width: min(1200px, calc(100vw - 24px));
    padding: 18px;
    border-radius: 20px;
  }
}

.dash {
  width: 100%;
  margin: 0;
  color: white;
}

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.dash-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.55);
}

.dash-title {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.62);
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #57d17a;
  box-shadow: 0 0 10px rgba(87, 209, 122, 0.8);
  animation: dashLivePulse 2s ease-in-out infinite;
}

@keyframes dashLivePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.92);
  }
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
}

.status-pill.ok {
  background: rgba(80, 200, 120, 0.12);
  border-color: rgba(80, 200, 120, 0.2);
  color: #dcffe7;
}

.status-pill.warn {
  background: rgba(255, 196, 87, 0.12);
  border-color: rgba(255, 196, 87, 0.2);
  color: #ffe7b0;
}

.status-pill.crit {
  background: rgba(255, 99, 99, 0.12);
  border-color: rgba(255, 99, 99, 0.2);
  color: #ffd1d1;
}

.pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card,
.panel {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.metric-card {
  border-radius: 20px;
  padding: 18px;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.12);
}

.metric-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.metric-label {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
}

.metric-val {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  font-weight: 700;
  color: white;
  font-variant-numeric: tabular-nums;
}

.metric-delta {
  margin: 8px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.48);
}

.panels-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.panels-row.equal {
  grid-template-columns: 1fr 1fr;
}

.panel {
  border-radius: 20px;
  overflow: hidden;
}

.panel-head {
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: white;
}

.panel-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.56);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.panel-body {
  padding: 18px 22px 22px;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 190px;
}

.spark-wrap {
  position: relative;
  width: 100%;
  height: 56px;
  margin-top: 8px;
  padding: 6px 0;
}

.health-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.health-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.hdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hdot.ok {
  background: #57d17a;
  box-shadow: 0 0 10px rgba(87, 209, 122, 0.8);
}

.hdot.warn {
  background: #ffc457;
  box-shadow: 0 0 10px rgba(255, 196, 87, 0.8);
}

.hdot.crit {
  background: #ff6b6b;
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.8);
}

.hname {
  font-size: 15px;
  font-weight: 600;
  color: white;
  margin: 0 0 4px;
}

.hdesc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.52);
  margin: 0;
}

.hval {
  font-size: 14px;
  font-weight: 600;
  color: white;
  margin: 0 0 4px;
  text-align: right;
}

.hstatus {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-align: right;
  margin: 0;
}

.usage-block {
  margin-bottom: 18px;
}

.usage-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.usage-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
}

.usage-pct {
  font-size: 13px;
  font-weight: 600;
  color: white;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  transition:
    width 0.45s ease,
    background 0.25s ease;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.12);
}

.bar-fill.low {
  background: linear-gradient(90deg, #57d17a, #7ff0a2);
}

.bar-fill.mid {
  background: linear-gradient(90deg, #ffc457, #ffd98f);
}

.bar-fill.high {
  background: linear-gradient(90deg, #ff7c7c, #ffb2b2);
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.mini-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.mini-label {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
}

.mini-val {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: white;
  font-variant-numeric: tabular-nums;
}

canvas {
  display: block;
  width: 100% !important;
  max-width: 100%;
}

@media (max-width: 1100px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panels-row,
  .panels-row.equal {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .dash {
    width: min(1200px, calc(100vw - 24px));
  }

  .dash-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dash-title {
    font-size: 25px;
  }

  .panel-title {
    font-size: 19px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .mini-grid {
    grid-template-columns: 1fr;
  }

  .chart-wrap {
    height: 170px;
  }
}

.metric-card-button {
  border: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
  background: transparent;
}

.metric-card-button:hover {
  transform: translateY(-2px);
}

.metric-card-arrow {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.8;
  color: white;
}
.aiUsagePopupOverlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(5, 10, 22, 0.56);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.aiUsagedetailPopUp {
  width: min(880px, calc(100vw - 40px));
  max-height: min(82vh, 760px);
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 32px;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.aiUsagePopupHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 28px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.aiUsagePopupEyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.46);
}

.aiUsagePopupTitle {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.aiUsagePopupCloseBtn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 18px;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.aiUsagePopupCloseBtn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.13);
  transform: translateY(-1px);
}

.aiUsageCategoryTabs {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 28px 0;
  flex-wrap: wrap;
}

.aiUsageCategoryTab {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.76);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.aiUsageCategoryTab:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.aiUsageCategoryTab.active {
  color: #ffffff;
  border-color: rgba(126, 166, 255, 0.38);
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.9),
    rgba(118, 75, 162, 0.9)
  );
  box-shadow: 0 8px 24px rgba(93, 83, 211, 0.25);
}

.aiUsagePopupBody {
  padding: 22px 28px 28px;
  overflow-y: auto;
  max-height: calc(82vh - 130px);
}

.aiUsagePlaceholderCard {
  min-height: 240px;
  border-radius: 22px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 30px rgba(0, 0, 0, 0.16);
}

.aiUsagePlaceholderTitle {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.aiUsagePlaceholderText {
  margin: 0;
  max-width: 720px;
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.58);
}

@media (max-width: 768px) {
  .aiUsagePopupOverlay {
    padding: 16px;
  }

  .aiUsagedetailPopUp {
    width: 100%;
    max-height: 88vh;
    border-radius: 22px;
  }

  .aiUsagePopupHeader {
    padding: 20px 20px 16px;
  }

  .aiUsageCategoryTabs {
    padding: 16px 20px 0;
  }

  .aiUsagePopupBody {
    padding: 18px 20px 20px;
    max-height: calc(88vh - 120px);
  }

  .aiUsagePlaceholderCard {
    min-height: 200px;
    padding: 20px;
  }

  .aiUsagePopupTitle {
    font-size: 18px;
  }

  .aiUsagePlaceholderTitle {
    font-size: 19px;
  }
}

@media (max-width: 1600px) and (min-width: 1025px) {
  .serverMonitorFrame {
    width: calc(100% - var(--page-content-gutter-laptop));
    max-width: var(--page-content-width-laptop);
    margin: var(--page-content-margin-top-laptop) auto 0;
  }
}

@media (min-width: 1900px) {
  .serverMonitorFrame {
    width: min(
      var(--page-content-width-ultra),
      calc(100vw - var(--page-content-gutter-ultra))
    );
    margin: var(--page-content-margin-top-ultra-default) auto 0;
    padding: 30px;
    border-radius: 28px;
  }

  .dash-header {
    gap: 22px;
    margin-bottom: 26px;
  }

  .dash-eyebrow {
    font-size: 12px;
  }

  .dash-title {
    font-size: 34px;
  }

  .dash-sub {
    font-size: 15px;
  }

  .live-badge {
    font-size: 12px;
    padding: 7px 12px;
  }

  .status-pill {
    font-size: 15px;
    padding: 11px 16px;
  }

  .metrics-grid {
    gap: 18px;
    margin-bottom: 24px;
  }

  .metric-card {
    padding: 22px;
    border-radius: 22px;
  }

  .metric-icon {
    width: 58px;
    height: 58px;
    font-size: 24px;
    margin-bottom: 16px;
  }

  .metric-label {
    font-size: 13px;
  }

  .metric-val {
    font-size: 34px;
  }

  .metric-delta {
    font-size: 13px;
  }

  .panels-row {
    gap: 22px;
    margin-bottom: 22px;
  }

  .panel {
    border-radius: 22px;
  }

  .panel-head {
    padding: 24px 24px 20px;
  }

  .panel-title {
    font-size: 24px;
  }

  .panel-tag {
    font-size: 12px;
  }

  .panel-body {
    padding: 20px 24px 24px;
  }

  .chart-wrap {
    height: 210px;
  }

  .spark-wrap {
    height: 64px;
  }

  .health-row {
    padding: 16px 18px;
    border-radius: 18px;
  }

  .hname {
    font-size: 16px;
  }

  .hdesc,
  .hstatus {
    font-size: 13px;
  }

  .hval {
    font-size: 15px;
  }

  .usage-label,
  .usage-pct {
    font-size: 14px;
  }

  .bar-track {
    height: 11px;
  }

  .mini-grid {
    gap: 14px;
  }

  .mini-card {
    padding: 16px;
    border-radius: 18px;
  }

  .mini-label {
    font-size: 12px;
  }

  .mini-val {
    font-size: 22px;
  }

  .metric-card-arrow {
    font-size: 14px;
  }

  .aiUsagedetailPopUp {
    width: min(980px, calc(100vw - 60px));
    max-height: min(84vh, 820px);
    border-radius: 34px;
  }

  .aiUsagePopupHeader {
    padding: 30px 32px 22px;
  }

  .aiUsagePopupEyebrow {
    font-size: 12px;
  }

  .aiUsagePopupTitle {
    font-size: 22px;
  }

  .aiUsagePopupCloseBtn {
    width: 46px;
    height: 46px;
    font-size: 20px;
  }

  .aiUsageCategoryTabs {
    gap: 12px;
    padding: 20px 32px 0;
  }

  .aiUsageCategoryTab {
    padding: 11px 20px;
    font-size: 14px;
  }

  .aiUsagePopupBody {
    padding: 24px 32px 32px;
    max-height: calc(84vh - 140px);
  }

  .aiUsagePlaceholderCard {
    min-height: 280px;
    padding: 28px;
    border-radius: 24px;
  }

  .aiUsagePlaceholderTitle {
    font-size: 24px;
  }

  .aiUsagePlaceholderText {
    font-size: 15px;
  }
}
