@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-main: #0f1117;
    --card-bg: #171b22;
    --card-2: #1b2029;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #8b5cf6;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --border-color: #2a2f3a;
    --radius: 18px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    --transition: all 0.25s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.glass-card {
    background: linear-gradient(180deg, rgba(23, 27, 34, 0.96), rgba(20, 24, 31, 0.96));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.app-body {
    background: var(--bg-main);
}

.app-layout {
    min-height: 100vh;
    display: flex;
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 18, 0.68);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 25;
}

.drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.drawer-open {
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #161a22, #11141a);
    border-right: 1px solid var(--border-color);
    padding: 20px 16px;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 30;
    transition: transform 0.3s ease;
}

.sidebar-header,
.sidebar-footer,
.app-bar {
    display: flex;
    align-items: center;
}

.sidebar-header {
    justify-content: space-between;
    margin-bottom: 24px;
}

.brand-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-title span {
    color: var(--primary);
}

.close-drawer-btn,
.hamburger-btn {
    display: none;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.hamburger-btn {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--text-main);
    font-weight: 600;
    border: 1px solid transparent;
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.25), rgba(59, 130, 246, 0.16));
}

.sidebar-footer {
    margin-top: auto;
}

.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
}

.app-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 70px;
    padding: 0 24px;
    background: rgba(15, 17, 23, 0.86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(42, 47, 58, 0.78);
    justify-content: space-between;
}

.app-bar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-right: auto;
}

.app-bar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wallet-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.9rem;
}

.avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.35);
}

.content-container {
    width: min(1200px, calc(100vw - 48px));
    margin: 24px auto 40px;
}

.card,
.card.glass-card {
    border-radius: var(--radius);
    padding: 24px;
    background: linear-gradient(180deg, rgba(23, 27, 34, 0.98), rgba(18, 22, 29, 0.98));
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.card-header h3,
.section-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.card-subtitle,
.stat-desc,
.brand-subtitle,
.info-note,
.modal-message,
#failedModalText,
#apiSecretModalDesc {
    color: var(--text-muted);
}

.form-wrapper-center {
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 140px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.06);
}

.bg-blue { background: rgba(59, 130, 246, 0.16); }
.bg-green { background: rgba(34, 197, 94, 0.16); }
.bg-purple { background: rgba(139, 92, 246, 0.16); }
.bg-warning { background: rgba(245, 158, 11, 0.16); }

.stat-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px) scale(1.01);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.18);
}

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

.btn-secondary,
.btn-outline {
    background: transparent;
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover,
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.18);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.18);
    color: #fff;
    border-color: rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.28);
}

.btn-success {
    background: rgba(34, 197, 94, 0.18);
    color: #fff;
    border-color: rgba(34, 197, 94, 0.35);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.18);
    color: #fff;
    border-color: rgba(245, 158, 11, 0.35);
}

.btn-block {
    width: 100%;
}

.btn-large {
    min-height: 48px;
}

.btn[disabled] {
    opacity: 0.62;
    cursor: not-allowed;
    transform: none;
}

.toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 240px;
    max-width: 360px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    animation: slideIn 0.28s ease;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 7, 10, 0.72);
    backdrop-filter: blur(6px);
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: min(100%, 480px);
    background: linear-gradient(180deg, rgba(23, 27, 34, 0.98), rgba(18, 22, 29, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow);
    animation: scaleIn 0.25s ease;
}

.modal-icon-status {
    font-size: 3rem;
    margin-bottom: 12px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.table-card {
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.minimal-table {
    width: 100%;
    border-collapse: collapse;
}

.minimal-table thead th {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.minimal-table tbody td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.minimal-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.minimal-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-success {
    background: rgba(34, 197, 94, 0.16);
    color: #8df0ad;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.15);
    color: #83f1ae;
}

@keyframes slideIn {
    from {
        transform: translateX(24px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.96);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes hoverPulse {
    from { box-shadow: 0 0 0 rgba(59, 130, 246, 0.0); }
    to { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.04); }
}

.btn:hover {
    animation: hoverPulse 0.35s ease-out;
}

.text-success {
    color: var(--success) !important;
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .close-drawer-btn,
    .hamburger-btn {
        display: inline-flex;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .app-bar {
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .content-container {
        width: min(100%, calc(100vw - 32px));
        margin-top: 16px;
    }

    .grid-cards {
        grid-template-columns: 1fr;
    }

    .wallet-badge {
        display: none;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }

    .app-bar {
        height: 64px;
    }

    .modal-content,
    .card,
    .login-card {
        padding: 20px;
    }
}
.payment-header{

display:flex;

justify-content:flex-start;

margin-bottom:16px;

}

.back-btn{

background:none;

border:none;

color:white;

font-size:16px;

font-weight:600;

cursor:pointer;

padding:8px 0;

}
.balance-loader{
    display:inline-block;
    width:22px;
    height:22px;
    border:3px solid rgba(255,255,255,.2);
    border-top-color:#fff;
    border-radius:50%;
    animation:spin .8s linear infinite;
}

.refresh-balance-btn{

    width:38px;
    height:38px;

    border:none;
    border-radius:50%;

    background:rgba(255,255,255,.08);

    color:#fff;

    font-size:20px;

    cursor:pointer;

    transition:.25s;

}

.refresh-balance-btn:hover{

    background:#6366f1;

    transform:rotate(180deg);

}

.refresh-balance-btn:disabled{

    opacity:.5;

    cursor:not-allowed;

}