:root {
  --ink: #17231f;
  --muted: #64716c;
  --paper: #f4f3ed;
  --card: #fffef9;
  --forest: #163f33;
  --mint: #dbece4;
  --line: #d8ddd8;
  --orange: #d96f32;
  --red: #a64132;
  --shadow: 0 14px 40px rgba(27, 46, 39, .08);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 14px/1.4 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
a { color: var(--forest); }

.topbar { padding: 18px max(24px, calc((100vw - 1280px) / 2)); background: var(--forest); color: white; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar h1, .section-heading h2 { margin: 2px 0 0; font-family: Georgia, serif; font-weight: 500; }
.topbar h1 { font-size: clamp(24px, 3vw, 34px); }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .13em; font-size: 10px; font-weight: 800; opacity: .72; }
.page-shell { width: min(1280px, calc(100% - 28px)); margin: 18px auto 42px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.summary-card { min-height: 82px; padding: 14px 16px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: space-between; }
.summary-card span { color: var(--muted); font-size: 12px; }
.summary-card strong { font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
.summary-card.warning strong { color: var(--red); }

.filters { margin: 14px 0; padding: 11px 12px; display: grid; grid-template-columns: 1.6fr 1fr 1fr auto; gap: 10px; align-items: end; background: rgba(255,255,255,.58); border: 1px solid var(--line); border-radius: 13px; }
.filters label, .login-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 750; }
input, select { width: 100%; min-height: 38px; padding: 0 10px; border: 1px solid #cbd2cd; border-radius: 9px; background: white; color: var(--ink); font-size: 13px; }
input:focus, select:focus, button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid rgba(217,111,50,.28); outline-offset: 2px; }
.primary-button, .quiet-button { min-height: 38px; padding: 0 15px; border: 0; border-radius: 9px; cursor: pointer; font-weight: 800; font-size: 13px; }
.primary-button { background: var(--orange); color: white; }
.primary-button:hover { background: #c45e27; }
.quiet-button { border: 1px solid rgba(255,255,255,.35); background: transparent; color: white; }

.task-list { padding: 17px 20px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 12px; }
.section-heading h2 { font-size: 23px; }
.task-card { padding: 13px 0; display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 22px; border-top: 1px solid var(--line); }
.task-card.is-done { opacity: .62; }
.task-card.is-done h3 { text-decoration: line-through; }
.task-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.priority, .due-date { padding: 4px 8px; border-radius: 99px; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.priority-haute { color: #822d22; background: #f9d9d3; }
.priority-moyenne { color: #775017; background: #f5e7c8; }
.priority-basse { color: #2d644f; background: var(--mint); }
.priority-non_definie { color: #606865; background: #e8ebe9; }
.due-date { padding-left: 0; color: var(--muted); }
.due-date.overdue { color: var(--red); }
.task-card h3 { margin: 6px 0 3px; font-family: Georgia, serif; font-size: 19px; font-weight: 500; }
.summary { margin: 0; color: #4d5a55; line-height: 1.42; font-size: 13px; }
details { margin-top: 9px; }
summary { width: fit-content; color: var(--forest); cursor: pointer; font-size: 13px; font-weight: 800; }
.details-grid { margin: 11px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 9px 14px; }
.details-grid div { min-width: 0; }
.details-grid .wide { grid-column: 1 / -1; }
dt { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.status-form { align-self: center; }
.status-form label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.empty-state strong { color: var(--ink); font-family: Georgia, serif; font-size: 24px; }
.flash { margin-bottom: 16px; padding: 12px 16px; border-radius: 10px; background: var(--mint); color: var(--forest); }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, #315e4f, var(--forest) 46%, #0c201a); }
.login-card { width: min(430px, 100%); padding: 38px; border-radius: 24px; background: var(--card); box-shadow: 0 25px 70px rgba(0,0,0,.25); }
.brand-mark { width: 54px; height: 54px; margin-bottom: 28px; display: grid; place-items: center; color: white; background: var(--orange); border-radius: 16px; font-family: Georgia, serif; font-size: 22px; }
.login-card h1 { margin: 6px 0 8px; font-family: Georgia, serif; font-size: 34px; font-weight: 500; }
.login-copy { margin: 0 0 26px; color: var(--muted); line-height: 1.5; }
.login-form { display: grid; gap: 14px; }
.form-error { margin: -4px 0 0; color: var(--red); font-size: 13px; }

@media (max-width: 820px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .task-card { grid-template-columns: 1fr; gap: 14px; }
  .status-form { width: min(100%, 260px); }
}

@media (max-width: 520px) {
  .topbar { padding: 22px 18px; }
  .quiet-button { padding: 0 10px; font-size: 12px; }
  .page-shell { width: min(100% - 20px, 1180px); margin-top: 10px; }
  .summary-grid { gap: 8px; }
  .summary-card { min-height: 92px; padding: 14px; border-radius: 14px; }
  .summary-card strong { font-size: 28px; }
  .filters { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .task-list { padding: 16px; border-radius: 16px; }
  .section-heading { align-items: start; flex-direction: column; }
  .details-grid { grid-template-columns: 1fr; }
  .details-grid .wide { grid-column: auto; }
  .login-card { padding: 28px 22px; }
}
