:root {
  color-scheme: dark;
  --ink: #f1eee6;
  --muted: #b0aa9a;
  --line: #3b3b32;
  --paper: #171914;
  --paper-strong: #202219;
  --soft: #0d0f0c;
  --accent: #9b7a35;
  --accent-strong: #c59a3b;
  --danger: #e06b55;
  --warning: #d9a441;
  --success: #88a85d;
  --shadow: 0 18px 70px rgba(0, 0, 0, 0.38);
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #171914;
  --muted: #55594f;
  --line: #d5d1bf;
  --paper: #f5f2e8;
  --paper-strong: #ffffff;
  --soft: #e9e5d8;
  --accent: #8d6d26;
  --accent-strong: #b1842c;
  --danger: #b94936;
  --warning: #9b6f16;
  --success: #547531;
  --shadow: 0 16px 44px rgba(51, 44, 25, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(13, 15, 12, 0.9), rgba(13, 15, 12, 0.96)),
    repeating-linear-gradient(135deg, rgba(112, 120, 85, 0.14) 0 2px, transparent 2px 14px),
    radial-gradient(circle at 20% 0%, rgba(128, 103, 43, 0.18), transparent 38%),
    var(--soft);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.55;
}

:root[data-theme="light"] body {
  background:
    linear-gradient(rgba(245, 242, 232, 0.9), rgba(233, 229, 216, 0.96)),
    repeating-linear-gradient(135deg, rgba(128, 103, 43, 0.12) 0 2px, transparent 2px 14px),
    var(--soft);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  min-height: 116px;
  padding: 10px 18px;
  background: #1f2329;
  border-bottom: 1px solid #323741;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] .app-header {
  background: #f7f5ee;
  border-bottom-color: #d6d0bd;
  box-shadow: 0 8px 24px rgba(51, 44, 25, 0.14);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: clamp(280px, 30vw, 520px);
  height: auto;
}

.nav {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  color: #ffe45a;
  font-weight: 800;
}

.nav a {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border: 1px solid #48515d;
  border-radius: 7px;
  background: #343c44;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="light"] .nav a {
  border-color: #cabf9f;
  background: #ece7d8;
  color: #4a3711;
}

:root[data-theme="light"] .nav a:hover,
:root[data-theme="light"] .nav a:focus-visible {
  border-color: #a77d26;
  background: #fff4c4;
  color: #14120c;
}

.nav a:hover,
.nav a:focus-visible {
  border-color: #ffe45a;
  background: #404954;
  color: #ffe45a;
}

.nav a.active {
  border-color: #ffe45a;
  background: #20252c;
  color: #ffe45a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(255, 228, 90, 0.12);
}

.header-tools {
  display: grid;
  width: 60px;
  justify-items: center;
  gap: 10px;
  margin-left: auto;
}

.theme-button,
.header-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #404956;
  border-radius: 999px;
  background: #303842;
  color: #ffe45a;
  font-weight: 900;
  cursor: pointer;
}

:root[data-theme="light"] .theme-button,
:root[data-theme="light"] .header-avatar {
  border-color: #c5b98f;
  background: #fff7d8;
  color: #5c4212;
}

.header-avatar {
  border-color: #d5b84d;
  background:
    radial-gradient(circle, rgba(255, 228, 90, 0.18), transparent 52%),
    #15171a;
  font-size: 0.8rem;
}

.header-avatar.has-avatar {
  color: transparent;
  background:
    var(--customer-avatar, none) center / cover no-repeat,
    #15171a;
}

.header-avatar:hover,
.header-avatar:focus-visible {
  border-color: #ffe45a;
  box-shadow: 0 0 0 3px rgba(255, 228, 90, 0.18);
}

.top-spacer {
  height: 52px;
  background: linear-gradient(180deg, #111313, #151819);
  border-bottom: 1px solid #242a2f;
}

:root[data-theme="light"] .top-spacer {
  background: linear-gradient(180deg, #eee9dc, #e4dece);
  border-bottom-color: #d6d0bd;
}

.app-shell {
  width: min(100%, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(34px, 5vw, 72px) 0;
}

.view-hidden {
  display: none !important;
}

.shop-home {
  display: grid;
  gap: 28px;
}

.shop-question {
  display: grid;
  min-height: 144px;
  place-items: center;
  border: 1px solid #333944;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    #1f2329;
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .shop-question,
:root[data-theme="light"] .product-card,
:root[data-theme="light"] .license-card {
  border-color: #d4c9aa;
  background: #ffffff;
  color: #171914;
}

.shop-question h1 {
  max-width: none;
  margin: 0;
  color: #f5f5f1;
  font-size: clamp(2rem, 3vw, 2.4rem);
  text-align: center;
}

:root[data-theme="light"] .shop-question h1,
:root[data-theme="light"] .product-heading h2,
:root[data-theme="light"] h1,
:root[data-theme="light"] h2 {
  color: #171914;
}

.product-heading h2 {
  margin: 10px 0 -4px;
  color: #f5f5f1;
  font-size: clamp(1.8rem, 3vw, 2.25rem);
}

.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
}

.server-list-panel {
  margin-top: 0;
}

.product-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  border: 1px solid #2c3440;
  border-radius: 8px;
  padding: 54px 18px 18px;
  background:
    linear-gradient(135deg, rgba(197, 154, 59, 0.12), transparent 34%),
    #1d2227;
  box-shadow: 0 15px 42px rgba(0, 0, 0, 0.42);
}

.product-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #ffe45a, #8b6b26);
}

.product-strip {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #303945;
  padding: 8px 18px 8px 24px;
  background: rgba(10, 12, 14, 0.5);
  color: #ffe45a;
  font-weight: 900;
}

.product-strip span {
  color: #b8c0c8;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.product-media {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
}

.product-media img,
.product-logo {
  width: 88px;
  height: 88px;
  border: 1px solid #4c5664;
  border-radius: 8px;
  background:
    radial-gradient(circle, rgba(255, 217, 74, 0.16), transparent 48%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent),
    #090b0e;
  object-fit: cover;
}

.product-logo {
  display: grid;
  place-items: center;
  color: #d5c26a;
  font-size: 2rem;
  font-weight: 900;
}

.product-prices {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.product-price,
.product-popular {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid #6d5b2d;
  border-radius: 6px;
  padding: 5px 9px;
  background: rgba(197, 154, 59, 0.14);
  color: #f1d36c;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.product-popular {
  min-height: 28px;
  background: #232b30;
  color: #ffe45a;
}

.product-body h3 {
  margin: 0 0 10px;
  color: #ffe45a;
  font-size: 1.55rem;
}

:root[data-theme="light"] .product-body h3,
:root[data-theme="light"] .license-card h3,
:root[data-theme="light"] .account-profile h2 {
  color: #8d6d26;
}

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.product-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid #46515d;
  border-radius: 6px;
  padding: 5px 10px;
  background: #29313a;
  color: #e7eced;
  font-size: 0.82rem;
  font-weight: 800;
}

.product-badge.gold {
  border-color: #78622c;
  background: rgba(197, 154, 59, 0.18);
  color: #ffe45a;
}

.product-body ul {
  margin: 0 0 18px;
  padding-left: 18px;
  color: #f1f1ed;
  font-weight: 650;
}

:root[data-theme="light"] .product-body ul,
:root[data-theme="light"] .account-profile p,
:root[data-theme="light"] .rich-text,
:root[data-theme="light"] .side-panel p {
  color: #303329;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.admin-layout {
  grid-template-columns: 360px minmax(0, 1fr);
}

.account-layout {
  margin-top: 48px;
  grid-template-columns: minmax(0, 1fr);
}

.account-summary {
  width: 100%;
}

.account-profile {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.account-avatar {
  display: grid;
  width: 110px;
  height: 110px;
  place-items: center;
  border-radius: 12px;
  background:
    var(--customer-avatar, none) center / cover no-repeat,
    radial-gradient(circle, rgba(255, 217, 74, 0.18), transparent 50%),
    #101318;
  color: #ffd94a;
  font-weight: 900;
}

.account-profile h2 {
  margin-bottom: 8px;
  color: #ffd94a;
  font-size: 1.6rem;
}

.account-profile p {
  color: #f1f1ed;
  font-size: 1.05rem;
  font-weight: 800;
}

.account-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.account-buttons .button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 120px),
    var(--paper);
  box-shadow: var(--shadow);
}

:root[data-theme="light"] .panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), transparent 120px),
    var(--paper);
}

.main-panel,
.side-panel,
.table-panel {
  padding: clamp(20px, 3vw, 30px);
}

.panel-heading {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 720px;
  margin-bottom: 0;
  color: #fff8df;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  color: #fff8df;
  font-size: 1.25rem;
  line-height: 1.2;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 14px;
  align-items: end;
}

.form-grid.compact {
  grid-template-columns: minmax(0, 1fr) 140px;
}

.full {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.checkbox-label {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
}

.checkbox-label input {
  width: 18px;
  min-height: 18px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #4a4b3e;
  border-radius: 5px;
  padding: 10px 12px;
  background: #0f110d;
  color: var(--ink);
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  border-color: #c8bea1;
  background: #fffdf7;
  color: #171914;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent-strong);
  outline: 3px solid rgba(197, 154, 59, 0.18);
}

input,
select {
  min-height: 46px;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.button,
.table-actions button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 900;
  text-transform: uppercase;
}

.button.primary {
  border-color: #d3aa4b;
  background: linear-gradient(180deg, #b28a39, #745719);
  color: #14120c;
}

.button.primary:hover,
.button.primary:focus-visible {
  background: linear-gradient(180deg, #d0a64a, #8a681f);
}

.button.secondary,
.table-actions button {
  border-color: #4f503f;
  background: #11130e;
  color: var(--ink);
}

:root[data-theme="light"] .button.secondary,
:root[data-theme="light"] .table-actions button {
  border-color: #bcb08e;
  background: #fffaf0;
  color: #171914;
}

.button.discord {
  border-color: #5865f2;
  background: #5865f2;
  color: #fff;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.notice {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 12px 14px;
  background: #11130e;
  font-weight: 800;
}

:root[data-theme="light"] .notice,
:root[data-theme="light"] pre,
:root[data-theme="light"] .status {
  background: #fffdf7;
  color: #171914;
}

.notice.success {
  border-color: rgba(136, 168, 93, 0.45);
  color: var(--success);
}

.notice.error {
  border-color: rgba(224, 107, 85, 0.45);
  color: var(--danger);
}

.notice.pending {
  border-color: rgba(217, 164, 65, 0.45);
  color: var(--warning);
}

.json-card {
  margin-top: 24px;
}

.json-card-header,
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

pre {
  overflow: auto;
  max-width: 100%;
  margin: 0;
  border: 1px solid #474a39;
  border-radius: 5px;
  padding: 16px;
  background: #090b09;
  color: #f0e9ce;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.steps {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.steps li + li {
  margin-top: 10px;
}

.divider {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}

.side-panel p {
  color: var(--muted);
}

.table-panel,
.info-panel {
  margin-top: 18px;
}

.info-panel {
  padding: clamp(20px, 3vw, 30px);
}

.rich-text {
  max-width: 820px;
  color: var(--muted);
  white-space: pre-wrap;
}

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

.image-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid #4a4b3e;
  border-radius: 5px;
  object-fit: cover;
  background: var(--soft);
  filter: saturate(0.85) contrast(1.08);
}

.content-form {
  display: grid;
  gap: 14px;
}

.mono-input {
  font-family:
    "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #d4c89f;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  border-radius: 4px;
  padding: 4px 8px;
  background: #10120e;
  font-weight: 900;
}

.status.active {
  color: var(--success);
}

.status.revoked {
  color: var(--danger);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.license-list {
  display: grid;
  gap: 18px;
}

.license-card {
  max-width: 560px;
  border: 1px solid #333844;
  border-radius: 3px;
  padding: 24px;
  background: #2c313b;
  color: #f1f1ed;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.license-card-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 12px;
}

.license-card h3 {
  margin: 0;
  color: #ffd94a;
  font-size: 1.45rem;
}

.license-card p {
  margin-bottom: 5px;
}

.mod-icon {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border: 1px solid #0b0d10;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 217, 74, 0.18), transparent 45%),
    #08090b;
  color: #ffd94a;
  font-weight: 900;
}

.license-meta strong {
  color: #fff;
}

.license-meta span {
  color: #83aefc;
  font-weight: 900;
}

.ip-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.ip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
}

.ip-row input {
  min-height: 34px;
  border-color: #4a5363;
  background: #20252c;
  color: #fff;
}

:root[data-theme="light"] .ip-row input {
  border-color: #c3b899;
  background: #fffdf7;
  color: #171914;
}

.square-button {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid #252a32;
  border-radius: 4px;
  background: #282d36;
  color: #ffd94a;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 900;
}

.license-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.muted-note {
  color: var(--muted);
  font-weight: 800;
}

.customer-license-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.account-json {
  margin-top: 10px;
}

@media (max-width: 900px) {
  .workspace,
  .admin-layout,
  .product-card,
  .form-grid,
  .form-grid.compact,
  .customer-license-form,
  .image-grid {
    grid-template-columns: 1fr;
  }

  .app-header,
  .json-card-header,
  .table-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-tools {
    display: flex;
    width: auto;
    margin-left: 0;
  }

  .brand-logo {
    width: min(100%, 360px);
  }

  .product-media {
    justify-items: start;
  }
}

@media (max-width: 520px) {
  .nav {
    grid-template-columns: 1fr;
  }

  .nav a {
    min-height: 44px;
  }

  .app-shell {
    width: min(100%, calc(100% - 28px));
  }
}
