/* Shared styles for Deposit/Withdrawal pages */
/* Toast notification */
.deposit-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e293b;
    color: #f8fafc;
    border-radius: 10px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    z-index: 9999;
    max-width: 480px;
    width: calc(100% - 40px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.deposit-toast.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.deposit-toast-icon {
    font-size: 18px;
    flex-shrink: 0;
    color: #f59e0b;
}

.deposit-toast-body {
    flex: 1;
    line-height: 1.45;
}

.deposit-toast-body a {
    color: #60a5fa;
    text-decoration: underline;
    font-weight: 600;
}

.deposit-toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}

.deposit-toast-close:hover {
    color: #f8fafc;
}

.action-page {
    padding-top: 18px;
    flex: 1;
    width: 100%;
    max-width: 1120px;
}

.action-page h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
}

.action-subtitle {
    color: var(--text-soft);
    font-size: 14px;
    margin-bottom: 18px;
}

.action-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #dbe2ea;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.04);
    margin-bottom: 18px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.action-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.action-field label {
    font-size: 13px;
    font-weight: 600;
    color: #41556a;
}

.action-field input,
.action-field select,
.action-field textarea {
    height: 40px;
    border: 1px solid #d9e0e7;
    border-radius: 8px;
    padding: 0 12px;
    outline: none;
    color: #3a506a;
    font-size: 14px;
    background: #f9fbfd;
}

.action-field textarea {
    height: 110px;
    resize: vertical;
    padding: 10px 12px;
}

.action-field.full {
    grid-column: 1 / -1;
}

.action-note {
    background: #f3f8ff;
    border: 1px solid #d5e7ff;
    color: #28588c;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 14px;
}

.action-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.action-link {
    color: #3f5f80;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.action-link:hover {
    text-decoration: underline;
}

.action-submit {
    border: none;
    border-radius: 8px;
    height: 40px;
    padding: 0 22px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.action-submit.deposit {
    background: var(--green);
}

.action-submit.withdraw {
    background: var(--red);
}

.rich-dropdown {
    position: relative;
}

.rich-dropdown-trigger {
    width: 100%;
    height: 40px;
    border: 1px solid #d9e0e7;
    border-radius: 8px;
    background: #f9fbfd;
    color: #3a506a;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    font-size: 14px;
    cursor: pointer;
}

.rich-dropdown-trigger:disabled {
    background: #eef2f6;
    color: #8ea0b3;
    cursor: not-allowed;
}

.rich-selected-icon,
.rich-option-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #edf3f9;
    color: #41556a;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.rich-selected-icon img,
.rich-option-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rich-icon-fallback {
    font-size: 10px;
    font-weight: 700;
}

.rich-selected-text {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rich-dropdown-trigger .fa-chevron-down {
    color: #7d90a5;
    font-size: 12px;
}

.rich-dropdown-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
    background: #fff;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.15);
    padding: 10px;
    display: none;
    min-width: 0;
}

.rich-dropdown.is-open .rich-dropdown-menu {
    display: block;
}

.rich-dropdown-search-wrap {
    padding-bottom: 8px;
}

.rich-dropdown-search {
    width: 100%;
    height: 36px;
    border: 1px solid #d9e0e7;
    border-radius: 8px;
    padding: 0 10px;
    font-size: 13px;
    color: #3a506a;
    background: #f9fbfd;
    outline: none;
}

.rich-dropdown-list {
    max-height: 240px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rich-option {
    width: 100%;
    border: none;
    background: #fff;
    color: #2f445b;
    border-radius: 8px;
    min-height: 40px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.rich-option:hover {
    background: #f1f7ff;
}

.rich-option-main {
    flex: 1;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rich-option-badge {
    background: #edf2f8;
    color: #5c7087;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
}

.rich-empty {
    color: #7a8da2;
    font-size: 12px;
    padding: 8px;
}

.deposit-address-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.deposit-address-row input {
    flex: 1;
    min-width: 0;
}

.deposit-page .text-muted {
    color: #7a8da2;
    font-size: 12px;
}

@media (max-width: 800px) {
    .action-page h1 {
        font-size: 24px;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }

    .deposit-address-row {
        flex-direction: column;
        align-items: stretch;
    }

    .deposit-address-row .action-submit {
        width: 100%;
    }
}

.withdraw-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.history-trigger-btn {
    border: 1px solid #d9e0e7;
    background: #ffffff;
    color: #3a506a;
    border-radius: 8px;
    height: 38px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}

.history-badge {
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.withdraw-balance-card {
    background: #f3f8ff;
    border: 1px solid #d5e7ff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.withdraw-balance-card span {
    font-size: 13px;
    color: #5d7288;
}

.withdraw-balance-card strong {
    font-size: 20px;
    color: #28588c;
}

.withdraw-amount-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.withdraw-amount-wrap input {
    flex: 1;
}

.max-btn {
    min-width: 74px;
    height: 40px;
    padding: 0 14px;
}

#withdrawAmountHint {
    color: #7a8da2;
    font-size: 12px;
}

.withdraw-form-message {
    font-size: 13px;
    margin-top: 12px;
    min-height: 18px;
    color: #617488;
}

.withdraw-form-message.success {
    color: #1f8a68;
}

.withdraw-form-message.error {
    color: #d3534f;
}

.history-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.history-card-head h3 {
    font-size: 20px;
}

.history-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.history-inline-btn {
    border: 1px solid #d9e0e7;
    background: #ffffff;
    color: #405468;
    border-radius: 8px;
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.history-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    min-width: 82px;
    padding: 4px 10px;
}

.history-status.status-pending {
    background: #7b66c7;
}

.history-status.status-approved {
    background: #22be94;
}

.history-status.status-rejected {
    background: #f06c68;
}

.history-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 27, 40, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 2000;
}

.history-modal-overlay.is-open {
    display: flex;
}

.history-modal,
.funds-modal {
    width: min(760px, 100%);
    max-height: 86dvh;
    overflow: auto;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #dbe2ea;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
    padding: 18px;
}

.funds-modal {
    width: min(460px, 100%);
}

.history-modal-head,
.funds-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.history-close-btn {
    border: 1px solid #d9e0e7;
    background: #fff;
    color: #5b6e83;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    cursor: pointer;
}

.history-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.history-stat-item {
    background: #f8fbff;
    border: 1px solid #dde8f4;
    border-radius: 10px;
    padding: 10px;
}

.history-stat-item strong {
    display: block;
    font-size: 18px;
    color: #2a4661;
}

.history-stat-item span {
    font-size: 12px;
    color: #70839a;
}

.history-modal-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    border: 1px solid #dde5ee;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fbfdff;
}

.history-item p {
    margin-top: 4px;
    color: #6b7f94;
    font-size: 12px;
}

.history-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.history-item-meta strong {
    color: #2a4661;
}

.history-item-meta small,
.history-empty,
.funds-copy {
    color: #6b7f94;
    font-size: 12px;
}

.funds-submit {
    width: 100%;
    margin-top: 8px;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 800px) {
    .action-card {
        padding: 14px;
    }

    .withdraw-header-row {
        align-items: flex-start;
    }

    .history-trigger-btn {
        width: 100%;
        justify-content: center;
    }

    .history-stats-grid {
        grid-template-columns: 1fr;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-item-meta {
        align-items: flex-start;
    }

    .withdraw-amount-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .max-btn {
        width: 100%;
    }

    .rich-dropdown-list {
        max-height: 38dvh;
    }
}

@media (max-width: 560px) {
    .action-page {
        padding-top: 8px;
    }

    .action-page h1 {
        font-size: 28px;
        margin-bottom: 6px;
    }

    .action-subtitle {
        margin-bottom: 12px;
    }

    .withdraw-balance-card strong {
        font-size: 18px;
    }

    .rich-dropdown-trigger,
    .action-field input,
    .action-field textarea,
    .action-submit,
    .history-inline-btn {
        height: 42px;
    }

    .rich-dropdown-menu {
        padding: 8px;
    }

    .rich-option {
        min-height: 42px;
        padding: 8px;
        gap: 8px;
    }

    .rich-option-badge {
        padding: 2px 7px;
        font-size: 9px;
    }

    .history-modal,
    .funds-modal {
        width: 100%;
        border-radius: 12px;
        padding: 14px;
    }

    .history-modal-overlay {
        padding: 10px;
    }

    .history-card-actions {
        width: 100%;
    }

    .history-inline-btn {
        flex: 1;
    }
}