/* TF4U — interface. Mobile d'abord, barre latérale à partir de 900px. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --text: #1d2330;
  --text-2: #475467;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --accent: #38b39d;          /* couleur principale TF4U */
  --accent-hover: #2fa18c;
  --accent-ink: #187362;      /* accent pour le texte (contraste AA) */
  --accent-soft: #e4f5f1;
  --accent-text: #ffffff;     /* texte sur fond plein (boutons) : blanc en clair, comme le logo */
  --accent-fill: #38b39d;     /* fond des boutons principaux : vert TF4U */
  --accent-fill-hover: #2fa18c;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn-soft: #fffaeb;
  --warn-text: #93370d;
  --chart-bar: #38b39d;
  --chart-grid: #eaecf0;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 8%);
  --radius: 12px;
  --radius-sm: 8px;
  --tabbar-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117;
    --surface: #181b24;
    --surface-2: #20242f;
    --text: #e8eaf0;
    --text-2: #c2c7d0;
    --muted: #98a2b3;
    --line: #2a2f3c;
    --line-strong: #3a4050;
    --accent: #38b39d;
    --accent-hover: #4cc7b0;
    --accent-ink: #5fd3bd;
    --accent-soft: #12322c;
    --accent-text: #052620;
    --accent-fill: #38b39d;
    --accent-fill-hover: #4cc7b0;
    --danger: #f97066;
    --danger-soft: #3a1a18;
    --ok: #47cd89;
    --ok-soft: #10301f;
    --warn-soft: #33260d;
    --warn-text: #fec84b;
    --chart-bar: #38b39d;
    --chart-grid: #262a36;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1117; --surface: #181b24; --surface-2: #20242f; --text: #e8eaf0; --text-2: #c2c7d0; --muted: #98a2b3;
  --line: #2a2f3c; --line-strong: #3a4050; --accent: #38b39d; --accent-hover: #4cc7b0; --accent-ink: #5fd3bd; --accent-soft: #12322c; --accent-text: #052620; --accent-fill: #38b39d; --accent-fill-hover: #4cc7b0;
  --danger: #f97066; --danger-soft: #3a1a18; --ok: #47cd89; --ok-soft: #10301f; --warn-soft: #33260d; --warn-text: #fec84b;
  --chart-bar: #38b39d; --chart-grid: #262a36; --shadow: 0 1px 2px rgb(0 0 0 / 40%); --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
a { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.text-danger { color: var(--danger); }
.ic { width: 18px; height: 18px; flex: none; }
.ic-xl { width: 40px; height: 40px; color: var(--muted); }
.boot, .loading { padding: 40px 16px; text-align: center; color: var(--muted); }
.print-only { display: none; }

/* ---------- Layout ---------- */
#app { min-height: 100vh; min-height: 100dvh; }
.content { padding: 0 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px); max-width: 1080px; margin: 0 auto; }
main:focus { outline: none; }
.page { padding-top: calc(16px + env(safe-area-inset-top)); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.sidebar {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.brand { display: none; }
.nav { display: flex; height: var(--tabbar-h); }
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 500;
}
.nav a .ic { width: 22px; height: 22px; }
.nav a[aria-current] { color: var(--accent-ink); }

@media (min-width: 900px) {
  .sidebar {
    top: 0; right: auto; width: 220px; border-top: 0; border-right: 1px solid var(--line);
    padding: 20px 12px; background: var(--surface);
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
  .nav { flex-direction: column; height: auto; gap: 2px; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-2); }
  .nav a .ic { width: 18px; height: 18px; }
  .nav a:hover { background: var(--surface-2); }
  .nav a[aria-current] { background: var(--accent-soft); color: var(--accent-ink); }
  .content { margin-left: 220px; padding: 0 32px 48px; max-width: none; }
  .content > * { max-width: 1040px; margin-left: auto; margin-right: auto; }
  .page { padding-top: 28px; }
}

/* ---------- Composants ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent-fill); color: var(--accent-text); }
.btn-primary:hover:not(:disabled) { background: var(--accent-fill-hover); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-stop { background: var(--danger); color: #fff; }
.btn-stop:hover { filter: brightness(1.05); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .ic { width: 17px; height: 17px; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-inline { display: inline-flex; align-items: center; gap: 6px; }
.hint { color: var(--muted); font-size: 12px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; min-height: 40px; padding: 8px 10px; font-size: 16px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: none;
}
@media (min-width: 900px) { input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 14px; } }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
input:disabled, select:disabled { opacity: .55; }
input[type=file] { font-size: 14px; max-width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; margin-bottom: 12px; }
.switch-sm { margin: 0; font-size: 13px; color: var(--text-2); }
.grid-2, .grid-3 { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 > .switch { align-self: center; }

.badge { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn-text); }
.entry.is-long .entry-dur { color: var(--warn-text); }
.alert {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: -8px 0 20px; padding: 10px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn-text);
  text-decoration: none; font-size: 14px;
}
.alert-cta { font-weight: 600; white-space: nowrap; }
.notice .btn { margin-left: 8px; }
.notice { background: var(--warn-soft); color: var(--warn-text); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; margin: 0 0 12px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }
.dot-lg { width: 14px; height: 14px; }
.empty-state { text-align: center; padding: 40px 16px; color: var(--text-2); }
.empty-state p { margin: 8px 0 0; }
.empty { color: var(--muted); padding: 16px; }

/* Toasts */
#toasts { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 900px) { #toasts { bottom: 24px; left: auto; right: 24px; transform: none; } }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgb(0 0 0 / 20%); font-size: 14px; animation: toast-in .2s ease-out; transition: opacity .3s; }
.toast-error { background: var(--danger); color: #fff; }
.toast-success { background: var(--ok); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast-success { color: #052e16; } }
:root[data-theme="dark"] .toast-success { color: #052e16; }
.toast.has-action { display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.toast.has-action > span { flex: 1; min-width: 0; }
.toast-action {
  flex: none; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-weight: 700;
  padding: 4px 10px; border-radius: 6px; cursor: pointer; opacity: .95;
}
.toast-action:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.toast.out { opacity: 0; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* Modales */
/* Largeur de base de toutes les fenêtres (v0.9.3) : celle de « Modifier l'entrée » (620 px) ; confirmations : .modal-sm */
dialog.modal {
  width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line);
  border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 24px 48px rgb(0 0 0 / 25%);
}
dialog.modal-sm { width: min(400px, calc(100vw - 24px)); }
dialog::backdrop { background: rgb(15 17 23 / 45%); }
.modal-form { display: flex; flex-direction: column; max-height: calc(100dvh - 34px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 20px; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 8px 20px 4px; overflow-y: auto; }
.modal-body p { margin: 8px 0; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); margin-top: 8px; }
.modal-sm .modal-foot { border-top: 0; }
.spacer { flex: 1; }
@media (max-width: 559px) {
  dialog.modal:not(.modal-sm) { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
}

/* ---------- Timer ---------- */
.tracker { padding: 12px; margin-bottom: 20px; }
.tracker-form { display: flex; flex-direction: column; gap: 10px; }
input.tracker-desc { font-size: 17px; border: 0; padding: 10px 6px; min-height: 44px; background: transparent; }
input.tracker-desc:focus-visible { box-shadow: none; }
.tracker-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tracker-fields select { width: auto; flex: 1 1 140px; max-width: 100%; }
.toggle-billable {
  width: 40px; height: 40px; flex: none; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.toggle-billable.on { color: var(--accent-ink); background: var(--accent-soft); border-color: transparent; }
.tracker-clock {
  font: 600 22px/1 var(--mono); font-variant-numeric: tabular-nums; min-width: 112px; text-align: center;
  background: transparent; border: 0; color: var(--text); padding: 8px 4px; border-radius: var(--radius-sm); cursor: pointer;
}
.tracker-clock:disabled { color: var(--muted); cursor: default; }
.tracker-clock:not(:disabled):hover { background: var(--surface-2); }
.btn-start, .tracker .btn-stop { min-width: 120px; min-height: 44px; }
.manual { display: flex; align-items: center; gap: 6px; flex: 1 1 100%; flex-wrap: wrap; }
.manual input[type=date] { flex: 1 1 140px; width: auto; }
.manual input[type=time] { flex: 0 1 108px; width: auto; }
.manual input.manual-dur { flex: 0 1 84px; width: auto; text-align: center; }
.mode-switch { display: flex; gap: 4px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.mode-switch button, .period-tabs button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted);
  padding: 6px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.mode-switch button .ic { width: 15px; height: 15px; }
.mode-switch button[aria-selected="true"], .period-tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-ink); }
@media (min-width: 900px) {
  .tracker-form { flex-direction: row; align-items: center; }
  input.tracker-desc { flex: 1 1 auto; min-width: 180px; }
  .tracker-fields { flex: 0 1 auto; flex-wrap: nowrap; }
  .tracker-fields select { flex: 0 1 180px; }
  .manual { flex: 0 1 auto; flex-wrap: nowrap; }
}
@media (max-width: 899px) {
  .tracker-fields .tracker-project { flex: 1 1 100%; }
  .tracker-fields .tracker-project:has(~ .tracker-task[hidden]) { flex: 1 1 calc(100% - 48px); }
  .tracker-fields .tracker-task { flex: 1 1 calc(100% - 48px); }
  .tracker-fields .tracker-clock { flex: 1 1 auto; text-align: left; padding-left: 6px; }
  .tracker-fields .btn-start, .tracker-fields .btn-stop { flex: 0 0 auto; min-width: 140px; }
  .manual input[type=date] { flex: 1 1 100%; }
}

.week { margin-bottom: 24px; }
.week-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 8px; }
.week-head h2 { font-size: 14px; font-weight: 600; color: var(--text-2); }
.week-total { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 600; }
.day { margin-bottom: 12px; overflow: hidden; }
.day-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.day-head h3 { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: capitalize; }
.day-total { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.btn-more { display: flex; margin: 8px auto; }

.entry { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 4px; border-bottom: 1px solid var(--line); min-height: 56px; }
.entries > .entry:last-child { border-bottom: 0; }
.entry.is-running { background: var(--accent-soft); }
.entry-check { display: flex; align-items: center; padding: 0 4px 0 8px; }
.entry-main { flex: 1; min-width: 0; text-align: left; background: transparent; border: 0; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
@media (hover: hover) { .entry-main:hover { background: var(--surface-2); } }
.entry-desc { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ctx-project { font-weight: 500; }
.ctx-task, .ctx-client { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.entry-meta { display: flex; align-items: center; gap: 10px; flex: none; font-variant-numeric: tabular-nums; }
.entry-billable { display: inline-flex; color: var(--line-strong); }
.entry-billable .ic { width: 15px; height: 15px; }
.entry-billable.on { color: var(--accent-ink); }
.entry-range { font-size: 13px; color: var(--muted); white-space: nowrap; }
.entry-date { color: var(--text-2); }
.entry-amount { font-size: 13px; color: var(--text-2); min-width: 64px; text-align: right; }
.entry-dur { font-weight: 600; min-width: 48px; text-align: right; }
.entry-actions { display: flex; width: 36px; }
@media (max-width: 699px) {
  .entry { flex-wrap: wrap; padding: 6px 8px 8px 4px; }
  .entry-main { flex-basis: calc(100% - 50px); }
  .entry-meta { width: 100%; padding-left: 8px; gap: 8px; }
  .entry-check + .entry-main + .entry-meta { padding-left: 38px; }
  .entry-range { margin-right: auto; }
  .entry-amount { min-width: 0; }
}

/* Bandeau timer en cours */
.running-bar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 10px;
  margin: 0 -16px; padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: color-mix(in srgb, var(--accent-soft) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) { .running-bar { margin: 0 -32px; padding: 10px 32px; max-width: none; } }
.running-info { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; color: var(--text); text-decoration: none; }
.running-desc { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.running-proj { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.running-time { font: 600 16px var(--mono); font-variant-numeric: tabular-nums; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); flex: none; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ---------- Rapports ---------- */
.filters { padding: 12px; margin-bottom: 16px; }
.period-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-bottom: 10px; }
.period-tabs::-webkit-scrollbar { display: none; }
.period-tabs button { flex: none; padding: 7px 12px; }
.period-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.period-label { font-size: 15px; min-width: 0; text-align: center; }
.period-nav input[type=date] { width: auto; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.filter-row .field { margin-bottom: 4px; }
@media (min-width: 900px) { .filter-row { grid-template-columns: repeat(6, 1fr); } }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 12px; } }
.stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.stat-value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 12px; color: var(--muted); }

.chart-card, .breakdown, .details { padding: 16px; margin-bottom: 16px; }
.chart { position: relative; padding-bottom: 20px; }
.chart svg { display: block; width: 100%; height: 200px; overflow: visible; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .bar { fill: var(--chart-bar); }
.chart .bar-hit { cursor: default; }
.chart .bar-hit.hover .bar { fill: var(--accent-hover); }
.chart .bar-hit.hover rect { fill: color-mix(in srgb, var(--accent) 8%, transparent); }
.chart-y { position: absolute; top: 0; left: 0; height: 200px; }
.chart-y span { position: absolute; left: 0; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-x { position: relative; height: 18px; }
.chart-x span { position: absolute; top: 2px; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart-tip {
  position: absolute; top: -4px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  font-size: 12px; font-weight: 600; padding: 5px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none;
}

.bd-head, .bd-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 64px 96px 104px; gap: 10px; align-items: center; }
.bd-head { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 0 4px 6px; border-bottom: 1px solid var(--line); }
.bd-head span:nth-child(n+2), .bd-time, .bd-billed, .bd-amount { text-align: right; font-variant-numeric: tabular-nums; }
.bd-row { padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.bd-row:last-child { border-bottom: 0; }
.bd-name { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-l0 { font-weight: 600; }
.bd-l1 .bd-name { padding-left: 28px; }
.bd-l2 { color: var(--text-2); font-size: 13px; }
.bd-l2 .bd-name { padding-left: 56px; }
.bd-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bd-bar span { display: block; height: 100%; background: var(--chart-bar); border-radius: 3px; }
.bd-billed { color: var(--muted); font-size: 13px; }
@media (max-width: 599px) {
  .bd-head, .bd-row { grid-template-columns: minmax(0, 1fr) 58px 86px 32px; gap: 8px; font-size: 13px; }
  .bd-invoice { min-height: 28px; width: 32px; padding: 0; }
  .bd-name { gap: 6px; }
  .bd-sub { display: none; }
  .bd-head > span:nth-child(3), .bd-row > .bd-billed { display: none; }
  .bd-l1 .bd-name { padding-left: 14px; }
  .bd-l2 .bd-name { padding-left: 28px; }
  .bd-invoice span { display: none; }
}

.details-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.details-head .section-title { margin: 0; }
.bulk { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.check-all { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 0 6px; cursor: pointer; }
.details .entries { margin: 0 -16px; border-top: 1px solid var(--line); }
.details .entries:not(.expanded) > .is-extra { display: none; }
.details .entries > div > .entry { border-bottom: 1px solid var(--line); }
.details .entries > div:last-child > .entry { border-bottom: 0; }
.details .btn-more { margin-top: 12px; }

/* ---------- Projets / clients ---------- */
.group { margin-bottom: 24px; }
.group-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 4px 8px; }
.project { margin-bottom: 12px; overflow: hidden; }
.project-head { display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 16px; }
.project-title { flex: 1; min-width: 0; }
.project-title h3 { font-size: 16px; }
.project-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.rate { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rate small { font-size: 11px; }
.tasks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.task { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 42px; border-bottom: 1px solid var(--line); min-height: 44px; font-size: 14px; }
.task:last-child { border-bottom: 0; }
.task-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.task .rate { font-size: 13px; }
.task-add { padding-left: 34px; }
.is-archived { opacity: .6; }

.list { overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--line); min-height: 56px; }
.list-row:last-child { border-bottom: 0; }
.list-main { flex: 1; min-width: 0; }
.list-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 599px) { .list-row .list-cell.small { display: none; } }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; }
.swatch input[type=radio] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatch-custom { background: conic-gradient(#dc2626, #d97706, #65a30d, #38b39d, #0891b2, #4f46e5, #db2777, #dc2626); overflow: hidden; }
.swatch-custom input[type=color] { position: absolute; inset: -8px; width: 46px; height: 46px; opacity: 0; cursor: pointer; border: 0; padding: 0; }

/* ---------- Réglages ---------- */
.settings-section { padding: 16px; margin-bottom: 16px; }
.settings-section > p { margin: 0 0 12px; font-size: 14px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; margin-bottom: 8px; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.form-grid .switch { align-self: center; }
.import-result { margin-top: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.import-result.done { background: var(--ok-soft); }
.import-result h3 { font-size: 15px; margin-bottom: 6px; }
.import-result h4 { font-size: 13px; margin: 8px 0 4px; }
.import-result ul { margin: 0; padding-left: 18px; }
.import-result p { margin: 0 0 8px; font-size: 14px; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(380px, 100%); padding: 28px 24px; display: flex; flex-direction: column; }
.login-card img { align-self: center; margin-bottom: 12px; }
.login-card h1 { text-align: center; }
.login-card > p.muted { text-align: center; margin: 4px 0 20px; }

/* ---------- Impression / PDF ---------- */
@media print {
  @page { margin: 14mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #f5f5f5; --text: #000; --text-2: #222; --muted: #555; --line: #ddd; --chart-bar: #38b39d; --accent-ink: #187362; --shadow: none; color-scheme: light; }
  body { background: #fff; font-size: 11pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .running-bar, .no-print, #toasts, .entry-actions, .entry-check, .chart-tip { display: none !important; }
  .print-only { display: block; }
  .content { margin: 0; padding: 0; max-width: none; }
  .page { padding: 0; }
  .page-head { display: none; }
  .print-head { margin-bottom: 12pt; }
  .print-head h1 { font-size: 16pt; }
  .print-head p { margin: 2pt 0; }
  .print-company { font-weight: 700; font-size: 12pt; margin-bottom: 4pt; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .details { break-inside: auto; }
  .details .entries > .is-extra { display: block !important; }
  .entry { break-inside: avoid; min-height: 0; }
  .entry-main { padding: 2pt 4pt; }
  .entry.is-running { background: none; }
  a { color: inherit; text-decoration: none; }
}

/* Paires date + heure dans la modale d'entrée */
.dt-pair { display: grid; grid-template-columns: 1fr 124px; gap: 0 8px; align-items: end; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Sélecteur segmenté (thème) */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 10px; margin-bottom: 8px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 6px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- v0.2 : filtres repliables, pastilles, graphique empilé ---------- */
.report-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.report-toolbar .period-tabs { flex: 1; min-width: 0; margin-bottom: 0; }
.filter-toggle { flex: none; position: relative; }
.filter-toggle.is-open { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.filter-toggle .count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent-fill); color: var(--accent-text); font-size: 11px; font-weight: 700;
}
@media (max-width: 559px) { .filter-toggle > span:not(.count) { display: none; } }
.filter-panel { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.filter-panel > .btn { margin-top: 4px; }
.period-nav { margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; border: 0; border-radius: 99px; cursor: pointer;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 600; padding: 4px 8px 4px 10px;
}
.chip .ic { width: 13px; height: 13px; }
.chip-reset { background: transparent; color: var(--muted); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head .section-title { margin: 0; }
.segmented-sm { margin: 0; }
.segmented-sm span { padding: 4px 10px; font-size: 13px; }

.chart svg { height: 220px; }
.chart-y { height: 220px; }
.chart .hit { fill: transparent; }
.chart .bar-hit { cursor: pointer; outline: none; }
.chart .bar-hit.hover .hit, .chart .bar-hit:focus-visible .hit { fill: color-mix(in srgb, var(--text) 6%, transparent); }
.chart .seg { transition: opacity .12s; }
.chart.has-focus .seg:not(.is-focus) { opacity: .35; }
.chart-tip {
  top: 0; min-width: 220px; max-width: min(340px, 92vw); white-space: normal; text-align: left;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
  padding: 10px 12px; font-weight: 400; z-index: 5; transform: translate(-50%, -8px);
}
.tip-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.tip-head span { font-variant-numeric: tabular-nums; font-weight: 600; }
.tip-proj { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-weight: 600; }
.tip-proj.is-hover { color: var(--accent-ink); }
.tip-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip-client { color: var(--muted); font-weight: 400; }
.tip-val { font-variant-numeric: tabular-nums; }
.tip-task { display: flex; justify-content: space-between; gap: 10px; padding-left: 16px; color: var(--text-2); font-size: 12px; }
.tip-task span:last-child { font-variant-numeric: tabular-nums; }
.tip-foot { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.tip-empty { color: var(--muted); }
.swatch-sm { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 8px; }
.legend-item {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text-2);
  font-size: 12px; padding: 4px 8px; border-radius: 6px; cursor: pointer; max-width: 100%;
}
.legend-item:disabled { cursor: default; }
@media (hover: hover) { .legend-item:not(:disabled):hover { background: var(--surface-2); color: var(--text); } }
.legend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.legend-val { color: var(--muted); font-variant-numeric: tabular-nums; }

.bd-act { display: flex; justify-content: flex-end; }
.bd-invoice { min-height: 28px; padding: 2px 8px; }
.bd-label { overflow: hidden; text-overflow: ellipsis; }
.bd-sub { font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.bd-sub::before { content: "— "; }
@media print { .bd-head, .bd-row { grid-template-columns: minmax(0, 1fr) 72px 64px 96px 0; } .legend-item { color: #222; } .bd-children[hidden] { display: block !important; } .bd-count { border-color: #ccc; } }

/* Projets repliables */
.project-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 4px; margin: -6px 0 -6px -8px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.project-toggle .chev { display: inline-flex; transition: transform .15s; }
.project-toggle .chev .ic { width: 16px; height: 16px; }
.project.is-open .project-toggle .chev { transform: rotate(90deg); }
.project-title[data-action] { cursor: pointer; }
.task-count { margin-left: 6px; font-weight: 600; }
.project:not(.is-open) .project-head { border-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .project-toggle .chev { transition: none; } }

/* Historique du Timer : période + filtres repliables */
.history-bar { padding: 10px 12px; margin-bottom: 16px; }
.history-toolbar { display: flex; align-items: center; gap: 8px; }
.history-title { font-size: 15px; font-weight: 600; flex: 1; }
select.history-range { width: auto; min-width: 150px; }
.history-bar .period-nav { margin: 10px 0 0; }
.history-bar .filter-panel { margin-top: 10px; }
.filter-row-4 { grid-template-columns: 1fr 1fr; }
.filter-row-4 > .field:first-child { grid-column: 1 / -1; }
@media (min-width: 900px) { .filter-row-4 { grid-template-columns: 2fr 1fr 1fr 1fr; } .filter-row-4 > .field:first-child { grid-column: auto; } }
.history-summary { margin: 0 4px 12px; font-size: 14px; color: var(--text-2); }

/* Répartition : tableau dépliable + anneau */
.group-by { display: inline-flex; align-items: center; gap: 8px; }
.bd-layout { display: grid; gap: 16px; grid-template-columns: 1fr; }
.bd-donut { order: -1; position: relative; justify-self: center; width: min(240px, 70vw); }
@media (min-width: 900px) {
  .bd-layout { grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
  .bd-donut { order: 0; position: sticky; top: 72px; width: 100%; }
}
.bd-donut svg { display: block; width: 100%; height: auto; overflow: visible; }
.donut-seg { stroke: var(--surface); stroke-width: 2; cursor: pointer; transition: opacity .12s; }
.donut-seg:not([data-key]) { cursor: default; }
.donut-seg.is-dim { opacity: .3; }
.donut-total { font: 700 22px var(--font); fill: var(--text); font-variant-numeric: tabular-nums; }
.donut-label { font: 500 12px var(--font); fill: var(--muted); font-variant-numeric: tabular-nums; }
.donut-tip {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; max-width: 118px;
  background: var(--surface); padding: 4px 6px; border-radius: 8px; font-size: 12px; color: var(--text-2); line-height: 1.3;
}
.donut-tip strong { color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; max-width: 112px; white-space: nowrap; }
.bd-count {
  display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 26px; height: 24px; padding: 0 6px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-2); color: var(--text-2);
  font: 600 12px var(--font); font-variant-numeric: tabular-nums; cursor: pointer;
}
.bd-count[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.bd-count-empty { visibility: hidden; cursor: default; }
.bd-all { min-width: 26px; padding: 0; }
.bd-all .ic { width: 14px; height: 14px; transition: transform .15s; }
.bd-all[aria-expanded="false"] .ic { transform: rotate(-90deg); }
.bd-head .bd-name { display: flex; align-items: center; gap: 8px; }
.dot-none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.bd-label.is-project { color: color-mix(in srgb, var(--c) 70%, var(--text)); }
.bd-row.is-hl { background: var(--surface-2); }
.bd-row.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.bd-l2 { color: var(--text-2); font-size: 13px; }
.bd-children .bd-row:last-child { border-bottom: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .bd-row.flash { animation: none; } .bd-all .ic { transition: none; } }

/* Menus déroulants : chevron maison, décollé du bord */
select:not([multiple]) {
  -webkit-appearance: none; appearance: none;
  background-image: var(--select-chevron); background-repeat: no-repeat;
  background-position: right 12px center; background-size: 16px 16px;
  padding-right: 38px; text-overflow: ellipsis;
}
select.history-range, .tracker-fields select { padding-right: 38px; }

/* Mobile : rien ne doit dépasser la largeur de l'écran */
.entry, .entry-main, .entry-meta, .card, .stat, .filter-row > *, .bd-name { min-width: 0; }
@media (max-width: 699px) {
  .entry-meta { flex-wrap: wrap; row-gap: 2px; column-gap: 8px; }
  .entry-range { min-width: 0; white-space: normal; }
  .badge-warn .badge-text { display: none; }
  .entry-actions { margin-left: auto; }
  .period-tabs { flex-wrap: wrap; overflow: visible; }
  .report-toolbar { align-items: flex-start; }
  .notice { overflow-wrap: anywhere; }
  .notice .btn { margin: 6px 0 0; display: flex; }
  .bulk { width: 100%; }
}
.modal-foot { flex-wrap: wrap; }
@media (max-width: 379px) { .modal-foot .btn { padding: 8px 10px; } .modal-foot { gap: 6px; padding-left: 12px; padding-right: 12px; } }

.brand-version {
  font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-2);
  padding: 2px 6px; border-radius: 99px; font-variant-numeric: tabular-nums; letter-spacing: 0;
}

/* Desktop : Réglages en bas de la barre latérale */
@media (min-width: 900px) {
  .sidebar { display: flex; flex-direction: column; bottom: 0; }
  .sidebar .nav { flex: 1; }
  .sidebar .nav a { flex: none; }
  .nav a.nav-end { margin-top: auto; }
}

/* Changelog (Réglages) */
.changelog details { border-top: 1px solid var(--line); padding: 10px 0; }
.changelog details:first-of-type { border-top: 0; padding-top: 0; }
.changelog summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
.changelog summary::-webkit-details-marker { display: none; }
.changelog summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; }
.changelog details[open] summary::before { transform: rotate(45deg); }
.changelog .cl-date { color: var(--muted); font-weight: 400; font-size: 13px; }
.changelog .badge { margin-left: 2px; }
.changelog ul { margin: 8px 0 0; padding-left: 22px; font-size: 14px; color: var(--text-2); }
.changelog li { margin: 3px 0; }
.changelog p { margin: 8px 0 0; font-size: 14px; color: var(--text-2); }
.changelog code { font: 12px var(--mono); background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }

/* ---------- Liste déroulante avec recherche (client / projet / tâche) ---------- */
select.combo-native { display: none !important; }
.combo { position: relative; min-width: 0; }
.combo[hidden] { display: none !important; }
.combo-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 8px 38px 8px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface) var(--select-chevron) no-repeat right 12px center / 16px 16px;
  color: var(--text); font-size: 16px; text-align: left; cursor: pointer;
}
@media (min-width: 900px) { .combo-trigger { font-size: 14px; } }
.combo-trigger:focus-visible, .combo.is-open .combo-trigger { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.combo-trigger:disabled { opacity: .55; cursor: default; }
.combo-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-value.is-placeholder { color: var(--text-2); }
.combo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.combo-dot[hidden] { display: none; }
.combo-panel {
  position: fixed; z-index: 200; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / 22%);
}
.combo-panel[hidden] { display: none; }
.combo-panel.is-sheet {
  left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 72dvh;
  border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom);
}
input.combo-search { border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; box-shadow: none !important; padding: 12px !important; background: var(--surface) !important; flex: none; }
.combo-list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; overscroll-behavior: contain; }
.combo-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.combo-option {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; cursor: pointer;
  font-size: 15px; color: var(--text); min-height: 40px;
}
@media (min-width: 900px) { .combo-option { font-size: 14px; min-height: 34px; padding: 7px 10px; } }
.combo-option > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-option.is-empty { color: var(--text-2); }
.combo-option.is-active { background: var(--surface-2); }
.combo-option.is-selected { color: var(--accent-ink); font-weight: 600; }
.combo-option.is-selected::after { content: "✓"; margin-left: auto; padding-left: 8px; }
.combo-option mark, .combo-group mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 2px; }
.combo-empty { padding: 14px 10px; color: var(--muted); font-size: 14px; text-align: center; }

/* Mise en page : le composant remplace le <select> dans les barres existantes */
.tracker-fields .combo { flex: 1 1 140px; max-width: 100%; }
@media (min-width: 900px) {
  .tracker-fields .combo.tracker-project { flex: 0 0 220px; }
  .tracker-fields .combo.tracker-task { flex: 0 0 200px; }
  input.tracker-desc { min-width: 160px; }
}
@media (max-width: 899px) {
  .tracker-fields .combo.tracker-project { flex: 1 1 100%; }
  .tracker-fields .combo.tracker-project:has(~ .combo.tracker-task[hidden]) { flex: 1 1 calc(100% - 48px); }
  .tracker-fields .combo.tracker-task { flex: 1 1 calc(100% - 48px); }
}
/* Bouton « ＋ Ajouter un projet / une tâche » en pied de liste */
.combo-foot-add { padding: 6px; }
.combo-add {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font: 600 14px var(--font); cursor: pointer;
}
.combo-add:hover, .combo-add:focus-visible { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); outline: none; border-style: solid; }

/* Liste à sélection multiple (filtres) */
.is-multi .combo-option::before {
  content: ""; flex: none; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--line-strong); background: var(--surface);
}
.is-multi .combo-option.is-selected::before {
  background: var(--accent-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
  border-color: var(--accent-fill);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .is-multi .combo-option.is-selected::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23052620' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); } }
:root[data-theme="dark"] .is-multi .combo-option.is-selected::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23052620' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.is-multi .combo-option.is-selected { color: var(--text); font-weight: 600; }
.is-multi .combo-option.is-selected::after { content: none; }
.combo-foot { display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid var(--line); flex: none; }
.combo-count { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.combo-foot .btn { min-height: 32px; }

/* Timer mis en avant : plus d'espace avant l'historique, relief plus marqué */
.tracker { margin-bottom: 28px; box-shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 8px 24px rgb(16 24 40 / 8%); }
:root[data-theme="dark"] .tracker { box-shadow: 0 8px 24px rgb(0 0 0 / 35%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tracker { box-shadow: 0 8px 24px rgb(0 0 0 / 35%); } }
.alert { margin: -12px 0 28px; }
.history-bar { margin-top: 12px; }
@media (min-width: 900px) {
  .tracker { margin-bottom: 40px; }
  .alert { margin: -20px 0 36px; }
  .history-bar { margin-top: 16px; }
}
.combo-value.is-hint { color: var(--accent-ink); font-weight: 600; }

/* Mobile : onglet actif de la barre du bas sur un léger fond */
@media (max-width: 899px) {
  .nav { padding: 6px 6px 0; gap: 4px; }
  .nav a { border-radius: 12px; margin-bottom: 6px; transition: background .15s, color .15s; }
  .nav a[aria-current] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
}
@media (max-width: 899px) and (prefers-reduced-motion: reduce) { .nav a { transition: none; } }

/* ---------- v0.3.2 : le timer, bloc principal de la page ---------- */
.tracker.tracker-hero {
  position: relative; padding: 16px; border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--surface)) 0%, var(--surface) 75%);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  box-shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 14px 36px -10px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: border-color .2s, box-shadow .2s;
}
.tracker-hero input.tracker-desc { font-size: 19px; font-weight: 500; min-height: 48px; }
.tracker-hero input.tracker-desc::placeholder { color: var(--muted); font-weight: 400; }
.tracker-hero .tracker-clock { font-size: 28px; min-width: 132px; }
.tracker-hero .btn-start, .tracker-hero .btn-stop { min-height: 48px; min-width: 140px; font-size: 15px; border-radius: 12px; }
.tracker-hero .btn-start { box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.tracker-hero .toggle-billable { width: 44px; height: 44px; }
.tracker-hero .combo-trigger { min-height: 44px; }
/* Timer en cours : bordure pleine, halo, chrono en couleur */
.tracker.tracker-hero.is-running {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent), 0 16px 40px -12px color-mix(in srgb, var(--accent) 45%, transparent);
}
.tracker-hero.is-running .tracker-clock { color: var(--accent-ink); }
.tracker-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
}
.tracker-foot .mode-switch { margin: 0; padding: 0; border: 0; }
.tracker-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.tracker-totals { display: flex; gap: 16px; font-size: 13px; font-variant-numeric: tabular-nums; }
.tracker-totals strong { color: var(--text); margin-left: 4px; }
@media (min-width: 900px) {
  .tracker.tracker-hero { padding: 22px 24px 16px; }
  .tracker-hero input.tracker-desc { font-size: 21px; }
  .tracker-hero .tracker-clock { font-size: 32px; min-width: 150px; }
}
@media (prefers-reduced-motion: reduce) { .tracker.tracker-hero { transition: none; } }

/* Historique au second plan */
.history-bar { background: transparent; border: 0; box-shadow: none; padding: 0 4px; }
.history-bar .history-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.history .day { box-shadow: none; }
.history .week-head h2 { font-weight: 600; color: var(--muted); }
@media (max-width: 899px) {
  .tracker-hero .tracker-fields .combo.tracker-project:has(~ .combo.tracker-task[hidden]) { flex: 1 1 calc(100% - 52px); }
  .tracker-hero .tracker-fields .combo.tracker-task { flex: 1 1 calc(100% - 52px); }
  .tracker-hero .tracker-clock { min-width: 0; flex: 1 1 auto; font-size: 26px; text-align: left; padding-left: 4px; }
  .tracker-hero .btn-start, .tracker-hero .btn-stop { min-width: 132px; }
}

/* Budgets (v0.4.0) */
.field-group { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px 0; margin: 4px 0 12px; min-width: 0; }
.field-group legend { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0 6px; margin-left: -6px; }
.back-link { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--muted); text-decoration: none; margin: 0 0 2px -4px; padding: 2px 4px; border-radius: 6px; }
.back-link .ic { width: 15px; height: 15px; }
@media (hover: hover) { .back-link:hover { color: var(--accent-ink); } }
.budget-link { color: var(--accent-ink); }
.text-warn { color: var(--warn-text); }
.text-ok { color: var(--ok); }
.empty-inline { margin: 4px 0; font-size: 14px; }
.st-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; flex: none; }
.st-badge > span { font-weight: 800; }
.st-ok { --st: var(--ok); --st-bg: var(--ok-soft); }
.st-warn { --st: var(--warn-text); --st-bg: var(--warn-soft); }
.st-over { --st: var(--danger); --st-bg: var(--danger-soft); }
.st-none { --st: var(--muted); --st-bg: var(--surface-2); }
.st-badge { color: var(--st); background: var(--st-bg); }
.budget-summary { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 14px; font-size: 14px; }
.budget-summary > span { display: inline-flex; align-items: center; gap: 6px; }
.budget-list { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .budget-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .budget-list { grid-template-columns: repeat(3, 1fr); } }
.budget-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; color: inherit; text-decoration: none; min-width: 0; transition: border-color .12s; }
@media (hover: hover) { .budget-card:hover { border-color: var(--accent); } }
.budget-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; min-width: 0; }
.budget-card-title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.budget-card-title strong, .budget-card-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.budget-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.budget-row > span:last-child { font-variant-numeric: tabular-nums; text-align: right; margin-left: auto; }
.budget-row-foot { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.meter { position: relative; display: flex; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 4px; }
.meter-fill { background: var(--accent); border-radius: 99px; }
.st-warn.meter .meter-fill { background: #f5a524; }
.st-over.meter .meter-fill { background: var(--accent); border-radius: 99px 0 0 99px; }
.meter-over { position: absolute; right: 0; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--danger) 0 4px, color-mix(in srgb, var(--danger) 70%, transparent) 4px 8px); }
.budget-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.budget-client { font-size: 15px; font-weight: 500; }
.stat-over .stat-value { color: var(--danger); }
.budget-progress { padding: 16px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.budget-progress .section-title { margin: 0 0 6px; }
.budget-progress .budget-row { font-size: 14px; }
.budget-facts { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 8px; font-size: 13px; }
.budget-facts strong { font-variant-numeric: tabular-nums; }
.chart-card { padding: 16px; margin-bottom: 16px; }
.chart-card .legend { margin: 0; }
.chart-card .legend-item { cursor: default; padding: 2px 6px; }
.swatch-line { width: 16px; height: 0; border-top: 2px dashed var(--text-2); display: inline-block; }
.budget-chart { padding-bottom: 0; }
.budget-chart svg { height: auto; touch-action: pan-y; }
.budget-chart .tick { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.budget-chart .area-time, .budget-chart .area-total { opacity: .85; stroke: none; }
.budget-chart .line-total { fill: none; stroke: var(--text-2); stroke-width: 1.2; opacity: .6; }
.budget-chart .budget-line { stroke: var(--text-2); stroke-width: 2; stroke-dasharray: 6 4; }
.budget-chart .budget-label { font-size: 11px; font-weight: 600; fill: var(--text-2); }
.budget-chart .cursor { stroke: var(--text-2); stroke-width: 1; }
.budget-chart .cursor-dot { fill: var(--surface); stroke: var(--text); stroke-width: 2; }
.budget-chart .hit { fill: transparent; cursor: crosshair; }
.expenses { padding: 16px; margin-bottom: 16px; }
.exp-list { display: flex; flex-direction: column; }
.exp-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: inherit; font: inherit; padding: 10px 4px; cursor: pointer; min-width: 0; border-radius: 0; }
.exp-row:last-child { border-bottom: 0; }
@media (hover: hover) { .exp-row:hover { background: var(--surface-2); } }
.exp-cat { font-size: 18px; width: 28px; text-align: center; flex: none; }
.exp-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.exp-main > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-label { font-weight: 600; font-size: 14px; }
.exp-amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.exp-total { display: flex; justify-content: flex-end; gap: 10px; padding: 10px 4px 0; border-top: 1px solid var(--line-strong); font-size: 14px; }
.cat-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cat-opt > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 99px; font-size: 13px; cursor: pointer; }
.cat-opt input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cat-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.exp-reb-text { display: none; color: var(--ok); font-weight: 600; }
@media (max-width: 560px) { .exp-row { gap: 8px; } .exp-reb-badge { display: none; } .exp-reb-text { display: inline; } }
@media print { .budget-chart .cursor, .budget-chart .cursor-dot { display: none; } }
.field-check .switch { margin: 0; }
.field-check .hint { display: block; }

/* ---------- v0.4.1 : Résumé / Détaillé, sélecteur de période, actions par lot ---------- */
.view-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); margin-right: auto; }
.view-tabs button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text-2);
  padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 34px;
}
.view-tabs button .ic { width: 16px; height: 16px; }
.view-tabs button[aria-selected="true"] { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow); }
.view-tabs .count { font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.view-tabs button[aria-selected="true"] .count { color: var(--accent-ink); }
.page-rapports .page-head h1 { margin-right: 4px; }
@media (max-width: 559px) { .page-rapports .view-tabs { order: 3; width: 100%; } .page-rapports .view-tabs button { flex: 1; justify-content: center; } }
.view-hint { margin: -4px 0 16px; text-align: center; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.filters { position: relative; }
.report-toolbar { align-items: center; }
.period-bar { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; flex-wrap: wrap; }
.period-current {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; max-width: 100%;
  border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; padding: 4px 8px; border-radius: 8px; cursor: pointer;
}
@media (hover: hover) { .period-current:hover { background: var(--surface-2); } }
.period-current.is-open { background: var(--accent-soft); }
.period-current:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.period-title { display: inline-flex; align-items: center; gap: 4px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.period-title .ic { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; flex: none; }
.period-current.is-open .period-title .ic { transform: rotate(180deg); color: var(--accent-ink); }
.period-sub { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.report-toolbar .filter-toggle { align-self: center; }
.pp {
  position: absolute; z-index: 30; left: 12px; right: 12px; top: 64px; max-width: 640px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 40px rgb(0 0 0 / 18%);
  padding: 10px; display: flex; flex-direction: column; gap: 10px;
}
.pp-kinds { display: flex; gap: 2px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pp-kinds button {
  border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
}
.pp-kinds button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.pp-body { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 12px; }
.pp-quick { display: flex; flex-direction: column; gap: 1px; border-right: 1px solid var(--line); padding-right: 10px; }
.pp-q { border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: left; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
@media (hover: hover) { .pp-q:hover, .pp-kinds button:hover { background: var(--surface-2); } }
.pp-q.is-sel { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.pp-main { min-width: 0; }
.pp-main .field { margin-bottom: 8px; }
.pp-year { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pp-year strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.pp-grid { display: grid; gap: 4px; }
.pp-weeks { grid-template-columns: repeat(7, minmax(0, 1fr)); max-height: 272px; overflow-y: auto; padding: 2px; }
.pp-months { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pp-quarters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pp-years { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pp-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 42px; min-width: 0;
  border: 1px solid transparent; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; border-radius: 8px; cursor: pointer; padding: 4px 2px;
}
.pp-cell small { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pp-cell strong { font-variant-numeric: tabular-nums; }
@media (hover: hover) { .pp-cell:hover { border-color: var(--accent); } }
.pp-cell.is-now { border-color: var(--accent); }
.pp-cell.is-sel { background: var(--accent-fill); color: var(--accent-text); border-color: var(--accent-fill); }
.pp-cell.is-sel small { color: var(--accent-text); opacity: .8; }
@media (max-width: 599px) {
  .pp { left: 8px; right: 8px; top: 60px; }
  .pp-body { grid-template-columns: 1fr; }
  .pp-quick { flex-direction: row; flex-wrap: wrap; gap: 4px; border-right: 0; padding-right: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .pp-q { background: var(--surface-2); border-radius: 99px; padding: 5px 10px; font-size: 12px; }
  .pp-weeks { max-height: 220px; }
  .period-title { font-size: 17px; }
}

/* Détaillé : jours */
.day-group + .day-group { margin-top: 10px; }
.day-group > .day-head { display: flex; align-items: center; gap: 8px; margin: 0 -16px; padding: 8px 12px 6px 4px; border-bottom: 1px solid var(--line); font-size: 14px; min-width: 0; }
.day-group > .day-head .entry-check { padding-left: 8px; }
.day-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-week { font-size: 11px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 99px; padding: 1px 7px; flex: none; }
.day-total { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media print { .day-head .entry-check { display: none; } }

/* Barre d'actions par lot */
.bulk-bar {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); width: min(calc(100vw - 24px), 760px);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px);
  background: var(--text); color: var(--bg); border-radius: 14px; box-shadow: 0 12px 32px rgb(0 0 0 / 28%); padding: 8px 8px 8px 14px;
}
@media (min-width: 900px) { .bulk-bar { bottom: 20px; left: calc(50% + 110px); width: min(calc(100vw - 260px), 760px); } }
.bulk-bar-inner { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.bulk-count { font-size: 14px; white-space: nowrap; }
.bulk-count .muted { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.bulk-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.bulk-bar .btn-ghost, .bulk-bar .btn-danger-ghost, .bulk-bar .icon-btn { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 30%, transparent); background: transparent; }
@media (hover: hover) { .bulk-bar .btn-ghost:hover, .bulk-bar .icon-btn:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); } }
.bulk-bar .btn-danger-ghost { color: #ff8a80; }
.bulk-bar .btn:disabled { opacity: .45; }
.bulk-bar .btn-primary { color: var(--accent-text); }
body.has-bulk-bar #toasts { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 88px); }
body.has-bulk-bar .content { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 120px); }
@media (min-width: 900px) { body.has-bulk-bar #toasts { bottom: 90px; } }
@media (max-width: 559px) {
  .bulk-bar { padding: 8px; }
  .bulk-count { width: 100%; padding-left: 4px; }
  .bulk-actions { margin-left: 0; width: 100%; }
  .bulk-actions .btn { flex: 1 1 auto; justify-content: center; padding-left: 8px; padding-right: 8px; }
}

/* Fenêtres « Modifier la sélection » */
.bulk-intro { margin: 0 0 12px; font-size: 14px; color: var(--text-2); }
.rate-mode { display: flex; gap: 6px; }
.rate-mode select { flex: 1 1 auto; min-width: 0; }
.rate-mode input { flex: 0 1 110px; min-width: 0; }
.hint.block { display: block; margin: -4px 0 12px; }
.swatch-keep { background: var(--surface-2); border: 1px dashed var(--line-strong); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; --c: var(--line-strong); }

/* Projets : mode sélection */
.select-mode .project-head { padding-left: 4px; }
.pick { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; cursor: pointer; }
.pick input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.group-title .pick { width: 26px; height: 26px; margin-left: -4px; }
.task .pick { width: 28px; height: 28px; margin-left: -6px; }
.project.is-picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.task.is-picked { background: var(--accent-soft); border-radius: 8px; }
.btn.is-active { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
:root[data-theme="dark"] .bulk-bar .btn-danger-ghost { color: #b42318; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bulk-bar .btn-danger-ghost { color: #b42318; } }
.period-group { display: flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; }
.period-current { flex: 0 1 auto; overflow: hidden; }
.pt-text, .period-sub { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.period-sub { display: block; }
@media (max-width: 559px) {
  .period-group .icon-btn { width: 34px; flex: none; }
  .period-bar [data-today] { margin-left: 36px; }
}

/* Bascule rapide clair / sombre */
.theme-toggle {
  position: fixed; z-index: 25; top: calc(env(safe-area-inset-top) + 10px); right: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text-2);
  box-shadow: var(--shadow); cursor: pointer; font: inherit;
}
.theme-toggle .ic { width: 19px; height: 19px; }
.theme-toggle-label { display: none; }
@media (hover: hover) { .theme-toggle:hover { color: var(--accent-ink); border-color: var(--accent); } }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 899px) { .page-head { padding-right: 48px; } }
.theme-toggle-side { display: none; }
@media (min-width: 900px) {
  .theme-toggle-top { display: none; }
  .theme-toggle-side { display: inline-flex; }
  .theme-toggle {
    position: static; order: 3; width: auto; height: auto; border: 0; border-radius: var(--radius-sm); box-shadow: none; background: transparent;
    justify-content: flex-start; padding: 9px 12px; font-size: 14px; color: var(--text-2); margin-top: 2px;
  }
  .theme-toggle .ic { width: 18px; height: 18px; }
  .theme-toggle-label { display: inline; }
  .theme-toggle:hover { background: var(--surface-2); color: var(--text); }
}
@media print { .theme-toggle { display: none !important; } }
.filters .report-toolbar { margin-bottom: 0; }
.filters .chips { padding-top: 10px; }
.filters .filter-panel { margin-top: 10px; }

/* v0.4.2 : boutons rapides de période */
.period-kinds { display: flex; gap: 2px; flex-wrap: wrap; margin: -2px 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.period-kinds button {
  border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
@media (hover: hover) { .period-kinds button:hover { background: var(--surface-2); color: var(--text); } }
.period-kinds button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.period-kinds button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.period-group .icon-btn:disabled { opacity: .3; cursor: default; }
.pp-all { margin: 4px 0 8px; font-size: 14px; }
@media (max-width: 599px) {
  .period-kinds { gap: 4px; }
  .period-kinds button { padding: 5px 9px; background: var(--surface-2); border-radius: 99px; font-size: 12px; }
}
@media (max-width: 379px) { .stat-value { font-size: 18px; } .stat { padding: 12px; } }
.field-state { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--warn-soft); color: var(--warn-text); vertical-align: 1px; }
.field-state.is-same { background: var(--surface-2); color: var(--muted); }

/* ---------- v0.4.3 ---------- */
/* Timer : reprises rapides, objectifs */
.recents { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.recents-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-right: 2px; }
.recent {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-size: 13px; padding: 5px 10px 5px 8px; border-radius: 99px; cursor: pointer;
}
.recent .ic { width: 12px; height: 12px; color: var(--accent-ink); flex: none; }
.recent-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.recent-desc { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.recent-desc::before { content: "· "; }
@media (hover: hover) { .recent:hover { border-color: var(--accent); background: var(--accent-soft); } }
@media (max-width: 559px) { .recent-desc { display: none; } .recent-name { max-width: 180px; } }
.total { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.goal-bar { display: inline-block; width: 56px; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-left: 4px; }
.goal-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.total.is-done strong { color: var(--accent-ink); }
.goal-ok { color: var(--accent-ink); font-weight: 800; }
.mode-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.mode-link .ic { width: 15px; height: 15px; }
@media (hover: hover) { .mode-link:hover { color: var(--accent-ink); background: var(--surface-2); } }

/* Résumé : modifier depuis la répartition */
.bd-head, .bd-row { grid-template-columns: minmax(0, 1fr) 72px 64px 96px 140px; }
.bd-act { gap: 4px; align-items: center; }
.bd-edit { width: 30px; height: 30px; flex: none; }
.bd-edit .ic { width: 15px; height: 15px; }
.bd-edit-spacer { width: 30px; flex: none; }
.bd-entries { padding: 4px 0 8px 40px; border-bottom: 1px solid var(--line); }
.bd-entries .entry { font-size: 14px; }
@media (max-width: 599px) {
  .bd-head, .bd-row { grid-template-columns: minmax(0, 1fr) 58px 86px 68px; }
  .bd-entries { padding-left: 0; }
}
@media print { .bd-head, .bd-row { grid-template-columns: minmax(0, 1fr) 72px 64px 96px 0; } .bd-entries[hidden] { display: none !important; } }

/* Boutons en haut à droite (iPhone) : recherche + thème */
.top-actions { position: fixed; z-index: 25; top: calc(env(safe-area-inset-top) + 10px); right: 12px; display: flex; gap: 8px; }
.top-actions .theme-toggle { position: static; }
.top-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--text-2); box-shadow: var(--shadow); cursor: pointer;
}
.top-btn .ic { width: 19px; height: 19px; }
@media (max-width: 899px) { .page-head { padding-right: 96px; } }
@media (min-width: 900px) { .top-actions { display: none; } }
.search-side { display: none; }
@media (min-width: 900px) {
  .search-side {
    display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 14px; padding: 8px 10px 8px 12px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; text-align: left;
  }
  .search-side .ic { width: 16px; height: 16px; }
  .search-side span { flex: 1; }
  .search-side:hover { border-color: var(--accent); color: var(--text); }
}
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface); color: var(--text-2);
  font: 600 11px/1 system-ui, -apple-system, sans-serif;
}

/* Palette de recherche */
dialog.palette { border: 0; padding: 0; background: transparent; width: min(640px, calc(100vw - 24px)); max-width: none; margin: 10vh auto auto; overflow: visible; }
dialog.palette::backdrop { background: rgb(15 17 23 / 45%); }
.palette-box { background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 64px rgb(0 0 0 / 30%); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.palette-input .ic { width: 20px; height: 20px; color: var(--muted); flex: none; }
.palette-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; padding: 4px 0; box-shadow: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: min(60vh, 460px); overflow-y: auto; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; min-width: 0; }
.palette-item.is-active { background: var(--accent-soft); }
.palette-icon { width: 22px; display: inline-flex; justify-content: center; flex: none; color: var(--muted); }
.palette-icon .ic { width: 17px; height: 17px; }
.palette-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.palette-label { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-kind { font-size: 11px; color: var(--muted); flex: none; }
.palette-run, .palette-alt { display: none; flex: none; min-height: 28px; padding: 2px 10px; }
.palette-item.is-active .palette-run, .palette-item.is-active .palette-alt { display: inline-flex; }
.palette-item.is-active .palette-kind { display: none; }
.palette-empty { padding: 20px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; }
.palette-foot kbd { margin: 0 2px; }
@media (max-width: 599px) {
  dialog.palette { margin-top: calc(env(safe-area-inset-top) + 8px); }
  .palette-foot, .palette-esc { display: none; }
  .palette-run, .palette-alt { display: inline-flex; }
  .palette-alt { display: none !important; }
  .palette-kind { display: none; }
}

/* Rappel « timer oublié ? » */
.reminder { position: sticky; top: calc(env(safe-area-inset-top) + 8px); z-index: 20; margin: 12px 0 0; }
.reminder-inner {
  display: flex; align-items: center; gap: 12px 14px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--warn-text); border: 1px solid color-mix(in srgb, var(--warn-text) 30%, transparent); box-shadow: var(--shadow);
}
.reminder-icon .ic { width: 22px; height: 22px; }
.reminder-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 240px; min-width: 0; font-size: 14px; }
.reminder-text strong { color: inherit; }
.reminder-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.reminder-at { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.reminder-at input { width: auto; min-height: 32px; padding: 4px 8px; font-size: 14px; }
@media (max-width: 559px) { .reminder-actions, .reminder-at { width: 100%; } .reminder-at input[type=date] { flex: 1; } }

/* Glisser une entrée (iPhone) */
.entries { position: relative; }
@media (hover: none) { .entry { touch-action: pan-y; } }
.entry.is-swiping { position: relative; z-index: 1; background: var(--surface); box-shadow: 0 2px 10px rgb(0 0 0 / 12%); }
.swipe-under {
  position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
  border-radius: 10px; font-size: 14px; font-weight: 700; color: #fff; background: var(--surface-2);
}
.swipe-under > span { display: inline-flex; align-items: center; gap: 6px; opacity: .55; }
.swipe-under .ic { width: 18px; height: 18px; }
.swipe-under.to-resume { background: var(--accent-fill); color: var(--accent-text); }
.swipe-under.to-delete { background: var(--danger); }
.swipe-under.to-resume .swipe-right, .swipe-under.to-delete .swipe-left { visibility: hidden; }
.swipe-under.is-armed > span { opacity: 1; }

/* Réglages : raccourcis */
.shortcuts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0; font-size: 14px; align-items: center; }
.shortcuts dt { display: flex; gap: 4px; align-items: center; }
.shortcuts dd { margin: 0; color: var(--text-2); }
@media (max-width: 559px) { .shortcuts { grid-template-columns: 1fr; gap: 2px; } .shortcuts dd { margin-bottom: 8px; } }
#reminder .reminder-at input[type=date], #reminder .reminder-at input[type=time] { width: auto; flex: 0 0 auto; }
#reminder .reminder-at input[type=date] { max-width: 160px; }
#reminder .reminder-at input[type=time] { max-width: 120px; }
@media (min-width: 560px) { .reminder-at { flex-wrap: nowrap; } }
@media (max-width: 559px) { #reminder .reminder-at input[type=date] { max-width: none; flex: 1 1 auto; } }
#notif { white-space: normal; text-align: left; height: auto; min-height: 32px; max-width: 100%; }

/* Timer, mode manuel (v0.4.3) : ligne date / début → fin / durée sous la description */
.tracker-form.is-manual { flex-wrap: wrap; }
.manual-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 16px; flex: 1 1 100%; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px dashed var(--line); }
.manual-row .manual { flex: 1 1 auto; display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.mf { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.mf > span { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.tracker .mf input { width: 100%; min-height: 44px; }
.mf-date { flex: 0 1 170px; }
.mf-time { flex: 0 1 120px; }
.mf-dur { flex: 0 1 96px; }
.mf-dur input { text-align: center; }
.mf-arrow { padding-bottom: 12px; }
.manual-row .btn-start { flex: 0 0 auto; }
@media (min-width: 900px) {
  .tracker-form.is-manual input.tracker-desc { flex: 1 1 260px; }
}
@media (max-width: 559px) {
  .manual-row .manual { gap: 8px; }
  .mf-date { flex: 1 1 100%; }
  .mf-time { flex: 1 1 calc(50% - 20px); }
  .mf-dur { flex: 1 1 100%; }
  .manual-row .btn-start { flex: 1 1 100%; }
}
.manual-row .mf input, .manual-row .mf input[type=date], .manual-row .mf input[type=time], .manual-row .mf input.manual-dur { flex: 0 0 auto; width: 100%; height: 44px; min-height: 44px; }
@media (max-width: 559px) { .mf-dur { flex: 1 1 calc(50% - 20px); } .mf-arrow { display: none; } .mf-time { flex: 1 1 calc(50% - 4px); } }
/* Les boutons ronds défilent avec la page : ils passent SOUS les éléments collés (barre du timer, filtres, sections). */
.top-actions { position: absolute; top: calc(var(--runbar-h, 0px) + env(safe-area-inset-top) + 10px); z-index: 12; }

/* Modales : le contenu défile à l'intérieur (iPhone compris), l'en-tête et les boutons restent visibles. */
dialog.modal { display: none; overflow: hidden; }
dialog.modal[open] { display: flex; flex-direction: column; }
.modal-form { flex: 1 1 auto; min-height: 0; max-height: none; overflow: hidden; }
.modal-head, .modal-foot { flex: none; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
@media (max-width: 559px) {
  dialog.modal:not(.modal-sm) { max-height: calc(92dvh - env(safe-area-inset-top)); }
}
html:has(dialog[open]) { overflow: hidden; }

/* ---------- v0.5.0 ---------- */
/* Clients et projets */
.client-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 10px; min-width: 0; }
.client-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.client-title h2 { font-size: 16px; font-weight: 700; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-meta { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-head .icon-btn { flex: none; }
.client-empty { margin: 0 4px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius); font-size: 14px; }
.group.is-archived .client-title h2 { color: var(--muted); }

/* Semaine (grille) */
.week-range { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.week-help { margin: -8px 0 12px; }
.week-help .ic { width: 13px; height: 13px; vertical-align: -2px; }
.week-card { padding: 0; overflow: hidden; }
.week-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.week-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; min-width: 760px; }
.week-grid th, .week-grid td { padding: 6px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.week-grid thead th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: capitalize; padding: 10px 6px; background: var(--surface); }
.week-grid .wg-row { text-align: left; position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 200px; max-width: 260px; padding-left: 14px;
  box-shadow: 1px 0 0 var(--line); }
.week-grid th.wg-row { display: table-cell; }
.week-grid tbody th.wg-row { font-weight: 500; }
.week-grid tbody th.wg-row .dot { margin-right: 8px; vertical-align: 2px; }
.wg-name { display: inline-flex; flex-direction: column; min-width: 0; max-width: calc(100% - 20px); vertical-align: middle; }
.wg-name > span, .wg-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-grid .is-today { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.week-grid thead th.is-today { color: var(--accent-ink); }
.week-grid .is-weekend { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.wg-cell { position: relative; display: flex; align-items: center; }
.week-grid input.wg-input { width: 100%; min-width: 64px; min-height: 38px; padding: 6px 22px 6px 6px; text-align: center; font-variant-numeric: tabular-nums;
  border-color: transparent; background: transparent; font-size: 14px; }
.week-grid input.wg-input:hover { border-color: var(--line); }
.week-grid input.wg-input:focus-visible { border-color: var(--accent); background: var(--surface); }
.week-grid input.wg-input:not(:placeholder-shown) { font-weight: 600; }
.wg-cell.is-locked input { color: var(--muted); cursor: not-allowed; }
.wg-more { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border: 0; border-radius: 4px; background: transparent;
  color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; opacity: .6; }
.wg-more .ic { width: 12px; height: 12px; }
.wg-cell:hover .wg-more, .wg-more:focus-visible { opacity: 1; background: var(--surface-2); }
.week-grid .wg-total { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 72px; }
.week-grid tfoot td, .week-grid tfoot th { border-bottom: 0; padding: 10px 6px; background: var(--surface-2); }
.week-grid tfoot th.wg-row { background: var(--surface-2); }
.week-grid .is-goal { color: var(--accent-ink); }
.week-grid .wg-add th { text-align: left; padding: 10px 14px; }
.wg-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: sticky; left: 14px; max-width: calc(100vw - 80px); }
.wg-add-row .combo, .wg-add-row select { flex: 0 1 280px; min-width: 0; }
.mode-link { text-decoration: none; }

/* Factures */
.inv-preview { margin-top: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.inv-preview-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.inv-lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.inv-lines th { text-align: left; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 6px; border-bottom: 2px solid var(--text); }
.inv-lines td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.inv-lines .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.inv-lines tfoot td { border-bottom: 0; padding-top: 6px; padding-bottom: 2px; text-align: right; }
.inv-lines tfoot td:first-child { color: var(--text-2); }
.inv-lines .inv-grand td { font-size: 16px; font-weight: 800; padding-top: 10px; border-top: 2px solid var(--text); }
.inv-lines-sm td { padding: 4px 4px; font-size: 13px; }
.inv-list { padding: 0; overflow: hidden; }
.inv-row { display: grid; grid-template-columns: 130px 130px minmax(0, 1fr) 70px 110px; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none; font-size: 14px; }
.inv-row:last-child { border-bottom: 0; }
.inv-row-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 10px; padding-bottom: 8px; }
a.inv-row:hover { background: var(--surface-2); }
.inv-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.inv-client { display: flex; flex-direction: column; min-width: 0; }
.inv-client, .inv-client small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 699px) {
  .inv-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .inv-row-head { display: none; }
  .inv-row > span:nth-child(2) { grid-row: 2; color: var(--muted); font-size: 13px; }
  .inv-row > .inv-client { grid-column: 1 / -1; grid-row: 3; }
  .inv-row > span.num.muted { display: none; }
}
.invoice-doc {
  background: #fff; color: #111; max-width: 820px; margin: 0 auto 16px; padding: 48px 52px; border-radius: 6px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 12%), 0 12px 32px rgb(0 0 0 / 10%); font-size: 14px; line-height: 1.45;
  --text: #111; --text-2: #333; --muted: #666; --line: #e3e3e3;
}
.invoice-doc p { margin: 0; }
.inv-top { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.inv-seller-name { display: block; font-size: 18px; margin-bottom: 6px; color: #187362; }
.inv-seller p { color: #333; }
.inv-meta { text-align: right; }
.inv-meta h2 { font-size: 28px; letter-spacing: .02em; text-transform: uppercase; margin: 0 0 10px; color: #111; }
.inv-meta dl { display: grid; grid-template-columns: auto auto; gap: 2px 12px; margin: 0; justify-content: end; }
.inv-meta dt { color: #666; }
.inv-meta dd { margin: 0; font-weight: 600; text-align: right; }
.inv-client-block { margin: 0 0 24px auto; width: min(320px, 100%); padding: 14px 16px; border: 1px solid #e3e3e3; border-radius: 6px; }
.inv-label { display: block; font-size: 11px; font-weight: 700; color: #666; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.inv-period { color: #333; margin-bottom: 12px !important; }
.invoice-doc .inv-lines th { color: #555; border-bottom-color: #111; }
.invoice-doc .inv-lines .inv-grand td { border-top-color: #111; }
.inv-note { margin-top: 14px !important; color: #333; font-size: 13px; }
.inv-foot { margin-top: 32px; padding-top: 14px; border-top: 1px solid #e3e3e3; color: #444; font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 699px) {
  .invoice-doc { padding: 22px 18px; font-size: 13px; }
  .inv-meta { text-align: left; }
  .inv-meta dl { justify-content: start; }
  .inv-client-block { margin-left: 0; }
  .invoice-doc .inv-lines th:nth-child(3), .invoice-doc .inv-lines td:nth-child(3) { display: none; }
  .invoice-doc .inv-lines tfoot td[colspan] { text-align: left; }
}
@media print {
  body.print-invoice .content > *:not(main), body.print-invoice main > .page > *:not(.invoice-doc) { display: none !important; }
  body.print-invoice .invoice-doc { box-shadow: none; padding: 0; max-width: none; margin: 0; border-radius: 0; font-size: 10.5pt; }
  body.print-invoice .invoice-doc .inv-lines th:nth-child(3), body.print-invoice .invoice-doc .inv-lines td:nth-child(3) { display: table-cell; }
  body.print-invoice .top-actions, body.print-invoice .reminder { display: none !important; }
}
.wg-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wg-head .dot { flex: none; margin: 0 !important; }
.wg-name { display: flex; max-width: none; flex: 1; }
.week-grid input.wg-input { padding-right: 24px; }
@media (max-width: 599px) {
  .week-grid { min-width: 620px; font-size: 13px; }
  .week-grid .wg-row { min-width: 128px; max-width: 150px; padding-left: 10px; }
  .wg-name small { display: none; }
  .week-grid th, .week-grid td { padding: 4px 3px; }
  .week-grid input.wg-input { min-width: 58px; min-height: 40px; font-size: 15px; padding: 4px 18px 4px 4px; }
  .wg-more { width: 16px; right: 1px; }
  .week-help { font-size: 12px; }
}
/* Suppression : message sur fond rouge (avec « Annuler ») */
.toast-delete { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .toast-delete { background: #b42318; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast-delete { background: #b42318; } }

/* Clients repliables (page Clients et projets) */
.client-toggle { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; border: 0; background: transparent;
  border-radius: 8px; color: var(--muted); cursor: pointer; margin-left: -6px; }
.client-toggle .chev { display: inline-flex; transition: transform .15s; }
.client-toggle .chev .ic { width: 16px; height: 16px; }
.group.is-open .client-toggle .chev { transform: rotate(90deg); }
@media (hover: hover) { .client-toggle:hover { background: var(--surface-2); color: var(--text); } }
.client-title { cursor: pointer; }
.client-dots { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; }
.client-dots .dot { width: 8px; height: 8px; }
.group.is-collapsed { margin-bottom: 8px; }
.group.is-collapsed .client-head { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 10px 14px; box-shadow: var(--shadow); }
@media (hover: hover) { .group.is-collapsed .client-head:hover { border-color: var(--accent); } }
.group.is-open { margin-bottom: 20px; }
.group.is-open .client-head { padding-left: 10px; }

/* v0.5.1 : mobile */
.only-touch { display: none; }
@media (hover: none) { .only-hover { display: none; } .only-touch { display: inline; } }
.tip-hint { display: block; margin-top: 6px; font-size: 11px; color: var(--accent-ink); font-weight: 600; }
@media (max-width: 599px) {
  /* Info-bulle du graphique : compacte (projets seulement) */
  .chart-tip { min-width: 0; width: min(300px, calc(100vw - 48px)); font-size: 12px; padding: 8px 10px; }
  .chart-tip .tip-task { display: none; }
  .chart-tip .tip-proj { margin-top: 4px; }
  /* Répartition : nom sur toute la largeur, chiffres et actions dessous */
  .bd-head { display: flex; }
  .bd-head > span:not(:first-child) { display: none; }
  .bd-row { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 2px; column-gap: 12px; padding: 8px 4px; }
  .bd-row > .bd-name { grid-column: 1 / -1; }
  .bd-row > .bd-time { justify-self: start; padding-left: 34px; }
  .bd-l1 > .bd-time { padding-left: 48px; }
  .bd-l2 > .bd-time { padding-left: 62px; }
  .bd-row > .bd-amount { justify-self: end; }
  .bd-row > .bd-act { justify-self: end; }
  .bd-name { white-space: normal; }
  .bd-label { overflow-wrap: anywhere; }
}

/* ---------- v0.5.2 : Clients et projets — hiérarchie lisible ---------- */
/* Le client est un bloc (carte) ; ses projets sont des lignes à l'intérieur, avec un liseré de leur couleur. */
.page-projets .group {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 14px; overflow: hidden;
}
.page-projets .group.is-collapsed { margin-bottom: 10px; }
.page-projets .group .client-head,
.page-projets .group.is-collapsed .client-head,
.page-projets .group.is-open .client-head {
  background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 12px 10px 12px 12px; gap: 10px;
}
.page-projets .group.is-open .client-head { background: var(--surface-2); border-bottom: 1px solid var(--line); }
@media (hover: hover) { .page-projets .group.is-collapsed:hover { border-color: var(--accent); } .page-projets .group.is-collapsed .client-head:hover { border-color: transparent; } }
.client-avatar {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--cc) 16%, var(--surface)); color: var(--cc); font-weight: 800; font-size: 14px; letter-spacing: .02em;
  border: 1px solid color-mix(in srgb, var(--cc) 30%, transparent);
}
.client-kind { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; line-height: 1; }
.client-title h2 { font-size: 17px; line-height: 1.25; }
.page-projets .client-toggle { margin-left: 0; order: 0; }
.client-body { padding: 4px 0; }
.client-empty { margin: 10px 12px; }

/* Projets : lignes dans le bloc du client */
.page-projets .group .project {
  background: transparent; border: 0; border-radius: 0; box-shadow: none; margin: 0;
  border-bottom: 1px solid var(--line); position: relative;
}
.page-projets .group .project:last-child { border-bottom: 0; }
.page-projets .group .project::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--pc); }
.page-projets .group .project-head { padding: 10px 8px 10px 22px; }
.page-projets .group .project-title h3 { font-size: 15px; font-weight: 600; }
.page-projets .group .project .dot-lg { display: none; }
.page-projets .group .project.is-open { background: color-mix(in srgb, var(--pc) 5%, var(--surface)); }
.page-projets .group .tasks { border-top: 1px dashed var(--line); margin-left: 22px; }
.page-projets .group .task { padding-left: 34px; border-bottom-color: transparent; min-height: 40px; }
.page-projets .group .task + .task { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.page-projets .group .project.is-picked { box-shadow: inset 0 0 0 2px var(--accent); }
@media (hover: hover) { .page-projets .group .project:hover { background: color-mix(in srgb, var(--pc) 6%, var(--surface)); } }
@media (max-width: 559px) {
  .client-avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
  .page-projets .group .project-head { padding-left: 18px; }
  .page-projets .group .tasks { margin-left: 12px; }
}
@media (max-width: 559px) {
  .page-projets .page-actions { gap: 6px; }
  .page-projets .page-actions .btn { min-height: 34px; padding: 6px 10px; font-size: 13px; }
  .page-projets .page-actions .btn .ic { width: 15px; height: 15px; }
}
.lbl-short { display: none; }
@media (max-width: 559px) {
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .page-projets .page-head { flex-direction: column; align-items: stretch; }
  .page-projets .page-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; }
  .page-projets .page-actions > * { grid-column: span 2; justify-content: center; }
  .page-projets .page-actions > .btn:nth-last-child(-n+2) { grid-column: span 3; }
  .page-projets .page-actions > .switch { grid-column: 1 / -1; }
}
@media (max-width: 400px) {
  .page-projets .client-head { gap: 6px; padding: 10px 6px 10px 8px; }
  .page-projets .client-toggle { width: 24px; }
  .client-avatar { width: 30px; height: 30px; font-size: 11px; border-radius: 9px; }
  .page-projets .client-head .icon-btn { width: 34px; height: 34px; }
  .page-projets .client-head [data-action=client-project] { display: none; }
}
@media (max-width: 559px) {
  .page-projets .page-head { padding-right: 0; }
  .page-projets .page-head h1 { padding-right: 96px; }
  .page-projets .page-actions .btn { min-width: 0; padding-left: 6px; padding-right: 6px; overflow: hidden; }
  .page-projets .page-actions > .btn:not(:nth-last-child(-n+2)) .ic { display: none; }
}

/* Répartition : une tâche et ses entrées forment un bloc (teinte et liseré de la couleur du projet) */
.bd-row.bd-task { position: relative; }
.bd-tree { color: var(--muted); font-size: 13px; margin-left: -2px; flex: none; }
.bd-kind { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); flex: none;
  padding: 1px 6px; border-radius: 99px; background: var(--surface-2); }
.bd-row.bd-task:has(+ .bd-entries:not([hidden])) {
  background: color-mix(in srgb, var(--pc) 12%, var(--surface)); border-bottom-color: transparent; border-radius: 10px 10px 0 0;
  box-shadow: inset 4px 0 0 var(--pc);
}
.bd-row.bd-task:has(+ .bd-entries:not([hidden])) .bd-label { color: var(--text); font-weight: 600; }
.bd-row.bd-task:has(+ .bd-entries:not([hidden])) .bd-kind { background: color-mix(in srgb, var(--pc) 22%, var(--surface)); color: var(--text-2); }
.bd-entries:not([hidden]) {
  background: color-mix(in srgb, var(--pc) 6%, var(--surface)); box-shadow: inset 4px 0 0 var(--pc);
  border-radius: 0 0 10px 10px; padding: 2px 0 6px 0; margin: 0 0 8px 0; border-bottom: 0;
}
.bd-entries-l2:not([hidden]), .bd-row.bd-l2.bd-task:has(+ .bd-entries:not([hidden])) { margin-left: 46px; }
.bd-entries-l1:not([hidden]), .bd-row.bd-l1.bd-task:has(+ .bd-entries:not([hidden])) { margin-left: 22px; }
.bd-row.bd-l2.bd-task:has(+ .bd-entries:not([hidden])) .bd-name { padding-left: 10px; }
.bd-row.bd-l1.bd-task:has(+ .bd-entries:not([hidden])) .bd-name { padding-left: 6px; }
/* Dans le bloc de la tâche, projet / tâche / client sont déjà connus : on ne les répète pas. */
.bd-entries .entry .ctx { display: none; }
.bd-entries .entry { border-bottom: 1px solid color-mix(in srgb, var(--pc) 14%, var(--line)); background: transparent; }
.bd-entries .entry:last-child { border-bottom: 0; }
.bd-entries .entry-main { padding-left: 18px; }
.bd-entries .entry-desc { font-size: 14px; }
@media (max-width: 599px) {
  .bd-entries-l2:not([hidden]), .bd-row.bd-l2.bd-task:has(+ .bd-entries:not([hidden])) { margin-left: 10px; }
  .bd-entries-l1:not([hidden]), .bd-row.bd-l1.bd-task:has(+ .bd-entries:not([hidden])) { margin-left: 4px; }
  .bd-kind { display: none; }
}
@media print { .bd-entries .entry .ctx { display: none; } }
/* Lignes de la répartition cliquables (déplier / replier) */
.bd-row[data-row]:has([data-expand]) { cursor: pointer; }
@media (hover: hover) { .bd-table .bd-row[data-row]:has([data-expand]):hover { background: color-mix(in srgb, var(--text) 4%, transparent); } }
.bd-row[data-row]:has([data-expand]):active { background: color-mix(in srgb, var(--text) 7%, transparent); }

/* ---------- v0.5.3 : Clients et projets ---------- */
.title-row { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; min-width: 0; }
.btn-budgets {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 12px; border-radius: 99px; text-decoration: none;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); transition: background .12s, border-color .12s;
}
.btn-budgets .ic { width: 18px; height: 18px; }
@media (hover: hover) { .btn-budgets:hover { background: color-mix(in srgb, var(--accent) 24%, var(--surface)); border-color: var(--accent); } }
.btn-budgets:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bb-badge { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.bb-badge.is-over { background: var(--danger); color: #fff; }
.bb-badge.is-warn { background: var(--warn-soft); color: var(--warn-text); border: 1px solid color-mix(in srgb, var(--warn-text) 35%, transparent); }
/* En-tête d'un client déplié : teinte seule, sans ligne de séparation marquée */
.page-projets .group.is-open .client-head { border-bottom: 0; background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.page-projets .group.is-open .client-body { padding-top: 6px; }
/* Projet déplié : plus d'air au-dessus des tâches et autour de « Ajouter une tâche » */
.page-projets .group .project.is-open .project-head { padding-bottom: 14px; }
.page-projets .group .tasks { padding: 6px 0 4px; }
.page-projets .group .task-add { padding-top: 12px; padding-bottom: 14px; border-top: 0 !important; }
.page-projets .group .project.is-open { margin: 4px 0; }
@media (max-width: 559px) {
  .page-projets .page-actions > *, .page-projets .page-actions > .btn:nth-last-child(-n+2) { grid-column: span 3; }
  .title-row { gap: 8px; }
  .btn-budgets { padding: 6px 12px 6px 10px; font-size: 13px; }
}
/* Timer : « Reprendre » replié par défaut */
.recents { flex-direction: column; align-items: flex-start; gap: 8px; }
.recents-toggle {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 13px; font-weight: 600; padding: 5px 10px 5px 9px; border-radius: 99px; cursor: pointer;
}
.recents-toggle > .ic { width: 12px; height: 12px; color: var(--accent-ink); }
.recents-toggle .chev { display: inline-flex; transition: transform .15s; color: var(--muted); }
.recents-toggle .chev .ic { width: 14px; height: 14px; }
.recents.is-open .recents-toggle .chev { transform: rotate(180deg); }
.recents.is-open .recents-toggle { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
@media (hover: hover) { .recents-toggle:hover { border-color: var(--accent); color: var(--text); } }
.recents-count { font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--surface-2); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; }
.recents-list { display: flex; gap: 6px; flex-wrap: wrap; }
.recents-list[hidden] { display: none; }
/* Semaine : navigation à position fixe (les flèches ne bougent pas d'une semaine à l'autre) */
.week-nav { flex-wrap: nowrap; gap: 4px; }
.week-nav .week-range { display: inline-block; width: 15em; text-align: center; white-space: nowrap; }
.week-nav .week-today { margin-left: 8px; }
.week-nav .week-today:disabled { display: none; }   /* semaine en cours : navigation poussée à droite */
@media (max-width: 559px) { .week-nav .week-range { width: 13.5em; font-size: 13px; } .week-nav .week-today { margin-left: 2px; } }
@media (max-width: 559px) {
  .week-nav { flex-wrap: wrap; width: 100%; }
  .week-nav .week-range { flex: 1 1 0; width: auto; min-width: 0; }
  .week-nav .week-today { flex-basis: 100%; margin: 4px 0 0; }
}
@media (max-width: 559px) {
  .page-semaine .page-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .page-semaine .week-nav { padding-right: 0; }
}
@media (max-width: 899px) {
  .page-semaine .page-head { padding-right: 0; }
  .page-semaine .page-head > div:first-child { padding-right: 96px; }
}

/* ---------- Réglages › Extension navigateur (v0.6.0) ---------- */
.ext-steps { margin: 8px 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); }
.ext-steps code, .ext-url code, .token-list code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.btn-row-inline { display: flex; margin-top: 6px; }
.ext-url { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ext-url code { word-break: break-all; }
.token-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.token-form .field { flex: 1 1 220px; margin: 0; }
.token-new { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; }
.token-new p { margin: 0 0 8px; }
.token-value { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.token-value code { font-family: var(--mono); font-size: 13px; background: var(--surface); padding: 6px 8px; border-radius: 6px; word-break: break-all; flex: 1 1 240px; user-select: all; }
.token-list { list-style: none; margin: 12px 0 0; padding: 0; }
.token-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.token-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.token-main .small { flex-basis: 100%; }

/* ---------- Réglages : navigation rapide entre les sections (v0.6.1) ---------- */
.settings-nav {
  position: sticky; top: 0; z-index: 14; margin: -4px -16px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.settings-nav-track { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 16px; scroll-padding: 0 40px; }
.settings-nav-track::-webkit-scrollbar { display: none; }
/* Dégradé (couleur du fond, donc clair ou sombre selon le thème) là où d'autres boutons sont cachés. */
.settings-nav::before, .settings-nav::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 44px; pointer-events: none; z-index: 1; opacity: 0; transition: opacity .2s;
}
.settings-nav::before { left: 0; background: linear-gradient(to right, var(--bg) 20%, transparent); }
.settings-nav::after { right: 0; background: linear-gradient(to left, var(--bg) 20%, transparent); }
.settings-nav.can-left::before, .settings-nav.can-right::after { opacity: 1; }
.settings-chip {
  flex: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s;
}
.settings-chip:hover { background: var(--surface-2); color: var(--text); }
.settings-chip.is-active { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
@media (min-width: 900px) {
  .settings-nav { margin: -4px -32px 20px; }
  .settings-nav-track { padding: 10px 32px; flex-wrap: wrap; overflow: visible; }
}

/* Logo selon le thème (v0.6.1) : dessin blanc en clair, foncé en sombre (comme le texte des boutons). */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: inline-block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline-block; }

/* Réglages › Remise à zéro (v0.6.1) */
.settings-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.settings-danger .section-title { color: var(--danger); }

/* Réglages › Apparence et langue (v0.7.0) : titres des choix Thème / Langue */
.field-label { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-label-gap { margin-top: 16px; }
/* Petits écrans (iPhone SE) : les choix segmentés se resserrent au lieu de déborder. */
.segmented { max-width: 100%; }
@media (max-width: 374px) { .segmented span { padding: 6px 10px; } }

/* ---------- v0.7.1 : recherche (Rapports, Clients et projets), boutons d'export sur une ligne ---------- */
.kinds-row { display: flex; align-items: center; gap: 8px; margin: -2px 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.kinds-row .period-kinds { margin: 0; padding: 0; border: 0; flex: 1 1 auto; min-width: 0; }
.search-field {
  display: flex; align-items: center; gap: 6px; flex: 0 1 240px; min-width: 170px; height: 36px; padding: 0 4px 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: text;
  transition: border-color .15s, box-shadow .15s;
}
.search-field > .ic { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search-field input[type=search] {
  flex: 1; min-width: 0; height: 100%; min-height: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important; font-size: 14px; width: auto;
}
.search-field input[type=search]::-webkit-search-cancel-button { display: none; }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
/* Recherche active : bien visible (bordure et fond teintés). */
.search-field:has(.search-clear) { border-color: var(--accent); background: var(--accent-soft); }
.search-field:has(.search-clear) > .ic { color: var(--accent-ink); }
.search-clear {
  flex: none; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.search-clear:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.search-clear .ic { width: 15px; height: 15px; }
.search-toggle { display: none; flex: none; }
.search-toggle.is-on { background: var(--accent-soft); color: var(--accent-ink); }

/* « Tout effacer » : retour rapide à l'affichage sans filtre, bien mis en évidence. */
.chip.chip-reset {
  background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); padding: 3px 10px 3px 8px;
}
.chip.chip-reset:hover { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); }
.btn-reset { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.btn-reset:hover { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); }

@media (max-width: 559px) {
  .kinds-row { flex-wrap: wrap; gap: 6px; }
  /* Jour … Année : une seule ligne qui défile, la loupe reste à droite. */
  .kinds-row .period-kinds { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex: 1 1 0; }
  .kinds-row .period-kinds::-webkit-scrollbar { display: none; }
  .search-toggle { display: inline-flex; }
  .kinds-row .search-field { display: none; }
  .kinds-row.is-searching .search-field { display: flex; flex: 1 1 100%; min-width: 0; height: 40px; }
  .kinds-row.is-searching .search-field input[type=search] { font-size: 16px; } /* iPhone : pas de zoom à la saisie */
  /* Rapports : Factures, CSV et PDF sur une seule ligne, défilement horizontal si besoin. */
  .page-rapports .page-head { padding-right: 0; }
  .page-rapports .page-head h1 { padding-right: 96px; }
  .page-rapports .page-actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; gap: 6px; }
  .page-rapports .page-actions::-webkit-scrollbar { display: none; }
  .page-rapports .page-actions .btn { flex: none; min-height: 36px; padding: 6px 12px; font-size: 13px; }
  .page-rapports .page-actions .btn .ic { width: 15px; height: 15px; }
  /* Fondu au bout de la ligne Jour … Année : signale qu'elle défile. */
  .kinds-row .period-kinds { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); padding-right: 18px; }
}
/* Clients et projets : recherche à droite du bouton Budgets */
.title-search { display: flex; align-items: center; margin-left: 4px; }
.title-search .search-field { flex: 0 1 200px; width: 200px; min-width: 150px; }
.search-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); font-size: 14px;
}
.page-projets mark, .search-summary mark { background: color-mix(in srgb, var(--accent) 30%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
@media (max-width: 559px) {
  .title-row { flex-wrap: wrap; }
  .title-search { margin-left: 0; }
  .title-search .search-field { display: none; }
  .title-search.is-searching { flex: 1 1 100%; gap: 6px; }
  .title-search.is-searching .search-toggle { display: none; }
  .title-search.is-searching .search-field { display: flex; flex: 1 1 auto; min-width: 0; height: 40px; }
  .title-search.is-searching .search-field input[type=search] { font-size: 16px; }
}

/* ---------- v0.7.2 : bandeau des filtres des Rapports collant ---------- */
.filters.no-print { position: sticky; top: var(--stick-top, 0px); z-index: 13; transition: box-shadow .15s; }
.filters.is-stuck {
  /* Collé : se distingue nettement du contenu qui défile dessous (teinte, bordure et liseré accent, ombre marquée). */
  background: color-mix(in srgb, color-mix(in srgb, var(--accent) 7%, var(--surface)) 92%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  border-bottom: 2px solid var(--accent);
  border-top-left-radius: 0; border-top-right-radius: 0;
  box-shadow: 0 12px 28px -10px rgb(16 24 40 / 35%);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .filters.is-stuck { background: color-mix(in srgb, color-mix(in srgb, var(--accent) 10%, var(--surface)) 92%, transparent); box-shadow: 0 14px 32px -6px rgb(0 0 0 / 70%); } }
:root[data-theme="dark"] .filters.is-stuck { background: color-mix(in srgb, color-mix(in srgb, var(--accent) 10%, var(--surface)) 92%, transparent); box-shadow: 0 14px 32px -6px rgb(0 0 0 / 70%); }
.pp { overflow-y: auto; overscroll-behavior: contain; }
/* Panneau des filtres ouvert et collé : il défile à l'intérieur s'il dépasse l'écran. */
.filters.is-stuck.is-panel-open { max-height: calc(100dvh - var(--stick-top, 0px) - 16px); overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 899px) {
  .filters.is-stuck.is-panel-open { max-height: calc(100dvh - var(--stick-top, 0px) - var(--tabbar-h) - env(safe-area-inset-bottom) - 12px); }
}
@media print { .filters.no-print { position: static; } }

/* ---------- v0.7.3 : page Timer — barre du timer en cours flottante quand le bloc du timer sort de l'écran ---------- */
.running-bar.is-floating {
  position: fixed; top: 0; margin: 0; z-index: 16; box-shadow: 0 8px 20px -10px rgb(16 24 40 / 30%);
  animation: bar-in .18s ease-out;
}
@media (min-width: 900px) { .running-bar.is-floating { margin: 0; } }
@keyframes bar-in { from { transform: translateY(-100%); opacity: 0; } }
@media print { .running-bar.is-floating { display: none !important; } }

/* Texte trouvé par une recherche : surligneur jaune bien visible (Clients et projets, listes avec recherche). */
.page-projets mark, .search-summary mark, .combo-option mark, .combo-group mark {
  background: #ffd84d; color: #1d2330; border-radius: 3px; padding: 0 2px; font-weight: 700;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-projets mark, :root:not([data-theme="light"]) .search-summary mark,
  :root:not([data-theme="light"]) .combo-option mark, :root:not([data-theme="light"]) .combo-group mark { background: #f5c518; color: #111318; }
}
:root[data-theme="dark"] .page-projets mark, :root[data-theme="dark"] .search-summary mark,
:root[data-theme="dark"] .combo-option mark, :root[data-theme="dark"] .combo-group mark { background: #f5c518; color: #111318; }

/* Mac (v0.7.3) : la barre du timer en cours a la largeur du contenu (alignée sur les cartes), coins arrondis en bas. */
@media (min-width: 900px) {
  .running-bar { max-width: 1040px; margin: 0 auto; }
  .running-bar.is-floating { margin: 0; max-width: none; }
  .running-bar, .running-bar.is-floating {
    padding: 10px 16px; border: 1px solid var(--line); border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
  }
}

/* Éléments collés (v0.7.3) : semi-transparence avec flou partout (barre du timer, filtres des Rapports, sections des
   Réglages, rappel « timer oublié ? »). */
.running-bar { -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); }
.reminder-inner {
  background: color-mix(in srgb, var(--warn-soft) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
}
/* Barre du timer en cours (collée ou flottante) : même fond que le bandeau des filtres collé des Rapports. */
.running-bar, .running-bar.is-floating { background: color-mix(in srgb, color-mix(in srgb, var(--accent) 7%, var(--surface)) 92%, transparent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .running-bar, :root:not([data-theme="light"]) .running-bar.is-floating { background: color-mix(in srgb, color-mix(in srgb, var(--accent) 10%, var(--surface)) 92%, transparent); }
}
:root[data-theme="dark"] .running-bar, :root[data-theme="dark"] .running-bar.is-floating { background: color-mix(in srgb, color-mix(in srgb, var(--accent) 10%, var(--surface)) 92%, transparent); }
/* iPhone / tablette : barre flottante sur toute la largeur, par le CSS (suit les rotations sans calcul). */
@media (max-width: 899px) { .running-bar.is-floating { left: 0 !important; right: 0; width: auto !important; } }
/* Rapports : bandeau des filtres collé sous la barre du timer → la barre perd ses coins arrondis (un seul bloc). */
body.filters-stuck .running-bar { border-radius: 0; border-bottom-color: transparent; box-shadow: none; }
/* Choix à boutons radio sur une ligne (ex. « Dupliquer des entrées » : mêmes dates / un jour), v0.7.4 */
.switch-radio { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; cursor: pointer; font-size: 14px; }
.switch-radio input[type=date] { width: auto; flex: 0 1 180px; }
/* Liseré vert (comme le bandeau des filtres collé) autour de la barre du timer, sauf en haut ; aucun liseré en haut
   pour les deux. Empilés (Rapports), ils forment un seul bloc encadré. */
.running-bar, .running-bar.is-floating {
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-top: 0; border-bottom: 2px solid var(--accent);
}
.filters.is-stuck { border-top: 0; }
body.filters-stuck .running-bar { border-bottom: 0; }
@media (max-width: 899px) { .running-bar, .running-bar.is-floating { border-left: 0; border-right: 0; } }
/* Entrées : corbeille à côté de « Relancer » (v0.7.4) */
.entry-actions { width: auto; gap: 2px; }
.entry-del { color: var(--muted); }
@media (hover: hover) { .entry-del:hover { color: var(--danger); background: var(--danger-soft); } }

/* ---------- Menu « ⋮ » d'une ligne (v0.7.4) ---------- */
.row-more { color: var(--muted); }
@media (hover: hover) { .row-more:hover { color: var(--text); background: var(--surface-2); } }
.row-more[aria-expanded="true"] { color: var(--accent-ink); background: var(--accent-soft); }
.row-menu {
  position: fixed; z-index: 220; min-width: 190px; padding: 4px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 12px 32px -8px rgb(16 24 40 / 30%);
  display: flex; flex-direction: column; animation: menu-in .12s ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
.row-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 8px 10px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.row-menu-item .ic { width: 16px; height: 16px; color: var(--muted); }
.row-menu-item:hover:not(:disabled), .row-menu-item:focus-visible { background: var(--surface-2); outline: none; }
.row-menu-item.is-danger { color: var(--danger); }
.row-menu-item.is-danger .ic { color: var(--danger); }
.row-menu-item.is-danger:hover:not(:disabled) { background: var(--danger-soft); }
.row-menu-item:disabled { opacity: .45; cursor: not-allowed; }
@media print { .row-more { display: none !important; } }

/* v0.7.4 : Rapports › Détaillé — chaque jour est une carte (comme les clients), ses entrées à l'intérieur */
.details .day-group {
  margin: 0 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.details .day-group + .day-group { margin-top: 0; }
.details .day-group > .day-head { margin: 0; padding: 10px 12px 10px 4px; gap: 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.details .day-group > .entries { margin: 0; border-top: 0; }
.details .day-title { font-size: 15px; }
.day-badge {
  width: 38px; height: 38px; border-radius: 11px; flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); line-height: 1;
}
.day-badge b { font-size: 15px; font-weight: 800; }
.day-badge small { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
@media (hover: hover) { .details .day-group:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); } }
@media print { .day-badge { display: none; } .details .day-group { box-shadow: none; break-inside: avoid-page; } }
@media (max-width: 640px) {
  .details .day-group > .day-head { flex-wrap: nowrap; }
  .details .day-title { white-space: normal; line-height: 1.25; font-size: 14px; flex: 1 1 auto; }
  .details .day-group > .day-head .day-total { display: flex; flex-direction: column; align-items: flex-end; margin-left: 0; text-align: right; }
}
/* v0.7.4 : historique du Timer — titre + période + Sélectionner + Filtres tiennent sur les petits écrans */
@media (max-width: 640px) {
  .history-toolbar { min-width: 0; }
  .history-toolbar .history-title { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .history-toolbar select.history-range, .history-toolbar .combo { min-width: 0; flex: 1 1 auto; width: auto; max-width: 170px; margin-left: auto; }
  .history-toolbar .btn { flex: none; }
}
@media (max-width: 420px) {
  .history-toolbar .history-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .history-toolbar select.history-range, .history-toolbar .combo { max-width: none; margin-left: 0; }
}
/* Rapports › Détaillé : hiérarchie jour › entrées bien lisible (entrées en retrait, trait d'arborescence) */
.details .day-group > .day-head { background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.details .day-group > .entries { position: relative; padding-left: 26px; }
.details .day-group > .entries::before {
  content: ""; position: absolute; left: 21px; top: 0; bottom: 14px; width: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.details .day-group > .entries > div > .entry { position: relative; }
.details .day-group > .entries > div > .entry::before {
  content: ""; position: absolute; left: -5px; top: 50%; width: 9px; height: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 45%, var(--line));
}
@media (max-width: 640px) {
  .details .day-group > .entries { padding-left: 18px; }
  .details .day-group > .entries::before { left: 13px; }
}
@media print { .details .day-group > .entries { padding-left: 0; } .details .day-group > .entries::before, .details .day-group > .entries > div > .entry::before { display: none; } }
/* Rapports › Détaillé : jours repliables (un par un ou tous) */
.details .day-group > .day-head { cursor: pointer; }
.day-toggle { width: 30px; height: 30px; flex: none; margin-left: 2px; }
.day-toggle .chev { display: inline-flex; transition: transform .15s; }
.day-toggle .chev .ic { width: 16px; height: 16px; }
.day-group:not(.is-collapsed) .day-toggle .chev { transform: rotate(90deg); }
.details .day-group.is-collapsed > .entries { display: none; }
.details .day-group.is-collapsed > .day-head { border-bottom: 0; }
.days-all .ic { transition: transform .15s; }
.days-all[aria-expanded="false"] .ic { transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) { .day-toggle .chev, .days-all .ic { transition: none; } }
@media print { .details .day-group.is-collapsed > .entries { display: block; } }
@media (max-width: 640px) {
  .details .day-group > .day-head .day-week, .details .day-group > .day-head .day-sep { display: none; }
  .details .day-group > .day-head .day-toggle { margin-left: -4px; }
}
/* Rapports › Détaillé : nombre d'entrées du jour */
.day-count {
  flex: none; font-size: 11px; font-weight: 700; color: var(--text-2); background: color-mix(in srgb, var(--text) 8%, transparent);
  border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.day-count-short { display: none; }
@media (max-width: 640px) {
  .day-count { min-width: 22px; height: 22px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }
  .day-count-long { display: none; }
  .day-count-short { display: inline; }
}

/* v0.7.4 : historique du Timer — semaines et jours repliables, jours en cartes, entrées en retrait */
.fold-toggle { width: 30px; height: 30px; flex: none; }
.fold-toggle .chev { display: inline-flex; transition: transform .15s; }
.fold-toggle .chev .ic { width: 16px; height: 16px; }
.week:not(.is-collapsed) > .week-head .fold-toggle .chev, .day:not(.is-collapsed) > .day-head .fold-toggle .chev { transform: rotate(90deg); }
.hist-fold-all .ic { transition: transform .15s; }
.hist-fold-all[aria-expanded="false"] .ic { transform: rotate(-90deg); }
@media (prefers-reduced-motion: reduce) { .fold-toggle .chev, .hist-fold-all .ic { transition: none; } }

.history .week-head { align-items: center; gap: 8px; padding: 0 4px 8px 0; cursor: pointer; }
.history .week-head .fold-toggle { margin-left: -4px; }
.history .week-head h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .week-head .week-total { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.history .week.is-collapsed { margin-bottom: 4px; }
.history .week.is-collapsed > .week-days { display: none; }

.history .day { border-radius: var(--radius); }
.history .day > .day-head {
  justify-content: flex-start; gap: 10px; padding: 10px 6px 10px 12px; cursor: pointer;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-2));
}
.history .day > .day-head h3 { font-size: 15px; color: var(--text); text-transform: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .day > .day-head h3::first-letter { text-transform: uppercase; }
.history .day > .day-head .day-total { margin-left: auto; font-size: 13px; white-space: nowrap; }
.history .day.is-collapsed > .entries { display: none; }
.history .day.is-collapsed > .day-head { border-bottom: 0; }
.history .day > .entries { position: relative; padding-left: 30px; }
.history .day > .entries::before {
  content: ""; position: absolute; left: 18px; top: 0; bottom: 14px; width: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 45%, var(--line));
}
.history .day > .entries > div > .entry { position: relative; }
@media (hover: hover) { .history .day:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); } }
@media (max-width: 640px) {
  .history .day > .entries { padding-left: 20px; }
  .history .day > .entries::before { left: 10px; }
  .history .day > .day-head h3 { white-space: normal; line-height: 1.25; font-size: 14px; }
  .history .day > .day-head .day-total, .history .week-head .week-total { display: flex; flex-direction: column; align-items: flex-end; }
  .history .day-sep { display: none; }
}

/* v0.7.5 : remise à zéro granulaire */
.reset-scopes { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px 8px; margin: 0 0 12px; display: grid; gap: 2px; }
.reset-scopes legend { font-weight: 700; font-size: 13px; padding: 0 6px; color: var(--text-2); }
.reset-scopes label { display: flex; align-items: flex-start; gap: 10px; padding: 7px 4px; border-radius: 8px; cursor: pointer; }
.reset-scopes label > input { margin-top: 2px; flex: none; }
.reset-scopes label > span { display: grid; gap: 1px; min-width: 0; }
.reset-scopes small { font-size: 12px; line-height: 1.35; }
.reset-scopes .reset-all { border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 2px; }
.reset-scopes label:has(input:disabled) { cursor: default; opacity: .7; }
@media (hover: hover) { .reset-scopes label:not(:has(input:disabled)):hover { background: var(--surface-2); } }
.field > .field-hint { display: block; font-size: 12px; margin-top: 4px; line-height: 1.35; overflow-wrap: anywhere; }
/* Rapports › Détaillé : « Aujourd'hui » / « Hier » seuls sur mobile, date complète sur ordinateur */
.day-title .dt-short { display: none; }
@media (max-width: 640px) { .day-title .dt-full { display: none; } .day-title .dt-short { display: inline; } }

/* v0.7.5 : Rapports › Résumé — arborescence lisible (chaque client / projet de 1er niveau est une carte, enfants en retrait) */
.bd-head, .bd-row { grid-template-columns: minmax(0, 1fr) 72px 64px 104px 168px; }
.bd-table > .bd-head { border-bottom: 0; padding-bottom: 8px; }
.bd-group {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 10px; overflow: hidden;
}
@media (hover: hover) { .bd-group:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); } }
.bd-group > .bd-row.bd-l0 { background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); padding: 10px 8px; border-bottom: 0; }
.bd-group:has(> .bd-children:not([hidden])) > .bd-row.bd-l0 { border-bottom: 1px solid var(--line); }
.bd-group .bd-children { position: relative; }
/* Traits d'arborescence : sous le compteur du parent */
.bd-group .bd-children::before {
  content: ""; position: absolute; top: 0; bottom: 18px; width: 2px; border-radius: 2px; left: 21px;
  background: color-mix(in srgb, var(--accent) 45%, var(--line)); pointer-events: none;
}
.bd-group .bd-children .bd-children:not(.bd-entries)::before { left: 49px; }
.bd-group .bd-entries::before { display: none; }
.bd-group .bd-row { padding-left: 8px; padding-right: 8px; }
.bd-group .bd-children > .bd-row:last-child, .bd-group .bd-children:last-child > .bd-row:last-child { border-bottom: 0; }
.bd-group .bd-children .bd-children { border-top: 1px solid var(--line); }
.bd-group .bd-children > .bd-row + .bd-children { border-top: 0; }
@media (max-width: 599px) {
  /* Mobile : on garde la disposition « nom sur toute la largeur, chiffres dessous » */
  .bd-row { grid-template-columns: minmax(0, 1fr) auto auto; }
}
@media (max-width: 640px) {
  .bd-group .bd-children::before { left: 17px; }
  .bd-group .bd-children .bd-children:not(.bd-entries)::before { left: 31px; }
}
@media print { .bd-group { box-shadow: none; break-inside: avoid-page; } .bd-group .bd-children::before { display: none; } }

/* v0.7.5 : sélecteur Résumé / Détaillé plus visible (surtout en sombre) */
.view-tabs { border: 1px solid var(--line); background: color-mix(in srgb, var(--text) 4%, var(--surface-2)); padding: 4px; gap: 4px; }
.view-tabs button { color: var(--text-2); border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s; }
@media (hover: hover) { .view-tabs button[aria-selected="false"]:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); } }
.view-tabs button[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 1px 2px rgb(0 0 0 / .12);
}
.view-tabs .count { background: color-mix(in srgb, var(--text) 9%, transparent); border-radius: 99px; padding: 1px 7px; color: var(--text-2); }
.view-tabs button[aria-selected="true"] .count { background: var(--accent); color: #06231c; }
.view-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .view-tabs button[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 26%, var(--surface)); color: #e6fff8; }
  :root:not([data-theme="light"]) .view-tabs button[aria-selected="true"] .count { color: #06231c; }
}
:root[data-theme="dark"] .view-tabs button[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 26%, var(--surface)); color: #e6fff8; }
:root[data-theme="dark"] .view-tabs button[aria-selected="true"] .count { color: #06231c; }
@media (prefers-reduced-motion: reduce) { .view-tabs button { transition: none; } }

/* v0.7.5 : tâche — bouton « Rapport » ; sur petit écran, le nom passe sur sa propre ligne */
.task .task-report { flex: none; }
/* Mobile : « Rapport » et « Modifier » de la tâche passent dans son menu ⋮ (crayon conservé en mode Sélection) ;
   le nom de la tâche peut aller à la ligne au lieu d'être coupé. */
@media (max-width: 640px) {
  .page-projets .task:has([data-action="task-menu"]) > .task-report,
  .page-projets .task:has([data-action="task-menu"]) > [data-action="edit-task"] { display: none; }
  .page-projets .task:not(:has([data-action="task-menu"])) > .task-report { display: none; }
  .page-projets .task:not(.task-add) { gap: 8px; }
  .page-projets .task:not(.task-add) > .task-name { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; padding: 4px 0; }
  .page-projets .task:not(.task-add) > .rate { flex: none; }
}

/* v0.7.5 : fenêtre d'entrée — la date (jj/mm/aaaa) s'affiche en entier à côté de l'heure */
.dt-pair { grid-template-columns: minmax(0, 1fr) 132px; gap: 0 6px; }
.dt-pair input[type="date"], .dt-pair input[type="time"] { padding-left: 8px; padding-right: 6px; font-variant-numeric: tabular-nums; min-width: 0; }

/* v0.7.5 : Clients et projets sur mobile — le nom du client / projet n'est plus tronqué.
   « Nouveau projet » et « Modifier » passent dans le menu ⋮ ; le nom peut tenir sur deux lignes. */
@media (max-width: 640px) {
  .page-projets .client-head [data-action="client-project"],
  .page-projets .client-head [data-action="edit-client"],
  .page-projets .project-head [data-action="edit-project"],
  .page-projets .project-head .project-budget { display: none; }
  .page-projets .client-head:has([data-action="client-menu"]) { gap: 8px; }
  .page-projets .client-title h2, .page-projets .project-title h3 {
    white-space: normal; overflow-wrap: anywhere; line-height: 1.25;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  }
  .page-projets .client-meta { white-space: normal; }
}
/* En mode Sélection, le menu ⋮ est masqué : on garde alors le crayon. */
@media (max-width: 640px) {
  .page-projets .client-head:not(:has([data-action="client-menu"])) [data-action="edit-client"],
  .page-projets .project-head:not(:has([data-action="project-menu"])) [data-action="edit-project"] { display: inline-flex; }
}

/* v0.7.5 : Rapports › Résumé sur mobile — crayon et « Facturer » passent dans le menu ⋮ de la ligne */
@media (max-width: 599px) {
  .bd-act .bd-edit, .bd-act .bd-invoice, .bd-act .bd-edit-spacer { display: none; }
  .bd-row > .bd-act { gap: 4px; }
}

/* v0.7.5 : entrées sur mobile — ▶ « Relancer » passe dans le menu ⋮ (glisser vers la droite relance toujours) */
@media (max-width: 640px) {
  .entry-actions:has(.row-more) .entry-play { display: none; }
}

/* v0.8.0 : pause du timer — compteur figé (atténué, clignotement lent), point ambré, bouton Pause / Reprendre */
:root { --pause: #e69a12; }
.tracker-clock.is-paused, .running-time.is-paused, .tracker-hero.is-running .tracker-clock.is-paused { color: var(--muted); animation: paused-blink 2s ease-in-out infinite; }
@keyframes paused-blink { 50% { opacity: .45; } }
.tracker-status.is-paused .pulse, .running-bar.is-paused .pulse { background: var(--pause); animation: none; }
.tracker-status.is-paused { color: var(--warn-text); }
.btn-pause { border: 1px solid var(--line); }
.btn-pause.is-paused { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.btn-pause .ic, .bar-pause .ic { width: 16px; height: 16px; }
.bar-pause { flex: none; }
.bar-pause.is-paused { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.entry-dur.is-paused { color: var(--muted); }
.tracker-hero .btn-pause { min-width: 0; padding-inline: 12px; flex: none; }
.tracker-hero .btn-pause span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .tracker-clock.is-paused, .running-time.is-paused { animation: none; } }

/* v0.8.0 → v0.8.5 : tâches favorites — bouton dépliable « Favoris » à côté de « Reprendre » (même présentation) */
.quick-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 12px; }
.quick-row .qr-slot, .quick-row .recents { display: contents; }
.quick-row .recents-toggle { order: 0; }
.quick-row .recents-list { order: 1; flex: 1 1 100%; }
.favorites-toggle > .ic { color: var(--pause) !important; }
.recent.is-on { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); cursor: default; }
.fav-star { display: inline-flex; vertical-align: -2px; margin-right: 5px; color: var(--pause); }
.fav-star .ic { width: 14px; height: 14px; }
/* v0.8.0 : écrans moyens (900–1279 px) — la description passe sur sa ligne, projet / tâche / compteur / boutons dessous */
@media (min-width: 900px) and (max-width: 1279px) {
  .tracker-hero .tracker-form { flex-direction: column; align-items: stretch; }
}
/* Projet + tâche affichés : la ligne ne tient plus, même en grand écran → même disposition. */
@media (min-width: 900px) {
  .tracker-hero .tracker-form:has(.tracker-task:not([hidden])) { flex-direction: column; align-items: stretch; }
  .tracker-hero .tracker-form:has(.tracker-task:not([hidden])) .tracker-fields { flex: 1 1 auto; flex-wrap: wrap; }
  .tracker-hero .tracker-form:has(.tracker-task:not([hidden])) .combo.tracker-project,
  .tracker-hero .tracker-form:has(.tracker-task:not([hidden])) .combo.tracker-task { flex: 1 1 180px; }
  .tracker-hero .tracker-form:has(.tracker-task:not([hidden])) .tracker-clock { margin-left: auto; }
}
@media (min-width: 900px) and (max-width: 1279px) {
  .tracker-hero .tracker-fields { flex: 1 1 auto; flex-wrap: wrap; }
  .tracker-hero .tracker-fields .combo.tracker-project, .tracker-hero .tracker-fields .combo.tracker-task { flex: 1 1 180px; }
  .tracker-hero .tracker-fields .tracker-clock { margin-left: auto; }
}

/* ---------- v0.8.0 : Tableau de bord ---------- */
.nav-short { display: none; }
@media (max-width: 899px) { .nav .nav-long { display: none; } .nav .nav-short { display: inline; } }
.page-sub { margin: 2px 0 0; font-size: 14px; }
.badge-over { background: var(--danger); color: #fff; }
.badge .ic { width: 12px; height: 12px; vertical-align: -2px; }
.delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.delta.is-up { color: var(--accent-ink); }
.delta.is-down { color: var(--danger); }
.delta.is-flat { color: var(--muted); }
.dash-stats .stat-sub { line-height: 1.35; }
.dash-card { padding: 16px; margin-bottom: 16px; }
.dash-card .section-title { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.dash-card .section-title .ic { width: 18px; height: 18px; color: var(--warn-text); }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.dash-card-head .section-title { margin: 0; }
.dash-grid { display: grid; gap: 16px; }
.dash-grid .dash-card { margin-bottom: 0; }
.dash-grid { margin-bottom: 16px; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
.dash-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dash-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; color: inherit; text-decoration: none; }
@media (hover: hover) { .dash-row:hover { background: var(--surface-2); } }
.dash-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dash-row .dash-name { flex: 1 1 auto; }
.dash-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-big { margin: 0 0 4px; font-size: 22px; }
.dash-big strong { font-variant-numeric: tabular-nums; }
.dash-big .muted { font-size: 13px; }
.dash-bar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(60px, 1fr) 150px; align-items: center; gap: 10px; font-size: 14px; }
.dash-bar-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dash-bar { height: 8px; background: color-mix(in srgb, var(--text) 7%, transparent); border-radius: 4px; overflow: hidden; }
.dash-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.dash-bar-val { display: flex; gap: 8px; align-items: baseline; justify-content: flex-end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-bar-val .muted { font-size: 12px; }
.dash-alerts .dash-list { gap: 2px; }

/* Calendrier annuel : intensité = une seule teinte (accent), du plus clair au plus soutenu ; 0 = case neutre. */
.heatmap-wrap { overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.heatmap { display: inline-flex; gap: 3px; padding-top: 16px; position: relative; }
.hm-days { display: grid; grid-template-rows: repeat(7, 12px); gap: 3px; margin-right: 4px; font-size: 10px; color: var(--muted); line-height: 12px; }
.hm-week { display: grid; grid-template-rows: repeat(7, 12px); gap: 3px; position: relative; }
.hm-month { position: absolute; top: -16px; left: 0; font-size: 10px; color: var(--muted); white-space: nowrap; text-transform: capitalize; }
.hm-cell { display: block; width: 12px; height: 12px; border-radius: 3px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.hm-cell.l1 { background: color-mix(in srgb, var(--accent) 25%, var(--surface)); }
.hm-cell.l2 { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.hm-cell.l3 { background: color-mix(in srgb, var(--accent) 65%, var(--surface)); }
.hm-cell.l4 { background: color-mix(in srgb, var(--accent) 85%, var(--surface)); }
.hm-cell.l5 { background: color-mix(in srgb, var(--accent) 100%, #000 25%); }
a.hm-cell:hover, a.hm-cell:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.hm-legend { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 10px; font-size: 11px; color: var(--muted); }
.hm-legend i.hm-cell { display: inline-block; }

/* Rentabilité par client */
.profit-table { display: grid; }
.profit-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 70px 100px 90px minmax(170px, 1.3fr); gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.profit-row:last-child { border-bottom: 0; }
.profit-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 0; }
.profit-name { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.profit-name .small { flex-basis: 100%; padding-left: 18px; margin-top: -2px; }
.profit-rate { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profit-bar { position: relative; flex: 1 1 60px; height: 8px; background: color-mix(in srgb, var(--text) 7%, transparent); border-radius: 4px; }
.profit-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.profit-bar > i, .profit-legend > i { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text-2); border-radius: 1px; }
.profit-legend { position: relative; padding-left: 10px; margin-top: 8px; }
.profit-legend > i { left: 0; top: 1px; }
.profit-meta { display: none; }
@media (max-width: 699px) {
  .profit-head { display: none; }
  .profit-row { grid-template-columns: 1fr; row-gap: 6px; }
  .profit-row > :nth-child(2), .profit-row > :nth-child(3), .profit-row > :nth-child(4) { display: none; }
  .profit-meta { display: block; flex-basis: 100%; padding-left: 18px; }
}
@media (max-width: 599px) {
  .dash-bar-row { grid-template-columns: minmax(0, 1fr) 54px auto; gap: 8px; }
  .dash-bar-val .muted { display: none; }
}
.toast-warn { background: var(--warn-soft); color: var(--warn-text); border: 1px solid color-mix(in srgb, var(--warn-text) 30%, transparent); }
/* Rapports › Détaillé : « Tout sélectionner » juste après le titre « Entrées » */
.details-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.details-title .section-title { margin: 0; }

/* v0.8.5 : sauvegardes sur le serveur */
.subsection-title { font-size: 15px; font-weight: 700; margin: 18px 0 6px; }
.server-backups { margin-top: 12px; }
.server-backups .btn-row { align-items: center; }
.backup-list { list-style: none; margin: 10px 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); max-height: 360px; overflow-y: auto; }
.backup-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.backup-item:last-child { border-bottom: 0; }
.backup-when { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; font-size: 14px; }
.backup-when strong { font-weight: 600; text-transform: capitalize; }
.backup-actions { display: flex; gap: 2px; flex: none; }
.badge-auto { background: var(--accent-soft); color: var(--accent-ink); }
.badge-safety { background: var(--warn-soft); color: var(--warn-text); }

/* v0.8.5 : suivi des paiements des factures */
.inv-row { grid-template-columns: 120px 130px minmax(0, 1fr) 140px 110px 36px; cursor: pointer; }
.inv-row-head { cursor: default; }
.inv-row:not(.inv-row-head):hover { background: var(--surface-2); }
.inv-row > a { color: inherit; text-decoration: none; }
.inv-row > span:nth-child(2) { display: flex; flex-direction: column; }
.inv-row small { font-size: 12px; }
.inv-status { font-size: 12px; padding: 2px 9px; white-space: nowrap; }
.inv-status.is-draft { background: var(--surface-2); color: var(--text-2); }
.inv-status.is-sent { background: color-mix(in srgb, #2a78d6 16%, var(--surface)); color: color-mix(in srgb, #2a78d6 80%, var(--text)); }
.inv-status.is-overdue { background: var(--danger); color: #fff; }
.inv-status.is-paid { background: var(--accent-soft); color: var(--accent-ink); }
.inv-stats .stat.is-alert { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.inv-stats .stat.is-alert .stat-value { color: var(--danger); }
.inv-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 10px; padding-bottom: 2px; }
.inv-filters::-webkit-scrollbar { display: none; }
.chip-filter { display: inline-flex; align-items: center; gap: 6px; flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip-filter .count { font-size: 11px; background: color-mix(in srgb, var(--text) 9%, transparent); border-radius: 99px; padding: 0 6px; }
.chip-filter[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent-ink); }
.chip-filter.is-alert .count { background: var(--danger); color: #fff; }
.inv-empty { padding: 16px; margin: 0; }
.inv-pay { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin: 0 auto 14px; max-width: 820px; }
.inv-pay-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inv-pay-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 699px) {
  .inv-row { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 4px; }
  .inv-row > a { grid-column: 1; grid-row: 1; }
  .inv-row > span:nth-child(4) { grid-column: 2; grid-row: 1; justify-self: end; }
  .inv-row > .row-more { grid-column: 3; grid-row: 1 / span 2; }
  .inv-row > span:nth-child(2) { grid-column: 1; grid-row: 2; }
  .inv-row > strong.num { grid-column: 2; grid-row: 2; }
  .inv-row > .inv-client { grid-column: 1 / -1; grid-row: 3; }
}
@media print { .inv-pay { display: none; } }
.dash-inv-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dash-inv-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-inv-val { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-inv-grid .is-alert .dash-inv-val { color: var(--danger); }
@media (max-width: 599px) { .dash-inv-grid { grid-template-columns: 1fr 1fr; } .dash-inv-grid > div:last-child { grid-column: 1 / -1; } }
/* v0.8.5 : étoile « favori » à côté de la tâche dans le Timer */
.fav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.tracker-hero .fav-toggle { width: 44px; height: 44px; }
.fav-toggle .ic { width: 18px; height: 18px; }
.fav-toggle.is-on { color: var(--pause); border-color: color-mix(in srgb, var(--pause) 45%, var(--line)); background: color-mix(in srgb, var(--pause) 10%, transparent); }
@media (hover: hover) { .fav-toggle:hover { color: var(--pause); } }
@media (max-width: 899px) {
  .tracker-hero .tracker-fields .combo.tracker-task:has(~ .fav-toggle) { flex: 1 1 calc(100% - 116px); }
}
/* Très petits écrans (iPhone SE) : compteur et bouton Démarrer / Arrêter sur la même ligne */
@media (max-width: 360px) {
  .tracker-hero .tracker-clock { font-size: 24px; }
  .tracker-hero .btn-start, .tracker-hero .btn-stop { min-width: 0; padding-inline: 14px; }
  .tracker-hero .btn-stop { flex: 1 1 100%; }
}

/* v0.8.6 : favoris repérables — étoile devant chaque tâche, regroupés et triés par client › projet ;
   titre au-dessus de chaque liste quand « Reprendre » et « Favoris » sont ouverts ensemble */
.quick-row .ql-title { display: none; align-items: center; gap: 6px; flex: 1 1 100%; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.quick-row .ql-title .ic { width: 12px; height: 12px; color: var(--accent-ink); }
.quick-row .favorites .ql-title .ic { color: var(--pause); }
.quick-row:has(.recents.is-open:not(.favorites)):has(.favorites.is-open) .ql-title { display: flex; }
.quick-row:has(.recents.is-open:not(.favorites)):has(.favorites.is-open) .favorites .recents-list { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 2px; }
.favorites .recents-list { flex-direction: column; gap: 8px; }
.fav-group { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fav-group-head { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-group-head .muted { font-weight: 500; }
.fav-group-items { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 14px; }
.fav-chip { border-color: color-mix(in srgb, var(--pause) 35%, var(--line)); }
.fav-chip .fav-star { margin: 0; vertical-align: 0; }
.fav-chip .fav-star .ic { width: 13px; height: 13px; color: var(--pause); }
.fav-chip.is-on .fav-star .ic { color: var(--accent-ink); }
@media (hover: hover) { .fav-chip:not(.is-on):hover { border-color: var(--pause); } }

/* v0.8.6 : corbeille */
.trash-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; min-height: 34px; }
.trash-all { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; margin-right: auto; }
.trash-list { padding: 4px 0; }
.trash-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.trash-row:first-child { border-top: 0; }
.trash-row.is-picked { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.trash-kind { display: inline-flex; width: 18px; justify-content: center; color: var(--muted); }
.trash-kind .ic { width: 16px; height: 16px; }
.trash-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trash-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-right: 8px; }
.trash-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-when { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; white-space: nowrap; }
.trash-when small { font-size: 12px; }
.trash-when small.is-alert { color: var(--danger); font-weight: 600; }
.trash-row .row-more { display: none; }
@media (max-width: 699px) {
  .trash-row { grid-template-columns: auto auto minmax(0, 1fr) auto; padding: 10px 12px; gap: 8px; }
  .trash-when { grid-column: 3; grid-row: 2; flex-direction: row; gap: 8px; align-items: baseline; font-size: 12px; }
  .trash-restore { display: none; }
  .trash-row .row-more { display: inline-flex; grid-column: 4; grid-row: 1 / span 2; }
}
/* v0.8.6 : rappel de fin de journée */
.reminder-inner.reminder-day { background: color-mix(in srgb, var(--accent-soft) 85%, transparent); color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.reminder-day .reminder-icon { color: var(--accent-ink); }
.trash-empty { margin-left: auto; }
.trash-all { margin-right: 0; }

/* v0.9.0 : contrats (maintenances au forfait, ponctuels) */
.btn-contracts { margin-left: 0; }
.alert-todo { background: color-mix(in srgb, var(--accent-soft) 85%, transparent); color: var(--text); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.alert-todo .ic { width: 15px; height: 15px; vertical-align: -2px; color: var(--accent-ink); }
.alert-todo .alert-cta { color: var(--accent-ink); }
.alert-todo.is-late { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
#alerts { display: flex; flex-direction: column; gap: 10px; }
#alerts:empty { display: none; }
.ct-stats { margin-bottom: 18px; }
.ct-list, .ct-history { padding: 2px 0; }
.ct-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.ct-row:first-child { border-top: 0; }
.ct-history .ct-row { grid-template-columns: minmax(0, 1fr) auto auto; padding-left: 46px; }
.ct-row.is-late { box-shadow: inset 3px 0 0 var(--danger); }
.ct-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-states { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ct-actions { display: inline-flex; align-items: center; gap: 6px; }
.ct-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.ct-chip .ic { width: 12px; height: 12px; }
.ct-chip.is-done { background: var(--accent-soft); color: var(--accent-ink); }
.ct-chip.is-overdue { background: var(--danger-soft); color: var(--danger); }
.ct-chip.is-soon { background: var(--warn-soft); color: var(--warn-text); }
.ct-chip.is-todo { background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface-2)); color: var(--text-2, var(--text)); }
.ct-chip.is-bill { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent-ink); }
.ct-inv { font-size: 12px; font-weight: 700; color: var(--text); text-decoration: none; }
.ct-inv:hover { text-decoration: underline; }
.ct-empty { padding: 14px; display: flex; align-items: center; gap: 8px; }
.ct-empty .ic { color: var(--accent-ink); width: 16px; height: 16px; }
.ct-contracts { display: flex; flex-direction: column; gap: 10px; }
.ct-card { padding: 0; overflow: hidden; }
.ct-card.is-archived { opacity: .7; }
.ct-card-head { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px 14px; padding: 12px 14px; }
.ct-fold { display: inline-flex; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.ct-fold .ic { width: 16px; height: 16px; transition: transform .15s; }
.ct-card.is-open .ct-fold .ic { transform: rotate(90deg); }
.ct-price, .ct-profit { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; white-space: nowrap; }
.ct-history { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 40%, transparent); }
.ct-check-hint { padding: 8px 14px 10px 46px; margin: 0; }
.ct-history > p.muted.small:last-child { padding: 0 14px 10px 46px; margin: 0; }
.ct-freq { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.ct-freq label { flex: 1 1 auto; }
.ct-freq input { position: absolute; opacity: 0; pointer-events: none; }
.ct-freq span { display: block; text-align: center; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.ct-freq input:checked + span { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.ct-freq input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ct-checklist { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.ct-checklist legend { font-weight: 600; margin-bottom: 6px; }
.check-line { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-billable:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 799px) {
  .ct-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ct-states { grid-column: 2 / -1; grid-row: 2; justify-content: flex-start; }
  .ct-actions { grid-column: 3; grid-row: 1; }
  .ct-actions .btn span { display: none; }
  .ct-actions .ct-play { display: none; }
  .ct-history .ct-row { grid-template-columns: minmax(0, 1fr) auto; padding-left: 14px; }
  .ct-history .ct-states { grid-column: 1 / -1; }
  .ct-history .ct-actions { grid-column: 2; grid-row: 1; }
  .ct-card-head { grid-template-columns: auto auto minmax(0, 1fr) auto; }
  .ct-price { grid-column: 3; grid-row: 2; align-items: flex-start; text-align: left; }
  .ct-profit { grid-column: 3 / -1; grid-row: 3; align-items: flex-start; text-align: left; white-space: normal; }
  .ct-card-head .row-more { grid-column: 4; grid-row: 1; }
  .ct-check-hint, .ct-history > p.muted.small:last-child { padding-left: 14px; }
}
.ct-list + .section-title, .ct-stats + .section-title { margin-top: 26px; }
.ct-list { margin-bottom: 8px; }
@media (max-width: 799px) {
  .ct-row .ct-name { white-space: normal; }
  .ct-row .ct-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ct-period { display: block; font-size: 13px; }
  .ct-sep { display: none; }
}
/* v0.9.3 : Clients et projets (ordinateur) — Budgets, Contrats et la recherche alignés tout à droite du titre */
@media (min-width: 900px) {
  .page-projets .page-head > .title-row { flex: 1 1 100%; }
  .page-projets .title-row > .btn-budgets:not(.btn-contracts) { margin-left: auto; }
}

/* v0.9.5 : favoris — projets, tâches, contrats ; page de gestion (ajouter, retirer, ordonner) */
.fav-kind { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 1px 5px; border-radius: 99px; background: var(--surface-2); }
.fav-chip.is-project .recent-name { font-style: italic; }
.fav-empty { margin: 0; }
.fav-manage { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--accent-ink); text-decoration: none; padding: 4px 2px; }
.fav-manage .ic { width: 14px; height: 14px; }
.fav-manage:hover { text-decoration: underline; }
.fav-section { margin-bottom: 16px; }
.fav-section .section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.fav-list, .fav-pool { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.fav-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-top: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.fav-row:first-child { border-top: 0; }
.fav-row.is-dragging { opacity: .45; }
.fav-row.is-over { box-shadow: inset 0 2px 0 var(--accent); }
.fav-grip { display: inline-flex; color: var(--muted); cursor: grab; }
.fav-grip .ic { width: 16px; height: 16px; }
.fav-row .fav-star { display: inline-flex; color: var(--pause); }
.fav-row .fav-star .ic { width: 15px; height: 15px; }
.fav-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fav-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-type { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; margin-right: 8px; border-radius: 99px; vertical-align: 1px; background: var(--surface-2); color: var(--muted); }
.fav-type.is-contract { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent-ink); }
.fav-type.is-project { background: color-mix(in srgb, var(--pause) 14%, var(--surface)); color: var(--warn-text); }
.fav-actions { display: inline-flex; gap: 2px; }
.fav-actions .icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.icon-danger:hover { color: var(--danger); }
.fav-none { margin: 4px 0; }
.fav-add-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.fav-search { flex: 1 1 260px; min-width: 0; }
.fav-cand { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.fav-pool li:first-child .fav-cand { border-top: 0; }
.fav-cand:hover { background: var(--surface-2); }
.fav-plus { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--accent-ink); white-space: nowrap; }
.fav-plus .ic { width: 14px; height: 14px; }
@media (max-width: 639px) { .fav-grip { display: none; } .fav-plus span { display: none; } }
@media (hover: none) { .fav-grip { display: none; } }
.fav-section { padding: 16px 16px 10px; }
.fav-add-bar .inv-filters { flex-wrap: wrap; margin: 0; }
.fav-more { margin: 8px 0 4px; }
@media (max-width: 639px) { .fav-section { padding: 14px 12px 8px; } .fav-row { gap: 8px; padding: 8px 2px; } }
@media (max-width: 639px) { .fav-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .fav-actions .icon-btn { width: 34px; } }
/* v0.9.6 : Rapports — bouton Corbeille après Factures, CSV et PDF ; tout à droite sur mobile */
.btn-trash .recents-count { margin-left: 2px; }
@media (max-width: 559px) { .page-rapports .page-actions .btn-trash { margin-left: auto; } }
@media (max-width: 559px) { .page-rapports .page-actions .btn-trash > span:not(.recents-count) { display: none; } .page-rapports .page-actions .btn-trash { padding-left: 10px; padding-right: 10px; gap: 4px; } }
@media (max-width: 380px) {
  .page-rapports .page-actions .btn:not(.btn-trash) .ic { display: none; }
  .page-rapports .page-actions .btn { padding-left: 10px; padding-right: 10px; }
}
