:root {
  --bg: #030712;
  --panel: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.14);
  --text: #f8fbff;
  --muted: #a8b3c7;
  --blue: #2667ff;
  --blue-bright: #4f8cff;
  --cyan: #38d8ff;
  --success: #36e29a;
  --danger: #ff5f7a;
  --warning: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 8px;
}

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

body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgba(38, 103, 255, 0.24), transparent 32%),
    radial-gradient(circle at 92% 4%, rgba(56, 216, 255, 0.13), transparent 30%),
    linear-gradient(180deg, #02050d, var(--bg));
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

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

button {
  border: 0;
}

.glass {
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-shell {
  display: grid;
  grid-template-columns: 292px 1fr;
  min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(2, 5, 13, 0.84);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 28px;
  font-size: 1.08rem;
  font-weight: 900;
}

.brand span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 16px 34px rgba(38, 103, 255, 0.36);
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  transition: transform 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.nav-item:hover,
.nav-item.active {
  color: white;
  background: rgba(38, 103, 255, 0.18);
  transform: translateX(4px);
}

.balance-card {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  padding: 18px;
  border-radius: var(--radius);
}

.balance-card p {
  color: var(--muted);
  font-weight: 800;
}

.balance-card strong {
  display: block;
  margin: 6px 0 12px;
  font-size: 2rem;
}

.mini-link {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: white;
  background: rgba(38, 103, 255, 0.24);
  cursor: pointer;
  font-weight: 900;
}

.main-area {
  min-width: 0;
  padding: 24px;
}

/* Top Header */
.topbar {
  position: sticky;
  z-index: 10;
  top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 18px 20px;
  border-radius: var(--radius);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: white;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.eyebrow {
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar h1 {
  margin-top: 2px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: fit-content;
}

.account-chip small {
  display: block;
  color: var(--muted);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 18px rgba(54, 226, 154, 0.8);
}

.page {
  display: none;
  animation: fadeIn 0.35s ease both;
}

.page.active {
  display: block;
}

/* Dashboard */
.hero-panel {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
  padding: 28px;
  border-radius: var(--radius);
}

.hero-panel h2 {
  max-width: 800px;
  font-size: clamp(2rem, 4.4vw, 4.35rem);
  line-height: 1.02;
}

.hero-panel p:not(.eyebrow) {
  max-width: 640px;
  margin-top: 18px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.login-card {
  padding: 18px;
  border-radius: var(--radius);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.auth-tab,
.filter-btn {
  min-height: 40px;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-weight: 900;
}

.auth-tab.active,
.filter-btn.active,
.auth-tab:hover,
.filter-btn:hover {
  color: white;
  background: rgba(38, 103, 255, 0.24);
}

.auth-form {
  display: none;
  gap: 12px;
}

.auth-form.active {
  display: grid;
}

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

.stat-card,
.panel,
.service-card,
.table-card {
  border-radius: var(--radius);
}

.stat-card {
  padding: 22px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.stat-card:hover,
.service-card:hover,
.panel:hover {
  border-color: rgba(79, 140, 255, 0.45);
}

.stat-card:hover,
.service-card:hover {
  transform: translateY(-6px);
}

.stat-card span {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.stat-card p,
.service-card p,
.stack-item p,
.api-status p,
.process-list,
.workflow-list {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-head h2,
.panel-head h2 {
  margin-top: 4px;
}

.category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.service-toolbar {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px;
  border-radius: var(--radius);
}

.service-toolbar label {
  display: grid;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  color: var(--cyan);
  background: rgba(38, 103, 255, 0.14);
}

.service-toolbar input {
  border-color: transparent;
  background: rgba(0, 0, 0, 0.18);
}

.service-toolbar span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.filter-btn {
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

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

.service-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.service-card::before {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(135deg, rgba(38, 103, 255, 0.2), transparent 58%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.service-card:hover::before {
  opacity: 1;
}

.service-card > * {
  position: relative;
}

.service-card i {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.quality-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.quality-badge,
.refill-badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.quality-badge {
  color: var(--cyan);
  border: 1px solid rgba(56, 216, 255, 0.26);
  background: rgba(38, 103, 255, 0.14);
}

.refill-badge {
  color: #c9ffdf;
  border: 1px solid rgba(54, 226, 154, 0.22);
  background: rgba(54, 226, 154, 0.11);
}

.service-card h3 {
  min-height: 54px;
  font-size: 1.05rem;
}

.service-meta {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.service-meta div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
}

.service-meta strong {
  color: white;
}

.empty-services {
  grid-column: 1 / -1;
  padding: 38px;
  border-radius: var(--radius);
  text-align: center;
}

.empty-services i {
  color: var(--cyan);
  font-size: 2rem;
}

.empty-services h3 {
  margin-top: 12px;
}

.empty-services p {
  color: var(--muted);
}

.two-column,
.admin-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 24px;
}

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

.panel,
.table-card {
  padding: 24px;
}

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

.panel-form,
.stack-list,
.process-list,
.workflow-list {
  display: grid;
  gap: 13px;
}

.panel-form label {
  color: white;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  outline: none;
  padding: 13px 14px;
  color: white;
  background: rgba(0, 0, 0, 0.22);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 4px rgba(38, 103, 255, 0.18);
}

.btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  font-weight: 900;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn {
  padding: 0 18px;
}

.btn:hover,
.icon-btn:hover {
  transform: translateY(-3px);
}

.primary {
  background: linear-gradient(135deg, var(--blue), #0e46dd);
  box-shadow: 0 16px 36px rgba(38, 103, 255, 0.28);
}

.ghost {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.07);
}

.danger {
  color: #ffd8df;
  background: rgba(255, 95, 122, 0.15);
}

.order-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid rgba(56, 216, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(38, 103, 255, 0.1);
}

.order-total span {
  color: var(--muted);
  font-weight: 800;
}

.order-total strong {
  font-size: 1.45rem;
}

.payment-box {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(56, 216, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(38, 103, 255, 0.09);
}

.qr-card {
  display: grid;
  min-height: 142px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: white;
  color: #06111d;
}

.qr-card img {
  width: 100%;
  height: 142px;
  object-fit: cover;
}

.fake-qr {
  display: grid;
  place-items: center;
  gap: 6px;
  color: #06111d;
  font-weight: 900;
}

.fake-qr i {
  font-size: 3rem;
}

.payment-box h3 {
  margin: 4px 0 8px;
}

.payment-box p:not(.eyebrow) {
  color: var(--muted);
}

.upload-preview {
  display: grid;
  min-height: 150px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(79, 140, 255, 0.45);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(38, 103, 255, 0.08);
  text-align: center;
}

.upload-preview i {
  display: block;
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 2rem;
}

.upload-preview img {
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.admin-stats {
  margin-bottom: 24px;
}

.api-status {
  display: flex;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(54, 226, 154, 0.2);
  border-radius: var(--radius);
  background: rgba(54, 226, 154, 0.08);
}

.process-list div,
.workflow-list div,
.payment-grid div,
.stack-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.process-list div,
.workflow-list div,
.payment-grid div {
  padding: 14px;
}

.process-list i {
  color: var(--success);
  margin-right: 8px;
}

.workflow-list span {
  display: inline-grid;
  width: 28px;
  height: 28px;
  margin-right: 9px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-weight: 900;
}

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

.payment-grid div {
  color: white;
  font-weight: 900;
}

.payment-grid i {
  color: var(--cyan);
  margin-right: 8px;
}

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

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

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  color: white;
  background: rgba(38, 103, 255, 0.22);
  font-size: 0.78rem;
  font-weight: 900;
}

.badge.Completed {
  background: rgba(54, 226, 154, 0.18);
  color: #bbffe0;
}

.badge.Processing {
  background: rgba(56, 216, 255, 0.18);
  color: #c6f5ff;
}

.badge.Pending {
  background: rgba(255, 209, 102, 0.18);
  color: #ffe9ac;
}

.badge.Cancelled {
  background: rgba(255, 95, 122, 0.18);
  color: #ffd8df;
}

.stack-item {
  padding: 15px;
}

.notification-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-item i {
  color: var(--cyan);
}

.payment-request {
  display: grid;
  gap: 12px;
}

.payment-request img {
  width: 100%;
  max-height: 230px;
  border-radius: var(--radius);
  object-fit: cover;
}

.stack-item h3 {
  margin-bottom: 5px;
  font-size: 1rem;
}

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

.stack-actions button,
.stack-actions select {
  width: auto;
  min-height: 36px;
  padding: 0 11px;
}

.compact-form {
  display: grid;
  grid-template-columns: 1fr 120px 46px;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-service-list {
  margin-top: 16px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: auto;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  padding: 14px 18px;
  border: 1px solid rgba(54, 226, 154, 0.35);
  border-radius: var(--radius);
  background: rgba(3, 7, 18, 0.88);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success-pulse {
  border-color: rgba(56, 216, 255, 0.5);
  box-shadow: 0 0 45px rgba(38, 103, 255, 0.4), var(--shadow);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Dashboard */
@media (max-width: 1180px) {
  .service-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1020px) {
  .panel-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 25;
    left: 0;
    top: 0;
    width: min(292px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .hero-panel,
  .two-column,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .main-area {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    top: 10px;
  }

  .account-chip {
    display: none;
  }

  .hero-panel,
  .panel,
  .table-card,
  .stat-card,
  .service-card {
    padding: 18px;
  }

  .stats-grid,
  .service-grid,
  .payment-grid {
    grid-template-columns: 1fr;
  }

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

  .service-toolbar {
    grid-template-columns: 1fr;
  }

  .payment-box {
    grid-template-columns: 1fr;
  }
}
