/* ============================================================
   APP-COMMON.CSS — Pola inti bersama halaman non-admin
   (dashboard, order, deposit, ticket, staff, user, price_list,
    api/documentation).
   Dibuat: Fase 2 — lihat fase2.md
   Link: lib/header.php (SETELAH variables.css & sidebar.css)
   ============================================================ */

/* ============================================================
   1. LAYOUT DASAR
   ============================================================ */
.dash-container,
.dash-container
  :not(i):not(.fa):not(.fab):not(.fas):not(.far):not(.fal):not(.fad):not(
    .fat
  ):not(.mdi) {
  font-family:
    "Inter",
    "Segoe UI",
    -apple-system,
    BlinkMacSystemFont,
    Roboto,
    sans-serif !important;
}

.dash-container {
  padding: 10px 0;
}

/* ============================================================
   2. CARD (SAAS-CARD)
   ============================================================ */
.saas-card {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  padding: 24px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.02),
    0 2px 4px -1px rgba(0, 0, 0, 0.01);
  margin-bottom: 24px;
  position: relative;
}
.saas-card {
  overflow: hidden;
}

/* HOF: equal-height card */
.hof-cards-row .saas-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
}

/* ============================================================
   3. HEADER CARD (SAAS-HEADER)
   ============================================================ */
.saas-header {
  font-size: 15px;
  font-weight: 700;
  color: var(--ui-text-main);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  letter-spacing: -0.3px;
}
.saas-header i {
  color: var(--ui-accent);
  font-size: 16px;
}
.saas-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.saas-header-link {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ui-accent);
  text-decoration: none;
  white-space: nowrap;
}

/* ============================================================
   4. FORM ELEMEN
   ============================================================ */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  font-weight: 600;
  color: var(--ui-text-main);
  font-size: 13px;
  margin-bottom: 8px;
  display: block;
}

.form-control {
  height: 34px !important;
  padding: 6px 12px !important;
  font-size: 14px !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: 8px !important;
  color: var(--ui-text-main) !important;
  background-color: #ffffff !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
}
textarea.form-control {
  min-height: 140px !important;
  resize: vertical;
}
/* Ticket reply: shorter textarea inside card */
.saas-card textarea.form-control {
  min-height: 120px !important;
}
.form-control:focus {
  border-color: var(--ui-accent) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
  outline: none !important;
}

/* ============================================================
   5. TOMBOL (BUTTON) — varian utama
   ============================================================ */
.btn-success {
  background: var(--ui-accent) !important;
  border: 1px solid var(--ui-accent) !important;
  color: #ffffff !important;
  height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  padding: 0 16px !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.1) !important;
}
.btn-success:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.2) !important;
}

.btn-danger {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #ef4444 !important;
  height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  padding: 0 16px !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
}
.btn-danger:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
}

/* Tombol "Kembali" abu-abu (ticket/reply) */
.saas-btn-back {
  background: #ffffff !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--ui-text-main) !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  border-radius: 8px !important;
  padding: 8px 16px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.saas-btn-back:hover {
  border-color: var(--ui-accent) !important;
  color: var(--ui-accent) !important;
}

/* ============================================================
   6. BADGE / LABEL STATUS
   ============================================================ */
.saas-badge-success {
  background-color: #f0fdf4 !important;
  color: #16a34a !important;
  border: 1px solid rgba(22, 163, 74, 0.15) !important;
}
.saas-badge-danger {
  background-color: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid rgba(220, 38, 38, 0.15) !important;
}
.saas-badge-warning {
  background-color: #fffbeb !important;
  color: #d97706 !important;
  border: 1px solid rgba(217, 119, 6, 0.15) !important;
}
.saas-badge-info {
  background-color: #f0f9ff !important;
  color: #0284c7 !important;
  border: 1px solid rgba(2, 132, 199, 0.15) !important;
}

/* Dashboard: badge status ringkas */
.saas-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-soft-warning {
  background-color: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
}
.badge-soft-info {
  background-color: #f0f9ff;
  color: #0284c7;
  border-color: #bae6fd;
}
.badge-soft-success {
  background-color: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}
.badge-soft-danger {
  background-color: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.badge-soft-id {
  background-color: var(--ui-accent-light);
  color: var(--ui-accent);
  border: 1px solid rgba(37, 99, 235, 0.15);
  text-decoration: none !important;
}

/* ============================================================
   7. TABEL (SAAS-TABLE) — untuk halaman list
   ============================================================ */
.saas-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0 !important;
  border: 1px solid var(--ui-border);
}
.saas-table th {
  text-align: left;
  padding: 10px 12px !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  color: var(--ui-text-muted) !important;
  border: 1px solid var(--ui-border) !important;
  background-color: var(--ui-bg) !important;
  font-weight: 700 !important;
  letter-spacing: 0.4px;
  white-space: nowrap !important;
}
.saas-table td {
  padding: 8px 12px !important;
  font-size: 13px !important;
  color: var(--ui-text-main) !important;
  border: 1px solid var(--ui-border) !important;
  vertical-align: middle !important;
  line-height: 1.4;
}
.saas-table tr:last-child td {
  border-bottom: 1px solid var(--ui-border) !important;
}
.saas-table tbody tr:nth-child(even) td {
  background-color: var(--ui-bg);
}
.saas-table tbody tr:hover td {
  background-color: var(--ui-accent-light) !important;
}
.saas-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: var(--ui-accent);
  color: #ffffff !important;
  font-size: 13px;
  text-decoration: none !important;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.saas-action-btn:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
}
.saas-table-wrap {
  overflow-x: auto;
}
.table-responsive {
  margin-top: 5px;
  border: none !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 !important;
}

/* Dashboard: tabel ringkas (compact) */
.saas-table-dash th {
  padding: 12px 8px !important;
  font-size: 11px !important;
  letter-spacing: 0.8px !important;
  background: transparent !important;
}
.saas-table-dash td {
  padding: 14px 8px !important;
  font-size: 13px !important;
}

/* HOF: highlight baris peringkat 1 */
.saas-table tr.rank-highlight-1 {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.02) 0%,
    rgba(245, 158, 11, 0.06) 100%
  );
}

/* ============================================================
   8. UTILITY — SAAS-DATE, SAAS-ALERT-INFO, dll
   ============================================================ */
.saas-date {
  font-size: 11px;
  color: var(--ui-text-muted);
  white-space: nowrap;
  line-height: 1.5;
  font-weight: 500;
}
.saas-badge-id {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  background-color: var(--ui-accent-light);
  color: var(--ui-accent);
  border: 1px solid rgba(37, 99, 235, 0.15);
}
.saas-alert-info {
  background-color: var(--ui-accent-light);
  border: 1px solid rgba(37, 99, 235, 0.15);
  color: var(--ui-accent);
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 13.5px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.saas-alert-info i.fa-circle-info {
  flex-shrink: 0;
  margin-top: 2px;
}
.saas-alert-info span {
  flex: 1;
  min-width: 0;
}

/* ============================================================
   9. PAGINATION
   ============================================================ */
/* Versi minimalis ala medanpedia.co.id: nomor polos tanpa kotak
   permanen, aktif jadi pill biru solid, prev/next cuma ikon chevron,
   "..." buat halaman yang di-skip, info "Menampilkan X-Y dari Z data"
   sejajar di kiri. Semua !important: style.css (lama) punya selector
   ".page-item.active .page-link" 3-class yang bisa menang lawan rule
   dengan spesifisitas lebih rendah kalau nggak dikasih !important. */
.saas-pagination-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  margin-top: 16px !important;
}
.saas-pagination-info {
  font-size: 13px !important;
  color: var(--ui-text-muted) !important;
}
.pagination {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  margin: 0 !important;
  padding: 0 !important;
}
.pagination-split li {
  margin-left: 0 !important;
  float: none !important;
  display: inline-flex !important;
}
.page-item {
  margin: 0 !important;
}
.page-item .page-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 0 8px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: var(--ui-text-main) !important;
  background: transparent !important;
  border: none !important;
  border-radius: 8px !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
}
.page-item .page-link:hover {
  background: var(--ui-accent-light) !important;
  color: var(--ui-accent) !important;
}
.page-item.active .page-link {
  background: var(--ui-accent) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25) !important;
}
.page-item .page-link.page-nav {
  color: var(--ui-text-muted) !important;
  font-size: 13px !important;
}
.page-item .page-link.page-dots {
  cursor: default !important;
}
.page-item.disabled .page-link {
  color: var(--ui-text-muted) !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

/* ============================================================
   10. SAAS-INFO-BOX — komponen info box (staff/add_reseller.php)
   ============================================================ */
.saas-info-box {
  background: var(--ui-accent-light);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--ui-text-main);
  line-height: 1.7;
  margin-bottom: 20px;
}
.saas-info-box b {
  color: var(--ui-accent);
}

/* ============================================================
   11. ALERT OUTLINE (order/new.php, deposit/new.php dll)
    ============================================================ */
.saas-alert-outline {
  background-color: var(--ui-accent-light);
  border: 1px solid rgba(37, 99, 235, 0.15);
  color: var(--ui-accent);
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================================================
   12. SPAN SEBAGAI FORM CONTROL (static display)
    ============================================================ */
span.form-control {
  display: flex !important;
  align-items: center !important;
  background-color: var(--ui-bg) !important;
}

/* ============================================================
   13. TEXTAREA-LIKE FORM-CONTROL (description, avgtime)
    ============================================================ */
#description.form-control,
#avgtime.form-control {
  height: auto !important;
  min-height: 60px !important;
  padding: 10px 14px !important;
  background-color: var(--ui-bg) !important;
  border-radius: 8px !important;
  line-height: 1.6 !important;
}
#avgtime.form-control {
  min-height: 34px !important;
  padding: 8px 12px !important;
  white-space: normal !important;
  word-break: break-word !important;
}

/* ============================================================
   14. INPUT GROUP
    ============================================================ */
.input-group {
  display: flex !important;
  align-items: stretch !important;
  width: 100% !important;
}
.input-group-prepend {
  display: flex !important;
}
.input-group-text {
  display: flex !important;
  align-items: center !important;
  padding: 6px 12px !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--ui-text-muted) !important;
  background-color: #f3f4f6 !important;
  border: 1px solid var(--ui-border) !important;
  border-right: none !important;
  border-radius: 8px 0 0 8px !important;
  height: 34px !important;
  box-sizing: border-box !important;
}
.input-group > .form-control {
  border-radius: 0 8px 8px 0 !important;
  flex: 1 1 auto !important;
  width: 1% !important;
}

/* ============================================================
   15. TOMBOL PRIMARY
    ============================================================ */
.btn-primary {
  background: var(--ui-accent) !important;
  border-color: var(--ui-accent) !important;
  color: #ffffff !important;
  height: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.1) !important;
  padding: 0 16px !important;
}
.btn-primary:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.2) !important;
}

/* ============================================================
   16. INFO TEXT BODY (order/new.php — accordion content)
    ============================================================ */
.info-text-body {
  font-size: 13px;
  color: var(--ui-text-main);
  line-height: 1.6;
}
.info-text-body ul {
  padding-left: 20px;
  margin-bottom: 16px;
  margin-top: 8px;
}
.info-text-body li {
  margin-bottom: 6px;
  color: var(--ui-text-muted);
}
.info-text-body b {
  color: var(--ui-text-main);
  font-size: 13.5px;
  display: block;
  margin-top: 15px;
}
.info-text-body b:first-child {
  margin-top: 0;
}
.info-text-body > *:first-child {
  margin-top: 0;
}
.info-text-body p {
  color: var(--ui-text-muted);
  margin-bottom: 10px;
}
.info-ig-title {
  font-size: 13.5px;
  color: var(--ui-text-main) !important;
  margin-bottom: 12px !important;
}
.info-ig-image {
  width: 100%;
  height: auto;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  margin-bottom: 14px;
  display: block;
}
.info-ig-steps {
  padding-left: 20px;
  margin-top: 8px;
  margin-bottom: 10px;
}
.info-ig-steps li {
  margin-bottom: 6px;
  color: var(--ui-text-muted);
}

/* ============================================================
   17. ACCORDION INFO (order/new.php)
    ============================================================ */
.info-accordion {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}
.info-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ui-text-main);
  cursor: pointer;
  user-select: none;
}
.info-accordion-header i.fa-circle-info {
  color: var(--ui-accent);
  margin-right: 8px;
}
.info-toggle-icon {
  color: var(--ui-text-muted);
  font-size: 13px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.info-toggle-icon.active {
  transform: rotate(180deg);
}
.info-accordion-body {
  padding: 0 16px 16px 16px;
}
@media (min-width: 992px) {
  .info-accordion-header {
    cursor: default;
  }
  .info-toggle-icon {
    display: none;
  }
}
@media (max-width: 991.98px) {
  .info-accordion-body {
    display: none;
  }
}

/* ============================================================
   18. MODAL
    ============================================================ */
.modal-content {
  border: none !important;
  border-radius: var(--ui-radius) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
  overflow: hidden !important;
}
.modal-header {
  background: var(--ui-gradient) !important;
  border-bottom: none !important;
  padding: 14px 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}
.modal-title {
  font-weight: 700 !important;
  font-size: 16px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
/* Tombol close bawaan tema lama (style.css) posisinya absolute nempel
   pas di top:0/right:0, jadi kepotong sama border-radius + overflow:hidden
   punya .modal-content di atas. Di-override di sini supaya jadi bagian
   dari flex header, gak pernah numpuk sama sudut modal lagi walau
   radius-nya diganti-ganti nanti. */
.modal .modal-dialog .close {
  position: static !important;
  height: 30px !important;
  width: 30px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: rgba(0, 0, 0, 0.06) !important;
  color: var(--ui-text-muted, #64748b) !important;
  opacity: 1 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  text-shadow: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal .modal-dialog .close:hover {
  background: rgba(0, 0, 0, 0.12) !important;
  color: var(--ui-text-main, #0f172a) !important;
}
.modal-body {
  padding: 20px !important;
  font-size: 13.5px !important;
  line-height: 1.6 !important;
  color: var(--ui-text-main) !important;
}
.modal-footer {
  border-top: none !important;
  padding: 16px 24px !important;
}

/* ============================================================
   19. RADIO LABEL (deposit/new.php)
    ============================================================ */
.radio-label {
  font-weight: 500 !important;
  color: var(--ui-text-main) !important;
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer;
  margin-bottom: 10px !important;
}
.radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ui-accent);
  cursor: pointer;
  margin: 0;
}

/* ============================================================
   20. HIDE UTILITY (deposit/new.php — JS toggle)
    ============================================================ */
.hide {
  display: none !important;
}

/* ============================================================
   21. MIN-AMOUNT INFO (deposit/new.php)
    ============================================================ */
#min-amount {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 500;
}

/* ============================================================
   22. API DOCUMENTATION — STEP NUMBER (saas-step-no)
    ============================================================ */
.saas-step-no {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--ui-accent-light);
  color: var(--ui-accent);
  font-size: 12.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   23. API DOC — HERO SECTION
    ============================================================ */
.doc-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.doc-hero h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ui-text-main);
  margin: 0 0 6px;
  letter-spacing: -0.4px;
}
.doc-hero p {
  font-size: 13.5px;
  color: var(--ui-text-muted);
  margin: 0;
  max-width: 560px;
}
.doc-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.doc-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.pill-post {
  background: var(--ui-accent-light);
  color: var(--ui-accent);
}
.pill-json {
  background: var(--ui-success-light);
  color: var(--ui-success);
}

/* ============================================================
   24. API DOC — QUICK NAV
    ============================================================ */
.doc-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.doc-nav a {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ui-text-main);
  text-decoration: none;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.doc-nav a:hover {
  background: var(--ui-accent-light);
  color: var(--ui-accent);
  border-color: rgba(37, 99, 235, 0.15);
}
.doc-nav a i {
  font-size: 11px;
  color: var(--ui-text-muted);
}

/* ============================================================
   25. API DOC — CREDENTIAL ROW
    ============================================================ */
.cred-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.cred-row:last-child {
  border-bottom: none;
  padding-bottom: 4px;
}
.cred-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ui-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 140px;
}
.cred-value {
  font-size: 13.5px;
  color: var(--ui-text-main);
  font-weight: 600;
  word-break: break-all;
}
.cred-value.mono {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
}
.mono {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
.cred-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================
   26. API DOC — CREDENTIAL BUTTONS
    ============================================================ */
.btn-copy,
.btn-regen,
.btn-view-example {
  border: 1px solid var(--ui-border);
  background: #f8fafc;
  color: var(--ui-text-main);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-copy:hover {
  background: var(--ui-accent-light);
  color: var(--ui-accent);
  border-color: rgba(37, 99, 235, 0.15);
}
.btn-regen {
  background: var(--ui-warning-light);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.2);
}
.btn-regen:hover {
  background: #fde68a;
  color: #92400e;
}
.btn-view-example:hover {
  background: var(--ui-accent-light);
  color: var(--ui-accent);
  border-color: rgba(37, 99, 235, 0.15);
}
.btn-copy.copied {
  background: var(--ui-success-light);
  color: var(--ui-success);
  border-color: rgba(16, 185, 129, 0.2);
}

/* ============================================================
   27. API DOC — CALLOUT
    ============================================================ */
.callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid;
  margin-bottom: 24px;
}
.callout i {
  font-size: 16px;
  margin-top: 1px;
}
.callout-title {
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 4px;
}
.callout-text {
  font-size: 13px;
  line-height: 1.6;
}
.callout-warning {
  background: var(--ui-warning-light);
  border-color: rgba(245, 158, 11, 0.2);
  color: #92400e;
}
.callout-warning i {
  color: #d97706;
}
.callout pre {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  margin: 8px 0 0;
  overflow-x: auto;
}

/* ============================================================
   28. API DOC — TABLE INLINE CODE
    ============================================================ */
table.saas-table tbody td code {
  background: var(--ui-accent-light);
  color: var(--ui-accent);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
}

/* ============================================================
   29. API DOC — RESPONSE LABELS
    ============================================================ */
.resp-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.resp-label.ok {
  color: var(--ui-success);
}
.resp-label.fail {
  color: var(--ui-danger);
}

/* ============================================================
   30. API DOC — CODE BLOCK
    ============================================================ */
.code-block {
  background: #f8fafc;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.75;
  color: #334155;
  position: relative;
  margin: 0;
}
.code-block .tok-key {
  color: #2563eb;
}
.code-block .tok-str {
  color: #15803d;
}
.code-block .tok-num {
  color: #b45309;
}
.code-block .tok-bool {
  color: #b91c1c;
}
.code-block .tok-punc {
  color: #94a3b8;
}
.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ffffff;
  border: 1px solid var(--ui-border);
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.code-copy-btn:hover {
  background: var(--ui-accent-light);
  color: var(--ui-accent);
  border-color: rgba(37, 99, 235, 0.15);
}

/* ============================================================
   31. API DOC — MESSAGE LIST
    ============================================================ */
.msg-list {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--ui-text-muted);
  line-height: 1.9;
}
.msg-list li b {
  color: var(--ui-text-main);
}

/* ============================================================
   32. API DOC — STATUS CHIPS
    ============================================================ */
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  margin: 2px 4px 2px 0;
}
.chip-pending {
  background: #f1f5f9;
  color: #64748b;
}
.chip-processing {
  background: var(--ui-info-light);
  color: var(--ui-info);
}
.chip-partial {
  background: var(--ui-warning-light);
  color: #b45309;
}
.chip-error {
  background: var(--ui-danger-light);
  color: #b91c1c;
}
.chip-success {
  background: var(--ui-success-light);
  color: #15803d;
}

/* ============================================================
   33. API DOC — ENDPOINT GRID
    ============================================================ */
.endpoint-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.endpoint-grid > div {
  flex: 1 1 320px;
  min-width: 0;
}

/* ============================================================
   34. API DOC — OVERRIDE font-family untuk code/pre
    ============================================================ */
.dash-container code,
.dash-container pre {
  font-family:
    "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace !important;
}

/* ============================================================
   35. DASHBOARD — STAT CARDS
    ============================================================ */
.saas-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-card-balance {
  background: linear-gradient(135deg, #ffffff 60%, #f0f7ff 100%);
}
.stat-card-orders {
  background: linear-gradient(135deg, #ffffff 60%, #f0f7ff 100%);
}
.stat-card-month {
  background: linear-gradient(135deg, #ffffff 60%, #fffbeb 100%);
}

.saas-stat-info h4 {
  font-size: 11.5px;
  color: var(--ui-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0 0 8px;
  font-weight: 700;
}
.saas-stat-info h2 {
  font-size: 22px;
  color: var(--ui-text-main);
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.saas-stat-info p {
  font-size: 12.5px;
  color: var(--ui-text-muted);
  margin: 6px 0 0;
  font-weight: 500;
}

.saas-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}
.icon-blue {
  background: var(--ui-accent-light);
  color: var(--ui-accent);
}
.icon-green {
  background: var(--ui-success-light);
  color: var(--ui-success);
}
.icon-amber {
  background: var(--ui-warning-light);
  color: var(--ui-warning);
}

/* ============================================================
   36. DASHBOARD — PROFILE WIDGET
    ============================================================ */
.saas-profile {
  text-align: center;
  padding: 0 0 24px 0 !important;
  overflow: hidden;
}
.profile-cover {
  height: 75px;
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
  width: 100%;
  position: relative;
}
.profile-avatar-container {
  margin-top: -38px;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
  z-index: 2;
}
.saas-profile img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.saas-profile h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 800;
  color: var(--ui-text-main);
  letter-spacing: -0.3px;
}
.saas-profile p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ui-text-muted);
  font-weight: 600;
}
.saas-badge-status {
  background: #f1f5f9;
  border: 1px solid var(--ui-border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ui-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   37. DASHBOARD — QUICK LINKS
    ============================================================ */
.saas-link-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.saas-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--ui-text-main);
  text-decoration: none;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  font-size: 13px;
  font-weight: 600;
}
.saas-link-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.saas-link i.link-icon {
  color: var(--ui-text-muted);
  font-size: 15px;
  width: 20px;
  text-align: center;
}
.saas-link i.arrow-icon {
  color: #cbd5e1;
  font-size: 11px;
}

/* ============================================================
   38. DASHBOARD — CHART OVERFLOW GUARD
    ============================================================ */
#last-order-chart {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
#last-order-chart svg {
  max-width: 100% !important;
}

/* ============================================================
   39. FAQ PAGE (landing, non-admin)
    ============================================================ */
.saas-faq-section {
  background-position: 0 0;
  min-height: calc(100vh - 200px);
  padding: 120px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.saas-faq-container {
  position: relative;
  z-index: 10;
  max-width: 900px;
  width: 100%;
}
.saas-faq-header {
  text-align: center;
  margin-bottom: 40px;
}
.saas-faq-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.04),
    0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 40px;
  border: 1px solid #f1f5f9;
}
.saas-faq-footer {
  text-align: center;
  margin-top: 30px;
}
.saas-faq-footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--mp-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 10px;
  background: rgba(13, 110, 253, 0.08);
}
.saas-faq-footer a:hover {
  background: rgba(13, 110, 253, 0.15);
  text-decoration: none;
}
@media (max-width: 991px) {
  .saas-faq-section {
    padding-top: 100px;
    padding-bottom: 40px;
  }
  .saas-faq-header h1 {
    font-size: 26px;
  }
  .saas-faq-card {
    padding: 24px 20px;
  }
}

/* ============================================================
   40. TOS PAGE (landing, non-admin)
    ============================================================ */
.saas-tos-section {
  min-height: calc(100vh - 200px);
  padding: 120px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.saas-tos-container {
  position: relative;
  z-index: 10;
  max-width: 900px;
  width: 100%;
}
.saas-tos-header {
  text-align: center;
  margin-bottom: 40px;
}
.saas-tos-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.04),
    0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 40px;
  border: 1px solid #f1f5f9;
}
.saas-tos-footer {
  text-align: center;
  margin-top: 30px;
}
.saas-tos-footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--mp-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 10px;
  background: rgba(13, 110, 253, 0.08);
  transition: all 0.2s ease;
}
.saas-tos-footer a:hover {
  background: rgba(13, 110, 253, 0.15);
  text-decoration: none;
}
@media (max-width: 991px) {
  .saas-tos-section {
    padding-top: 100px;
    padding-bottom: 40px;
  }
  .saas-tos-header h1 {
    font-size: 26px;
  }
  .saas-tos-card {
    padding: 24px 20px;
  }
}

/* ============================================================
   41. HALL OF FAME (HOF)
    ============================================================ */
.hof-title-section {
  margin-bottom: 20px;
  margin-top: 0;
}
.hof-title-section h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ui-text-main);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.hof-title-section h3 i {
  color: #f59e0b;
}
.hof-title-section p {
  font-size: 13px;
  color: var(--ui-text-muted);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
  font-weight: 500;
}
.hof-cards-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}
.hof-cards-row > [class*="col-"] {
  display: flex;
}

.saas-empty {
  text-align: center;
  padding: 32px 14px;
  color: var(--ui-text-muted);
  font-size: 13px;
}

.rank-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.rank-1 {
  background-color: #fef3c7;
  color: #d97706;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.15);
  border: 1px solid rgba(217, 119, 6, 0.1);
}
.rank-2 {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid rgba(71, 85, 105, 0.1);
}
.rank-3 {
  background-color: #ffedd5;
  color: #c2410c;
  border: 1px solid rgba(194, 65, 12, 0.1);
}
.rank-other {
  background-color: #f8fafc;
  color: var(--ui-text-muted);
  border: 1px solid var(--ui-border);
}

/* ============================================================
   42. TICKET REPLY — THREAD / BUBBLE
    ============================================================ */
.saas-thread {
  max-height: 400px;
  overflow: auto;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  padding: 16px;
  background: var(--ui-bg);
  margin-bottom: 20px;
}
.saas-bubble {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  color: var(--ui-text-main) !important;
  font-size: 13.5px;
  border: 1px solid transparent;
}
.saas-bubble:last-child {
  margin-bottom: 0;
}
.saas-bubble-owner {
  background: #ffffff;
  border-color: var(--ui-border);
}
.saas-bubble-admin {
  background: var(--ui-success-light);
  border-color: rgba(16, 185, 129, 0.15);
}
.saas-bubble-user {
  background: var(--ui-info-light);
  border-color: rgba(2, 132, 199, 0.15);
}
.saas-bubble-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.saas-bubble-sender {
  font-weight: 700;
  font-size: 12.5px;
}
.saas-bubble-time {
  font-size: 11px;
  color: var(--ui-text-muted);
  font-weight: 500;
}
.saas-bubble-msg {
  margin: 0;
  overflow: auto;
  line-height: 1.5;
}