:root {
  color-scheme: light;
  --bg: #f4f7fa;
  --rail: #ffffff;
  --header: #ffffff;
  --tile: #ffffff;
  --tile-hover: #f8fbff;
  --text: #142033;
  --muted: #5e6b7c;
  --line: rgba(20, 32, 51, 0.12);
  --teal: #14b8a6;
  --teal-bright: #0f9f91;
  --blue: #2563eb;
  --amber: #f59e0b;
  --red: #e11d48;
  --magenta: #64748b;
  --coral: #2563eb;
  --violet: #4f46e5;
  --shadow: 0 18px 38px rgba(20, 32, 51, 0.1);
  --shadow-strong: 0 22px 48px rgba(20, 32, 51, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 4%, rgba(37, 99, 235, 0.14), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(20, 184, 166, 0.15), transparent 30%),
    radial-gradient(circle at 64% 90%, rgba(245, 158, 11, 0.12), transparent 34%),
    linear-gradient(rgba(244, 247, 250, 0.9), rgba(244, 247, 250, 0.96)),
    linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0 1px, transparent 1px 90px),
    var(--bg);
  background-size: auto, auto, auto, auto, 90px 90px, auto;
  color: var(--text);
  font-family:
    "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 86px 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 82px;
  padding: 10px 22px 14px 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(20, 184, 166, 0.14), transparent 28%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  box-shadow: 0 16px 34px rgba(20, 32, 51, 0.1);
}

.header-divider {
  position: sticky;
  top: 82px;
  z-index: 9;
  height: 22px;
  margin-left: 58px;
  background:
    radial-gradient(80% 28px at 54% 0%, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.04) 58%, transparent 72%),
    linear-gradient(180deg, #f8fbff 0%, rgba(248, 251, 255, 0.92) 44%, rgba(248, 251, 255, 0) 100%);
  pointer-events: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(20, 184, 166, 0.34);
  border-radius: 8px;
  background:
    radial-gradient(circle at 82% 16%, rgba(20, 184, 166, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), transparent 36%),
    linear-gradient(160deg, #ffffff, #e8fbf8);
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: var(--shadow-strong);
}

.brand-mark svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.brand-mark circle {
  fill: var(--teal);
  stroke: transparent;
}

.header-title {
  display: grid;
  gap: 2px;
}

.header-title h1 {
  margin: 0;
  color: var(--text);
  font-size: 1.36rem;
  font-weight: 800;
  letter-spacing: 0;
}

.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: center;
  margin-bottom: 4px;
  border: 1px solid rgba(20, 32, 51, 0.1);
  border-radius: 999px;
  padding: 6px 7px 6px 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 26px rgba(20, 32, 51, 0.08);
}

.user-copy {
  display: grid;
  justify-items: end;
  gap: 1px;
}

.user-copy span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.user-copy strong {
  color: var(--text);
  font-size: 0.86rem;
}

.user-avatar {
  justify-self: center;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: linear-gradient(145deg, var(--violet), var(--magenta));
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
}

.app-layout {
  display: grid;
  grid-template-columns: 58px 1fr;
  min-height: calc(100vh - 104px);
  margin-top: -22px;
  padding-top: 22px;
}

.side-nav {
  position: sticky;
  top: 82px;
  align-self: start;
  display: grid;
  align-content: start;
  grid-auto-rows: min-content;
  gap: 0;
  justify-items: center;
  width: 58px;
  min-height: calc(100vh - 82px);
  padding: 0 0 16px;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.1), transparent 38%),
    var(--rail);
  border-right: 1px solid rgba(20, 32, 51, 0.12);
}

.nav-button,
.refresh-button {
  display: grid;
  place-items: center;
  border: 0;
  color: var(--teal);
  cursor: pointer;
}

.nav-button {
  position: relative;
  width: 46px;
  height: 46px;
  min-height: 46px;
  border-left: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  opacity: 0.92;
  padding: 0;
}

.nav-button.active {
  background: rgba(20, 184, 166, 0.14);
  border-left-color: var(--teal);
  color: var(--teal-bright);
}

.nav-button.active {
  opacity: 1;
}

.nav-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  z-index: 20;
  min-width: max-content;
  max-width: 180px;
  transform: translate(-4px, -50%);
  border: 1px solid rgba(20, 32, 51, 0.12);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 8px 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), transparent 42%),
    linear-gradient(160deg, #ffffff, #eef5ff);
  box-shadow: var(--shadow-strong);
  color: var(--teal-bright);
  font-size: 0.78rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.nav-button:hover .nav-tooltip,
.nav-button:focus-visible .nav-tooltip {
  opacity: 1;
  transform: translate(0, -50%);
}

.nav-button svg,
.refresh-button svg,
.tile-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.tile-icon img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.workspace {
  width: min(1720px, 100%);
  padding: 38px 40px 64px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-actions.optional[hidden] {
  display: none;
}

.select-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stage-select {
  min-width: 150px;
  height: 44px;
  border: 1px solid rgba(20, 32, 51, 0.12);
  border-left: 4px solid var(--coral);
  border-radius: 8px;
  padding: 0 36px 0 12px;
  background:
    radial-gradient(circle at 90% 10%, rgba(37, 99, 235, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), transparent 35%),
    linear-gradient(160deg, #ffffff, #eef5ff);
  box-shadow: var(--shadow-strong);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.stage-select:focus {
  outline: 2px solid rgba(24, 196, 189, 0.45);
  outline-offset: 2px;
}

.stage-select option {
  background: #ffffff;
  color: var(--text);
}

.section-header h2 {
  position: relative;
  margin: 0 0 6px;
  padding-left: 18px;
  color: var(--text);
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 300;
  letter-spacing: 0;
}

.section-header h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 7px;
  width: 2px;
  background: linear-gradient(180deg, var(--coral), var(--magenta), var(--teal-bright));
}

.section-header p {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.status-pill {
  min-width: 124px;
  margin-bottom: 8px;
  border: 1px solid rgba(20, 32, 51, 0.12);
  border-left: 4px solid #697172;
  border-radius: 8px;
  padding: 11px 14px;
  background:
    radial-gradient(circle at 90% 10%, rgba(37, 99, 235, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), transparent 35%),
    linear-gradient(160deg, #ffffff, #eef5ff);
  box-shadow: var(--shadow-strong);
  color: var(--muted);
  text-align: center;
  font-size: 0.86rem;
  font-weight: 800;
}

.status-pill.ready {
  border-color: rgba(20, 32, 51, 0.12);
  border-left-color: var(--teal-bright);
  color: var(--teal-bright);
}

.status-pill.degraded {
  border-color: rgba(20, 32, 51, 0.12);
  border-left-color: var(--amber);
  color: var(--amber);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(226px, 226px));
  gap: 16px;
}

.section-stack {
  display: grid;
  gap: 34px;
}

.stage-section,
.tool-section {
  display: grid;
  gap: 14px;
}

.stage-title,
.tool-section h3 {
  position: relative;
  margin: 0;
  padding-left: 14px;
  color: var(--text);
  font-size: 1.45rem;
  font-weight: 300;
  letter-spacing: 0;
}

.stage-title::before,
.tool-section h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 5px;
  width: 2px;
  background: var(--blue);
  background: linear-gradient(180deg, var(--coral), var(--magenta), var(--teal-bright));
}

.stage-body {
  display: grid;
  gap: 18px;
}

.tool-section h3 {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tile {
  position: relative;
  display: grid;
  grid-template-rows: 1fr 44px;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid rgba(20, 32, 51, 0.1);
  border-radius: 8px;
  background:
    radial-gradient(circle at 84% 12%, rgba(37, 99, 235, 0.09), transparent 24%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), transparent 28%),
    linear-gradient(160deg, #ffffff, var(--tile) 58%, #eef5ff);
  box-shadow: var(--shadow-strong);
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.tile:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.25);
  background:
    radial-gradient(circle at 84% 12%, rgba(20, 184, 166, 0.12), transparent 26%),
    linear-gradient(145deg, rgba(255, 255, 255, 1), transparent 30%),
    linear-gradient(160deg, var(--tile-hover), #eaf3ff);
  box-shadow: 0 28px 54px rgba(20, 32, 51, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.tile-main {
  padding: 18px 74px 34px 16px;
}

.tile-title {
  margin: 0;
  color: var(--text);
  font-size: 1.28rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
}

.tile p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.35;
}

.tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  background: var(--teal);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
}

.tile-footer span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile.ready .tile-footer {
  background: var(--teal);
}

.tile.degraded .tile-footer {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.tile.unavailable .tile-footer {
  background: linear-gradient(90deg, #e11d48, #fb7185);
}

.tile.unknown .tile-footer {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}

.tile-icon {
  position: absolute;
  right: 14px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 28%, #ffffff, #f0f7f6 70%);
  color: var(--magenta);
  box-shadow: 0 11px 24px rgba(0, 0, 0, 0.34);
}

.tile.ready .tile-icon {
  color: var(--teal);
}

.tile.degraded .tile-icon {
  color: var(--amber);
}

.tile.unavailable .tile-icon {
  color: var(--red);
}

.tile.unknown .tile-icon {
  color: var(--violet);
}

.tile-badge {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.tile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag {
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.07);
  padding: 3px 7px;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
}

.refresh-button {
  width: 52px;
  height: 44px;
  margin-bottom: 8px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 88% 12%, rgba(20, 184, 166, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), transparent 35%),
    linear-gradient(160deg, #ffffff, #e8fbf8);
  border: 1px solid rgba(20, 184, 166, 0.34);
  border-left: 4px solid var(--teal);
  box-shadow: var(--shadow-strong);
}

.refresh-button:hover {
  transform: translateY(-2px);
  color: var(--teal-bright);
  border-color: rgba(20, 184, 166, 0.55);
  border-left-color: var(--teal-bright);
  box-shadow: 0 24px 44px rgba(20, 32, 51, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.refresh-button.loading svg {
  animation: spin 900ms linear infinite;
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  padding: 24px;
  color: var(--muted);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .app-header {
    grid-template-columns: 68px 1fr;
    min-height: 70px;
    padding: 8px 10px 10px 0;
  }

  .header-divider {
    top: 70px;
    margin-left: 0;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand-mark svg {
    width: 36px;
    height: 36px;
  }

  .user-area {
    display: none;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: sticky;
    top: 70px;
    z-index: 8;
    grid-auto-flow: column;
    justify-content: start;
    width: 100%;
    min-height: 56px;
    padding: 6px 10px;
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
  }

  .nav-button {
    width: 48px;
    min-height: 48px;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .nav-button.active {
    border-bottom-color: var(--teal-bright);
  }

  .nav-tooltip {
    left: 50%;
    top: calc(100% + 8px);
    transform: translate(-50%, -4px);
  }

  .nav-button:hover .nav-tooltip,
  .nav-button:focus-visible .nav-tooltip {
    transform: translate(-50%, 0);
  }

  .workspace {
    padding: 26px 14px 38px;
  }

  .section-header {
    align-items: flex-start;
  }

  .tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }
}
