/* Telegram Mini App Style - Official Telegram Colors */

:root {
    /* Официальные цвета Telegram */
    --tg-theme-accent-text-color: #6ab2f2;
    --tg-color-scheme: dark;
    --tg-theme-bg-color: #17212b;
    --tg-theme-bottom-bar-bg-color: #17212b;
    --tg-theme-button-color: #5288c1;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-destructive-text-color: #ec3942;
    --tg-theme-header-bg-color: #17212b;
    --tg-theme-hint-color: #708499;
    --tg-theme-link-color: #6ab3f3;
    --tg-theme-secondary-bg-color: #232e3c;
    --tg-theme-section-bg-color: #17212b;
    --tg-theme-section-header-text-color: #6ab3f3;
    --tg-theme-section-separator-color: #111921;
    --tg-theme-subtitle-text-color: #708499;
    --tg-theme-text-color: #f5f5f5;

    /* Дополнительные цвета KeyStore */
    --kb-c-orange: #F7931A;
    --kb-c-green: #46c270;
    --kb-section-line-color: #2B3B4A;
    --kb-main-bg-color: #18222E;
    --kb-section-bg-color: #20303F;

    /* Алиасы для обратной совместимости */
    --tg-bg: var(--tg-theme-bg-color);
    --tg-secondary-bg: var(--tg-theme-secondary-bg-color);
    --tg-text: var(--tg-theme-text-color);
    --tg-hint: var(--tg-theme-hint-color);
    --tg-accent: var(--tg-theme-button-color);
    --tg-green: #4cd964;
    --tg-orange: var(--kb-c-orange);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    background-color: var(--tg-bg);
    color: var(--tg-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    padding-bottom: 120px;
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
}

/* ==================== HEADER ==================== */
.header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.trade-header {
    padding: 16px 20px 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.settings-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--tg-secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
    color: var(--tg-text);
}

.settings-btn:active {
    opacity: 0.6;
}

/* ==================== TITLE SECTION ==================== */
.title-section {
    text-align: center;
    padding: 40px 20px 32px;
}

.page-title {
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--tg-hint);
    line-height: 1.4;
}

/* ==================== STORE CARDS ==================== */
.store-card {
    background: var(--tg-secondary-bg);
    border-radius: 14px;
    margin: 0 16px 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--tg-text);
    transition: all 0.2s;
}

.store-card.disabled {
    pointer-events: none;
    opacity: 0.4;
    filter: saturate(0.2);
}

.state-section {
    margin: 0 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.block-banner {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(236, 57, 66, 0.4);
    background: rgba(236, 57, 66, 0.08);
}

.block-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(236, 57, 66, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tg-theme-destructive-text-color);
}

.block-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.block-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-destructive-text-color);
}

.block-text {
    font-size: 13px;
    color: var(--tg-text);
    opacity: 0.85;
}

.active-payment-card {
    display: none;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    color: var(--tg-text);
    background: var(--tg-secondary-bg);
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid var(--tg-theme-section-separator-color);
    transition: background 0.2s ease, border 0.2s ease;
}

.active-payment-card:active {
    background: rgba(82, 136, 193, 0.1);
    border-color: var(--tg-theme-button-color);
}

.active-payment-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.active-payment-label {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tg-hint);
    font-weight: 600;
}

.active-payment-amount {
    font-size: 16px;
    font-weight: 600;
}

.active-payment-sub {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: var(--tg-hint);
    align-items: center;
}

.active-payment-timer {
    background: rgba(82, 136, 193, 0.15);
    color: var(--tg-theme-button-color);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
}

.active-payment-arrow {
    display: flex;
    align-items: center;
}

.payment-active-badge {
    display: none;
    align-self: flex-start;
    margin: 12px 16px 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(82, 136, 193, 0.12);
    color: var(--tg-theme-button-color);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


.store-card:active {
    opacity: 0.7;
    transform: scale(0.98);
}

.store-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(94, 179, 246, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tg-accent);
    flex-shrink: 0;
}

.store-card-content {
    flex: 1;
}

.store-card-title {
    font-size: 17px;
    font-weight: 600;
}

.store-card-arrow {
    color: var(--tg-hint);
    flex-shrink: 0;
}

/* ==================== BOTTOM BUTTONS ==================== */
.bottom-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 24px 16px;
}

.bottom-btn {
    padding: 14px 24px;
    border-radius: 10px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--tg-theme-section-bg-color);
    color: var(--tg-theme-text-color);
}

.bottom-btn:active {
    opacity: 0.7;
    transform: scale(0.97);
}

/* ==================== TRADE EXCHANGE ==================== */
.trade-exchange {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px 16px;
}

.trade-exchange-icon {
    flex-shrink: 0;
}

.trade-exchange-arrows {
    flex-shrink: 0;
    color: var(--tg-hint);
}

/* ==================== TRADE BUTTONS ==================== */
.trade-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px 24px;
}

.trade-btn {
    padding: 16px 24px;
    border-radius: 10px;
    border: none;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.trade-btn:active {
    opacity: 0.7;
    transform: scale(0.97);
}

.trade-btn.buy {
    background: var(--tg-theme-button-color);
}

.trade-btn.sell {
    background: var(--tg-theme-button-color);
}

/* ==================== PRICE INFO CARD ==================== */
.price-info-card {
    background: var(--tg-secondary-bg);
    border-radius: 14px;
    margin: 0 16px 24px;
    padding: 20px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.price-item {
    flex: 1;
}

.price-item.right {
    text-align: right;
}

.price-label {
    font-size: 13px;
    color: var(--tg-hint);
    margin-bottom: 4px;
}

.price-value {
    font-size: 17px;
    font-weight: 600;
    color: var(--tg-text);
}

.price-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 16px 0;
}

/* ==================== NAV BOTTOM ==================== */
.nav-bottom {
    text-align: center;
    padding: 24px 16px;
}

.nav-link {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 10px;
    background: var(--tg-theme-section-bg-color);
    color: var(--tg-theme-link-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
}

.nav-link:active {
    opacity: 0.7;
    transform: scale(0.97);
}

/* ==================== ORDER PAGE (BUY/SELL) ==================== */

/* Order Header */
.order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--tg-theme-bg-color);
}

.order-header > *:first-child,
.order-header > *:last-child {
    width: 36px;
    flex-shrink: 0;
}

.back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--tg-theme-text-color);
    text-decoration: none;
    transition: background 0.2s;
}

.back-btn:active {
    background: var(--tg-theme-secondary-bg-color);
}

.order-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    text-align: center;
    flex: 1;
}

/* Main Input Section */
.order-main-section {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.order-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.order-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--tg-theme-hint-color);
    padding-left: 2px;
}

.order-input {
    background: var(--tg-theme-secondary-bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 24px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

/* Убираем стрелочки в number input */
.order-input::-webkit-outer-spin-button,
.order-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.order-input[type=number] {
    -moz-appearance: textfield;
}

.order-input:focus {
    border-color: var(--tg-theme-button-color);
}

.order-input::placeholder {
    color: var(--tg-theme-hint-color);
    opacity: 0.4;
}

.order-hint {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    padding: 0 2px;
}

.order-input-text {
    background: var(--tg-theme-secondary-bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--tg-theme-text-color);
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.order-input-text:focus {
    border-color: var(--tg-theme-button-color);
}

.order-input-text::placeholder {
    color: var(--tg-theme-hint-color);
    opacity: 0.5;
}

/* Price Info Section */
.order-price-section {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 0 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-price-label {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
}

.order-price-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
}

.order-price-value.accent {
    color: var(--tg-theme-accent-text-color);
}

.order-price-value.success {
    color: var(--tg-green);
}

/* Total Section */
.order-total-section {
    background: rgba(94, 179, 246, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 16px 16px;
}

.order-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-total-label {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    font-weight: 500;
}

.order-total-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--tg-theme-accent-text-color);
}

/* Submit Button */
.order-submit-btn {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.order-submit-btn:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.order-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==================== PAYMENT PAGE ==================== */

/* Payment Status Section */
.payment-status-section {
    padding: 40px 20px;
    text-align: center;
}

.payment-status-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.payment-status-icon.success {
    color: var(--tg-green);
}

.payment-status-icon.error {
    color: var(--tg-theme-destructive-text-color);
}

.payment-status-error-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(236, 57, 66, 0.12);
    border: 2px solid rgba(236, 57, 66, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Clean Payment Loader */
.payment-loader-clean {
    width: 100px;
    height: 100px;
    position: relative;
    margin: 0 auto;
}

/* Spinner Circle */
.spinner-circle {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.spinner-track {
    stroke: var(--tg-theme-button-color);
    opacity: 0.1;
}

.spinner-progress {
    stroke: var(--tg-theme-button-color);
    stroke-linecap: round;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transform-origin: center;
    animation: spinner-dash 2s ease-in-out infinite;
}

.keys-inline-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
}

.keys-inline-loader svg {
    width: 100%;
    height: 100%;
}

@keyframes spinner-dash {
    0% {
        stroke-dashoffset: 200;
        transform: rotate(0deg);
    }
    50% {
        stroke-dashoffset: 50;
        transform: rotate(180deg);
    }
    100% {
        stroke-dashoffset: 200;
        transform: rotate(360deg);
    }
}

/* Loader Icon */
.loader-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: icon-pulse 2s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* Success Animation Clean */
.success-animation-clean {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    animation: success-scale 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes success-scale {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-svg {
    width: 100%;
    height: 100%;
}

.success-bg {
    opacity: 0.2;
}

.success-circle {
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    animation: draw-circle 0.6s ease-out forwards;
}

@keyframes draw-circle {
    to {
        stroke-dashoffset: 0;
    }
}

.success-check {
    stroke-dasharray: 70;
    stroke-dashoffset: 70;
    animation: draw-check 0.4s ease-out 0.4s forwards;
}

@keyframes draw-check {
    to {
        stroke-dashoffset: 0;
    }
}

.payment-status-text h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--tg-theme-text-color);
}

.payment-status-text p {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

/* Payment Info Card */
.payment-info-card {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    padding: 16px;
    margin: 0 16px 16px;
}

.payment-info-card.compact {
    padding: 10px 16px;
}

.payment-info-card.compact .payment-info-row {
    padding: 6px 0;
}

.amount-copy-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.amount-copy-btn {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--tg-theme-hint-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    opacity: 0.7;
}

.amount-copy-btn:hover {
    opacity: 1;
    color: var(--tg-theme-button-color);
}

.amount-copy-btn:active {
    transform: scale(0.95);
}

.payment-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.payment-info-label {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

.payment-info-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
}

.payment-info-value.large {
    font-size: 24px;
    font-weight: 700;
    color: var(--tg-theme-accent-text-color);
}

.payment-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

/* Wallet Address Section */
.wallet-address-section {
    padding: 0 16px 16px;
}

.wallet-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--tg-theme-hint-color);
    margin-bottom: 8px;
    padding-left: 2px;
}

.wallet-address-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.wallet-address-input {
    flex: 1;
    background: var(--tg-theme-secondary-bg-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--tg-theme-text-color);
    font-family: monospace;
    outline: none;
}

.wallet-copy-btn {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 10px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.wallet-copy-btn:active {
    opacity: 0.7;
}

.wallet-tag {
    margin-top: 12px;
}

/* Payment Warning */
.payment-warning {
    background: rgba(247, 147, 26, 0.1);
    border: 1px solid var(--kb-c-orange);
    border-radius: 10px;
    padding: 12px;
    margin: 0 16px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.payment-warning svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.payment-warning span {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    line-height: 1.4;
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--tg-theme-bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 9999;
}

.page-loader-spinner {
    width: 80px;
    height: 80px;
    position: relative;
}

.page-loader-spinner .spinner-circle {
    width: 100%;
    height: 100%;
    animation: rotate 1.5s linear infinite;
}

.page-loader-text {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    margin: 0;
}

/* Payment Timer in Info Card */
.payment-timer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.payment-timer-row .payment-info-label {
    display: flex;
    align-items: center;
}

.payment-timer-row svg {
    color: var(--tg-theme-hint-color);
}

.timer-value-large {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--tg-theme-text-color) !important;
}

/* Spinner Animation */
.spinner {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

/* ==================== OLD BUY/SELL PAGE (DEPRECATED) ==================== */
.amount-input-card {
    background: var(--tg-secondary-bg);
    border-radius: 14px;
    margin: 0 16px 16px;
    padding: 24px;
}

.amount-input-wrapper {
    margin-bottom: 12px;
}

.amount-input {
    background: transparent;
    border: none;
    color: var(--tg-text);
    font-size: 48px;
    font-weight: 700;
    width: 100%;
    outline: none;
    text-align: left;
}

.amount-input::placeholder {
    color: var(--tg-hint);
    opacity: 0.5;
}

.amount-usd {
    font-size: 14px;
    color: var(--tg-hint);
    margin-top: 4px;
}

.buy-all-link {
    text-align: right;
}

.buy-all-link a {
    color: var(--tg-theme-link-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
}

.buy-all-link a:active {
    opacity: 0.6;
}

/* Info Grid */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 16px 16px;
}

.info-item {
    background: var(--tg-secondary-bg);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-size: 15px;
    color: var(--tg-hint);
}

.info-value {
    font-size: 17px;
    font-weight: 600;
    color: var(--tg-text);
}

.info-value.highlight {
    color: var(--tg-theme-accent-text-color);
}

.info-link {
    color: var(--tg-theme-link-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
}

.info-link:active {
    opacity: 0.6;
}

/* Payment Methods */
.payment-section {
    padding: 24px 16px;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-left: 4px;
}

.payment-list {
    background: var(--tg-secondary-bg);
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid var(--tg-orange);
}

.payment-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.payment-item:last-child {
    border-bottom: none;
}

.payment-item:active {
    background: rgba(255, 255, 255, 0.05);
}

.payment-item.selected {
    background: rgba(94, 179, 246, 0.1);
}

.payment-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(76, 217, 100, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.payment-name {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}

.payment-multiplier {
    color: var(--tg-hint);
    font-size: 15px;
    font-weight: 500;
}

/* Info Box */
.info-box {
    background: var(--tg-secondary-bg);
    border-radius: 14px;
    padding: 16px;
    margin: 16px;
    border: 2px solid var(--tg-orange);
}

.info-box p {
    font-size: 13px;
    color: var(--tg-hint);
    line-height: 1.6;
    margin-bottom: 12px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

.info-box ul {
    margin: 8px 0;
    padding-left: 20px;
}

.info-box li {
    margin: 4px 0;
    font-size: 13px;
    color: var(--tg-hint);
}

.info-highlight {
    color: var(--tg-orange);
    font-weight: 600;
}

/* Total Card */
.total-card {
    background: rgba(94, 179, 246, 0.1);
    border-radius: 14px;
    margin: 16px;
    padding: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-size: 15px;
    color: var(--tg-hint);
}

.total-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--tg-theme-accent-text-color);
}

/* Submit Button */
.submit-btn {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 12px;
    padding: 18px;
    font-size: 18px;
    font-weight: 600;
    width: calc(100% - 32px);
    margin: 16px 16px 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-btn:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Input Text */
.input-text {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--tg-text);
    font-size: 15px;
    width: 100%;
    outline: none;
    margin-top: 8px;
}

.input-text:focus {
    border-color: var(--tg-theme-button-color);
}

.input-text::placeholder {
    color: var(--tg-hint);
    opacity: 0.5;
}

/* Loader */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== KEYSTORE PAGE REDESIGN ==================== */

/* Header with Icons */
.keystore-header {
    text-align: center;
    padding: 40px 20px 24px;
}

.keystore-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.keystore-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.keystore-icon-circle.black {
    background: #000000;
}

.keystore-icon-circle.teal {
    background: #5EAEA6;
}

.keystore-arrows {
    display: flex;
    align-items: center;
    justify-content: center;
}

.keystore-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
    color: var(--tg-theme-text-color);
}

.keystore-subtitle {
    font-size: 13px;
    color: var(--tg-theme-subtitle-text-color);
    line-height: 1.4;
}

/* Trade Cards Grid */
.trade-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 16px 24px;
}

.trade-card {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    padding: 16px;
    text-decoration: none;
    color: var(--tg-theme-text-color);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trade-card:active {
    opacity: 0.8;
    transform: scale(0.98);
}

.trade-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trade-card-title {
    font-size: 17px;
    font-weight: 600;
}

.trade-card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trade-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trade-card-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--tg-theme-hint-color);
}

.trade-card-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--tg-theme-text-color);
}

.trade-card-value.warning {
    color: var(--kb-c-orange);
}

/* Payment Methods Section */
.payment-methods-section {
    padding: 0 16px 20px;
}

.section-heading-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-heading {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    flex: 1;
}

.refresh-btn {
    background: transparent;
    border: none;
    color: var(--tg-theme-hint-color);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 8px;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--tg-theme-text-color);
}

.refresh-btn:active {
    transform: scale(0.9);
}

.refresh-btn.spinning svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.payment-methods-list {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 14px;
    border: 2px solid var(--kb-c-orange);
    overflow: hidden;
    padding: 4px 0;
}

.payment-method-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.payment-method-item:last-child {
    border-bottom: none;
}

.payment-method-item:active {
    background: rgba(255, 255, 255, 0.05);
}

.payment-method-item.selected .payment-method-name {
    color: var(--kb-c-orange);
}

.payment-method-item.selected .payment-method-multiplier {
    color: var(--kb-c-orange);
}

.payment-method-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.payment-method-icon img {
    display: block;
    width: 36px;
    height: 36px;
}

.payment-method-name {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    transition: color 0.2s;
}

.payment-method-multiplier {
    font-size: 15px;
    font-weight: 600;
    color: var(--tg-theme-hint-color);
    transition: color 0.2s;
}

/* Info Notice Box */
.info-notice-box {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 10px;
    padding: 12px;
    margin: 0 16px 20px;
    border: 2px solid var(--kb-c-orange);
}

.info-notice-box p {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    line-height: 1.5;
    margin-bottom: 10px;
}

.info-notice-box p:last-child {
    margin-bottom: 0;
}

.info-notice-box ul {
    margin: 6px 0 0 0;
    padding-left: 18px;
}

.info-notice-box li {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    margin: 3px 0;
}

.info-notice-box .info-highlight {
    color: var(--kb-c-orange);
    font-weight: 600;
}

/* Notification Toast */
.notification-toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 85%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification-toast.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

/* Floating Action Footer */
.action-footer {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: min(480px, 100%);
    padding: 20px 16px 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(23, 33, 43, 0) 0%, rgba(23, 33, 43, 0.85) 45%, rgba(23, 33, 43, 0.98) 100%);
    display: flex;
    gap: 12px;
    justify-content: center;
    pointer-events: none;
    z-index: 1200;
}

.action-footer > * {
    pointer-events: auto;
    flex: 1;
}

/* Bottom Navigation */
.bottom-navigation {
    width: 100%;
    display: flex;
    justify-content: center;
}

.btn-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: 10px;
    background: var(--tg-theme-secondary-bg-color);
    color: var(--tg-theme-text-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
    width: 100%;
    min-height: 52px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.btn-home:active {
    opacity: 0.8;
    transform: scale(0.98);
}

/* ==================== SETTINGS PAGE ==================== */
.settings-page-header {
    padding: 16px 20px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--tg-secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
    color: var(--tg-text);
}

.back-btn:active {
    opacity: 0.6;
}

.settings-page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--tg-text);
}

.settings-list {
    margin-top: 16px;
}

.settings-item {
    margin-bottom: 16px;
    background: var(--tg-secondary-bg);
    border-radius: 14px;
    overflow: hidden;
}

.settings-item-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    color: var(--tg-text);
}

.settings-item-header:active {
    background-color: rgba(255, 255, 255, 0.05);
}

.settings-item-title {
    font-size: 17px;
    font-weight: 500;
}

.settings-item-arrow {
    transition: transform 0.3s;
    color: var(--tg-hint);
}

.settings-item-arrow.rotated {
    transform: rotate(90deg);
}

.settings-item-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: rgba(0, 0, 0, 0.1);
}

.settings-item-content.expanded {
    max-height: 500px;
    transition: max-height 0.5s ease-in;
}

.wallet-input-group {
    padding: 16px 20px 0;
}

.wallet-input-group:not(:last-child) {
    padding-bottom: 20px;
}

.wallet-label {
    display: block;
    font-size: 14px;
    color: var(--tg-hint);
    margin-bottom: 8px;
}

.wallet-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--tg-bg);
    border: 1px solid var(--tg-section-separator-color);
    color: var(--tg-text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.wallet-input:focus {
    border-color: var(--tg-accent);
}

.save-wallets-btn, .save-trade-link-btn {
    display: block;
    width: calc(100% - 40px);
    margin: 16px 20px 20px;
    padding: 14px;
    border-radius: 10px;
    background: var(--tg-accent);
    color: var(--tg-button-text-color);
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.save-wallets-btn:active, .save-trade-link-btn:active {
    opacity: 0.8;
}

.save-wallets-btn:disabled, .save-trade-link-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.save-wallets-btn .loader, .save-trade-link-btn .loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* ==================== BOTTOM BUTTONS ==================== */

/* Responsive */
@media (max-width: 400px) {
    .page-title {
        font-size: 28px;
    }

    .amount-input {
        font-size: 40px;
    }

    .keystore-icon-circle {
        width: 56px;
        height: 56px;
    }

    .keystore-title {
        font-size: 24px;
    }
}

.error-text {
    color: var(--tg-theme-destructive-text-color);
    font-weight: 500;
}

/* ==================== ADMIN PANEL ==================== */
.admin-panel {
    padding: 8px;
}

.search-container {
    padding: 12px;
    margin: 8px;
    background: var(--tg-secondary-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-input-group {
    display: flex;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    background: var(--tg-bg);
    border: 1px solid var(--tg-theme-section-separator-color);
    border-radius: 8px;
    color: var(--tg-text);
    font-size: 15px;
    outline: none;
    min-height: 40px; /* Удобный размер для касания на мобильных */
}

.search-btn {
    padding: 8px 12px;
    background: var(--tg-accent);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    min-height: 40px; /* Удобный размер для касания на мобильных */
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:active {
    opacity: 0.8;
}

.admin-filters {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--tg-secondary-bg);
    border-radius: 12px;
    margin: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 12px;
    color: var(--tg-hint);
    margin-bottom: 4px;
}

.filter-select, .filter-input {
    padding: 8px 12px;
    background: var(--tg-bg);
    border: 1px solid var(--tg-theme-section-separator-color);
    border-radius: 8px;
    color: var(--tg-text);
    font-size: 14px;
    outline: none;
    min-height: 40px; /* Удобный размер для касания на мобильных */
}

.filter-buttons-row {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.filter-btn {
    flex: 1;
    padding: 8px 12px;
    background: var(--tg-accent);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    min-height: 40px; /* Удобный размер для касания на мобильных */
}

.filter-btn:active {
    opacity: 0.8;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 8px;
}

.stat-card {
    background: var(--tg-secondary-bg);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-title {
    font-size: 12px;
    color: var(--tg-hint);
    margin-bottom: 6px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-text);
}

.transactions-container {
    margin: 8px;
}

.transactions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.transactions-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-text);
}

.pagination-info {
    font-size: 12px;
    color: var(--tg-hint);
}

.transactions-table-container {
    background: var(--tg-secondary-bg);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table th {
    background: var(--kb-section-bg-color);
    padding: 8px 4px;
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    color: var(--tg-hint);
    text-transform: uppercase;
}

.transactions-table td {
    padding: 8px 4px;
    border-top: 1px solid var(--tg-theme-section-separator-color);
    font-size: 12px;
    color: var(--tg-text);
}

.loading-row, .no-data-row {
    text-align: center;
    padding: 16px;
    color: var(--tg-hint);
    font-style: italic;
}

.status-badge {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-pending {
    background: rgba(247, 147, 26, 0.2);
    color: var(--kb-c-orange);
}

.status-confirmed {
    background: rgba(70, 194, 112, 0.2);
    color: var(--kb-c-green);
}

.status-expired {
    background: rgba(236, 57, 66, 0.2);
    color: var(--tg-theme-destructive-text-color);
}

.status-cancelled {
    background: rgba(112, 132, 153, 0.2);
    color: var(--tg-hint);
}

.action-btn {
    padding: 4px 8px;
    background: var(--tg-accent);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: opacity 0.2s;
    min-height: 32px; /* Удобный размер для касания на мобильных */
}

.action-btn:active {
    opacity: 0.8;
}

.confirm-btn {
    background: var(--kb-c-green);
    margin-left: 4px;
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.pagination-btn {
    padding: 8px 12px;
    background: var(--tg-accent);
    color: var(--tg-theme-button-text-color);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
    min-height: 40px; /* Удобный размер для касания на мобильных */
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn:active:not(:disabled) {
    opacity: 0.8;
}

#page-info {
    font-size: 13px;
    color: var(--tg-hint);
}

/* ==================== СЖАТЫЕ КАРТОЧКИ ТРАНЗАКЦИЙ ==================== */
.transaction-cards {
    display: none;
    margin: 8px;
    gap: 8px;
    flex-direction: column;
}

.transaction-card {
    background: var(--tg-secondary-bg);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.transaction-card-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
}

.transaction-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.transaction-card-id {
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-text);
}

.transaction-card-status {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
}

.transaction-card-expand-icon {
    transition: transform 0.3s ease;
    color: var(--tg-hint);
}

.transaction-card-expand-icon.rotated {
    transform: rotate(180deg);
}

.transaction-card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.transaction-card-details.expanded {
    max-height: 400px;
}

.transaction-card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.transaction-info-row {
    display: flex;
    justify-content: space-between;
}

.transaction-info-label {
    font-size: 12px;
    color: var(--tg-hint);
}

.transaction-info-value {
    font-size: 12px;
    color: var(--tg-text);
    text-align: right;
    word-break: break-all;
}

.transaction-card-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

/* ==================== МОБИЛЬНАЯ АДАПТАЦИЯ ==================== */
@media (max-width: 480px) {
    .admin-panel {
        padding: 6px;
    }
    
    .search-container, .admin-filters {
        margin: 6px;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-title {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    .transactions-container {
        margin: 6px;
    }
    
    .transactions-header {
        margin-bottom: 6px;
    }
    
    .transactions-table th,
    .transactions-table td {
        padding: 6px 3px;
        font-size: 11px;
    }
    
    .transactions-table th:nth-child(4),
    .transactions-table td:nth-child(4),
    .transactions-table th:nth-child(5),
    .transactions-table td:nth-child(5) {
        display: none; /* Скрываем менее важные колонки на мобильных */
    }
    
    .action-btn {
        padding: 3px 6px;
        font-size: 10px;
        min-height: 28px;
    }
    
    .transaction-cards {
        display: flex; /* Показываем карточки на мобильных */
    }
    
    .transaction-card {
        padding: 10px;
        margin-bottom: 6px;
    }
    
    .transaction-card-header {
        margin-bottom: 6px;
    }
    
    .transaction-card-details.expanded {
        max-height: 300px;
    }
    
    .transaction-info-row {
        gap: 4px;
    }
    
    .transaction-info-label,
    .transaction-info-value {
        font-size: 11px;
    }
    
    .transaction-card-actions {
        margin-top: 6px;
        gap: 4px;
    }
}

/* ==================== НОВЫЕ СТИЛИ АДМИН-ПАНЕЛИ ==================== */

/* Кнопка обновления */
.refresh-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--tg-secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
    color: var(--tg-text);
}

.refresh-btn:active {
    opacity: 0.6;
}

/* Секция фильтров */
.filter-section {
    margin: 12px;
    background: var(--tg-secondary-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--tg-theme-section-separator-color);
}

.filter-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-text);
}

.toggle-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--tg-theme-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
    color: var(--tg-text);
}

.toggle-btn.rotated {
    transform: rotate(180deg);
}

.filter-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-content.expanded {
    max-height: 500px;
    padding: 16px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-text);
}

.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--tg-text);
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--tg-theme-bg-color);
    transition: background 0.2s;
}

.radio-option:hover {
    background: var(--tg-theme-section-separator-color);
}

.radio-option input[type="radio"] {
    margin-right: 8px;
    accent-color: var(--tg-theme-button-color);
}

.radio-option input[type="radio"]:checked + span {
    color: var(--tg-theme-button-color);
    font-weight: 500;
}

.date-range-container {
    display: flex;
    gap: 12px;
}

.date-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.date-input-group label {
    font-size: 12px;
    margin-bottom: 6px;
    color: var(--tg-hint);
}

.date-input {
    padding: 12px;
    border: 1px solid var(--tg-theme-section-separator-color);
    border-radius: 8px;
    background: var(--tg-theme-bg-color);
    color: var(--tg-text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.date-input:focus {
    border-color: var(--tg-theme-button-color);
}

.filter-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-primary, .btn-secondary {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
}

.btn-primary:active {
    opacity: 0.8;
}

.btn-secondary {
    background: var(--tg-theme-bg-color);
    color: var(--tg-text);
    border: 1px solid var(--tg-theme-section-separator-color);
}

.btn-secondary:active {
    background: var(--tg-theme-section-separator-color);
}

/* Секция транзакций */
.transactions-section {
    margin: 12px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-text);
}

.pagination-info {
    font-size: 12px;
    color: var(--tg-hint);
}

/* Карточки транзакций */
.transaction-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transaction-card {
    background: var(--tg-secondary-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.transaction-card:active {
    transform: scale(0.98);
}

.transaction-card-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    position: relative;
}

.transaction-card-summary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: var(--tg-theme-section-separator-color);
    opacity: 0.5;
}

.transaction-card-summary-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.transaction-card-id {
    font-size: 15px;
    font-weight: 600;
    color: var(--tg-text);
}

.transaction-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.transaction-card-type {
    font-size: 13px;
    color: var(--tg-hint);
    background: var(--tg-theme-bg-color);
    padding: 3px 8px;
    border-radius: 4px;
}

.transaction-card-amount {
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-text);
}

.transaction-card-status {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    margin-left: 10px;
    white-space: nowrap;
}

.status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-confirmed {
    background: rgba(76, 217, 100, 0.2);
    color: #4cd964;
}

.status-expired {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.status-cancelled {
    background: rgba(142, 142, 147, 0.2);
    color: #8e8e93;
}

.transaction-card-expand-icon {
    transition: transform 0.3s ease;
    color: var(--tg-hint);
    margin-left: 10px;
}

.transaction-card-expand-icon.rotated {
    transform: rotate(180deg);
}

.transaction-card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--tg-theme-bg-color);
}

.transaction-card-details.expanded {
    max-height: 500px;
}

.transaction-card-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.transaction-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transaction-info-label {
    font-size: 13px;
    color: var(--tg-hint);
}

.transaction-info-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--tg-text);
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transaction-card-actions {
    padding: 0 16px 16px;
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

.view-btn {
    background: var(--tg-theme-bg-color);
    color: var(--tg-text);
    border: 1px solid var(--tg-theme-section-separator-color);
}

.view-btn:active {
    background: var(--tg-theme-section-separator-color);
}

.confirm-btn {
    background: var(--tg-green);
    color: white;
}

.confirm-btn:active {
    opacity: 0.8;
}

/* Пагинация */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding: 0 4px;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--tg-secondary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    color: var(--tg-text);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn:not(:disabled):active {
    background: var(--tg-theme-section-separator-color);
}

#page-info {
    font-size: 13px;
    color: var(--tg-hint);
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--tg-theme-bg-color);
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--tg-theme-section-separator-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--tg-text);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    color: var(--tg-text);
}

.modal-close:active {
    background: var(--tg-theme-section-separator-color);
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.transaction-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tg-theme-section-separator-color);
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    font-size: 13px;
    color: var(--tg-hint);
    flex: 1;
}

.detail-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--tg-text);
    flex: 2;
    text-align: right;
    word-break: break-all;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    max-width: 80%;
    text-align: center;
}

.notification.show {
    opacity: 1;
}

.notification-success {
    background: var(--tg-green);
    color: white;
}

.notification-error {
    background: var(--tg-theme-destructive-text-color);
    color: white;
}

.notification-info {
    background: var(--tg-theme-button-color);
    color: white;
}

/* Элементы загрузки */
.loading-row {
    padding: 20px;
    text-align: center;
    color: var(--tg-hint);
    font-size: 14px;
}

.no-data-row {
    padding: 20px;
    text-align: center;
    color: var(--tg-hint);
    font-size: 14px;
}



.payment-success {
    margin-top: 24px;
}

.success-card {
    background: var(--tg-secondary-bg);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.success-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.success-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--tg-theme-text-color);
}

.success-subtitle {
    color: var(--tg-hint);
    font-size: 0.95rem;
    line-height: 1.5;
}

.success-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.summary-item {
    flex: 1 1 120px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--tg-hint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--tg-theme-text-color);
}

/* Minimalist Progress Bar */
.progress-container {
    margin-top: 24px;
    padding: 20px 0;
    position: relative;
}

.progress-line {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 0;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 120px;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.step-number {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.step-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(236, 57, 66, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.step-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    line-height: 1.4;
    font-weight: 500;
    transition: color 0.3s ease;
}

/* States */
.progress-step.active .step-circle {
    border-color: var(--tg-theme-button-color);
    background: var(--tg-theme-button-color);
}

.progress-step.active .step-number {
    color: rgba(255, 255, 255, 0.9);
}

.progress-step.active .step-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.progress-step.done .step-circle {
    border-color: rgba(39, 174, 96, 0.8);
    background: rgba(39, 174, 96, 0.8);
}

.progress-step.done .step-number {
    opacity: 0;
    transform: scale(0.8);
}

.progress-step.done .step-check {
    opacity: 1;
}

.progress-step.done .step-label {
    color: rgba(255, 255, 255, 0.8);
}

.progress-step.failed .step-circle {
    border-color: rgba(236, 57, 66, 0.8);
    background: rgba(236, 57, 66, 0.8);
}

.progress-step.failed .step-number {
    opacity: 0;
    transform: scale(0.8);
}

.progress-step.failed .step-error {
    opacity: 1;
}

.progress-step.failed .step-label {
    color: rgba(236, 57, 66, 0.9);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .progress-container {
        padding: 16px 0;
        margin-top: 20px;
    }

    .progress-step {
        max-width: 100px;
    }

    .step-circle {
        width: 36px;
        height: 36px;
    }

    .step-number {
        font-size: 13px;
    }

    .step-label {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .progress-container {
        padding: 14px 0;
        margin-top: 16px;
    }

    .progress-step {
        max-width: 80px;
    }

    .step-circle {
        width: 32px;
        height: 32px;
        margin-bottom: 8px;
    }

    .step-number {
        font-size: 12px;
    }

    .step-label {
        font-size: 11px;
        line-height: 1.3;
    }

    .step-check,
    .step-error {
        width: 14px;
        height: 14px;
    }
}

.trade-status-note {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
}

.trade-offer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.95rem;
}

.trade-offer-label {
    color: var(--tg-hint);
    font-size: 0.85rem;
}

#trade-offer-link {
    color: var(--tg-theme-button-color);
    font-weight: 600;
    text-decoration: none;
}

#trade-offer-link:hover {
    text-decoration: underline;
}

.trade-history {
    margin-top: 12px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.trade-history-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.trade-history-time {
    min-width: 64px;
    font-size: 0.82rem;
    color: var(--tg-hint);
}

.trade-history-message {
    flex: 1;
    font-size: 0.92rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.85);
}

.trade-history-item.error .trade-history-message {
    color: var(--tg-theme-destructive-text-color);
}
@media (max-width: 520px) {
    .success-card {
        padding: 16px;
    }

    .success-summary {
        gap: 10px;
    }

    .trade-progress-track {
        gap: 10px;
    }

    .trade-progress-label {
        font-size: 0.78rem;
    }
}
