:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --critical-color: #dc2626;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #334155;
    --text-light: #64748b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--background);
    border-color: var(--secondary-color);
}

.btn-action {
    padding: 0.5rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.btn-edit {
    background: var(--warning-color);
    color: white;
}

.btn-edit:hover {
    background: #d97706;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.stat-icon.critique {
    background: var(--critical-color);
}

.stat-icon.en-cours {
    background: var(--primary-color);
}

.stat-icon.termine {
    background: var(--success-color);
}

.stat-icon.retard {
    background: var(--danger-color);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Table Container */
.table-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.table-header h2 {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-filters {
    display: flex;
    gap: 1rem;
}

.table-filters select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 0.875rem;
}

.table-wrapper {
    overflow-x: auto;
    max-height: calc(100vh - 400px);
}

/* Table */
.planning-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.planning-table th {
    background: #f8fafc;
    color: var(--text);
    font-weight: 600;
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.planning-table td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.planning-table tr:hover {
    background: #f8fafc;
}

/* Cellules spéciales */
.nom-tache {
    font-weight: 500;
    color: var(--primary-color);
    max-width: 250px;
}

.description {
    max-width: 300px;
    color: var(--text-light);
}

.responsable {
    font-weight: 500;
}

.jours-planifies, .jours-restants {
    text-align: center;
    font-weight: 500;
}

.jours-restants.en-retard {
    background: var(--danger-color);
    color: white;
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    font-size: 0.75rem;
}

.jours-restants.terminé {
    background: var(--success-color);
    color: white;
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    font-size: 0.75rem;
}

.jours-restants.annulé {
    background: var(--secondary-color);
    color: white;
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Statut */
.statut {
    text-align: center;
}

.statut-à-faire {
    background: #fef3c7;
    color: #92400e;
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    font-size: 0.75rem;
}

.statut-en-cours {
    background: #dbeafe;
    color: #1e40af;
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    font-size: 0.75rem;
}

.statut-en-attente {
    background: #fed7aa;
    color: #c2410c;
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    font-size: 0.75rem;
}

.statut-terminé {
    background: #d1fae5;
    color: #065f46;
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    font-size: 0.75rem;
}

.statut-annulé {
    background: #e5e7eb;
    color: #374151;
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    font-size: 0.75rem;
    text-decoration: line-through;
}

/* Priorité */
.priorite {
    text-align: center;
}

.priorite-critique {
    background: var(--critical-color);
    color: white;
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    font-size: 0.75rem;
}

.priorite-haute {
    background: var(--warning-color);
    color: white;
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    font-size: 0.75rem;
}

.priorite-moyenne {
    background: #fef3c7;
    color: #92400e;
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    font-size: 0.75rem;
}

.priorite-basse {
    background: #d1fae5;
    color: #065f46;
    border-radius: var(--radius);
    padding: 0.25rem 0.5rem;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Jalon */
.jalon.oui {
    color: var(--primary-color);
    font-weight: 600;
}

.jalon.non {
    color: var(--text-light);
}

/* Progress Bar */
.progression {
    width: 120px;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color) 0%, #16a34a 100%);
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Actions */
.actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* 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);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--surface);
    margin: 2% auto;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 {
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 600;
}

.close {
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close:hover {
    color: var(--text);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: var(--background);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Form */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Styles pour les formulaires améliorés */
.required {
    color: var(--danger-color);
    font-weight: bold;
}

.form-help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-light);
    font-style: italic;
}

.form-group input:invalid,
.form-group select:invalid,
.form-group textarea:invalid {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

.form-group input:valid,
.form-group select:valid,
.form-group textarea:valid {
    border-color: var(--success-color);
}

/* Listes */
.liste-membres,
.liste-feries {
    list-style: none;
    padding: 0;
}

.liste-membres li,
.liste-feries li {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    background: var(--background);
}

.liste-membres li:last-child,
.liste-feries li:last-child {
    margin-bottom: 0;
}

/* Gestion des vues */
.view-selector {
    display: flex;
    gap: 0.5rem;
    margin: 0 1rem;
}

.view-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.view-btn.active {
    background: var(--primary-color);
    color: white;
}

.vue-container {
    display: none;
}

.vue-container.active {
    display: block;
}

/* Vue Calendrier Mensuel */
.calendar-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border);
}

.calendar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.calendar-legend {
    display: flex;
    gap: 1rem;
    padding: 1rem 2rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.critique { background: var(--critical-color); }
.legend-color.haute { background: var(--warning-color); }
.legend-color.moyenne { background: #fef3c7; }
.legend-color.basse { background: var(--success-color); }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--surface);
}

.calendar-day-header {
    padding: 1rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    font-weight: 600;
    text-align: center;
    color: var(--text);
}

.calendar-day {
    min-height: 120px;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    position: relative;
    background: var(--surface);
}

.calendar-day:hover {
    background: #f8fafc;
}

.calendar-day-number {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.calendar-day.autre-mois .calendar-day-number {
    color: var(--text-light);
}

.calendar-day.aujourd-hui {
    background: #dbeafe;
}

.calendar-day.aujourd-hui .calendar-day-number {
    color: var(--primary-color);
    font-weight: 700;
}

.calendar-task {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    border-radius: 3px;
    border-left: 3px solid;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.calendar-task:hover {
    transform: translateX(2px);
}

.calendar-task.critique {
    border-left-color: var(--critical-color);
    background: #fef2f2;
}

.calendar-task.haute {
    border-left-color: var(--warning-color);
    background: #fffbeb;
}

.calendar-task.moyenne {
    border-left-color: #f59e0b;
    background: #fefdf8;
}

.calendar-task.basse {
    border-left-color: var(--success-color);
    background: #f0fdf4;
}

/* Vue Gantt */
.gantt-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.gantt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border);
}

.gantt-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gantt-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gantt-controls label {
    font-weight: 500;
    color: var(--text);
}

.gantt-controls select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.gantt-wrapper {
    display: flex;
    max-height: 600px;
    overflow: hidden;
}

.gantt-sidebar {
    width: 300px;
    border-right: 1px solid var(--border);
    background: var(--background);
    flex-shrink: 0;
}

.gantt-sidebar-header {
    padding: 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text);
}

.gantt-tasks {
    overflow-y: auto;
    max-height: 550px;
}

.gantt-task-row {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: background 0.2s ease;
}

.gantt-task-row:hover {
    background: #f8fafc;
}

.gantt-task-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text);
    font-size: 0.875rem;
}

.gantt-task-info {
    font-size: 0.75rem;
    color: var(--text-light);
}

.gantt-timeline {
    flex: 1;
    overflow-x: auto;
    background: var(--surface);
}

.gantt-calendar {
    display: flex;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.gantt-month {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.gantt-month-header {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    text-align: center;
    color: var(--text);
    font-size: 0.875rem;
}

.gantt-days {
    display: flex;
}

.gantt-day {
    width: 30px;
    padding: 0.5rem 0;
    text-align: center;
    border-right: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-light);
    background: var(--surface);
}

.gantt-day.weekend {
    background: #f3f4f6;
    color: var(--text-light);
}

.gantt-day.today {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.gantt-bars {
    position: relative;
}

.gantt-bar-row {
    height: 48px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.gantt-bar {
    position: absolute;
    height: 24px;
    top: 12px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.gantt-bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.gantt-bar.critique {
    background: linear-gradient(90deg, var(--critical-color), #dc2626);
}

.gantt-bar.haute {
    background: linear-gradient(90deg, var(--warning-color), #d97706);
}

.gantt-bar.moyenne {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.gantt-bar.basse {
    background: linear-gradient(90deg, var(--success-color), #16a34a);
}

.gantt-bar.termine {
    background: linear-gradient(90deg, var(--success-color), #16a34a);
    opacity: 0.7;
}

.gantt-bar.en-retard {
    background: linear-gradient(90deg, var(--danger-color), #dc2626);
    border: 2px solid #b91c1c;
}

.gantt-milestone {
    position: absolute;
    top: 18px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 12px solid var(--primary-color);
    cursor: pointer;
}

.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
    z-index: 5;
    box-shadow: 0 0 4px rgba(37, 99, 235, 0.5);
}

/* === STYLES MULTI-PROJETS === */

/* Header utilisateur */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.user-name {
    font-weight: 500;
    color: var(--text);
}

.user-role {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.role-administrateur {
    background: #fef3c7;
    color: #92400e;
}

.role-chef_projet {
    background: #dbeafe;
    color: #1e40af;
}

.role-intervenant {
    background: #f3e8ff;
    color: #7c3aed;
}

/* Badge pour les notifications */
.badge {
    background: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

/* Vue d'ensemble des projets */
.projects-overview {
    margin-bottom: 2rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.project-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.project-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-title h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
    font-size: 1.125rem;
    font-weight: 600;
}

.project-status {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-en-preparation {
    background: #f3f4f6;
    color: #374151;
}

.status-en-cours {
    background: #dbeafe;
    color: #1e40af;
}

.status-en-pause {
    background: #fef3c7;
    color: #92400e;
}

.status-termine {
    background: #d1fae5;
    color: #065f46;
}

.status-annule {
    background: #fee2e2;
    color: #991b1b;
}

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

.project-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.project-meta {
    margin-bottom: 1rem;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.project-info span {
    font-size: 0.875rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.project-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
}

.text-success {
    color: #10b981 !important;
}

.text-warning {
    color: #f59e0b !important;
}

.text-danger {
    color: #ef4444 !important;
}

.project-progress {
    margin-top: 1rem;
}

/* État vide */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* Messages récents */
.recent-messages {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

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

.message-item {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.message-item:last-child {
    margin-bottom: 0;
}

.message-item.non-lu {
    background: #f0f9ff;
    border-color: #3b82f6;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.message-from {
    font-weight: 500;
    color: var(--text);
}

.message-project {
    color: var(--text-light);
    font-size: 0.75rem;
}

.message-date {
    color: var(--text-light);
    font-size: 0.75rem;
}

.message-subject {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.message-type {
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.type-info {
    background: #dbeafe;
    color: #1e40af;
}

.type-question {
    background: #fef3c7;
    color: #92400e;
}

.type-alerte {
    background: #fed7aa;
    color: #ea580c;
}

.type-urgence {
    background: #fee2e2;
    color: #991b1b;
}

/* Modals étendus */
.modal-large {
    max-width: 800px;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.messages-container {
    max-height: 400px;
    overflow-y: auto;
}

.message-detail {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.message-detail.non-lu {
    background: #f0f9ff;
    border-color: #3b82f6;
}

.message-content {
    margin-top: 0.75rem;
    line-height: 1.6;
    color: var(--text);
}

/* En-tête de projet */
.project-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.project-info h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.access-level {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.level-lecture {
    background: #f3f4f6;
    color: #374151;
}

.level-ecriture {
    background: #dbeafe;
    color: #1e40af;
}

.level-admin {
    background: #fef3c7;
    color: #92400e;
}

/* Membres du projet */
.membres-liste {
    max-height: 300px;
    overflow-y: auto;
}

.membre-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.membre-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.membre-email {
    font-size: 0.875rem;
    color: var(--text-light);
}

.membre-role {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
}

.permission-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

/* Alertes */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin: 16px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.alert-close {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.alert-close:hover {
    opacity: 1;
}

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

/* Responsive pour multi-projets */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .project-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .project-actions {
        justify-content: flex-end;
    }
    
    .project-stats {
        gap: 0.5rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .project-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .user-info {
        order: -1;
        justify-content: center;
    }
}

@media (max-width: 1200px) {
    .header-content {
        padding: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .table-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .table-filters {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
    
    .planning-table {
        font-size: 0.75rem;
    }
    
    .planning-table th,
    .planning-table td {
        padding: 0.5rem 0.25rem;
    }
}

/* Masquer les colonnes moins importantes sur mobile */
@media (max-width: 768px) {
    .planning-table th:nth-child(3),
    .planning-table td:nth-child(3),
    .planning-table th:nth-child(5),
    .planning-table td:nth-child(5),
    .planning-table th:nth-child(9),
    .planning-table td:nth-child(9),
    .planning-table th:nth-child(15),
    .planning-table td:nth-child(15),
    .planning-table th:nth-child(16),
    .planning-table td:nth-child(16) {
        display: none;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar personnalisée */
.table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Écart de dates */
.ecart {
    text-align: center;
    font-weight: 500;
}

/* Styles d'impression */
@media print {
    .header-actions,
    .btn-action,
    .modal {
        display: none !important;
    }
    
    .planning-table {
        font-size: 10px;
    }
    
    .planning-table th,
    .planning-table td {
        padding: 0.25rem;
    }
}
