:root {
  color-scheme: dark;
  --bg: #080c12;
  --sidebar: #0b1017;
  --surface: #111924;
  --surface-2: #162130;
  --line: #223044;
  --text: #f5f7fb;
  --muted: #8ea0b8;
  --accent: #a9cff7;
  --accent-strong: #c6e1ff;
  --ink: #07111e;
  font: 16px/1.5 Inter, ui-sans-serif, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 62% -20%, #142338 0, var(--bg) 38%); color: var(--text); }
button, input, select { font: inherit; }
button, a, input, select { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 22px 22px; background: rgba(9, 14, 21, .96); border-right: 1px solid #172231; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 650; letter-spacing: -.025em; }
.brand b { color: var(--muted); font-weight: 550; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: var(--ink); background: var(--accent); border-radius: 11px 5px 11px 5px; font-size: 22px; font-weight: 900; font-style: italic; box-shadow: 0 8px 28px rgba(99, 163, 226, .16); }
.brand-mark.large { width: 52px; height: 52px; margin: 0 auto 24px; border-radius: 15px 7px 15px 7px; font-size: 29px; }
nav { display: grid; gap: 7px; margin-top: 64px; }
.nav-label { padding: 0 12px 8px; color: #53647a; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 10px; text-align: left; font-size: 14px; font-weight: 600; }
.nav:hover { color: var(--text); background: #121b27; }
.nav.active { color: var(--ink); background: var(--accent); }
.nav-icon { display: grid; place-items: center; width: 20px; font-size: 17px; }
.user-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) 26px; align-items: center; gap: 11px; margin-top: auto; padding: 12px; background: #121b27; border: 1px solid var(--line); border-radius: 13px; }
.user-card img, .mini-account img { display: block; object-fit: cover; border-radius: 50%; background: #243247; }
.user-card strong, .user-card span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card strong { font-size: 14px; }
.user-card span { color: var(--muted); font-size: 12px; }
.logout { width: 26px; height: 30px; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font-size: 17px; }
.logout:hover { color: var(--text); background: #202d3e; }

main { min-width: 0; width: min(100%, 1040px); margin: 0 auto; padding: 0 42px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 82px; color: var(--muted); border-bottom: 1px solid #182333; font-size: 14px; }
.mobile-brand { display: none; }
.mini-account { display: flex; align-items: center; gap: 9px; color: #c9d4e2; }
section { padding: 52px 0 20px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow { color: #6f89a7; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 7px 0 0; font-size: clamp(32px, 5vw, 44px); line-height: 1.08; letter-spacing: -.045em; }
.page-heading p { margin: 10px 0 0; color: var(--muted); }
h2 { margin: 0; font-size: 20px; letter-spacing: -.025em; }
h3 { margin: 14px 0 4px; font-size: 15px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: 10px; font-size: 14px; font-weight: 750; }
.primary { color: var(--ink); background: var(--accent); }
.primary:hover { background: var(--accent-strong); }
.secondary { color: #d9e3ef; background: #121b27; border-color: #2b3a4e; }
.secondary:hover { background: #172332; border-color: #41536b; }

.license-card, .quick-start, .panel, .table-wrap, .empty { background: linear-gradient(145deg, rgba(21, 31, 45, .98), rgba(15, 23, 34, .98)); border: 1px solid var(--line); border-radius: 16px; }
.license-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 22px; padding: 28px 30px; }
.license-main { display: flex; align-items: center; gap: 20px; min-width: 0; }
.product-icon { display: grid; place-items: center; flex: 0 0 58px; height: 58px; color: var(--accent); background: #1c2a3d; border: 1px solid #2d4058; border-radius: 14px 7px 14px 7px; font-size: 31px; font-weight: 900; font-style: italic; }
.license-card h2 { margin-bottom: 5px; }
.license-card p { margin: 2px 0; color: var(--muted); font-size: 14px; }
.license-action { display: flex; align-items: center; gap: 14px; }
.badge { padding: 5px 9px; color: #97e1c2; background: #10281f; border: 1px solid #225440; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.badge.off { color: #f2aeae; background: #2b171a; border-color: #633039; }
.quick-start { margin-top: 20px; padding: 28px 30px 30px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.steps article { min-height: 142px; padding: 20px; background: rgba(27, 40, 57, .7); border: 1px solid #26364a; border-radius: 12px; }
.steps article > span { color: var(--accent); font: 12px/1 ui-monospace, Consolas, monospace; }
.steps p { margin: 0; color: var(--muted); font-size: 14px; }
.empty { padding: 44px 28px; text-align: center; }
.empty p { margin: 7px 0 22px; color: var(--muted); }

.panel { max-width: 700px; margin-top: 18px; padding: 28px; }
.panel label { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 700; }
input, select { display: block; width: 100%; min-width: 0; padding: 13px 14px; color: var(--text); background: #0b111a; border: 1px solid #33445a; border-radius: 9px; font-size: 14px; }
#redeem-key, #generated-key { font-family: ui-monospace, Consolas, monospace; }
.field-help { margin: 9px 0 22px; color: var(--muted); font-size: 13px; }
.create-panel { display: grid; grid-template-columns: minmax(180px, 280px) auto; align-items: end; gap: 14px 18px; }
.create-panel .field-help { grid-column: 1 / -1; margin: 0; }
.copy-row { display: flex; gap: 12px; }
.table-wrap { margin-top: 26px; padding: 8px 22px 18px; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: 14px; }
caption { padding: 18px 10px 12px; text-align: left; font-weight: 750; }
th { color: var(--muted); font-size: 12px; font-weight: 650; }
td, th { padding: 14px 10px; border-bottom: 1px solid var(--line); }
.revoke { padding: 7px 11px; color: #ffb0b0; background: #28171a; border: 1px solid #633039; border-radius: 7px; }
.notice { margin-top: 18px; padding: 13px 16px; color: #b8efd7; background: #10251e; border: 1px solid #27513f; border-radius: 10px; font-size: 14px; }
.notice.error { color: #ffd0d0; background: #2a171b; border-color: #6a333d; }
.login-view { min-height: calc(100vh - 82px); display: grid; place-items: center; padding-top: 0; }
.login-card { width: min(100%, 430px); padding: 42px; text-align: center; background: rgba(16, 24, 35, .94); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.login-card h1 { font-size: 32px; }
.login-card > p { margin: 10px 0 24px; color: var(--muted); }
.discord { width: 100%; background: #5865f2; color: white; }
.discord:hover { background: #6c77f4; }
.discord-mark { font-size: 20px; }
.loading-view { color: var(--muted); }

@media (max-width: 820px) {
  .shell { grid-template-columns: 205px minmax(0, 1fr); }
  .sidebar { padding: 24px 15px 18px; }
  main { padding-inline: 28px; }
  .license-card { grid-template-columns: 1fr; }
  .license-action { justify-content: space-between; }
  .steps { grid-template-columns: 1fr; }
  .steps article { min-height: 0; }
}

@media (max-width: 620px) {
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 20; top: auto; bottom: 0; width: 100%; height: auto; padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); }
  .sidebar > .brand, .nav-label, .user-card { display: none !important; }
  nav { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 4px; margin: 0; }
  .nav { justify-content: center; padding: 10px 7px; font-size: 12px; }
  .nav-icon { display: none; }
  main { width: 100%; padding: 0 18px 92px; }
  .topbar { min-height: 68px; }
  .topbar > #page-name { display: none; }
  .mobile-brand { display: flex; font-size: 16px; }
  .mobile-brand .brand-mark { width: 32px; height: 32px; font-size: 18px; }
  section { padding-top: 35px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .license-card { padding: 22px; }
  .license-action { align-items: stretch; flex-direction: column; }
  .quick-start { padding: 22px; }
  .create-panel { display: block; }
  .create-panel .button { width: 100%; margin-top: 14px; }
  .copy-row { flex-direction: column; }
  .login-view { min-height: calc(100vh - 68px - 82px); }
  .login-card { padding: 32px 22px; }
}
