:root {
  color-scheme: dark;
  --bg: #07131d;
  --surface: #0c1b27;
  --surface-2: #102433;
  --line: rgba(255, 255, 255, 0.08);
  --text: #edf7f5;
  --muted: #8da4ad;
  --green: #44d79b;
  --yellow: #f5c451;
  --red: #ff6b6b;
  --cyan: #47c7e6;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 20% 0%, rgba(71, 199, 230, 0.1), transparent 30rem),
    linear-gradient(180deg, #07131d 0%, #061019 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

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

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: env(safe-area-inset-top) 16px calc(24px + env(safe-area-inset-bottom));
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand,
.top-actions,
.service-main,
.card-top,
.section-heading,
.deploy-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand > div {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 15px;
}

.brand span:not(.brand-mark) {
  color: var(--muted);
  font-size: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, var(--green), var(--cyan));
  color: #042019;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(68, 215, 155, 0.18);
}

.brand-mark.large {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  font-size: 22px;
}

.top-actions {
  gap: 8px;
}

.ghost,
.icon-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.ghost {
  padding: 0 14px;
}

.icon-button {
  width: 42px;
  font-size: 22px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 8px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(16, 36, 51, 0.96), rgba(8, 26, 37, 0.96));
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -80% -30% auto auto;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.08;
  filter: blur(10px);
}

.hero.status-healthy { color: var(--green); }
.hero.status-degraded { color: var(--yellow); }
.hero.status-down { color: var(--red); }
.hero.status-unknown { color: var(--cyan); }

.hero > div {
  position: relative;
  color: var(--text);
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 10px 0 8px;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.hero p {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.pulse {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 10px color-mix(in srgb, currentColor 14%, transparent);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.metric,
.panel,
.project-card {
  border: 1px solid var(--line);
  background: rgba(12, 27, 39, 0.88);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.metric {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  border-radius: 18px;
}

.metric span,
.metric small,
.hint,
.project-category,
.project-stats span,
.last-use,
.service-row small,
.service-meta,
.deploy-row small,
.infra-item span,
.timeline-item p,
.timeline-item small,
footer {
  color: var(--muted);
}

.metric span,
.metric small {
  font-size: 11px;
}

.metric strong {
  margin: 8px 0 2px;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.panel {
  margin-top: 12px;
  padding: 18px;
  border-radius: 22px;
}

.section-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.hint {
  font-size: 11px;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.project-card {
  padding: 16px;
  border-radius: 17px;
}

.card-top,
.deploy-row {
  justify-content: space-between;
  gap: 12px;
}

.project-category {
  font-size: 11px;
}

.project-card h3 {
  margin: 18px 0 14px;
  font-size: 18px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 10px;
  font-weight: 800;
}

.status-badge i,
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-healthy { color: var(--green); }
.status-degraded { color: var(--yellow); }
.status-down { color: var(--red); }
.status-unknown { color: var(--muted); }

.project-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.project-stats > div {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.project-stats span,
.project-stats strong {
  display: block;
}

.project-stats span {
  margin-bottom: 5px;
  font-size: 10px;
}

.project-stats strong {
  font-size: 18px;
}

.last-use {
  margin: 14px 0 0;
  font-size: 11px;
  line-height: 1.5;
}

.service-list,
.stack,
.timeline {
  display: grid;
  gap: 1px;
}

.service-row,
.deploy-row,
.alert-item {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.service-row:last-child,
.deploy-row:last-child {
  border-bottom: 0;
}

.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.service-main {
  min-width: 0;
  gap: 10px;
}

.service-main > div,
.deploy-row > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.service-main strong,
.deploy-row strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-row small,
.deploy-row small {
  font-size: 10px;
}

.service-meta {
  flex: 0 0 auto;
  display: grid;
  gap: 3px;
  text-align: right;
  font-size: 10px;
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

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

.infra-item {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.infra-item span {
  margin-bottom: 6px;
  font-size: 10px;
}

.infra-item strong {
  font-size: 17px;
}

.alert-item {
  padding: 14px;
  border: 1px solid rgba(255, 107, 107, 0.18);
  border-radius: 14px;
  background: rgba(255, 107, 107, 0.05);
}

.alert-item strong {
  display: block;
  margin-top: 10px;
}

.alert-item p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 12px;
}

.alert-item small {
  color: var(--muted);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  padding: 8px 0 14px;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(71, 199, 230, 0.08);
}

.timeline-item p {
  margin: 4px 0;
  font-size: 12px;
}

.timeline-item small {
  font-size: 10px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
}

.empty-state p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 28px 6px 6px;
  font-size: 11px;
}

footer a {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.spinning {
  animation: spin 0.7s linear infinite;
}

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

.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(440px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(12, 27, 39, 0.94);
  box-shadow: var(--shadow);
}

.login-brand h1 {
  margin: 24px 0 10px;
  font-size: clamp(30px, 8vw, 43px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.login-brand .eyebrow {
  display: block;
  margin-top: 18px;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.login-card form {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.login-card label {
  font-size: 12px;
  font-weight: 700;
}

.login-card input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.login-card input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(71, 199, 230, 0.08);
}

.login-card button {
  min-height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  color: #042019;
  font-weight: 900;
  cursor: pointer;
}

.form-error {
  margin: 0;
  color: var(--red);
  font-size: 12px;
}

@media (min-width: 720px) {
  .shell {
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero {
    min-height: 240px;
    padding: 34px;
  }

  .metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .split {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

@media (min-width: 1040px) {
  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

