:root {
  --green: #00a884;
  --green-dark: #008069;
  --dark: #111b21;
  --panel: #f0f2f5;
  --line: #d1d7db;
  --text: #111b21;
  --muted: #667781;
  --white: #ffffff;
  --bubble: #d9fdd3;
  --chat-bg: #efeae2;
  --danger: #d93025;
  --shadow: 0 8px 28px rgba(0,0,0,.18);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(#00a884 0 130px, #e9edef 130px);
  color: var(--text);
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 330px 1fr;
  max-width: 1320px;
  margin: 24px auto;
  height: calc(100vh - 48px);
  box-shadow: var(--shadow);
  background: #fff;
  overflow: hidden;
}

.wa-sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.wa-brand {
  height: 72px;
  background: var(--panel);
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.wa-brand small,
.mobile-brand small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
}

.wa-sidebar nav {
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.wa-sidebar nav a {
  padding: 15px 16px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  color: #263238;
  margin-bottom: 4px;
  transition: .18s ease;
}

.wa-sidebar nav a:hover {
  background: #f5f6f6;
  transform: translateX(2px);
}

.side-note {
  margin-top: auto;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.wa-main {
  overflow: auto;
  background:
    radial-gradient(circle at top left, rgba(0,168,132,.09), transparent 28%),
    var(--chat-bg);
}

.topbar {
  min-height: 72px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h2 {
  margin: 0;
  font-size: 22px;
}

.topbar small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.content {
  padding: 24px;
  max-width: 1080px;
}

.card {
  background: #fff;
  border: 1px solid rgba(209,215,219,.9);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.card h2 {
  margin-top: 0;
}

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

.btn,
button {
  background: var(--green);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: .18s ease;
}

.btn:hover,
button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.btn.secondary,
button.secondary {
  background: #e9edef;
  color: #111b21;
}

.btn.secondary:hover,
button.secondary:hover {
  background: #dfe5e7;
}

.btn.ghost {
  background: transparent;
  color: var(--green-dark);
  border: 1px solid rgba(0,128,105,.25);
}

.btn.danger,
button.danger {
  background: var(--danger);
}

.inline {
  display: inline-block;
  margin: 3px;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  margin: 6px 0 14px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,168,132,.12);
}

label {
  font-weight: 700;
  display: block;
}

.note {
  background: #f0f2f5;
  border-left: 4px solid var(--green);
  padding: 12px;
  color: #3b4a54;
  line-height: 1.4;
  border-radius: 10px;
}

.error {
  background: #ffe9e6;
  color: #b00020;
  padding: 12px;
  border-radius: 10px;
}

.chat-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 0;
  min-height: 600px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.device-list {
  background: #fff;
  border-right: 1px solid var(--line);
}

.device-head {
  height: 60px;
  background: var(--panel);
  padding: 16px;
  font-weight: 800;
}

.device-row {
  display: block;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  transition: .15s ease;
}

.device-row:hover {
  background: #f8fafa;
}

.device-row b {
  display: block;
}

.status {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.chat-pane {
  background:
    linear-gradient(rgba(239,234,226,.9), rgba(239,234,226,.9)),
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(0,0,0,.015) 12px 13px);
  display: flex;
  flex-direction: column;
}

.chat-head {
  height: 60px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.qr-box {
  margin: auto;
  background: #fff;
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  max-width: 440px;
  width: calc(100% - 32px);
  box-shadow: 0 4px 18px rgba(0,0,0,.08);
}

.qr {
  width: 280px;
  max-width: 100%;
  image-rendering: pixelated;
  border-radius: 12px;
}

.bubble {
  background: var(--bubble);
  padding: 12px 14px;
  border-radius: 12px 12px 4px 12px;
  display: inline-block;
  margin: 10px 0;
  text-align: left;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.table-wrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid #e9edef;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel);
  color: #3b4a54;
}

.code {
  background: #111b21;
  color: #e9edef;
  border-radius: 12px;
  padding: 14px;
  overflow: auto;
  line-height: 1.5;
}

.qris {
  max-width: 280px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* HOME */

.hero {
  padding: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 420px;
  gap: 28px;
  align-items: center;
}

.hero-card {
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 28px;
  padding: 34px;
  box-shadow: 0 12px 35px rgba(0,0,0,.10);
  backdrop-filter: blur(8px);
}

.hero-badge {
  display: inline-flex;
  width: fit-content;
  background: rgba(0,168,132,.12);
  color: var(--green-dark);
  border: 1px solid rgba(0,168,132,.18);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 44px;
  line-height: 1.08;
  margin: 0 0 16px;
  max-width: 780px;
  letter-spacing: -1px;
}

.hero p {
  font-size: 18px;
  max-width: 700px;
  color: #3b4a54;
  line-height: 1.6;
}

.price-box {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: #f7fbfa;
  border: 1px solid rgba(0,168,132,.20);
  border-radius: 20px;
  padding: 18px;
  margin: 24px 0;
}

.price-box small {
  color: var(--muted);
  font-weight: 700;
}

.price-main {
  font-size: 34px;
  font-weight: 900;
  color: var(--green-dark);
  margin-top: 4px;
}

.price-main span {
  font-size: 15px;
  color: var(--muted);
  margin-left: 4px;
}

.price-old {
  color: var(--muted);
  margin-top: 4px;
  font-weight: 700;
}

.price-old s {
  color: #d93025;
  text-decoration-thickness: 2px;
}

.discount-pill {
  background: var(--green);
  color: white;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.phone-preview {
  background: #fff;
  border-radius: 30px;
  padding: 12px;
  box-shadow: 0 18px 45px rgba(0,0,0,.22);
  overflow: hidden;
  border: 8px solid #101820;
}

.phone-head {
  background: var(--panel);
  border-radius: 20px 20px 0 0;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-head small {
  display: block;
  color: var(--green-dark);
  margin-top: 3px;
}

.phone-chat {
  min-height: 380px;
  background:
    linear-gradient(rgba(239,234,226,.92), rgba(239,234,226,.92)),
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(0,0,0,.018) 12px 13px);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 82%;
  padding: 11px 13px;
  border-radius: 14px;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0,0,0,.07);
  font-size: 14px;
}

.chat-bubble.left {
  background: #fff;
  border-radius: 14px 14px 14px 4px;
  align-self: flex-start;
}

.chat-bubble.right {
  background: var(--bubble);
  border-radius: 14px 14px 4px 14px;
  align-self: flex-end;
}

.phone-input {
  background: var(--panel);
  border-radius: 0 0 20px 20px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.home-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 0 46px 46px;
}

.feature-card p {
  color: var(--muted);
  line-height: 1.5;
}

/* API KEY COPY BOX */

.api-key-box {
  border: 2px solid #111;
  padding: 14px;
  margin: 14px 0;
  background: #fff;
  border-radius: 12px;
}

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

.copy-row input {
  flex: 1;
  min-width: 260px;
  border: 2px solid #111;
  padding: 10px;
  font-family: monospace;
  font-size: 14px;
  background: #f8f8f8;
}

/* MOBILE */

.mobile-appbar,
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  body {
    background: #e9edef;
    padding: 0;
  }

  .mobile-appbar {
    height: 64px;
    background: var(--green-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    position: sticky;
    top: 0;
    z-index: 30;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-brand .avatar {
    background: rgba(255,255,255,.22);
  }

  .mobile-brand small {
    color: rgba(255,255,255,.82);
  }

  .mobile-login-btn {
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    background: rgba(255,255,255,.16);
    padding: 8px 12px;
    border-radius: 999px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    margin: 0;
    height: calc(100vh - 64px);
    box-shadow: none;
    overflow: visible;
  }

  .wa-sidebar {
    display: none;
  }

  .wa-main {
    padding-bottom: 82px;
    background: var(--chat-bg);
  }

  .topbar {
    min-height: 60px;
    padding: 12px 16px;
    top: 0;
  }

  .topbar h2 {
    font-size: 19px;
  }

  .content {
    padding: 14px;
  }

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

  .card {
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
  }

  .chat-layout {
    grid-template-columns: 1fr;
    min-height: auto;
    border-radius: 16px;
  }

  .device-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .device-head {
    height: auto;
    padding: 13px 14px;
  }

  .device-row {
    padding: 13px 14px;
  }

  .chat-pane {
    min-height: 420px;
  }

  .chat-head {
    height: auto;
    padding: 10px 14px;
  }

  .qr-box {
    margin: 22px auto;
    padding: 20px;
    width: calc(100% - 24px);
  }

  .qr {
    width: 230px;
  }

  table {
    min-width: 650px;
  }

  .card > table {
    display: block;
    overflow-x: auto;
  }

  .hero {
    padding: 16px;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .hero-card {
    padding: 22px;
    border-radius: 24px;
  }

  .hero h1 {
    font-size: 31px;
    letter-spacing: -.5px;
  }

  .hero p {
    font-size: 16px;
  }

  .price-box {
    align-items: flex-start;
    flex-direction: column;
  }

  .price-main {
    font-size: 30px;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }

  .phone-preview {
    border-width: 6px;
    border-radius: 26px;
  }

  .phone-chat {
    min-height: 300px;
  }

  .home-features {
    grid-template-columns: 1fr;
    padding: 0 16px 90px;
    gap: 12px;
  }

  input,
  select,
  textarea,
  button,
  .btn {
    font-size: 15px;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 66px;
    background: #fff;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 18px rgba(0,0,0,.08);
  }

  .mobile-bottom-nav a {
    text-decoration: none;
    color: #3b4a54;
    font-size: 11px;
    font-weight: 800;
    display: grid;
    gap: 3px;
    place-items: center;
    min-width: 54px;
  }

  .mobile-bottom-nav span {
    font-size: 20px;
    line-height: 1;
  }
}

@media (max-width: 420px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar .btn {
    width: 100%;
    text-align: center;
  }

  .hero h1 {
    font-size: 28px;
  }

  .price-main {
    font-size: 28px;
  }

  .copy-row input {
    min-width: 100%;
  }

  .inline,
  .inline button {
    width: 100%;
  }
}
.api-section-title {
  margin-top: 34px;
  border-left: 5px solid var(--green);
}

@media (max-width: 900px) {
  .api-section-title {
    margin-top: 22px;
  }

  .code {
    font-size: 12px;
    white-space: pre;
  }
}
.qr-refresh-note {
  margin-top: 14px;
}

.report-status {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-status.sent {
  background: #d9fdd3;
  color: #008069;
}

.report-status.failed {
  background: #ffe9e6;
  color: #b00020;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .btn-sm {
    width: 100%;
    text-align: center;
  }
}

.avatar-img {
  overflow: hidden;
  background: #25d366;
}

.avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}