:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #090d12;
  color: #eef4f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(53, 120, 168, 0.18), transparent 32rem),
    linear-gradient(145deg, #090d12 0%, #101821 55%, #080b0f 100%);
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.card {
  width: min(100%, 520px);
  padding: 34px;
  border: 1px solid #283847;
  border-radius: 14px;
  background: rgba(12, 18, 24, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

.eyebrow {
  margin-bottom: 12px;
  color: #7fb8dc;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1;
}

.lead {
  margin: 0 0 28px;
  color: #aebdca;
  line-height: 1.6;
}

form {
  display: grid;
  gap: 10px;
}

label {
  margin-top: 8px;
  color: #dbe6ee;
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  border: 1px solid #344858;
  border-radius: 9px;
  padding: 13px 14px;
  background: #0a1117;
  color: #f7fbff;
  font: inherit;
  outline: none;
}

input:focus,
select:focus {
  border-color: #6faed6;
  box-shadow: 0 0 0 3px rgba(111, 174, 214, 0.16);
}

.hint,
.small,
footer {
  color: #8495a3;
  font-size: 0.8rem;
  line-height: 1.5;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
  border: 0;
  border-radius: 9px;
  padding: 13px 18px;
  background: #dfeef7;
  color: #071018;
  font: inherit;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.06);
}

.button.secondary {
  background: #17232d;
  color: #dceaf3;
  border: 1px solid #344858;
}

.notice {
  display: grid;
  gap: 6px;
  margin: 0 0 18px;
  border-radius: 9px;
  padding: 14px 16px;
  line-height: 1.45;
}

.notice.error {
  border: 1px solid #6f3535;
  background: #2d1717;
  color: #ffdcdc;
}

.notice.success {
  border: 1px solid #325b4c;
  background: #13271f;
  color: #dcfff1;
}

footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #22313d;
}


textarea {
  width: 100%;
  border: 1px solid #344858;
  border-radius: 9px;
  padding: 13px 14px;
  background: #0a1117;
  color: #f7fbff;
  font: inherit;
  outline: none;
  resize: vertical;
}

textarea:focus {
  border-color: #6faed6;
  box-shadow: 0 0 0 3px rgba(111, 174, 214, 0.16);
}

.card.wide {
  width: min(100%, 900px);
}

.admin-shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.admin-header,
.list-row,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-header {
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-card {
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid #283847;
  border-radius: 14px;
  background: rgba(12, 18, 24, 0.94);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.admin-grid .admin-card {
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #22313d;
  text-align: left;
  vertical-align: top;
}

th {
  color: #9fc0d5;
}

.muted {
  margin-top: 4px;
  color: #8495a3;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.inline-form {
  display: inline;
  margin-left: 5px;
}

.compact-form {
  min-width: 180px;
}

.compact-form .button,
.list-row .button,
.admin-header .button {
  margin-top: 0;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #9fc0d5;
  font: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
}

.button.danger,
.link-button.danger {
  color: #ffdcdc;
}

.button.danger {
  background: #552626;
  border: 1px solid #794040;
}

.stack {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.list-row {
  justify-content: space-between;
  padding: 12px;
  border: 1px solid #22313d;
  border-radius: 9px;
  background: #0a1117;
}

.resource-list {
  display: grid;
  gap: 14px;
}

.resource-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid #283847;
  border-radius: 10px;
  background: #0a1117;
}

.resource-item h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.resource-item p {
  margin: 0;
  color: #9eafbc;
}

.resource-item .button {
  margin-top: 0;
  flex: 0 0 auto;
}

footer a {
  color: #9fc0d5;
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .resource-item,
  .list-row {
    align-items: stretch;
    flex-direction: column;
  }
}


.recovery-codes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.recovery-codes code {
  padding: 9px 10px;
  border: 1px solid #344858;
  border-radius: 7px;
  background: #0a1117;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.separator {
  margin: 28px 0;
  border: 0;
  border-top: 1px solid #22313d;
}


.status-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.status-badge {
  flex: 0 0 auto;
  border: 1px solid #344858;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.status-online {
  border-color: #325b4c;
  background: #13271f;
  color: #dcfff1;
}

.status-degraded {
  border-color: #6d5b2d;
  background: #2b2414;
  color: #fff1bc;
}

.status-offline {
  border-color: #6f3535;
  background: #2d1717;
  color: #ffdcdc;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.metric-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid #283847;
  border-radius: 10px;
  background: #0a1117;
}

.metric-value {
  font-size: 1.7rem;
  font-weight: 900;
}

.metric-label {
  color: #8fa3b2;
  font-size: 0.8rem;
}

.status-grid {
  display: grid;
  gap: 10px;
}

.status-service {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #283847;
  border-radius: 10px;
  background: #0a1117;
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 800;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: currentColor;
}

.is-online {
  color: #8fe0bd;
}

.is-offline {
  color: #ef9b9b;
}

.status-note {
  margin-top: 16px;
}

.status-details {
  margin-bottom: 18px;
}

@media (max-width: 640px) {
  .status-title-row,
  .status-service {
    align-items: stretch;
    flex-direction: column;
  }

  .status-badge {
    align-self: flex-start;
  }
}


.beta-notice {
  border: 1px solid #5a4d2f;
  background: #241f14;
  color: #f7e9b8;
}

.invite-generate-form {
  display: grid;
  grid-template-columns: 140px 180px minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin: 18px 0;
}

.invite-generate-form .button {
  margin-top: 0;
}

.generated-invite-list {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.generated-invite {
  padding: 16px;
  border: 1px solid #283847;
  border-radius: 10px;
  background: #0a1117;
}

.generated-invite code {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: 0.03em;
}

@media (max-width: 900px) {
  .invite-generate-form {
    grid-template-columns: 1fr;
  }
}
