* { box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: #f5f7fb; margin: 0; padding: 20px; color: #333; }
.container { max-width: 1200px; margin: auto; }

/* Toast */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    align-items: center;
    pointer-events: none;
}
.toast {
    padding: 12px 24px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: auto;
    animation: slideUp 0.3s ease forwards;
}
.toast.toast-exit {
    animation: slideDown 0.3s ease forwards;
}
.toast-success { background: #2ecc71; }
.toast-error { background: #e74c3c; }
.toast-info { background: #3498db; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(50px); }
}
/* Spinner */
.spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: white;
    border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; margin-right: 5px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Formulaires */
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 4px; font-weight: 600; }
input, select, textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px; font-size: 14px; }
input[type="file"] { padding: 8px; }
button { padding: 10px 20px; border: none; border-radius: 5px; background: #2c3e50; color: white; cursor: pointer; font-weight: 600; }
button:hover { background: #34495e; }
button:disabled { opacity: 0.7; cursor: not-allowed; }

/* Cartes & tableaux */
.card { background: white; border-radius: 8px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f8f9fa; }

/* Modale QR */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); justify-content: center; align-items: center; }
.modal-content { background: white; padding: 30px; border-radius: 10px; text-align: center; }
.modal .close { float: right; font-size: 24px; cursor: pointer; }

/* Boutons action */
.btn-approve { background: #27ae60; margin-right: 5px; }
.btn-cancel { background: #e74c3c; }
.btn-qr { background: #16a085; }

/* Agent scanner */
#reader { width: 300px; margin: auto; display: none; }

/* Stats summary cards */
.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}
.summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: white;
}
.summary-icon.blue { background: #3498db; }
.summary-icon.green { background: #27ae60; }
.summary-icon.emerald { background: #16a085; }
.summary-icon.orange { background: #f39c12; }
.summary-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}
.summary-card h3 {
    margin: 0;
    font-size: 1.4em;
    color: #2c3e50;
}

/* Charts grid */
.stats-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
}
.chart-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.chart-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
}
.chart-card canvas {
    width: 100% !important;
    max-height: 300px;
}