:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --warn: #d97706;
  --warn-light: #fef3c7;
  --info: #2563eb;
  --info-light: #dbeafe;
  --radius: 10px;
  --sidebar-w: 230px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a { color: inherit; }

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-logo .dot {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}

.login-logo strong { font-size: 17px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }

.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }
@media (max-width: 640px) { .field-row { flex-direction: column; gap: 0; } }

input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea { resize: vertical; min-height: 80px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: white;
  transition: background 0.15s;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: #f3f4f6; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.error-text { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }
.hint-text { color: var(--text-muted); font-size: 12px; margin-top: 6px; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: #0f172a;
  color: #cbd5e1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
  color: white;
}
.sidebar-logo-img {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
}
.sidebar-logo-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sidebar-logo strong { font-size: 15px; }
.sidebar-logo-link {
  font-size: 11px; color: #64748b; text-decoration: none;
}
.sidebar-logo-link:hover { color: #94a3b8; text-decoration: underline; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 2px;
}
.nav-item:hover { background: #1e293b; color: white; }
.nav-item.active { background: var(--primary); color: white; }
.nav-item.nav-item-indent { padding-left: 26px; }
.nav-item.nav-item-subindent { padding-left: 40px; font-size: 12.5px; }
.nav-item.nav-parent { display: flex; align-items: center; justify-content: space-between; }
.nav-item.nav-parent.active-parent { color: white; }
.nav-chevron { font-size: 9px; opacity: .65; }

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  padding: 14px 12px 6px;
}
.nav-item:first-child, .nav-section-label:first-child { margin-top: 0; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #1e293b;
}
.sidebar-user { font-size: 12px; color: #94a3b8; padding: 0 8px 8px; }
.sidebar-user strong { color: white; display: block; font-size: 13px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 { font-size: 18px; margin: 0; }

.content { padding: 24px 28px; flex: 1; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.stat-card .value { font-size: 24px; font-weight: 700; }

/* ---------- Panel / table ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-header h2 { font-size: 15px; margin: 0; }
.panel-body { padding: 18px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 18px; color: var(--text-muted); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.empty-row td { text-align: center; color: var(--text-muted); padding: 32px 18px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-green { background: var(--primary-light); color: var(--primary-dark); }
.badge-yellow { background: var(--warn-light); color: var(--warn); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-gray { background: #f3f4f6; color: var(--text-muted); }
.badge-blue { background: var(--info-light); color: var(--info); }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal {
  background: white; border-radius: var(--radius); padding: 24px; width: 100%; max-width: 420px;
  max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin: 0 0 16px; font-size: 16px; }
.modal-close { float: right; cursor: pointer; color: var(--text-muted); font-size: 20px; line-height: 1; }

.qr-box { text-align: center; padding: 8px 0; }
.qr-box img { width: 220px; height: 220px; border: 1px solid var(--border); border-radius: 8px; }
.qr-status { margin-top: 12px; font-size: 13px; color: var(--text-muted); }

.form-row { display: flex; gap: 10px; }
.form-row > * { flex: 1; }

.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 100;
  background: #111827; color: white; padding: 11px 18px; border-radius: 8px; font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.toast.error { background: var(--danger); }

.checkbox-list { display: flex; flex-direction: column; gap: 8px; max-height: 140px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.checkbox-list label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; }
.checkbox-list input { width: auto; }

.text-muted { color: var(--text-muted); }
.api-token-box {
  background: #f3f4f6; border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, monospace;
  font-size: 12px; word-break: break-all; margin-top: 8px;
}

.login-sub { color: var(--text-muted); font-size: 13px; margin: -8px 0 18px; }
.login-footer { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 18px; }
.login-footer a { color: var(--primary); font-weight: 600; text-decoration: none; }
.success-box {
  background: var(--primary-light); color: var(--primary-dark); border-radius: 8px;
  padding: 16px 18px; font-size: 13px;
}
.success-box strong { display: block; margin-bottom: 6px; font-size: 14px; }
.success-box p { margin: 0; }

/* ---------- Billing: usage banner & usage bar ---------- */
.usage-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--warn-light); color: #92400e; border: 1px solid #fde68a;
  border-radius: var(--radius); padding: 12px 18px; margin-bottom: 18px; font-size: 13px;
}
.usage-banner.danger { background: var(--danger-light); color: #991b1b; border-color: #fecaca; }
.usage-banner strong { display: block; margin-bottom: 2px; }

.usage-bar-wrap { margin-bottom: 4px; }
.usage-bar-track { background: #f3f4f6; border-radius: 999px; height: 8px; overflow: hidden; }
.usage-bar-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width 0.2s; }
.usage-bar-fill.over { background: var(--warn); }
.usage-bar-label { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.balance-negative { color: var(--danger); font-weight: 700; }
.balance-positive { color: var(--primary-dark); font-weight: 700; }

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.mobile-menu-btn svg { width: 20px; height: 20px; }
.sidebar-backdrop { display: none; }

@media (max-width: 720px) {
  .app-shell { flex-direction: column; }

  .mobile-menu-btn { display: flex; }
  .topbar { gap: 12px; }

  /* Sidebar jadi drawer yang nutup layar (overlay), digeser masuk dari
     kiri pas tombol hamburger diklik - bukan baris horizontal lagi,
     soalnya menu ada ~30 item, gak muat/gak kepake kalau dipaksa jadi
     satu baris scroll ke samping. */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 82vw;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 60;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .usage-banner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Landing page ---------- */
body.landing { background: var(--bg); }

.lp-topbar {
  height: 5px;
  background: #0f1115;
  position: sticky;
  top: 0;
  z-index: 11;
}
.lp-nav {
  position: sticky;
  top: 5px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.lp-nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}
.lp-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #0f1115; }
.lp-brand strong { font-size: 17px; font-weight: 800; letter-spacing: -0.2px; }

.lp-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: #0f1115;
  cursor: pointer;
}
.lp-hamburger:hover { background: var(--bg); }
.lp-hamburger svg { width: 20px; height: 20px; }

.lp-nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 4px;
  min-width: 190px;
}
.lp-nav-menu.open { display: flex; }
.lp-nav-menu a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  padding: 9px 10px;
  border-radius: 6px;
}
.lp-nav-menu a:hover { background: var(--bg); }
.lp-nav-menu a.btn,
.lp-nav-menu a.btn-outline {
  text-align: center;
  margin-top: 2px;
}

.btn-outline { background: transparent; color: var(--primary-dark); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-lg { padding: 12px 22px; font-size: 15px; }

.lp-hero { padding: 56px 20px 40px; }
.lp-hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  gap: 48px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.lp-hero-copy { flex: 1 1 420px; min-width: 280px; padding-top: 12px; }
.lp-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin: 0 0 10px;
}
.lp-hero-copy h1 { font-size: 40px; line-height: 1.15; margin: 0 0 16px; color: var(--text); }
.lp-hero-sub { font-size: 16px; color: var(--text-muted); margin: 0 0 24px; max-width: 480px; }
.lp-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.lp-hero-note { font-size: 13px; color: var(--text-muted); }
.lp-hero-form { flex: 0 1 380px; min-width: 300px; }
.lp-hero-form .login-card { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); }

.lp-features {
  padding: 48px 20px 60px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.lp-section-inner { max-width: 1120px; margin: 0 auto; }
.lp-features h2 { text-align: center; font-size: 28px; margin: 0 0 6px; }
.lp-section-sub { text-align: center; color: var(--text-muted); margin: 0 0 36px; }
.lp-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.lp-feature-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; background: var(--bg); }
.lp-feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.lp-feature-icon svg { width: 22px; height: 22px; }
.lp-feature-card h3 { font-size: 15px; margin: 0 0 8px; }
.lp-feature-card p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.5; }

.lp-footer { padding: 24px 20px; }
.lp-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.lp-footer-inner a { color: var(--text-muted); text-decoration: none; }
.lp-footer-inner a:hover { text-decoration: underline; }

/* ---------- Fungsi: use-case chips ---------- */
.lp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 32px;
}
.lp-chip {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid transparent;
}

/* ---------- Kelebihan ---------- */
.lp-why { padding: 48px 20px 56px; }
.lp-why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.lp-why-card { text-align: left; }
.lp-why-card h3 { font-size: 15px; margin: 0 0 8px; }
.lp-why-card p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* ---------- Paket & Harga ---------- */
.lp-pricing {
  padding: 48px 20px 40px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.lp-pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  max-width: 760px;
  margin: 0 auto;
}
.lp-price-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.lp-price-highlight {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.12);
}
.lp-price-card h3 { font-size: 16px; margin: 0 0 10px; }
.lp-price-amount { font-size: 30px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.lp-price-amount span { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.lp-price-desc { font-size: 13px; color: var(--text-muted); margin: 0 0 16px; line-height: 1.5; }
.lp-price-list { list-style: none; padding: 0; margin: 0 0 20px; flex: 1; }
.lp-price-list li {
  font-size: 13px;
  color: var(--text);
  padding: 7px 0 7px 22px;
  position: relative;
  border-top: 1px solid var(--border);
}
.lp-price-list li:first-child { border-top: none; }
.lp-price-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(-45deg);
}
.lp-price-note { text-align: center; font-size: 12px; color: var(--text-muted); margin: 24px auto 0; max-width: 640px; }

/* ---------- FAQ ---------- */
.lp-faq { padding: 48px 20px 60px; }
.lp-faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.lp-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  background: var(--panel);
}
.lp-faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lp-faq-item summary::-webkit-details-marker { display: none; }
.lp-faq-item summary::after {
  content: "+";
  font-size: 18px;
  color: var(--text-muted);
  margin-left: 12px;
  flex-shrink: 0;
}
.lp-faq-item[open] summary::after { content: "\2212"; }
.lp-faq-item p { font-size: 13px; color: var(--text-muted); margin: 12px 0 0; line-height: 1.6; }

@media (max-width: 900px) {
  .lp-feature-grid { grid-template-columns: repeat(2, 1fr); }
  .lp-why-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .lp-hero-copy h1 { font-size: 30px; }
  .lp-feature-grid { grid-template-columns: 1fr; }
  .lp-hero-inner { gap: 28px; }
  .lp-why-grid { grid-template-columns: 1fr; }
  .lp-pricing-grid { grid-template-columns: 1fr; }
}
