/* ========================================
   WALLET PAGE – Dashboard
   ======================================== */

/* ===== STATISTIK-KACHELN ===== */
.wallet-stats-grid {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.wallet-stat-card {
    background: var(--bg-secondary);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 16px;
    padding: 16px 20px;
    transition: 0.2s;
    width: 100%;
    text-align: center;
}

.wallet-stat-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
}

.wallet-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.wallet-stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.wallet-stat-card .stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

/* ===== ABHEBUNG (WITHDRAW) ===== */
.wallet-withdraw {
    background: var(--bg-secondary);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.withdraw-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.withdraw-balance {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.withdraw-balance strong {
    color: var(--text-primary);
    font-size: 1.2rem;
}

.withdraw-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.withdraw-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.withdraw-actions .btn-primary,
.withdraw-actions .btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
}

.withdraw-actions .btn-primary img,
.withdraw-actions .btn-secondary img {
    width: 20px;
    height: 20px;
}

/* ===== SWITCH + FILTER WRAPPER ===== */
.wallet-switch-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

/* ===== SWITCH BUTTONS ===== */
.switch-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-switch {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 30px;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.5;
}

.btn-switch.active {
    opacity: 1;
    border-color: var(--accent-violet);
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.08);
}

.btn-switch:hover {
    opacity: 0.8;
}

/* ===== WALLET FILTER ===== */
.wallet-filter {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.wallet-filter .filter-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.wallet-filter .filter-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.wallet-filter .filter-group input[type="month"] {
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

.wallet-filter .filter-group input[type="month"]:focus {
    border-color: var(--accent-violet);
}

.wallet-filter .btn-secondary {
    padding: 8px 20px;
}

/* ===== WALLET VIEW (Transactions / Withdrawals) ===== */
.wallet-view {
    display: none;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.wallet-view.active {
    display: block;
}

.wallet-view h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* ===== GRID WRAPPER (sticky header + scrollbare Liste) ===== */
.wallet-grid-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.08);
}

/* ===== GRID HEADER (sticky) ===== */
.wallet-grid-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr 1fr 1fr;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* ===== GRID BODY (scrollbar) ===== */
.wallet-grid-body {
    max-height: 450px;
    overflow-y: auto;
}

.wallet-grid-body::-webkit-scrollbar {
    width: 4px;
}

.wallet-grid-body::-webkit-scrollbar-track {
    background: transparent;
}

.wallet-grid-body::-webkit-scrollbar-thumb {
    background: var(--accent-violet);
    border-radius: 2px;
}

/* ===== GRID ROW ===== */
.wallet-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr 1fr 1fr;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    align-items: center;
}

.wallet-grid-row:last-child {
    border-bottom: none;
}

.wallet-grid-row:hover {
    background: #222;
}

/* ===== STATUS BADGES (innerhalb der Grids) ===== */
.wallet-grid-row .status-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    width: fit-content;
}

.wallet-grid-row .status-badge.success {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

.wallet-grid-row .status-badge.pending {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.wallet-grid-row .status-badge.failed {
    background: rgba(236, 72, 153, 0.15);
    color: var(--accent-pink);
}

.wallet-filter .filter-group input[type="month"] {
    filter: invert(1) !important;
    background: #e5e5e5;
    color: black;
    border-color: #a8c56ce8;
}

.withraw-info-grid {
    display: flex;
    gap: 20px;
}

.withdraw-hint {
    padding: 5px 10px;
    background: #252525;
    border: 1px solid #5936ac;
    border-radius: 10px;
}

.wallet-bank-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.wallet-bank-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

.wallet-bank-input:focus {
    border-color: rgba(139, 92, 246, 0.6);
}

.bank-grid {
    display: flex;
    align-items: center;
    gap: 20px;
}

#wallet-payout-setup img {
    width: 20px;
    height: 20px;
}

#wallet-payout-setup {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    width: max-content;
}

.withdrawal-setup {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wallet-payout-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallet-payout-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.wallet-payout-modal-content {
    position: relative;
    width: min(420px, calc(100vw - 32px));
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 18px;
}

.wallet-payout-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wallet-payout-modal-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.wallet-payout-modal-close {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
}

.wallet-payout-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 0 24px;
}

.wallet-payout-currency {
    color: var(--text-secondary);
    font-size: 1rem;
}

#wallet-payout-amount {
    margin: 6px 0;
    color: var(--text-primary);
    font-size: 3rem;
    font-weight: 600;
}

.wallet-payout-available {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.wallet-payout-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.wallet-payout-presets button {
    padding: 8px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
}

.wallet-payout-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.wallet-payout-key {
    height: 58px;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.wallet-payout-key:hover {
    background: rgba(139, 92, 246, 0.1);
}

.wallet-payout-delete {
    color: var(--text-secondary);
}

.wallet-payout-submit {
    width: 100%;
    margin-top: 20px;
    padding: 12px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--accent-primary);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.wallet-payout-submit:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.payout-status-completed {
    color: #22c55e;
}

.payout-status-pending {
    color: #ffffff;
}

.payout-status-rejected {
    color: #ef4444;
}

.payout-status-not_configured {
    color: #8a8a8a;
}

.wallet-payout-submit:hover {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.wallet-payout-modal-close:hover {
    color: #ef4444;
}

.wallet-payout-sufficient {
    color: #22c55e;
}

.wallet-payout-sufficient strong {
    color: #22c55e;
}

.wallet-payout-insufficient {
    color: #ef4444;
}

.wallet-payout-insufficient strong {
    color: #ef4444;
}

.transaction-header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Mobile */
@media (max-width: 768px) {

    .wallet-withdraw {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .withdraw-actions {
        justify-content: center;
    }

    .wallet-switch-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .switch-buttons {
        justify-content: center;
    }

    .wallet-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .wallet-filter .filter-group {
        width: 100%;
    }

    .wallet-filter .filter-group input[type="month"] {
        width: 100%;
    }

    .wallet-filter .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* Grid auf 3 Spalten reduzieren */
    .wallet-grid-header,
    .wallet-grid-row {
        grid-template-columns: 1fr 1fr 1fr;
        font-size: 0.8rem;
        gap: 8px;
    }

    /* Referenz-Spalte ausblenden */
    .wallet-grid-header span:nth-child(3),
    .wallet-grid-row span:nth-child(3) {
        display: none;
    }

    .wallet-grid-body {
        max-height: 250px;
    }
}

/* Kleine Smartphones */
@media (max-width: 480px) {

    .wallet-stat-card {
        padding: 12px 16px;
    }

    .wallet-stat-card .stat-value {
        font-size: 1.3rem;
    }

    .wallet-grid-header,
    .wallet-grid-row {
        grid-template-columns: 1fr 1fr 1fr 1fr;
        font-size: 0.6rem;
        gap: 4px;
        padding: 6px 10px;
    }

    .wallet-grid-body {
        max-height: 200px;
    }

    .btn-switch {
        font-size: 0.8rem;
        padding: 4px 12px;
    }

    .wallet-withdraw {
        padding: 14px;
    }

    .wallet-view {
        padding: 10px;
    }

    .wallet-filter .filter-group input[type="month"] {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .products-grid-row {
        grid-template-columns: 2fr 2fr 2fr 1fr !important;
    }

    #product-creator-form {
        flex-direction: column !important;
    }
}