* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #07070a;
  --card: rgba(255, 255, 255, 0.04);
  --card-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(155, 92, 255, 0.3);
  --text: #fff;
  --muted: #a1a1aa;
  --accent: #9b5cff;
  --purple2: #7c3cff;
  --good: #80e6ae;
  --warn: #f4c96a;
  --bad: #ff7d91;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}

body.login-active {
  overflow: hidden;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(155, 92, 255, 0.08), transparent 26%),
    radial-gradient(circle at bottom right, rgba(155, 92, 255, 0.06), transparent 28%);
  content: "";
  pointer-events: none;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.blur {
  position: absolute;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: rgba(155, 92, 255, 0.07);
  filter: blur(120px);
}

.blur.one {
  top: -120px;
  left: -100px;
}

.blur.two {
  right: -120px;
  bottom: 0;
}

.site-header {
  position: fixed;
  z-index: 1000;
  top: 0;
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(7, 7, 10, 0.6);
  backdrop-filter: blur(20px);
  transition: 0.3s ease;
}

.site-header.scrolled {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(7, 7, 10, 0.84);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}

.login-active .site-header {
  display: none;
}

.navbar {
  display: flex;
  width: min(1400px, 100%);
  min-height: 68px;
  margin: auto;
  padding: 0 8%;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
}

.logo img {
  width: 34px;
  filter: drop-shadow(0 0 10px rgba(155, 92, 255, 0.32));
  transition: 0.4s ease;
}

.logo:hover img {
  transform: scale(1.08) rotate(-4deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-links a,
.nav-links button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  text-decoration: none;
  transition: 0.25s;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links button:hover {
  color: white;
}

.nav-links .nav-cta {
  display: inline-flex;
  padding: 10px 16px;
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  align-items: center;
  gap: 8px;
  color: #d5c0ff;
  background: rgba(155, 92, 255, 0.1);
}

.menu-toggle {
  display: none;
}

main {
  width: 100%;
  min-height: 100vh;
}

.login-active main {
  min-height: 100dvh;
}

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

.login-active .login-view {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  padding: 20px;
  place-items: center;
}

.login-shell {
  width: 100%;
  max-width: 380px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px);
  transform: none;
}

.login-brand {
  display: flex;
  margin-bottom: 22px;
  align-items: center;
  gap: 12px;
}

.login-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(155, 92, 255, 0.35));
}

.login-brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
  line-height: 1.1;
}

.login-brand p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

h1 {
  margin-bottom: 8px;
  font-size: 32px;
  letter-spacing: 0;
  line-height: 1.15;
}

.login-shell p,
.dashboard-head p,
.toolbar p,
.empty,
.muted {
  color: var(--muted);
  line-height: 1.7;
}

.login-form,
.dynamic-form {
  display: grid;
  margin-top: 0;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: #d8c3ff;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  color: white;
  background: rgba(255, 255, 255, 0.045);
  transition: 0.25s ease;
}

textarea {
  min-height: 92px;
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(155, 92, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(155, 92, 255, 0.12);
}

option {
  color: #111;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: white;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--purple2));
  box-shadow: 0 10px 28px rgba(155, 92, 255, 0.18);
}

.btn-primary:hover {
  box-shadow: 0 14px 32px rgba(155, 92, 255, 0.25);
  transform: translateY(-2px);
}

.btn-secondary {
  border: 1px solid var(--border);
  background: var(--card);
}

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

.dashboard-view {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 92px 8% 56px;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  display: inline-flex;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  color: white;
  background: var(--card);
  transition: 0.25s ease;
}

.icon-button:hover {
  border-color: rgba(155, 92, 255, 0.35);
  background: rgba(255, 255, 255, 0.07);
}

.metrics {
  display: grid;
  margin-bottom: 18px;
  gap: 12px;
  grid-template-columns: repeat(4, 1fr);
}

.metric {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  backdrop-filter: blur(20px);
}

.metric span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.metric strong {
  font-size: 28px;
}

.split-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
}

.panel,
.table-shell {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  backdrop-filter: blur(20px);
}

.panel {
  padding: 18px;
}

.panel-title,
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-title {
  margin-bottom: 18px;
}

.panel-title h2,
.toolbar h2 {
  font-size: 20px;
}

.panel-title i {
  color: #d0b0ff;
}

.toolbar {
  margin-bottom: 18px;
}

.list {
  display: grid;
  gap: 10px;
}

.list-row {
  display: flex;
  min-height: 54px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-row:first-child {
  border-top: 0;
}

.list-row strong {
  display: block;
  margin-bottom: 4px;
}

.list-row span {
  color: var(--muted);
  font-size: 12px;
}

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

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

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #d8c3ff;
  font-size: 12px;
  text-transform: uppercase;
}

td {
  color: #f4f0ff;
  font-size: 14px;
}

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

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.chip {
  display: inline-flex;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  align-items: center;
  color: #d8c3ff;
  background: rgba(155, 92, 255, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(155, 92, 255, 0.2);
  border-radius: 999px;
  align-items: center;
  gap: 8px;
  color: #d5c0ff;
  background: rgba(155, 92, 255, 0.08);
  font-size: 13px;
}

.chip.active,
.chip.paid,
.chip.healthy {
  border-color: rgba(128, 230, 174, 0.28);
  color: var(--good);
  background: rgba(128, 230, 174, 0.08);
}

.chip.paused,
.chip.pending {
  border-color: rgba(244, 201, 106, 0.28);
  color: var(--warn);
  background: rgba(244, 201, 106, 0.08);
}

.chip.revoked,
.chip.expired,
.chip.failed,
.chip.refunded,
.chip.disabled {
  border-color: rgba(255, 125, 145, 0.28);
  color: var(--bad);
  background: rgba(255, 125, 145, 0.08);
}

.drawer {
  position: fixed;
  z-index: 2000;
  inset: 0;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(8px);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(480px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 26px;
  border-left: 1px solid var(--border);
  background: rgba(13, 13, 18, 0.96);
  box-shadow: -20px 0 80px rgba(0, 0, 0, 0.34);
}

.form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

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

.toast {
  position: fixed;
  z-index: 3000;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 14px 16px;
  border: 1px solid rgba(155, 92, 255, 0.28);
  border-radius: 14px;
  color: white;
  background: rgba(13, 13, 18, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 900px) {
  .navbar {
    min-height: 70px;
  }

  .menu-toggle {
    display: flex;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-direction: column;
    background: var(--card);
  }

  .menu-toggle span {
    display: block;
    width: 17px;
    height: 1px;
    background: white;
    transition: 0.25s ease;
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .nav-links {
    position: absolute;
    visibility: hidden;
    top: 74px;
    right: 8%;
    left: 8%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    opacity: 0;
    background: rgba(13, 13, 18, 0.97);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(22px);
    transform: translateY(-10px);
    transition: 0.25s ease;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .nav-links.open {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-links a,
  .nav-links button {
    padding: 10px 7px;
    text-align: left;
  }

  .dashboard-head,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .head-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .dashboard-view {
    padding: 92px 6% 48px;
  }

  .login-view {
    padding-inline: 16px;
  }

  .navbar {
    padding-inline: 6%;
  }

  .nav-links {
    right: 6%;
    left: 6%;
  }

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

  h1 {
    font-size: 30px;
  }

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

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