* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f3ff 0%, #e0f2fe 100%);
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 30px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    color: #7c3aed;
    font-size: 2em;
}

.header p {
    color: #666;
    margin-top: 5px;
}

.btn-download {
    background: #10b981;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-download:hover {
    background: #059669;
}

.info-box {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 4px;
}

.sync-indicator {
    background: #d1fae5;
    border-left: 4px solid #10b981;
    padding: 12px;
    margin-bottom: 25px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-indicator.syncing {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.sync-indicator.error {
    background: #fee2e2;
    border-left-color: #ef4444;
}

.section {
    margin-bottom: 40px;
}

.section h2 {
    color: #374151;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.member-input {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.member-input input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

.member-input input:focus {
    outline: none;
    border-color: #7c3aed;
}

.btn-add {
    background: #7c3aed;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.btn-add:hover {
    background: #6d28d9;
}

.members-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.member-tag {
    background: #ede9fe;
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-tag button {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 20px;
    cursor: pointer;
    font-weight: bold;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    border: 1px solid #e5e7eb;
    padding: 10px;
    text-align: center;
}

th {
    background: #7c3aed;
    color: white;
    font-weight: 600;
}

.stats-table th {
    position: sticky;
    top: 0;
}

.stats-table tr:nth-child(even) {
    background: #f9fafb;
}

.month-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.month-section h3 {
    color: #7c3aed;
    margin-bottom: 15px;
}

.presence-table {
    overflow-x: auto;
}

.presence-table th {
    background: #ede9fe;
    color: #374151;
    font-size: 12px;
    min-width: 60px;
}

.presence-table td {
    padding: 5px;
}

.presence-table select {
    width: 100%;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    text-align: center;
    font-size: 12px;
}

.presence-table select.present {
    background: #d1fae5;
    border-color: #86efac;
}

.presence-table select.absent {
    background: #fee2e2;
    border-color: #fca5a5;
}

.presence-table select.retard {
    background: #fed7aa;
    border-color: #fdba74;
}

.presence-table select.permission {
    background: #dbeafe;
    border-color: #60a5fa;
}

.legend {
    background: #f3f4f6;
    padding: 15px;
    border-radius: 8px;
    margin-top: 30px;
}

.legend p {
    margin-bottom: 10px;
    color: #4b5563;
}

.stat-green { color: #10b981; font-weight: bold; }
.stat-red { color: #ef4444; font-weight: bold; }
.stat-orange { color: #f59e0b; font-weight: bold; }
.stat-permission { color: #2563eb; font-weight: bold; }

.taux-high { color: #10b981; font-weight: bold; }
.taux-medium { color: #f59e0b; font-weight: bold; }
.taux-low { color: #ef4444; font-weight: bold; }

.date-header-rep { color: #3b82f6; font-size: 10px; }
.date-header-prog { color: #f59e0b; font-size: 10px; }

/* Styles pour les membres avec absences successives */
.member-tag.highlighted {
    background: #fee2e2;
    border: 2px solid #ef4444;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.highlighted-row {
    background: #fee2e2 !important;
    border-left: 4px solid #ef4444 !important;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    color: #7c3aed;
    margin: 0;
}

.close {
    color: #9ca3af;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #374151;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-group input[type="text"],
.form-group input[type="date"] {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #7c3aed;
}

.photo-preview {
    text-align: center;
    margin: 20px 0;
}

.photo-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

.photo-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.btn-photo {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-upload {
    background: #3b82f6;
    color: white;
}

.btn-upload:hover {
    background: #2563eb;
}

.btn-delete-photo {
    background: #ef4444;
    color: white;
}

.btn-delete-photo:hover {
    background: #dc2626;
}

.btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.btn-status {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-present {
    background: #d1fae5;
    color: #065f46;
    border: 2px solid #86efac;
}

.btn-present:hover {
    background: #a7f3d0;
}

.btn-absent {
    background: #fee2e2;
    color: #991b1b;
    border: 2px solid #fca5a5;
}

.btn-absent:hover {
    background: #fecaca;
}

.btn-retard {
    background: #fed7aa;
    color: #92400e;
    border: 2px solid #fdba74;
}

.btn-retard:hover {
    background: #fde68a;
}

.btn-permission {
    background: #dbeafe;
    color: #1e40af;
    border: 2px solid #60a5fa;
}

.btn-permission:hover {
    background: #bfdbfe;
}

.btn-save {
    background: #7c3aed;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}

.btn-save:hover {
    background: #6d28d9;
}

.member-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid #e5e7eb;
}

.member-tag-content {
    display: flex;
    align-items: center;
}

.member-name {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.member-name:hover {
    text-decoration: underline;
}

.absence-badge {
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: bold;
}