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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f2f5;
    color: #1a1a1a;
    min-height: 100vh;
}

.container { max-width: 1000px; margin: 0 auto; padding: 20px; }
.login-container { max-width: 400px; margin-top: 80px; text-align: center; }

h1 { font-size: 24px; margin-bottom: 4px; }
h2 { font-size: 18px; margin-bottom: 16px; }
.subtitle { color: #666; margin-bottom: 30px; }

/* Cards */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Forms */
.form-group { margin-bottom: 12px; text-align: left; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #444; }
.form-group input, .form-group select {
    width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 14px; outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: #2F5496; }

/* Buttons */
.btn {
    display: inline-block; padding: 10px 20px; border: none; border-radius: 6px;
    font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.btn-primary { background: #2F5496; color: #fff; width: 100%; margin-top: 8px; }
.btn-primary:hover { background: #1e3a6e; }
.btn-primary:disabled { background: #a0b4d0; cursor: not-allowed; }
.btn-link { background: none; color: #2F5496; font-size: 13px; margin-top: 8px; }
.btn-small { padding: 6px 14px; font-size: 13px; }
.btn-green { background: #27ae60; color: #fff; }
.btn-green:hover { background: #1e8c4c; }
.btn-outline { background: #fff; color: #2F5496; border: 1px solid #2F5496; }
.btn-outline:hover { background: #f0f4fa; }

/* Errors & alerts */
.error { color: #c0392b; font-size: 13px; margin-top: 8px; padding: 8px; background: #fce4e4; border-radius: 4px; }
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.alert-warning { background: #fff3cd; color: #856404; }
.alert-danger { background: #f8d7da; color: #721c24; }
.alert-success { background: #d4edda; color: #155724; }

/* Header */
.header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; margin-bottom: 20px; border-bottom: 1px solid #ddd;
}
.header h1 { font-size: 18px; }
.header .user-info { font-size: 13px; color: #666; }
.header .user-info a { color: #c0392b; cursor: pointer; margin-left: 12px; }

/* Steps */
.step { display: none; }
.step.active { display: block; }
.step-indicator { display: flex; gap: 8px; margin-bottom: 20px; }
.step-indicator .dot {
    width: 32px; height: 32px; border-radius: 50%; background: #ddd;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: #888;
}
.step-indicator .dot.active { background: #2F5496; color: #fff; }
.step-indicator .dot.done { background: #27ae60; color: #fff; }

/* Upload zone */
.upload-zone {
    border: 2px dashed #ccc; border-radius: 8px; padding: 40px;
    text-align: center; cursor: pointer; transition: border-color 0.2s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: #2F5496; background: #f8faff; }
.upload-zone p { color: #888; font-size: 14px; }
.upload-zone .icon { font-size: 36px; margin-bottom: 8px; }

/* Mois grid */
.mois-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.mois-card {
    border: 1px solid #ddd; border-radius: 6px; padding: 12px; cursor: pointer;
    transition: all 0.2s;
}
.mois-card:hover { border-color: #2F5496; background: #f8faff; }
.mois-card.selected { border-color: #2F5496; background: #e8f0fe; }
.mois-card h3 { font-size: 15px; margin-bottom: 4px; }
.mois-card .stats { font-size: 12px; color: #666; }

/* Results */
.results-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-box { text-align: center; padding: 16px; background: #f8f9fa; border-radius: 6px; }
.stat-box .number { font-size: 24px; font-weight: 700; }
.stat-box .label { font-size: 12px; color: #666; margin-top: 4px; }

/* Downloads */
.download-list { list-style: none; }
.download-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid #eee;
}
.download-list li:last-child { border-bottom: none; }

/* Anomalies */
.anomaly { padding: 6px 10px; margin-bottom: 4px; border-radius: 4px; font-size: 13px; font-family: monospace; }
.anomaly-DOUBLON { background: #fff3cd; }
.anomaly-MONTANT { background: #f8d7da; }
.anomaly-ECART { background: #d1ecf1; }
.anomaly-INCONNU { background: #fce4e4; }

/* Verification table */
.verif-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.verif-table th {
    background: #2F5496; color: #fff; padding: 8px 6px; text-align: left;
    position: sticky; top: 0;
}
.verif-table td { padding: 6px; border-bottom: 1px solid #eee; }
.verif-table tr:hover { background: #f8f9fa; }
.verif-table tr.error-row { background: #fff0f0; }
.verif-table input, .verif-table select {
    width: 100%; padding: 4px 6px; border: 1px solid #ddd; border-radius: 4px;
    font-size: 13px;
}
.verif-table .compte-input { width: 80px; }

/* Loader */
.loader { text-align: center; padding: 40px; color: #888; }
.spinner {
    width: 32px; height: 32px; border: 3px solid #ddd; border-top-color: #2F5496;
    border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Badges */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600;
}
.badge-red { background: #f8d7da; color: #721c24; }
.badge-orange { background: #fff3cd; color: #856404; }
.badge-green { background: #d4edda; color: #155724; }
