:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111416;
  color: #f7f9fa;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #111416;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 420px);
  border: 1px solid #30363b;
  border-top: 3px solid #2dd4bf;
  border-radius: 6px;
  background: #181c1f;
  padding: 34px;
  box-shadow: 0 24px 70px rgb(0 0 0 / 28%);
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 6px;
  background: #2dd4bf;
}

.brand-mark img {
  width: 29px;
  height: 29px;
  filter: brightness(0) saturate(100%);
}

.brand-mark.compact {
  width: 42px;
  height: 42px;
  margin: 0;
}

.brand-mark.compact img {
  width: 23px;
  height: 23px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #6fe7d6;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.3;
}

.subtle {
  margin-bottom: 28px;
  color: #a4adb4;
  line-height: 1.55;
}

.login-panel > label:not(.drop-zone) {
  display: block;
  margin: 16px 0 7px;
  color: #d7dde1;
  font-size: 13px;
  font-weight: 650;
}

input[type="text"],
input[type="password"],
.login-panel input:not([type]) {
  width: 100%;
  min-height: 44px;
  border: 1px solid #3b4349;
  border-radius: 5px;
  outline: none;
  background: #111416;
  color: #f7f9fa;
  padding: 0 12px;
}

input:focus-visible,
button:focus-visible,
.drop-zone:focus-within {
  outline: 2px solid #2dd4bf;
  outline-offset: 2px;
}

.form-error {
  min-height: 20px;
  margin: 12px 0;
  color: #fb7185;
  font-size: 13px;
}

.text-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #9ba5ab;
  padding: 16px 8px 0;
  font-size: 13px;
}

.text-button:hover {
  color: #f7f9fa;
}

.primary-button,
.secondary-button,
.icon-button {
  min-height: 40px;
  border-radius: 5px;
  font-weight: 700;
}

.primary-button {
  width: 100%;
  border: 1px solid #2dd4bf;
  background: #2dd4bf;
  color: #091311;
  padding: 0 16px;
}

.primary-button:hover:not(:disabled) {
  background: #5eead4;
}

.secondary-button,
.icon-button {
  border: 1px solid #3b4349;
  background: #1b2023;
  color: #e9edf0;
}

.secondary-button {
  padding: 0 14px;
}

.icon-button {
  width: 40px;
  display: grid;
  place-items: center;
  padding: 0;
}

.icon-button img,
.deploy-button img {
  width: 18px;
  height: 18px;
  filter: invert(1);
}

.dashboard {
  min-height: 100vh;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #2a3035;
  padding: 14px clamp(18px, 4vw, 52px);
  background: #161a1d;
}

.brand,
.topbar-actions,
.deployment-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 13px;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
}

.topbar-actions {
  gap: 10px;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  border: 1px solid #30373c;
  border-radius: 5px;
  background: #111416;
  padding: 3px;
}

.view-tab {
  min-height: 32px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #9ca6ac;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 700;
}

.view-tab.active {
  background: #293035;
  color: #f7f9fa;
}

.current-user {
  max-width: 150px;
  overflow: hidden;
  color: #c7ced2;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: #b4bdc3;
  font-size: 13px;
  font-weight: 650;
  padding: 0 10px;
}

.connection-state span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}

.connection-state.online span {
  background: #22c55e;
}

.connection-state.offline span {
  background: #f43f5e;
}

.content {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 44px 0 70px;
}

.status-section,
.deployment-section {
  border-top: 1px solid #384047;
  padding: 28px 0 40px;
}

.deployment-section {
  margin-top: 18px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 24px;
}

.last-checked,
.max-size {
  margin: 0;
  color: #89939a;
  font-size: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #30373c;
  border-radius: 6px;
  overflow: hidden;
}

.metric {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  background: #181c1f;
}

.metric + .metric {
  border-left: 1px solid #30373c;
}

.metric span,
.server-detail span {
  color: #8e989f;
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

.metric strong {
  overflow-wrap: anywhere;
  font-size: 25px;
}

.server-detail {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  padding: 24px 2px 0;
}

.server-detail > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #dce2e5;
}

.player-name {
  border: 1px solid #3b444a;
  border-radius: 4px;
  background: #1b2023;
  padding: 4px 7px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.drop-zone {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed #4a555c;
  border-radius: 6px;
  background: #171b1e;
  color: #e7ebed;
  padding: 28px;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragging,
.drop-zone.has-file {
  border-color: #2dd4bf;
  background: #192321;
}

.drop-zone img {
  width: 40px;
  height: 40px;
  margin-bottom: 7px;
  filter: invert(79%) sepia(29%) saturate(1104%) hue-rotate(119deg) brightness(93%);
}

.drop-zone span {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #98a2a9;
  font-size: 13px;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.deployment-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0;
  color: #c7ced2;
  font-size: 13px;
}

.deployment-check input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: #2dd4bf;
}

.deployment-actions {
  min-height: 44px;
  gap: 14px;
}

.deploy-button {
  width: auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.deploy-button img {
  filter: brightness(0) saturate(100%);
}

.deployment-state {
  color: #a5afb5;
  font-size: 13px;
}

.result-panel {
  display: flex;
  gap: 14px;
  margin-top: 22px;
  border-left: 3px solid #22c55e;
  background: #17211b;
  padding: 17px 18px;
}

.result-panel.error {
  border-left-color: #f43f5e;
  background: #24191d;
}

.result-icon img {
  width: 22px;
  height: 22px;
  filter: invert(61%) sepia(67%) saturate(527%) hue-rotate(83deg);
}

.result-panel.error .result-icon img {
  content: url("/icons/circle-x.svg");
  filter: invert(55%) sepia(84%) saturate(1519%) hue-rotate(313deg);
}

.result-panel p {
  margin: 5px 0 8px;
  color: #b3bdc3;
  font-size: 13px;
}

.result-panel code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #7dd3fc;
  font-size: 11px;
}

.accounts-section {
  border-top: 1px solid #384047;
  padding: 28px 0 40px;
}

.account-form {
  border: 1px solid #30373c;
  border-radius: 6px;
  background: #181c1f;
  padding: 24px;
}

.account-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr);
  gap: 18px;
}

.field-group {
  min-width: 0;
}

.field-group label,
.password-choice legend {
  display: block;
  margin-bottom: 7px;
  color: #cbd2d6;
  font-size: 12px;
  font-weight: 700;
}

.field-group input,
.field-group select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #3b4349;
  border-radius: 5px;
  outline: none;
  background: #111416;
  color: #f7f9fa;
  padding: 0 12px;
}

.password-choice {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 20px 0;
  border: 0;
  padding: 0;
}

.password-choice legend {
  margin-bottom: 8px;
}

.password-choice label {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #3b4349;
  background: #15191c;
  color: #cbd2d6;
  padding: 0 11px;
  font-size: 13px;
  cursor: pointer;
}

.password-choice label:first-of-type {
  border-radius: 5px 0 0 5px;
}

.password-choice label:last-of-type {
  border-radius: 0 5px 5px 0;
}

.password-choice input,
.account-reset-check input {
  accent-color: #2dd4bf;
}

.account-reset-check {
  margin-bottom: 18px;
}

.account-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.create-account-button {
  width: auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.create-account-button img {
  width: 18px;
  height: 18px;
  filter: brightness(0) saturate(100%);
}

.credential-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  border-left: 3px solid #2dd4bf;
  background: #172220;
  padding: 16px 18px;
}

.credential-panel > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #aeb8bd;
  font-size: 13px;
}

.credential-panel code {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 750;
}

.account-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 34px 0 12px;
}

.account-list-heading h3 {
  margin: 0;
  font-size: 15px;
}

.account-list-heading span {
  color: #8f999f;
  font-size: 12px;
}

.account-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #30373c;
  border-radius: 6px;
}

.account-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #181c1f;
}

.account-table th,
.account-table td {
  border-bottom: 1px solid #30373c;
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

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

.account-table th {
  color: #89939a;
  font-size: 11px;
  text-transform: uppercase;
}

.account-table td {
  color: #e2e7e9;
  font-size: 13px;
}

.account-table td > span,
.account-table td > small {
  display: block;
}

.account-table td > small {
  margin-top: 4px;
  color: #7f8a91;
  font-size: 11px;
}

.role-badge,
.reset-required {
  width: fit-content;
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 750;
}

.role-badge.admin {
  background: #243a36;
  color: #6ee7d5;
}

.role-badge.user {
  background: #2b3136;
  color: #c8d0d5;
}

.reset-required {
  background: #3b2c17;
  color: #fbbf24;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.account-actions .icon-button {
  width: 34px;
  min-height: 34px;
}

.danger-button {
  border-color: #57313a;
  color: #fb7185;
}

.danger-button img {
  filter: invert(55%) sepia(73%) saturate(1767%) hue-rotate(310deg);
}

.sr-only {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .view-tabs {
    width: 100%;
    order: 3;
  }

  .view-tab {
    flex: 1;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .connection-state {
    width: 100%;
    justify-content: flex-end;
    order: 3;
  }

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

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

  .metric:nth-child(n + 3) {
    border-top: 1px solid #30373c;
  }

  .server-detail {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .account-form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .login-panel {
    padding: 26px 22px;
  }

  .topbar {
    padding: 13px 16px;
  }

  .brand .eyebrow,
  .connection-state,
  .current-user {
    display: none;
  }

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

  .secondary-button::after {
    content: "×";
    font-size: 23px;
  }

  .content {
    width: min(100% - 28px, 1180px);
    padding-top: 28px;
  }

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

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

  .metric + .metric {
    border-left: 0;
    border-top: 1px solid #30373c;
  }

  .drop-zone {
    min-height: 190px;
  }

  .deployment-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .deploy-button {
    width: 100%;
    justify-content: center;
  }

  .password-choice,
  .account-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .password-choice label,
  .password-choice label:first-of-type,
  .password-choice label:last-of-type {
    border-radius: 5px;
  }

  .create-account-button {
    width: 100%;
    justify-content: center;
  }
}
