/* Relais Fichiers — charte bleu nuit, bleu, gris lavande et orange. */
:root {
  color-scheme: light;
  --canvas: #f1f4fa;
  --surface: #ffffff;
  --surface-soft: #f5f6fb;
  --ink: #18263a;
  --muted: #68778b;
  --subtle: #8b98aa;
  --line: #e2e5ee;
  --line-strong: #c7d1e1;
  --primary: #1f4e78;
  --primary-hover: #163b63;
  --primary-soft: #eaf1fa;
  --primary-border: #ccdcee;
  --blue: #2d71b0;
  --blue-soft: #dce9f7;
  --blue-ink: #345f85;
  --blue-panel: #edf3fb;
  --navy: #16335b;
  --orange: #e8a03a;
  --orange-hover: #d68c27;
  --orange-ink: #32291a;
  --inverse: #ffffff;
  --inverse-soft: #d9e4f1;
  --inverse-muted: #b7cbe1;
  --inverse-accent: #9ac7ef;
  --sidebar-line: #385779;
  --sidebar-surface: #1c3d64;
  --sidebar-selected: #275885;
  --neutral-soft: #f1f3f8;
  --danger: #b3323e;
  --danger-soft: #fff0f2;
  --danger-border: #edcad0;
  --danger-hover: #912731;
  --danger-hover-soft: #ffe7eb;
  --warning: #946019;
  --warning-border: #ead9b5;
  --warning-soft: #fffaef;
  --focus: #cb7d16;
  --lavender: #65558a;
  --lavender-bg: #f1eef8;
  --lavender-border: #e1dbee;
  --success: #25735b;
  --success-bg: #eff8f3;
  --success-border: #cae3d8;
  --success-muted: #538171;
  --success-fill: #8fc5ad;
  --radius: 12px;
  --radius-small: 10px;
  --shadow: 0 3px 12px rgb(22 51 91 / 5%);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button, input[type="submit"] { cursor: pointer; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
button, a, input, select, textarea, summary, [tabindex] { outline-offset: 4px; }
:focus-visible { outline: 3px solid var(--focus); }
img, svg { max-width: 100%; vertical-align: middle; }
img { height: auto; }
svg { flex-shrink: 0; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 650; line-height: 1.3; letter-spacing: -.025em; }
h1 { font-size: clamp(24px, 2.6vw, 30px); }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin-bottom: 1em; }
small, .text-small { font-size: 12px; }
strong { font-weight: 650; }
hr, .separator { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
code { padding: 2px 5px; border-radius: 4px; background: var(--surface-soft); font-size: .9em; overflow-wrap: anywhere; }
pre { max-width: 100%; padding: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
pre code { padding: 0; background: transparent; }
[hidden] { display: none !important; }
.sr-only, .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 16px; padding: 10px 18px; border-radius: 6px; color: white; background: var(--navy); transform: translateY(-150%); }
.skip-link:focus { color: white; transform: translateY(0); }
.muted, .text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack > :last-child { margin-bottom: 0; }
.stack > .field { margin-bottom: 0; }
.icon { display: inline-block; width: 20px; height: 20px; flex: 0 0 20px; stroke-width: 1.7; }
.inline-form { display: inline; }
.break-word { overflow-wrap: anywhere; }

/* Application et navigation */
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100dvh; padding: 29px 19px 19px; color: var(--inverse-soft); background: var(--navy); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px; color: inherit; text-decoration: none; font-size: 18px; font-weight: 650; line-height: 1.3; letter-spacing: -.035em; }
.brand:hover { color: inherit; }
.brand img { width: 40px; height: 40px; flex: 0 0 40px; }
.brand small, .brand-subtitle { display: block; margin-top: 3px; color: var(--inverse-muted); font-size: 10px; font-weight: 450; letter-spacing: .05em; text-transform: uppercase; }
.brand-name { display: block; }
.sidebar > .brand { margin-bottom: 38px; color: var(--surface); }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-label, .nav-section-title { margin: 25px 13px 10px; color: var(--inverse-muted); font-size: 10px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.nav-label:first-child, .nav-section-title:first-child { margin-top: 0; }
.sidebar-label { margin: 23px 13px 10px; color: var(--inverse-muted); font-size: 9px; font-weight: 650; letter-spacing: .11em; }
.sidebar > .brand + .sidebar-label { margin-top: 0; }
.sidebar-note { margin: 33px 9px 19px; padding: 16px 14px 13px; border: 1px solid var(--sidebar-line); border-radius: 10px; color: var(--inverse-muted); background: var(--sidebar-surface); }
.sidebar-note > .icon { display: block; width: 23px; height: 23px; margin-bottom: 11px; color: var(--inverse-accent); }
.sidebar-note strong { display: block; margin-bottom: 6px; color: var(--inverse-soft); font-size: 11px; }
.sidebar-note p { margin: 0; font-size: 10px; line-height: 1.8; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 11px 13px; border-radius: 10px; color: var(--inverse-soft); text-decoration: none; font-size: 13px; font-weight: 500; line-height: 1.5; }
.nav-link:hover { color: white; background: rgb(255 255 255 / 6%); }
.nav-link.is-active, .nav-link[aria-current="page"] { color: var(--inverse); background: var(--sidebar-selected); box-shadow: inset 3px 0 var(--inverse-accent); }
.nav-link.is-active .icon, .nav-link[aria-current="page"] .icon { color: var(--inverse-accent); }
.nav-count, .notification-count { display: inline-flex; justify-content: center; align-items: center; min-width: 22px; height: 22px; margin-left: auto; padding: 0 6px; border-radius: 6px; color: var(--inverse-soft); background: var(--sidebar-selected); font-size: 11px; font-weight: 650; }
.sidebar-footer { margin-top: auto; padding: 24px 10px 0; font-size: 12px; color: var(--inverse-muted); }
.sidebar-footer > p { margin: 0; }
.sidebar-footer .separator { border-color: rgb(255 255 255 / 12%); }
.sidebar-footer .btn { width: 100%; justify-content: flex-start; color: var(--inverse-soft); border-color: rgb(255 255 255 / 16%); background: transparent; }
.sidebar-footer .btn:hover { color: white; background: rgb(255 255 255 / 7%); }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin: 0 0 17px; }
.sidebar-user strong { display: block; max-width: 147px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--inverse); font-size: 12px; }
.sidebar-user small { display: block; font-size: 11px; }
.user-block { display: flex; align-items: center; gap: 10px; margin: 0 0 17px; color: var(--inverse); text-decoration: none; }
.user-block:hover { color: white; }
.user-block > span:last-child { min-width: 0; }
.user-block strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-block small { display: block; color: var(--inverse-muted); font-size: 10px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid var(--primary-border); border-radius: 50%; color: var(--primary); background: var(--primary-soft); font-size: 12px; font-weight: 650; text-transform: uppercase; }
.sidebar .avatar { border-color: var(--sidebar-line); color: var(--inverse-soft); background: var(--sidebar-surface); }
.avatar-small { width: 31px; height: 31px; flex-basis: 31px; font-size: 10px; text-decoration: none; }
.avatar-tiny { width: 25px; height: 25px; flex-basis: 25px; font-size: 9px; }
.avatar-large { width: 55px; height: 55px; flex-basis: 55px; font-size: 19px; }
.person-cell { display: flex; align-items: center; gap: 7px; min-width: 105px; font-size: 11px; }
.main-content { --space-left: 36px; --space-right: 36px; min-width: 0; padding: 0 var(--space-right) 36px var(--space-left); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 82px; margin: 0 calc(-1 * var(--space-right)) 28px calc(-1 * var(--space-left)); padding: 0 var(--space-right) 0 var(--space-left); color: var(--inverse-soft); background: linear-gradient(100deg, var(--navy), var(--blue)); font-size: 12px; }
.topbar-left, .topbar-right, .topbar-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-start, .topbar-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-actions { margin-left: auto; flex-shrink: 0; }
.topbar-right { margin-left: auto; }
.topbar-user > div { line-height: 1.4; }
.topbar-user strong { display: block; color: var(--ink); font-size: 12px; }
.topbar-user small { color: var(--muted); font-size: 10px; }
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .icon { width: 15px; height: 15px; flex-basis: 15px; }
.topbar .breadcrumb, .topbar .breadcrumb a { color: var(--inverse-soft); }
.topbar .breadcrumb strong { color: var(--inverse); }
.topbar .btn { border-color: transparent; color: var(--inverse); background: transparent; }
.topbar .btn:hover { border-color: transparent; color: var(--inverse); background: rgb(255 255 255 / 12%); }
.topbar .avatar { border-color: rgb(255 255 255 / 38%); color: var(--inverse); background: rgb(255 255 255 / 12%); }
.topbar .notification-count { color: var(--navy); background: var(--inverse); }
.topbar .nav-toggle, .topbar [data-nav-toggle] { display: none; }
.nav-backdrop { display: none; }
.sidebar-close { display: none; }
/* Comptes du bureau et externes : navigation en haut, sans colonne latérale. */
.app-shell.app-shell-wide { display: block; grid-template-columns: minmax(0, 1fr); }
.app-shell-wide .main-content { --space-left: clamp(15px, 3vw, 44px); --space-right: clamp(15px, 3vw, 44px); }
.app-shell-wide .page-content { width: 100%; max-width: 1060px; margin-inline: auto; }
.topbar-simple { padding-top: 16px; padding-bottom: 16px; }
.topbar-simple-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 24px; width: 100%; max-width: 1060px; margin-inline: auto; }
.topbar-simple .topbar-brand { min-width: 0; padding: 0; color: var(--inverse); font-size: 18px; }
.topbar-brand > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-navigation { display: flex; align-items: center; gap: 10px; }
.topbar-navigation > form { margin: 0; }
.topbar-navigation .btn { min-height: 42px; white-space: nowrap; }
.topbar-simple .topbar-dossiers { border-color: var(--orange); color: var(--orange-ink); background: var(--orange); }
.topbar-simple .topbar-dossiers:hover { border-color: var(--orange-hover); color: var(--orange-ink); background: var(--orange-hover); }
.topbar-simple .topbar-logout { border-color: rgb(255 255 255 / 38%); background: rgb(255 255 255 / 6%); }
.topbar-simple .topbar-logout:hover { border-color: rgb(255 255 255 / 65%); background: rgb(255 255 255 / 12%); }
.page-header, .split-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.page-header { margin-bottom: 26px; }
.page-header > div:first-child { min-width: 0; }
.page-title { margin-bottom: 8px; overflow-wrap: anywhere; }
.page-subtitle { max-width: 760px; margin-bottom: 0; color: var(--muted); font-size: 13px; }
.page-eyebrow { display: block; margin-bottom: 7px; color: var(--primary); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.page-actions, .actions, .table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.page-actions { flex-shrink: 0; padding-top: 6px; }
.page-actions form, .actions form, .table-actions form { margin: 0; }
.app-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.section-title { margin: 29px 0 14px; font-size: 17px; }
.section-note { margin: -4px 0 18px; color: var(--muted); font-size: 12px; }

/* Boutons et messages */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-small); color: var(--ink); background: white; font-size: 12px; font-weight: 600; line-height: 1.5; text-align: center; text-decoration: none; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-soft); }
.btn .icon { width: 17px; height: 17px; flex-basis: 17px; }
.btn-primary { color: white; border-color: var(--primary); background: var(--primary); box-shadow: 0 2px 3px rgb(31 78 120 / 12%); }
.btn-primary:hover { color: white; border-color: var(--primary-hover); background: var(--primary-hover); }
.btn-secondary { color: var(--primary); border-color: var(--line-strong); background: white; }
.btn-secondary:hover { color: var(--primary-hover); border-color: var(--blue); background: var(--primary-soft); }
.btn-ghost { color: var(--muted); border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { color: var(--ink); border-color: transparent; background: var(--primary-soft); }
.btn-danger { color: var(--danger); border-color: var(--danger-border); background: var(--danger-soft); }
.btn-danger:hover { color: var(--danger-hover); border-color: var(--danger-border); background: var(--danger-hover-soft); }
.btn-small, .btn-sm { min-height: 33px; padding: 6px 11px; font-size: 11px; }
.btn-large { min-height: 47px; padding: 12px 21px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; min-width: 38px; padding: 8px; }
button:disabled, input:disabled, select:disabled, textarea:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .6; }
.flash, .alert, .notice { margin: 0 0 20px; padding: 13px 16px; border: 1px solid var(--primary-border); border-left: 3px solid var(--primary); border-radius: 8px; color: var(--blue-ink); background: var(--primary-soft); font-size: 13px; }
.flash p:last-child, .alert p:last-child, .notice p:last-child { margin-bottom: 0; }
.flash:has(> .icon) { display: flex; align-items: flex-start; gap: 10px; }
.flash > .icon { width: 18px; height: 18px; flex-basis: 18px; margin-top: 2px; }
.flash > span { flex: 1; min-width: 0; }
.flash > form, .flash > .btn { flex-shrink: 0; margin: 0; }
.flash-success, .alert-success { color: var(--success); border-color: var(--success-border); border-left-color: var(--success); background: var(--success-bg); }
.flash-error, .alert-error { color: var(--danger); border-color: var(--danger-border); border-left-color: var(--danger); background: var(--danger-soft); }
.flash-warning, .alert-warning { color: var(--warning); border-color: var(--warning-border); border-left-color: var(--warning); background: var(--warning-soft); }
.flash-info, .alert-info { color: var(--primary); border-color: var(--primary-border); border-left-color: var(--primary); background: var(--primary-soft); }
.badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; max-width: 100%; padding: 4px 8px; border: 1px solid transparent; border-radius: 5px; color: var(--muted); background: var(--neutral-soft); font-size: 10px; font-weight: 650; line-height: 1.35; white-space: nowrap; }
.badge-new { color: var(--primary); border-color: var(--primary-border); background: var(--primary-soft); }
.badge-processing { color: var(--lavender); border-color: var(--lavender-border); background: var(--lavender-bg); }
.badge-waiting { color: var(--warning); border-color: var(--warning-border); background: var(--warning-soft); }
.badge-delivered, .badge-success, .badge-active { color: var(--success); border-color: var(--success-border); background: var(--success-bg); }
.badge-closed, .badge-neutral, .badge-inactive { color: var(--muted); border-color: var(--line); background: var(--neutral-soft); }
.badge-danger, .badge-high, .badge-urgent { color: var(--danger); border-color: var(--danger-border); background: var(--danger-soft); }
.badge-draft, .badge-internal { color: var(--warning); border-color: var(--warning-border); background: var(--warning-soft); }
.badge-admin, .badge-interne { color: var(--primary); border-color: var(--primary-border); background: var(--primary-soft); }
.badge-externe { color: var(--primary); border-color: var(--primary-border); background: var(--primary-soft); }
.badge-dot { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: currentColor; }
.badge-group { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.badge-role-admin { color: var(--lavender); border-color: var(--lavender-border); background: var(--lavender-bg); }
.badge-role-interne { color: var(--primary); border-color: var(--primary-border); background: var(--primary-soft); }
.badge-role-externe { color: var(--primary); border-color: var(--primary-border); background: var(--primary-soft); }
.badge > .icon { width: 12px; height: 12px; flex-basis: 12px; }

/* Cartes, indicateurs et tableaux */
.card { min-width: 0; margin-bottom: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 23px 17px; border-bottom: 1px solid var(--line); }
.card-header h2, .card-header h3 { margin: 0; }
.card-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.card-body { padding: 22px 23px; }
.card-body > :last-child { margin-bottom: 0; }
.card > summary.card-header { cursor: pointer; border-bottom: 0; }
.card > summary.card-header::-webkit-details-marker { display: none; }
.card > summary.card-header::after { flex-shrink: 0; margin-left: auto; color: var(--primary); font-size: 21px; font-weight: 400; line-height: 1; content: "+"; }
.card[open] > summary.card-header { border-bottom: 1px solid var(--line); }
.card[open] > summary.card-header::after { content: "−"; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 23px; border-top: 1px solid var(--line); background: var(--surface-soft); border-radius: 0 0 var(--radius) var(--radius); }
.card > .table-wrap:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.card > .table-wrap:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-bottom: 27px; }
.stat-card { position: relative; min-width: 0; padding: 20px 21px 18px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; box-shadow: var(--shadow); text-decoration: none; }
a.stat-card:hover { border-color: var(--primary-border); color: var(--ink); }
.stat-label { margin: 0 32px 14px 0; color: var(--muted); font-size: 11px; font-weight: 500; }
.stat-value { display: block; margin: 0 0 7px; color: var(--ink); font-size: 31px; font-weight: 600; line-height: 1.15; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.stat-note { margin: 0; color: var(--muted); font-size: 10px; }
.metric-icon { position: absolute; top: 19px; right: 19px; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: var(--primary); background: var(--surface-soft); }
.metric-icon .icon { width: 16px; height: 16px; flex-basis: 16px; }
.stat-new .metric-icon { color: var(--primary); background: var(--primary-soft); }
.stat-processing .metric-icon { color: var(--lavender); background: var(--lavender-bg); }
.stat-delivered .metric-icon { color: var(--success); background: var(--success-bg); }
.content-grid, .detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 308px; gap: 23px; align-items: start; }
.main-column, .side-column { min-width: 0; }
.side-column .card-header { padding: 18px 19px 15px; }
.side-column .card-body { padding: 19px; }
.side-column .card-header h2 { font-size: 15px; }
.toolbar, .filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.toolbar { margin-bottom: 20px; }
.card > .toolbar { margin: 0; padding: 17px 23px; border-bottom: 1px solid var(--line); }
.toolbar .search-field, .filters .search-field { flex: 1 1 260px; }
.toolbar input[type="search"], .filters input[type="search"] { min-width: 210px; }
.toolbar select, .filters select { width: auto; min-width: 160px; }
.toolbar .field, .filters .field { margin: 0; }
.toolbar input, .toolbar select, .filters input, .filters select { min-height: 40px; }
.search-field { position: relative; }
.search-field > .icon { position: absolute; top: 12px; left: 12px; width: 17px; height: 17px; color: var(--subtle); pointer-events: none; }
.search-field > .icon + input { padding-left: 37px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 19px; }
.filter-tab { padding: 7px 12px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); font-size: 12px; text-decoration: none; }
.filter-tab:hover { color: var(--ink); background: var(--primary-soft); }
.filter-tab.is-active, .filter-tab[aria-current="page"] { border-color: var(--primary-border); color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.table-wrap { position: relative; width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.table-wrap > table { min-width: 760px; }
th { padding: 13px 20px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--surface-soft); font-size: 10px; font-weight: 600; line-height: 1.5; text-transform: uppercase; letter-spacing: .055em; white-space: nowrap; }
td { padding: 17px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-soft); }
td a:not(.btn):not(.badge) { color: var(--ink); font-weight: 550; text-decoration: none; }
td a:not(.btn):not(.badge):hover { color: var(--primary); text-decoration: underline; }
.table-title, .dossier-title { display: block; max-width: 360px; font-size: 12px; overflow-wrap: anywhere; }
.table-title { min-width: 165px; }
.table-subtitle, .dossier-reference { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }
.table-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 5px; }
.reference { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.table-actions { flex-wrap: nowrap; }
.table-actions .btn { white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 0; padding: 16px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination-links { display: flex; align-items: center; gap: 5px; }
.pagination .btn[aria-current="page"], .pagination a[aria-current="page"] { color: white; border-color: var(--primary); background: var(--primary); }
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 48px 24px; text-align: center; }
.empty-state > .icon, .empty-icon { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; margin-bottom: 17px; padding: 14px; border: 1px solid var(--primary-border); border-radius: 15px; color: var(--primary); background: var(--primary-soft); }
.empty-state h2, .empty-state h3 { margin-bottom: 8px; font-size: 17px; }
.empty-state p { max-width: 430px; margin: 0 0 19px; color: var(--muted); font-size: 12px; }
.empty-state p:last-child { margin-bottom: 0; }
.empty-state.compact { padding: 25px 15px; }

/* Formulaires et sélection de fichiers */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 19px; row-gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin-bottom: 19px; }
.form-grid > .field { margin-bottom: 0; }
.field-full { grid-column: 1 / -1; }
label, legend { color: var(--ink); font-size: 12px; font-weight: 600; }
.field > label { display: block; }
fieldset { min-width: 0; margin: 0 0 23px; padding: 20px; border: 1px solid var(--line); border-radius: 9px; }
legend { padding: 0 7px; }
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]), select, textarea) { display: block; width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--ink); background: white; font-size: 13px; line-height: 1.5; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--subtle); opacity: 1; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(45 113 176 / 10%); }
textarea { min-height: 114px; resize: vertical; }
input[readonly], textarea[readonly] { color: var(--muted); background: var(--surface-soft) !important; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; flex: 0 0 16px; margin: 2px 0 0; accent-color: var(--primary); }
.checkbox-field { display: flex; align-items: flex-start; gap: 9px; margin: 12px 0 19px; }
.checkbox-field label { font-weight: 450; line-height: 1.6; }
label.checkbox { display: flex; align-items: flex-start; gap: 9px; font-weight: 450; }
.form-help, .field-help { margin: 0; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.65; }
.form-error, [data-upload-error] { margin: 0; color: var(--danger); font-size: 12px; }
.form-error:empty, [data-upload-error]:empty { display: none; }
.field-error input, input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger) !important; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.password-field { position: relative; }
.password-field input { padding-right: 78px !important; }
.password-field [data-password-toggle] { position: absolute; top: 5px; right: 5px; min-height: 32px; padding: 6px 9px; border: 0; border-radius: 5px; color: var(--muted); background: var(--surface-soft); font-size: 11px; }
.upload-zone, [data-upload-zone] { position: relative; margin: 8px 0 0; padding: 25px 20px; border: 1px dashed var(--line-strong); border-radius: 11px; background: var(--surface-soft); text-align: center; transition: border-color .15s, background-color .15s; }
.upload-zone:focus-within, [data-upload-zone]:focus-within { border-color: var(--primary); }
.upload-zone.is-dragging, [data-upload-zone].is-dragging { border: 2px dashed var(--primary); padding: 24px 19px; background: var(--primary-soft); box-shadow: inset 0 0 0 4px var(--surface-soft); }
.upload-zone.is-invalid, [data-upload-zone].is-invalid { border-color: var(--danger); background: var(--danger-soft); }
.upload-zone > .icon, [data-upload-zone] > .icon, .upload-icon { width: 31px; height: 31px; margin-bottom: 11px; color: var(--primary); }
.upload-zone h3, [data-upload-zone] h3 { margin-bottom: 7px; font-size: 13px; }
.upload-zone p, [data-upload-zone] p { margin-bottom: 10px; color: var(--muted); font-size: 11px; }
.upload-zone label, [data-upload-zone] label { display: block; margin-bottom: 10px; }
.upload-zone input[type="file"], [data-upload-zone] input[type="file"] { width: min(100%, 420px); margin: 0 auto 10px; padding: 5px; background: white; font-size: 11px; }
input[type="file"]::file-selector-button { margin-right: 10px; padding: 10px 14px; border: 1px solid transparent; border-radius: 8px; color: var(--orange-ink); background: var(--orange); box-shadow: 0 2px 5px rgb(205 139 42 / 16%); font: 650 12px/1.5 var(--font); cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--orange-hover); }
.selected-files, [data-file-list] { margin: 13px 0 0; padding: 0; list-style: none; text-align: left; }
.selected-files:empty, [data-file-list]:empty { display: none; }
.selected-file { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: white; font-size: 11px; }
.selected-file + .selected-file { margin-top: 6px; }
.selected-file-name { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.selected-file-size { flex-shrink: 0; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.selected-file.is-invalid { color: var(--danger); border-color: var(--danger-border); background: var(--danger-soft); }
.selected-file-summary { margin-top: 9px; color: var(--muted); font-size: 11px; }
.upload-note { padding: 13px 0 0; color: var(--muted); font-size: 11px; }
.upload-formats { max-width: 460px; margin: 11px auto 0; color: var(--muted); font-size: 10px; }
.upload-formats summary { width: fit-content; margin: 0 auto; cursor: pointer; text-underline-offset: 3px; }
.upload-formats summary:hover { color: var(--primary); }
.upload-formats p { margin: 9px 0 0; font-size: 10px; }

/* Dossier, fichiers, suivi et conversations */
.meta-list { display: grid; grid-template-columns: minmax(95px, .9fr) minmax(0, 1.1fr); gap: 12px 14px; margin: 0; font-size: 12px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { min-width: 0; margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.meta-list dd .badge { vertical-align: middle; }
.meta-list > div { grid-column: 1 / -1; min-width: 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.meta-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.meta-list > div > dt { margin-bottom: 4px; font-size: 10px; }
.meta-list dd > small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.prose { font-size: 13px; line-height: 1.85; overflow-wrap: anywhere; }
.dossier-description { color: var(--ink); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.status-steps, .stepper { display: flex; align-items: stretch; gap: 0; margin: 0 0 24px; padding: 0; list-style: none; }
.status-step, .step { position: relative; min-width: 0; flex: 1; padding: 0 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.status-step::before, .step::before { position: relative; z-index: 1; display: block; width: 11px; height: 11px; margin-bottom: 11px; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--canvas); content: ""; }
.status-step::after, .step::after { position: absolute; top: 5px; right: 0; left: 11px; height: 1px; background: var(--line); content: ""; }
.status-step:last-child::after, .step:last-child::after { display: none; }
.status-step.is-complete::before, .step.is-complete::before { border-color: var(--blue); background: var(--blue); }
.status-step.is-complete::after, .step.is-complete::after { background: var(--blue-soft); }
.status-step.is-current, .step.is-current { color: var(--primary); font-weight: 650; }
.status-step.is-current::before, .step.is-current::before { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 4px var(--blue-soft); }
.status-step .step-number, .step .step-number { display: none; }
.status-step span, .step span { display: block; }
.file-list { margin: 0; padding: 0; list-style: none; }
.card > .file-list { padding: 19px 23px; }
.file-item { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.file-item:first-child { padding-top: 0; }
.file-item:last-child { padding-bottom: 0; border-bottom: 0; }
.file-icon { display: flex; align-items: center; justify-content: center; width: 39px; height: 43px; flex: 0 0 39px; border: 1px solid var(--line); border-radius: 8px; color: var(--primary); background: var(--surface-soft); }
.file-icon .icon { width: 19px; height: 19px; }
.file-icon:has(> small) { flex-direction: column; gap: 3px; height: 48px; }
.file-icon small { font-size: 8px; font-weight: 700; line-height: 1; }
.file-extension { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.file-info, .file-details { min-width: 0; flex: 1; }
.file-name { display: block; color: var(--ink); font-size: 12px; font-weight: 550; overflow-wrap: anywhere; text-decoration: none; }
a.file-name:hover { color: var(--primary); text-decoration: underline; }
.file-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; margin-top: 5px; color: var(--muted); font-size: 10px; }
.file-item > .btn, .file-actions { margin-left: auto; flex-shrink: 0; }
.file-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.file-info > p { margin: 5px 0 0; font-size: 10px; }
.result-published { border-color: var(--success-border); }
.result-published > .card-header { background: var(--success-bg); border-radius: var(--radius) var(--radius) 0 0; }
.result-banner, .delivery-banner { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; padding: 18px 21px; border: 1px solid var(--success-border); border-radius: 11px; color: var(--success); background: var(--success-bg); }
.result-banner h2, .delivery-banner h2 { margin-bottom: 5px; color: var(--success); font-size: 15px; }
.result-banner p, .delivery-banner p { margin-bottom: 0; font-size: 12px; }
.delivery-panel { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 15px; padding: 19px; border: 1px solid var(--success-border); border-radius: 10px; background: var(--success-bg); }
.delivery-panel > div { min-width: 0; flex: 1 1 270px; }
.delivery-panel h3 { margin-bottom: 7px; color: var(--success); font-size: 13px; }
.delivery-panel p { margin: 0; color: var(--success-muted); font-size: 11px; line-height: 1.7; }
.delivery-panel > form { margin: 0; }
.receipt-card { border-color: var(--success-border); background: var(--success-bg); }
.receipt-card p { font-size: 12px; color: var(--success-muted); }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline-item { position: relative; margin-left: 5px; padding: 0 0 22px 22px; border-left: 1px solid var(--blue-soft); }
.timeline-item::before { position: absolute; top: 5px; left: -4px; width: 7px; height: 7px; border: 2px solid white; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); content: ""; }
.timeline-item:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline-item p { margin: 0 0 4px; color: var(--ink); font-size: 11px; overflow-wrap: anywhere; }
.timeline-item time, .timeline-meta { color: var(--muted); font-size: 10px; }
.timeline-item > .text-small { font-size: 10px; }
.timeline-item > small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.timeline-item > strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 11px; font-weight: 600; }
.info-panel { display: flex; align-items: flex-start; gap: 10px; padding: 3px 5px; color: var(--muted); }
.info-panel > .icon { width: 17px; height: 17px; flex-basis: 17px; margin-top: 1px; }
.info-panel p { margin: 0; font-size: 11px; line-height: 1.7; }
.message-list { display: flex; flex-direction: column; gap: 15px; margin: 0 0 21px; }
.card > .message-list { padding: 21px 23px 0; }
.message { padding: 16px 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.message.is-internal { border-color: var(--warning-border); background: var(--warning-soft); }
.message-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; font-size: 11px; }
.message-author { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--ink); font-weight: 650; }
.message time, .message-meta { color: var(--muted); font-size: 10px; }
.message-body { margin: 0; color: var(--ink); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-header > .avatar + div { min-width: 0; margin-right: auto; }
.message-role { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.message-body:has(br) { white-space: normal; }
.message-form { border-top: 1px solid var(--line); }
.message-form .checkbox-field { margin: 0 auto 0 0; color: var(--muted); font-size: 11px; font-weight: 400; }
.message-form .form-actions { margin-top: 0; padding-top: 0; border-top: 0; }
.notification-item { display: flex; align-items: flex-start; gap: 13px; padding: 19px 0; border-bottom: 1px solid var(--line); }
.notification-item:last-child { border-bottom: 0; }
.notification-item.is-unread { padding-right: 13px; padding-left: 13px; border-radius: 8px; background: var(--primary-soft); }
.notification-item h3 { margin-bottom: 5px; font-size: 13px; }
.notification-item p { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.notification-item time { color: var(--muted); font-size: 10px; }
.notification-dot { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 7px; border-radius: 50%; background: var(--primary); }
.notification-list { padding: 6px 22px; }
.notification-item.is-unread { margin: 10px -10px; }
.notification-icon { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 34px; border: 1px solid var(--primary-border); border-radius: 9px; color: var(--primary); background: var(--surface-soft); }
.notification-icon .icon { width: 16px; height: 16px; }
.notification-body { min-width: 0; flex: 1; }
.notification-body h2 { margin: 0 0 6px; font-size: 13px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.notification-body h2 a { color: var(--ink); text-decoration: none; }
.notification-body h2 a:hover { color: var(--primary); text-decoration: underline; }
.notification-body p { overflow-wrap: anywhere; }
.notification-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.role-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 27px 1px 6px; }
.role-guide article { min-width: 0; padding: 0 12px; border-left: 2px solid var(--line); }
.role-guide p { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.profile-heading { display: flex; align-items: center; gap: 14px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.profile-heading > div { min-width: 0; }
.profile-heading h3 { margin: 0 0 5px; overflow-wrap: anywhere; }
.profile-heading p { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.storage-value { font-size: 28px; font-weight: 550; letter-spacing: -.05em; line-height: 1.2; }
.storage-progress { display: block; width: 100%; height: 7px; border: 0; border-radius: 4px; appearance: none; color: var(--primary); background: var(--neutral-soft); overflow: hidden; }
.storage-progress::-webkit-progress-bar { border-radius: 4px; background: var(--neutral-soft); }
.storage-progress::-webkit-progress-value { border-radius: 4px; background: var(--primary); }
.storage-progress::-moz-progress-bar { border-radius: 4px; background: var(--primary); }
.audit-details { max-width: 370px; font-size: 11px; }
.audit-details summary { color: var(--primary); cursor: pointer; }
.audit-details pre { max-height: 230px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 10px; }

/* Connexion minimale : deux champs et un bouton. */
.login-page { min-height: 100dvh; background: var(--canvas); }
.login-shell { display: grid; min-height: 100dvh; place-items: center; padding: 28px 20px; }
.login-card { position: relative; width: 100%; max-width: 370px; padding: 35px 29px 29px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 26px rgb(22 51 91 / 8%); }
.login-card::before { position: absolute; top: -1px; right: -1px; left: -1px; height: 5px; border-radius: 12px 12px 0 0; background: linear-gradient(100deg, var(--navy), var(--blue)); content: ""; }
.login-form.stack { gap: 17px; }
.login-form .field { gap: 6px; margin: 0; }
.login-form input:not([type="hidden"]) { min-height: 45px; padding: 11px 13px; border-radius: 9px; font-size: 14px; }
.login-form input::placeholder { color: var(--muted); }
.login-form .btn { width: 100%; min-height: 45px; margin-top: 3px; border-radius: 9px; font-size: 13px; }
.login-card .flash { margin-bottom: 19px; padding: 11px 12px; font-size: 12px; }

/* Récupération d’accès et installation */
.auth-layout { display: grid; grid-template-columns: minmax(330px, .9fr) minmax(440px, 1.1fr); min-height: 100dvh; }
.auth-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 47px clamp(28px, 5vw, 78px); overflow: hidden; color: var(--inverse-soft); background: linear-gradient(145deg, var(--navy), var(--primary), var(--blue)); }
.auth-aside::after { position: absolute; right: -145px; bottom: -190px; width: 470px; height: 470px; border: 1px solid rgb(154 199 239 / 11%); border-radius: 50%; box-shadow: 0 0 0 67px rgb(154 199 239 / 4%), 0 0 0 133px rgb(154 199 239 / 3%); content: ""; pointer-events: none; }
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside .brand { padding: 0; color: white; }
.auth-aside .brand img { width: 44px; height: 44px; flex-basis: 44px; }
.auth-aside h1, .auth-aside h2 { max-width: 400px; margin: 42px 0 20px; color: var(--inverse); font-size: clamp(29px, 3.5vw, 44px); font-weight: 550; letter-spacing: -.045em; line-height: 1.22; }
.auth-aside p { max-width: 390px; font-size: 13px; line-height: 1.85; }
.auth-aside .page-eyebrow { color: var(--inverse-accent); }
.auth-aside small { color: var(--inverse-muted); font-size: 11px; }
.auth-features { display: grid; gap: 18px; margin: 30px 0 40px; padding: 0; list-style: none; }
.auth-features li { display: flex; align-items: center; gap: 12px; color: var(--inverse-soft); font-size: 12px; }
.auth-features .icon { color: var(--inverse-accent); }
.auth-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 32px; }
.auth-card { width: 100%; max-width: 430px; }
.auth-card > .brand { padding: 0; margin-bottom: 30px; }
.auth-card h1 { margin-bottom: 10px; font-size: 29px; }
.auth-card h2 { margin-bottom: 12px; font-size: 28px; line-height: 1.3; }
.auth-card > p { margin-bottom: 29px; font-size: 13px; }
.auth-kicker { display: block; margin-bottom: 13px; color: var(--primary); font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.auth-card .page-subtitle { margin-bottom: 30px; font-size: 13px; }
.auth-card .field { margin-bottom: 19px; }
.auth-card form.stack > .field { margin-bottom: 0; }
.auth-card .stack { gap: 22px; }
.auth-card form > .btn-primary { width: 100%; min-height: 45px; margin-top: 7px; }
.auth-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 22px; text-align: center; font-size: 12px; }
.auth-footer { margin-top: 35px; color: var(--muted); font-size: 11px; text-align: center; }
.auth-note { margin-top: 25px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; font-size: 11px; }
.auth-note strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 12px; }
.auth-intro .eyebrow { display: block; color: var(--inverse-accent); font-size: 9px; font-weight: 650; letter-spacing: .13em; }
.auth-intro h1 { margin-top: 20px; }
.auth-workflow { display: grid; gap: 19px; margin: 18px 0 30px; }
.auth-workflow-step { display: flex; align-items: center; gap: 13px; }
.auth-workflow-icon { display: flex; align-items: center; justify-content: center; width: 37px; height: 37px; flex: 0 0 37px; border: 1px solid var(--sidebar-line); border-radius: 9px; color: var(--inverse-accent); background: var(--sidebar-surface); }
.auth-workflow-icon .icon { width: 18px; height: 18px; flex-basis: 18px; }
.auth-workflow-step strong { display: block; color: var(--inverse-soft); font-size: 12px; font-weight: 550; }
.auth-workflow-step small { display: block; margin-top: 3px; color: var(--inverse-muted); font-size: 10px; }
.auth-aside .auth-footnote { display: flex; align-items: flex-start; gap: 8px; max-width: none; margin: 0; color: var(--inverse-muted); font-size: 9px; }
.auth-footnote .icon { width: 14px; height: 14px; flex-basis: 14px; margin-top: 2px; }
.auth-help { margin-top: 29px; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.auth-help strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 11px; }
.auth-help p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.75; }
.auth-copyright { position: absolute; right: 20px; bottom: 22px; left: 20px; margin: 0; color: var(--muted); font-size: 10px; text-align: center; }
.auth-back { margin-top: 25px; font-size: 12px; }
.auth-back a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.auth-back .icon { width: 16px; height: 16px; }
.auth-page > .auth-card { max-width: 530px; margin: 12vh auto; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.installer-shell { max-width: 820px; margin: 0 auto; padding: 34px 24px 48px; }
.installer-shell > .brand { justify-content: center; margin-bottom: 26px; color: var(--ink); }
.installer-shell .brand-subtitle, .installer-shell .brand small { color: var(--muted); }
.installer-card { position: relative; padding: 30px 33px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 6px 22px rgb(22 51 91 / 6%); }
.installer-card::before { position: absolute; top: -1px; right: -1px; left: -1px; height: 5px; border-radius: 12px 12px 0 0; background: linear-gradient(100deg, var(--navy), var(--blue)); content: ""; }
.installer-card h1 { margin-bottom: 10px; font-size: 26px; }
.installer-card .page-subtitle { margin-bottom: 27px; }
.installer-card .stepper { margin-bottom: 31px; }
.installer-card .step::before { background: white; }
.installer-card .step.is-current::before { background: var(--primary); }
.installer-card .step.is-complete::before { background: var(--blue); }
.installer-card .card { margin-top: 23px; box-shadow: none; }
.installer-card form > h2 { margin: 27px 0 16px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 16px; }
.installer-card form > h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.installer-footer { margin-top: 20px; color: var(--muted); font-size: 11px; text-align: center; }
.check-list { display: flex; flex-direction: column; gap: 0; margin: 0 0 25px; padding: 0; list-style: none; }
.check-list li { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.check-list li:last-child { border-bottom: 0; }
.installation-success { padding: 20px 0 12px; text-align: center; }
.installation-success > .icon { width: 58px; height: 58px; padding: 15px; margin-bottom: 18px; border-radius: 50%; color: var(--success); background: var(--success-bg); }
.installation-success h1 { margin-bottom: 14px; }
.installation-success p { color: var(--muted); }
.installation-success .btn { margin-top: 14px; }
.security-note { display: flex; align-items: flex-start; gap: 9px; padding: 14px; border-radius: 8px; color: var(--blue-ink); background: var(--blue-panel); font-size: 11px; }
.security-note .icon { width: 16px; height: 16px; flex-basis: 16px; margin-top: 2px; }
.security-note p { margin-bottom: 0; }
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 85dvh; padding: 35px 24px; text-align: center; }
.error-page .brand { margin-bottom: 32px; }
.error-page h1 { font-size: 27px; }
.error-page p { max-width: 480px; color: var(--muted); }
.error-code { margin-bottom: 10px; color: var(--blue); font-size: 60px; font-weight: 650; line-height: 1.2; letter-spacing: -.05em; }


/* Écrans quotidiens : les fichiers et les deux actions restent au premier plan. */
.simple-workspace { width: 100%; max-width: 1060px; }
.simple-workspace .card { margin-bottom: 17px; }
.simple-workspace .card-header { padding: 17px 22px; }
.simple-workspace .card-header h2 { font-size: 15px; }
.simple-workspace .card-header h2 > .icon { width: 17px; height: 17px; margin-right: 4px; }
.simple-workspace .card-body { padding: 22px; }
.quick-card { border-top: 3px solid var(--orange); }
.quick-card > .card-body { padding-top: 26px; padding-bottom: 20px; }
.quick-options { margin: 0; }
.quick-options > summary { width: fit-content; padding: 3px 0; color: var(--muted); font-size: 12px; cursor: pointer; }
.quick-options > summary:hover { color: var(--primary); }
.options-body { padding-top: 20px; }
.quick-options .field label { font-size: 12px; }
.upload-zone.upload-simple { margin: 0; padding: 0; border: 0; border-radius: 9px; background: transparent; text-align: left; }
.upload-zone.upload-simple.is-dragging { padding: 0; outline: 2px dashed var(--primary); outline-offset: 10px; background: var(--primary-soft); box-shadow: none; }
.upload-zone.upload-simple.is-invalid { background: transparent; }
.attach-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.attach-input { position: relative; min-width: 0; }
.upload-simple .attach-input > .attach-label { display: inline-flex; min-width: 145px; min-height: 49px; margin: 0 0 10px; padding: 12px 25px; border-color: var(--orange); color: var(--orange-ink); background: var(--orange); font-size: 14px; cursor: pointer; }
.upload-simple .attach-input > .attach-label .icon { width: 19px; height: 19px; }
.upload-simple .attach-input:hover > .attach-label { border-color: var(--orange-hover); background: var(--orange-hover); }
.upload-simple .attach-input input[type="file"] { width: min(100%, 420px); margin: 0; }
.upload-simple.upload-enhanced .attach-input > .attach-label { margin-bottom: 0; }
.upload-simple.upload-enhanced .attach-input input[type="file"] { position: absolute; z-index: 1; inset: 0; display: block; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.upload-simple.upload-enhanced .attach-input:focus-within > .attach-label { outline: 3px solid var(--focus); outline-offset: 4px; }
.upload-simple .validate-button { min-height: 49px; min-width: 160px; padding: 12px 23px; font-size: 13px; letter-spacing: .025em; }
.upload-simple .selected-files { margin-top: 18px; }
.upload-simple .selected-file { gap: 12px; min-height: 48px; padding: 7px 9px 7px 14px; background: var(--surface-soft); border-color: var(--line); font-size: 12px; }
.upload-simple .selected-file.is-invalid { border-color: var(--danger-border); background: var(--danger-soft); }
.selected-file-remove { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 21px; line-height: 1; }
.selected-file-remove:hover { color: var(--danger); background: var(--danger-soft); }
.upload-simple .selected-file-summary { margin: 10px 0 0; font-size: 11px; }
.upload-simple .upload-error { margin: 12px 0 0; color: var(--danger); font-size: 12px; }
.upload-progress { width: 100%; min-width: 0; margin-top: 16px; padding: 13px 14px; border: 1px solid var(--primary-border); border-left: 3px solid var(--orange); border-radius: 9px; color: var(--primary); background: var(--primary-soft); }
.upload-progress-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 12px; }
.upload-progress-heading > span { min-width: 0; overflow-wrap: anywhere; }
.upload-progress-heading > strong { flex-shrink: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.upload-progress > progress { display: block; width: 100%; height: 8px; border: 0; border-radius: 4px; appearance: none; overflow: hidden; color: var(--primary); background: var(--surface); }
.upload-progress > progress::-webkit-progress-bar { border-radius: 4px; background: var(--surface); }
.upload-progress > progress::-webkit-progress-value { border-radius: 4px; background: var(--primary); }
.upload-progress > progress::-moz-progress-bar { border-radius: 4px; background: var(--primary); }
.upload-progress-bytes { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.upload-progress-feedback { margin: 10px 0 0; color: var(--danger); font-size: 12px; overflow-wrap: anywhere; }
.upload-progress-check { display: inline-block; max-width: 100%; margin-top: 10px; font-size: 12px; overflow-wrap: anywhere; }
.upload-progress.is-error { border-color: var(--danger-border); border-left-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
form.is-uploading .attach-input, form.is-uploading .selected-file-remove { opacity: .55; cursor: not-allowed; }
form.is-uploading .attach-input > .attach-label, form.is-uploading .attach-input input[type="file"] { cursor: not-allowed; }
form.is-uploading .attach-input:hover > .attach-label { border-color: var(--orange); background: var(--orange); }
.search-options { border-bottom: 1px solid var(--line); }
.search-options > summary { display: flex; align-items: center; gap: 8px; min-height: 55px; padding: 14px 21px; color: var(--muted); cursor: pointer; font-size: 12px; list-style: none; }
.search-options > summary::-webkit-details-marker { display: none; }
.search-options > summary > .icon { width: 16px; height: 16px; }
.search-options > summary::after { margin-left: auto; content: "+"; font-size: 19px; }
.search-options[open] > summary::after { content: "−"; }
.search-options > .toolbar { margin: 0; padding: 0 21px 18px; }
.simple-dossier-list { list-style: none; padding: 0; margin: 0; }
.simple-dossier-item { display: flex; align-items: center; gap: 15px; padding: 17px 21px; border-bottom: 1px solid var(--line); }
.simple-dossier-item:last-child { border-bottom: 0; }
.simple-dossier-item:hover { background: var(--surface-soft); }
.dossier-main-link { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; color: var(--ink); text-decoration: none; }
.dossier-row-icon { display: flex; align-items: center; justify-content: center; flex: 0 0 39px; width: 39px; height: 42px; border-radius: 9px; color: var(--primary); background: var(--primary-soft); }
.dossier-row-name { min-width: 0; }
.dossier-row-name > strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.dossier-row-name > small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.dossier-row-status { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.dossier-open { flex-shrink: 0; }
.quiet-empty { margin: 0; padding: 25px 22px; color: var(--muted); font-size: 13px; }
.dossier-state { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: -5px 0 20px; }
.dossier-state > form { margin: 0; }
.dossier-owner { margin-left: 5px; color: var(--muted); font-size: 12px; }
.file-metadata { margin-top: 5px; color: var(--muted); font-size: 11px; }
.file-metadata > summary { width: fit-content; cursor: pointer; }
.file-metadata > div { padding-top: 6px; font-size: 11px; }
.simple-workspace .file-card > .file-transfer, .receipt-actions { border-top: 1px solid var(--line); }
.simple-workspace .file-card > .card-header + .file-transfer { border-top: 0; }
.staff-source-options { border-top: 1px solid var(--line); }
.staff-source-options > summary { padding: 14px 22px; color: var(--muted); font-size: 12px; cursor: pointer; }
.staff-source-options > .card-body { padding-top: 8px; }
.transfer-note { margin: 0 0 15px; color: var(--muted); font-size: 12px; }
.management-form + .management-form { padding-top: 24px; border-top: 1px solid var(--line); }
.management-form > .btn { align-self: flex-start; }
.simple-workspace .form-actions { margin-top: 0; padding-top: 15px; }
.simple-workspace .card > .message-list { padding-top: 17px; }
@media (max-width: 520px) {
  .simple-workspace .card-header { padding: 16px; }
  .simple-workspace .card-body { padding: 18px 16px; }
  .attach-row { gap: 10px; }
  .attach-row > .attach-input, .attach-row > .validate-button { flex: 1 1 0; min-width: 0; }
  .upload-simple .attach-input > .attach-label { min-width: 0; width: 100%; min-height: 47px; padding: 11px 12px; font-size: 13px; }
  .upload-simple .validate-button { min-height: 47px; min-width: 0; padding: 11px 10px; font-size: 12px; }
  .upload-simple .selected-file { gap: 8px; padding-left: 10px; }
  .selected-file-size { font-size: 10px; }
  .search-options > summary { padding-right: 16px; padding-left: 16px; }
  .search-options > .toolbar { padding-right: 16px; padding-left: 16px; }
  .simple-dossier-item { position: relative; flex-wrap: wrap; gap: 9px; padding: 15px 16px; }
  .dossier-main-link { flex: 1 1 calc(100% - 42px); }
  .dossier-row-status { order: 3; justify-content: flex-start; width: 100%; padding-left: 51px; }
  .dossier-row-name > strong { font-size: 12px; }
  .dossier-open { width: 31px; padding: 6px; }
  .quiet-empty { padding: 22px 16px; }
  .simple-workspace .file-actions { margin-left: 0; flex-basis: 100%; width: 100%; max-width: 100%; }
  .simple-workspace .file-actions > .btn-secondary { flex: 1; }
}

/* Responsive et accessibilité */
@media (max-width: 620px) {
  .topbar-simple-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 14px 10px; }
  .topbar-simple .topbar-brand { gap: 9px; font-size: 16px; }
  .topbar-simple .topbar-brand img { width: 33px; height: 33px; flex-basis: 33px; }
  .topbar-simple .topbar-actions { grid-column: 2; grid-row: 1; gap: 6px; }
  .topbar-navigation { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .topbar-navigation > form, .topbar-navigation .btn { min-width: 0; width: 100%; }
  .topbar-navigation .btn { min-height: 43px; padding: 10px 9px; gap: 6px; }
}
@media (min-width: 1680px) {
  .main-content { --space-right: max(44px, calc((100vw - 1500px) / 2)); --space-left: max(44px, calc((100vw - 1660px) / 2)); }
}
@media (max-width: 1199px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar { padding-right: 14px; padding-left: 14px; }
  .brand { font-size: 16px; }
  .main-content { --space-right: 25px; --space-left: 25px; }
  .content-grid, .detail-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
  .stats-grid { gap: 12px; }
  .stat-card { padding: 18px 16px; }
  .metric-icon { top: 16px; right: 13px; }
  th, td { padding-right: 15px; padding-left: 15px; }
}
@media (max-width: 1010px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .side-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
  .side-column > .card { margin-bottom: 0; }
  .side-column > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .page-header { gap: 16px; }
  .page-actions { max-width: 240px; justify-content: flex-end; }
  .auth-aside { padding-right: 33px; padding-left: 33px; }
}
@media (max-width: 780px) {
  .app-shell { display: block; }
  .sidebar { position: relative; width: 100%; height: auto; min-height: 0; padding: 20px; }
  .sidebar > .brand { margin-bottom: 20px; }
  .sidebar .nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .sidebar .nav-label, .sidebar .nav-section-title { grid-column: 1 / -1; margin-top: 12px; }
  .sidebar-footer { padding-top: 20px; }
  .sidebar-note { display: none; }
  .nav-enhanced .sidebar { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: min(300px, 85vw); height: 100dvh; padding: 57px 19px 20px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 12px 0 30px rgb(0 0 0 / 12%); visibility: hidden; }
  .nav-enhanced .sidebar .nav { display: flex; }
  .nav-enhanced .sidebar.is-open { transform: translateX(0); visibility: visible; }
  .nav-enhanced .sidebar > .brand { margin-bottom: 30px; }
  .nav-enhanced .sidebar-close { position: absolute; top: 12px; right: 13px; display: block; padding: 7px 9px; border: 1px solid rgb(255 255 255 / 14%); border-radius: 6px; color: var(--inverse-soft); background: transparent; font-size: 11px; }
  .nav-enhanced .sidebar-close:hover { background: rgb(255 255 255 / 8%); }
  .nav-enhanced .topbar .nav-toggle, .nav-enhanced .topbar [data-nav-toggle] { display: inline-flex; flex-shrink: 0; }
  .nav-enhanced .nav-backdrop.is-visible { position: fixed; z-index: 40; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: rgb(15 33 57 / 42%); }
  body.nav-open { overflow: hidden; }
  .main-content { --space-right: 21px; --space-left: 21px; padding: 0 var(--space-right) 28px var(--space-left); }
  .topbar { min-height: 69px; margin-bottom: 23px; }
  .page-header { flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
  .page-actions { max-width: none; padding-top: 0; justify-content: flex-start; }
  .page-title { font-size: 26px; }
  .auth-layout { display: block; }
  .auth-aside { padding: 24px 27px; }
  .auth-aside::after { display: none; }
  .auth-aside h1, .auth-aside h2 { max-width: none; margin: 24px 0 10px; font-size: 26px; }
  .auth-aside p { max-width: none; margin-bottom: 0; font-size: 12px; }
  .auth-aside .auth-features, .auth-aside > small, .auth-aside .auth-aside-footer { display: none; }
  .auth-aside .auth-workflow, .auth-aside .auth-footnote, .auth-intro .eyebrow { display: none; }
  .auth-main { padding: 34px 24px 42px; }
  .auth-card { max-width: 450px; }
  .auth-copyright { position: static; margin: 29px 0 0; }
  .installer-shell { padding-top: 24px; }
  .installer-card { padding: 26px; }
}
@media (max-width: 520px) {
  body { font-size: 13px; }
  .main-content { --space-right: 15px; --space-left: 15px; }
  .topbar { gap: 9px; }
  .topbar-left, .topbar-right { gap: 8px; }
  .topbar-start, .topbar-actions { gap: 6px; }
  .topbar-user > div { display: none; }
  .breadcrumb { font-size: 11px; gap: 5px; }
  .breadcrumb .icon { display: none; }
  .page-header { margin-bottom: 20px; }
  .page-title { font-size: 25px; }
  .page-subtitle { font-size: 12px; }
  .page-actions { width: 100%; }
  .page-actions > .btn-primary { flex: 1; }
  .stats-grid { gap: 10px; margin-bottom: 20px; }
  .stat-card { padding: 17px 13px 14px; }
  .stat-label { margin-right: 0; margin-bottom: 14px; font-size: 10px; }
  .stat-value { font-size: 28px; }
  .stat-note { font-size: 9px; }
  .metric-icon { display: none; }
  .card { margin-bottom: 18px; border-radius: 11px; }
  .card-header, .side-column .card-header { padding: 17px 16px 14px; }
  .card-header { flex-wrap: wrap; gap: 10px; }
  .card-header h2 { font-size: 16px; }
  .card-body, .side-column .card-body { padding: 18px 16px; }
  .card > .toolbar { padding: 15px 16px; }
  .card > .file-list { padding: 17px 16px; }
  .card > .message-list { padding: 17px 16px 0; }
  .card-footer { padding: 14px 16px; flex-wrap: wrap; }
  .side-column { display: block; }
  .side-column > .card { margin-bottom: 18px; }
  .toolbar, .filters { align-items: stretch; }
  .toolbar > input, .toolbar > select, .toolbar .field, .filters > input, .filters > select, .filters .field { flex: 1 1 140px; min-width: 0; }
  .toolbar .search-field, .filters .search-field { flex-basis: 100%; min-width: 0; }
  .toolbar > input[type="search"], .filters > input[type="search"] { flex-basis: 100%; }
  .toolbar input[type="search"], .filters input[type="search"] { min-width: 0; }
  .toolbar select, .filters select { min-width: 0; }
  .form-grid { grid-template-columns: minmax(0, 1fr); row-gap: 17px; }
  .form-actions > .btn { flex: 1 1 auto; }
  .upload-zone, [data-upload-zone] { padding: 20px 13px; }
  .upload-zone.is-dragging, [data-upload-zone].is-dragging { padding: 19px 12px; }
  .file-item { flex-wrap: wrap; gap: 10px; }
  .file-item > .btn, .file-actions { margin-left: 49px; }
  .file-actions { flex: 0 1 calc(100% - 49px); flex-direction: row; align-items: center; flex-wrap: wrap; width: calc(100% - 49px); min-width: 0; max-width: calc(100% - 49px); }
  .file-actions > form { min-width: 0; max-width: 100%; margin: 0; }
  .file-actions .btn { max-width: 100%; }
  .file-item .file-info, .file-item .file-details { min-width: calc(100% - 55px); }
  .file-name { font-size: 11px; }
  .status-step, .step { padding-right: 7px; font-size: 9px; }
  .message { padding: 13px; }
  .message-header time { margin-left: 38px; }
  .flash:has(> .icon) { flex-wrap: wrap; }
  .flash > form, .flash > .btn { margin-left: 28px; }
  .notification-list { padding: 5px 15px; }
  .notification-item { flex-wrap: wrap; gap: 11px; }
  .notification-body { min-width: calc(100% - 45px); }
  .notification-body .split-header { flex-wrap: wrap; gap: 5px; }
  .notification-actions { flex-direction: row; flex-wrap: wrap; align-items: center; margin-left: 45px; }
  .role-guide { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .meta-list { grid-template-columns: 1fr 1.3fr; gap: 11px 10px; }
  .pagination { padding: 13px 15px; }
  .auth-aside { padding: 22px; }
  .auth-aside h1, .auth-aside h2 { font-size: 24px; }
  .auth-main { padding: 29px 22px 36px; }
  .auth-card h1 { font-size: 25px; }
  .auth-card h2 { font-size: 25px; }
  .auth-card .split-header { gap: 8px; }
  .auth-card .split-header a { font-size: 11px; }
  .auth-page > .auth-card { width: calc(100% - 30px); padding: 23px; }
  .login-shell { padding: 22px 18px; }
  .login-card { padding: 32px 23px 25px; }
  .installer-shell { padding: 23px 14px 35px; }
  .installer-shell > .brand { margin-bottom: 22px; }
  .installer-card { padding: 23px 18px; border-radius: 12px; }
  .installer-card h1 { font-size: 23px; }
  .installer-card .stepper { margin-bottom: 27px; }
  .installer-card fieldset { padding: 15px; }
  .check-list li { align-items: flex-start; }
  .check-list .badge { flex-shrink: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  body { background: white; font-size: 11px; }
  .app-shell { display: block; }
  .sidebar, .topbar, .nav-backdrop, .page-actions, .form-actions, .toolbar, .filters, .pagination, form, .btn, .skip-link { display: none !important; }
  .main-content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .content-grid, .detail-grid { display: block; }
  .side-column { display: block; }
  .table-wrap { overflow: visible; }
  a { color: inherit; text-decoration: none; }
  .badge { print-color-adjust: exact; }
}
