:root {
    --primary: #1e293b;
    --accent: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #e2e8f0;
    --text-muted: #64748b;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc;
    margin: 0; padding: 20px;
    display: flex; justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 600px;
    background: white; padding: 1.5rem;
    border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

header h1 { margin: 0; color: var(--primary); font-size: 1.4rem; font-weight: 800; }
.progress-container { background: #f1f5f9; height: 6px; border-radius: 10px; margin: 15px 0 5px 0; }
.progress-bar { background: var(--accent); height: 100%; border-radius: 10px; transition: width 0.4s ease; }
#stats { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 25px; font-weight: 600; }

/* --- FORMULAIRE --- */
form { width: 100%; margin-bottom: 30px; }
.input-row { width: 100%; margin-bottom: 10px; }
#taskInput { width: 100%; font-weight: 600; padding: 10px; border: 1px solid var(--border); border-radius: 6px; outline: none; }

.form-actions { display: flex; gap: 10px; align-items: center; }
select, .custom-date-input { 
    padding: 10px; border: 1px solid var(--border); border-radius: 6px; 
    font-size: 14px; outline: none; background: #fff;
}

/* Date Wrapper & Masque */
.date-input-wrapper { position: relative; flex: 1; min-width: 0; }
.custom-date-input { width: 100%; cursor: pointer; min-height: 40px; }

/* Placeholder simulé pour le champ date vide */
.custom-date-input:before {
    content: "📅 Date";
    color: var(--text-muted);
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    background: white;
    padding-right: 10px;
    pointer-events: none;
}
.custom-date-input:focus:before,
.custom-date-input:valid:before { display: none; }

.add-btn { background: var(--primary); color: white; border: none; padding: 10px 20px; border-radius: 6px; font-weight: 700; cursor: pointer; }

/* --- LISTE --- */
.task-list { list-style: none; padding: 0; margin: 0; }
.task-item { 
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px; background: white; border: 1px solid var(--border);
    border-radius: 8px; margin-bottom: 10px; transition: 0.2s;
}

.task-main-info { display: flex; align-items: center; flex: 1; min-width: 0; }
.priority-indicator { width: 4px; height: 32px; border-radius: 10px; margin-right: 15px; flex-shrink: 0; }
.priority-high { background: var(--danger); }
.priority-medium { background: var(--warning); }
.priority-low { background: var(--success); }

.task-content { flex: 1; min-width: 0; padding-right: 15px; }
.task-title { font-weight: 700; color: var(--primary); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { font-size: 0.75rem; color: var(--text-muted); }

.actions { display: flex; gap: 5px; }
.icon-btn { background: transparent; border: none; cursor: pointer; padding: 8px; color: #cbd5e1; transition: 0.2s; font-size: 1rem; }
.btn-edit:hover { color: var(--accent); background: #f0f7ff; border-radius: 4px; }
.btn-check:hover { color: var(--success); background: #f0fdf4; border-radius: 4px; }
.btn-delete:hover { color: var(--danger); background: #fef2f2; border-radius: 4px; }

.task-separator { margin: 30px 0 15px 0; text-align: center; border-bottom: 1px solid var(--border); line-height: 0.1em; }
.task-separator span { background: #fff; padding: 0 10px; color: var(--text-muted); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }

.completed { opacity: 0.5; background: #f8fafc; border-color: transparent; }
.completed .task-title { text-decoration: line-through; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 480px) {
    body { padding: 10px; }
    .app-container { padding: 1rem; }
    .form-actions { flex-direction: column; gap: 8px; }
    .form-actions > * { width: 100%; }
    .task-item { padding: 10px; }
    input, select { font-size: 16px; }
}