*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { font-size: 17px; font-weight: 700; color: #1a1a2e; text-decoration: none; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: #4f46e5;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: background .2s;
}
.btn-primary:hover { background: #4338ca; }
.btn-primary.btn-large { padding: 14px 32px; font-size: 16px; }

.btn-outline {
  background: transparent;
  color: #4f46e5;
  border: 1.5px solid #4f46e5;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}
.btn-outline:hover { background: #f0f2ff; }

/* ── Landing ─────────────────────────────────────────────────────────────── */
.hero {
  max-width: 640px;
  margin: 80px auto;
  padding: 0 24px;
  text-align: center;
}

.hero h1 { font-size: 40px; font-weight: 800; line-height: 1.2; margin-bottom: 20px; }
.hero-sub { color: #555; font-size: 17px; line-height: 1.7; margin-bottom: 36px; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  max-width: 860px;
  margin: 0 auto 60px;
  padding: 0 24px;
}

.feature {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.feature-icon { font-size: 32px; margin-bottom: 12px; }
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { color: #666; font-size: 14px; line-height: 1.6; }

/* ── Pricing section (landing) ───────────────────────────────────────────── */
.pricing {
  max-width: 760px;
  margin: 32px auto 0;
  padding: 0 24px;
  text-align: center;
}
.pricing h2 { font-size: 22px; margin-bottom: 8px; }
.pricing-intro { color: #666; font-size: 15px; margin-bottom: 16px; }
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 auto 12px;
  font-size: 15px;
}
.pricing-table th,
.pricing-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}
.pricing-table th { background: #f9fafb; font-weight: 600; }
.pricing-note { color: #555; font-size: 13px; line-height: 1.6; }

.footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: #888;
}

.footer a { color: #4f46e5; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ── App dashboard ───────────────────────────────────────────────────────── */
.main {
  max-width: 860px;
  margin: 32px auto;
  padding: 0 24px;
}

.welcome {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
}

.kyc-banner {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.kyc-banner p { color: #92400e; font-size: 14px; }

.empty-state {
  background: #fff;
  border-radius: 12px;
  padding: 60px 32px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h2 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: #666; font-size: 14px; margin-bottom: 24px; }

/* ── Docs ────────────────────────────────────────────────────────────────── */
.docs-content {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 24px 60px;
}

.docs-content h1 { font-size: 28px; margin-bottom: 8px; }
.version { color: #888; font-size: 13px; margin-bottom: 32px; }
.docs-content h2 { font-size: 18px; margin: 28px 0 10px; }
.docs-content p, .docs-content li { color: #444; line-height: 1.7; font-size: 15px; }
.docs-content ul { padding-left: 24px; margin: 8px 0; }
.docs-content li { margin-bottom: 6px; }
.footer-nav { margin-top: 40px; }
.footer-nav a { color: #4f46e5; text-decoration: none; font-size: 14px; }
.footer-nav a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* ── Admin review queue (used by static/admin.html) ──────────────────────── */
.muted { color: #6b7280; font-size: 14px; line-height: 1.6; }

.cobranca-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.cobranca-row {
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cobranca-row .muted { color: #6b7280; font-size: 14px; }

.btn-danger {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 9px 14px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.btn-danger:hover { background: #b91c1c; }
.btn-danger:disabled { opacity: 0.6; cursor: not-allowed; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal-content {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  max-width: 560px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #6b7280;
}
.modal-body { margin: 12px 0 16px; font-size: 14px; }
.modal-body dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.modal-body dt { color: #6b7280; font-weight: 500; }
.modal-body dd { margin: 0; color: #111827; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions button { flex: 1; }
#rejectForm { margin-top: 16px; }
#rejectForm label { display: block; font-size: 14px; margin-bottom: 6px; }
.refund-error {
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.4;
}
.btn-retry-refund { margin-left: 6px; }

#rejectForm textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  margin-bottom: 10px;
  box-sizing: border-box;
}

/* ── Dashboard header ────────────────────────────────────────────────────── */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.dashboard-header .welcome { margin-bottom: 0; }

/* ── Status banner ───────────────────────────────────────────────────────── */
.status-banner {
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}
.status-banner-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.status-banner-warn    { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }

/* ── Nova Cobrança form card ─────────────────────────────────────────────── */
.form-card {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.form-title { font-size: 18px; font-weight: 700; margin-bottom: 24px; }

.form-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b7280;
  margin: 20px 0 12px;
}
.form-section-label:first-of-type { margin-top: 0; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 13px; font-weight: 600; color: #374151; }
.form-group input,
.form-group textarea,
.form-group select {
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  color: #1a1a2e;
  background: #fff;
  transition: border-color .15s;
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,.08);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.required { color: #ef4444; }

/* ── Phone field (DDI select + number input) ─────────────────────────────── */
.phone-group { display: flex; gap: 8px; }
.phone-group .phone-ddi  { width: 110px; flex-shrink: 0; cursor: pointer; }
.phone-group .phone-number { flex: 1; }

/* ── File drop zone ──────────────────────────────────────────────────────── */
.file-drop {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
  color: #6b7280;
  font-size: 14px;
}
.file-drop:hover,
.file-drop.drag-over { border-color: #4f46e5; background: #f5f3ff; }
.file-drop input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%;
}
.file-link { color: #4f46e5; font-weight: 600; }

.file-list { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.file-item {
  font-size: 13px;
  color: #374151;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 10px;
}

/* ── Form error ──────────────────────────────────────────────────────────── */
.form-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 16px;
  color: #991b1b;
  font-size: 14px;
  margin-bottom: 20px;
}

/* ── Form actions ────────────────────────────────────────────────────────── */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}

/* ── Cobrança table ──────────────────────────────────────────────────────── */
.section-loading { color: #6b7280; font-size: 14px; padding: 20px 0; }

.cobranca-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  font-size: 14px;
}
.cobranca-table th {
  background: #f9fafb;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}
.cobranca-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: #1a1a2e;
}
.cobranca-table tr:last-child td { border-bottom: none; }
.cobranca-table tbody tr:hover { background: #fafafa; }

/* ── Status badges ───────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-pending_payment { background: #fef9c3; color: #854d0e; }
.badge-processing      { background: #dbeafe; color: #1e40af; }
.badge-pending_review  { background: #fed7aa; color: #9a3412; }
.badge-sent            { background: #d1fae5; color: #065f46; }
.badge-paid            { background: #bbf7d0; color: #14532d; }
.badge-expired         { background: #f3f4f6; color: #6b7280; }
.badge-failed          { background: #fee2e2; color: #991b1b; }
.badge-rejected        { background: #fee2e2; color: #991b1b; }
.badge-pending         { background: #fef9c3; color: #854d0e; }
.badge-viewed          { background: #ede9fe; color: #4c1d95; }
.ai-valid              { background: #d1fae5; color: #065f46; }
.ai-rejected           { background: #fee2e2; color: #991b1b; }
.ai-pending            { background: #f3f4f6; color: #6b7280; }

/* ── Stats bar ───────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 24px;
  flex: 1;
  min-width: 160px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a2e;
}

/* ── Actions column ──────────────────────────────────────────────────────── */
.actions-cell { white-space: nowrap; }

.action-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px 7px;
  cursor: pointer;
  font-size: 15px;
  margin-right: 4px;
  transition: background .15s, border-color .15s;
  line-height: 1;
}
.action-btn:hover:not(:disabled) { background: #f0f2ff; border-color: #4f46e5; }
.action-btn:disabled { opacity: .35; cursor: default; }

/* ── Detail expansion row ────────────────────────────────────────────────── */
.detail-row td { padding: 0; border-bottom: 1px solid #e5e7eb; }

.detail-content {
  padding: 16px 20px;
  background: #fafafa;
}

.detail-loading { font-size: 13px; color: #6b7280; }

/* ── Notification timeline ───────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 10px; }

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.timeline-dot-sent    { background: #34d399; }
.timeline-dot-viewed  { background: #818cf8; }
.timeline-dot-pending { background: #fbbf24; }
.timeline-dot-failed  { background: #f87171; }

.timeline-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.timeline-channel { font-weight: 600; color: #374151; }
.timeline-meta    { color: #6b7280; }
.timeline-error   { color: #991b1b; font-size: 12px; width: 100%; }

/* ── File detail list ────────────────────────────────────────────────────── */
.file-detail-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.file-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.file-detail-name { color: #374151; font-weight: 500; }
