* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #040707;
  --bg-soft: #0b1110;
  --panel: rgba(8, 12, 11, 0.84);
  --panel-strong: rgba(10, 14, 13, 0.95);
  --panel-muted: rgba(255, 255, 255, 0.04);
  --line: rgba(0, 255, 159, 0.16);
  --line-strong: rgba(0, 255, 159, 0.32);
  --text: #f3f7f4;
  --muted: #9ba8a0;
  --accent: #00ff9f;
  --accent-2: #7dffcb;
  --accent-3: #4cffb6;
  --success: #6ef0b6;
  --danger: #ff8b8b;
  --warning: #ffd39f;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #040707 0%, #060a09 46%, #040707 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
  opacity: 0.2;
}

body.locked {
  overflow: hidden;
}

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

.admin-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.admin-ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.45;
}

.admin-ambient-one {
  top: -120px;
  left: -140px;
  width: 420px;
  height: 420px;
  background: rgba(0, 255, 159, 0.18);
}

.admin-ambient-two {
  top: 10%;
  right: -120px;
  width: 360px;
  height: 360px;
  background: rgba(0, 255, 159, 0.11);
}

.admin-ambient-three {
  bottom: -160px;
  left: 26%;
  width: 460px;
  height: 460px;
  background: rgba(0, 255, 159, 0.08);
}

.layout {
  position: relative;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 20px 44px;
}

.layout.locked {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

.sidebar,
.workspace-bar,
.panel,
.stat-card,
.sidebar-card,
.sidebar-metric,
.module-card,
.license-card,
.event-card,
.device-card,
.overlay-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 40px);
  padding: 22px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(0, 255, 159, 0.07), transparent 20%),
    rgba(6, 10, 9, 0.9);
  backdrop-filter: blur(24px);
}

.sidebar-brand h2,
.workspace-copy h1,
.overlay-card h1,
.overlay-card h2,
.stat-card strong,
.module-card h3,
.license-title h3,
.sidebar-metric h3 {
  font-family: Barlow, Inter, sans-serif;
}

.sidebar-brand h2 {
  margin-top: 10px;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.eyebrow,
.section-label,
.stat-label,
.preview-label {
  display: inline-flex;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.eyebrow {
  margin-bottom: 10px;
}

.subtext,
.muted,
.sidebar-brand p,
.workspace-copy p,
.sidebar-metric p,
.panel-header p {
  color: var(--muted);
  line-height: 1.7;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
}

.tab-button,
.button {
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.tab-button {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: #d7e6de;
  font-weight: 700;
  text-align: left;
}

.tab-button.active {
  background: linear-gradient(135deg, rgba(0, 255, 159, 0.18), rgba(125, 255, 203, 0.09));
  border-color: var(--line-strong);
  color: #08110d;
  box-shadow: 0 12px 30px rgba(0, 255, 159, 0.16);
}

.sidebar-card,
.sidebar-metric {
  padding: 18px;
  border-radius: 22px;
}

.sidebar-card {
  display: grid;
  gap: 10px;
}

.sidebar-card a {
  color: #d8e6de;
}

.sidebar-card a:hover {
  color: #fff;
}

.admin-main {
  display: grid;
  gap: 20px;
}

.workspace-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  padding: 24px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(0, 255, 159, 0.1), transparent 24%),
    linear-gradient(315deg, rgba(125, 255, 203, 0.07), transparent 20%),
    var(--panel-strong);
}

.workspace-copy h1 {
  margin-top: 10px;
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.token-box,
.overlay-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.token-box {
  align-self: end;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 20px;
  border-radius: 24px;
  background: rgba(8, 12, 11, 0.86);
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 320px;
  gap: 18px;
}

.hero-side {
  display: grid;
  gap: 18px;
}

.panel,
.module-card,
.license-card,
.event-card,
.device-card {
  position: relative;
  overflow: hidden;
}

.panel::after,
.module-card::after,
.license-card::after,
.event-card::after,
.device-card::after,
.sidebar-card::after,
.sidebar-metric::after,
.stat-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 22%);
}

.panel {
  padding: 22px;
  border-radius: 28px;
}

.orders-hero {
  padding: 24px;
}

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

.inner-header {
  margin-top: 26px;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 320px;
}

.panel-footer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

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

.module-card {
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.025);
}

.module-list {
  margin-top: 16px;
}

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

.form-grid label,
.section-stack label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #dbe8e0;
  font-size: 14px;
}

.section-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compact-stack {
  gap: 8px;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(0, 255, 159, 0.16);
  background: rgba(6, 10, 9, 0.92);
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
  font: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(0, 255, 159, 0.4);
  box-shadow: 0 0 0 4px rgba(0, 255, 159, 0.08);
}

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

.preview-box {
  padding: 16px;
  border: 1px solid rgba(0, 255, 159, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
}

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

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  color: #05110a;
  background: linear-gradient(135deg, #00ff9f 0%, #8affca 100%);
  box-shadow: 0 18px 40px rgba(0, 255, 159, 0.16);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.button-secondary:hover,
.ghost-button:hover,
.tab-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.button-danger {
  background: rgba(255, 139, 139, 0.12);
  border-color: rgba(255, 139, 139, 0.22);
  color: #fff;
}

.card-list,
.event-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.license-card,
.event-card,
.device-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(6, 10, 9, 0.84);
}

.license-header,
.device-row,
.event-row,
.file-row,
.release-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.license-title {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.license-key,
.mono {
  font-family: Consolas, "Courier New", monospace;
}

.license-key {
  font-size: 13px;
  color: var(--muted);
}

.license-key-row,
.license-meta,
.license-actions,
.device-list,
.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.license-meta,
.license-actions {
  margin-top: 14px;
}

.compact-actions {
  margin-top: 14px;
}

.meta-pill,
.device-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.meta-pill,
.device-pill {
  background: rgba(0, 255, 159, 0.1);
  color: #dcf7e9;
}

.badge-active {
  background: rgba(110, 240, 182, 0.16);
  color: var(--success);
}

.badge-revoked,
.badge-expired {
  background: rgba(255, 139, 139, 0.14);
  color: var(--danger);
}

.badge-warning {
  background: rgba(255, 211, 159, 0.16);
  color: var(--warning);
}

.ghost-button {
  border-color: rgba(0, 255, 159, 0.18);
  background: transparent;
  color: #dcf7e9;
}

.file-row,
.release-row {
  padding: 12px 14px;
  border: 1px solid rgba(0, 255, 159, 0.12);
  border-radius: 18px;
  background: rgba(0, 255, 159, 0.05);
}

.file-meta,
.release-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.release-notes {
  margin-top: 12px;
  white-space: pre-wrap;
  color: #d7e5dd;
}

.mini-list {
  margin: 14px 0 0;
  list-style: none;
}

.mini-list li {
  position: relative;
  padding: 10px 0 10px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #d7e5dd;
}

.mini-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(0, 255, 159, 0.08);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 7, 0.84);
  backdrop-filter: blur(14px);
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  width: min(520px, calc(100vw - 32px));
  padding: 30px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(0, 255, 159, 0.08), transparent 24%),
    var(--panel-strong);
}

.overlay-card h1 {
  margin-top: 10px;
  font-size: 2.4rem;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.details-card {
  width: min(820px, calc(100vw - 32px));
}

.status-card {
  width: min(560px, calc(100vw - 32px));
}

.status-card h2 {
  margin-top: 10px;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.status-card .subtext {
  margin-top: 12px;
  font-size: 1rem;
}

.details-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

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

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.event-card pre {
  margin: 10px 0 0;
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 140;
  background: rgba(6, 10, 9, 0.96);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--text);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.38);
}

.error-text {
  color: var(--danger);
  font-size: 13px;
}

.hidden {
  display: none;
}

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

  .sidebar {
    position: static;
    min-height: auto;
  }

  .workspace-bar,
  .hero-grid,
  .dual-grid,
  .orders-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .stats-grid,
  .form-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .panel-tools {
    min-width: 0;
    width: 100%;
    flex-direction: column;
  }

  .workspace-bar {
    padding: 20px;
  }

  .workspace-copy h1 {
    font-size: clamp(2.2rem, 9vw, 3.4rem);
  }
}
