@font-face {
  font-family: Satoshi;
  src: url("../fonts/satoshi-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Satoshi;
  src: url("../fonts/satoshi-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: Satoshi;
  src: url("../fonts/satoshi-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: JetBrains;
  src: url("../fonts/jetbrains-mono-latin-400-600.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: Satoshi, Arial, sans-serif;
  font-synthesis: none;
  --live: #2bcb78;
  --live-text: #147a45;
  --warning: #f2b544;
  --warning-text: #a25a00;
  --critical: #e25555;
  --critical-text: #b4232f;
  --shadow: 0 22px 60px rgba(7, 18, 37, 0.14);
}

.theme-cobalt {
  --foundation: #001330;
  --raised: #0b2147;
  --accent: #2d6bff;
  --accent-deep: #174db8;
  --accent-light: #8cb4ff;
  --canvas: #ffffff;
  --neutral: #f7f9fc;
  --selected: #dce8ff;
  --ink: #0c172a;
  --muted: #53657a;
  --muted-dark: #b8c7d9;
  --border: #cbd6e4;
  --row-hover: #eef4ff;
  --accent-rgb: 45, 107, 255;
}

.theme-gold {
  --foundation: #151515;
  --raised: #292b2b;
  --accent: #c6a15b;
  --accent-deep: #7e5f1a;
  --accent-light: #d4b96f;
  --canvas: #fbfaf7;
  --neutral: #f3f0e9;
  --selected: #e8ddbd;
  --ink: #151515;
  --muted: #555651;
  --muted-dark: #c8c6c0;
  --border: #d6d4ce;
  --row-hover: #f5efe2;
  --accent-rgb: 198, 161, 91;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--neutral);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--neutral);
}

button,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent-light);
  outline-offset: 2px;
}

.review-bar {
  position: relative;
  z-index: 20;
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 14px;
  padding: 7px 18px;
  color: var(--muted-dark);
  background: var(--foundation);
  font:
    500 10px/1.4 JetBrains,
    monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.review-bar strong {
  color: var(--accent-light);
}

.review-bar a {
  margin-left: auto;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.cloud-panel {
  display: grid;
  min-height: calc(100vh - 36px);
  grid-template-columns: 242px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  height: calc(100vh - 36px);
  min-height: 640px;
  flex-direction: column;
  padding: 30px 18px 22px;
  color: #fff;
  background: var(--foundation);
}

.brand {
  display: inline-flex;
  width: 126px;
  min-height: 70px;
  align-items: center;
}

.brand img {
  display: block;
  width: 118px;
  height: auto;
}

.workspace {
  margin: 34px 6px 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.workspace span,
.label {
  display: block;
  color: var(--muted);
  font:
    600 10px/1.45 JetBrains,
    monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workspace span {
  color: var(--muted-dark);
}

.workspace strong {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}

.sidebar nav {
  display: grid;
  gap: 3px;
}

.sidebar nav button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 0;
  color: var(--muted-dark);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
}

.sidebar nav button::before {
  position: absolute;
  left: 0;
  width: 2px;
  height: 0;
  content: "";
  background: var(--accent);
  transition: height 160ms ease;
}

.sidebar nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar nav button.is-active {
  color: #fff;
  background: var(--raised);
}

.sidebar nav button.is-active::before {
  height: 26px;
}

.sidebar nav b {
  display: inline-grid;
  width: 21px;
  height: 21px;
  place-items: center;
  color: #fff;
  background: var(--critical-text);
  font:
    600 10px JetBrains,
    monospace;
}

.sidebar-foot {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 18px 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-foot p {
  margin: -3px 0 0;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
}

.sidebar-foot small {
  color: var(--muted-dark);
}

.state-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.state-dot--live {
  background: var(--live);
  box-shadow: 0 0 0 4px rgba(43, 203, 120, 0.12);
}

.state-dot--warning {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(242, 181, 68, 0.14);
}

.state-dot--critical {
  background: var(--critical);
  box-shadow: 0 0 0 4px rgba(226, 85, 85, 0.12);
}

.panel-main {
  min-width: 0;
  background: var(--neutral);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px clamp(24px, 4vw, 58px);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--canvas) 96%, transparent);
  backdrop-filter: blur(12px);
}

.topbar > div:first-child strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.topbar-actions {
  display: flex;
  align-items: end;
  gap: 9px;
}

.topbar-actions label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font:
    600 9px JetBrains,
    monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

select,
.button {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 2px;
}

select {
  min-width: 132px;
  padding: 0 34px 0 12px;
  color: var(--ink);
  background: var(--canvas);
  cursor: pointer;
  font-size: 12px;
}

.button {
  padding: 0 16px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.button--primary {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent-deep);
}

.theme-gold .button--primary {
  color: #151515;
  background: var(--accent);
}

.button--primary:hover {
  filter: brightness(0.96);
}

.button--secondary {
  color: var(--ink);
  background: var(--canvas);
}

.button--secondary:hover {
  border-color: var(--accent);
  background: var(--row-hover);
}

.view {
  display: none;
  max-width: 1540px;
  margin: 0 auto;
  padding: clamp(42px, 5vw, 74px) clamp(24px, 4vw, 58px) 80px;
}

.view.is-visible {
  display: block;
}

.page-head {
  display: flex;
  min-height: 126px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 34px;
}

.page-head h1 {
  max-width: 780px;
  margin: 12px 0 12px;
  color: var(--foundation);
  font-size: clamp(36px, 4.2vw, 66px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.page-head p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.updated {
  flex: 0 0 auto;
  margin-top: 8px;
  color: var(--muted);
  font:
    500 10px JetBrains,
    monospace;
}

.metric-grid {
  display: grid;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  grid-template-columns: repeat(4, 1fr);
  background: var(--canvas);
}

.metric-grid article {
  min-height: 148px;
  padding: 24px;
  border-right: 1px solid var(--border);
}

.metric-grid article:last-child {
  border-right: 0;
}

.metric-grid span,
.gpu-grid article > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.metric-grid strong {
  display: block;
  margin: 16px 0 13px;
  color: var(--foundation);
  font-size: 38px;
  line-height: 1;
}

.metric-grid small {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.metric-grid small .state-dot {
  margin-top: 0;
}

.metric-grid--three {
  grid-template-columns: repeat(3, 1fr);
}

.panel-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-card,
.incident-card,
.gpu-grid article {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--canvas);
}

.panel-card--wide {
  grid-column: 1 / -1;
}

.panel-card--standalone {
  width: 100%;
}

.panel-card > header {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.panel-card h2,
.incident-card h2 {
  margin: 5px 0 0;
  color: var(--foundation);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.panel-card > header > button:not(.button) {
  padding: 0;
  border: 0;
  color: var(--accent-deep);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.data-table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.table-row {
  display: grid;
  min-width: 680px;
  min-height: 58px;
  align-items: center;
  gap: 22px;
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  grid-template-columns: 1.5fr 1fr 0.8fr 0.7fr;
  font-size: 12px;
}

.table-row:first-child {
  border-top: 0;
}

.table-row:not(.table-head):hover {
  background: var(--row-hover);
}

.table-row[hidden] {
  display: none;
}

.table-head {
  min-height: 44px;
  color: var(--muted);
  background: var(--neutral);
  font:
    600 9px JetBrains,
    monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table--infra .table-row {
  min-width: 850px;
  grid-template-columns: 1.25fr 0.8fr 0.8fr 1.2fr 0.8fr;
}

.status {
  justify-self: start;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 700;
}

.status--live {
  color: var(--live-text);
  background: rgba(43, 203, 120, 0.12);
}

.status--warning {
  color: var(--warning-text);
  background: rgba(242, 181, 68, 0.15);
}

.status--critical {
  color: var(--critical-text);
  background: rgba(226, 85, 85, 0.12);
}

.bar-list {
  display: grid;
  gap: 19px;
  padding: 24px;
}

.bar-list > div {
  display: grid;
  align-items: center;
  gap: 8px 14px;
  grid-template-columns: 1fr auto;
  color: var(--muted);
  font-size: 12px;
}

.bar-list b {
  color: var(--foundation);
  font:
    600 11px JetBrains,
    monospace;
}

.bar-list i,
.gpu-grid i {
  position: relative;
  display: block;
  height: 5px;
  overflow: hidden;
  background: var(--selected);
  grid-column: 1 / -1;
}

.bar-list i::after,
.gpu-grid i::after {
  display: block;
  width: var(--value);
  height: 100%;
  content: "";
  background: var(--accent);
}

.activity {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 12px 24px;
  list-style: none;
}

.activity li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.activity li:last-child {
  border-bottom: 0;
}

.activity strong,
.activity span {
  display: block;
  font-size: 12px;
}

.activity span {
  margin-top: 4px;
  color: var(--muted);
}

.incident-card {
  display: grid;
  align-items: start;
  gap: 24px;
  margin-bottom: 24px;
  padding: 30px;
  grid-template-columns: auto 1fr auto;
}

.incident-severity {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--critical-text);
  background: rgba(226, 85, 85, 0.12);
  font:
    700 12px JetBrains,
    monospace;
}

.incident-card p {
  max-width: 760px;
  margin: 12px 0 22px;
  color: var(--muted);
  line-height: 1.6;
}

.incident-card dl {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin: 0;
}

.incident-card dl div {
  min-width: 110px;
}

.incident-card dt {
  color: var(--muted);
  font:
    600 9px JetBrains,
    monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.incident-card dd {
  margin: 5px 0 0;
  font-size: 12px;
  font-weight: 700;
}

.simple-list {
  padding: 0 22px;
}

.simple-list > div {
  display: flex;
  min-height: 65px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.simple-list > div:last-child {
  border-bottom: 0;
}

.simple-list span {
  color: var(--muted);
}

.gpu-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
  grid-template-columns: repeat(3, 1fr);
}

.gpu-grid article {
  min-height: 210px;
  padding: 24px;
}

.gpu-grid strong {
  display: block;
  margin: 21px 0 7px;
  color: var(--foundation);
  font-size: 30px;
}

.gpu-grid p {
  min-height: 42px;
  margin: 0 0 25px;
  color: var(--muted);
  font-size: 12px;
}

dialog {
  width: min(480px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--ink);
  background: var(--canvas);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 19, 48, 0.62);
}

dialog form {
  padding: 34px;
}

dialog h2 {
  margin: 10px 0;
  color: var(--foundation);
  font-size: 30px;
}

dialog p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

dialog form > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  padding: 13px 16px;
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--foundation);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
}

.toast[hidden] {
  display: none;
}

@media (max-width: 1100px) {
  .cloud-panel {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-grid article:nth-child(2) {
    border-right: 0;
  }

  .metric-grid article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 820px) {
  .review-bar {
    flex-wrap: wrap;
  }

  .review-bar span {
    display: none;
  }

  .cloud-panel {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
    padding: 16px;
  }

  .brand {
    width: 90px;
    min-height: 50px;
  }

  .brand img {
    width: 86px;
  }

  .workspace,
  .sidebar-foot {
    display: none;
  }

  .sidebar nav {
    display: flex;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .sidebar nav button {
    width: auto;
    min-width: max-content;
    padding: 0 13px;
  }

  .sidebar nav button::before {
    left: 50%;
    bottom: 0;
    width: 0;
    height: 2px;
    transform: translateX(-50%);
    transition: width 160ms ease;
  }

  .sidebar nav button.is-active::before {
    width: 30px;
    height: 2px;
  }

  .topbar {
    position: static;
  }

  .page-head {
    display: block;
  }

  .updated {
    margin-top: 18px;
  }

  .panel-grid,
  .gpu-grid {
    grid-template-columns: 1fr;
  }

  .incident-card {
    grid-template-columns: auto 1fr;
  }

  .incident-card .button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 18px 16px;
  }

  .topbar-actions {
    display: grid;
    align-items: end;
    grid-template-columns: 1fr 1fr;
  }

  .topbar-actions label {
    grid-column: 1 / -1;
  }

  select {
    width: 100%;
  }

  .view {
    padding: 42px 16px 60px;
  }

  .page-head h1 {
    font-size: 42px;
  }

  .page-head p {
    font-size: 14px;
  }

  .metric-grid,
  .metric-grid--three {
    grid-template-columns: 1fr;
  }

  .metric-grid article {
    min-height: 125px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .metric-grid article:last-child {
    border-bottom: 0;
  }

  .panel-card > header,
  .simple-list > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-card > header {
    min-height: 0;
  }

  .simple-list > div {
    justify-content: center;
    padding: 14px 0;
  }

  .incident-card {
    padding: 22px;
    grid-template-columns: 1fr;
  }

  .incident-card .button {
    grid-column: 1;
  }

  .incident-card dl {
    gap: 18px;
  }

  dialog form {
    padding: 26px;
  }

  dialog form > div {
    flex-direction: column-reverse;
  }

  dialog .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
