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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    min-height: 100vh;
}

/* ===== BACKGROUND ===== */
.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
}

.c1 { width: 500px; height: 500px; background: #6c5ce7; top: -150px; right: -100px; }
.c2 { width: 400px; height: 400px; background: #a29bfe; bottom: -100px; left: -100px; }

/* ===== WRAPPER ===== */
.wrapper {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    margin-bottom: 24px;
}

.header-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.header h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

/* ===== NAV TABS ===== */
.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    justify-content: center;
    overflow-x: auto;
}

.nav-tab {
    padding: 9px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #888;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-tab:hover {
    color: #a29bfe;
    border-color: rgba(108,92,231,0.3);
}

.nav-tab.active {
    background: #6c5ce7;
    color: #fff;
    border-color: #6c5ce7;
}

.nav-tab i { font-size: 10px; }

/* ===== PANELS ===== */
.panel { display: none; }
.panel.active { display: block; }

/* ===== CARD ===== */
.card {
    background: rgba(20, 20, 35, 0.85);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.card-header {
    padding: 20px 20px 0;
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.card-header p {
    font-size: 0.82rem;
    color: #666;
}

.card-body {
    padding: 20px 24px 28px;
}

/* ===== TEXTAREA ===== */
textarea {
    width: 100%;
    min-height: 160px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 16px;
    color: #ddd;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    line-height: 1.7;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea::placeholder { color: #444; }
textarea:focus { outline: none; border-color: #6c5ce7; }

/* ===== BAR ===== */
.bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0 14px;
}

.bar span {
    font-size: 0.7rem;
    color: #555;
}

.btn-sm {
    background: none;
    border: none;
    color: #6c5ce7;
    font-size: 0.72rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-sm:hover { color: #a29bfe; }

/* ===== LABELS ===== */
.label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* ===== RADIO GROUP ===== */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.radio-group label {
    cursor: pointer;
}

.radio-group input { display: none; }

.radio-group span {
    display: inline-block;
    padding: 7px 11px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    font-size: 0.72rem;
    color: #777;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    transition: all 0.2s;
}

.radio-group input:checked + span {
    background: rgba(108,92,231,0.15);
    border-color: #6c5ce7;
    color: #a29bfe;
}

.radio-group label:hover span {
    border-color: rgba(108,92,231,0.4);
}

/* ===== FIELDS ===== */
.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 5px;
}

.field input, .field select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #ddd;
    font-size: 0.88rem;
    transition: border-color 0.2s;
}

.field input:focus, .field select:focus {
    outline: none;
    border-color: #6c5ce7;
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.fields-grid .field {
    margin-bottom: 0;
}

.inline-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.inline-field label {
    font-size: 0.78rem;
    color: #777;
    white-space: nowrap;
}

.inline-field input {
    width: 90px;
    padding: 9px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #ddd;
    font-size: 0.84rem;
}

.inline-field input:focus { outline: none; border-color: #6c5ce7; }

/* ===== MAIN BUTTON ===== */
.btn-main {
    width: 100%;
    padding: 14px;
    background: #6c5ce7;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.2s;
}

.btn-main:hover { background: #5a4bd4; transform: translateY(-1px); }
.btn-main:active { transform: translateY(0); }

/* ===== RESULTS ===== */
.result {
    margin-top: 16px;
}

.result-msg {
    font-size: 0.8rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-msg.success { color: #00b894; }
.result-msg.error { color: #e74c3c; }
.result-msg.warn { color: #f39c12; }

.result-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.badge {
    background: rgba(108,92,231,0.1);
    border: 1px solid rgba(108,92,231,0.2);
    border-radius: 5px;
    padding: 4px 9px;
    font-size: 0.68rem;
    color: #a29bfe;
}

.badge strong { color: #e0e0e0; }

/* Result card */
.r-card {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.r-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 13px;
    background: rgba(108,92,231,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.r-card-head span {
    font-size: 0.72rem;
    font-weight: 600;
    color: #a29bfe;
}

.btn-copy {
    background: #6c5ce7;
    border: none;
    color: #fff;
    padding: 4px 9px;
    border-radius: 4px;
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
}

.btn-copy:hover { background: #5a4bd4; }

.r-card-body {
    padding: 11px 13px;
    max-height: 200px;
    overflow-y: auto;
}

.r-card-body pre {
    font-size: 0.73rem;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    color: #bbb;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.7;
    margin: 0;
}

.r-card-body::-webkit-scrollbar { width: 3px; }
.r-card-body::-webkit-scrollbar-thumb { background: #6c5ce7; border-radius: 3px; }

/* Counter grid */
.cnt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
}

.cnt-item {
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
}

.cnt-item .n {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
}

.cnt-item .l {
    font-size: 0.68rem;
    color: #666;
    margin-top: 2px;
}

/* Refund result */
.rf-result {
    margin-top: 16px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 20px;
}

.rf-result h3 {
    font-size: 0.85rem;
    color: #fff;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.rf-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.8rem;
}

.rf-row .rf-label { color: #777; }
.rf-row .rf-value { color: #ddd; font-weight: 500; }

.rf-total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(108,92,231,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rf-total .rf-label { color: #a29bfe; font-weight: 600; font-size: 0.85rem; }
.rf-total .rf-value { color: #00b894; font-weight: 800; font-size: 1.1rem; }

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    margin-top: 30px;
}

.footer p {
    color: #444;
    font-size: 0.72rem;
    margin-bottom: 8px;
}

.footer a {
    color: #6c5ce7;
    text-decoration: none;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.footer a:hover { color: #a29bfe; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .wrapper { padding: 16px 12px 30px; }
    .card-body { padding: 14px 16px 20px; }
    .nav-tab { padding: 7px 10px; font-size: 0.7rem; }
    textarea { min-height: 110px; }
}
