:root {
  --navy: #02071f;
  --navy-2: #07134a;
  --ink: #061028;
  --muted: #65758e;
  --line: #dce6f4;
  --bg: #f4f8ff;
  --panel: #ffffff;
  --blue: #1668ff;
  --cyan: #16c9ff;
  --magenta: #d400ff;
  --danger: #ed4563;
  --green: #24d366;
  --shadow: 0 18px 44px rgba(6, 16, 40, .12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

img {
  display: block;
  max-width: 100%;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  background: white;
}

.brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 32px;
  color: white;
  background:
    radial-gradient(circle at 76% 16%, rgba(22, 201, 255, .28), transparent 28%),
    radial-gradient(circle at 20% 86%, rgba(212, 0, 255, .32), transparent 32%),
    linear-gradient(180deg, #02071f, #06134b 58%, #26045f);
}

.logo-card {
  width: 300px;
  max-width: 78vw;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 36px rgba(22, 201, 255, .42);
}

.brand-panel h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.05;
  text-transform: uppercase;
}

.brand-panel p {
  max-width: 480px;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-weight: 700;
}

.auth-card {
  width: min(520px, calc(100% - 32px));
  align-self: center;
  justify-self: center;
  padding: 28px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  background: #f3f7ff;
}

.auth-tabs button,
.nav button,
.primary,
.secondary,
.danger,
.ghost,
.link-button {
  border: 0;
  padding: 12px 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-tabs button {
  color: var(--muted);
  background: transparent;
}

.auth-tabs button.active,
.primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--magenta));
}

.secondary {
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.danger {
  color: white;
  background: var(--danger);
}

.ghost {
  color: var(--blue);
  background: white;
  border: 1px solid var(--line);
}

.link-button {
  display: inline-block;
  text-decoration: none;
}

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

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea,
.shop-tools select,
.search-box input,
.stock-input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 11px 12px;
  color: var(--ink);
  background: white;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.shop-tools select:focus,
.search-box input:focus,
.stock-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(22, 201, 255, .16);
}

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

.success,
.error {
  padding: 12px;
  font-weight: 900;
}

.success {
  color: #0a6f42;
  background: #e8fff3;
}

.error {
  color: #912139;
  background: #ffe8ee;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 9px 10px;
  color: white;
  background:
    radial-gradient(circle at 70% 4%, rgba(22, 201, 255, .25), transparent 28%),
    linear-gradient(180deg, #02071f, #09164c 60%, #250557);
}

.side-logo {
  width: 126px;
  height: 126px;
  margin: 0 auto 8px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 22px rgba(22, 201, 255, .45);
}

.search-box {
  position: relative;
}

.search-box input {
  height: 38px;
  border-radius: 18px;
  padding: 8px 32px 8px 10px;
  font-size: 13px;
}

.search-box span {
  position: absolute;
  right: 12px;
  top: 50%;
  color: var(--blue);
  font-weight: 900;
  transform: translateY(-50%);
}

.currency {
  width: max-content;
  padding: 6px 8px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--blue), var(--magenta));
  font-size: 12px;
  font-weight: 900;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav button {
  color: white;
  background: transparent;
  text-align: left;
  min-height: 38px;
  padding: 9px 10px;
  line-height: 1.12;
}

.nav button.active,
.nav button:hover {
  background: linear-gradient(135deg, var(--blue), var(--magenta));
}

.whatsapp {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: auto;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  min-height: 34px;
}

.whatsapp img {
  width: 20px;
  height: 20px;
}

.whatsapp span {
  display: block;
}

.main {
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 15px 18px;
  background: white;
  border-bottom: 1px solid var(--line);
}

.crumb {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.balance {
  padding: 8px 10px;
  color: white;
  background: var(--navy);
  font-weight: 900;
}

.content {
  min-height: calc(100vh - 58px);
  padding: 16px 18px 34px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 108px;
  margin-bottom: 14px;
  padding: 20px;
  color: white;
  background:
    linear-gradient(90deg, rgba(2, 7, 31, .94), rgba(7, 19, 74, .78)),
    radial-gradient(circle at 80% 20%, rgba(22, 201, 255, .36), transparent 28%);
}

.hero h2 {
  margin: 0 0 6px;
  font-size: 34px;
  line-height: 1;
  text-transform: uppercase;
}

.hero p {
  max-width: 620px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.shop-tools {
  display: grid;
  grid-template-columns: 160px minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 9px;
  background: white;
  border: 1px solid var(--line);
}

.shop-page-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pager button {
  min-width: 38px;
  padding: 8px 10px;
  font-size: 12px;
}

.category-section {
  margin-bottom: 18px;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: 16px 18px;
  color: white;
  background: linear-gradient(135deg, #061436, var(--blue), var(--magenta));
}

.category-header small {
  font-weight: 900;
  text-transform: uppercase;
}

.category-header h2 {
  margin: 6px 0 0;
  font-size: 24px;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  padding-top: 14px;
}

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

.product-image {
  position: relative;
  min-height: 150px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f8fbff;
}

.product-image.has-image {
  aspect-ratio: 1 / .78;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge,
.stock-badge {
  position: absolute;
  top: 10px;
  padding: 6px 8px;
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.badge {
  left: 10px;
  background: var(--magenta);
}

.stock-badge {
  right: 10px;
  background: var(--navy);
}

.product-meta {
  display: grid;
  gap: 8px;
}

.product-meta small {
  min-height: 26px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.product-meta h3 {
  min-height: 40px;
  margin: 0;
  font-size: 15px;
}

.availability {
  width: max-content;
  padding: 5px 8px;
  color: white;
  background: var(--navy);
  font-size: 11px;
  font-weight: 900;
}

.stars {
  color: #cfd8e6;
  letter-spacing: 0;
}

.price {
  color: var(--ink);
  font-size: 16px;
}

.panel {
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
}

.panel h2,
.panel h3 {
  margin: 0 0 14px;
}

.payment-grid,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(360px, 1.6fr);
  gap: 16px;
  align-items: start;
}

.admin-section,
.reports {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section-head,
.report-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.section-head h3,
.section-head h4,
.report-header h3 {
  margin: 0 0 4px;
}

.compact-head {
  margin-bottom: 10px;
}

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

.report-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.report-card {
  padding: 14px;
  background: #f8fbff;
  border: 1px solid var(--line);
}

.report-card span,
.report-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-card strong {
  display: block;
  margin: 7px 0;
  color: var(--blue);
  font-size: 24px;
}

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

.inventory-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.inventory-row h4 {
  margin: 0 0 4px;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inline-form input {
  min-width: 140px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.admin-pager {
  margin-top: 10px;
}

.support-card {
  color: white;
  background: linear-gradient(135deg, #0b2d78, var(--blue), var(--magenta));
}

.bank-box {
  display: grid;
  margin: 14px 0;
  border: 1px solid var(--line);
}

.bank-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.bank-row:last-child {
  border-bottom: 0;
}

.cart-row,
.list-row,
.license-row,
.topup-row,
.user-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-row h4,
.list-row h4,
.license-row h4,
.topup-row h4,
.user-row h4 {
  margin: 0 0 4px;
}

.cart-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  color: var(--blue);
  background: white;
  font-weight: 900;
}

.total {
  display: flex;
  justify-content: space-between;
  margin: 18px 0;
  padding-top: 16px;
  border-top: 2px solid var(--line);
  font-size: 22px;
  font-weight: 900;
}

.account-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.account-menu {
  display: grid;
  gap: 0;
}

.account-menu button {
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.account-menu button.active {
  color: var(--blue);
}

.quick-grid,
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.quick-card,
.metric {
  min-height: 104px;
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  text-align: left;
  font-weight: 900;
}

.quick-card span,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.metric strong,
.wallet-balance strong {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 28px;
}

.wallet-balance {
  margin-bottom: 16px;
  padding: 28px;
  color: white;
  background: linear-gradient(135deg, #3d38d8, var(--blue));
  text-align: center;
}

.wallet-balance strong {
  color: white;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

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

.stock-input {
  width: 96px;
  padding: 8px;
}

.license-key,
code {
  display: inline-block;
  padding: 6px 8px;
  background: #f8fbff;
  border: 1px solid var(--line);
  white-space: normal;
}

.fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: var(--shadow);
}

.fab img {
  width: 34px;
  height: 34px;
}

@media (max-width: 980px) {
  .auth-shell,
  .shop-shell,
  .payment-grid,
  .admin-grid,
  .account-layout,
  .report-grid,
  .report-cards {
    grid-template-columns: 1fr;
  }

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

  .hero,
  .topbar,
  .bank-row,
  .cart-row,
  .list-row,
  .license-row,
  .topup-row,
  .user-row,
  .inventory-row,
  .section-head,
  .report-header {
    align-items: stretch;
    flex-direction: column;
  }

  .shop-tools {
    grid-template-columns: 1fr;
  }

  .shop-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pager {
    justify-content: flex-start;
  }
}
