/* ==========================================================================
   1. VARIABLES ET CONFIGURATION
   ========================================================================== */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --danger: #ef4444;
    --danger-hover: #b91c1c;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --column-bg: #e2e8f0;
    --border: #cbd5e1;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* ==========================================================================
   2. ÉCRAN DE LOGIN (NOUVEAU)
   ========================================================================== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h1 {
    margin-bottom: 30px;
    color: var(--primary);
    font-weight: 800;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

input[type="text"], input[type="password"], input[type="date"], select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ==========================================================================
   3. HEADER & NAVIGATION
   ========================================================================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.logo { font-size: 1.5rem; font-weight: 800; color: var(--primary); }

.header-right { display: flex; align-items: center; gap: 15px; }

.user-info { font-size: 0.9rem; color: var(--text-light); }

.btn-logout { 
    text-decoration: none; 
    color: var(--danger); 
    font-weight: 600; 
    font-size: 0.9rem; 
}

/* ==========================================================================
   4. DASHBOARD KANBAN (CORRECTION ALIGNEMENT CROIX)
   ========================================================================== */
.dashboard {
    display: flex;
    gap: 20px;
    padding: 0 20px 20px;
    overflow-x: auto;
    align-items: flex-start;
}

.column {
    background: var(--column-bg);
    border-radius: 12px;
    min-width: 300px;
    width: 300px;
    padding: 15px;
    flex-shrink: 0;
}

/* FLEXBOX ICI POUR METTRE LA CROIX A DROITE */
.column-header {
    display: flex;
    justify-content: space-between; /* Pousse le H2 à gauche et la Croix à droite */
    align-items: center;
    margin-bottom: 15px;
}

.column-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    flex-grow: 1; /* Prend tout l'espace disponible */
    cursor: pointer;
}

.col-delete {
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding-left: 10px;
    transition: color 0.2s;
}

.col-delete:hover { color: var(--danger); }

.task-list { min-height: 100px; }

.task-card {
    background: var(--card);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: grab;
    transition: transform 0.1s;
}

.task-card:active { cursor: grabbing; transform: scale(1.02); }

/* ==========================================================================
   5. BOUTONS & TAGS (ADMIN / UTILISATEURS)
   ========================================================================== */
.btn-main, .btn-secondary, .btn-danger-small {
    padding: 10px 18px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    justify-content: center;
}

.btn-main { background: var(--primary); color: white; width: auto; }
.btn-main:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-secondary { background: #f1f5f9; color: #475569; }
.btn-secondary:hover { background: #e2e8f0; }

.btn-danger-small { 
    background: #fee2e2; 
    color: var(--danger);
    font-size: 0.8rem;
    padding: 6px 12px;
}
.btn-danger-small:hover { background: var(--danger); color: white; }

.tag {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
}
.tag-admin { background: #e0e7ff; color: #4338ca; }
.tag-lecteur { background: #dcfce7; color: #15803d; }

.data-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border-collapse: collapse;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.data-table th { background: #f8fafc; padding: 15px; text-align: left; color: var(--text-light); }
.data-table td { padding: 15px; border-top: 1px solid #f1f5f9; }

/* ==========================================================================
   6. MODALES & CORBEILLE
   ========================================================================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 95%;
    max-width: 500px;
}

.trash-can {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 80px;
    background: var(--danger);
    color: white;
    border-radius: 40px 40px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: bottom 0.3s ease;
    z-index: 999;
}
.trash-can.visible { bottom: 0; }
.trash-can.drag-over { background: var(--danger-hover); height: 100px; }

.fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 30px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}