/* Comptonet — Design tokens source artifact
   Source : document_2_tokens_v03.docx
   Système : base 4px, palette 5 familles, Inter + JetBrains Mono */

:root {
  /* === COULEURS === */
  /* Slate — colonne vertébrale */
  --slate-0:   #FFFFFF;
  --slate-50:  #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  /* Blue — retained technical scale for existing components */
  --blue-50:  #EFF6FF;
  --blue-100: #DBEAFE;
  --blue-200: #BFDBFE;
  --blue-500: #3B82F6;
  --blue-700: #1D4ED8;
  --blue-800: #1E40AF;
  --blue-900: #1E3A8A;
  --blue-950: #172554;

  /* Comptonet brand */
  --brand-primary: #3D47D6;
  --brand-accent: #4F68F2;
  --brand-deep: #10182A;

  /* Sémantiques sobres */
  --green-50:  #F0FDF4;
  --green-100: #DCFCE7;
  --green-700: #15803D;
  --green-800: #166534;

  --amber-50:  #FFFBEB;
  --amber-100: #FEF3C7;
  --amber-700: #B45309;
  --amber-800: #92400E;

  --red-50:    #FEF2F2;
  --red-100:   #FEE2E2;
  --red-700:   #B91C1C;
  --red-800:   #991B1B;

  --violet-100: #E4E4FB;
  --violet-700: #4338CA;

  /* Rôles sémantiques */
  --surface-page:    var(--slate-50);
  --surface-card:    var(--slate-0);
  --surface-sunken:  var(--slate-100);
  --surface-overlay: var(--slate-0);

  --text-primary:    var(--slate-900);
  --text-secondary:  var(--slate-700);
  --text-tertiary:   var(--slate-500);
  --text-on-primary: var(--slate-0);

  --border-subtle:   var(--slate-200);
  --border-strong:   var(--slate-300);

  --action-primary:        var(--brand-primary);
  --action-primary-hover:  var(--brand-deep);

  --surface-navigation: var(--brand-deep);
  --surface-navigation-strong: var(--brand-deep);
  --surface-navigation-active: rgba(255, 255, 255, 0.09);
  --text-navigation: var(--slate-300);
  --text-navigation-active: var(--slate-0);
  --border-navigation: rgba(255, 255, 255, 0.12);
  --surface-selection: #F0F2FF;
  --border-selection: var(--brand-primary);
  --proof-present: var(--slate-700);
  --proof-missing: var(--slate-400);
  --layout-sidebar-width: 248px;
  --layout-detail-panel-width: 320px;
  --layout-content-gap: var(--space-6);
  --layout-context-control-min: 164px;

  /* === TYPOGRAPHIE === */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-brand: 'Poppins', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-lg:   18px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  30px;
  --text-4xl:  36px;
  --text-5xl:  48px;

  --leading-tight: 1.2;
  --leading-snug:  1.35;
  --leading-normal:1.5;
  --leading-relax: 1.65;

  /* === ESPACEMENT (base 4px) === */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* === RAYONS === */
  --radius-sm:   4px;
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-xl:   12px;
  --radius-pill: 9999px;

  /* === OMBRES (neutres uniquement) === */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.05);

  /* === MOTION === */
  --duration-fast:     100ms;
  --duration-standard: 180ms;
  --duration-slow:     250ms;
  --ease-standard:     cubic-bezier(0.2, 0, 0, 1);

  /* === DENSITÉ (standard par défaut) === */
  --density-row-padding-y:  10px;
  --density-card-padding:   20px;
  --density-form-gap:       16px;
  --density-input-height:   36px;
}

[data-density="comfort"] {
  --density-row-padding-y: 14px;
  --density-card-padding:  24px;
  --density-form-gap:      20px;
  --density-input-height:  40px;
}
[data-density="compact"] {
  --density-row-padding-y: 6px;
  --density-card-padding:  16px;
  --density-form-gap:      12px;
  --density-input-height:  32px;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-standard: 0ms;
    --duration-slow: 0ms;
  }
}

/* === RESET MINIMAL === */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 0.92em; }

/* === CARD === */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--density-card-padding);
  box-shadow: var(--shadow-xs);
}
/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500;
  border: 1px solid transparent;
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast), border-color var(--duration-fast);
  white-space: nowrap;
}
.btn svg {
  flex-shrink: 0;
}
.chrome-no-select,
.chrome-no-select *:not(input):not(textarea):not(code) {
  user-select: none;
}
.btn,
.badge,
.section-title {
  user-select: none;
}
.btn--sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn--primary {
  background: var(--action-primary); color: var(--text-on-primary);
}
.btn--primary:hover { background: var(--action-primary-hover); }
.btn--primary:disabled { background: var(--slate-300); color: var(--slate-500); cursor: not-allowed; }

.fec-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fec-issue-list { display: grid; gap: var(--space-3); }
.fec-issue-list h3 { margin: 0; font-size: 16px; }
/* UX-012: issues are ledger lines; a blocker reads as an error text. */
.fec-issue { display: grid; gap: 4px; border-top: 1px solid var(--border-subtle); padding: 8px 0; font-size: 13px; }
.fec-issue span { color: var(--text-secondary); }
.fec-issue--blocker strong { color: var(--red-700); }
.fec-history { display: grid; gap: 8px; }
.fec-history__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 12px 14px; background: var(--surface-card); }
.fec-history__row div { display: grid; gap: 3px; }
.fec-history__row span { color: var(--text-secondary); font-size: 13px; }
@media (max-width: 760px) {
  .fec-metrics { grid-template-columns: 1fr; }
  .fec-history__row { align-items: flex-start; flex-direction: column; }
}
.btn--secondary {
  background: var(--slate-0); color: var(--slate-900);
  border-color: var(--border-strong);
}
.btn--secondary:hover { background: var(--slate-50); border-color: var(--slate-400); }
.btn--ghost {
  background: transparent; color: var(--slate-700);
}
.btn--ghost:hover { background: var(--slate-100); color: var(--slate-900); }
.btn--danger {
  background: var(--slate-0); color: var(--red-700); border-color: var(--red-100);
}
.btn--danger:hover { background: var(--slate-100); border-color: var(--red-700); }

/* === INPUTS === */
.label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.input {
  width: 100%; height: var(--density-input-height);
  padding: 0 12px;
  font-size: var(--text-sm);
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
textarea.input { height: auto; padding: 8px 12px; min-height: 72px; }
.input:focus {
  outline: none;
  border-color: var(--blue-700);
  box-shadow: 0 0 0 3px var(--blue-100);
}
.field-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.required-mark { color: var(--red-700); font-weight: 700; }

/* === BADGES === */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 3px;
  border: 1px solid transparent;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge--neutral { background: var(--slate-100); color: var(--slate-700); border-color: var(--slate-200); }
.badge--info { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-100); }
.badge--success { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); }
.badge--warning { background: var(--amber-50); color: var(--amber-700); border-color: var(--amber-100); }
.badge--danger { background: var(--red-50); color: var(--red-700); border-color: var(--red-100); }

.badge--status {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  gap: 6px;
}

.badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* === ALERTS === */
.alert {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 16px;
  border: 1px solid;
  border-radius: var(--radius-md);
  font-size: var(--text-sm); line-height: var(--leading-snug);
}
.alert--neutral { background: var(--surface-card); border-color: var(--border-subtle); color: var(--text-secondary); }

/* === MONTANTS (mono + couleur) === */
.amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; }

/* === TABLES (générique pour la planche DS) === */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.tbl th, .tbl td { text-align: left; padding: 8px 0; }
.tbl th { font-weight: 600; color: var(--text-secondary); border-bottom: 1px solid var(--border-subtle); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.tbl td.right, .tbl th.right { text-align: right; }
.tbl td.muted { color: var(--text-secondary); }

/* === HERO APP === */
.hero-app { min-height: 100vh; background: var(--surface-page); }

.topbar {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  gap: 12px 24px;
  align-items: center;
  min-height: 56px;
  padding: 12px 24px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--brand-deep);
  color: white; display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px;
}
.brand-mark:hover { text-decoration: none; }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; color: var(--text-primary); }
.brand-name:hover { text-decoration: none; }
.org-pill {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 12px; padding: 4px 10px;
  background: var(--slate-100); border-radius: var(--radius-pill);
  font-size: 13px; color: var(--text-secondary); font-weight: 500;
}
.org-pill:hover { background: var(--slate-200); cursor: pointer; text-decoration: none; }
.topbar-nav { display: flex; gap: 4px; flex: 1; margin-left: 16px; min-width: 0; flex-wrap: wrap; }
.nav-item {
  padding: 6px 12px; border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.nav-item:hover { background: var(--slate-100); color: var(--text-primary); text-decoration: none; }
.nav-item.active { background: var(--slate-100); color: var(--text-primary); }
.topbar-right { display: flex; align-items: center; gap: 12px; justify-self: end; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.topbar-username { font-size: 13px; color: var(--text-secondary); }
.avatar {
  width: 30px; height: 30px; border-radius: var(--radius-pill);
  background: var(--slate-200); color: var(--slate-700);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}
@media (max-width: 980px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .topbar-nav {
    grid-column: 1 / -1;
    margin-left: 0;
  }
}
@media (max-width: 640px) {
  .topbar {
    padding: 12px 16px;
  }
  .topbar-right {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .topbar-user {
    flex-wrap: wrap;
    gap: 8px;
  }
}

.page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; margin-bottom: 24px;
}
.page-title { font-size: var(--text-3xl); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.page-sub { font-size: 14px; color: var(--text-secondary); margin: 6px 0 0 0; }
.page-actions { display: flex; gap: 8px; }

/* === EMPTY === */
.empty-state { text-align: center; padding: 64px 24px; }
.empty-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.empty-sub { font-size: 14px; color: var(--text-secondary); }

/* === LEAN UI RESET === */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface-page);
}

.app-shell--workspace {
  display: grid;
  grid-template-columns: var(--layout-sidebar-width) minmax(0, 1fr);
  align-items: stretch;
}

.app-main {
  width: 100%;
  max-width: 1180px;
  padding: 28px 32px 72px;
}

.workspace-main {
  min-width: 0;
  max-width: none;
}

.app-sidebar {
  min-height: 100vh;
  height: 100vh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-6);
  padding: var(--space-5);
  background: var(--surface-navigation);
  color: var(--text-navigation);
  position: sticky;
  top: 0;
  overflow: hidden;
}

.app-sidebar__brand {
  display: grid;
  gap: var(--space-3);
}

.app-sidebar__brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* NOTIF-001: discreet bell; the counter appears only for unread items. */
.shell-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  color: var(--text-navigation);
}

.shell-bell:hover,
.shell-bell:focus-visible {
  color: var(--text-navigation-active);
  background: var(--surface-navigation-active);
  text-decoration: none;
}

.shell-bell__count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--action-primary);
  color: var(--slate-0);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.notification-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(480px, 100vw);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}

.notification-drawer[open] {
  display: grid;
  grid-template-rows: auto 1fr auto;
  animation: notification-drawer-in 160ms ease-out;
}

@keyframes notification-drawer-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .notification-drawer[open] { animation: none; }
}

.notification-drawer::backdrop {
  background: rgba(15, 23, 42, 0.32);
}

.notification-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 64px;
  padding: 0 var(--space-4) 0 var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}

.notification-drawer__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--space-3);
  min-width: 0;
}

.notification-drawer__heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.notification-drawer__count {
  color: var(--text-tertiary);
  font-size: 13px;
  white-space: nowrap;
}

.notification-drawer__tools {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--space-3);
}

.notification-drawer__tools form {
  margin: 0;
}

.notification-drawer__link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--action-primary);
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.notification-drawer__link:hover {
  text-decoration: underline;
}

.notification-drawer__link--muted {
  color: var(--text-secondary);
}

.notification-drawer__divider {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
}

.notification-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
}

.notification-drawer__close:hover {
  background: var(--slate-100);
  color: var(--text-primary);
}

.notification-drawer__body {
  overflow-y: auto;
  padding: var(--space-2) var(--space-4) var(--space-4);
}

.notification-drawer__section {
  margin: var(--space-4) var(--space-2) var(--space-2);
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.notification-row {
  border-bottom: 1px solid var(--border-subtle);
}

.notification-row__open {
  margin: 0;
}

.notification-row__button {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: var(--space-3);
  align-items: start;
  width: 100%;
  padding: var(--space-3) var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.notification-row__button:hover {
  background: var(--slate-50);
}

.notification-row__button:focus-visible,
.notification-drawer__link:focus-visible,
.notification-drawer__close:focus-visible,
.notification-drawer__footer a:focus-visible {
  outline: 2px solid var(--border-selection);
  outline-offset: 2px;
}

.notification-row__dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: var(--radius-pill);
}

/* DS-FORM-001: indigo for action, amber for review, red for blocking. */
.notification-row.is-unread .notification-row__dot { background: var(--action-primary); }
.notification-row.is-unread.notification-row--warning .notification-row__dot { background: var(--amber-700); }
.notification-row.is-unread.notification-row--critical .notification-row__dot { background: var(--red-700); }

.notification-row__content {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.notification-row__meta {
  color: var(--text-tertiary);
  font-size: 12px;
}

.notification-row__title {
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.35;
}

.notification-row.is-unread .notification-row__title {
  font-weight: 600;
}

.notification-row__excerpt {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-row__chevron {
  margin-top: 18px;
  color: var(--text-tertiary);
}

.notification-row__mark {
  display: flex;
  justify-content: flex-end;
  margin: calc(-1 * var(--space-2)) var(--space-2) var(--space-3) 0;
}

.notification-drawer__empty {
  margin: 0;
  padding: var(--space-12) var(--space-6);
  color: var(--text-secondary);
  text-align: center;
}

.notification-drawer__footer {
  border-top: 1px solid var(--border-subtle);
}

.notification-drawer__footer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  color: var(--action-primary);
  font-weight: 500;
}

.notification-drawer__footer a:hover {
  background: var(--slate-50);
  text-decoration: none;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  width: 142px;
  color: var(--text-navigation-active);
}

.brand-lockup img {
  display: block;
  width: 100%;
  height: auto;
}

.brand-lockup:hover {
  text-decoration: none;
}

.app-sidebar__org-row {
  display: grid;
  gap: 2px;
  padding: var(--space-2) 0 0;
  border-top: 1px solid var(--border-navigation);
}

.app-sidebar__org-label {
  color: var(--slate-500);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-sidebar__org-name {
  color: var(--slate-300);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar__org-name:hover {
  color: var(--text-navigation-active);
  text-decoration: none;
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  /* With Paramètres open the links outgrow the viewport. The main entries
     stay in place and only the Paramètres list scrolls (see below); the
     navigation itself scrolls only as a fallback. */
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  margin-right: calc(-1 * var(--space-2));
  padding-right: var(--space-2);
}

.app-sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 34px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  color: var(--text-navigation);
  font-size: 14px;
  font-weight: 600;
}

.app-sidebar__icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: currentColor;
  opacity: .88;
}

/* ICON-001: one linear family, 24x24 viewBox, 1.75 stroke, round caps. */
.app-sidebar__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-sidebar__link:hover,
.app-sidebar__link.active {
  background: var(--surface-navigation-active);
  color: var(--text-navigation-active);
  text-decoration: none;
}

.app-sidebar__section-title {
  margin: var(--space-5) 0 var(--space-2);
  color: var(--slate-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-sidebar__settings {
  margin-top: var(--space-4);
}

.app-sidebar__nav > * {
  flex: none;
}

/* The open Paramètres list takes the remaining height and scrolls inside
   it, so Tableau de bord, Banque and Opérations never leave the screen. */
.app-sidebar__nav > .app-sidebar__settings[open] {
  flex: 0 1 auto;
  /* Paramètres and a few of its links stay visible on short screens. */
  min-height: 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.app-sidebar__settings[open] > summary {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-navigation);
}

.app-sidebar__settings[open] > summary.active,
.app-sidebar__settings[open] > summary:hover {
  background: linear-gradient(var(--surface-navigation-active), var(--surface-navigation-active)), var(--surface-navigation);
}

.app-sidebar__settings summary {
  cursor: pointer;
  list-style: none;
}

.app-sidebar__settings summary::-webkit-details-marker {
  display: none;
}

.app-sidebar__settings-links {
  display: grid;
  gap: 2px;
  margin-top: var(--space-2);
  padding-left: var(--space-3);
  border-left: 1px solid var(--border-navigation);
}

.app-sidebar__settings-links .app-sidebar__link {
  min-height: 30px;
  font-size: 13px;
}

.app-sidebar__footer {
  display: grid;
  gap: var(--space-3);
  border-top: 1px solid var(--border-navigation);
  padding-top: var(--space-4);
}

.app-sidebar .btn--ghost {
  color: var(--text-navigation);
}

.app-sidebar .btn--ghost:hover {
  color: var(--text-navigation-active);
  background: var(--surface-navigation-active);
}

.sidebar-fiscal {
  display: grid;
  gap: 6px;
}

.sidebar-fiscal label,
.sidebar-user {
  color: var(--slate-400);
  font-size: 12px;
  font-weight: 600;
}

.sidebar-fiscal select {
  width: 100%;
  height: 32px;
  border-color: var(--border-navigation);
  background: var(--slate-800);
  color: var(--text-navigation-active);
}

.sidebar-user-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2);
  border: 1px solid var(--border-navigation);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-user-card__avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--slate-700);
  color: var(--text-navigation-active);
  font-weight: 800;
}

.sidebar-user-card__body {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.sidebar-user-card__name {
  overflow: hidden;
  color: var(--text-navigation-active);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-card__role {
  color: var(--slate-400);
  font-size: 11px;
  font-weight: 700;
}

.topbar--lean {
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
  min-height: 52px;
  padding: 10px 24px;
}

.settings-menu {
  position: relative;
}

.settings-menu summary {
  list-style: none;
}

.settings-menu summary::-webkit-details-marker {
  display: none;
}

.settings-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 240px;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-md);
}
.settings-menu--nav {
  position: relative;
  display: inline-flex;
}
.settings-menu--nav summary {
  list-style: none;
}
.settings-menu--nav summary::-webkit-details-marker {
  display: none;
}

.settings-menu__panel a {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
}

.settings-menu__panel a:hover {
  background: var(--slate-100);
  color: var(--text-primary);
  text-decoration: none;
}

.page-header--lean {
  align-items: flex-start;
  margin-bottom: 22px;
}

.page-header__text {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.back-link {
  display: inline-flex;
  width: fit-content;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.eyebrow {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.muted {
  color: var(--text-secondary);
}

.nowrap {
  white-space: nowrap;
}

.metric-action {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-xs);
  color: var(--text-primary);
}

.metric-action:hover {
  border-color: var(--border-strong);
  text-decoration: none;
}


.metric-action__main {
  display: grid;
  gap: 1px;
}

.metric-action__value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
}

.metric-action__label {
  color: var(--text-secondary);
  font-size: 13px;
}

.metric-action__hint {
  grid-column: 1 / -1;
  color: var(--text-tertiary);
  font-size: 12px;
}

/* work_note (UX-012): a situation is written as a ledger line — hairlines
   above and below, no card, no fill, no radius and never a coloured edge.
   Severity is carried by the wording; a blocking state only colours its
   title as an error text. `.signal-panel` is the historical class name. */
.signal-panel,
.work-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border: 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
}

.signal-panel__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.signal-panel--danger .signal-panel__title {
  color: var(--red-700);
}

.signal-panel__body {
  flex: 1;
  display: grid;
  gap: 2px;
}

.signal-panel__title {
  margin: 0;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 14px;
}

.signal-panel__text {
  margin: 0;
  font-size: 13px;
}

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.status-inline::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--slate-400);
}

.status-inline--warning::before {
  background: var(--amber-700);
}

.status-inline--warning {
  color: var(--amber-700);
}

.status-inline--danger::before {
  background: var(--red-700);
}

.status-inline--danger {
  color: var(--red-700);
}

.status-inline--success::before {
  background: var(--slate-400);
}

.status-inline--info::before {
  background: var(--blue-700);
}

.table-shell {
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
}

.table-shell .tbl {
  margin: 0;
}

.table-shell .tbl th,
.table-shell .tbl td {
  padding: 9px 14px;
  vertical-align: top;
}

.table-link {
  font-weight: 700;
}

.cell-note {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 12px;
}

.actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filters-compact {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(130px, 1fr) minmax(120px, 1fr) auto auto;
  gap: var(--space-3);
  align-items: end;
}

.filters-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.empty-state--lean {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
}

.empty-action {
  margin: var(--space-4) 0 0;
}

.page-stack {
  display: grid;
  gap: var(--space-6);
}

.section-stack {
  display: grid;
  gap: var(--space-3);
}

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

.workspace-header {
  display: grid;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.workspace-header__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.workspace-header--bank .workspace-header__bar {
  align-items: center;
}

.bank-header-controls {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.workspace-title {
  margin: 0;
  font-size: var(--text-3xl);
  font-weight: 700;
}

.workspace-subtitle {
  margin: 0;
  color: var(--text-secondary);
}

.workspace-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--layout-context-control-min), 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.workspace-context--form {
  align-items: end;
}

.context-control {
  min-height: 54px;
  display: grid;
  gap: 5px;
  align-content: center;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
}

.context-control select {
  width: 100%;
  min-height: 30px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-weight: 700;
}

.context-control--compact {
  min-height: 38px;
  grid-template-columns: auto minmax(118px, 1fr);
  gap: var(--space-2);
  align-items: center;
  align-content: center;
  padding: 6px 10px;
  border-radius: var(--radius-md);
}

.context-control--compact select {
  min-height: 28px;
}

.context-control--static {
  justify-content: start;
}

.context-chip {
  min-height: 54px;
  display: grid;
  gap: 2px;
  align-content: center;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
}

.context-chip__label {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.context-chip__value {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.context-chip--pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
}

.context-chip--pill svg {
  flex-shrink: 0;
  color: var(--text-secondary);
}

.work-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.work-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.work-tab:hover,
.work-tab--active {
  border-color: var(--border-selection);
  color: var(--text-primary);
  text-decoration: none;
}

.work-tab__count {
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 1fr);
  gap: var(--layout-content-gap);
  align-items: stretch;
}

.workspace-queue {
  min-width: 0;
  overflow: auto;
}

.bank-workspace {
  display: grid;
  grid-template-columns: minmax(0, 65fr) minmax(360px, 35fr);
  gap: var(--layout-content-gap);
  align-items: stretch;
  min-height: 0;
  overflow: hidden;
}

.bank-workbench {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: var(--space-3);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.bank-table-scroll {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.decision-panel {
  display: grid;
  gap: var(--space-3);
  align-self: stretch;
  position: sticky;
  top: var(--space-5);
  overflow: auto;
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: none;
}

.decision-panel__topline {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.decision-panel__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
}

.decision-panel__meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.decision-panel__central {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.bank-page {
  min-height: 0;
  display: grid;
  gap: var(--space-4);
}

.bank-page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  min-height: 0;
}

.bank-page-header__title {
  min-width: 0;
  display: grid;
  gap: var(--space-1);
}

.bank-page-header__notice {
  grid-column: 1 / -1;
}

.bank-workspace-empty {
  min-height: 0;
}

.bank-header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.bank-header-controls .context-control--compact,
.bank-header-controls .bank-header-button,
.bank-header-controls .context-chip--pill {
  min-height: 40px;
  height: 40px;
}

.bank-header-controls .context-control--compact select {
  min-height: 28px;
}

.bank-header-controls .context-chip--pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 var(--space-3);
}

.bank-header-controls .context-chip--pill svg {
  flex-shrink: 0;
  color: var(--text-secondary);
}

.bank-status-tabs {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.bank-filter-region {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.bank-filter-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 1.6fr) minmax(150px, 1fr) minmax(130px, .8fr) auto minmax(170px, 1fr);
  gap: var(--space-2);
  align-items: center;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.bank-filter-field {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.bank-filter-field input,
.bank-filter-field select,
.amount-filter__fields input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-primary);
}

.amount-filter {
  position: relative;
  align-self: end;
}

.amount-filter summary {
  list-style: none;
}

.amount-filter summary::-webkit-details-marker {
  display: none;
}

.amount-filter__summary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 116px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.amount-filter__summary::after {
  content: "▾";
  color: var(--text-tertiary);
  font-size: 12px;
}

.amount-filter__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: min(340px, 86vw);
  display: grid;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-md);
}

.amount-filter__modes {
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  border: 0;
}

.amount-filter__modes label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.amount-filter__fields {
  display: grid;
  gap: var(--space-2);
}

.amount-filter__fields span {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
}

.amount-filter__exact,
.amount-filter__range {
  display: none;
}

.amount-filter:has(#banking-amount-mode-exact:checked) .amount-filter__exact,
.amount-filter:has(#banking-amount-mode-range:checked) .amount-filter__range {
  display: grid;
  gap: var(--space-2);
}

.amount-filter__range {
  grid-template-columns: 1fr 1fr;
}

.amount-filter__error {
  margin: 0;
  color: var(--red-700);
  font-size: 12px;
  font-weight: 700;
}

.amount-filter__actions {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  align-items: center;
}

.active-filter-tokens {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.active-filter-token,
.active-filter-clear {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.active-filter-clear {
  border-color: transparent;
  background: transparent;
}

.active-filter-token:hover,
.active-filter-clear:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  text-decoration: none;
}

.bank-table {
  table-layout: fixed;
}

.bank-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-card);
}

/* Bank-table: horizontal cell padding to prevent MONTANTÉTAT visual merge */
.bank-table th,
.bank-table td {
  padding: var(--density-row-padding-y) 10px;
}

.bank-table th:first-child,
.bank-table td:first-child {
  padding-left: 0;
}

.bank-table th:last-child,
.bank-table td:last-child {
  padding-right: 0;
}

/* Date column */
.bank-table th:nth-child(1),
.bank-table td:nth-child(1) {
  width: 94px;
}

/* Default (4-col): Date | Mouvement | Montant | Pièce */
.bank-table th:nth-child(3),
.bank-table td:nth-child(3) {
  width: 118px;
}

.bank-table th:nth-child(4),
.bank-table td:nth-child(4) {
  width: 72px;
}

/* 5-col review: Date | Mouvement | Montant | État | Pièce */
.bank-table--review th:nth-child(3),
.bank-table--review td:nth-child(3) {
  width: 110px;
}

.bank-table--review th:nth-child(4),
.bank-table--review td:nth-child(4) {
  width: 110px;
}

.bank-table--review th:nth-child(5),
.bank-table--review td:nth-child(5) {
  width: 72px;
}

.bank-decision-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  align-self: stretch;
  display: grid;
  align-content: start;
  gap: var(--space-3);
  overflow-y: auto;
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.bank-decision-panel__topline {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.bank-decision-panel__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
}

.bank-decision-panel__status {
  min-height: 22px;
}

.bank-decision-panel__meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.bank-decision-panel__central {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

/* Panel sections, not cards: no frame, radius or surface of their own
   (UX-012). The panel's 1px dividers already separate them. */
.bank-linked-operation-card,
.bank-document-preview-card {
  display: grid;
  gap: var(--space-2);
}

.bank-matching-suggestion {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.bank-matching-suggestion__title {
  margin: 0;
  font-size: var(--text-base);
}

.bank-matching-suggestion__meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.bank-matching-suggestion__list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.bank-matching-suggestion__list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: center;
}

.bank-matching-suggestion__list div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.bank-matching-suggestion__list a {
  overflow: hidden;
  color: var(--text-primary);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-matching-suggestion__list span {
  color: var(--text-secondary);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.bank-matching-suggestion__groups {
  display: grid;
  gap: var(--space-3);
}

.bank-matching-suggestion__group {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.bank-matching-suggestion__group-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.bank-matching-suggestion__confirmation {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  margin: 0 0 var(--space-2);
  color: var(--text-secondary);
  font-size: 12px;
}

.bank-linked-operation-card__title,
.bank-document-preview-card__title {
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
}

.bank-linked-operation-card__title:hover,
.bank-document-preview-card__title:hover {
  color: var(--blue-700);
  text-decoration: underline;
}

.bank-linked-operation-card__meta,
.bank-document-preview-card__meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.bank-linked-operation-card__list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bank-linked-operation-card__list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: baseline;
}

.bank-linked-operation-card__list a {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.bank-linked-operation-card__list span {
  color: var(--text-secondary);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.bank-document-preview-card__header {
  display: grid;
  gap: 3px;
}

.bank-document-preview-card__type {
  color: var(--text-secondary);
  font-size: 12px;
}

.bank-document-preview {
  display: grid;
  place-items: center;
  min-height: 150px;
  max-height: 220px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.bank-document-preview iframe,
.bank-document-preview img {
  width: 100%;
  height: 220px;
  border: 0;
}

.bank-document-preview img {
  object-fit: contain;
}

.bank-document-preview__placeholder {
  display: grid;
  gap: var(--space-2);
  place-items: center;
  padding: var(--space-4);
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

.bank-document-preview-card__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.document-preview-dialog {
  width: min(900px, calc(100vw - 48px));
  max-width: none;
  height: min(780px, calc(100vh - 48px));
  max-height: none;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
}

.document-preview-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
}

.document-preview-dialog__bar {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.document-preview-dialog__bar h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: var(--text-lg);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-preview-dialog__close {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-secondary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 10px;
}

.document-preview-dialog__body {
  height: calc(100% - 58px);
  overflow: auto;
  background: var(--surface-sunken);
}

.document-preview-dialog__body iframe {
  width: 100%;
  height: 100%;
  min-height: 640px;
  border: 0;
  background: var(--surface-card);
}

.document-preview-dialog__body img {
  display: block;
  max-width: 100%;
  max-height: none;
  margin: 0 auto;
}

body.modal-open {
  overflow: hidden;
}

.queue-table .tbl th,
.queue-table .tbl td {
  padding: 10px 12px;
}

.contextual-action-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
}

.contextual-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.contextual-action svg {
  flex-shrink: 0;
}

.contextual-action:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  text-decoration: none;
}

.contextual-action--danger {
  color: var(--red-700);
}

.movement-row {
  cursor: pointer;
}

.movement-row:focus-visible td {
  outline: 2px solid var(--border-selection);
  outline-offset: -2px;
}

.queue-row--selected td {
  background: var(--surface-selection);
  box-shadow: none;
}

.movement-label {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 42rem;
}

.movement-label--plain {
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
}

.movement-label--plain:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.queue-state .status-inline {
  white-space: nowrap;
}

.queue-footer {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: var(--space-3);
}

.queue-footer__sizes {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  color: var(--text-secondary);
  font-size: 12px;
}

.queue-footer__sizes a {
  color: var(--text-secondary);
  font-weight: 700;
}

.queue-footer__sizes a.active {
  color: var(--text-primary);
}

.piece-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.piece-indicator svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
}

.piece-indicator--linked {
  color: var(--text-secondary);
}

.piece-indicator--none {
  color: var(--slate-300);
}

.col-piece {
  width: 72px;
}

.col-etat {
  width: 110px;
  white-space: nowrap;
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue-700);
  font: inherit;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.proof-indicator {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.proof-indicator__label {
  color: var(--text-tertiary);
}

.proof-indicator__item {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--proof-missing);
}

.proof-indicator__item--present {
  color: var(--proof-present);
}

.source-fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
}

.source-fact {
  display: grid;
  gap: 3px;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background: var(--surface-card);
  box-shadow: var(--shadow-xs);
}

.source-fact__label {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.source-fact__label--icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.source-fact__label--icon svg {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.source-fact__value {
  font-weight: 700;
}
.segmented {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.segmented__option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.segmented__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented__option:has(input:checked),
.segmented__option--selected {
  background: var(--action-primary);
  border-color: var(--action-primary);
  color: var(--text-on-primary);
}

.segmented__option:has(input:focus-visible) {
  outline: 2px solid var(--action-primary);
  outline-offset: 2px;
}
.funding-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  position: relative;
}

.compact-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.compact-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.muted {
  color: var(--text-secondary);
}

.right {
  text-align: right;
}

.nowrap {
  white-space: nowrap;
}

.amt {
  font-family: var(--font-mono);
}

.result-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.result-banner__label {
  font-weight: 700;
}

.result-banner__value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.table-indent {
  padding-left: var(--space-4);
  color: var(--text-secondary);
  font-size: 13px;
}

.checkbox-row {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  color: var(--text-secondary);
}

.inline-form {
  display: inline;
  margin: 0;
}

.no-org-notice {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  color: var(--text-secondary);
}

.no-org-notice--error {
  color: var(--red-700);
}

/* === DOCUMENTS WORKSPACE (approved W18 wireframe) === */
.document-workspace,
.document-detail-workspace {
  min-width: 0;
  display: grid;
  gap: var(--space-4);
}

.document-workspace__header,
.document-detail-header {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}

.document-workspace__header h1,
.document-detail-header h1 {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--font-brand);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: var(--leading-tight);
}

.document-workspace__header svg,
.document-detail-header svg,
.document-actions-card svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.document-tabs {
  min-height: 42px;
  display: flex;
  align-items: end;
  gap: var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}

.document-tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 0 11px;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.document-tab:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.document-tab--active {
  border-bottom-color: var(--action-primary);
  color: var(--text-primary);
}

.document-tab__count {
  min-width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.document-tab--active .document-tab__count {
  background: var(--action-primary);
  color: var(--text-on-primary);
}

.document-filter-bar {
  min-width: 0;
  display: grid;
  grid-template-columns:
    minmax(230px, 1.65fr)
    minmax(150px, .85fr)
    minmax(170px, 1fr)
    minmax(165px, 1fr)
    auto
    auto;
  gap: var(--space-2);
  align-items: center;
}

.document-filter-bar select,
.document-filter-bar__search,
.document-filter-bar__submit {
  height: 38px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 13px;
}

.document-filter-bar select {
  min-width: 0;
  width: 100%;
  padding: 0 30px 0 12px;
}

.document-filter-bar__search {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 11px;
}

.document-filter-bar__search svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-tertiary);
  stroke-width: 1.6;
}

.document-filter-bar__search input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
}

.document-filter-bar__submit {
  padding: 0 13px;
  color: var(--text-primary);
  font-weight: 700;
}

.document-filter-bar__submit:hover {
  border-color: var(--border-strong);
  background: var(--surface-sunken);
}

.document-filter-bar__reset {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.document-filter-bar--workspace {
  grid-template-columns: minmax(230px, 1.75fr) minmax(170px, 1fr) minmax(165px, 1fr) auto auto;
}

.document-workspace__body {
  min-width: 0;
}

.document-list-table--to_process th:nth-child(1) { width: 34%; }
.document-list-table--to_process th:nth-child(2) { width: 10%; }
.document-list-table--to_process th:nth-child(3) { width: 25%; }
.document-list-table--to_process th:nth-child(4) { width: 25%; }
.document-list-table--to_process th:nth-child(5) { width: 6%; }
.document-list-table--invoices th:nth-child(1) { width: 28%; }
.document-list-table--invoices th:nth-child(2) { width: 8%; }
.document-list-table--invoices th:nth-child(3) { width: 15%; }
.document-list-table--invoices th:nth-child(4) { width: 11%; }
.document-list-table--invoices th:nth-child(5) { width: 11%; }
.document-list-table--invoices th:nth-child(6) { width: 21%; }
.document-list-table--invoices th:nth-child(7) { width: 6%; }
.document-list-table--statements th:nth-child(1),
.document-list-table--supporting th:nth-child(1) { width: 29%; }
.document-list-table--statements th:nth-child(2),
.document-list-table--supporting th:nth-child(2) { width: 16%; }
.document-list-table--statements th:nth-child(3),
.document-list-table--supporting th:nth-child(3) { width: 16%; }
.document-list-table--statements th:nth-child(4),
.document-list-table--supporting th:nth-child(4) { width: 11%; }
.document-list-table--statements th:nth-child(5),
.document-list-table--supporting th:nth-child(5) { width: 14%; }
.document-list-table--statements th:nth-child(6),
.document-list-table--supporting th:nth-child(6) { width: 9%; }
.document-list-table--statements th:nth-child(7),
.document-list-table--supporting th:nth-child(7) { width: 5%; }

.document-list-row__subfact,
.document-list-row__context-action {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.document-list-row__context-action { color: var(--blue-700); }

.document-pagination { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); color: var(--text-secondary); font-size: 12px; }
.document-pagination a { font-weight: 700; }
.document-family-mark__icon--composite { width: 24px; }
.document-source-viewer__image--localizable { position: relative; }
.document-source-highlight { position: absolute; z-index: 2; border: 2px solid var(--blue-500); border-radius: 2px; background: rgb(191 219 254 / 28%); box-shadow: 0 0 0 9999px rgb(30 58 138 / 6%); pointer-events: none; }
.document-extracted-fields { gap: 8px; }
.document-extracted-fields > p { margin: 0; color: var(--text-secondary); font-size: 11px; }
.document-extracted-fields dl { display: grid; gap: 5px; margin: 0; }
.document-extracted-fields dl > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.document-extracted-fields dt { color: var(--text-secondary); font-size: 10px; }
.document-extracted-fields dd { display: grid; justify-items: end; gap: 2px; margin: 0; text-align: right; }
.document-source-field { padding: 0; border: 0; background: transparent; color: var(--blue-700); font: inherit; font-size: 11px; font-weight: 700; text-align: right; cursor: pointer; }
.document-source-field:focus-visible { outline: 2px solid var(--border-selection); outline-offset: 2px; }
.document-source-reference { color: var(--text-secondary); font-size: 10px; line-height: 1.35; }
.document-source-value { color: var(--text-primary); font-size: 11px; font-weight: 700; }
.document-provenance-disclosure > summary { color: var(--text-primary); cursor: pointer; font-size: 12px; font-weight: 700; }
.document-provenance-disclosure > p { margin: var(--space-2) 0; }
.document-provenance-lines { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.document-provenance-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px var(--space-2); }
.document-provenance-lines li .document-source-reference { grid-column: 1; }
.document-provenance-lines li > strong { grid-column: 2; grid-row: 1; font-size: 11px; white-space: nowrap; }

.document-list-shell {
  min-width: 0;
  overflow: visible;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
}

.document-list-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: var(--text-primary);
  font-size: 12px;
}

.document-list-table th {
  padding: 10px 12px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
}

.document-list-table th:nth-child(1) { width: 30%; }
.document-list-table th:nth-child(2) { width: 8%; }
.document-list-table th:nth-child(3) { width: 13%; }
.document-list-table th:nth-child(4) { width: 10%; }
.document-list-table th:nth-child(5) { width: 9%; }
.document-list-table th:nth-child(6) { width: 12%; }
.document-list-table th:nth-child(7) { width: 13%; }
.document-list-table th:nth-child(8) { width: 5%; }

.document-list-table__action-heading {
  text-align: right !important;
}

.document-list-table td {
  min-width: 0;
  padding: 9px 12px;
  border-top: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.document-list-row {
  outline: none;
  transition: background var(--duration-fast) var(--ease-standard);
}

.document-list-row:hover,
.document-list-row:focus-visible {
  background: var(--surface-selection);
}

.document-list-row:focus-visible {
  outline: 2px solid var(--border-selection);
  outline-offset: -2px;
}

.document-list-row__document {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.document-thumbnail {
  position: relative;
  width: 40px;
  height: 54px;
  display: block;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text-tertiary);
}

.document-thumbnail:hover {
  border-color: var(--border-selection);
  text-decoration: none;
}

.document-thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  /* A document is identified by its header — supplier, logo, title — so the
     crop keeps the top of the page rather than its centre. */
  object-position: top center;
  background: var(--surface-card);
}

.document-thumbnail > svg {
  width: 20px;
  height: 26px;
  position: absolute;
  inset: 50% auto auto 50%;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.3;
  transform: translate(-50%, -50%);
}

.document-thumbnail__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 3px;
  color: var(--text-tertiary);
  background: linear-gradient(145deg, var(--surface-card), var(--surface-sunken));
}

.document-thumbnail__fallback[hidden] { display: none; }

.document-thumbnail__fallback-glyph {
  display: grid;
  place-items: center;
  width: 22px;
  height: 25px;
  border-radius: 3px;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--surface-card) 76%, var(--border-subtle));
  box-shadow: 0 1px 2px rgb(15 23 42 / 8%);
}

.document-thumbnail__fallback-glyph svg {
  width: 15px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.document-thumbnail__fallback-label {
  max-width: 34px;
  overflow: hidden;
  color: var(--text-tertiary);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.document-list-row__identity {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.document-list-row__name {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.document-list-row__name:hover {
  color: var(--blue-700);
  text-decoration: underline;
}

.document-list-row__meta {
  overflow: hidden;
  color: var(--text-tertiary);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-list-row__amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.document-family-mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
}

.document-family-mark__icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.document-family-mark__arrow {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--text-secondary);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.document-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.document-state--neutral { color: var(--text-tertiary); font-weight: 500; }
.document-state--success { color: var(--green-700); }
.document-state--warning { color: var(--amber-700); }
.document-state--danger { color: var(--red-700); }
.document-state--running { color: var(--blue-700); }

.document-state__icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.document-state__icon--bolt {
  fill: currentColor;
  stroke: none;
}

.document-list-row__mobile-action {
  display: none;
}

.document-list-row__actions {
  text-align: right;
}

/* secondary_action_menu (UX-010): one grouped entry for actions rare in the current state. */
.secondary-action-menu {
  position: relative;
  display: inline-block;
}

.secondary-action-menu > summary {
  list-style: none;
}

.secondary-action-menu > summary::-webkit-details-marker {
  display: none;
}

.document-reading-pulse {
  display: inline-block;
  animation: document-reading-pulse 1.35s ease-in-out infinite;
}

@keyframes document-reading-pulse {
  0%, 100% { opacity: .45; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

.document-detail-workspace {
  gap: var(--space-3);
}

.document-detail-header {
  align-items: start;
}

.document-detail-header__identity {
  min-width: 0;
  display: grid;
  gap: var(--space-2);
}

.document-detail-header__back {
  justify-self: start;
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 700;
}

.document-detail-header h1 {
  max-width: min(980px, 72vw);
  overflow: hidden;
  font-size: var(--text-xl);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secondary-action-menu {
  z-index: 80;
}

.secondary-action-menu > .secondary-action-menu__panel {
  top: calc(100% + 5px);
  right: 0;
}

.secondary-action-menu__panel {
  position: absolute;
  z-index: 100;
  width: 215px;
  display: grid;
  padding: 5px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-overlay);
  box-shadow: var(--shadow-md);
}

.secondary-action-menu__panel form {
  margin: 0;
}

.secondary-action-menu__panel a,
.secondary-action-menu__panel button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 7px 9px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.secondary-action-menu__panel a:hover,
.secondary-action-menu__panel button:hover {
  background: var(--surface-sunken);
  color: var(--text-primary);
  text-decoration: none;
}

.secondary-action-menu__panel .secondary-action-menu__danger {
  color: var(--red-700);
}

.document-reading-indicator {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
}

.document-reading-indicator strong {
  font-size: 12px;
}

.document-reading-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green-700);
}

.document-reading-indicator--unavailable .document-reading-dot {
  background: var(--red-700);
}

.document-reading-bolt {
  width: 24px;
  height: 24px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--blue-200);
  border-radius: 50%;
  color: var(--blue-700);
}

.document-reading-bolt svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: none;
}

.document-detail-layout {
  min-width: 0;
  position: relative;
  height: calc(100vh - 188px);
  min-height: 600px;
  max-height: 820px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 330px);
  gap: 14px;
  align-items: stretch;
}

.document-source-viewer {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.document-source-viewer iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: var(--surface-sunken);
}

.document-source-viewer__image,
.document-source-viewer__empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: var(--space-6);
}

.document-source-viewer__image {
  position: relative;
  overflow: auto;
}

.document-source-viewer__image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.document-source-viewer__page-note {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  margin: 0;
  padding: 4px 6px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 11px;
}

.document-source-viewer pre {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: auto;
  padding: var(--space-5);
  background: var(--surface-card);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
}

.document-source-viewer__empty {
  align-content: center;
  gap: var(--space-3);
  color: var(--text-secondary);
  text-align: center;
}

.document-source-viewer__empty p {
  margin: 0;
}

.document-summary-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.document-summary-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
}

.document-summary-card h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
}

.document-summary-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.document-summary-list > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(88px, .85fr) minmax(0, 1.15fr);
  gap: 10px;
  padding: 5px 0;
  align-items: start;
}

.document-summary-list dt {
  color: var(--text-secondary);
  font-size: 10px;
}

.document-summary-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
}

.document-summary-card__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.document-summary-card__family-icon { display: inline-flex; color: var(--text-secondary); }
.document-summary-card__family-icon .document-family-mark__icon { width: 22px; height: 22px; }

.document-operation-card > p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
}

.document-operation-card > .btn,
.document-linked-operation .btn,
.document-link-disclosure > summary {
  width: 100%;
  justify-content: center;
}

.document-linked-operation {
  display: grid;
  gap: 8px;
}

.document-linked-operation strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.document-linked-operation span {
  color: var(--text-secondary);
  font-size: 11px;
}

.document-link-disclosure {
  display: grid;
  gap: 9px;
}

.document-link-disclosure > summary {
  list-style: none;
  cursor: pointer;
}

.document-link-disclosure > summary::-webkit-details-marker {
  display: none;
}

.document-link-disclosure form {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.document-link-disclosure select {
  font-size: 12px;
}

.document-actions-card {
  gap: 4px;
}

.document-actions-card h2 {
  margin-bottom: 5px;
}

.document-actions-card > a,
.document-actions-card__disabled {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

.document-actions-card > a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.document-actions-card > a svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.document-actions-card > .document-actions-card__danger {
  color: var(--red-700);
}

.document-actions-card__disabled {
  color: var(--text-tertiary);
}

.document-summary-panel__footer {
  margin: 0;
  padding: 1px 3px;
  color: var(--text-tertiary);
  font-size: 9px;
}

@media (prefers-reduced-motion: reduce) {
  .document-reading-pulse {
    animation: none;
  }
}

@media (min-width: 900px) {
  .document-detail-page {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .document-detail-page .workspace-main {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding-bottom: 28px;
  }

  .document-detail-page .document-detail-workspace {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .document-detail-page .document-detail-header,
  .document-detail-page .document-reading-indicator {
    flex: 0 0 auto;
  }

  .document-detail-page .document-detail-layout {
    height: auto;
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
  }
}

@media (min-width: 1200px) {
  .bank-workspace-page {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .bank-workspace-page .workspace-main {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    padding: 20px 24px;
  }

  .bank-page {
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .bank-workspace {
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 65fr) minmax(360px, 35fr);
  }

  .bank-workbench {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .bank-table-scroll {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .bank-decision-panel {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    align-self: stretch;
  }
}

@media (max-width: 760px) {
  .app-shell--workspace {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    min-height: auto;
    height: auto;
    max-height: none;
    position: static;
    overflow: visible;
  }
  .app-sidebar__nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
  .workspace-layout {
    grid-template-columns: 1fr;
  }
  .decision-panel {
    position: static;
  }
  .app-main {
    padding: 22px 16px 56px;
  }
  .topbar--lean {
    grid-template-columns: minmax(0, 1fr);
  }
  .topbar-right {
    justify-self: start;
  }
  .filters-compact {
    grid-template-columns: 1fr;
  }
  .bank-header-controls {
    justify-content: flex-start;
  }
  .bank-workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .workspace-layout {
    min-height: 0;
  }
  .workspace-queue,
  .decision-panel {
    max-height: none;
    min-height: 0;
    overflow: visible;
  }
  .bank-matching-suggestion__list li {
    align-items: stretch;
    flex-direction: column;
  }
  .bank-matching-suggestion__list form .btn {
    width: 100%;
  }

  .operation-ventilation-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  }

  .operation-ventilation-row > div {
    min-width: 0;
  }

  .operation-ventilation-row__label,
  .operation-ventilation-row__remove {
    grid-column: 1 / -1;
  }

  .operation-ventilation-row__remove {
    padding-top: 0 !important;
  }

  .operation-ventilation-row__remove .btn {
    width: 100%;
  }
  .document-workspace__header {
    align-items: flex-start;
  }
  .document-workspace__header .btn {
    padding-inline: 10px;
  }
  .document-tabs {
    gap: var(--space-4);
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .document-tab {
    flex: 0 0 auto;
  }
  .document-filter-bar {
    grid-template-columns: 1fr;
  }
  .document-filter-bar__reset {
    justify-self: start;
  }
  .document-list-shell {
    border: 0;
    background: transparent;
  }
  .document-list-table,
  .document-list-table tbody {
    display: block;
  }
  .document-list-table thead {
    display: none;
  }
  .document-list-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 12px;
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface-card);
  }
  .document-list-table td {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
  }
  .document-list-row__document {
    grid-column: 1 / -1;
  }
  .document-list-row > td:nth-child(n) {
    display: none;
  }
  .document-list-row > td:first-child,
  .document-list-row > td:nth-last-child(2),
  .document-list-row > td:last-child {
    display: block;
  }
  .document-list-row > td:nth-last-child(2) {
    grid-column: 1;
    color: var(--text-secondary);
  }
  .document-list-row > td:nth-child(3) {
    display: none;
  }
  .document-list-row__family,
  .document-list-row > td:nth-child(4),
  .document-list-row > td:nth-child(5),
  .document-list-row > td:nth-child(6),
  .document-list-row > td:nth-child(7) {
    display: inline-flex;
    align-items: center;
  }
  .document-list-row__family {
    grid-column: 1;
  }
  .document-list-row__actions {
    position: static;
    grid-column: 1 / -1;
    display: block;
    text-align: left;
  }
  .document-list-row__actions .document-row-menu {
    position: absolute;
    right: 10px;
    top: 10px;
  }
  .document-list-row__identity {
    padding-right: 34px;
  }
  .document-list-row__mobile-action {
    width: 100%;
    min-height: 34px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-top: 4px;
    padding: 0 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
  }
  .document-list-row__mobile-action:hover {
    background: var(--surface-sunken);
    text-decoration: none;
  }
  .document-detail-header h1 {
    white-space: normal;
  }
  .document-detail-layout {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
  .document-source-viewer {
    min-height: 60vh;
  }
  .document-summary-panel {
    overflow: visible;
  }
  .document-list-row > td:nth-child(n) {
    display: none;
  }
  .document-list-row > td:first-child,
  .document-list-row > td:nth-last-child(2),
  .document-list-row > td:last-child {
    display: block;
  }
  .document-list-row > td:nth-last-child(2) {
    grid-column: 1;
    color: var(--text-secondary);
  }
  .document-list-row__actions {
    grid-column: 1 / -1;
  }
  .document-pagination {
    justify-content: space-between;
  }
}

/* === FUNDING STEPPER (DOS-01 Subventions — parcours Demande → Décision →
   Exécution → Justification → Clôture) === */
.funding-stepper {
  display: flex;
  align-items: flex-start;
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
  gap: 2px;
}

.funding-stepper__step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.funding-stepper__step::after {
  content: "";
  flex: 1;
  height: 0;
  border-top: 2px dashed var(--border-subtle);
  margin: 0 6px;
}

.funding-stepper__step--completed::after {
  border-top-color: var(--green-200, var(--green-100));
}

.funding-stepper__step:last-child::after {
  display: none;
}

.funding-stepper__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.funding-stepper__link:hover {
  text-decoration: none;
  color: var(--text-primary);
}

span.funding-stepper__link {
  cursor: default;
}

.funding-stepper__marker {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-card);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
}

.funding-stepper__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.funding-stepper__step--completed .funding-stepper__marker {
  background: var(--green-100);
  border-color: var(--green-100);
  color: var(--green-700);
  font-size: 15px;
}

.funding-stepper__step--completed .funding-stepper__link {
  color: var(--text-secondary);
}

.funding-stepper__step--current .funding-stepper__marker {
  width: 32px;
  height: 32px;
  background: var(--action-primary);
  border-color: var(--action-primary);
  color: var(--text-on-primary);
  font-size: 14px;
}

.funding-stepper__step--current .funding-stepper__link {
  color: var(--text-primary);
  font-weight: 700;
}

.funding-stepper__step--future .funding-stepper__marker {
  background: var(--surface-card);
  color: var(--slate-400);
  border-color: var(--border-subtle);
}

.funding-stepper__step--future .funding-stepper__label {
  color: var(--text-tertiary);
}

.funding-stepper__step--anomaly .funding-stepper__marker {
  background: var(--amber-700);
  border-color: var(--amber-700);
  color: var(--slate-0);
}

@media (max-width: 640px) {
  .funding-stepper {
    flex-direction: column;
    gap: 10px;
  }
  .funding-stepper__step {
    width: 100%;
  }
  .funding-stepper__step::after {
    display: none;
  }
  .funding-stepper__label {
    overflow: visible;
    white-space: normal;
  }
}

/* === TOOLTIP (short secondary info only — term, icon meaning, precision;
   never a mandatory instruction/error/action). Works on hover and keyboard
   focus; dismissible with Escape via funding-stepper.js. === */
.tt {
  position: relative;
  display: inline-flex;
}

.tt__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-card);
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.tt__bubble {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: var(--slate-900);
  color: var(--slate-0);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--duration-fast);
  pointer-events: none;
}

.tt__trigger:hover + .tt__bubble,
.tt__trigger:focus-visible + .tt__bubble {
  visibility: visible;
  opacity: 1;
}

.tt[data-tt-dismissed="true"] .tt__bubble {
  visibility: hidden !important;
  opacity: 0 !important;
}

.installment-planner {
  padding: var(--space-3);
  background: var(--surface-subtle, #f8fafc);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.installment-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) minmax(125px, .9fr) minmax(125px, .9fr) minmax(160px, 1.2fr) minmax(130px, .9fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  background: var(--surface-card, #fff);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.installment-row__remove {
  white-space: nowrap;
}

.installment-total {
  font-size: 13px;
  font-weight: 600;
}

.installment-total--ok {
  color: var(--green-700, #047857);
}

.installment-total--error {
  color: var(--red-700, #b91c1c);
}

@media (max-width: 1100px) {
  .installment-row {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
  .installment-row__remove {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .installment-row {
    grid-template-columns: 1fr;
  }
  .installment-row [style*="grid-column"] {
    grid-column: auto !important;
  }
}

/* ------------------------------------------------------------------ */
/* Documents — document-assisted expense/income editor (DOC-05, DOC-06) */
/* ------------------------------------------------------------------ */

.document-expense-editor {
  display: grid;
  gap: var(--space-3);
  min-width: 0;
}

.document-expense-editor__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: 12px;
}

.document-expense-editor__breadcrumb a { color: var(--blue-700); font-weight: 600; }
.document-expense-editor__breadcrumb-current { color: var(--text-tertiary); }

.document-expense-editor__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.document-expense-editor__header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

/* The journey marker is neutral evidence, not a status: it states which
   editor is open, so it never carries a success or warning tone. */
.document-expense-journey {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.document-expense-journey svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.document-expense-editor__layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--space-4);
  align-items: start;
}

@media (max-width: 1100px) {
  .document-expense-editor__layout { grid-template-columns: minmax(0, 1fr); }
}

.document-expense-source {
  min-width: 0;
  display: grid;
  gap: var(--space-2);
  align-content: start;
  position: sticky;
  top: var(--space-3);
}

.document-expense-source__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.document-expense-source__name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.document-expense-source__hint { margin: 0; color: var(--text-secondary); font-size: 12px; }

.document-expense-source__viewer {
  position: relative;
  min-width: 0;
  overflow: auto;
  height: calc(100vh - 300px);
  min-height: 420px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.document-expense-source__viewer iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.document-expense-source__image { position: relative; display: block; padding: var(--space-3); }
.document-expense-source__image img { display: block; width: 100%; height: auto; }

.document-expense-source__empty {
  display: grid;
  gap: var(--space-3);
  justify-items: start;
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  color: var(--text-secondary);
}

.document-expense-form { min-width: 0; display: grid; gap: var(--space-3); }
.document-expense-form__title { margin: 0; font-size: 16px; font-weight: 600; }
.document-expense-form__sections { display: grid; gap: var(--space-3); min-width: 0; }
.document-expense-form__ventilation { min-width: 0; }

.document-expense-evidence {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.document-expense-evidence__label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.document-expense-evidence__file {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.document-expense-evidence__icon {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
}

.document-expense-evidence__icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.document-expense-evidence__meta { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.document-expense-evidence__meta strong { overflow-wrap: anywhere; }
.document-expense-evidence__meta span { color: var(--text-secondary); font-size: 12px; }

.document-expense-editor__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

/* ------------------------------------------------------------- */
/* Documents — deposit dialog and dropzone (DOC-04)               */
/* ------------------------------------------------------------- */

.document-deposit-dialog {
  width: min(720px, calc(100vw - 2 * var(--space-4)));
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  color: var(--text-primary);
}

.document-deposit-dialog::backdrop { background: rgb(15 23 42 / 45%); }

.document-deposit-dialog__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) 0;
}

.document-deposit-dialog__bar h2 { margin: 0; font-size: 18px; font-weight: 600; }

.document-deposit-dialog__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.document-deposit-dialog__close:hover { background: var(--surface-sunken); }
.document-deposit-dialog__close:focus-visible { outline: 2px solid var(--border-selection); outline-offset: -2px; }

.document-deposit-dialog__body { display: grid; gap: var(--space-4); padding: var(--space-4); }

.document-deposit-step { display: grid; gap: var(--space-2); }

.document-deposit-step__head { display: flex; align-items: flex-start; gap: var(--space-3); }

.document-deposit-step__number {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.document-deposit-step__title { margin: 0; font-size: 14px; font-weight: 600; }
.document-deposit-step__hint { margin: 2px 0 0; color: var(--text-secondary); font-size: 12px; }

.document-deposit-journeys {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-3);
  border: 0;
  padding: 0;
  margin: 0;
}

.document-deposit-journeys legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* No journey is preselected: the choice carries judgment, so the member makes
   it and the submit control stays disabled until then. */
.document-deposit-journey {
  position: relative;
  display: grid;
  gap: 6px;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.document-deposit-journey:hover { background: var(--surface-sunken); }

.document-deposit-journey:has(input:checked) {
  border-color: var(--border-selection);
  background: var(--surface-selection);
}

.document-deposit-journey:has(input:focus-visible) {
  outline: 2px solid var(--border-selection);
  outline-offset: -2px;
}

.document-deposit-journey input { position: absolute; top: var(--space-3); right: var(--space-3); margin: 0; }
.document-deposit-journey__icon { color: var(--text-secondary); }
.document-deposit-journey__icon svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.document-deposit-journey__title { font-weight: 600; padding-right: var(--space-4); }
.document-deposit-journey__hint { color: var(--text-secondary); font-size: 12px; }

.document-dropzone {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-4);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  text-align: center;
}

.document-dropzone--active { border-color: var(--border-selection); background: var(--surface-selection); }
.document-dropzone__icon { color: var(--text-tertiary); }
.document-dropzone__icon svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.document-dropzone__title { margin: 0; font-weight: 600; }
.document-dropzone__hint { margin: 0; color: var(--text-secondary); font-size: 12px; }
.document-dropzone__formats { margin: 0; color: var(--text-tertiary); font-size: 11px; }
.document-dropzone__input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.document-dropzone__selected {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  font-size: 12px;
}

/* The selected-file layout must not override the native hidden state. */
.document-dropzone__selected[hidden] { display: none; }
.document-dropzone__selected strong { overflow-wrap: anywhere; }

.document-deposit-dialog__note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: 12px;
}

.document-deposit-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: 0 var(--space-4) var(--space-4);
}

/* ------------------------------------------------------------- */
/* Documents — workspace queue and decision panel (DOC-03)        */
/* ------------------------------------------------------------- */

.document-workspace__layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, var(--layout-detail-panel-width));
  gap: var(--space-4);
  align-items: start;
}

@media (max-width: 1024px) {
  .document-workspace__layout { grid-template-columns: minmax(0, 1fr); }
}

.document-list-table--workspace th:nth-child(1) { width: 42%; }
.document-list-table--workspace th:nth-child(2) { width: 20%; }
.document-list-table--workspace th:nth-child(3) { width: 14%; }
.document-list-table--workspace th:nth-child(4) { width: 16%; }
.document-list-table--workspace th:nth-child(5) { width: 8%; }

/* Row state contract: selection is a surface plus an accessible state, focus is
   an outline. No inset side band is used for either. */
.document-list-row--selected td { background: var(--surface-selection); box-shadow: none; }
.document-list-row__reading { display: block; margin-top: 2px; }
.document-list-row__journey { color: var(--text-secondary); }
.document-list-row__journey--undeclared { color: var(--text-tertiary); font-style: italic; }

.document-decision-panel {
  position: sticky;
  top: var(--space-3);
  display: grid;
  gap: var(--space-3);
  align-content: start;
  padding: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
}

.document-decision-panel__head { display: flex; gap: var(--space-3); align-items: flex-start; }

.document-decision-panel__thumb {
  display: grid;
  place-items: center;
  flex: 0 0 64px;
  width: 64px;
  height: 80px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}

.document-decision-panel__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface-card);
}
.document-decision-panel__thumb .document-thumbnail__fallback-glyph { width: 30px; height: 34px; }
.document-decision-panel__thumb .document-thumbnail__fallback-glyph svg { width: 20px; height: 25px; }
.document-decision-panel__thumb .document-thumbnail__fallback-label { font-size: 8px; }

.document-decision-panel__identity { min-width: 0; display: grid; gap: 2px; }
.document-decision-panel__identity h2 { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.document-decision-panel__subtitle { margin: 0; color: var(--text-secondary); font-size: 12px; }

.document-decision-panel__facts { display: grid; gap: 6px; margin: 0; }
.document-decision-panel__facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.document-decision-panel__facts dt { color: var(--text-secondary); font-size: 12px; }
.document-decision-panel__facts dd { margin: 0; font-size: 12px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.document-decision-panel__reading { margin: 0; }
.document-decision-panel__action { justify-content: center; }
.document-decision-panel__note { margin: 0; color: var(--text-secondary); font-size: 12px; }
.document-decision-panel__empty { margin: 0; color: var(--text-secondary); font-size: 12px; }

/* ------------------------------------------------------------- */
/* Documents — reading suggestions (DOC-05, DOC-06)               */
/* ------------------------------------------------------------- */

/* A suggestion is a discreet line under its own field: no AI badge, no score,
   no banner. It states where the value comes from and offers two explicit
   gestures. */
.document-suggestion {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0 0;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: 12px;
}

.document-suggestion__bolt { color: var(--text-tertiary); }
.document-suggestion__text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.document-suggestion__text strong { color: var(--text-primary); }
.document-suggestion__separator { color: var(--text-tertiary); }

.document-suggestion__action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-700);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.document-suggestion__action:hover { text-decoration: underline; }
.document-suggestion__action:focus-visible { outline: 2px solid var(--border-selection); outline-offset: 2px; }

/* A field filled from the document says so next to itself, in one discreet
   mark. It carries its own words, so the provenance does not rest on the icon
   alone, and it disappears as soon as the member edits the value. */
.document-prefill-origin {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin: 4px 0 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.document-prefill-origin__bolt { color: var(--text-tertiary); }
.document-prefill-origin__text { color: var(--text-secondary); }

/* origin_marker (PROP-001): the provenance of a configured or proposed value,
   in words next to its label. Removed as soon as the member changes it. */
.origin-marker {
  margin-left: 6px;
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/* exception_resolution (PROP-001 §5): causes as plain choices under a
   work_note; no coloured callout, no preselected value. */
.exception-resolution {
  display: grid;
  gap: var(--space-2);
}

.exception-resolution__causes {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.exception-resolution__cause {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.exception-resolution__cause:focus-visible { outline: 2px solid var(--border-selection); outline-offset: 2px; }

.exception-resolution__other > summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
}

/* reason_chip: up to three neutral reasons; no colour carries meaning. */
.reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.reason-chip {
  padding: 1px 6px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 12px;
}

/* The reading may propose another journey; accepting is an explicit gesture,
   never a consequence of the reading itself. */
.document-journey-change {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.document-journey-change__message {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ------------------------------------------------------------- */
/* Documents — period filter (DOC-03)                             */
/* ------------------------------------------------------------- */

/* One control instead of two bare date inputs: closed it states the active
   window in words, open it offers the usual windows first and an explicit
   range second. Same <details> grammar as the Banque amount filter. */
.period-filter {
  position: relative;
  min-width: var(--layout-context-control-min);
}

.period-filter summary { list-style: none; cursor: pointer; }
.period-filter summary::-webkit-details-marker { display: none; }

.period-filter__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
}

.period-filter__summary svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.period-filter__summary span { overflow: hidden; text-overflow: ellipsis; }

.period-filter__summary::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 11px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--text-tertiary);
  border-bottom: 1.5px solid var(--text-tertiary);
  transform: rotate(45deg);
}

.period-filter[open] .period-filter__summary,
.period-filter--active .period-filter__summary {
  border-color: var(--border-selection);
  color: var(--text-primary);
}

.period-filter--active .period-filter__summary { background: var(--surface-selection); }

.period-filter__panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  gap: var(--space-3);
  min-width: 260px;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: var(--shadow-md, 0 8px 24px rgb(15 23 42 / 12%));
}

.period-filter__presets {
  display: grid;
  gap: 2px;
  border: 0;
  padding: 0;
  margin: 0;
}

.period-filter__presets label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}

.period-filter__presets label:hover { background: var(--surface-sunken); }
.period-filter__presets input { margin: 0; }

.period-filter__range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.period-filter__range label { display: grid; gap: 3px; font-size: 11px; color: var(--text-tertiary); }

.period-filter__range input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
}

.period-filter__range input:focus-visible {
  outline: 2px solid var(--border-selection);
  outline-offset: -1px;
}

/* Choosing an explicit range is itself the "custom" choice, so the radio
   follows the fields rather than the user having to set both. */
.period-filter__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-2);
}

/* --- Onboarding : trois mécanismes distincts, trois poids distincts ------ */

/* 1. Next best action : capacité permanente du produit. C'est la seule bande
   qui porte un bouton primaire, et elle survit au repli de « Premiers pas ». */
.next-best {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-5);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}
.next-best__eyebrow {
  margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-secondary);
}
.next-best__label { font-size: var(--text-base); font-weight: 600; margin: var(--space-1) 0 0; color: var(--text-primary); }
.next-best__explanation { margin: var(--space-1) 0 0; color: var(--text-secondary); font-size: 13px; }
.next-best__reason { margin: var(--space-1) 0 0; color: var(--text-secondary); font-size: 12px; opacity: .85; }
.next-best__secondary { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.next-best__secondary-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); font-size: 13px; }
.next-best__actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

/* 2. « Premiers pas » : aide temporaire. Aucun bouton primaire, et elle
   s'efface visuellement une fois le parcours terminé. */
.first-steps {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
}
.first-steps--done { opacity: .7; }
.first-steps__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.first-steps__head-right { display: flex; align-items: center; gap: var(--space-3); }
.first-steps__title { font-size: 13px; font-weight: 600; margin: 0; color: var(--text-secondary); }
.first-steps__progress { font-size: 12px; color: var(--text-secondary); }
.first-steps__toggle { margin: 0; }
.first-steps__goal-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.first-steps__goal { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); font-size: 13px; }
.first-steps__goal-state { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
.first-steps__goal--done { color: var(--text-secondary); }
.first-steps__goal-hint { color: var(--text-secondary); }

/* The tour is a bubble in the corner, never an overlay: the screen underneath
   stays readable and clickable throughout. */
.guided-tour {
  position: fixed; right: var(--space-6); bottom: var(--space-6); z-index: 40;
  width: min(360px, calc(100vw - 2 * var(--space-6)));
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: var(--space-5);
}
.guided-tour__counter { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
.guided-tour__title { font-size: var(--text-base); font-weight: 600; margin: var(--space-2) 0 0; }
.guided-tour__body { font-size: 13px; color: var(--text-secondary); margin: var(--space-2) 0 var(--space-4); }
.guided-tour__actions { display: flex; gap: var(--space-2); justify-content: flex-end; }
[data-guide-active] { outline: 2px solid var(--brand-deep); outline-offset: 3px; border-radius: var(--radius-sm); }

.guided-tour__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.guided-tour__pause {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.guided-tour__instruction {
  min-height: 18px;
  margin: calc(-1 * var(--space-2)) 0 var(--space-4);
  color: var(--text-tertiary);
  font-size: 12px;
}
.guided-tour__actions { flex-wrap: wrap; }

/* HELP-001 — « Aide » flyout (HELP-01/HELP-02). It opens against the
   navigation and over the workspace: the page is not resized, a business
   side panel underneath stays put, and there is no backdrop. Its height is
   the viewport's and its body scrolls on its own. */
.help-flyout {
  position: fixed;
  z-index: 120;
  top: 0;
  bottom: 0;
  left: var(--layout-sidebar-width);
  width: 380px;
  max-width: calc(100vw - var(--layout-sidebar-width));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface-overlay);
  border-right: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}
.help-flyout[hidden],
.help-flyout [hidden] { display: none; }
.help-flyout:focus { outline: none; }
.help-flyout__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-3);
}
.help-flyout__title { margin: 0; font-size: var(--text-xl); font-weight: 600; }
.help-flyout__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.help-flyout__close:hover { background: var(--slate-100); color: var(--text-primary); }
.help-flyout__body {
  display: grid;
  align-content: start;
  gap: var(--space-4);
  padding: 0 var(--space-5) var(--space-5);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.help-flyout__resume { width: 100%; justify-content: center; }
.help-flyout__guide-block { display: grid; gap: var(--space-1); }
.help-flyout__guide {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-selection);
  color: var(--action-primary);
  font-weight: 600;
}
.help-flyout__guide:hover { text-decoration: none; background: var(--violet-100); }
.help-flyout__guide-title,
.help-flyout__muted { margin: 0; color: var(--text-secondary); font-size: 12px; }
.help-flyout__label,
.help-flyout__section-title {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
}
.help-flyout__segments { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: 13px; }
.help-flyout__segments li { display: grid; gap: 2px; }
.help-flyout__foot {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-5) var(--space-4);
  border-top: 1px solid var(--border-subtle);
}
.help-flyout__foot-link { padding: var(--space-1) 0; font-size: 14px; font-weight: 500; color: var(--action-primary); }
.help-flyout a:focus-visible,
.help-flyout button:focus-visible,
.app-sidebar__help:focus-visible {
  outline: 2px solid var(--border-selection);
  outline-offset: 2px;
}

/* Search field shared by the flyout and the help centre. */
.help-search { position: relative; display: flex; align-items: center; }
.help-search__icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-tertiary);
  stroke-width: 1.75;
  stroke-linecap: round;
  pointer-events: none;
}
.help-search__input { padding-left: 38px; }

/* A help resource as a ledger row: rows split by hairlines, never cards. */
.help-list { display: grid; margin: 0; padding: 0; list-style: none; }
.help-row + .help-row { border-top: 1px solid var(--border-subtle); }
.help-row__link {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  color: var(--text-primary);
}
.help-row__link:hover { text-decoration: none; }
.help-row__link:hover .help-row__title { text-decoration: underline; }
.help-row__icon { display: inline-flex; padding-top: 2px; color: var(--text-secondary); }
.help-row__text { display: grid; gap: 2px; min-width: 0; }
.help-row__kind { color: var(--text-tertiary); font-size: 12px; }
.help-row__title { color: var(--action-primary); font-size: 14px; font-weight: 600; }
.help-row__summary { color: var(--text-secondary); font-size: 13px; }
.help-row__chevron { align-self: center; color: var(--text-tertiary); }

@media (max-width: 760px) {
  /* The navigation is no longer a column: the flyout becomes a drawer over
     the page, from the left edge, without closing what is underneath. */
  .help-flyout {
    left: 0;
    width: min(380px, 100vw);
    max-width: 100vw;
  }
}

.guided-catalog__journey {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
}
.guided-catalog__journey-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}
.guided-catalog__journey-head > div { display: grid; gap: var(--space-1); }
.guided-catalog__parts-label {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.guided-catalog__journey h2,
.guided-catalog__segment h3,
.guided-catalog__segment p { margin: 0; }
.guided-catalog__segments { display: grid; }
.guided-catalog__segment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.guided-catalog__segment > div { display: grid; gap: var(--space-1); }
.guided-catalog__segment p { color: var(--text-secondary); font-size: 13px; }

/* ROLE-CONTRIB-003: the contributor's two entries, side by side when room allows. */
.contributor-entries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  align-items: start;
}

/* BLK-001: completion blockers — second-level Banque entry and derived shortcut. */
.completion-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.work-note__action {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.work-note__action:hover { text-decoration: underline; }

.completion-shortcut__text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  font-size: 14px;
}

.completion-shortcut__detail {
  color: var(--text-secondary);
  font-size: 13px;
}

.completion-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.completion-filters .bank-filter-field {
  flex: 0 1 220px;
}

.completion-filters .btn {
  flex: 0 0 auto;
  width: auto;
}

.completion-filters__note {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.completion-filters__export {
  margin-left: auto;
}

.completion-table td.nowrap {
  white-space: nowrap;
}

.tbl.completion-table th,
.tbl.completion-table td {
  padding: var(--space-2);
}

.tbl.completion-table .completion-table__reason {
  padding-left: var(--space-4);
  white-space: nowrap;
}

/* INFO-REQ-002: information request — row state, side panel next to the blockers list. */
.completion-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.completion-workspace--panel {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

.completion-workspace--panel .completion-table { min-width: 960px; }

.completion-table tr.completion-row--selected td { background: var(--slate-50); }

@media (max-width: 1100px) {
  .completion-workspace--panel { grid-template-columns: minmax(0, 1fr); }
}

.completion-request-state {
  display: block;
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 12.5px;
  white-space: nowrap;
}

.completion-request-state a { margin-left: var(--space-1); }

.completion-resolved-requests {
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  font-size: 13px;
}

.completion-resolved-requests__title { margin: 0 0 var(--space-1); font-weight: 600; }
.completion-resolved-requests ul { margin: 0; padding-left: var(--space-4); }

.request-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: sticky;
  top: var(--space-4);
  max-height: calc(100vh - 2 * var(--space-4));
  overflow-y: auto;
  font-size: var(--text-sm);
}

.request-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.request-panel__title { margin: 0; font-size: var(--text-base); font-weight: 600; }
.request-panel__subtitle { margin: 0 0 var(--space-1); font-size: 13px; font-weight: 600; color: var(--text-secondary); }

.request-panel__feedback,
.request-panel__error,
.request-panel__resolved {
  margin: 0;
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.request-panel__error { color: var(--red-700); }
.request-panel__resolved { display: flex; flex-direction: column; gap: var(--space-2); }
.request-panel__resolved p { margin: 0; }

.request-panel__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-3);
  margin: 0;
}

.request-panel__facts dt { font-size: 12px; color: var(--text-tertiary); }
.request-panel__facts dd { margin: 0; overflow-wrap: anywhere; }

.request-panel__text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.request-panel__meta { margin: 0; font-size: 12px; }
.request-panel__hint { margin: var(--space-2) 0 0; color: var(--text-secondary); font-size: 13px; }

.request-panel__privacy {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--slate-50);
  color: var(--text-secondary);
  font-size: 13px;
}

.request-panel__privacy p { margin: 0; }
.request-panel__privacy p + p { margin-top: var(--space-1); }

.request-panel__response + .request-panel__response {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
}

.request-panel__document {
  margin-top: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.request-panel__docname { margin: 2px 0 var(--space-1); font-weight: 500; overflow-wrap: anywhere; }

.request-panel__inline-form,
.request-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.request-panel__inline-form + .request-panel__inline-form { margin-top: var(--space-1); }
.request-panel__actions form { margin: 0; }

.request-panel__follow-up summary {
  cursor: pointer;
  color: var(--slate-700);
  font-weight: 500;
}

.request-panel__follow-up summary:focus-visible,
.completion-request-state a:focus-visible {
  outline: 2px solid var(--blue-700);
  outline-offset: 2px;
}

.request-panel__follow-up form { margin-top: var(--space-2); }

.request-panel__timeline { margin: 0; padding: 0; list-style: none; color: var(--text-secondary); font-size: 13px; }

.request-answer { max-width: 760px; }

/* --- Loading splash (UX-008) ------------------------------------------------
   Covers the workspace only: the navigation stays in place while the next page
   loads. Plain page surface, no container around the mark (IDENTITY-1). */
.action-pending { cursor: progress !important; }
.action-pending::after {
  content: ""; display: inline-block; width: .85em; height: .85em; margin-inline-start: .5em;
  vertical-align: -.12em; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: action-pending-spin .75s linear infinite;
}
.action-progress-status { display: inline-flex; align-items: center; gap: var(--space-2); margin-inline-start: var(--space-2); color: var(--text-secondary); font-size: 13px; }
@keyframes action-pending-spin { to { transform: rotate(360deg); } }
.loading-splash {
  position: fixed;
  inset: 0 0 0 var(--layout-sidebar-width);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  background: var(--surface-page);
  animation: loading-splash-in 160ms ease-out;
}
.loading-splash[hidden] { display: none; }
.loading-splash__mark { display: block; width: 64px; height: 64px; }
.loading-splash__label { margin: 0; font-size: 14px; color: var(--text-secondary); }
@keyframes loading-splash-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 760px) {
  .loading-splash { inset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .action-pending::after, .loading-splash { animation: none; }
}

/* --- Error pages (UX-008) -------------------------------------------------- */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--surface-page);
}
.error-page__card {
  width: 100%;
  max-width: 520px;
  padding: var(--space-8);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.error-page__lockup { display: block; height: 28px; width: auto; margin-bottom: var(--space-6); }
.error-page__code { margin: 0 0 var(--space-1); font-size: 13px; color: var(--text-secondary); }
.error-page__title { margin: 0 0 var(--space-3); font-size: var(--text-2xl); font-weight: 600; color: var(--text-primary); }
.error-page__text { margin: 0 0 var(--space-6); color: var(--text-secondary); }
.error-page__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.error-page__meta { margin: var(--space-6) 0 0; font-size: 13px; color: var(--text-secondary); }

/* Breadcrumb: where a page sits, above its title (replaces page eyebrows). */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-tertiary);
}
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-primary); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text-primary); }
