:root {
  --bg: #f6f8fb;
  --card: #fff;
  --ink: #111827;
  --muted: #667085;
  --line: #dbe2ea;
  --blue: #2563eb;
  --nav: #0e1726;
  --nav2: #1c2b42;
  --radius: 18px;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans SC",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 20px;
  background: var(--nav);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 13px;
  background: #4f8cff;
  font-weight: 900;
}
.brand-mark.large {
  width: 58px;
  height: 58px;
  margin: auto;
  font-size: 22px;
}
.brand b,
.brand small {
  display: block;
}
.brand b {
  font-size: 14px;
}
.brand small,
.sidebar-foot small {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 12px;
}
.sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 32px;
}
.nav-link {
  min-height: 44px;
  padding: 12px;
  border-radius: 12px;
  color: #cbd5e1;
  font-size: 14px;
}
.nav-link:hover,
.nav-link.active {
  background: var(--nav2);
  color: #fff;
  font-weight: 700;
}
.sidebar-foot {
  position: absolute;
  right: 20px;
  bottom: 24px;
  left: 20px;
  padding-top: 18px;
  border-top: 1px solid #26354b;
}
.sidebar-foot b,
.sidebar-foot small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logout {
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: #93c5fd;
  cursor: pointer;
}
.admin-main {
  min-width: 0;
  padding: 40px;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(16, 20, 27, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 20, 27, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto 28px;
}
.page-head h1,
.form-panel h1 {
  margin: 8px 0 0;
  font-size: 38px;
  line-height: 1.08;
}
.page-head p,
.form-panel > p {
  margin: 10px 0 0;
  color: var(--muted);
}
.eyebrow {
  margin: 0 !important;
  color: var(--blue) !important;
  font-size: 12px !important;
  font-weight: 900;
  letter-spacing: 0.16em;
}
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.button.small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 13px;
}
.button.ghost {
  border-color: transparent;
}
.button.danger {
  border-color: #fecaca;
  color: #b42318;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto 28px;
}
.stats article {
  padding: 20px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.stats span,
.stats small {
  display: block;
  color: var(--muted);
}
.stats strong {
  display: block;
  margin: 12px 0 18px;
  font-size: 38px;
}
.stats small {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.panel {
  max-width: 1180px;
  margin: 0 auto 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.045);
}
.panel-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.panel h2 {
  margin: 0;
}
.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-size: 13px;
}
td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.right {
  text-align: right;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}
.actions form {
  margin: 0;
}
.status {
  display: inline-block;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 12px;
}
.status.on {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: #067647;
}
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.form-panel {
  padding: 28px;
  max-width: 900px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 24px 20px;
  margin-top: 28px;
}
.form-grid label,
.form-stack label {
  display: grid;
  align-content: start;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.form-grid label.full {
  grid-column: 1/-1;
}
.form-grid input,
.form-grid select,
.form-stack input,
textarea {
  display: block;
  width: 100%;
  height: 46px;
  min-height: 46px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fafb;
  line-height: 1.2;
  outline: none;
}
.form-grid input:focus,
.form-grid select:focus,
.form-stack input:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.form-grid input[readonly] {
  border-style: dashed;
  background: #eef2f6;
  color: #667085;
  cursor: not-allowed;
}
.form-grid small {
  min-height: 16px;
  color: var(--muted);
  font-weight: 400;
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.locked-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto 28px;
}
.quick-grid a {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.045);
}
.quick-grid a:hover {
  border-color: #93b4ff;
  transform: translateY(-1px);
}
.quick-grid b {
  font-size: 18px;
}
.quick-grid span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.check {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
}
.check input {
  width: 18px !important;
  height: 18px !important;
}
.back {
  display: block;
  max-width: 1180px;
  margin: 0 auto 20px;
  color: var(--blue);
  font-weight: 700;
}
.merchant-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  max-width: 1180px;
  margin: auto;
}
.merchant-layout .panel {
  max-width: none;
}
.login-share-card {
  padding: 22px;
}
.login-share-card h2 {
  margin: 7px 0 16px;
}
.login-share-card > p:not(.eyebrow) {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}
.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}
.copy-row input,
.share-password-form input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--ink);
}
.login-email {
  display: grid;
  gap: 4px;
  margin: 16px 0;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  overflow-wrap: anywhere;
}
.login-email span,
.security-note {
  color: var(--muted);
  font-size: 11px;
}
.share-password-form {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.share-password-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}
.credentials-ready {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #86efac;
  border-radius: 14px;
  background: #ecfdf3;
}
.credentials-ready p {
  margin: 0 0 10px;
  color: #067647;
  font-size: 12px;
  line-height: 1.5;
}
.credentials-ready textarea {
  height: 150px;
  padding: 10px;
  background: #fff;
  font-size: 12px;
  line-height: 1.5;
  resize: none;
}
.share-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.button.whatsapp {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}
.security-note {
  display: block;
  margin-top: 10px;
  line-height: 1.5;
}
.template-add {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}
.template-add textarea {
  height: 100px;
  padding: 12px;
  resize: vertical;
}
.template-add select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fafb;
  color: var(--ink);
  font-weight: 700;
}
.template-add .button {
  justify-self: end;
}
.template-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
}
.template-row p {
  flex: 1;
  margin: 0;
  line-height: 1.6;
}
.language-badge,
.language-counts span {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.language-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.icon-danger {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: #fee2e2;
  color: #b42318;
  font-size: 20px;
  cursor: pointer;
}
.qr-card {
  padding: 22px;
  text-align: center;
}
.qr-card img {
  display: block;
  width: 210px;
  max-width: 100%;
  margin: 18px auto;
  border-radius: 12px;
}
.qr-card code {
  display: block;
  overflow-wrap: anywhere;
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 12px;
}
.dark-card {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--nav);
  color: #fff;
}
.dark-card > div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
}
.dark-card span {
  padding: 12px 5px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}
.dark-card b,
.dark-card small {
  display: block;
}
.dark-card b {
  font-size: 24px;
}
.dark-card small {
  margin-top: 5px;
  color: #94a3b8;
}
.card-list,
.qr-grid {
  display: grid;
  gap: 14px;
  max-width: 1000px;
  margin: 0 auto;
}
.card-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.card-list h2,
.card-list p {
  margin: 0;
}
.card-list p {
  margin-top: 6px;
  color: var(--muted);
}
.report-panel {
  padding: 20px;
}
.report-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px auto auto;
  align-items: end;
  gap: 12px;
}
.client-report-filter {
  grid-template-columns: minmax(220px, 1fr) auto auto;
}
.report-filters label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.report-filters select,
.report-filters input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fafb;
  color: var(--ink);
}
.report-stats strong {
  font-size: 32px;
}
.review-copy {
  min-width: 320px;
  max-width: 560px;
  white-space: normal;
  line-height: 1.55;
}
.points {
  font-weight: 900;
}
.points.negative {
  color: #b42318;
}
.points.positive {
  color: #067647;
}
.billing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto 28px;
}
.billing-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.045);
}
.billing-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.billing-head h2 {
  margin: 6px 0 0;
}
.balance {
  color: var(--blue);
  font-size: 34px;
  line-height: 1;
  text-align: right;
}
.balance.low {
  color: #b42318;
}
.balance small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.usage-split {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 20px 0;
}
.usage-split span {
  padding: 12px 8px;
  border-radius: 12px;
  background: #f8fafc;
  text-align: center;
}
.usage-split b,
.usage-split small {
  display: block;
}
.usage-split b {
  font-size: 22px;
}
.usage-split small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.topup-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.topup-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.topup-options form {
  margin: 0;
}
.topup-options button {
  width: 100%;
  padding: 10px 5px;
  border: 1px solid #bfdbfe;
  border-radius: 11px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
  cursor: pointer;
}
.topup-options small {
  display: block;
  margin-top: 3px;
  font-size: 9px;
}
.report-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}
.qr-grid {
  grid-template-columns: repeat(3, 1fr);
  max-width: 1180px;
}
.qr-grid .panel {
  width: 100%;
  margin: 0;
}
.login-page,
.public-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card,
.review-card {
  width: min(100%, 460px);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  text-align: center;
}
.login-card h1,
.review-card h1 {
  margin: 16px 0 8px;
  font-size: 32px;
}
.login-card > p,
.review-card > p {
  color: var(--muted);
  line-height: 1.7;
}
.form-stack {
  display: grid;
  gap: 18px;
  margin: 26px 0;
}
.notice {
  max-width: 1180px;
  margin: 0 auto 20px;
  padding: 12px 14px;
  border-radius: 12px;
}
.notice.error {
  background: #fef3f2;
  color: #b42318;
}
.notice.success {
  background: #ecfdf3;
  color: #067647;
}
.language-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 0 0 24px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f1f5f9;
}
.language-switch a {
  padding: 9px 8px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.language-switch a.active {
  background: #fff;
  color: var(--brand, var(--blue));
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}
.merchant-logo {
  display: block;
  width: 92px;
  height: 92px;
  object-fit: contain;
  margin: 0 auto 22px;
  border-radius: 20px;
}
.merchant-logo.placeholder {
  display: grid;
  place-items: center;
  background: #e8efff;
  color: var(--blue);
  font-size: 30px;
  font-weight: 900;
}
.review-card h2 {
  margin: 24px 0 0;
}
.review-button {
  display: flex;
  width: 100%;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  background: var(--brand, var(--blue));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.review-button:disabled {
  opacity: 0.75;
}
.hint,
.fallback {
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8 !important;
}
.fallback blockquote {
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}
.fallback a {
  font-weight: 800;
  text-decoration: underline;
}
.policy {
  margin-top: 22px !important;
  font-size: 13px !important;
}
.public-page {
  align-content: center;
}
.public-page footer {
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
}
.public-page footer a {
  text-decoration: underline;
}
@media (max-width: 900px) {
  .admin-shell {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
  }
  .sidebar nav {
    grid-template-columns: repeat(2, 1fr);
  }
  .sidebar-foot {
    position: relative;
    right: auto;
    bottom: auto;
    left: auto;
    margin-top: 22px;
  }
  .admin-main {
    padding: 24px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .quick-grid {
    grid-template-columns: 1fr;
  }
  .merchant-layout {
    grid-template-columns: 1fr;
  }
  .billing-grid {
    grid-template-columns: 1fr;
  }
  .report-filters {
    grid-template-columns: 1fr 1fr;
  }
  .qr-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 620px) {
  .page-head {
    align-items: stretch;
    flex-direction: column;
  }
  .page-head h1,
  .form-panel h1 {
    font-size: 30px;
  }
  .stats,
  .form-grid,
  .qr-grid {
    grid-template-columns: 1fr;
  }
  .report-filters {
    grid-template-columns: 1fr;
  }
  .form-grid label.full {
    grid-column: auto;
  }
  .actions {
    flex-wrap: wrap;
  }
  .card-list article {
    align-items: flex-start;
    flex-direction: column;
  }
  .login-card,
  .review-card {
    padding: 28px 22px;
  }
  .sidebar nav {
    grid-template-columns: 1fr 1fr;
  }
  .admin-main {
    padding: 20px 14px;
  }
}
