* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    color: white;
    padding: 20px 0;
}
header h1 { font-size: 2rem; margin-bottom: 8px; }
.tagline { opacity: 0.9; font-size: 1rem; }

.wallets-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}
.wallet-badge {
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
}
.dmoney  { background: #e63946; }
.waafi   { background: #2a9d8f; }
.cacpay  { background: #f4a261; }

.card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.card h2 {
    color: #4a4a8a;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}
legend {
    color: #667eea;
    font-weight: bold;
    padding: 0 8px;
}

label {
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
}

.summary {
    background: #f0f4ff;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
}

.btn-primary, .btn-secondary, .btn-small,
.btn-success, .btn-warning, .btn-danger {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    margin: 5px 5px 5px 0;
    transition: transform 0.2s;
    color: white;
}
.btn-primary   { background: #667eea; }
.btn-secondary { background: #6c757d; }
.btn-success   { background: #28a745; }
.btn-warning   { background: #ffc107; color: #333; }
.btn-danger    { background: #dc3545; }
.btn-small     { padding: 6px 12px; font-size: 0.85rem; }

.btn-primary:hover, .btn-success:hover { transform: translateY(-2px); }

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}
.status-pending   { background: #ffc107; color: #333; }
.status-received  { background: #17a2b8; }
.status-sent      { background: #28a745; }
.status-cancelled { background: #dc3545; }

.reference {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    margin: 15px 0;
    border: 2px dashed #ffc107;
}

.instructions {
    background: #e8f5e9;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}
.instructions ol { padding-left: 20px; }
.instructions li { margin: 8px 0; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.stat-card h3 { color: #888; font-size: 0.9rem; }
.stat-card p  { font-size: 1.8rem; font-weight: bold; color: #4a4a8a; margin-top: 5px; }

.table-responsive { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}
th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}
th { background: #f5f5f5; color: #555; }

.transfer-details {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}
.transfer-details p { margin: 8px 0; }

.error { color: #dc3545; background: #f8d7da; padding: 10px; border-radius: 8px; }
.success { color: #155724; background: #d4edda; padding: 10px; border-radius: 8px; }
.info { color: #0c5460; background: #d1ecf1; padding: 10px; border-radius: 8px; }

footer {
    text-align: center;
    color: white;
    padding: 20px;
    margin-top: 20px;
}
footer a { color: white; }

.logout {
    float: right;
    background: #dc3545;
    color: white !important;
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
}

/* Section commissions */
.stat-card.fees {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}
.stat-card.fees h3 { color: rgba(255,255,255,0.9); }
.stat-card.fees p { color: white; }

/* Grille de statistiques par wallet */
.wallet-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.wallet-stat-card {
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.wallet-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.wallet-stat-card.dmoney {
    background: linear-gradient(135deg, #e63946 0%, #c62828 100%);
    color: white;
}
.wallet-stat-card.waafi {
    background: linear-gradient(135deg, #2a9d8f 0%, #1e7a6f 100%);
    color: white;
}
.wallet-stat-card.cacpay {
    background: linear-gradient(135deg, #f4a261 0%, #e76f51 100%);
    color: white;
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,0.3);
}

.wallet-icon {
    font-size: 1.3rem;
    font-weight: bold;
}

.wallet-count {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.wallet-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wallet-amount, .wallet-fees {
    display: flex;
    flex-direction: column;
}

.wallet-amount small, .wallet-fees small {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 3px;
}

.wallet-amount strong, .wallet-fees strong {
    font-size: 1.3rem;
    font-weight: bold;
}

.wallet-fees {
    background: rgba(255,255,255,0.15);
    padding: 10px;
    border-radius: 8px;
    margin-top: 5px;
}

/* Responsive mobile */
@media (max-width: 600px) {
    .wallet-stats-grid {
        grid-template-columns: 1fr;
    }
    .wallet-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Mobile */
@media (max-width: 600px) {
    header h1 { font-size: 1.5rem; }
    .card { padding: 18px; }
    table { font-size: 0.8rem; }
    th, td { padding: 6px; }
    .btn-primary, .btn-secondary { width: 100%; margin: 5px 0; }
}