/* FARAMENG Partner API — shared styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary:   #5b2df5;
  --primary-2: #2f6bff;
  --accent:    #ffb020;
  --green:     #16a34a;
  --red:       #dc2626;
  --amber:     #d97706;
  --text:      #121a2e;
  --text2:     #5a6884;
  --light:     #9aa6bd;
  --border:    #e7ecf5;
  --bg:        #f4f6fc;
  --surface:   #ffffff;
  --grad:      linear-gradient(120deg, #1d1b4b 0%, #3b2f86 45%, #5b2df5 100%);
  --font:      'Inter','Roboto',Arial,sans-serif;
  --mono:      'JetBrains Mono',ui-monospace,monospace;
  --radius:    14px;
  --shadow:    0 14px 40px rgba(23,35,59,0.10);
}
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(23,35,59,0.2); border-radius: 6px; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 900; background: rgba(255,255,255,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 0 20px; height: 62px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--text); }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 900; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(91,45,245,.35); }
.brand .logo-img { width: 38px; height: 38px; object-fit: contain; flex: none; filter: drop-shadow(0 3px 8px rgba(124,92,255,.35)); }
.brand small { display: block; font-size: 10px; font-weight: 500; color: var(--light); letter-spacing: .3px; }
.spacer { flex: 1; }
.top-nav { display: flex; gap: 4px; align-items: center; }
.top-nav a { color: var(--text2); padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 13.5px; }
.top-nav a:hover { color: var(--primary); background: rgba(91,45,245,.07); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font); font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; transition: transform .08s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(91,45,245,.28); }
.btn-primary:hover { background: #4a1fe0; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fff; color: var(--red); border-color: #f3c6c6; }
.btn-danger:hover { background: #fded ed; background: #fdeeee; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* Cards & layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 26px 20px 60px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 18px; }
.card h2 { font-size: 17px; margin-bottom: 4px; }
.card h3 { font-size: 15px; }
.muted { color: var(--text2); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.section-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--light); margin-bottom: 12px; }

/* Forms */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
label.field .hint { font-weight: 400; color: var(--text2); font-size: 12px; margin-top: 3px; }
input, select, textarea { width: 100%; font-family: var(--font); font-size: 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fbfcff; color: var(--text); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,45,245,.12); }
textarea { resize: vertical; min-height: 70px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 100px; text-transform: capitalize; }
.badge.active, .badge.success, .badge.paid { background: #e5f6ec; color: var(--green); }
.badge.pending, .badge.processing, .badge.partial { background: #fff3e0; color: var(--amber); }
.badge.expired, .badge.failed, .badge.suspended, .badge.error { background: #fdeaea; color: var(--red); }
.badge.disabled { background: #eef1f7; color: var(--text2); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--light); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table code { font-family: var(--mono); font-size: 12px; background: #f1f3fb; padding: 2px 6px; border-radius: 6px; }

/* Toast */
#toast { position: fixed; right: 18px; bottom: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #121a2e; color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 340px; animation: slidein .2s ease; }
.toast.ok { background: #16653a; }
.toast.err { background: #a01919; }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(18,26,46,.5); display: grid; place-items: center; z-index: 1500; padding: 20px; }
.modal { background: var(--surface); border-radius: 16px; max-width: 480px; width: 100%; padding: 24px; box-shadow: 0 30px 60px rgba(0,0,0,.3); max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 18px; margin-bottom: 14px; }

/* Auth pages */
.auth-wrap { min-height: calc(100vh - 62px); display: grid; place-items: center; padding: 30px 20px; }
.auth-card { width: 100%; max-width: 420px; }

/* Code blocks (docs) */
pre.code { background: #10152a; color: #e6ebff; border-radius: 12px; padding: 16px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
pre.code .k { color: #c792ea; } pre.code .s { color: #c3e88d; } pre.code .c { color: #637777; }
.method { font-family: var(--mono); font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.method.get { background: #e3f0ff; color: #1565c0; } .method.post { background: #e5f6ec; color: var(--green); } .method.delete { background: #fdeaea; color: var(--red); }

.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pill-tabs button { background: var(--surface); border: 1px solid var(--border); color: var(--text2); font-weight: 600; font-size: 13px; padding: 7px 14px; border-radius: 100px; cursor: pointer; }
.pill-tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat .n { font-size: 24px; font-weight: 800; }
.stat .l { font-size: 12px; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

@media (max-width: 720px) {
  .top-nav a.hide-sm { display: none; }
  .wrap { padding: 18px 14px 50px; }
  .card { padding: 16px; }
  .table { font-size: 12.5px; }
}
