:root {
  color-scheme: dark;
  --bg: #08090b;
  --sidebar: #0d0e11;
  --panel: #17181c;
  --panel-2: #22242a;
  --text: #f4f1ea;
  --muted: #b8b2a4;
  --quiet: #817a6d;
  --line: #363941;
  --line-strong: #5a606b;
  --accent: #ff5a3d;
  --cyan: #18d4c3;
  --amber: #f5c84b;
  --red: #ff6b6b;
  --green: #60d394;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button,
input,
select {
  min-height: 44px;
  border-radius: 6px;
}

button {
  border: 1px solid var(--accent);
  color: #090a0c;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.ghost,
.panel-header button,
.button-link {
  color: var(--text);
  background: transparent;
  border-color: var(--line-strong);
}

.sso-button {
  color: #090a0c;
  border-color: var(--cyan);
  background: var(--cyan);
}

input,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  color: var(--text);
  background: #111217;
}

label span,
legend {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.1;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.eyebrow,
.panel-label {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 460px);
  gap: clamp(28px, 7vw, 96px);
  min-height: 100vh;
  padding: clamp(28px, 7vw, 88px);
  background:
    linear-gradient(110deg, rgba(255, 90, 61, 0.09), transparent 38%),
    radial-gradient(circle at 82% 16%, rgba(24, 212, 195, 0.14), transparent 28%),
    var(--bg);
}

.login-copy {
  align-self: center;
  max-width: 780px;
}

.login-copy h1 {
  font-size: clamp(40px, 7vw, 92px);
  line-height: 0.92;
}

.login-copy p:not(.eyebrow) {
  max-width: 640px;
  font-size: 19px;
}

.login-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 24, 28, 0.96);
}

.login-panel {
  align-self: center;
  display: grid;
  gap: 18px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
}

.form-note {
  margin-bottom: 0;
  color: var(--quiet);
  font-size: 13px;
}

.form-note.error {
  color: var(--red);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  height: 1px;
  flex: 1 1 auto;
  content: "";
  background: var(--line);
}

.dashboard {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.dashboard[data-busy="true"] .brand-mark,
.dashboard[data-busy="true"] .metric-build {
  border-color: rgba(24, 212, 195, 0.72);
  box-shadow: 0 0 0 1px rgba(24, 212, 195, 0.13), 0 18px 52px rgba(0, 0, 0, 0.24);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 6px;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 38px;
  height: 38px;
}

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

.sidebar nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
}

.sidebar nav a.active,
.sidebar nav a:hover {
  color: var(--text);
  background: var(--panel-2);
}

.sidebar .ghost {
  margin-top: auto;
}

.workspace {
  padding: clamp(20px, 4vw, 44px);
}

.page-root {
  display: grid;
  gap: 18px;
}

.topbar,
.panel-header,
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 24px;
}

.busy-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 90, 61, 0.74);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 90, 61, 0.16), transparent 64%),
    var(--panel);
  box-shadow: 0 0 0 1px rgba(255, 90, 61, 0.1), 0 22px 70px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.busy-banner::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(100deg, transparent 0%, rgba(24, 212, 195, 0.14) 42%, transparent 72%);
  animation: busy-sweep 2.2s ease-in-out infinite;
  pointer-events: none;
}

.busy-copy {
  position: relative;
  z-index: 1;
  min-width: 220px;
  flex: 1 1 auto;
}

.busy-banner strong,
.busy-banner span {
  display: block;
}

.busy-banner strong {
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 17px;
}

.busy-banner span {
  color: #e6e1d6;
}

.busy-orbit {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 90, 61, 0.42);
  border-radius: 999px;
  animation: busy-spin 1.4s linear infinite;
}

.busy-orbit::before {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  content: "";
  background: var(--accent);
  box-shadow: 0 0 20px rgba(255, 90, 61, 0.82);
}

.busy-lanes {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 5px;
  width: min(260px, 28vw);
  min-width: 150px;
  flex: 0 0 auto;
}

.busy-lanes span {
  display: block;
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(24, 212, 195, 0.12), rgba(24, 212, 195, 0.78), rgba(245, 200, 75, 0.28));
  transform-origin: left;
  animation: busy-lane 1.4s ease-in-out infinite;
}

.busy-lanes span:nth-child(2) {
  width: 78%;
  animation-delay: 0.18s;
}

.busy-lanes span:nth-child(3) {
  width: 58%;
  animation-delay: 0.36s;
}

.user-chip {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metric-grid article {
  position: relative;
  min-height: 124px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.metric-build::after {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 38px;
  height: 10px;
  border-radius: 999px;
  content: "";
  opacity: 0;
  background: repeating-linear-gradient(90deg, var(--cyan) 0 8px, transparent 8px 14px);
}

.dashboard[data-busy="true"] .metric-build::after {
  opacity: 1;
  animation: busy-tracks 0.8s linear infinite;
}

.metric-grid span,
.metric-grid strong {
  display: block;
}

.metric-grid span {
  margin-bottom: 24px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-grid strong {
  font-size: 34px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 12px;
}

.single-grid {
  display: grid;
  grid-template-columns: 1fr;
}

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

.page-heading {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.page-heading h2 {
  margin-bottom: 8px;
}

.page-heading p:not(.panel-label) {
  max-width: 780px;
  margin-bottom: 0;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.panel {
  min-height: 220px;
  padding: 18px;
}

.span-2 {
  grid-column: span 1;
}

.release-form {
  display: grid;
  gap: 14px;
}

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

fieldset {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--muted);
}

.check input {
  width: 16px;
  min-height: 16px;
}

.table,
.stack-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.row,
.item {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111217;
}

.item-running {
  position: relative;
  border-color: rgba(24, 212, 195, 0.62);
  overflow: hidden;
}

.item-running::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(24, 212, 195, 0.1), transparent);
  animation: busy-sweep 1.8s ease-in-out infinite;
}

.row {
  grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.35fr) minmax(90px, 0.55fr) auto;
  align-items: center;
  column-gap: 16px;
}

.data-table {
  overflow-x: auto;
}

.data-table .row {
  grid-template-columns: var(--columns);
  min-width: 860px;
}

.table-head {
  padding-block: 10px;
  border-style: solid;
  background: var(--panel-2);
}

.table-head span {
  color: var(--quiet);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.row strong,
.item strong {
  display: block;
  color: var(--text);
}

.row span,
.item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.row div {
  min-width: 0;
}

.row div strong,
.row div span {
  overflow-wrap: anywhere;
}

.badge {
  justify-self: start;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.status-good {
  color: var(--green);
  border-color: rgba(96, 211, 148, 0.72);
}

.status-running {
  color: var(--cyan);
  border-color: rgba(24, 212, 195, 0.72);
}

.status-warn {
  color: var(--amber);
  border-color: rgba(245, 200, 75, 0.72);
}

.status-bad {
  color: var(--red);
  border-color: rgba(255, 107, 107, 0.72);
}

.status-neutral {
  color: var(--muted);
}

.running-copy {
  color: var(--cyan) !important;
  font-weight: 800;
}

.job-spinner {
  display: inline-grid !important;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border: 2px solid rgba(24, 212, 195, 0.28);
  border-top-color: var(--cyan);
  border-radius: 999px;
  vertical-align: -1px;
  animation: busy-spin 0.85s linear infinite;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--quiet);
}

.notice {
  padding: 13px 15px;
  border: 1px solid rgba(245, 200, 75, 0.58);
  border-radius: 8px;
  color: #f7df92;
  background: rgba(245, 200, 75, 0.09);
}

.notice.error {
  border-color: rgba(255, 107, 107, 0.62);
  color: #ffb4b4;
  background: rgba(255, 107, 107, 0.09);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.pager span {
  color: var(--muted);
  font-size: 13px;
}

.pager div {
  display: flex;
  gap: 8px;
}

.pager button {
  min-height: 38px;
  padding: 0 12px;
}

.page-loading {
  min-height: 160px;
}

.loading-bar {
  position: relative;
  height: 8px;
  margin-top: 24px;
  border-radius: 999px;
  background: #111217;
  overflow: hidden;
}

.loading-bar::before {
  position: absolute;
  inset: 0;
  width: 42%;
  border-radius: inherit;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  animation: busy-sweep 1.4s ease-in-out infinite;
}

.error-panel p {
  max-width: 760px;
}

.agent-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-state {
  padding: 3px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-state.online {
  color: var(--green);
  border-color: var(--green);
}

.agent-state.offline {
  color: var(--quiet);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-list {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.settings-list div {
  min-width: 0;
}

.settings-list dt {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.settings-list dd {
  margin: 4px 0 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.route-list,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.route-list a,
.chip-list span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #111217;
  font-size: 13px;
  text-decoration: none;
}

@media (max-width: 1040px) {
  .dashboard,
  .login-shell,
  .content-grid,
  .metric-grid,
  .overview-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar nav {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

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

@keyframes busy-sweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes busy-lane {
  0%,
  100% {
    opacity: 0.42;
    transform: scaleX(0.62);
  }
  45% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes busy-tracks {
  to {
    background-position: 14px 0;
  }
}

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

@media (max-width: 680px) {
  .login-shell,
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .panel-header,
  .page-heading,
  .busy-banner,
  .pager {
    align-items: flex-start;
    flex-direction: column;
  }

  .busy-lanes {
    width: 100%;
  }

  .sidebar nav,
  .form-row,
  .row {
    grid-template-columns: 1fr;
  }

  .sidebar nav a {
    justify-content: center;
    padding-inline: 8px;
    font-size: 13px;
  }

  .pager div,
  .pager button {
    width: 100%;
  }
}
