:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #292826;
  background: #fff;
  font-synthesis: none;
  --muted: #66635e;
  --line: #e8e7e3;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid #57554e; outline-offset: 4px; }
.skip-link { position: absolute; left: 16px; top: -100px; padding: 12px; background: white; }
.skip-link:focus { top: 12px; }
.app-header { padding: 16px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 600; text-decoration: none; }
.brand svg { width: 26px; height: 30px; flex: none; }
.cabinet { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 3px; }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; white-space: nowrap; }
main { flex: 1; width: min(1040px, 100%); margin-inline: auto; padding: 48px 24px; }
.welcome { max-width: 620px; }
.eyebrow { color: var(--muted); font-size: 14px; }
h1 { margin: 12px 0 24px; font-size: clamp(28px, 5vw, 38px); line-height: 1.2; letter-spacing: -.035em; font-weight: 650; }
p { line-height: 1.65; overflow-wrap: anywhere; }
.notice { margin-top: 32px; padding: 20px; border: 1px solid var(--line); border-radius: 5px; background: #f7f7f5; }
footer { padding: 20px 24px; color: var(--muted); font-size: 12px; text-align: center; }
.login { max-width: 352px; margin: clamp(0px, 6vh, 64px) auto 32px; }
.login h1 { font-size: 32px; margin-bottom: 32px; }
.field + .field { margin-top: 20px; }
label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 7px; }
input:not([type="hidden"]):not([type="checkbox"]) { width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid #deddd9; border-radius: 5px; color: inherit; background: white; font-size: 16px; }
input[aria-invalid="true"] { border-color: #a23b32; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.visibility { position: absolute; inset: 1px 1px 1px auto; width: 44px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.visibility svg { width: 19px; height: 19px; }
.visibility[aria-pressed="false"] .slash { display: none; }
.submit { width: 100%; min-height: 46px; margin-top: 26px; padding: 10px 16px; border: 1px solid #292826; border-radius: 5px; color: white; background: #292826; font-size: 14px; font-weight: 600; }
.submit:hover { background: #44423e; }
.feedback, .field-error { margin-top: 14px; color: #a23b32; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.errorlist { list-style: none; margin: 0; padding: 0; }
.account { max-width: 500px; margin: auto; }
.profile { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.profile h2 { font-size: 13px; font-weight: 500; color: var(--muted); }
.profile p { margin-bottom: 0; }
.account-action { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 14px 12px; margin-top: 16px; border: 0; border-radius: 5px; background: white; color: inherit; text-align: left; font-size: 14px; }
.account-action svg { width: 20px; height: 20px; flex: none; }
.account-action:hover, .visibility:hover { background: #f7f7f5; }
.account-action.danger { color: #922f26; }
button:disabled { cursor: wait; opacity: .7; }
@media (max-width: 360px) {
  .app-header { padding-inline: 12px; gap: 8px; }
  .brand { font-size: 13px; }
  .nav-link { font-size: 12px; }
}
@media (min-width: 700px) {
  .app-header { padding: 24px 40px; }
  main { padding: 72px 40px; }
}

.return { display: block; width: fit-content; margin: 18px auto 0; padding: 10px; min-height: 44px; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.profile + form { margin-top: 24px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 10px 14px; border: 1px solid #292826; border-radius: 5px; background: #292826; color: white; font-size: 14px; text-decoration: none; }
.secondary { color: inherit; background: white; border-color: var(--line); }
.admin-sections { display: flex; flex-wrap: wrap; gap: 12px 24px; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 24px; color: var(--muted); font-size: 14px; }
.admin-sections [aria-current] { color: #292826; font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin-block: 28px; }
.filters > div:first-child { flex: 1 1 250px; }
select { max-width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #deddd9; border-radius: 5px; color: inherit; background: white; font-size: 16px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 5px; margin-top: 20px; }
table { width: 100%; min-width: 820px; border-collapse: collapse; text-align: left; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 14px 12px; vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; font-weight: 500; background: #f7f7f5; }
td { overflow-wrap: anywhere; max-width: 250px; }
td:nth-child(4) { min-width: 220px; white-space: normal; }
tr:last-child td { border-bottom: 0; }
input[type="checkbox"] { width: 22px; height: 22px; margin: 11px; accent-color: #292826; cursor: pointer; }
.access-switch { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 0; border: 0; border-radius: 4px; color: inherit; background: transparent; text-align: left; }
.access-switch-track { position: relative; flex: none; width: 34px; height: 20px; border: 1px solid #77736d; border-radius: 12px; background: #f7f7f5; }
.access-switch-track::after { content: ""; position: absolute; inset: 3px auto auto 3px; width: 12px; height: 12px; border-radius: 50%; background: #66635e; }
.access-switch[aria-checked="true"] .access-switch-track { border-color: #45624b; background: #45624b; }
.access-switch[aria-checked="true"] .access-switch-track::after { inset-inline-start: 17px; background: white; }
.access-switch[title]:disabled { cursor: default; }
.access-switch-error { max-width: 200px; white-space: normal; margin: 4px 0; }
.user-table-wrap { position: relative; }
.user-actions > * + * { margin-top: 8px; }
.selection-summary { position: sticky; top: 0; z-index: 1; background: #f7f7f5; border: 1px solid var(--line); border-radius: 5px; padding: 12px; }
.selection-summary p { font-size: 13px; margin: 0 0 8px; }
.selection-summary ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 10px; padding: 0; max-height: 100px; overflow-y: auto; }
.selection-summary li { max-width: 100%; }
.selection-summary li button { min-height: 44px; max-width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 5px; color: inherit; background: white; overflow-wrap: anywhere; }
.admin-sections a { display: inline-flex; align-items: center; min-height: 44px; }
.admin-sections span { display: inline-flex; align-items: center; min-height: 44px; }
.form-actions, .pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-block: 24px; }
.pagination { font-size: 13px; }
.dossier-table td:nth-child(3) { min-width: 200px; white-space: normal; }
fieldset { min-width: 0; margin: 24px 0; padding: 16px; border: 1px solid var(--line); border-radius: 5px; }
legend { max-width: 100%; font-size: 14px; }
.radio-choice { display: flex; align-items: center; gap: 12px; padding: 12px 0; overflow-wrap: anywhere; }
.radio-choice input[type="radio"] { width: 22px; min-height: 22px; flex: 0 0 22px; accent-color: #292826; }

.ia-form { max-width: 780px; }
.ia-modeles { display: grid; gap: 20px; }
.ia-modeles .field { min-width: 0; margin-top: 0; }
.ia-modeles [data-ia-recherche] { margin-bottom: 12px; }
.ia-identifiant { margin-top: 6px; }
.ia-form select, .ia-form textarea { width: 100%; }
.ia-form textarea { font: inherit; font-size: 16px; padding: 12px; border: 1px solid #deddd9; border-radius: 5px; resize: vertical; }
.ia-form [aria-invalid="true"] { border-color: #a23b32; }
.ia-format { margin-top: 16px; }
.ia-format summary { cursor: pointer; padding-block: 12px; }
.ia-format p { white-space: pre-line; font-size: 14px; }
.ia-resultat { padding: 16px; border: 1px solid var(--line); border-radius: 5px; overflow-wrap: anywhere; }
.ia-resultat h2 { font-size: 18px; margin-top: 0; }
.ia-comparaison { min-width: 0; table-layout: fixed; font-size: 13px; }
.ia-comparaison th, .ia-comparaison td { padding: 8px 6px; white-space: normal; vertical-align: top; }
.ia-comparaison th:first-child { width: 26%; }
@media (min-width: 700px) {
  .ia-modeles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.expense-form { max-width: 680px; margin-inline: auto; }
.expense-form select, .expense-form textarea { width: 100%; }
.expense-form textarea { font: inherit; padding: 12px; border: 1px solid #deddd9; border-radius: 5px; resize: vertical; }
.expense-form .field { margin-top: 20px; }
.expense-form .expense-grid .field { margin-top: 0; }
.expense-grid { display: grid; gap: 20px; margin-top: 24px; }
.expense-actions { padding-block: 16px; margin-bottom: 0; background: white; border-top: 1px solid var(--line); justify-content: flex-end; }
.expense-form [aria-invalid="true"] { border-color: #a23b32; }
.lookup { position: relative; }
.lookup .field { margin-top: 0; }
.lookup [data-lookup-status] { margin-top: 8px; }
.suggestions { position: absolute; top: 71px; left: 0; right: 0; z-index: 2; max-height: 260px; overflow-y: auto; list-style: none; padding: 4px; margin: 0; border: 1px solid #deddd9; border-radius: 5px; background: white; box-shadow: 0 8px 24px #0001; }
.suggestions li { padding: 12px 8px; min-height: 44px; cursor: pointer; overflow-wrap: anywhere; }
.suggestions [aria-selected="true"], .suggestions li:hover { background: #eeede9; }
.search-dossiers { margin-block: 8px; }
.expense-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.expense-heading h1 { margin-bottom: 20px; }
.expense-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.expense-tabs a { padding-block: 14px; text-decoration: none; font-size: 14px; }
.expense-tabs [aria-current] { border-bottom: 2px solid #292826; font-weight: 600; }
.expense-group { border: 1px solid var(--line); border-radius: 6px; margin-block: 16px; }
.expense-group summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 18px; cursor: pointer; font-size: 14px; font-weight: 600; }
.expense-group summary > span:first-child::before { content: '▸ '; }
.expense-group details[open] summary > span:first-child::before { content: '▾ '; }
.month-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px 12px; border-top: 1px solid var(--line); }
.month-actions svg { width: 18px; height: 18px; }
.note-submit[value="1"], .expense-group details:not([open]) + .month-actions .note-submit[value="0"] { display: none; }
.expense-group details:not([open]) + .month-actions .note-submit[value="1"] { display: inline-flex; }
.note-scope { margin: 0 4px; }
.note-change { color: #6d501e; font-size: 13px; }
.month-actions .note-change { flex-basis: 100%; margin: 0 4px; }
.danger { color: #922f26; }
.restored-notes { border-top: 1px solid var(--line); padding: 8px 12px 12px; }
.restored-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-block: 4px; font-size: 13px; }
.restored-note strong { flex-basis: 100%; }
.restored-note svg { width: 18px; height: 18px; }
.trash-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 8px; padding: 24px; color: inherit; }
.trash-dialog::backdrop { background: #29282666; }
.trash-dialog h2, .trash-inline h2 { margin: 0 0 16px; overflow-wrap: anywhere; font-size: 22px; }
.trash-dialog .form-actions, .trash-inline .form-actions { margin-bottom: 0; justify-content: flex-end; }
.trash-table { min-width: 0; }
.trash-table td:nth-child(4) { min-width: 0; }
.trash-table th:first-child, .trash-table td:first-child { white-space: normal; }
.trash-item { display: flex; gap: 10px; justify-content: space-between; white-space: normal; }
.trash-item .hint, .trash-dialog h2 small, .trash-inline h2 small { display: block; margin: 4px 0 0; font-weight: 400; }
.trash-mobile { display: none; }
.trash-documents { display: flex; flex-wrap: wrap; gap: 8px; }
.trash-dates { margin: 16px 0; font-size: 14px; }
.trash-dates > div { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.trash-dates dt { color: var(--muted); }
.trash-dates dd { margin: 0; }
@media (max-width: 760px) {
  .trash-table-wrap { overflow-x: visible; }
  .trash-table { table-layout: fixed; }
  .trash-table thead, .trash-table td:not(:first-child) { display: none; }
  .trash-table td { padding-block: 10px; }
  .trash-mobile { display: block; }
  .trash-sheet { position: fixed; inset: auto 0 0; width: 100%; max-width: none; max-height: 90dvh; margin: 0; border-radius: 12px 12px 0 0; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
}
.expense-list { list-style: none; padding: 0 18px; margin: 0; }
.expense-row { display: flex; gap: 12px; justify-content: space-between; padding-block: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.expense-description { min-width: 0; }
.expense-description p { margin: 0 0 5px; }
.expense-type { font-size: 13px; color: var(--muted); }
.expense-dossier { text-decoration: underline; text-underline-offset: 3px; }
.expense-comment { background: #fff8db; color: #6d501e; padding: 6px 8px; border-radius: 3px; white-space: normal; }
.expense-amount { white-space: nowrap; flex-shrink: 0; }
.expense-anomalies { margin-block: 20px; padding: 18px; border: 1px solid #a23b32; border-radius: 6px; background: #fff8f3; overflow-wrap: anywhere; font-size: 14px; }
.expense-anomalies h2 { margin-top: 0; font-size: 19px; }
.expense-anomalies h3 { font-size: 15px; }
.anomaly-list { list-style: none; padding: 0; }
.anomaly-list > li { border-top: 1px solid #e5cfc5; padding-block: 12px; }
.anomaly-list > li > ul { padding-left: 20px; margin-bottom: 16px; }
.anomaly-list .button { margin: 0 8px 8px 0; }
@media (min-width: 700px) { .expense-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 699px) {
  main { padding: 28px 12px; }
  .expense-heading .add-expense { position: fixed; bottom: 24px; right: 20px; z-index: 3; width: 56px; height: 56px; border-radius: 50%; background: #111; font-size: 30px; box-shadow: 0 3px 12px #0002; }
  .add-label { display: none; }
  .expense-list { padding-inline: 12px; }
  .expense-group summary { padding-inline: 12px; }
}

.vehicle-list {list-style:none;padding:0;}
.vehicle-list li {padding:16px 0;border-bottom:1px solid var(--line, #ddd);overflow-wrap:anywhere;}
.vehicle-dialog {width:min(640px,calc(100% - 24px));max-height:90dvh;overflow:auto;border:1px solid #ddd;border-radius:8px;padding:20px;}
.vehicle-dialog::backdrop {background:#0006;}
.vehicle-dialog .expense-form {padding:0;max-width:100%;}
.vehicle-dialog [data-account-back] {display:none;}
.vehicle-dialog input {max-width:100%;}
[data-ik-calculation] {overflow-wrap:anywhere;}

.sr-only {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}

.expense-filters { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.expense-filters .expense-tabs { margin: 0; border: 0; flex-shrink: 0; gap: 20px; }
.filter-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; min-width: 0; }
.filter-icon { width: 44px; height: 44px; display: inline-flex; justify-content: center; align-items: center; flex-shrink: 0; text-decoration: none; border-radius: 4px; font-size: 24px; color: var(--muted); }
.filter-icon:hover, .filter-icon[aria-expanded="true"], .filter-icon.is-filtered { background: #f1f1ef; color: #292826; }
.filter-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.folder-search { position: relative; width: 220px; min-width: 0; }
.folder-field { display: flex; align-items: center; border-bottom: 1px solid #deddd9; }
.folder-field:focus-within { border-bottom: 2px solid #57554e; }
.folder-field #folder-query { min-width: 0; border: 0; border-radius: 0; padding: 8px 0; background: transparent; font-size: 14px; }
.folder-field #folder-query:focus-visible { outline-offset: 0; }
#folder-query::-webkit-search-cancel-button { -webkit-appearance: none; }
.folder-suggestions { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; background: white; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 5px 12px #0001; max-height: 260px; overflow-y: auto; }
.folder-suggestions a { display: block; padding: 12px; font-size: 13px; overflow-wrap: anywhere; text-decoration: none; }
.folder-suggestions a:hover, .folder-suggestions [aria-selected="true"] { background: #f1f1ef; }
.folder-suggestions p { padding: 12px; }
.filter-submit { border: 1px solid var(--line); background: white; padding: 10px; border-radius: 4px; font-size: 13px; }
.enhanced .filter-submit { display: none; }
.selected-date { font-size: 13px; margin: 8px 0 16px; }
#calendar-view { margin-block: 16px 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.calendar-shell { width: min(336px, 100%); margin-inline: auto; }
.calendar-heading { display: flex; justify-content: space-between; align-items: center; }
.calendar-heading h2 { font-size: 15px; margin: 0; }
.calendar-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; }
.calendar-table th { padding: 0; font-size: 11px; font-weight: 400; color: var(--muted); height: 30px; text-align: center; }
.calendar-table td { padding: 0; min-width: 0; height: 44px; text-align: center; }
.calendar-day { display: grid; place-items: center; min-height: 44px; text-decoration: none; border-radius: 4px; font-size: 13px; }
.calendar-day:hover { background: #f1f1ef; }
.calendar-day span { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid transparent; border-radius: 50%; }
.calendar-day.has-expenses span { border-color: #96938c; }
.calendar-day[aria-current="date"] span { background: #292826; border-color: #292826; color: white; }
[aria-busy="true"] .expense-group { opacity: .6; }
@media (max-width: 699px) {
  .expense-filters { gap: 4px; }
  .expense-filters .expense-tabs { gap: 12px; }
  .expense-filters .expense-tabs a { font-size: 13px; }
  .search-open .expense-tabs { display: none; }
  .search-open .filter-actions { flex: 1; }
  .search-open .folder-search { flex: 1; width: auto; }
  .expense-filters:not(.enhanced) { flex-wrap: wrap; }
}
[data-manage-vehicles] {white-space:normal;}

/* Pièces et lecteur partagé entre le formulaire et le détail. */
.receipt-attachments{border-block:1px solid var(--border,#ddd);padding:12px 0;margin-bottom:22px}
.receipt-choices{display:flex;gap:8px;flex-wrap:wrap}
.receipt-files{list-style:none;padding:0;margin:12px 0}
.receipt-files li{display:flex;align-items:center;gap:6px;padding:8px 0;min-width:0}
.receipt-files li>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem}
.receipt-files .button{padding:8px;flex-shrink:0;min-height:44px;font-size:.8rem}
.receipt-reader{width:min(1050px,96vw);height:94dvh;max-height:96dvh;padding:16px;border:1px solid #ddd;border-radius:10px}
.receipt-reader[open]{display:flex;flex-direction:column;gap:8px}
.receipt-reader::backdrop{background:#0009}
.reader-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.reader-heading h2{font-size:1.1rem;margin:0}
.reader-toolbar{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.reader-toolbar .button{min-width:44px;min-height:44px;padding:6px 10px}
.reader-page{flex:1;min-height:80px;overflow:auto;background:#e7e7e7;padding:12px;text-align:center}
.reader-page img{display:block;max-width:none;margin:auto;box-shadow:0 1px 5px #0003}
.reader-source{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.receipt-reader [data-reader-status]:empty{display:none}
@media(max-width:600px){.receipt-reader{width:100%;max-width:100%;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;padding:10px}.reader-toolbar{font-size:.8rem}.reader-toolbar .button{padding:6px 8px}}

.receipt-size{flex-shrink:0;font-size:.7rem;white-space:nowrap}
