@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@500;600&display=swap");

/* ============================================================
   HouseFlow — refonte « moderne & net »
   Surfaces plates, ombres douces, contraste franc, compact.
   Tout dérive d'un seul --ac : les 8 accents et les 2 thèmes
   se réagencent automatiquement dans la même teinte.
   ============================================================ */

:root {
  --ac: #1f7a5c;

  /* accent dérivé (identique clair/sombre) */
  --accent: var(--ac);
  --accent-2: color-mix(in oklab, var(--ac), white 30%);
  --accent-deep: color-mix(in oklab, var(--ac), black 24%);
  --accent-soft: color-mix(in srgb, var(--ac) 13%, transparent);
  --accent-softer: color-mix(in srgb, var(--ac) 7%, transparent);
  --accent-glow: color-mix(in srgb, var(--ac) 26%, transparent);
  --on-accent: #ffffff;

  /* statuts */
  --warm: #e0a534;
  --danger: #c0492f;
  --danger-soft: color-mix(in srgb, var(--danger) 13%, transparent);
  --warning: #c1861c;
  --warning-soft: color-mix(in srgb, var(--warning) 15%, transparent);
  --ok: #2f9363;
  --ok-soft: color-mix(in srgb, var(--ok) 14%, transparent);
  --info: #2f6fd0;
  --info-soft: color-mix(in srgb, var(--info) 13%, transparent);

  /* surfaces — MODE CLAIR (1a) : fond teinté pâle, cartes blanches */
  --bg: color-mix(in oklab, var(--ac) 5%, #f6f7f7);
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: color-mix(in oklab, var(--ac) 4%, #ffffff);
  --surface-3: color-mix(in oklab, var(--ac) 8%, #ffffff);
  --line: rgba(16, 24, 32, 0.10);
  --line-strong: rgba(16, 24, 32, 0.17);
  --text: #1b2530;
  --muted: #68736d;
  --faint: #99a29c;

  /* barre latérale foncée dérivée de l'accent */
  --side-bg: color-mix(in oklab, var(--ac) 80%, #0a1310);
  --side-text: rgba(255, 255, 255, 0.82);
  --side-muted: rgba(255, 255, 255, 0.52);
  --side-line: rgba(255, 255, 255, 0.12);
  --side-hover: rgba(255, 255, 255, 0.09);

  --shadow: 0 1px 2px rgba(16, 24, 32, 0.05), 0 8px 24px rgba(16, 24, 32, 0.07);
  --shadow-sm: 0 1px 2px rgba(16, 24, 32, 0.05);
  --shadow-pop: 0 12px 40px rgba(16, 24, 32, 0.16);

  --radius-lg: 14px;
  --radius-md: 12px;
  --radius-sm: 10px;

  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

:root[data-accent="forest"] { --ac: #1f7a5c; }
:root[data-accent="ocean"]  { --ac: #2f6fd0; }
:root[data-accent="violet"] { --ac: #7a54cf; }
:root[data-accent="rose"]   { --ac: #bd4e79; }
:root[data-accent="coral"]  { --ac: #cf5c46; }
:root[data-accent="amber"]  { --ac: #a8760f; }
:root[data-accent="teal"]   { --ac: #12808f; }
:root[data-accent="slate"]  { --ac: #566579; }

/* ---------- MODE SOMBRE (1c) : surfaces teintées, jamais écrasées ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: color-mix(in oklab, var(--ac) 10%, #12161a);
  --bg-alt: color-mix(in oklab, var(--ac) 11%, #1a2025);
  --surface: color-mix(in oklab, var(--ac) 7%, #1b2126);
  --surface-2: color-mix(in oklab, var(--ac) 6%, #171c21);
  --surface-3: color-mix(in oklab, var(--ac) 11%, #1e252b);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #e7ecea;
  --muted: #97a29c;
  --faint: #6f7a74;

  --accent-2: color-mix(in oklab, var(--ac), white 22%);
  --accent-soft: color-mix(in srgb, var(--ac) 24%, transparent);
  --accent-softer: color-mix(in srgb, var(--ac) 14%, transparent);
  --accent-glow: color-mix(in srgb, var(--ac) 34%, transparent);

  --danger: #ef8a6d;
  --danger-soft: color-mix(in srgb, var(--danger) 20%, transparent);
  --warning: #e0a838;
  --warning-soft: color-mix(in srgb, var(--warning) 20%, transparent);
  --ok: #4bbd87;
  --ok-soft: color-mix(in srgb, var(--ok) 20%, transparent);
  --info: #6ba2ef;
  --info-soft: color-mix(in srgb, var(--info) 20%, transparent);

  --side-bg: color-mix(in oklab, var(--ac) 14%, #0c1013);
  --side-text: rgba(255, 255, 255, 0.80);
  --side-muted: rgba(255, 255, 255, 0.45);
  --side-line: rgba(255, 255, 255, 0.08);
  --side-hover: rgba(255, 255, 255, 0.07);

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.32), 0 10px 30px rgba(0, 0, 0, 0.30);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-pop: 0 16px 46px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }

button {
  cursor: pointer;
  border: none;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}
button:active:not(:disabled) { transform: translateY(1px); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: color-mix(in oklab, var(--accent), black 18%); }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line-strong)); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
textarea { min-height: 96px; resize: vertical; }

.eyebrow, .sidebar-label {
  margin: 0 0 5px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--muted);
}

h1, h2, h3, h4 { font-family: "Hanken Grotesk", sans-serif; letter-spacing: -0.02em; }

/* ============================================================
   Layout
   ============================================================ */
.app-shell {
  width: min(1400px, calc(100vw - 300px));
  margin: 18px 24px 40px 284px;
}

.mobile-bar, .sidebar-overlay { display: none; }

/* ---------- Sidebar ---------- */
.app-sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: 256px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 18px 13px;
  overflow-y: auto;
  color: var(--side-text);
  background: var(--side-bg);
  border-right: 1px solid var(--side-line);
}

.sidebar-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 14px; border-bottom: 1px solid var(--side-line); }
.board-brand-button {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: inherit;
  text-align: left;
  background: transparent;
}
.board-brand-button:hover { background: var(--side-hover); }
.board-brand-button .eyebrow { color: var(--side-muted); }
.board-brand-button strong { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.2rem; letter-spacing: -0.03em; }
.app-sidebar .eyebrow, .sidebar-label { color: var(--side-muted); }

.sidebar-close { display: none; width: 34px; height: 34px; border-radius: var(--radius-sm); color: #fff; background: var(--side-hover); }

.appearance-panel { display: flex; align-items: center; gap: 7px; padding: 2px; }

.appearance-toggle {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--side-text);
  background: var(--side-hover);
  border: 1px solid var(--side-line);
}
.appearance-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }
.appearance-toggle svg { width: 19px; height: 19px; }

.accent-menu-wrap { position: relative; flex: 1 1 auto; }
.appearance-accent {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--side-text);
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--side-hover);
  border: 1px solid var(--side-line);
}
.appearance-accent:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }
.accent-dot { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35); }
.accent-label { flex: 1 1 auto; text-align: left; }
.accent-chev { width: 15px; height: 15px; opacity: 0.7; }
.appearance-accent[aria-expanded="true"] .accent-chev { transform: rotate(180deg); }

.accent-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 9px;
  border-radius: var(--radius-md);
  background: var(--bg-alt);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-pop);
}
.accent-popover[hidden] { display: none; }
#accentChoicesTop { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#accentChoicesTop button { width: 100%; aspect-ratio: 1; border: 2px solid transparent; border-radius: 50%; background: var(--swatch); transition: transform 120ms ease, box-shadow 120ms ease; }
#accentChoicesTop button:hover { transform: scale(1.12); }
#accentChoicesTop button.active { box-shadow: 0 0 0 2px var(--bg-alt), 0 0 0 4px var(--text); }
[data-accent-choice="forest"] { --swatch: #1f7a5c; }
[data-accent-choice="ocean"] { --swatch: #2f6fd0; }
[data-accent-choice="violet"] { --swatch: #7a54cf; }
[data-accent-choice="rose"] { --swatch: #bd4e79; }
[data-accent-choice="coral"] { --swatch: #cf5c46; }
[data-accent-choice="amber"] { --swatch: #a8760f; }
[data-accent-choice="teal"] { --swatch: #12808f; }
[data-accent-choice="slate"] { --swatch: #566579; }

.sidebar-views, .sidebar-filter-list { display: grid; gap: 3px; }
.sidebar-section { display: grid; gap: 6px; }
.sidebar-label { margin: 4px 6px 1px; }

.sidebar-link, .sidebar-filter-btn {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--side-text);
  font-weight: 500;
  text-align: left;
  background: transparent;
}
.sidebar-link:hover, .sidebar-filter-btn:hover { color: #fff; background: var(--side-hover); }
.sidebar-link.active, .sidebar-filter-btn.active { color: var(--accent-deep); font-weight: 700; background: #fff; }
.sidebar-filter-count { min-width: 24px; padding: 0.1rem 0.4rem; border-radius: 999px; text-align: center; font-family: var(--mono); font-size: 0.7rem; color: inherit; background: rgba(255, 255, 255, 0.14); }
.sidebar-filter-btn.active .sidebar-filter-count { background: var(--accent-soft); color: var(--accent-deep); }

.member-filter-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.member-avatar.member-avatar-all { font-size: 1.2rem; line-height: 1; font-weight: 400; }

.sidebar-create {
  min-height: 44px;
  margin-top: 2px;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  color: #3a2c05;
  font-weight: 800;
  background: #f6c84c;
}
.sidebar-create:hover { background: #f3bf33; }

.sidebar-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: auto; padding-top: 6px; }
.sidebar-tools button, .sidebar-tools a { min-height: 36px; display: grid; place-items: center; padding: 0 0.5rem; border-radius: 8px; font-size: 0.82rem; font-weight: 500; color: var(--side-text); text-decoration: none; background: var(--side-hover); border: 1px solid var(--side-line); }
.sidebar-tools button:hover, .sidebar-tools a:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }
.sidebar-tool-wide { grid-column: 1 / -1; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(440px, 1.25fr);
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.hero h1 { margin: 0; font-size: clamp(1.6rem, 2.4vw, 2.3rem); line-height: 1.05; }
.hero-copy { max-width: 52ch; margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.hero-stats-panel { display: grid; gap: 8px; }
.hero-member-context { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; margin: 0; color: var(--muted); font-size: 0.78rem; }
.hero-member-label { font-weight: 600; }
.hero-member-pill { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 34px; padding: 0.24rem 0.68rem 0.24rem 0.28rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--text); background: var(--surface-2); }
.hero-member-pill .member-avatar { width: 26px; height: 26px; font-size: 0.68rem; }
.hero-member-pill strong { font-size: 0.86rem; }

.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; align-content: center; }

.stat-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 11px 13px; background: var(--surface-2); box-shadow: var(--shadow-sm); }
.stat-filter-card { width: 100%; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color 140ms ease, background 140ms ease, transform 120ms ease; }
.stat-filter-card:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--accent-softer); }
.stat-filter-card.active { border-color: var(--accent); background: var(--accent-soft); }
.stat-filter-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stat-card strong { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; color: var(--accent-deep); }
.stat-card span { color: var(--muted); font-size: 0.76rem; }

/* ============================================================
   Quick add
   ============================================================ */
.quick-add {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(140px, 0.35fr) 160px auto;
  gap: 9px;
  margin-top: 14px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.quick-add-title { position: relative; }
.quick-add-title span { position: absolute; z-index: 1; left: 13px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 1.15rem; font-weight: 700; }
.quick-add-title input { height: 100%; padding-left: 38px; }

/* ============================================================
   Boutons génériques
   ============================================================ */
.primary-btn, .inline-form button, .list-editor .add-row-btn, .quick-add button, .new-board-panel button {
  padding: 0.62rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--on-accent);
  font-weight: 700;
  background: var(--accent);
}
.primary-btn:hover, .inline-form button:hover, .list-editor .add-row-btn:hover, .quick-add button:hover, .new-board-panel button:hover { background: var(--accent-deep); }

.quick-done-btn { padding: 0.55rem 0.85rem; border-radius: var(--radius-sm); color: var(--on-accent); font-weight: 700; background: var(--accent); }
.quick-done-btn:hover { background: var(--accent-deep); }

.ghost-btn, .chip button, .icon-btn, .mini-btn, .nav-btn, .segment-btn {
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  border: 1px solid var(--line-strong);
}
.ghost-btn:hover, .icon-btn:hover, .mini-btn:hover, .nav-btn:hover, .segment-btn:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-softer); }

.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; }

.danger-btn, .danger-text { color: var(--danger); }
.danger-btn { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 26%, transparent); }
.danger-btn:hover { background: color-mix(in srgb, var(--danger) 20%, transparent); border-color: var(--danger); color: var(--danger); }

/* ============================================================
   Nav / segments
   ============================================================ */
.top-nav { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.nav-btn { min-height: 40px; border-radius: 999px; }
.nav-btn.active, .primary-nav { color: var(--on-accent); background: var(--accent); border-color: transparent; }
.segmented-control { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; max-width: 620px; }
.segment-btn { min-height: 38px; border-radius: 999px; }
.segment-btn.active { color: var(--on-accent); background: var(--accent); border-color: transparent; }

/* ============================================================
   Panels / structure partagée
   ============================================================ */
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }

.section-heading, .dialog-header, .list-editor-head, .task-card-top, .task-card-meta, .task-card-actions, .item-row, .step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.layout { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 16px; }
.content { order: 1; display: grid; gap: 18px; }
.management-panel { order: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.inline-form, .filters-grid, .task-form, .editor-grid { display: grid; gap: 11px; }
.inline-form { grid-template-columns: 1fr auto; }
.task-form-page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.task-form .full, .filters-grid .full, .editor-grid .full { grid-column: 1 / -1; }

.member-picker, .picker-panel { display: grid; gap: 9px; }
.member-picker label, .picker-panel label { color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.member-picker button:disabled, .picker-panel button:disabled { cursor: default; opacity: 0.5; }

.rotation-field { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); }
.rotation-field small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.4; }

.household-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.household-grid section { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); }
.section-heading h2 { margin: 0; font-size: 1.15rem; }

/* chips & tags */
.tag-list, .chips-row, .task-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 0.34rem 0.4rem 0.34rem 0.72rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); font-size: 0.85rem; }
.chip button, .mini-btn { padding: 0.28rem 0.5rem; border-radius: 999px; }

/* ============================================================
   Filtres
   ============================================================ */
.filters-panel { padding: 0; overflow: hidden; }
.filters-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; cursor: pointer; list-style: none; user-select: none; }
.filters-summary::-webkit-details-marker { display: none; }
.filters-summary-label { display: flex; align-items: center; gap: 9px; }
.filters-summary h2 { font-size: 1.15rem; margin: 0; }
.filters-chevron { width: 17px; height: 17px; color: var(--muted); transition: transform 160ms ease; flex: 0 0 auto; }
.filters-panel[open] .filters-chevron { transform: rotate(90deg); }
.filters-summary:hover .filters-chevron { color: var(--accent-deep); }
.filters-summary .ghost-btn { min-height: 38px; padding: 0.45rem 0.75rem; }
.filters-panel .filters-grid { padding: 0 16px 15px; }
.filters-grid { grid-template-columns: 1fr; gap: 10px; }
.filter-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 11px; }
.filter-select-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.toggle-filter { display: flex; align-items: center; gap: 9px; width: max-content; min-height: 44px; padding: 0.55rem 0.8rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.toggle-filter input { width: auto; accent-color: var(--accent); }

/* ============================================================
   Board header + today
   ============================================================ */
.board-header { display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: end; gap: 12px; padding: 0 2px; }
.board-controls { display: grid; justify-items: end; gap: 8px; }
.results-copy { margin: 0; color: var(--muted); font-size: 0.86rem; }
.active-task-context { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0.4rem 0 0; padding: 0.34rem 0.66rem; border: 1px solid var(--accent-soft); border-radius: 999px; color: var(--accent-deep); background: var(--accent-soft); font-size: 0.82rem; font-weight: 700; }

.today-view, .all-tasks-view { display: grid; gap: 16px; }
.all-tasks-view[hidden], .today-view[hidden] { display: none; }
.all-tasks-view { scroll-margin-top: 84px; }

.today-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 2px; }
.today-heading h2 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.today-greeting { margin: 7px 0 0; color: var(--muted); }

.today-progress { display: grid; gap: 8px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.today-progress-copy { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.84rem; }
.today-progress-copy strong { color: var(--text); font-family: var(--mono); font-weight: 600; }

.today-board { display: grid; gap: 14px; }
.today-group { display: grid; gap: 8px; }
.today-group-title { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 0.9rem; font-weight: 700; }
.today-count { min-width: 24px; padding: 0.16rem 0.46rem; border-radius: 999px; text-align: center; font-family: var(--mono); font-size: 0.72rem; color: var(--accent-deep); background: var(--accent-soft); }
.today-group.overdue .today-group-title { color: var(--danger); }
.today-group.overdue .today-count { color: var(--danger); background: var(--danger-soft); }

.today-task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
}
.today-group.overdue .today-task { border-left: 3px solid var(--danger); }
.today-task:hover { transform: translateY(-1px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.today-task h3, .today-task p { margin: 0; }
.today-task h3 { font-size: 0.98rem; }
.today-task p { margin-top: 4px; color: var(--muted); font-size: 0.82rem; }
.today-actions { display: flex; align-items: center; gap: 7px; }

.recently-done:empty { display: none; }
.recently-done { padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); }
.recent-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.recent-heading h3 { margin: 0; font-size: 1rem; }
.recent-heading > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--on-accent); background: var(--accent); }
.recent-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.recent-list span { padding: 0.4rem 0.68rem; border-radius: 999px; color: var(--accent-deep); background: var(--accent-soft); font-size: 0.82rem; font-weight: 600; }

/* ============================================================
   Avatars & pastilles de statut/priorité
   ============================================================ */
.member-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  background: hsl(var(--avatar-hue) 42% 44%);
}

.status-pill, .category-pill { display: inline-flex; align-items: center; padding: 0.3rem 0.66rem; border-radius: 999px; font-size: 0.76rem; font-weight: 700; }
.status-pill { background: var(--ok-soft); color: var(--ok); }
.category-pill { background: var(--accent-soft); color: var(--accent-deep); }

.status-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 82px; padding: 0.36rem 0.68rem; border-radius: 999px; font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.status-todo { color: var(--muted); background: color-mix(in srgb, var(--muted) 16%, transparent); }
.status-doing { color: var(--accent-deep); background: var(--accent-soft); }
.status-late { color: var(--danger); background: var(--danger-soft); }
.status-done { color: var(--info); background: var(--info-soft); }

/* ============================================================
   Task board / cards
   ============================================================ */
.task-board { display: grid; gap: 10px; }

.task-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 13px;
  box-shadow: var(--shadow-sm);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 120ms ease;
  min-width: 0;
}
.task-card:hover, .today-task:hover { border-color: var(--line-strong); }
.task-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.task-main { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; }
.task-title-group { min-width: 0; }
.task-card h4 { margin: 0; font-size: 0.98rem; line-height: 1.25; overflow-wrap: anywhere; }
.task-card p { margin: 4px 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.35; overflow-wrap: anywhere; }
.task-card .completion-line { color: var(--info); font-weight: 700; }

.task-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 9px; min-width: 0; }
.task-details > div { min-width: 0; }
.task-details strong { display: block; margin-top: 3px; overflow-wrap: anywhere; }

.meta-block, .note-block { padding: 10px 11px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.meta-block { min-width: 0; }
.meta-block strong, .note-block, .chip { overflow-wrap: anywhere; }
.meta-label { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }

.progress-bar { height: 8px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.progress-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.task-card-actions { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(110px, 1fr) 42px; align-items: center; gap: 9px; min-width: 0; }
.task-card-actions .ghost-btn { width: 100%; min-height: 42px; padding-inline: 0.65rem; min-width: 0; }
.status-select-label { display: grid; width: 100%; min-width: 0; }
.status-select-label select { width: 100%; min-height: 42px; padding: 0.5rem 0.68rem; }

.trash-icon-btn { width: 42px; height: 42px; display: inline-grid; flex: 0 0 42px; place-items: center; border: 1px solid color-mix(in srgb, var(--danger) 24%, transparent); border-radius: var(--radius-sm); color: var(--danger); background: var(--danger-soft); }
.trash-icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* --- carte compacte --- */
.task-card-compact { grid-template-columns: minmax(230px, 1fr) minmax(310px, 1.25fr) auto; padding: 10px 12px; gap: 12px; display: grid; align-items: center; }
.task-card-compact .task-details, .task-card-compact .task-progress, .task-card-compact .task-title-group > p { display: none; }
.task-title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.compact-meta { display: grid; grid-template-columns: minmax(96px, 0.7fr) minmax(126px, 1fr) auto; align-items: center; gap: 9px; min-width: 0; }
.compact-date { color: var(--muted); font-family: var(--mono); font-size: 0.8rem; font-weight: 600; }
.compact-date.is-late { color: var(--danger); }
.compact-assignee { display: flex; align-items: center; gap: 6px; min-width: 0; }
.compact-assignee select { min-width: 0; padding: 0.5rem 0.65rem; border-radius: var(--radius-sm); }
.task-card-detailed .compact-meta { display: none; }

.completion-toggle { flex: 0 0 auto; width: 32px; height: 32px; border: 2px solid color-mix(in srgb, var(--accent) 70%, var(--line-strong)); border-radius: 50%; color: #fff; background: transparent; transition: transform 120ms ease, background 140ms ease, border-color 140ms ease; }
.completion-toggle:hover { transform: scale(1.06); border-color: var(--accent); background: var(--accent-softer); }
.completion-toggle.completed { border-color: transparent; background: var(--accent); }

.task-card-compact .task-card-actions { grid-column: auto; width: auto; justify-self: end; display: flex; flex-wrap: nowrap; }
.task-card-compact .status-select-label { display: none; }
.task-card-compact .task-card-actions button { white-space: nowrap; padding: 0.5rem 0.62rem; }

.task-more { position: relative; }
.task-more summary { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; list-style: none; background: var(--surface); }
.task-more summary::-webkit-details-marker { display: none; }
.task-more summary:hover { border-color: var(--accent); color: var(--accent-deep); }
.task-more-menu { position: absolute; z-index: 10; right: 0; top: calc(100% + 6px); width: 190px; display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--bg-alt); box-shadow: var(--shadow-pop); }
.task-more-menu button { padding: 0.6rem 0.7rem; border-radius: 8px; text-align: left; color: var(--text); background: transparent; font-weight: 500; }
.task-more-menu button:hover { background: var(--accent-soft); color: var(--accent-deep); }
.task-more-menu .danger-text:hover { background: var(--danger-soft); color: var(--danger); }
.density-toggle { min-width: 128px; }

/* --- carte « streamlined » (éditable en place) --- */
.task-card-streamlined { position: relative; grid-template-columns: 1fr; gap: 11px; padding: 15px 16px; overflow: visible; display: grid; }
.task-card-streamlined:hover { transform: none; }

.task-card-topline {
  display: grid;
  grid-template-columns: minmax(42px, 1fr) auto minmax(110px, 1fr);
  align-items: center;
  gap: 12px;
  margin: -15px -16px 3px;
  padding: 10px 14px;
  border-radius: var(--radius-md) var(--radius-md) 8px 8px;
  color: var(--text);
  background: var(--surface-3);
  border-bottom: 1px solid var(--line);
}

.task-card-streamlined .completion-toggle {
  position: static;
  justify-self: start;
  width: 34px;
  height: 34px;
  border-color: var(--accent);
  color: #fff;
}
.task-card-streamlined .completion-toggle.completed { background: var(--accent); border-color: transparent; }

.inline-date { position: relative; display: inline-flex; align-items: center; min-height: 30px; justify-self: center; color: var(--muted); font-family: var(--mono); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.inline-date.is-late { color: var(--danger); }
.inline-date input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.inline-date button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 34px; padding: 5px 12px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  color: inherit; background: var(--surface); font: inherit; cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}
.inline-date button:hover { border-color: var(--accent); background: var(--accent-softer); }
.inline-date button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.inline-assignee-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; max-width: min(48%, 210px); padding: 3px 8px 3px 4px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); justify-self: end; }
.inline-assignee-pill select { min-width: 0; max-width: 150px; padding: 0 20px 0 2px; border: 0; color: var(--text); background: transparent !important; font-weight: 700; box-shadow: none; cursor: pointer; }
.inline-assignee-pill select:focus { box-shadow: none; }

.task-main-streamlined { position: static; grid-template-columns: 1fr; align-items: start; padding-left: 0; }
.task-card-streamlined .task-title-group > h4 { margin-top: 6px; font-size: 1.04rem; }

.task-status-row { display: flex; align-items: center; }
.inline-status { display: inline-flex; width: max-content; min-height: 30px; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: 0.76rem; font-weight: 800; }
.inline-status select { width: auto; min-height: 30px; padding: 4px 26px 4px 10px; border: 0; border-radius: 999px; color: inherit; background-color: transparent; font-size: 0.76rem; font-weight: 800; box-shadow: none; cursor: pointer; }
.inline-status select:focus { box-shadow: none; }
.inline-status.status-todo { color: var(--muted); background: color-mix(in srgb, var(--muted) 16%, transparent); }
.inline-status.status-doing { color: var(--accent-deep); background: var(--accent-soft); }
.inline-status.status-late { color: var(--danger); background: var(--danger-soft); }
.inline-status.status-done { color: var(--info); background: var(--info-soft); }
.inline-status.status-archive { color: var(--muted); background: color-mix(in srgb, var(--muted) 16%, transparent); }

.streamlined-progress { max-width: 100%; }
.editor-status-readonly { margin-top: 6px; }
.task-card-streamlined .task-card-actions { width: 100%; justify-self: stretch; grid-template-columns: minmax(120px, 1fr) 44px; }

.task-delete-icon { width: 44px; height: 42px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent); border-radius: var(--radius-sm); color: var(--danger); background: var(--danger-soft); }
.task-delete-icon:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.task-delete-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#taskResultsHeader { scroll-margin-top: 84px; }
.task-board { padding-left: 0; }

/* ============================================================
   Empty / muted / list editors
   ============================================================ */
.empty-state { padding: 22px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-2); }
.muted { color: var(--muted); }
.list-editor { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 9px 11px; background: var(--surface-2); }
.rows { display: grid; gap: 9px; margin-top: 10px; }
.rows:empty { margin-top: 0; }
.step-tools { display: flex; gap: 7px; }

.record-list { display: grid; gap: 9px; }
.record-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.record-row div { display: grid; gap: 3px; min-width: 0; }
.record-row strong, .record-row span { overflow-wrap: anywhere; }
.record-row span { color: var(--muted); font-size: 0.84rem; }
.trash-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ============================================================
   Dialogs
   ============================================================ */
.task-dialog { width: min(960px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--bg-alt); box-shadow: var(--shadow-pop); color: var(--text); }
.task-dialog::backdrop { background: rgba(12, 18, 22, 0.5); }
.dialog-frame { margin: 0; }
.dialog-header, .dialog-body { padding: 20px; background: var(--bg-alt); }
.dialog-header { border-bottom: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.dialog-header h2 { margin: 0; font-size: 1.3rem; }
.dialog-body { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.new-board-form { display: grid; gap: 16px; }
.nb-field { display: grid; gap: 7px; }
.nb-field > label { color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.new-board-form .chips-row { margin-top: 2px; }

/* ============================================================
   Board launcher (page d'accueil)
   ============================================================ */
.board-launcher-dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: min(850px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--text);
  background: var(--bg-alt);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.board-launcher-dialog::backdrop { background: rgba(12, 18, 22, 0.55); }
.board-launcher-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 540px; max-height: min(850px, calc(100vh - 32px)); }

.launcher-rail {
  display: flex;
  flex-direction: column;
  padding: 28px 26px;
  color: var(--side-text);
  background: linear-gradient(170deg, color-mix(in oklab, var(--side-bg), white 7%), color-mix(in oklab, var(--side-bg), black 22%));
}
.launcher-rail h2 { margin: 32px 0 8px; font-size: 1.85rem; line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.launcher-rail p { margin: 0; color: var(--side-muted); font-size: 0.9rem; line-height: 1.5; }
.launcher-rail .app-name { color: #fff; }
.launcher-rail-actions { display: grid; gap: 10px; margin-top: 26px; }
.rail-btn { display: flex; align-items: center; gap: 11px; padding: 13px 15px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.9rem; text-align: left; }
.rail-btn svg { flex: none; }
.rail-btn-primary { background: #f6c945; color: #20261f; font-weight: 800; }
.rail-btn-primary:hover { background: #f3bf33; }
.rail-btn-soft { background: rgba(255, 255, 255, 0.10); color: #fff; border: 1px solid rgba(255, 255, 255, 0.14); }
.rail-btn-soft:hover { background: rgba(255, 255, 255, 0.17); }
.rail-btn-ghost { background: transparent; color: var(--side-text); border: 1px solid rgba(255, 255, 255, 0.14); }
.rail-btn-ghost:hover { background: rgba(255, 255, 255, 0.09); }
.launcher-rail-footer { display: grid; gap: 4px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--side-line); }
.launcher-rail-date { font-family: var(--mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--side-muted); }
.launcher-rail-footer span:last-child { font-size: 0.84rem; color: var(--side-text); }

.launcher-main { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 26px 28px; background: var(--bg-alt); overflow: auto; -webkit-overflow-scrolling: touch; }
.launcher-close { position: absolute; top: 20px; right: 20px; }
.launcher-main-head { display: flex; align-items: center; gap: 14px; margin: 4px 44px 13px 0; }
.launcher-main-head .section-heading { display: flex; align-items: baseline; gap: 9px; margin: 0; flex: none; }
.launcher-main-head h3 { margin: 0; }
.board-search { flex: 1; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--faint); transition: border-color 140ms ease, box-shadow 140ms ease; }
.board-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-softer); }
.board-search input { border: none; padding: 9px 0; background: transparent; border-radius: 0; box-shadow: none; }
.board-search input:hover, .board-search input:focus, .board-search input:focus-visible { border: none; outline: none; box-shadow: none; }

@media (max-width: 760px) {
  .board-launcher-shell { grid-template-columns: 1fr; max-height: none; }
  .launcher-rail { padding: 22px; }
  .launcher-rail h2 { margin-top: 16px; font-size: 1.4rem; }
  .launcher-rail h2 br { display: none; }
  .launcher-rail-footer { display: none; }
  .launcher-main { overflow: visible; }
}

.recent-board-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 22px 0;
  padding: 18px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--on-accent);
  text-align: left;
  background: var(--accent);
  transition: background 140ms ease, transform 120ms ease;
}
.recent-board-card:hover { background: var(--accent-deep); transform: translateY(-1px); }
.recent-board-card span:first-child { display: grid; gap: 3px; }
.recent-board-card small, .recent-board-card em { color: rgba(255, 255, 255, 0.78); font-style: normal; }
.recent-board-card strong { font-size: 1.14rem; }
.recent-arrow { font-weight: 700; white-space: nowrap; }

.board-launcher-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.board-launcher-grid .section-heading { margin-bottom: 11px; }
.board-launcher-grid .section-heading h3 { margin: 0; }
.board-launcher-grid .section-heading span { color: var(--muted); font-size: 0.82rem; }
.boards-list { display: grid; gap: 8px; align-content: start; max-height: 380px; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 2px; }
.board-list-card {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr) auto;
  align-items: stretch;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  text-align: left;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 140ms ease, background 140ms ease, transform 120ms ease;
}
.board-list-card:hover, .board-list-card.active { border-color: var(--accent); }
.board-card-bar { background: var(--accent-soft); }
.board-list-card.active .board-card-bar { background: var(--accent); }
.board-card-copy { display: grid; gap: 3px; min-width: 0; padding: 13px 16px; }
.board-card-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.board-card-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; }
.board-open-pill { flex: none; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; color: var(--accent-deep); background: var(--accent-soft); }
.board-list-card small { color: var(--muted); }
.board-card-arrow { display: grid; place-items: center; padding: 0 18px; color: var(--faint); font-weight: 700; font-size: 1.05rem; }
.board-list-card:hover .board-card-arrow, .board-list-card.active .board-card-arrow { color: var(--accent); }

.new-board-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.new-board-panel .board-action-btn {
  display: grid;
  gap: 3px;
  justify-items: center;
  align-content: center;
  min-height: 116px;
  padding: 20px 16px;
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-md);
  color: var(--accent-deep);
  background: var(--accent-softer);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.new-board-panel .board-action-btn:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-1px); }
.board-action-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 6px; border-radius: var(--radius-sm); font-size: 1.35rem; color: var(--on-accent); background: var(--accent); }
.board-action-label { font-size: 1rem; font-weight: 800; }
.board-action-sub { color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.new-board-panel h3 { grid-area: title; align-self: end; margin: 0 0 2px; }
.new-board-panel p { grid-area: description; align-self: start; margin: 0; color: var(--muted); line-height: 1.4; }
.new-board-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--radius-md); color: var(--on-accent); font-size: 1.4rem; background: var(--accent); }
.new-board-panel .new-board-icon { grid-area: icon; }
.new-board-panel form { grid-area: form; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.new-board-panel button { font-weight: 800; }
.board-import-divider { grid-area: divider; display: flex; align-items: center; gap: 10px; margin: 15px 0 11px; color: var(--muted); font-size: 0.76rem; }
.board-import-divider::before, .board-import-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.new-board-panel .open-saved-board-btn { grid-area: open; width: 100%; color: var(--accent-deep); background: var(--accent-softer); border: 1px solid var(--accent-soft); border-radius: var(--radius-sm); padding: 0.62rem 1rem; font-weight: 700; }
.new-board-panel .open-saved-board-btn:hover { background: var(--accent-soft); }
.board-file-hint { grid-area: hint; display: block; margin-top: 8px; color: var(--faint); text-align: center; font-size: 0.72rem; }

.template-library { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.template-library .section-heading { align-items: center; margin-bottom: 5px; }
.template-library .section-heading > div { display: flex; align-items: baseline; gap: 8px; }
.template-library .section-heading h3 { margin: 0; }
.template-library .section-heading span, .template-library-hint { color: var(--muted); font-size: 0.82rem; }
.template-library-hint { margin: 0 0 12px; }
.template-import-btn { padding: 0.55rem 0.8rem; border: 1px solid var(--accent-soft); border-radius: var(--radius-sm); color: var(--accent-deep); background: var(--accent-softer); font-weight: 700; }
.template-import-btn:hover { background: var(--accent-soft); }
.templates-list { display: grid; gap: 8px; }
.template-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 38px 38px; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.template-card-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); color: var(--on-accent); background: var(--accent); }
.template-card-copy { display: grid; gap: 2px; min-width: 0; }
.template-card-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-card-copy small { color: var(--muted); }
.template-use-btn { padding: 0.55rem 0.85rem; border-radius: var(--radius-sm); color: var(--on-accent); background: var(--accent); font-weight: 700; }
.template-use-btn:hover { background: var(--accent-deep); }
.template-icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--text); background: var(--surface); font-size: 0.95rem; }
.template-icon-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.template-icon-btn.danger-text { color: var(--danger); }
.template-icon-btn.danger-text:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.template-empty { padding: 15px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); color: var(--muted); text-align: center; background: var(--surface-2); }

/* ============================================================
   Toasts
   ============================================================ */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: grid; gap: 9px; }
.toast { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); color: var(--text); background: var(--bg-alt); box-shadow: var(--shadow-pop); }
.toast button { padding: 0.5rem 0.72rem; border-radius: 999px; color: var(--on-accent); background: var(--accent); font-weight: 700; }
.toast-check { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: var(--on-accent); background: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1360px) {
  .layout { grid-template-columns: 1fr; }
  .task-card:not(.task-card-compact):not(.task-card-streamlined) { grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.2fr); }
  .task-card-compact { grid-template-columns: minmax(210px, 1fr) minmax(270px, 1fr); }
  .task-card-compact .task-card-actions { grid-column: 1 / -1; }
}

@media (max-width: 1100px) {
  body.menu-open { overflow: hidden; }

  .mobile-bar {
    position: fixed;
    z-index: 25;
    inset: 0 0 auto 0;
    height: 56px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 96px;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    color: #fff;
    background: var(--side-bg);
    border-bottom: 1px solid var(--side-line);
  }
  .mobile-bar strong { min-width: 0; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-menu-btn, .mobile-add-btn, .mobile-theme-btn { width: 44px; height: 44px; border-radius: var(--radius-sm); color: #fff; background: var(--side-hover); }
  .mobile-add-btn { color: #3a2c05; font-size: 1.4rem; background: #f6c84c; }
  .mobile-bar-actions { display: grid; grid-template-columns: 44px 44px; gap: 8px; justify-self: end; }
  .mobile-bar-actions .mobile-theme-btn, .mobile-bar-actions .mobile-add-btn { box-sizing: border-box; display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; padding: 0; line-height: 1; }

  .app-sidebar { width: min(88vw, 320px); transform: translateX(-105%); transition: transform 0.22s ease; box-shadow: var(--shadow-pop); }
  body.menu-open .app-sidebar { transform: translateX(0); }
  .sidebar-close { display: grid; }
  .sidebar-overlay { position: fixed; z-index: 29; inset: 0; display: block; background: rgba(10, 15, 18, 0.5); }
  .sidebar-overlay[hidden] { display: none; }

  .hero, .layout, .filters-grid, .editor-grid, .task-form-page, .board-header { grid-template-columns: 1fr; }
  .board-controls, .segmented-control { justify-items: start; justify-content: flex-start; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { width: min(100vw - 18px, 100%); margin: 66px auto 24px; }
  .hero, .panel { padding: 16px; }
  .management-panel { grid-template-columns: 1fr; }
  .top-nav { align-items: stretch; flex-direction: column; }
  .today-heading, .today-task { align-items: stretch; grid-template-columns: 1fr; }
  .today-heading { display: grid; }
  .today-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .task-card:not(.task-card-streamlined), .task-details, .task-main { grid-template-columns: 1fr; }
  .task-card-actions { width: 100%; grid-template-columns: 1fr 1fr 42px; }
  .board-launcher-grid { grid-template-columns: 1fr; }
  .quick-add { grid-template-columns: 1fr 1fr; }
  .quick-add-title { grid-column: 1 / -1; }
  .household-grid { grid-template-columns: 1fr; }
  .task-card-compact { grid-template-columns: 1fr; padding: 13px; }
  .task-card-compact .compact-meta { grid-template-columns: 1fr auto; }
  .task-card-compact .compact-date { grid-column: 1 / -1; }
  .task-card-compact .task-card-actions { justify-self: stretch; display: grid; grid-template-columns: 1fr 1fr 1fr 42px; }
  .task-card-compact .task-card-actions .ghost-btn { width: 100%; }
  .toast-host { right: 12px; bottom: 12px; left: 12px; }
  .toast { justify-content: space-between; }
}

@media (max-width: 760px) {
  .new-board-panel { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .filter-search-row, .filter-select-row { grid-template-columns: 1fr; }
  .toggle-filter { width: 100%; }
}

@media (max-width: 560px) {
  .board-launcher-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .board-launcher-shell { padding: 18px; }
  .board-launcher-header { gap: 12px; }
  .recent-board-card { align-items: flex-end; padding: 16px; }
  .recent-arrow { font-size: 0.84rem; }
  .quick-add { grid-template-columns: 1fr; }
  .task-card-compact .compact-meta { grid-template-columns: 1fr; }
  .compact-date { grid-column: auto !important; }
  .task-card-compact .task-card-actions { grid-template-columns: 1fr 1fr 42px; }
  .today-progress-copy { display: grid; }
  .template-card { grid-template-columns: auto minmax(0, 1fr) 38px 38px; }
  .template-use-btn { grid-column: 1 / -1; grid-row: 2; }
  .template-library .section-heading { align-items: flex-start; }
  .task-card-streamlined { padding: 13px; }
  .task-card-topline { margin: -13px -13px 3px; padding: 9px 11px; grid-template-columns: minmax(39px, 1fr) auto minmax(88px, 1fr); gap: 6px; }
  .inline-date button { min-height: 34px; padding: 5px 9px; gap: 6px; font-size: 0.76rem; }
  .inline-assignee-pill { max-width: 100%; padding-right: 6px; }
  .inline-assignee-pill select { max-width: 80px; }
  .task-card-streamlined .task-card-actions { grid-template-columns: 1fr 44px; }
}


/* ============================================================
   Carte en ligne compacte (inspirée de 1a) — lecture seule,
   l'édition de la date/assigné se fait dans « Détail ».
   ============================================================ */
.task-card-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;
  padding: 11px 15px;
}
.task-card-row.is-done { opacity: 0.62; }
.task-card-row.status-edge-late { border-left: 3px solid var(--danger); }
.task-card-row.status-edge-doing { border-left: 3px solid var(--accent); }

.task-card-row .completion-toggle { order: 0; }

.tc-title {
  order: 1;
  flex: 1 1 220px;
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.tc-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tc-name { font-size: 0.98rem; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-title:hover .tc-name { color: var(--accent-deep); }
.task-card-row.is-done .tc-name { text-decoration: line-through; color: var(--muted); }
.tc-cat { flex: 0 0 auto; padding: 1px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; color: var(--accent-deep); background: var(--accent-soft); }
.tc-notes { font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.task-card-row .inline-status { order: 2; flex: 0 0 auto; }
.tc-date { order: 3; flex: 0 0 auto; font-family: var(--mono); font-size: 0.8rem; font-weight: 600; color: var(--muted); white-space: nowrap; min-width: 62px; }
.tc-date.is-late { color: var(--danger); }

.tc-assignee { order: 4; flex: 0 0 auto; display: flex; align-items: center; gap: 7px; min-width: 0; max-width: 168px; }
.tc-assignee .member-avatar { width: 26px; height: 26px; font-size: 0.66rem; }
.tc-assignee-name { font-size: 0.84rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tc-steps { order: 5; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; justify-content: flex-end; min-width: 88px; }
.tc-steps-track { width: 54px; height: 6px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); }
.tc-steps-track > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.task-card-row.is-done .tc-steps-track > span { background: var(--ok); }
.tc-steps-count { font-family: var(--mono); font-size: 0.76rem; font-weight: 600; color: var(--muted); min-width: 26px; text-align: right; }
.tc-steps.is-empty .tc-steps-count { color: var(--faint); }

.tc-actions { order: 6; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tc-actions .ghost-btn { min-height: 38px; padding: 0.5rem 0.85rem; }

@media (max-width: 760px) {
  .tc-title { flex-basis: 100%; }
  .tc-actions { margin-left: auto; }
}


/* ============================================================
   Vue Aujourd'hui — épurée (barre de progression + lignes 1a)
   ============================================================ */
body[data-view="today"] .hero,
body[data-view="today"] .quick-add { display: none; }

.today-greeting:empty { display: none; }
.today-heading #todaySummary { text-align: right; line-height: 1.5; }
.today-heading #todaySummary strong { color: var(--text); }

.today-progress { display: flex; align-items: center; gap: 14px; }
.today-progress .progress-bar { flex: 1 1 auto; height: 12px; border: 2px solid color-mix(in srgb, var(--accent) 70%, var(--line-strong)); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.today-progress-count { flex: 0 0 auto; font-family: var(--mono); font-size: 0.9rem; font-weight: 600; color: var(--muted); }

.today-row { padding: 12px 15px; }
.today-row .today-right { display: flex; align-items: center; gap: 14px; margin-left: auto; flex: 0 0 auto; }
.today-row .tc-title { order: 0; }
.today-row .today-right { order: 1; }
.today-row .today-right .tc-date { order: 0; }
.today-row .today-right .ghost-btn { order: 0; }
.today-row .today-right .member-avatar { width: 30px; height: 30px; font-size: 0.7rem; }
.today-row .tc-date { min-width: 46px; text-align: right; }
.today-row .ghost-btn { min-height: 36px; padding: 0.45rem 0.85rem; }


/* Section outils dans Paramètres du tableau + undo intégré au dialogue */
.household-grid .settings-tools-section { grid-column: 1 / -1; padding-top: 4px; border-top: 1px solid var(--line); }
.settings-tools-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; margin-top: 10px; }
.settings-tools-grid .ghost-btn { min-height: 52px; }
@media (max-width: 820px) { .settings-tools-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .settings-tools-grid { grid-template-columns: repeat(2, 1fr); } }
.dialog-frame { position: relative; }
.dialog-toast-host { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 60; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.dialog-toast-host:empty { display: none; }
.dialog-toast-host .toast { pointer-events: auto; }


/* Logo de marque (Jamwired) */
.brand-logo { display: block; height: 38px; width: auto; }
.brand-logo-sm { height: 28px; margin-bottom: 8px; }
.app-name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; color: var(--text); }
.sidebar-brand .app-name { margin-left: 2px; color: var(--side-text); }
.brand-lockup { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.brand-lockup .brand-logo-sm { margin-bottom: 0; }


/* Alignement uniforme des lignes du tableau « Toutes les tâches » */
.task-card-row:not(.today-row) {
  display: grid;
  grid-template-columns: 32px minmax(200px, 1fr) 88px 104px 156px 132px;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
}
.task-card-row:not(.today-row) .tc-title { order: 1; }
.task-card-row:not(.today-row) .tc-steps { order: 2; justify-content: flex-start; }
.task-card-row:not(.today-row) .inline-status { order: 3; justify-self: start; }
.task-card-row:not(.today-row) .tc-assignee { order: 4; max-width: none; }
.task-card-row:not(.today-row) .tc-actions { order: 5; margin-left: 0; justify-self: end; }

.task-board-head {
  display: grid;
  grid-template-columns: 32px minmax(200px, 1fr) 88px 104px 156px 132px;
  align-items: center;
  gap: 14px;
  padding: 2px 17px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
.task-board-head span:last-child { min-width: 44px; }

.tc-meta { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.tc-meta-date.is-late { color: var(--danger); }
.tc-meta-done { color: var(--faint); font-weight: 500; }
.tc-meta-sep { color: var(--faint); }

.tc-detail-link { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 8px; border: 0; background: transparent; color: var(--muted); font-size: 0.84rem; font-weight: 600; cursor: pointer; border-radius: var(--radius-sm); transition: color 120ms ease; }
.tc-detail-link svg { width: 15px; height: 15px; }
.tc-detail-link:hover { color: var(--accent-deep); }

.editor-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.editor-actions > button { flex: 1 1 0; min-width: 0; min-height: 48px; padding-inline: 0.75rem; }

@media (max-width: 1000px) {
  .task-card-row:not(.today-row) { display: flex; flex-wrap: wrap; }
  .task-board-head { display: none; }
}

/* ============================================================
   Refonte 2b — hero segmenté, quick-add fusionné, cartes accent
   ============================================================ */
.hero-eyebrow { margin: 0 0 2px; font-family: var(--mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.hero h1 { letter-spacing: -0.02em; }

.hero-stats { display: flex; gap: 0; width: max-content; margin-left: auto; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); overflow: hidden; }
.hero-stats .stat-card { display: flex; align-items: baseline; gap: 6px; padding: 10px 16px; border: none; border-right: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; cursor: pointer; }
.hero-stats .stat-card:last-child { border-right: none; }
.hero-stats .stat-card:hover { background: var(--accent-softer); }
.hero-stats .stat-card[aria-pressed="true"] { background: var(--accent-soft); }
.hero-stats .stat-card strong { font-family: var(--mono); font-size: 1.05rem; color: var(--text); }
.hero-stats .stat-card[data-stat-filter="all"] strong { color: var(--accent); }
.hero-stats .stat-card[data-stat-filter="late"] strong { color: var(--danger); }
.hero-stats .stat-card[data-stat-filter="done"] strong { color: var(--ok); }
.hero-stats .stat-card span { font-size: 0.74rem; font-weight: 600; color: var(--muted); white-space: nowrap; }

.quick-add { grid-template-columns: minmax(0, 1fr) auto 150px auto; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.quick-add .quick-add-title { display: flex; align-items: center; gap: 8px; padding-left: 14px; border: none; background: transparent; }
.quick-add .quick-add-title input { border: none; box-shadow: none; border-radius: 0; padding: 13px 8px 13px 0; background: transparent; }
.quick-add select, .quick-add input[name="dueDate"] { border: none; border-left: 1px solid var(--line); border-radius: 0; background: transparent; padding: 0 14px; }
.quick-add button[type="submit"] { border-radius: var(--radius-sm); margin: 6px; padding: 0 24px; background: #f6c84c; color: #3a2c05; font-weight: 800; }
.quick-add button[type="submit"]:hover { background: #f3bf33; }
.quick-add :focus-visible { outline-offset: -2px; }

.task-board { overflow: visible; }
.task-card-row:not(.today-row) { position: relative; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); padding-left: 20px; overflow: visible; }
.task-card-row:not(.today-row):hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.task-card-row:not(.today-row).status-edge-late { border-color: color-mix(in srgb, var(--danger) 35%, transparent); border-left-width: 1px; background: linear-gradient(90deg, var(--danger-soft), var(--surface) 40%); }
.task-card-row:not(.today-row).status-edge-doing { border-left-width: 1px; border-left-color: var(--line); }
.tc-bar { position: absolute; left: 1px; top: 1px; bottom: 1px; width: 4px; border-radius: calc(var(--radius-md) - 1px) 0 0 calc(var(--radius-md) - 1px); background: color-mix(in srgb, var(--accent) 30%, transparent); }
.status-edge-late .tc-bar { background: var(--danger); }
.status-edge-doing .tc-bar { background: var(--accent); }
.task-card-row.is-done .tc-bar { background: var(--ok); }

.tc-detail-link { display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: var(--radius-sm); background: var(--accent-softer); color: var(--accent-deep); font-size: 0.84rem; font-weight: 700; }
.tc-detail-link:hover { background: var(--accent-soft); }
.tc-detail-link svg { width: 14px; height: 14px; }

.tc-menu-wrap { position: relative; }
.tc-menu-btn { width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font-size: 1rem; line-height: 1; }
.tc-menu-btn:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-softer); }
.tc-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; display: grid; min-width: 150px; padding: 5px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--bg-alt); box-shadow: var(--shadow-pop); }
.tc-menu button { padding: 9px 12px; border-radius: 7px; background: transparent; text-align: left; font-size: 0.86rem; font-weight: 600; color: var(--text); }
.tc-menu button:hover { background: var(--accent-softer); }
.tc-menu button.danger-item { color: var(--danger); }
.tc-menu button.danger-item:hover { background: var(--danger-soft); }
.tc-menu[hidden] { display: none; }
.task-card-row:not(.today-row):has(.tc-menu:not([hidden])) { z-index: 25; }
.tc-menu-wrap:has(.tc-menu:not([hidden])) { z-index: 25; }

.sidebar-create { margin-bottom: 12px; }

.quick-add .quick-add-title > span { position: static; transform: none; flex: none; }

.sidebar-create { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.sidebar-create svg { flex: none; }
.member-avatar svg { width: 12px; height: 12px; display: block; }

.today-focus { display: grid; gap: 4px; justify-items: start; padding: 22px 24px; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow); }
.today-focus.status-late { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: linear-gradient(135deg, var(--danger-soft), var(--surface) 55%); }
.today-focus h3 { margin: 8px 0 0; font-size: 1.45rem; letter-spacing: -0.02em; }
.today-focus-meta { margin: 0 0 14px; color: var(--muted); font-size: 0.88rem; }
.today-focus-meta strong { color: var(--text); }
.today-focus-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.today-focus-done { padding: 0.7rem 1.3rem; border-radius: var(--radius-sm); background: #f6c84c; color: #3a2c05; font-weight: 800; }
.today-focus-done:hover { background: #f3bf33; }
.today-queue-title { margin: 12px 0 0; font-family: var(--mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.today-group { display: grid; gap: 9px; }

.board-header { align-items: center; }
.board-header-line { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.board-header-line h2 { margin: 0; }
.board-header-line .results-copy { margin: 0; }
