/* ============================================================
   Portail des Caisses de Secours — Sapeurs-Pompiers
   Thème institutionnel clair — v1.5.0
   ============================================================ */

:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8f0;
  --border-strong: #cdd6e3;

  --ink: #16233c;
  --text: #35435e;
  --text-soft: #66738c;
  --text-faint: #8f99ab;

  --red: #b3282d;
  --red-dark: #912024;
  --red-soft: #faedec;
  --red-border: #ecd2d1;

  --navy: #1f3a5f;
  --navy-dark: #16294a;
  --navy-soft: #e9eef6;

  --green: #177a4c;
  --green-soft: #e7f4ed;
  --green-border: #c7e4d4;

  --amber: #935f10;
  --amber-soft: #fdf3de;
  --amber-border: #f0dfb7;

  --focus-ring: rgba(31, 58, 95, 0.18);
  --shadow-sm: 0 1px 2px rgba(22, 35, 60, 0.06), 0 1px 3px rgba(22, 35, 60, 0.04);
  --shadow-md: 0 8px 24px rgba(22, 35, 60, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

h1 { font-size: 1.45rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }

p { color: var(--text); }

a { color: var(--navy); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--red); }

code {
  font-family: 'SF Mono', ui-monospace, 'Cascadia Code', Menlo, monospace;
  font-size: 0.85em;
  background: var(--navy-soft);
  color: var(--navy);
  padding: 2px 7px;
  border-radius: 6px;
}

.mono {
  font-family: 'SF Mono', ui-monospace, 'Cascadia Code', Menlo, monospace;
  font-size: 0.92em;
  letter-spacing: 0.01em;
}

/* ------------------------------------------------------------
   Icônes SVG inline
   ------------------------------------------------------------ */
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: -4px;
}
.icon-sm { width: 16px; height: 16px; vertical-align: -3px; }
.icon-lg { width: 40px; height: 40px; }

/* ------------------------------------------------------------
   Barre supérieure
   ------------------------------------------------------------ */
.topbar {
  background: var(--surface);
  border-top: 3px solid var(--red);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }

.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 0.98rem; font-weight: 650; letter-spacing: -0.01em; }
.brand-text small { font-size: 0.72rem; color: var(--text-soft); font-weight: 500; letter-spacing: 0.02em; }

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.topnav a {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--text-soft);
}
.topnav a:hover { background: var(--surface-2); color: var(--ink); }
.topnav a.active { color: var(--red); background: var(--red-soft); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  margin-right: 6px;
  background: var(--navy-soft);
  color: var(--navy);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ------------------------------------------------------------
   Structure de page
   ------------------------------------------------------------ */
.page {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 34px 24px 20px;
  flex: 1;
}

.page-narrow { max-width: 660px; }
.page-wide { max-width: 1160px; }

.page-head { margin-bottom: 24px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { color: var(--text-soft); font-size: 0.94rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  margin-bottom: 20px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.card-title .icon { color: var(--red); }
.card-subtitle {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 22px 0;
}

/* ------------------------------------------------------------
   Connexion
   ------------------------------------------------------------ */
.auth-wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 7vh 20px 30px;
  flex: 1;
}

.auth-brand {
  text-align: center;
  margin-bottom: 26px;
}
.auth-brand .brand-mark { width: 52px; height: 52px; margin-bottom: 12px; }
.auth-brand h1 { font-size: 1.35rem; margin-bottom: 5px; }
.auth-brand p { color: var(--text-soft); font-size: 0.92rem; }

/* ------------------------------------------------------------
   Formulaires
   ------------------------------------------------------------ */
.input-group { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }

.input-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
}

.input-group input,
.input-group select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.input-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366738c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
  cursor: pointer;
}

.input-group input::placeholder { color: var(--text-faint); }

.input-group input:focus,
.input-group select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.field-hint { font-size: 0.8rem; color: var(--text-soft); }

.field-status { font-size: 0.83rem; font-weight: 550; display: none; align-items: center; gap: 6px; }
.field-status.ok { display: flex; color: var(--green); }
.field-status.ko { display: flex; color: var(--red); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.form-grid .full { grid-column: 1 / -1; }

/* ------------------------------------------------------------
   Boutons
   ------------------------------------------------------------ */
button { font-family: inherit; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 1px 2px rgba(145, 32, 36, 0.3);
}
.btn-primary:hover { background: var(--red-dark); }

.btn-navy {
  background: var(--navy);
  color: #fff;
}
.btn-navy:hover { background: var(--navy-dark); }

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }

.btn-block { width: 100%; }

/* ------------------------------------------------------------
   Indicateur d'étapes
   ------------------------------------------------------------ */
.stepper {
  display: flex;
  align-items: flex-start;
  margin-bottom: 26px;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  text-align: center;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: calc(50% + 24px);
  right: calc(-50% + 24px);
  height: 2px;
  background: var(--border-strong);
  border-radius: 2px;
}
.step.done:not(:last-child)::after { background: var(--navy); }

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 650;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  color: var(--text-soft);
  z-index: 1;
  transition: all 0.2s;
}

.step-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-faint);
}

.step.active .step-dot {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 0 0 4px var(--red-soft);
}
.step.active .step-label { color: var(--red); }

.step.done .step-dot {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.step.done .step-label { color: var(--navy); }

/* ------------------------------------------------------------
   Assistant (étapes du dashboard)
   ------------------------------------------------------------ */
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fadeIn 0.3s ease; }

.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 42px 24px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--red);
  background: var(--red-soft);
}
.drop-zone .icon-lg { color: var(--red); margin-bottom: 10px; }
.drop-zone h3 { margin-bottom: 4px; }
.drop-zone p { font-size: 0.85rem; color: var(--text-soft); }

/* ------------------------------------------------------------
   Alertes et encadrés
   ------------------------------------------------------------ */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.55;
  margin-bottom: 20px;
  border: 1px solid;
}
.alert .icon { margin-top: 2px; }
.alert strong { display: block; margin-bottom: 2px; }

.alert-info    { background: var(--navy-soft);  border-color: #d4deec; color: var(--navy); }
.alert-success { background: var(--green-soft); border-color: var(--green-border); color: var(--green); }
.alert-warning { background: var(--amber-soft); border-color: var(--amber-border); color: var(--amber); }
.alert-danger  { background: var(--red-soft);   border-color: var(--red-border); color: var(--red-dark); }

.alert a { font-weight: 600; text-decoration: underline; color: inherit; }

/* ------------------------------------------------------------
   Tuiles statistiques (récapitulatif)
   ------------------------------------------------------------ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.stat-tile .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.stat-tile .stat-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  margin-top: 3px;
}
.stat-tile.ok { border-color: var(--green-border); background: var(--green-soft); }
.stat-tile.ok .stat-value { color: var(--green); }
.stat-tile.ko { border-color: var(--red-border); background: var(--red-soft); }
.stat-tile.ko .stat-value { color: var(--red); }

/* ------------------------------------------------------------
   Tableaux
   ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table th {
  text-align: left;
  padding: 9px 12px;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

table tr:last-child td { border-bottom: none; }
table td strong { color: var(--ink); }

tr.error-row td { color: var(--red-dark); }
tr.error-row td:first-child { font-weight: 600; }

.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }

/* ------------------------------------------------------------
   Résumé compte émetteur
   ------------------------------------------------------------ */
.emitter-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.emitter-box .icon { color: var(--navy); }
.emitter-box .spacer { flex: 1; }
.emitter-box a { font-weight: 600; font-size: 0.85rem; white-space: nowrap; }

/* ------------------------------------------------------------
   Listes clé / valeur (paramètres, admin)
   ------------------------------------------------------------ */
.kv { display: flex; flex-direction: column; }
.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.kv-row:last-child { border-bottom: none; }
.kv-row dt { color: var(--text-soft); font-weight: 500; white-space: nowrap; }
.kv-row dd { color: var(--ink); font-weight: 550; text-align: right; word-break: break-word; }

/* ------------------------------------------------------------
   Cartes caisse (administration)
   ------------------------------------------------------------ */
.caisses-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

.caisse-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
}
.caisse-card h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 9px; }
.caisse-card h3 .icon { color: var(--red); }

.add-new {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-soft);
  text-align: center;
  padding: 22px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.15s;
}
.add-new:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-soft); }

/* ------------------------------------------------------------
   Fenêtre modale
   ------------------------------------------------------------ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(22, 35, 60, 0.45);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  animation: fadeIn 0.2s ease;
}

/* ------------------------------------------------------------
   Pied de page
   ------------------------------------------------------------ */
.site-footer {
  text-align: center;
  padding: 26px 20px 30px;
  font-size: 0.78rem;
  color: var(--text-faint);
  line-height: 1.7;
}
.site-footer a { color: var(--text-soft); font-weight: 550; }
.site-footer a:hover { color: var(--red); }

/* ------------------------------------------------------------
   Libelles de virement par onglet (etape 2)
   ------------------------------------------------------------ */
.sheet-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-message-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sheet-tag {
  flex: 0 0 auto;
  min-width: 118px;
  max-width: 190px;
  padding: 7px 12px;
  background: var(--navy-soft);
  color: var(--navy);
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-message-input {
  flex: 1;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sheet-message-input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

@media (max-width: 640px) {
  .sheet-tag { min-width: 0; max-width: none; width: 100%; text-align: left; }
  .sheet-message-input { min-width: 0; width: 100%; }
}

/* ------------------------------------------------------------
   Case a cocher explicative
   ------------------------------------------------------------ */
.check-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.check-box input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--red);
  cursor: pointer;
}
.check-box label { cursor: pointer; font-size: 0.9rem; line-height: 1.5; }
.check-box label strong { display: block; color: var(--ink); margin-bottom: 2px; }
.check-box label span { color: var(--text-soft); font-size: 0.86rem; }

/* ------------------------------------------------------------
   Correction en ligne
   ------------------------------------------------------------ */
.dossier-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.dossier-bar .spacer { flex: 1; }
.dossier-file { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dossier-file .icon { color: var(--red); }
.dossier-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.retention {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--amber-soft, #fdf3de);
  color: var(--amber);
  border: 1px solid var(--amber-border, #f0dfb7);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn-slim { padding: 7px 14px; font-size: 0.85rem; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-group {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.filter-btn {
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.filter-btn:hover { color: var(--ink); }
.filter-btn.active {
  background: var(--surface);
  color: var(--red);
  box-shadow: var(--shadow-sm);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: var(--surface);
  min-width: 240px;
  flex: 1;
  max-width: 320px;
}
.search-box .icon-sm { color: var(--text-faint); flex-shrink: 0; }
.search-box input {
  border: none;
  outline: none;
  padding: 9px 0;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: transparent;
  width: 100%;
}
.search-box:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Le tableau garde une largeur plancher : en dessous, il défile
   horizontalement plutôt que de tronquer les IBAN et les noms. */
.corrections-table { min-width: 980px; }
.corrections-table td { vertical-align: middle; padding: 7px 10px; }
.corrections-table th { padding: 8px 10px; }
.corrections-table .col-sheet { font-weight: 600; color: var(--ink); white-space: nowrap; }
.corrections-table .col-line { color: var(--text-faint); font-variant-numeric: tabular-nums; }

.corrections-table col.c-sheet  { width: 12%; }
.corrections-table col.c-line   { width: 6%; }
.corrections-table col.c-name   { width: 24%; }
.corrections-table col.c-iban   { width: 27%; }
.corrections-table col.c-amount { width: 12%; }
.corrections-table col.c-status { width: 19%; }

.cell-input {
  width: 100%;
  min-width: 120px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 7px 9px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.cell-input.mono {
  font-family: 'SF Mono', ui-monospace, Menlo, monospace;
  font-size: 0.82rem;
  min-width: 245px;   /* un IBAN suisse mis en forme tient en entier */
}
.cell-input.num { text-align: right; min-width: 90px; }
.cell-input:hover { border-color: var(--border-strong); background: var(--surface); }
.cell-input:focus {
  border-color: var(--navy);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.cell-input::placeholder { color: var(--red); opacity: 0.65; font-style: italic; }

.cell-hint {
  display: block;
  font-size: 0.76rem;
  font-weight: 550;
  padding: 2px 9px 0;
  line-height: 1.35;
}
.cell-hint.ok { color: var(--green); }
.cell-hint.ko { color: var(--red); }

.row-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-error .row-badge { background: var(--red-soft); color: var(--red-dark); }
.status-ok .row-badge { background: var(--green-soft); color: var(--green); }

.corr-row.status-error td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.corr-row.is-corrected td:first-child { box-shadow: inset 3px 0 0 var(--navy); }
.corr-row.is-saving { opacity: 0.55; }
.corr-row.just-saved { background: var(--green-soft); transition: background 0.9s ease; }

.link-btn {
  border: none;
  background: none;
  color: var(--navy);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 0 0 8px;
  text-decoration: underline;
}
.link-btn:hover { color: var(--red); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 38px 20px;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.back-link { font-size: 0.88rem; font-weight: 600; }

/* Dossiers en cours (générateur) */
.dossier-list { display: flex; flex-direction: column; gap: 10px; }
.dossier-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  background: var(--surface-2);
  font-size: 0.89rem;
}
.dossier-item .icon { color: var(--text-soft); flex-shrink: 0; }
.dossier-item .name { font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dossier-item .meta { color: var(--text-soft); font-size: 0.82rem; }
.dossier-item .spacer { flex: 1; }

/* ------------------------------------------------------------
   Retours de la banque
   ------------------------------------------------------------ */
.returns-table { min-width: 900px; }
.returns-table td { vertical-align: top; padding: 11px 12px; }

.returns-table .status-rejete td:first-child,
.returns-table .status-retourne td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.returns-table .status-accepte td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.returns-table .status-avertissement td:first-child { box-shadow: inset 3px 0 0 var(--amber); }

.status-rejete .row-badge, .status-retourne .row-badge { background: var(--red-soft); color: var(--red-dark); }
.status-accepte .row-badge { background: var(--green-soft); color: var(--green); }
.status-avertissement .row-badge { background: var(--amber-soft); color: var(--amber); }

.ret-reason { margin-top: 5px; color: var(--ink); font-weight: 550; font-size: 0.87rem; line-height: 1.4; }
.ret-detail { margin-top: 3px; color: var(--text-soft); font-size: 0.79rem; line-height: 1.4; word-break: break-word; }
.ret-note {
  display: block;
  margin-top: 2px;
  font-size: 0.77rem;
  font-weight: 500;
  color: var(--amber);
}
.ret-origin { color: var(--text-soft); font-size: 0.82rem; line-height: 1.5; }
.ret-origin .ret-file { color: var(--text-faint); font-size: 0.75rem; word-break: break-word; }

@media print {
  .topbar, .site-footer, .toolbar, .drop-zone, .actions-row,
  .dossier-bar .btn, .alert { display: none !important; }
  .card { box-shadow: none; border: none; padding: 0; }
  .page { max-width: none; padding: 0; }
  .ret-row[style*="none"] { display: none !important; }
}

/* ------------------------------------------------------------
   Divers
   ------------------------------------------------------------ */
.status-msg { font-size: 0.88rem; font-weight: 550; margin-top: 12px; display: none; }
.status-msg.ok { display: block; color: var(--green); }
.status-msg.ko { display: block; color: var(--red); }

.actions-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.actions-row .btn { flex: 1; min-width: 220px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .page { padding: 22px 16px; }
  .step-label { font-size: 0.7rem; }
  .kv-row { flex-direction: column; gap: 2px; }
  .kv-row dd { text-align: left; }
}
