:root {
  color-scheme: dark;
  --bg: #05060a;
  --surface: #0b0f18;
  --surface-2: #0e1421;
  --surface-3: #111827;
  --text: #f2f6ff;
  --text-soft: #d5ddef;
  --muted: #8b95ac;
  --muted-2: #5f6a80;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);
  --cyan: #70f8ff;
  --cyan-soft: rgba(112, 248, 255, 0.12);
  --violet: #9d7bff;
  --lime: #c8ff6a;
  --amber: #ffd166;
  --pink: #ff7a9b;
  --ink: #041016;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", "Consolas", "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scrollbar-color: rgba(112, 248, 255, 0.28) #05060a;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 90% 60% at 100% -10%, rgba(112, 248, 255, 0.1), transparent 55%),
    radial-gradient(ellipse 60% 60% at 0% 110%, rgba(157, 123, 255, 0.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 85% 60% at 50% 0%, #000 10%, transparent 78%);
  mask-image: radial-gradient(ellipse 85% 60% at 50% 0%, #000 10%, transparent 78%);
  z-index: -1;
}

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

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

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

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

button {
  cursor: pointer;
}

ul {
  margin: 0;
  padding-left: 1.1rem;
}

code,
pre {
  font-family: var(--mono);
}

svg {
  display: block;
}

::selection {
  background: var(--cyan);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.clipboard-helper {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Brand, buttons, links
   -------------------------------------------------------------------------- */

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.admin-brand__mark {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: none;
  border: 1px solid rgba(112, 248, 255, 0.32);
  border-radius: 11px;
  background: radial-gradient(circle at 35% 25%, rgba(112, 248, 255, 0.18), rgba(12, 18, 29, 0.7));
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  box-shadow: inset 0 0 18px rgba(112, 248, 255, 0.06);
}

.admin-brand strong {
  display: block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.admin-brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(115deg, #b8fdff 0%, var(--cyan) 32%, #75c9ff 68%, #b59cff 100%);
  color: var(--ink);
  box-shadow: 0 8px 30px rgba(112, 248, 255, 0.13);
}

.btn-primary:hover {
  box-shadow: 0 12px 36px rgba(112, 248, 255, 0.22);
}

.btn-ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
}

.btn-ghost:hover {
  border-color: rgba(112, 248, 255, 0.32);
  background: rgba(112, 248, 255, 0.05);
}

.btn-small {
  min-height: 34px;
  padding-inline: 13px;
  font-size: 10px;
}

.btn-block {
  width: 100%;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(112, 248, 255, 0.25);
  background: none;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  line-height: 1.8;
  text-transform: uppercase;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.text-link:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

/* --------------------------------------------------------------------------
   Alerts / messages
   -------------------------------------------------------------------------- */

.alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.55;
}

.alert ul {
  margin-top: 5px;
}

.alert-error {
  border-color: rgba(255, 122, 155, 0.3);
  background: rgba(255, 122, 155, 0.07);
  color: #ffd9e2;
}

.alert-success {
  border-color: rgba(200, 255, 106, 0.26);
  background: rgba(200, 255, 106, 0.06);
  color: #e9ffc5;
}

.alert-info,
.alert-warning {
  border-color: rgba(112, 248, 255, 0.24);
  background: rgba(112, 248, 255, 0.055);
  color: #d8f9ff;
}

.alert-warning {
  border-color: rgba(255, 209, 102, 0.3);
  background: rgba(255, 209, 102, 0.06);
  color: #ffedbb;
}

.message-card {
  width: min(520px, calc(100% - 32px));
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4);
}

.message-card h1 {
  margin-bottom: 10px;
  font-size: 1.9rem;
}

.message-card p {
  margin-bottom: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.admin-center {
  display: grid;
  place-items: center;
  padding: 24px;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 0.76rem;
}

label > span {
  color: var(--text-soft);
  font-size: 0.73rem;
  font-weight: 550;
}

label small {
  color: var(--muted-2);
  font-size: 0.68rem;
  line-height: 1.45;
}

input,
select,
textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: rgba(5, 8, 14, 0.62);
  color: var(--text);
  font-size: 0.84rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(112, 248, 255, 0.58);
  background: rgba(7, 12, 20, 0.85);
  box-shadow: 0 0 0 3px rgba(112, 248, 255, 0.08);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 19px,
    calc(100% - 11px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

input[type="date"] {
  color-scheme: dark;
}

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

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

.form-span {
  grid-column: 1 / -1;
}

.form-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.form-hint {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 0.7rem;
}

.form-hint code {
  color: var(--muted);
}

.expiry-auto-note {
  align-self: end;
  padding: 9px 11px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted-2);
  font-size: 0.68rem;
}

.feature-fieldset {
  min-width: 0;
  margin: 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.feature-fieldset legend {
  padding: 0 5px;
  color: var(--text-soft);
  font-size: 0.73rem;
  font-weight: 550;
}

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

.feature-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
}

.feature-check:hover {
  border-color: rgba(112, 248, 255, 0.2);
  color: var(--text-soft);
}

.feature-check input {
  width: 14px;
  height: 14px;
  min-height: 0;
  flex: none;
  padding: 0;
  accent-color: var(--cyan);
}

.feature-check span {
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: capitalize;
}

.feature-fieldset > small {
  display: block;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 0.67rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.settings-card,
.settings-side {
  min-width: 0;
}

.settings-side h2 {
  margin-bottom: 12px;
}

.switch-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  cursor: pointer;
}

.switch-row input {
  width: 16px;
  height: 16px;
  min-height: 0;
  flex: none;
  padding: 0;
  accent-color: var(--cyan);
}

.switch-row span {
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 500;
}

.switch-row--muted span {
  color: var(--muted-2);
  font-size: 0.7rem;
}

.settings-steps {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.settings-steps li {
  margin-bottom: 7px;
}

.btn-block {
  width: 100%;
}

.settings-side__meta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
}

.settings-side__meta span {
  color: var(--muted-2);
}

.settings-side__meta strong {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-align: right;
}

.app-update-current {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.015);
}

.app-update-current > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.app-update-current strong {
  overflow-wrap: anywhere;
  font-size: 0.72rem;
}

.app-update-current span {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.status-muted {
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--muted-2);
}

.status-muted i {
  background: var(--muted-2);
}

.form-section {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.form-section + .form-section {
  margin-top: 24px;
}

.form-section__head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.form-index {
  padding-top: 2px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.form-section h2 {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.form-section__head p {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 0.72rem;
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

.auth-page {
  overflow-x: clip;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
  min-height: 100svh;
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(28px, 4vw, 48px);
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 80% 20%, rgba(112, 248, 255, 0.13), transparent 38%),
    radial-gradient(circle at 20% 90%, rgba(157, 123, 255, 0.09), transparent 40%),
    rgba(6, 9, 15, 0.56);
}

.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 20%, #000, transparent 72%);
  pointer-events: none;
}

.auth-visual > * {
  position: relative;
  z-index: 1;
}

.auth-visual__copy {
  max-width: 580px;
  margin: auto 0;
  padding: 64px 0;
}

.auth-visual__copy h1 {
  max-width: 620px;
  font-size: clamp(2.5rem, 4.6vw, 4.7rem);
  font-weight: 580;
  letter-spacing: -0.055em;
  line-height: 0.98;
  background: linear-gradient(105deg, #f2ffff 0%, #bafcff 30%, #b3a1ff 75%, #f3efff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-visual__copy p:last-child {
  max-width: 470px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.auth-visual__foot {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-portal {
  position: absolute;
  right: 4%;
  bottom: -8%;
  width: min(410px, 42vw);
  aspect-ratio: 1;
  opacity: 0.82;
  pointer-events: none;
}

.auth-portal__ring {
  position: absolute;
  border: 1px solid transparent;
  border-radius: 50%;
}

.auth-portal__ring--a {
  inset: 0;
  border-top-color: rgba(112, 248, 255, 0.55);
  border-right-color: rgba(112, 248, 255, 0.08);
  animation: admin-spin 24s linear infinite;
}

.auth-portal__ring--b {
  inset: 42px;
  border-bottom-color: rgba(157, 123, 255, 0.55);
  border-left-color: rgba(157, 123, 255, 0.06);
  animation: admin-spin-reverse 18s linear infinite;
}

.auth-portal__ring--c {
  inset: 84px;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.08);
  animation: admin-spin 42s linear infinite;
}

.auth-portal__door {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 38%;
  height: 50%;
  border: 1px solid rgba(112, 248, 255, 0.42);
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, rgba(112, 248, 255, 0.15), rgba(5, 8, 15, 0.82));
  box-shadow: 0 0 32px rgba(112, 248, 255, 0.15), inset 0 0 26px rgba(112, 248, 255, 0.1);
  transform: translate(-50%, -50%);
}

.auth-portal__door i {
  color: #e6feff;
  font-family: var(--mono);
  font-size: 1.4rem;
  font-style: normal;
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(112, 248, 255, 0.5);
}

.auth-portal__dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px 2px rgba(112, 248, 255, 0.65);
}

.auth-portal__dot--a {
  top: 12%;
  left: 50%;
}

.auth-portal__dot--b {
  right: 15%;
  bottom: 22%;
  width: 4px;
  height: 4px;
  background: var(--violet);
  box-shadow: 0 0 12px 2px rgba(157, 123, 255, 0.7);
}

.auth-main {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 32px clamp(22px, 4vw, 54px);
}

.auth-card {
  width: min(430px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 0%, rgba(112, 248, 255, 0.08), transparent 36%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.26);
}

.auth-card--standalone {
  margin: 24px auto;
}

.auth-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.auth-lock {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--cyan);
}

.auth-lock svg {
  width: 15px;
  height: 15px;
}

.auth-card h2,
.auth-card h1 {
  margin-top: 4px;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
}

.auth-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}

.login-form .btn {
  margin-top: 5px;
}

.auth-help {
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 0.7rem;
  line-height: 1.6;
}

.auth-back {
  margin-top: 15px;
}

.logout-inline {
  margin-top: 18px;
}

/* --------------------------------------------------------------------------
   Setup / installer
   -------------------------------------------------------------------------- */

.setup-page {
  padding: 28px 0 60px;
}

.setup-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% 5%, rgba(112, 248, 255, 0.1), transparent 33%),
    radial-gradient(circle at 4% 100%, rgba(157, 123, 255, 0.08), transparent 36%);
  z-index: -1;
}

.setup-shell {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
}

.setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.setup-card {
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.2);
}

.setup-card--locked {
  max-width: 660px;
  margin: 80px auto;
  text-align: center;
}

.setup-card--locked h1 {
  margin-bottom: 12px;
  font-size: 2rem;
}

.setup-card--locked p {
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.7;
}

.setup-intro h1 {
  margin-top: 4px;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
}

.setup-intro > p:last-of-type {
  max-width: 560px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.7;
}

.setup-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.setup-notes span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.04em;
}

.setup-card .alert {
  margin-top: 20px;
}

.admin-form {
  margin-top: 26px;
}

/* --------------------------------------------------------------------------
   Panel shell
   -------------------------------------------------------------------------- */

.panel-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 20px 22px;
  border-right: 1px solid var(--line);
  background: rgba(6, 9, 15, 0.72);
  backdrop-filter: blur(14px);
}

.sidebar__spacer {
  flex: 1;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 38px;
}

.side-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.79rem;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.side-nav__link:hover,
.side-nav__link.is-active {
  border-color: rgba(112, 248, 255, 0.16);
  background: rgba(112, 248, 255, 0.055);
  color: var(--text);
}

.side-nav__link.is-active {
  box-shadow: inset 2px 0 0 var(--cyan);
}

.side-nav__icon {
  width: 17px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.9rem;
  text-align: center;
}

.account-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
}

.account-card__label {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.12em;
}

.account-card strong {
  display: block;
  margin-top: 5px;
  font-size: 0.84rem;
  font-weight: 600;
}

.account-card__meta {
  display: block;
  color: var(--muted);
  font-size: 0.67rem;
}

.account-card form {
  margin-top: 9px;
}

.sidebar__back {
  margin-top: 15px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.sidebar__back:hover {
  color: var(--cyan);
}

.panel-main {
  min-width: 0;
  padding: clamp(22px, 3.2vw, 42px);
}

.panel-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 27px;
}

.panel-topbar h1 {
  font-size: clamp(2rem, 3.4vw, 3.2rem);
}

.panel-topbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 30px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 90% 0%, rgba(112, 248, 255, 0.08), transparent 45%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
}

.stat-card::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 12px;
  width: 33px;
  height: 1px;
  background: rgba(112, 248, 255, 0.28);
}

.stat-card__label,
.stat-card__foot {
  display: block;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin: 14px 0 5px;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1;
}

.stat-card--good strong { color: var(--lime); }
.stat-card--warn strong { color: var(--amber); }
.stat-card--muted strong { color: var(--muted); }

.panel-section {
  margin-top: 27px;
  scroll-margin-top: 20px;
}

.section-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-bar h2 {
  font-size: 1.18rem;
  letter-spacing: -0.025em;
}

.result-count {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.filter-bar label {
  min-width: 130px;
  flex: 0 1 180px;
}

.filter-bar .filter-search {
  flex: 1 1 230px;
}

.filter-bar input,
.filter-bar select {
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 0.73rem;
}

.filter-bar select {
  padding-right: 27px;
  background-position:
    calc(100% - 14px) 15px,
    calc(100% - 9px) 15px;
}

.btn-filter {
  min-height: 34px;
  padding-inline: 13px;
  font-size: 9px;
}

.filter-reset {
  padding: 0 5px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-reset:hover {
  color: var(--cyan);
}

/* --------------------------------------------------------------------------
   Table
   -------------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.012);
}

.license-table {
  width: 100%;
  min-width: 930px;
  border-collapse: collapse;
  text-align: left;
}

.license-table th {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 6.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.license-table td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  color: var(--text-soft);
  font-size: 0.76rem;
  vertical-align: middle;
}

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

.license-table tbody tr:hover {
  background: rgba(112, 248, 255, 0.025);
}

.th-actions {
  text-align: right;
}

.cell-title {
  display: block;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 550;
  line-height: 1.35;
}

.cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 6.8px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.key-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 205px;
}

.key-cell code {
  color: #bdfaff;
  font-size: 0.69rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.copy-btn {
  flex: none;
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.copy-btn:hover {
  border-color: rgba(112, 248, 255, 0.35);
  color: var(--cyan);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 21px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 6.8px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-pill i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 7px currentColor;
}

.status-active {
  border-color: rgba(200, 255, 106, 0.22);
  background: rgba(200, 255, 106, 0.06);
  color: var(--lime);
}

.status-expired {
  border-color: rgba(255, 209, 102, 0.22);
  background: rgba(255, 209, 102, 0.06);
  color: var(--amber);
}

.status-revoked {
  border-color: rgba(255, 122, 155, 0.22);
  background: rgba(255, 122, 155, 0.06);
  color: var(--pink);
}

.status-pending {
  border-color: rgba(112, 248, 255, 0.22);
  background: rgba(112, 248, 255, 0.06);
  color: var(--cyan);
}

.status-suspended {
  border-color: rgba(255, 209, 102, 0.22);
  background: rgba(255, 209, 102, 0.06);
  color: var(--amber);
}

.status-issued,
.status-unused {
  border-color: rgba(112, 248, 255, 0.22);
  background: rgba(112, 248, 255, 0.06);
  color: var(--cyan);
}

.status-used {
  border-color: rgba(200, 255, 106, 0.22);
  background: rgba(200, 255, 106, 0.06);
  color: var(--lime);
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.row-actions form {
  display: inline;
}

.row-action {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  text-transform: uppercase;
}

.row-action:hover {
  color: var(--cyan);
}

.row-action--danger:hover {
  color: var(--pink);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 38px 20px;
  text-align: center;
}

.empty-state strong {
  font-size: 0.95rem;
}

.empty-state span {
  color: var(--muted);
  font-size: 0.76rem;
}

.empty-state .btn {
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Apps
   -------------------------------------------------------------------------- */

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.app-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.008));
}

.app-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}

.app-card__initial {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(112, 248, 255, 0.2);
  border-radius: 8px;
  background: rgba(112, 248, 255, 0.06);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.app-card__version {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.05em;
}

.app-card h3 {
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-card p {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.app-card__count {
  display: block;
  margin-top: 12px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 6.8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Dialog
   -------------------------------------------------------------------------- */

body.dialog-open {
  overflow: hidden;
}

.license-dialog {
  width: min(680px, calc(100vw - 28px));
  max-width: 680px;
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--text);
  overflow: visible;
}

.license-dialog::backdrop {
  background: rgba(3, 5, 10, 0.78);
  backdrop-filter: blur(8px);
}

.dialog-card {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 88vh;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #0a0f18;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dialog-head h2 {
  font-size: 1.5rem;
}

.dialog-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
}

.dialog-close:hover {
  border-color: rgba(112, 248, 255, 0.35);
  color: var(--cyan);
}

.license-form {
  margin-top: 15px;
}

.license-form .form-grid {
  gap: 12px;
}

.license-form .form-actions {
  display: none;
}

.license-form .dialog-actions {
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

/* Keterbacaan label kecil di layar lebar */
.stat-card__label,
.stat-card__foot {
  font-size: 13px;
  letter-spacing: 0.05em;
}

.license-table {
  min-width: 1240px;
}

.license-table th {
  font-size: 13px;
  letter-spacing: 0.04em;
}

.result-count {
  font-size: 13px;
}

.account-card__label {
  font-size: 13px;
}

.account-card__meta {
  font-size: 0.85rem;
}

.sidebar__back {
  font-size: 13px;
}

.cell-sub {
  font-size: 12px;
  line-height: 1.5;
}

.app-card__count,
.app-card__version {
  font-size: 12px;
}

.status-pill {
  font-size: 12px;
}

.row-action,
.copy-btn,
.filter-reset {
  font-size: 12px;
}

.version-pill,
.admin-brand small {
  font-size: 12px;
}

.eyebrow {
  font-size: 12.5px;
}

.side-nav__link {
  font-size: 0.88rem;
}

/* Tabel aplikasi: deskripsi lebih sempit dan membungkus ke bawah. */
.license-table.app-table {
  min-width: 980px;
  table-layout: fixed;
}

.app-table .app-col-name {
  width: 22%;
}

.app-table .app-col-slug {
  width: 10%;
}

.app-table .app-col-version {
  width: 17%;
}

.app-table .app-col-license {
  width: 7%;
}

.app-table .app-col-description {
  width: 26%;
}

.app-table .app-col-action {
  width: 18%;
}

.app-table th,
.app-table td {
  vertical-align: top;
}

.app-table td:nth-child(2) .cell-sub,
.app-table td:nth-child(5) .cell-sub {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.app-table .row-actions {
  flex-wrap: wrap;
}

/* Halaman Cek Sistem */
.key-upload-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(112, 248, 255, 0.025);
}

.key-upload-box h2 {
  margin: 5px 0 7px;
  font-size: 1.1rem;
}

.key-upload-box p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.82rem;
}

.key-upload-path {
  display: block;
  color: var(--cyan);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.key-upload-form {
  display: grid;
  gap: 9px;
}

.key-upload-form label {
  display: grid;
  gap: 5px;
  font-size: 0.76rem;
}

.key-upload-form small {
  color: var(--muted-2);
  font-size: 0.7rem;
}

.check-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.check-item__mark {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.check-item__body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.check-item__body strong {
  font-size: 0.82rem;
}

.check-item__body span {
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.check-item__body small {
  color: var(--muted-2);
  font-size: 0.73rem;
  line-height: 1.45;
}

.check-item--ok .check-item__mark {
  background: rgba(200, 255, 106, 0.12);
  color: #d6ff8a;
}

.check-item--warn {
  border-color: rgba(255, 209, 102, 0.25);
}

.check-item--warn .check-item__mark {
  background: rgba(255, 209, 102, 0.12);
  color: #ffd166;
}

.check-item--fail {
  border-color: rgba(255, 122, 155, 0.25);
}

.check-item--fail .check-item__mark {
  background: rgba(255, 122, 155, 0.13);
  color: #ff9caf;
}

@media (max-width: 900px) {
  .key-upload-box {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dialog-actions form {
  margin: 0;
}

.side-nav__link {
  font-size: 0.84rem;
}

@keyframes admin-spin {
  to { transform: rotate(360deg); }
}

@keyframes admin-spin-reverse {
  to { transform: rotate(-360deg); }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .auth-portal {
    width: 330px;
    opacity: 0.65;
  }
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-visual {
    min-height: 0;
    padding: 26px 24px 30px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .auth-visual__copy {
    padding: 38px 0 12px;
  }

  .auth-visual__copy h1 {
    max-width: 640px;
    font-size: clamp(2.2rem, 6vw, 3.8rem);
  }

  .auth-visual__copy p:last-child {
    margin-top: 14px;
  }

  .auth-visual__foot,
  .auth-portal {
    display: none;
  }

  .auth-main {
    padding: 30px 24px 50px;
  }

  .panel-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 20px;
  }

  .side-nav__link {
    padding: 8px 10px;
  }

  .account-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 17px;
  }

  .account-card__label,
  .account-card__meta {
    display: none;
  }

  .account-card strong {
    margin-top: 0;
  }

  .account-card form {
    margin-top: 0;
    margin-left: auto;
  }

  .sidebar__spacer,
  .sidebar__back {
    display: none;
  }
}

@media (max-width: 760px) {
  .setup-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .setup-header .text-link {
    margin-left: 50px;
  }

  .setup-card {
    padding: 22px 18px;
  }

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

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

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

  .form-span {
    grid-column: auto;
  }

  .panel-main {
    padding: 20px 14px 38px;
  }

  .panel-topbar {
    flex-direction: column;
    gap: 15px;
  }

  .panel-topbar__actions {
    width: 100%;
    justify-content: space-between;
  }

  .stat-grid {
    gap: 8px;
  }

  .stat-card {
    min-height: 112px;
  }

  .section-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .filter-bar {
    align-items: stretch;
  }

  .filter-bar label,
  .filter-bar .filter-search {
    flex: 1 1 100%;
  }

  .btn-filter {
    width: 100%;
  }

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

  .license-dialog {
    width: calc(100vw - 20px);
    max-height: 92vh;
  }

  .dialog-card {
    max-height: 92vh;
    padding: 18px;
  }

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

  .dialog-actions .btn {
    width: 100%;
  }

  .auth-card {
    padding: 24px 20px;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    min-height: 100px;
  }

  .panel-topbar__actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .panel-topbar__actions .btn {
    width: 100%;
  }

  .version-pill {
    align-self: flex-start;
  }

  .setup-notes {
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
