:root {
  color-scheme: dark;
  --bg: #0d100f;
  --bg-elevated: #121614;
  --surface: #161b18;
  --surface-soft: #1a201d;
  --surface-hover: #202722;
  --line: #29312c;
  --line-strong: #39433d;
  --text: #eef3f0;
  --text-soft: #a8b2ac;
  --text-faint: #6f7b74;
  --accent: #7fb99a;
  --accent-strong: #9cc9ae;
  --accent-muted: rgba(127, 185, 154, 0.12);
  --warning: #c9a86a;
  --warning-muted: rgba(201, 168, 106, 0.12);
  --danger: #c98279;
  --danger-muted: rgba(201, 130, 121, 0.12);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --font-sans: "Geist", "Aptos", "Segoe UI Variable", "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-family: var(--font-sans);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

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

.noise-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.84' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.muted {
  color: var(--text-soft);
}

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid rgba(127, 185, 154, 0.22);
  border-radius: 12px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

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

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 2px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand--large .brand-mark {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  border-radius: 14px;
}

.brand--large strong {
  font-size: 17px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.status-dot--offline {
  background: var(--text-faint);
  box-shadow: 0 0 0 3px rgba(111, 123, 116, 0.12);
}

.status-dot--danger {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-muted);
}

.status-dot--pulse {
  animation: status-pulse 2.4s ease-in-out infinite;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.58;
    transform: scale(0.82);
  }
}

.primary-button,
.secondary-button,
.danger-button,
.icon-text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 15px;
  cursor: pointer;
  border-radius: 10px;
  transition:
    transform 180ms cubic-bezier(0.16, 1, 0.3, 1),
    background-color 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease;
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.icon-text-button:active {
  transform: translateY(1px) scale(0.985);
}

.primary-button {
  color: #102018;
  font-weight: 700;
  background: var(--accent-strong);
  border: 1px solid var(--accent-strong);
}

.primary-button:hover {
  background: #b2d6c0;
}

.primary-button svg,
.secondary-button svg,
.icon-text-button svg {
  width: 17px;
  height: 17px;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.primary-button.is-loading span {
  opacity: 0.72;
}

.primary-button.is-loading svg {
  animation: button-shift 900ms ease-in-out infinite;
}

@keyframes button-shift {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(3px);
  }
}

.secondary-button {
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--line);
}

.secondary-button:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

.secondary-button.is-refreshing svg {
  animation: rotate-refresh 800ms cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

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

.danger-button {
  color: #f2d3cf;
  font-weight: 650;
  background: var(--danger-muted);
  border: 1px solid rgba(201, 130, 121, 0.28);
}

.danger-button:hover {
  background: rgba(201, 130, 121, 0.2);
}

.icon-text-button {
  width: 100%;
  justify-content: flex-start;
  color: var(--text-faint);
  background: transparent;
  border: 1px solid transparent;
}

.icon-text-button:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

/* Login */

.login-body {
  min-height: 100dvh;
  overflow-x: hidden;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.8), transparent 74%);
}

.login-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(420px, 0.7fr);
  min-height: 100dvh;
}

.login-context {
  display: flex;
  min-height: 100dvh;
  padding: clamp(32px, 5vw, 72px);
  flex-direction: column;
}

.login-copy {
  max-width: 760px;
  margin: auto 0;
  padding: 72px 0;
}

.login-copy h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(42px, 5.8vw, 82px);
  font-weight: 570;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.login-copy > p:last-child {
  max-width: 57ch;
  margin: 26px 0 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.7;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 760px;
  border-top: 1px solid var(--line);
}

.signal-strip > div {
  padding: 19px 22px 2px 0;
}

.signal-strip > div + div {
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

.signal-index {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10px;
}

.signal-strip p {
  margin: 9px 0 0;
  font-size: 13px;
  font-weight: 620;
}

.login-panel {
  display: flex;
  min-height: 100dvh;
  padding: clamp(28px, 4vw, 64px);
  flex-direction: column;
  background: rgba(18, 22, 20, 0.92);
  border-left: 1px solid var(--line);
  box-shadow:
    inset 1px 0 rgba(255, 255, 255, 0.025),
    -30px 0 90px rgba(3, 7, 5, 0.24);
  backdrop-filter: blur(18px);
}

.login-panel__status {
  display: flex;
  align-items: center;
  align-self: flex-end;
  gap: 10px;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-form {
  display: grid;
  width: min(100%, 430px);
  margin: auto;
  gap: 24px;
}

.login-form h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 610;
  letter-spacing: -0.045em;
}

.login-form .muted {
  margin: 10px 0 0;
  font-size: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span:first-child {
  font-size: 13px;
  font-weight: 630;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.field small {
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.45;
}

.password-input {
  position: relative;
  display: block;
}

.password-input input {
  padding-right: 48px;
}

.password-input button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  cursor: pointer;
  color: var(--text-faint);
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.password-input button:hover {
  color: var(--text);
  background: var(--surface);
}

.password-input svg {
  width: 19px;
  height: 19px;
}

.form-error {
  padding: 11px 13px;
  color: #e7b3ad;
  background: var(--danger-muted);
  border: 1px solid rgba(201, 130, 121, 0.22);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.5;
}

.login-footnote {
  margin: 0;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

/* Dashboard shell */

.app-shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100dvh;
}

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

.sidebar .brand {
  padding: 0 8px;
}

.side-nav {
  display: grid;
  margin-top: 46px;
  gap: 5px;
}

.side-nav__item {
  display: flex;
  min-height: 42px;
  padding: 0 11px;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 570;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

.side-nav__item svg {
  width: 18px;
  height: 18px;
}

.side-nav__item:hover {
  color: var(--text-soft);
  background: var(--surface);
}

.side-nav__item:active {
  transform: translateY(1px);
}

.side-nav__item.is-active {
  color: var(--text);
  background: var(--accent-muted);
  border-color: rgba(127, 185, 154, 0.15);
}

.side-nav__item.is-active svg {
  color: var(--accent);
}

.sidebar-footer {
  display: grid;
  margin-top: auto;
  gap: 13px;
}

.node-state {
  display: flex;
  padding: 13px 12px;
  align-items: center;
  gap: 11px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.node-state strong,
.node-state small {
  display: block;
}

.node-state strong {
  font-size: 11px;
  font-weight: 640;
}

.node-state small {
  max-width: 145px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 clamp(22px, 3vw, 48px) 64px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 16, 15, 0.84);
  border-bottom: 1px solid rgba(41, 49, 44, 0.74);
  backdrop-filter: blur(18px);
}

.topbar h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 610;
  letter-spacing: -0.04em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-pill {
  display: inline-flex;
  height: 40px;
  padding: 0 13px;
  align-items: center;
  gap: 9px;
  color: var(--text-soft);
  background: rgba(18, 22, 20, 0.72);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-anchor {
  scroll-margin-top: 122px;
}

/* Sidebar navigation is a real view switch, not only an anchor highlight. */
body[data-view="servers"] #overview .metric-grid,
body[data-view="servers"] #overview #events,
body[data-view="servers"] #profiles,
body[data-view="events"] #overview .metric-grid,
body[data-view="events"] #overview #servers,
body[data-view="events"] #profiles,
body[data-view="profiles"] #overview {
  display: none;
}

body[data-view="servers"] #overview .overview-layout,
body[data-view="events"] #overview .overview-layout {
  display: block;
}

body[data-view="servers"] #overview #servers,
body[data-view="events"] #overview #events {
  width: 100%;
}

body[data-view="profiles"] #profiles {
  display: block;
}

#logouts {
  display: none;
}

body[data-view="logouts"] #overview,
body[data-view="logouts"] #profiles {
  display: none;
}

body[data-view="logouts"] #logouts {
  display: block;
}

.logouts-panel {
  margin-top: 18px;
}

.panel-copy {
  display: grid;
  padding: 0 20px 18px;
  gap: 5px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.panel-copy p,
.panel-copy span {
  margin: 0;
}

.panel-copy span {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 9px;
}

.panel-copy code {
  color: var(--accent-strong);
  font-family: var(--font-mono);
}

.logout-groups {
  display: grid;
  padding: 0 18px 18px;
  gap: 12px;
}

.logout-group {
  overflow: hidden;
  background: rgba(13, 16, 15, 0.52);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.logout-group__header {
  display: flex;
  padding: 15px 17px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.logout-group__header h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 650;
}

.logout-issue-list {
  display: grid;
}

.logout-issue {
  display: grid;
  grid-template-columns: minmax(160px, 0.7fr) minmax(260px, 1.5fr) auto;
  padding: 14px 17px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.logout-issue:last-child {
  border-bottom: 0;
}

.logout-issue__identity,
.logout-issue__reason {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.logout-issue__reason > span:last-child {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-resolve-button {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.logout-empty-state {
  min-height: 280px;
  padding: 36px;
}

.global-error {
  display: flex;
  margin-top: 24px;
  padding: 14px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #e6b0aa;
  background: var(--danger-muted);
  border: 1px solid rgba(201, 130, 121, 0.25);
  border-radius: var(--radius-sm);
}

.global-error[hidden] {
  display: none;
}

.global-error strong,
.global-error small {
  display: block;
}

.global-error strong {
  font-size: 12px;
}

.global-error small {
  margin-top: 3px;
  color: #c9928b;
}

.global-error button {
  cursor: pointer;
  color: var(--text);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 650;
}

.overview-section {
  padding-top: 34px;
}

.metric-grid {
  display: grid;
  grid-template-columns: minmax(235px, 1.25fr) repeat(5, minmax(132px, 0.7fr));
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.metric {
  min-height: 148px;
  padding: 24px 22px;
  border-left: 1px solid var(--line);
  animation: metric-enter 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.metric:nth-child(2) {
  animation-delay: 60ms;
}

.metric:nth-child(3) {
  animation-delay: 120ms;
}

.metric:nth-child(4) {
  animation-delay: 180ms;
}

.metric:nth-child(5) {
  animation-delay: 240ms;
}

@keyframes metric-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metric:first-child {
  padding-left: 0;
  border-left: 0;
}

.metric p {
  margin: 0 0 18px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric > strong,
.metric-value strong {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 520;
  letter-spacing: -0.06em;
}

.metric > small,
.metric-value + small,
.metric small {
  display: block;
  margin-top: 9px;
  color: var(--text-faint);
  font-size: 10px;
  line-height: 1.45;
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.metric-value span {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 13px;
}

.metric-value b {
  color: var(--text-soft);
  font-weight: 520;
}

.metric--alert strong {
  color: var(--danger);
}

.capacity-track {
  height: 3px;
  margin-top: 18px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}

.capacity-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
  transform: scaleX(var(--capacity, 0));
  transform-origin: left;
}

.overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.65fr);
  margin-top: 34px;
  gap: 18px;
}

.panel {
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.025),
    0 24px 70px rgba(2, 6, 4, 0.16);
}

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

.panel-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.025em;
}

.panel-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-search {
  display: flex;
  width: 190px;
  height: 36px;
  padding: 0 10px;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.compact-search--wide {
  width: 260px;
}

.compact-search svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.compact-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 11px;
}

.compact-search input::placeholder {
  color: var(--text-faint);
}

.panel-tools select {
  height: 36px;
  padding: 0 30px 0 11px;
  color: var(--text-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  font-size: 11px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th {
  height: 41px;
  padding: 0 16px;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 550;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  height: 66px;
  padding: 10px 16px;
  color: var(--text-soft);
  border-bottom: 1px solid rgba(41, 49, 44, 0.75);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background-color 160ms ease;
}

.data-table tbody tr:not(.empty-row):hover {
  background: rgba(127, 185, 154, 0.035);
}

.cell-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 620;
}

.cell-meta {
  display: block;
  max-width: 260px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-label {
  display: inline-flex;
  height: 24px;
  padding: 0 8px;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: lowercase;
}

.status-label--online,
.status-label--running,
.status-label--idle {
  color: var(--accent-strong);
  background: var(--accent-muted);
  border-color: rgba(127, 185, 154, 0.2);
}

.status-label--offline,
.status-label--unknown {
  color: var(--text-faint);
}

.status-label--banned,
.status-label--conflict,
.status-label--error {
  color: #e2a39b;
  background: var(--danger-muted);
  border-color: rgba(201, 130, 121, 0.2);
}

.status-label--warning,
.status-label--restarting,
.status-label--starting {
  color: #dbc28e;
  background: var(--warning-muted);
  border-color: rgba(201, 168, 106, 0.2);
}

.autostart-status {
  display: inline-flex;
  min-height: 23px;
  padding: 0 8px;
  align-items: center;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1;
  text-transform: lowercase;
  white-space: nowrap;
}

.autostart-status--ready {
  color: var(--accent-strong);
  background: var(--accent-muted);
  border-color: rgba(127, 185, 154, 0.2);
}

.autostart-status--warning {
  color: #dbc28e;
  background: var(--warning-muted);
  border-color: rgba(201, 168, 106, 0.2);
}

.autostart-status--danger {
  color: #e2a39b;
  background: var(--danger-muted);
  border-color: rgba(201, 130, 121, 0.2);
}

.autostart-status--disabled {
  color: var(--text-faint);
}

.session-meter {
  display: grid;
  min-width: 100px;
  gap: 6px;
}

.session-meter__numbers {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-mono);
}

.session-meter__numbers strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 560;
}

.session-meter__numbers span {
  color: var(--text-faint);
  font-size: 9px;
}

.session-meter__track {
  display: block;
  width: 84px;
  height: 3px;
  overflow: hidden;
  background: var(--line);
  border-radius: 99px;
}

.session-meter__track i {
  display: block;
  width: var(--usage, 0%);
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.table-action {
  display: inline-flex;
  width: 31px;
  height: 31px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-faint);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.table-action:hover {
  color: var(--danger);
  background: var(--danger-muted);
  border-color: rgba(201, 130, 121, 0.18);
}

.table-action svg {
  width: 16px;
  height: 16px;
}

.table-action:disabled {
  cursor: not-allowed;
  opacity: 0.24;
}

.count-badge {
  display: grid;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  place-items: center;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
}

.events-list {
  max-height: 511px;
  overflow: auto;
}

.event-item {
  position: relative;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  padding: 16px 19px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  animation: event-enter 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes event-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.event-item:last-child {
  border-bottom: 0;
}

.event-marker {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  background: var(--text-faint);
  border-radius: 999px;
}

.event-item--success .event-marker {
  background: var(--accent);
}

.event-item--warning .event-marker {
  background: var(--warning);
}

.event-item--error .event-marker {
  background: var(--danger);
}

.event-content p {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.45;
}

.event-content strong {
  color: var(--text);
  font-weight: 620;
}

.event-meta {
  display: flex;
  margin-top: 7px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 8px;
}

.profiles-panel {
  margin-top: 18px;
}

.data-table--profiles {
  min-width: 980px;
}

.data-table--profiles td:first-child {
  width: 23%;
}

.table-footer {
  display: flex;
  min-height: 44px;
  padding: 0 18px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--text-faint);
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 8px;
}

.empty-row td {
  height: 174px;
  text-align: center;
}

.empty-state {
  display: grid;
  max-width: 340px;
  margin: 0 auto;
  place-items: center;
}

.empty-state svg {
  width: 30px;
  height: 30px;
  color: var(--text-faint);
}

.empty-state strong {
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 12px;
}

.empty-state span {
  margin-top: 5px;
  color: var(--text-faint);
  font-size: 10px;
}

.skeleton-row td {
  height: 66px;
}

.skeleton-row span,
.event-skeleton {
  display: block;
  overflow: hidden;
  background: var(--surface);
  border-radius: 7px;
}

.skeleton-row span {
  width: 100%;
  height: 30px;
}

.event-skeleton {
  height: 72px;
  margin: 14px 18px;
}

.skeleton-row span::after,
.event-skeleton::after {
  display: block;
  width: 45%;
  height: 100%;
  content: "";
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.035),
    transparent
  );
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  from {
    transform: translateX(-110%);
  }
  to {
    transform: translateX(280%);
  }
}

.action-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: 0 30px 110px rgba(2, 5, 3, 0.62);
}

.action-dialog::backdrop {
  background: rgba(5, 8, 6, 0.72);
  backdrop-filter: blur(7px);
}

.action-dialog[open] {
  animation: dialog-enter 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.action-dialog form {
  position: relative;
  padding: 28px;
}

.action-dialog h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.035em;
}

.action-dialog p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.action-dialog p strong {
  color: var(--text);
}

.dialog-close {
  position: absolute;
  top: 17px;
  right: 17px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  cursor: pointer;
  color: var(--text-faint);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
}

.dialog-close:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

.dialog-close svg {
  width: 17px;
  height: 17px;
}

.dialog-actions {
  display: flex;
  margin-top: 24px;
  justify-content: flex-end;
  gap: 9px;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: 1.4fr repeat(2, 1fr);
  }

  .metric:nth-child(4),
  .metric:nth-child(5),
  .metric:nth-child(6) {
    border-top: 1px solid var(--line);
  }

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

  .events-list {
    max-height: 380px;
  }
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-context {
    min-height: auto;
    padding: 28px 24px 36px;
  }

  .login-copy {
    padding: 88px 0 54px;
  }

  .login-copy h1 {
    max-width: 15ch;
    font-size: clamp(38px, 10vw, 62px);
  }

  .login-panel {
    min-height: auto;
    padding: 52px 24px 28px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .login-panel__status {
    margin-bottom: 54px;
    align-self: flex-start;
  }

  .login-form {
    margin: 0 auto 70px;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 12;
    display: grid;
    width: 100%;
    height: auto;
    padding: 12px 18px;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar .brand-copy,
  .sidebar-footer .node-state {
    display: none;
  }

  .side-nav {
    display: flex;
    margin: 0;
    justify-content: center;
    gap: 3px;
  }

  .side-nav__item {
    min-height: 38px;
    padding: 0 10px;
  }

  .side-nav__item span {
    display: none;
  }

  .sidebar-footer {
    margin: 0;
  }

  .icon-text-button {
    width: 38px;
    padding: 0;
  }

  .icon-text-button span {
    display: none;
  }

  .workspace {
    padding: 0 18px 44px;
  }

  .topbar {
    top: 63px;
    min-height: 88px;
  }

  .section-anchor {
    scroll-margin-top: 166px;
  }

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

  .metric:first-child {
    grid-column: 1 / -1;
  }

  .metric:nth-child(2) {
    padding-left: 0;
    border-left: 0;
  }

  .metric:nth-child(4) {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 640px) {
  .signal-strip {
    grid-template-columns: 1fr;
  }

  .signal-strip > div {
    display: flex;
    padding: 13px 0;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--line);
  }

  .signal-strip > div + div {
    padding-left: 0;
    border-left: 0;
  }

  .signal-strip p {
    margin: 0;
  }

  .sidebar {
    padding-right: 12px;
    padding-left: 12px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .topbar {
    align-items: flex-start;
    padding: 18px 0;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .live-pill {
    display: none;
  }

  .secondary-button span {
    display: none;
  }

  .secondary-button {
    width: 40px;
    padding: 0;
  }

  .overview-section {
    padding-top: 22px;
  }

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

  .metric,
  .metric:first-child,
  .metric:nth-child(2),
  .metric:nth-child(4) {
    min-height: 116px;
    padding: 19px 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .metric:first-child {
    border-top: 0;
  }

  .overview-layout {
    margin-top: 22px;
  }

  .panel {
    border-radius: 16px;
  }

  .panel-header,
  .panel-header--profiles {
    padding: 18px;
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-tools {
    width: 100%;
  }

  .compact-search,
  .compact-search--wide {
    width: 100%;
    flex: 1;
  }

  .panel-tools select {
    width: auto;
    flex: 1 1 126px;
  }

  .profiles-panel {
    margin-top: 14px;
  }

  .logout-issue {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .logout-resolve-button {
    justify-self: start;
  }

  .table-footer {
    align-items: flex-start;
    padding: 13px 16px;
    flex-direction: column;
    gap: 4px;
  }

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

@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;
  }
}
