:root {
    --color-bg: #d8dadd;
    --color-surface: #ffffff;
    --color-border: #dde1e7;
    --color-text: #1f2328;
    --color-muted: #6b7280;
    --color-primary: #2563eb;
    --color-danger: #dc2626;
    --color-red: #dc2626;
    --color-orange: #d97706;
    --color-green: #16a34a;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 15px;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.header__title {
    font-weight: 700;
    font-size: 18px;
}

.header__user {
    color: var(--color-muted);
    font-size: 14px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
}

.new-task {
    margin-bottom: 24px;
}

.new-task__bar {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px 16px;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-primary);
    list-style: none;
}

.new-task__bar::-webkit-details-marker {
    display: none;
}

.new-task__bar:hover {
    background: var(--color-bg);
}

.new-task[open] .new-task__bar {
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}

.new-task__form {
    border-radius: 0 0 8px 8px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-row label {
    font-size: 13px;
    color: var(--color-muted);
}

input, textarea, select {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: 6px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 14px;
}

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

.btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn:hover {
    opacity: 0.9;
    text-decoration: none;
}

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

.link-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    font-family: inherit;
}

.link-btn:hover {
    text-decoration: underline;
}

.link-btn--danger {
    color: var(--color-danger);
}

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert--error {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--color-bg);
}

.login-card {
    width: 100%;
    max-width: 340px;
}

.login-card h1 {
    font-size: 19px;
    margin-bottom: 20px;
    text-align: center;
}

.back-link {
    display: inline-block;
    margin-bottom: 16px;
}

.muted {
    color: var(--color-muted);
}

/* Liste et cartes de tâches */

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
}

.task-card--done {
    opacity: 0.85;
}

.task-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.task-card__title {
    font-weight: 600;
    font-size: 15px;
}

.task-card__description {
    color: var(--color-muted);
    font-size: 13px;
    margin-top: 2px;
}

.task-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.task-card__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--color-muted);
    margin: 10px 0;
}

.assignee {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 30%;
}

.task-card__meta .overdue {
    color: var(--color-danger);
    font-weight: 600;
}

/* Jauge d'avancement : slider sur toute la largeur, barre colorée + valeur en dessous */

.gauge {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.gauge__slider {
    order: 1;
    flex-basis: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--color-border);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
}

.gauge__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-text);
    cursor: pointer;
}

.gauge__slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-text);
    border: none;
    cursor: pointer;
}

.gauge__bar-wrap {
    order: 2;
    flex: 1;
    height: 8px;
    background: var(--color-border);
    border-radius: 999px;
    overflow: hidden;
}

.gauge__bar {
    height: 100%;
    transition: width 0.15s ease, background-color 0.15s ease;
}

.gauge__bar--red {
    background: var(--color-red);
}

.gauge__bar--orange {
    background: var(--color-orange);
}

.gauge__bar--green {
    background: var(--color-green);
}

.gauge__value {
    order: 3;
    font-size: 13px;
    font-weight: 600;
    width: 42px;
    text-align: right;
}

@media (max-width: 480px) {
    .task-card__header {
        flex-direction: column;
    }
}
