/* ============================================
   ROOT
   ============================================ */
:root {
    --bg: #f0f4f8;
    --card: #ffffff;
    --text: #1a2332;
    --text2: #4a5a6e;
    --text3: #8a9aa8;
    --border: #e2e8f0;
    --primary: #4f6ef7;
    --danger: #ef5a6b;
    --success: #22b573;
    --warning: #f5a623;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

[data-theme="dark"] {
    --bg: #0f1420;
    --card: #1a2332;
    --text: #e8edf2;
    --text2: #a0b0c0;
    --text3: #6a7a8e;
    --border: #2a3348;
    --shadow: 0 1px 3px rgba(0,0,0,0.40);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    padding: 0;
    transition: background 0.3s, color 0.3s;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 20px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), #7c5cfc);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.logo-text {
    font-size: 16px;
    font-weight: 800;
}

.logo-badge {
    font-size: 9px;
    font-weight: 700;
    color: var(--text3);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 10px;
}

.header-actions {
    display: flex;
    gap: 6px;
}

.theme-btn, .menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--bg);
    color: var(--text2);
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}

.theme-btn:hover, .menu-btn:hover {
    background: var(--border);
}

.menu-btn {
    display: none;
}

/* ============================================
   MOBILE MENU
   ============================================ */
.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.4);
}

.mobile-menu.open {
    display: block;
}

.mobile-menu-inner {
    position: absolute;
    left: 0;
    top: 0;
    width: 280px;
    height: 100%;
    background: var(--card);
    padding: 20px;
    overflow-y: auto;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-header button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--bg);
    cursor: pointer;
    font-size: 16px;
}

.mobile-menu nav a {
    display: block;
    padding: 10px 0;
    color: var(--text2);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.mobile-menu nav a.active {
    color: var(--primary);
}

.mobile-menu nav hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

/* ============================================
   MAIN
   ============================================ */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 6px 14px;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    background: transparent;
    color: var(--text3);
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
}

.tab:hover {
    background: var(--border);
    color: var(--text);
}

.tab.active {
    background: var(--primary);
    color: #fff;
}

/* ============================================
   PAGE
   ============================================ */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* ============================================
   CARD
   ============================================ */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    transition: background 0.3s, box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

[data-theme="dark"] .card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.40);
}

/* ============================================
   HERO
   ============================================ */
.badge-red {
    display: inline-block;
    padding: 2px 12px;
    background: var(--danger);
    color: #fff;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.card h1 {
    font-size: 22px;
    font-weight: 800;
    margin: 8px 0 4px;
}

.card > p {
    color: var(--text2);
    font-size: 14px;
    margin-bottom: 12px;
}

.box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}

.box strong {
    display: block;
    font-size: 13px;
    margin-bottom: 8px;
}

.box ol {
    padding-left: 20px;
    font-size: 13px;
    color: var(--text2);
}

.box ol li {
    margin-bottom: 4px;
}

.tag {
    display: inline-block;
    padding: 1px 8px;
    background: var(--warning);
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* ============================================
   WARNING
   ============================================ */
.warning {
    border-left: 4px solid var(--warning);
}

.warning h3 {
    font-size: 14px;
    font-weight: 700;
}

.warning p {
    font-size: 13px;
    color: var(--text2);
    margin: 4px 0 10px;
}

.input-disabled {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text3);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    cursor: not-allowed;
}

/* ============================================
   FORM
   ============================================ */
.card h2 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 2px;
}

.card h2 + p {
    font-size: 13px;
    color: var(--text2);
    margin-bottom: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

.form-row > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-row label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
}

.required {
    color: var(--danger);
}

.input {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: 0.2s;
    width: 100%;
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,0.15);
}

.input::placeholder {
    color: var(--text3);
}

textarea.input {
    resize: vertical;
    min-height: 50px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: #3a56d4;
    box-shadow: 0 4px 12px rgba(79,110,247,0.30);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text2);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #d94a5a;
}

.btn-copy {
    background: var(--bg);
    color: var(--text2);
}

.btn-copy:hover {
    background: var(--border);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   RESULT
   ============================================ */
.result {
    display: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.result.show {
    display: block;
}

.result-header {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}

.result-meta {
    font-size: 12px;
    color: var(--text3);
    margin-bottom: 8px;
}

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

.code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    overflow: auto;
    font-size: 12px;
    margin: 6px 0;
}

.code-block code {
    font-family: 'JetBrains Mono', monospace;
}

.qr-img {
    max-width: 140px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    background: #fff;
    display: block;
}

/* ============================================
   DROP ZONE
   ============================================ */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    background: var(--bg);
}

.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(79,110,247,0.05);
}

.drop-zone div {
    font-size: 32px;
    color: var(--text3);
}

.drop-zone p {
    font-weight: 600;
    color: var(--text2);
    margin: 4px 0;
}

.drop-zone small {
    color: var(--text3);
    font-size: 12px;
}

.preview-img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* ============================================
   ENDPOINT
   ============================================ */
.endpoint-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    overflow-x: auto;
    flex-wrap: wrap;
}

.method {
    font-weight: 700;
    color: var(--danger);
}

/* ============================================
   STATUS TABLE
   ============================================ */
.status-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 300px;
}

.status-table th {
    background: var(--bg);
    color: var(--text2);
    font-weight: 600;
    padding: 8px 12px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    font-size: 11px;
    text-transform: uppercase;
}

.status-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text2);
}

.status-table tr:hover td {
    background: var(--bg);
}

.green { color: var(--success); font-weight: 700; }
.yellow { color: var(--warning); font-weight: 700; }
.red { color: var(--danger); font-weight: 700; }

/* ============================================
   HISTORY
   ============================================ */
.history-form {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.history-form label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    display: block;
    margin-bottom: 2px;
}

.empty {
    text-align: center;
    padding: 30px;
    color: var(--text3);
}

/* ============================================
   FORWARDER
   ============================================ */
.pink {
    border-left: 4px solid var(--danger);
}

.pink h2 {
    font-size: 20px;
    font-weight: 800;
}

.pink p {
    font-size: 14px;
    color: var(--text2);
    margin: 4px 0 12px;
}

.step {
    display: flex;
    gap: 14px;
    padding: 14px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 10px;
}

.step-num {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step h4 {
    font-size: 14px;
    font-weight: 700;
}

.step p {
    font-size: 13px;
    color: var(--text2);
}

.warning-text {
    font-size: 12px;
    color: var(--danger);
    font-weight: 600;
    margin-top: 4px;
}

/* ============================================
   SETTING ROW
   ============================================ */
.setting-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text2);
    margin-bottom: 4px;
}

.check {
    color: var(--success);
    font-weight: 700;
}

/* ============================================
   DONATE
   ============================================ */
.text-center {
    text-align: center;
}

.donate-card {
    text-align: center;
}

.donate-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text2);
    margin-bottom: 12px;
}

.donate-qr {
    width: 180px;
    height: 180px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    background: #fff;
    display: inline-block;
    margin-bottom: 10px;
    object-fit: contain;
}

.donate-card p {
    font-size: 13px;
    color: var(--text2);
}

/* ============================================
   LABEL SMALL
   ============================================ */
.label-small {
    font-size: 11px;
    font-weight: 700;
    color: var(--danger);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 6px 0 2px;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--bg);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    display: none;
    z-index: 999;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    display: block;
    animation: fadeUp 0.3s ease;
}

[data-theme="dark"] .toast {
    background: var(--card);
    color: var(--text);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .logo-badge {
        display: none;
    }
    
    .main {
        padding: 12px;
    }
    
    .card {
        padding: 14px;
    }
    
    .card h1 {
        font-size: 18px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .history-form {
        grid-template-columns: 1fr;
    }
    
    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .tabs {
        gap: 2px;
    }
    
    .tab {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .donate-qr {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 14px;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .card h1 {
        font-size: 16px;
    }
    
    .card h2 {
        font-size: 16px;
    }
    
    .btn {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .donate-qr {
        width: 120px;
        height: 120px;
    }
    
    .status-table {
        font-size: 11px;
    }
}

/* ============================================
   QRIS MODAL ZOOM
   ============================================ */
.qris-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.qris-modal-overlay.active {
    display: flex;
}

.qris-modal-content {
    position: relative;
    max-width: 500px;
    width: 100%;
    background: var(--card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.30);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.qris-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text2);
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qris-modal-close:hover {
    background: var(--danger);
    color: #fff;
}

.qris-modal-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 8px;
    background: #fff;
}

.qris-modal-hint {
    text-align: center;
    color: var(--text2);
    font-size: 13px;
    margin-top: 12px;
}

/* ============================================
   DONATE QR - HINT
   ============================================ */
.qr-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.donate-qr {
    cursor: pointer;
    transition: transform 0.2s;
}

.donate-qr:hover {
    transform: scale(1.02);
}

/* ============================================
   RESPONSIVE MODAL
   ============================================ */
@media (max-width: 480px) {
    .qris-modal-content {
        padding: 14px;
        margin: 10px;
    }
    
    .qris-modal-image {
        max-width: 280px;
    }
}

/* ============================================
   HLJS OVERRIDE
   ============================================ */
.hljs {
    background: transparent !important;
    color: var(--text) !important;
}

.hljs-string { color: var(--success) !important; }
.hljs-number { color: var(--warning) !important; }
.hljs-attr { color: var(--primary) !important; }
.hljs-keyword { color: var(--danger) !important; }
.hljs-comment { color: var(--text3) !important; }