* { box-sizing: border-box; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f0f2f5;
    margin: 0;
    padding: 2rem 1rem;
    color: #222;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

h1 {
    margin-top: 0;
    font-size: 1.6rem;
    text-align: center;
}

/* ---- Formulaire d'ajout ---- */
.add-form {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.add-form input {
    flex: 1;
    padding: .7rem .9rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

.add-form button {
    padding: .7rem 1.2rem;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

.add-form button:hover { background: #4338ca; }

/* ---- Tableau ---- */
.task-table {
    width: 100%;
    border-collapse: collapse;
}

.task-table thead th {
    text-align: left;
    padding: .6rem .5rem;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #666;
    border-bottom: 2px solid #e5e7eb;
}

.task-table tbody td {
    padding: .7rem .5rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.task-table tbody tr:hover {
    background: #fafafa;
}

/* Tâche terminée → barrée + grisée */
.task-table tr.done .title {
    text-decoration: line-through;
    color: #999;
}

/* Colonnes compactes à droite */
.col-state  { width: 70px;  text-align: center; }
.col-action { width: 60px;  text-align: center; }

/* ---- Checkbox personnalisée ---- */
.checkbox-wrap {
    position: relative;
    display: inline-block;
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.checkbox-wrap input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    margin: 0;
}

.checkmark {
    position: absolute;
    inset: 0;
    background: #fff;
    border: 2px solid #c7c7c7;
    border-radius: 5px;
    transition: all .15s ease;
}

.checkbox-wrap input:checked + .checkmark {
    background: #4f46e5;
    border-color: #4f46e5;
}

.checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-wrap input:checked + .checkmark::after {
    display: block;
}

.checkbox-wrap:hover .checkmark {
    border-color: #4f46e5;
}

/* ---- Bouton supprimer (SVG) ---- */
.delete {
    background: none;
    border: none;
    padding: .35rem;
    cursor: pointer;
    color: #9ca3af;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
}

.delete:hover {
    color: #e11d48;
    background: #fee2e2;
}

/* ---- Divers ---- */
.empty {
    text-align: center;
    color: #999;
    padding: 1.5rem;
}

.count {
    text-align: right;
    color: #666;
    font-size: .9rem;
    margin-top: 1rem;
}