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

/* =============================
   Yelii Wallets - Harmonisation style agrégateurs
   ============================= */
#yelii-wallets .table,
#yelii-wallets .data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
#yelii-wallets .table thead th,
#yelii-wallets .data-table thead th {
    background: #28a745; /* même vert que agents/aggrégateurs */
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}
#yelii-wallets .table th,
#yelii-wallets .table td,
#yelii-wallets .data-table th,
#yelii-wallets .data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}
#yelii-wallets .table tbody tr:hover,
#yelii-wallets .data-table tbody tr:hover {
    background: #f8f9fa;
}

/* Badges de statut pour Yelii wallets */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}
.status-badge.status-active { background: #d4edda; color: #155724; }
.status-badge.status-inactive { background: #f8d7da; color: #721c24; }
.status-badge.status-blocked { background: #ffeeba; color: #856404; }
.status-badge.active { background: #d4edda; color: #155724; }
.status-badge.inactive { background: #f8d7da; color: #721c24; }
.status-badge.pending { background: #e2e3e5; color: #6c757d; }

/* =============================
   Welcome Bonus Panel (ywb-panel)
   ============================= */
#ywb-panel .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#ywb-panel .card-title {
    font-weight: 700;
}
#ywb-panel .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
#ywb-panel .form-group label {
    font-weight: 600;
}

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

/* Permissions grid pour agrégateurs */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-color, #333);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #007bff;
}

/* Styles pour les transactions */
.transaction-type {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.transaction-type.credit { background: #d4edda; color: #155724; }
.transaction-type.debit { background: #f8d7da; color: #721c24; }
.transaction-type.deposit { background: #d1ecf1; color: #0c5460; }
.transaction-type.withdrawal { background: #fff3cd; color: #856404; }

.amount.positive { color: #28a745; font-weight: 600; }
.amount.negative { color: #dc3545; font-weight: 600; }

.user-info .user-name { font-weight: 600; font-size: 0.875rem; }
.user-info .user-phone { font-size: 0.75rem; color: #6c757d; }

.date-info .date { font-weight: 600; font-size: 0.875rem; }
.date-info .description { font-size: 0.75rem; color: #6c757d; margin-top: 0.125rem; }

/* Amélioration des tables */
.data-table td {
    padding: 0.75rem 0.5rem;
    vertical-align: top;
}

.user-info, .date-info {
    line-height: 1.3;
}

/* Styles pour agrégateurs */
.company-info .company-name { font-weight: 600; font-size: 0.875rem; }
.company-info .permissions-count { font-size: 0.75rem; color: #6c757d; }

.api-key-info .api-key { 
    font-family: monospace; 
    font-size: 0.75rem; 
    background: #f8f9fa; 
    padding: 0.125rem 0.25rem; 
    border-radius: 0.25rem;
}
.api-key-info .last-api-call { font-size: 0.75rem; color: #6c757d; margin-top: 0.125rem; }

.login-info .last-login { font-weight: 600; font-size: 0.875rem; }
.login-info .login-status { font-size: 0.75rem; color: #6c757d; }

.wallet-amount { font-weight: 600; color: #28a745; }

.user-type { 
    font-size: 0.7rem; 
    color: #6c757d; 
    margin-top: 0.125rem;
    font-weight: 500;
}

/* Styles modernes pour les transactions */
.modern-table {
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.modern-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.transaction-row {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.transaction-row:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.transaction-id {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
}

.transaction-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.transaction-type-badge.credit {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.transaction-type-badge.debit {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.transaction-type-badge.deposit {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
}

.user-avatar.agent {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

.user-avatar.aggregator {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.user-details .user-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.125rem;
}

.user-details .user-phone {
    font-size: 0.75rem;
    color: #64748b;
}

.amount-display {
    text-align: right;
}

.amount-value {
    font-size: 1rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
}

.amount-display.positive .amount-value {
    color: #059669;
}

.amount-display.negative .amount-value {
    color: #dc2626;
}

.amount-type {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.8;
}

.date-description {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.transaction-date {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
}

.transaction-description {
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
}

.status-badge.completed {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

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

.form-container h2 {
    color: #667eea;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.forfait-info,
.result,
.agent-info,
.wallet-info,
.transactions,
.agents-list,
.transactions-admin {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.forfait-info h3,
.result h3,
.agent-info h3,
.wallet-info h3,
.transactions h3,
.agents-list h2,
.transactions-admin h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.forfait-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #667eea;
}

.forfait-details p {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.forfait-details strong {
    color: #667eea;
}

.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #667eea;
}

/* Styles pour les liens */
.links {
    text-align: center;
    margin-top: 2rem;
}

.link {
    color: #007bff;
    text-decoration: none;
    margin: 0 1rem;
    padding: 0.5rem 1rem;
    border: 1px solid #007bff;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.link:hover {
    background-color: #007bff;
    color: white;
    text-decoration: none;
}

/* Styles pour les agents */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.agent-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.agent-card h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.agent-card p {
    margin: 0.25rem 0;
    color: #666;
}

.balance {
    color: #28a745;
    font-weight: bold;
}

/* Styles pour les transactions */
.transactions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.transaction-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.transaction-type {
    font-weight: bold;
}

.transaction-type.green {
    color: #28a745;
}

.transaction-type.red {
    color: #dc3545;
}

.transaction-amount {
    font-weight: bold;
    color: #333;
}

.transaction-body p {
    margin: 0.25rem 0;
    color: #666;
}

.transactions-list {
    margin-top: 1rem;
}

.transaction-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Styles pour le filtre */
.filter-section {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-section label {
    font-weight: bold;
    color: #333;
}

.filter-section select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex: 1;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Styles pour les informations agent */
.agent-details, .wallet-details {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.agent-details p, .wallet-details p {
    margin: 0.5rem 0;
    color: #333;
}

/* Styles pour les modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

.large-modal .modal-content {
    max-width: 900px;
    max-height: 80vh;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

.modal-header.success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.modal-header.error {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #000;
}

.modal-header .close {
    color: white;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
    border-radius: 0 0 10px 10px;
}

/* Modals portefeuille Yelii */
.yelii-modal {
    border-radius: 12px;
    overflow: hidden;
}

.yelii-modal-header {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 1.5rem;
    border-bottom: none;
}

.yelii-modal-body {
    padding: 1.5rem;
}

.yelii-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f1f5f9;
}

/* Styles pour le résumé de transaction */
.transaction-summary {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .label {
    font-weight: 600;
    color: #666;
}

.summary-item .value {
    font-weight: bold;
    color: #333;
}

.success-status {
    color: #28a745;
}

/* Styles pour l'historique */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #5a6268;
}

.history-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

.history-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.history-table th,
.history-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.history-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
}

.history-table tr:hover {
    background: #f8f9fa;
}

.transaction-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.transaction-type.credit {
    background: #d4edda;
    color: #155724;
}

.transaction-type.debit {
    background: #f8d7da;
    color: #721c24;
}

.history-summary {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

.history-summary .summary-item {
    text-align: center;
    border: none;
    padding: 0;
}

.history-summary .label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}

.history-summary .value {
    display: block;
    font-size: 1.1rem;
    font-weight: bold;
}

.history-summary .value.credit {
    color: #28a745;
}

.history-summary .value.debit {
    color: #dc3545;
}

.modal-footer {
    border-top: 1px solid #eee;
    padding-top: 1rem;
    text-align: right;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Styles pour le tableau des agents */
.agents-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.agents-table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.agents-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.agents-table th,
.agents-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.agents-table th {
    background: #28a745;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.agents-table tr:hover {
    background: #f8f9fa;
}

.agent-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.agent-status.active {
    background: #d4edda;
    color: #155724;
}

.agent-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.agent-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-action.credit {
    background: #28a745;
    color: white;
}

.btn-action.credit:hover {
    background: #218838;
}

.btn-action.debit {
    background: #dc3545;
    color: white;
}

.btn-action.debit:hover {
    background: #c82333;
}

.btn-action.view {
    background: #17a2b8;
    color: white;
}

.btn-action.view:hover {
    background: #138496;
}

.agents-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.agents-summary .value.active {
    color: #28a745;
}

/* Responsive pour le dashboard */
@media (max-width: 768px) {
    .dashboard-kpi {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .kpi-card {
        padding: 1rem;
    }
    
    .kpi-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }
    
    .kpi-value {
        font-size: 1.5rem;
    }
    
    .export-actions {
        flex-direction: column;
    }
    
    .history-filters {
        grid-template-columns: 1fr;
    }
    
    .history-summary {
        grid-template-columns: 1fr;
    }
    
    .large-modal .modal-content {
        min-width: 95%;
        margin: 1rem;
    }
}

.btn-action.reset {
    background: #ffc107;
    color: #000;
}

.btn-action.reset:hover {
    background: #e0a800;
}

.btn-action.edit {
    background: #17a2b8;
    color: white;
}

.btn-action.edit:hover {
    background: #138496;
}

.btn-action.delete {
    background: #dc3545;
    color: white;
}

.btn-action.delete:hover {
    background: #c82333;
}

.agent-info {
    color: #1a2d13;
    font-weight: 500;
}

@media (max-width: 700px) {
    .header-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 8px;
    }
    .logo-container {
        justify-content: center;
        margin: 0 0 8px 0;
    }
    .agent-info {
        align-items: center;
        text-align: center;
        margin: 0 0 8px 0;
    }
    .header-actions {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    .header-actions button {
        width: 100%;
        font-size: 1.1rem;
        padding: 12px 0;
    }
} 

/* Styles pour le dashboard KPI */
.dashboard-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.kpi-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-radius: 12px;
}

.kpi-content h3 {
    margin: 0 0 0.5rem 0;
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
}

/* Styles pour les boutons d'export */
.export-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.btn-export {
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-export:hover {
    background: #138496;
}

/* Modal d'historique */
.large-modal .modal-content {
    min-width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.modal-header h3 {
    margin: 0;
    color: #28a745;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #333;
}

.modal-body {
    flex: 1;
}

.history-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.history-table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.history-table th,
.history-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.history-table th {
    background: #28a745;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.history-table tr:hover {
    background: #f8f9fa;
}

.transaction-type.credit {
    color: #28a745;
    font-weight: bold;
}

.transaction-type.debit {
    color: #dc3545;
    font-weight: bold;
}

.success-status {
    color: #28a745;
    font-weight: bold;
}

.history-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
}

.summary-item .label {
    font-weight: 600;
    color: #333;
}

.summary-item .value {
    font-weight: bold;
    font-size: 1.1rem;
}

.summary-item .value.credit {
    color: #28a745;
}

.summary-item .value.debit {
    color: #dc3545;
}

.modal-footer {
    border-top: 1px solid #eee;
    padding-top: 1rem;
    text-align: right;
}

.btn-primary {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Styles pour le tableau des agents */
.agents-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.agents-table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.agents-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.agents-table th,
.agents-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.agents-table th {
    background: #28a745;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.agents-table tr:hover {
    background: #f8f9fa;
}

.agent-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.agent-status.active {
    background: #d4edda;
    color: #155724;
}

.agent-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.agent-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-action.credit {
    background: #28a745;
    color: white;
}

.btn-action.credit:hover {
    background: #218838;
}

.btn-action.debit {
    background: #dc3545;
    color: white;
}

.btn-action.debit:hover {
    background: #c82333;
}

.btn-action.view {
    background: #17a2b8;
    color: white;
}

.btn-action.view:hover {
    background: #138496;
}

.agents-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.agents-summary .value.active {
    color: #28a745;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .agents-grid,
    .transactions-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .history-filters {
        flex-direction: column;
    }

    .history-summary {
        flex-direction: column;
        gap: 15px;
    }

            .header-actions {
            flex-direction: column;
            gap: 5px;
        }
    }