:root {
  color-scheme: dark;
  --bg: #090d11;
  --panel: #101820;
  --panel-soft: #16232b;
  --line: #2b3a44;
  --text: #f3f7f8;
  --muted: #a7b6be;
  --accent: #40d6ff;
  --accent-strong: #f4c542;
  --accent-green: #51dc8f;
  --danger: #ff6677;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(64, 214, 255, 0.14), transparent 34rem),
    linear-gradient(315deg, rgba(244, 197, 66, 0.12), transparent 30rem),
    var(--bg);
  color: var(--text);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

a {
  color: inherit;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

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

.brand-logo {
  width: 44px;
  max-width: 44px;
  height: 44px;
  max-height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.32));
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.button.primary {
  border-color: rgba(244, 197, 66, 0.68);
  background: linear-gradient(135deg, var(--accent-strong), #ffda6b);
  color: #130e04;
}

.login-layout {
  display: grid;
  width: 100%;
  min-height: auto;
  align-items: center;
  justify-items: center;
}

.dashboard-panel,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 26, 34, 0.86);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.26);
}

.login-panel {
  position: relative;
  width: min(460px, 100%);
  overflow: hidden;
  padding: 34px 34px 32px;
  border: 1px solid rgba(64, 214, 255, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(20, 35, 45, 0.96), rgba(11, 16, 21, 0.96)),
    var(--panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.login-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border-top: 1px solid rgba(244, 197, 66, 0.46);
  background: linear-gradient(90deg, transparent, rgba(64, 214, 255, 0.16), transparent);
}

.login-logo-frame {
  display: grid;
  width: min(176px, 50vw);
  max-width: 176px;
  height: min(176px, 50vw);
  max-height: 176px;
  place-items: center;
  margin: 0 auto 18px;
  overflow: hidden;
}

.login-logo {
  display: block;
  width: 176px;
  max-width: 100%;
  height: 176px;
  max-height: 100%;
  object-fit: contain;
  filter: none;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.35rem, 8vw, 4.25rem);
  line-height: 0.96;
}

h2 {
  margin-bottom: 16px;
  font-size: 1.1rem;
}

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

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-title {
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 1.48rem;
  font-weight: 900;
  line-height: 1.1;
}

.login-button {
  width: min(320px, 100%);
  min-height: 46px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}

.dashboard-panel {
  padding: 22px;
  min-width: 0;
}

.profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border: 2px solid rgba(70, 212, 140, 0.44);
  border-radius: 8px;
  background: var(--panel-soft);
  object-fit: cover;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
}

.tag.good {
  border-color: rgba(70, 212, 140, 0.42);
  color: var(--accent);
}

.tag.warning {
  border-color: rgba(244, 197, 66, 0.52);
  color: #ffdd72;
}

.tag.bad {
  border-color: rgba(255, 102, 119, 0.45);
  color: #ffd4da;
}

.permissions {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.permissions li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(22, 33, 43, 0.72);
  color: var(--muted);
}

.cloud-overview,
.nodes-panel {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin-bottom: 0;
}

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

.metric {
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(22, 33, 43, 0.66);
}

.metric span {
  display: block;
  color: var(--accent);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.node-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 18, 24, 0.72);
}

.node-card {
  padding: 18px;
}

.node-card.shared {
  border-color: rgba(244, 197, 66, 0.42);
}

.node-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.node-title h3 {
  margin: 0 0 4px;
  font-size: 1.24rem;
}

.node-title p {
  margin-bottom: 0;
}

.node-tags,
.safety-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.node-details {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.node-details div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.node-details dt {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.node-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.safety-chip {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 800;
}

.safety-chip.locked {
  border-color: rgba(255, 102, 119, 0.38);
  color: #ffd4da;
}

.safety-chip.open {
  border-color: rgba(70, 212, 140, 0.42);
  color: var(--accent-green);
}

.node-note {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
}

.notice {
  margin-top: 20px;
  padding: 16px;
  text-align: left;
}

.notice.error {
  border-color: rgba(255, 102, 119, 0.45);
  color: #ffd4da;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding: 18px 0;
  }

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

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

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

  h1 {
    font-size: 2.45rem;
  }

  .login-panel {
    padding: 26px 22px;
    width: min(390px, 100%);
  }

  .login-logo-frame {
    width: min(154px, 52vw);
    max-width: 154px;
    height: min(154px, 52vw);
    max-height: 154px;
  }

  .login-logo {
    width: 154px;
    height: 154px;
  }
}
