.twd-app { max-width: 620px; margin: 0 auto; font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

/* ---------- Header (tankou MonCash) ---------- */

.twd-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}
.twd-header-profile { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.twd-header-profile img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; display: block; }
.twd-header-profile-text { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.twd-header-profile-text strong { font-size: 14px; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.twd-header-profile-text span { font-size: 11px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.twd-header-avatar-wrap { position: relative; flex-shrink: 0; }
.twd-header-avatar-edit {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #b0121f;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    text-decoration: none;
}
.twd-header-avatar-edit:hover { background: #8a0e1c; }

.twd-header-icons { display: flex; gap: 8px; flex-shrink: 0; }
.twd-header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f1f1f4;
    border: none;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}
.twd-header-icon-btn:hover { background: #b0121f; color: #fff; }

/* ---------- Hero Balans (tankou Pòtfèy MonCash) ---------- */

.twd-balance-hero {
    background: linear-gradient(135deg, #7a0d18 0%, #b0121f 55%, #8a0e1c 100%);
    border-radius: 20px;
    padding: 22px 24px;
    color: #fff;
    box-shadow: 0 8px 22px rgba(176,18,31,0.3);
    margin-bottom: 20px;
}
.twd-balance-hero-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.twd-balance-hero-label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: rgba(255,255,255,0.85); font-style: italic; }

.twd-eye-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    padding: 4px;
    display: flex;
}

.twd-balance-hero-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.twd-balance-hero-amount { font-size: 32px; font-weight: 800; color: #fff; }
.twd-refresh-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    display: flex;
}
.twd-refresh-btn.twd-spinning svg { animation: twd-spin 0.8s linear infinite; }
@keyframes twd-spin { to { transform: rotate(360deg); } }

.twd-hero-actions { display: flex; gap: 12px; }
.twd-hero-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}
.twd-hero-btn-light { background: #fff; color: #b0121f !important; }
.twd-hero-btn-outline { background: rgba(255,255,255,0.12); color: #fff !important; border: 1px solid rgba(255,255,255,0.3); }

/* ---------- Dekouvri (grid ikon tankou "Découvrez MonCash") ---------- */

.twd-discover { margin-bottom: 20px; }
.twd-discover-title { font-size: 15px; font-weight: 800; color: #111; margin: 0 0 12px; }

.twd-discover-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 18px 12px;
}

.twd-discover-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.twd-discover-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #f4f4f7;
    color: #b0121f;
    display: flex;
    align-items: center;
    justify-content: center;
}
.twd-discover-item span:last-child {
    font-size: 10.5px;
    color: #333;
    text-align: center;
    line-height: 1.3;
}

.twd-primary-btn {
    background: #b0121f;
    color: #fff !important;
    border: none;
    border-radius: 10px;
    padding: 13px 20px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-shadow: 0 4px 14px rgba(176,18,31,0.3);
}
.twd-primary-btn:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; }

.twd-message { font-size: 13px; margin-top: 10px; color: #b0121f; min-height: 16px; }

/* ---------- Seksyon ---------- */

.twd-section {
    background: #f8fafc;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
}
.twd-section-dark { background: #14141f; border-color: #14141f; }

.twd-section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; color: #111; margin: 0 0 6px; }
.twd-section-dark .twd-section-title { color: #fff; }

.twd-section-note { font-size: 12px; color: #888; margin-bottom: 14px; }
.twd-section-dark .twd-section-note { color: rgba(255,255,255,0.6); }

.twd-field { margin-bottom: 14px; }
.twd-field:last-child { margin-bottom: 0; }
.twd-field label { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 12px; margin-bottom: 6px; color: #111; }
.twd-section-dark .twd-field label { color: rgba(255,255,255,0.85); }

.twd-field input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #ddd;
    font-size: 14px;
    box-sizing: border-box;
}
.twd-section-dark .twd-field input {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    color: #fff;
}

.twd-method-row { display: flex; gap: 8px; }
.twd-method-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #ddd;
    background: #f8fafc;
    color: #555;
    font-weight: 700;
    cursor: pointer;
}
.twd-method-btn.active { border-color: #b0121f; background: #b0121f; color: #fff; }

/* ---------- QR ---------- */

.twd-qr-section { text-align: center; }
.twd-qr-box {
    display: flex;
    justify-content: center;
    padding: 14px;
    background: #fff;
    border-radius: 12px;
    max-width: 200px;
    margin: 0 auto;
}
.twd-qr-box img { border-radius: 6px; }

.twd-scan-btn {
    width: 100%;
    background: #b0121f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}
.twd-scan-btn:hover { background: #8a0e1c; }

.twd-scanner-box {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.twd-scanner-box h3 { color: #111; margin: 0 0 14px; font-size: 16px; }
.twd-scanner-box video {
    width: 100%;
    border-radius: 12px;
    background: #000;
    max-height: 320px;
    object-fit: cover;
}
.twd-scanner-note { color: #888; font-size: 12px; margin: 12px 0 0; }
.twd-scanner-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f1f1f4;
    color: #333;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
}
.twd-scanner-close:hover { background: #b0121f; color: #fff; }

.twd-scanner-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    color: #999;
    font-size: 11px;
    text-transform: uppercase;
}
.twd-scanner-divider::before,
.twd-scanner-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #eee;
}

.twd-scanner-gallery-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #f4f4f7;
    color: #333;
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 11px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-sizing: border-box;
}
.twd-scanner-gallery-btn:hover { border-color: #b0121f; color: #b0121f; }

/* ---------- Verifikasyon/redeem ---------- */

.twd-id-verify-row { display: flex; gap: 8px; }
.twd-id-verify-row input { flex: 1; }

.twd-verify-btn {
    flex-shrink: 0;
    background: #b0121f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ---------- Tranzaksyon ---------- */

.twd-tx-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 4px;
}
.twd-tx-list::-webkit-scrollbar { width: 6px; }
.twd-tx-list::-webkit-scrollbar-track { background: transparent; }
.twd-tx-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 999px; }

.twd-tx-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #eee;
}
.twd-tx-note { font-size: 12px; color: #333; }
.twd-tx-date { display: block; font-size: 10px; color: #999; margin-top: 2px; }
.twd-tx-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.twd-tx-amount { font-weight: 800; font-size: 13px; color: #146c3a; white-space: nowrap; }
.twd-tx-debit .twd-tx-amount { color: #b0121f; }

.twd-tx-status {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.twd-status-pending { background: #fff3e0; color: #a35a08; }
.twd-status-paid { background: #e6f4ea; color: #146c3a; }
.twd-status-rejected { background: #fbe4e4; color: #b0121f; }

/* ---------- Popup konfimasyon retrè ---------- */

.twd-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,10,15,0.72);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.twd-modal-box {
    background: #fff;
    border-radius: 18px;
    padding: 32px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    position: relative;
    max-height: 88vh;
    overflow-y: auto;
}

.twd-modal-box-dark { background: #14141f; }
.twd-modal-box-dark h3 { color: #fff; }
.twd-modal-box-dark .twd-modal-note { color: rgba(255,255,255,0.6); }
.twd-modal-box-dark .twd-field label { color: rgba(255,255,255,0.85); }
.twd-modal-box-dark .twd-field input {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    color: #fff;
}

.twd-modal-box-wide { max-width: 460px; }

.twd-field-left { text-align: left; }

.twd-target-note {
    display: block;
    font-size: 11px;
    color: #146c3a;
    margin-top: 6px;
    font-weight: 700;
}

.twd-modal-x {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f1f1f4;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.twd-modal-box-dark .twd-modal-x { background: rgba(255,255,255,0.1); color: #fff; }
.twd-modal-x:hover { background: #b0121f; color: #fff; }

.twd-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #146c3a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.twd-modal-box h3 { margin: 0 0 6px; font-size: 19px; color: #111; }
.twd-modal-note { font-size: 13px; color: #888; margin: 0 0 20px; }

.twd-modal-details {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 22px;
    text-align: left;
}
.twd-modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px solid #eee;
}
.twd-modal-row:last-child { border-bottom: none; }
.twd-modal-row span { color: #888; }
.twd-modal-row strong { color: #111; }
.twd-modal-row-total strong { color: #146c3a; font-size: 15px; }

@media (max-width: 480px) {
    .twd-balance-hero-amount { font-size: 26px; }
}
