* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: #252525;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app, .app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 60px;
}


.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #1a1a1a;
    border-bottom: none;
    border-radius: 0 0 16px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.username {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.balance-block {
    display: flex;
    align-items: center;
    gap: 0;
    border-radius: 10px;
    padding: 0;
    position: relative;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 136, 255, 0.05) 25%, rgba(0, 136, 255, 0.12) 55%, transparent 100%);
}

.balance {
    font-size: 14px;
    font-weight: 600;
    color: #0088ff;
    padding: 8px 12px 8px 16px;
    white-space: nowrap;
    position: relative;
    background: transparent;
}

.btn-refill {
    padding: 8px 16px;
    background: #0088ff;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
    margin-left: 4px;
}

.btn-refill:hover {
    background: #006dd9;
}

.btn-refill:active {
    transform: scale(0.98);
}


.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #1a1a1a;
    border-top: none;
    padding: 8px 0;
    z-index: 100;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    color: #666666;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.nav-btn.active {
    color: #0088ff;
}

.nav-btn.active svg {
    filter: none;
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-btn svg {
    width: 20px;
    height: 20px;
}

.nav-btn span {
    font-size: 9px;
    font-weight: 500;
}

.nav-icon-wrap {
    position: relative;
}

.badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
}


.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-card);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-primary);
}

.modal-close svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.modal-body {
    padding: 24px;
}

.modal-hint {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.input-wrap {
    position: relative;
    margin-bottom: 20px;
}

.input-wrap input {
    width: 100%;
    padding: 16px 50px 16px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    outline: none;
    transition: all 0.2s;
}

.input-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}


.input-wrap input[type="number"]::-webkit-outer-spin-button,
.input-wrap input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-wrap input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.input-wrap .currency {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

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


.modal-small {
    max-width: 320px;
}

.modal-message {
    font-size: 15px;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
}

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


.filter-modal .modal-content {
    max-width: 100%;
    margin: 0;
    border-radius: 20px 20px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    overflow-y: auto;
}

.filter-modal {
    align-items: flex-end;
    padding: 0;
}

.filter-group {
    margin-bottom: 12px;
}

.filter-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.filter-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.filter-select:focus {
    border-color: var(--accent);
}

.filter-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
}

.filter-input:focus {
    border-color: var(--accent);
}


.filter-input::-webkit-outer-spin-button,
.filter-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.filter-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.filter-dropdown-toggle {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.filter-dropdown-toggle:hover {
    border-color: var(--accent);
}

.filter-dropdown-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.filter-dropdown-toggle.open svg {
    transform: rotate(180deg);
}

.filter-dropdown {
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding: 8px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.filter-checkbox:hover {
    background: rgba(255, 255, 255, 0.05);
}

.filter-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    appearance: none;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 6px;
    position: relative;
    transition: all 0.2s;
}

.filter-checkbox input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.filter-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-checkbox label {
    flex: 1;
    cursor: pointer;
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
}


@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
    }

    .avatar {
        width: 38px;
        height: 38px;
    }

    .username {
        font-size: 14px;
    }

    .balance {
        font-size: 16px;
    }

    .btn-refill {
        padding: 8px 16px;
        font-size: 13px;
    }

    .nav-btn svg {
        width: 22px;
        height: 22px;
    }

    .nav-btn span {
        font-size: 10px;
    }
}

