:root {
  --bg: #111018;
  --bg-deep: #16131f;
  --panel: #1b1825;
  --panel-strong: #201c2c;
  --panel-soft: rgba(27, 24, 37, 0.82);
  --panel-muted: rgba(17, 16, 24, 0.5);
  --border: rgba(160, 130, 210, 0.22);
  --border-bright: rgba(168, 137, 232, 0.56);
  --divider: rgba(182, 175, 194, 0.1);
  --text: #e7e4ec;
  --muted: #b6afc2;
  --link: #a889e8;
  --link-hover: #c3acef;
  --accent-purple: #9b7bd8;
  --accent-purple-hover: #a889e8;
  --accent-heading: #d8cdf0;
  --success: #6fd6a3;
  --success-text: #c8f1dc;
  --danger: #e38da2;
  --danger-text: #f1cbd4;
  --shadow: rgba(7, 6, 12, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(155, 123, 216, 0.14), transparent 34rem),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-deep) 58%, #100e15 100%);
  color: var(--text);
  font-family: Arial, sans-serif;
}

a {
  color: var(--link);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.dashboard {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 30px 0;
}

.dashboard__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(155, 123, 216, 0.14), rgba(127, 101, 176, 0.06)),
    var(--panel);
  box-shadow: 0 18px 48px var(--shadow);
}

.dashboard__header h1 {
  margin: 0 0 7px;
  font-size: 29px;
  line-height: 1.15;
}

.dashboard__header p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(111, 214, 163, 0.32);
  border-radius: 8px;
  background: rgba(76, 146, 116, 0.12);
  color: var(--success-text);
  box-shadow: none;
  white-space: nowrap;
}

.status__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(111, 214, 163, 0.36);
}

.header-meta {
  display: grid;
  gap: 8px;
  min-width: 300px;
  max-width: 420px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-muted);
}

.header-meta__status {
  width: 100%;
}

.dashboard__header > .status {
  flex-shrink: 0;
}

.header-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
  flex-shrink: 0;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 13px;
}

.user-chip span {
  overflow-wrap: anywhere;
}

.user-chip a {
  white-space: nowrap;
}

.header-meta__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.header-meta__row strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  text-align: right;
  overflow-wrap: anywhere;
}

.health {
  margin: 20px 0;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.health h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.health__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.overview,
.modules-section {
  margin: 20px 0;
}

.overview__header {
  margin-bottom: 14px;
}

.overview__header h2 {
  margin: 0 0 7px;
  font-size: 21px;
}

.overview__header p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

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

.overview-card {
  min-height: 0;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(150deg, rgba(155, 123, 216, 0.08), rgba(26, 28, 40, 0.16)),
    var(--panel);
  box-shadow: 0 12px 28px var(--shadow);
}

.overview-card h3 {
  margin: 0 0 8px;
  color: var(--accent-heading);
  font-size: 18px;
}

.overview-card__note {
  margin: -1px 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.overview-card dl {
  display: grid;
  gap: 3px;
  margin: 0;
}

.overview-card dl div,
.endpoint-list li {
  display: grid;
  grid-template-columns: minmax(160px, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--divider);
}

.overview-card--environment dl div {
  grid-template-columns: minmax(190px, 1fr) auto;
}

.overview-card--endpoints .endpoint-list li {
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1.3fr);
  align-items: start;
}

.overview-card--environment,
.overview-card--endpoints {
  font-size: 13px;
}

.overview-card--environment h3,
.overview-card--endpoints h3 {
  font-size: 16px;
}

.overview-card--environment .overview-card__note {
  font-size: 12px;
}

.overview-card--environment dl,
.overview-card--endpoints .endpoint-list {
  gap: 2px;
}

.overview-card--environment dl div,
.overview-card--endpoints .endpoint-list li {
  padding: 6px 0;
}

.overview-card--environment .badge {
  min-height: 22px;
  min-width: 96px;
  padding: 2px 8px;
  font-size: 12px;
}

.overview-card dl div:first-child,
.endpoint-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.overview-card dt {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.overview-card dd {
  margin: 0;
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
  justify-self: end;
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  min-width: 104px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(168, 137, 232, 0.26);
  background: rgba(168, 137, 232, 0.1);
  color: #e4ddf4;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.badge--configured,
.badge--local {
  border-color: rgba(111, 214, 163, 0.32);
  background: rgba(76, 146, 116, 0.12);
  color: var(--success-text);
}

.badge--default {
  border-color: rgba(137, 166, 218, 0.3);
  background: rgba(86, 110, 154, 0.12);
  color: #d9e1f0;
}

.badge--missing {
  border-color: rgba(227, 141, 162, 0.34);
  background: rgba(148, 77, 95, 0.12);
  color: var(--danger-text);
}

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

.endpoint-list span {
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

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

.module {
  min-height: 109px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(91, 112, 159, 0.08), rgba(155, 123, 216, 0.06)),
    var(--panel);
  box-shadow: 0 12px 28px var(--shadow);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.module--link {
  display: block;
  color: var(--text);
}

.module--link:hover {
  color: var(--text);
  text-decoration: none;
}

.module:hover {
  border-color: var(--border-bright);
  box-shadow: 0 16px 34px rgba(7, 6, 12, 0.38);
  transform: translateY(-2px);
}

.module h2 {
  margin: 0 0 10px;
  color: var(--accent-heading);
  font-size: 18px;
}

.module p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.login-panel {
  width: min(440px, 100%);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(155, 123, 216, 0.14), rgba(127, 101, 176, 0.06)),
    var(--panel);
  box-shadow: 0 18px 48px var(--shadow);
}

.login-panel h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.login-panel p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.login-error {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(227, 141, 162, 0.34);
  border-radius: 8px;
  background: rgba(148, 77, 95, 0.12);
  color: var(--danger-text);
}

.login-error span {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.login-error p {
  margin: 0;
}

.login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #d8cdf0;
  color: #201c2c;
  text-align: center;
}

.login-button:hover {
  color: #201c2c;
}

.login-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  font-size: 14px;
}

.otp-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.otp-form label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.otp-form input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(168, 137, 232, 0.32);
  border-radius: 8px;
  background: rgba(17, 16, 24, 0.68);
  color: var(--text);
  font-size: 18px;
  letter-spacing: 0;
}

.otp-form input:focus {
  outline: 2px solid rgba(168, 137, 232, 0.36);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .dashboard {
    width: min(100% - 24px, 1120px);
    padding: 20px 0;
  }

  .dashboard__header {
    display: block;
    padding: 17px;
  }

  .dashboard__header h1 {
    font-size: 24px;
  }

  .status {
    margin-top: 14px;
    white-space: normal;
  }

  .header-actions {
    justify-items: start;
    margin-top: 14px;
  }

  .header-actions .status {
    margin-top: 0;
  }

  .user-chip {
    align-items: flex-start;
    flex-direction: column;
    max-width: 100%;
  }

  .header-meta {
    margin-top: 16px;
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .header-meta__status {
    margin-top: 0;
  }

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

  .header-meta__row strong {
    text-align: left;
  }

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

  .overview-card dl div,
  .endpoint-list li,
  .overview-card--environment dl div,
  .overview-card--endpoints .endpoint-list li {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .overview-card dd {
    justify-self: start;
    text-align: left;
  }
}
