/* BGFIBank — UI moderne, polices système, zéro CDN */
:root {
  --teal: #0f6b5c;
  --teal-2: #148f7a;
  --teal-soft: #e6f5f1;
  --blue: #0b4f8c;
  --blue-2: #1565c0;
  --blue-3: #e3f0fb;
  --navy: #0a2540;
  --ink: #15202b;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #f1f5f9;
  --surface: #ffffff;
  --ok: #0d7a4f;
  --ok-bg: #e6f6ef;
  --warn: #9a6700;
  --warn-bg: #fff6e0;
  --danger: #c62828;
  --danger-bg: #fdecea;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --font:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  min-height: 100vh;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.app-header {
  background: linear-gradient(105deg, #071b2e 0%, #0a3a5c 45%, #0f6b5c 100%);
  color: #fff;
  padding: 0 20px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-header .inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  text-decoration: none;
}
.brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4fc3f7, #c4a35a);
  display: grid;
  place-items: center;
  font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.brand span.sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
}

nav.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
nav.main-nav a {
  color: rgba(255, 255, 255, 0.9);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
nav.main-nav a:hover,
nav.main-nav a.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  text-decoration: none;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.user-box .role {
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.btn-logout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.btn-logout:hover {
  background: rgba(255, 255, 255, 0.12);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 16px 56px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.panel h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.lead {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 14px;
}
label.f {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
label.f input,
label.f select,
label.f textarea {
  font: 400 14.5px var(--font);
  color: var(--ink);
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  width: 100%;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
label.f input:focus,
label.f select:focus,
label.f textarea:focus {
  outline: none;
  border-color: var(--blue-2);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 13.5px var(--font);
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
  padding: 10px 18px;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    transform 0.1s;
}
.btn:hover {
  background: var(--teal-2);
  border-color: var(--teal-2);
  color: #fff;
  text-decoration: none;
}
.btn.ghost {
  border-color: #c5d0dc;
}
.btn:active {
  transform: scale(0.98);
}
.btn.ghost {
  background: transparent;
  color: var(--blue);
}
.btn.ghost:hover {
  background: var(--blue-3);
  color: var(--blue);
}
.btn.warn {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}
.btn.warn:hover {
  background: var(--danger-bg);
}
.btn.ok {
  background: var(--ok);
  border-color: var(--ok);
}
.btn.sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 7px;
}
.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

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

.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th,
table.data td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  background: #f0f4f8;
  font-weight: 700;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
table.data tr:last-child td {
  border-bottom: 0;
}
table.data tr:hover td {
  background: rgba(11, 79, 140, 0.03);
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.draft {
  background: #eef2f6;
  color: var(--muted);
}
.badge.submitted {
  background: var(--blue-3);
  color: var(--blue);
}
.badge.in_review,
.badge.docs_incomplete {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge.approved,
.badge.signed,
.badge.active {
  background: var(--ok-bg);
  color: var(--ok);
}
.badge.rejected,
.badge.locked {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge.cancelled,
.badge.archived,
.badge.inactive {
  background: #eee;
  color: #666;
}

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 14px;
  border: 1px solid transparent;
}
.alert.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #b7e4cf;
}
.alert.err {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f5c6c2;
}
.alert.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: #f0d78c;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, var(--navy), var(--blue) 50%, #0d3d6b);
  padding: 24px;
}
.login-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}
.login-card h1 {
  margin: 0 0 4px;
  font-size: 1.4rem;
  color: var(--navy);
  text-align: center;
}
.login-card .slogan {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
}
.login-card .logo-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), #c4a35a);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
.kv:last-child {
  border-bottom: 0;
}
.kv b {
  font-family: var(--mono);
  font-weight: 500;
  text-align: right;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  position: relative;
  padding: 0 0 18px 24px;
  border-left: 2px solid var(--line);
  margin-left: 8px;
}
.timeline li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--blue);
}
.timeline .meta {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}
.timeline .act {
  font-weight: 600;
}

label.chk {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  background: #fafbfc;
  transition:
    border-color 0.15s,
    background 0.15s;
}
label.chk:hover {
  border-color: var(--blue-2);
  background: var(--blue-3);
}
label.chk input {
  margin-top: 3px;
  accent-color: var(--blue);
  width: 16px;
  height: 16px;
}

.type-card {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  background: #fff;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.type-card:hover,
.type-card.on {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
  background: var(--blue-3);
}
.type-card b {
  display: block;
  color: var(--navy);
}
.type-card span {
  font-size: 12px;
  color: var(--muted);
}

.doc-slot {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  background: #fafbfc;
}
.doc-slot.filled {
  border-style: solid;
  border-color: #b7e4cf;
  background: var(--ok-bg);
}

.steps-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.steps-bar a,
.steps-bar span {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #eef2f6;
  color: var(--muted);
  text-decoration: none;
}
.steps-bar a.on,
.steps-bar span.on {
  background: var(--blue);
  color: #fff;
}

.footer-note {
  margin-top: 40px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .app-header .inner {
    padding: 10px 0;
  }
  nav.main-nav {
    width: 100%;
  }
  .panel {
    padding: 16px;
  }
}

/* —— Documents / wizard UX —— */
.mono-tag {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  background: var(--blue-3);
  color: var(--blue);
  padding: 2px 8px;
  border-radius: 6px;
}
.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 18px;
  line-height: 1.5;
}
.progress-bar {
  height: 6px;
  background: #e8eef4;
  border-radius: 999px;
  overflow: hidden;
  margin: 14px 0 4px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
  border-radius: 999px;
  transition: width 0.3s ease;
}
.progress-ring {
  text-align: center;
  background: var(--blue-3);
  border-radius: 12px;
  padding: 8px 14px;
  min-width: 64px;
}
.progress-num {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
}
.progress-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  margin-top: 8px;
}
.doc-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.doc-card:hover {
  border-color: #b8c9d9;
  box-shadow: var(--shadow-sm);
}
.doc-card.is-done {
  border-color: #a8d5c0;
  background: linear-gradient(180deg, #f3fbf7 0%, #fff 40%);
}
.doc-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.doc-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--paper);
  display: grid;
  place-items: center;
  font-size: 18px;
  border: 1px solid var(--line);
}
.doc-card.is-done .doc-icon {
  background: var(--ok-bg);
  border-color: #a8d5c0;
  color: var(--ok);
  font-weight: 700;
}
.doc-title {
  font-weight: 600;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.35;
}
.doc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.doc-help {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.doc-file {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--ok);
  margin-top: 4px;
  word-break: break-all;
}
.doc-upload {
  margin-top: auto;
}
.file-btn {
  display: block;
  cursor: pointer;
  border: 1.5px dashed #c5d0dc;
  border-radius: 9px;
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: #f7fafc;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.file-btn:hover {
  border-color: var(--blue-2);
  background: var(--blue-3);
}
.file-btn input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-btn span {
  pointer-events: none;
}

.ocr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chip {
  font-size: 12px;
  font-family: var(--mono);
  background: #fff;
  border: 1px solid #b7e4cf;
  color: var(--ok);
  padding: 4px 10px;
  border-radius: 999px;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 0 8px;
  margin-top: 8px;
  background: linear-gradient(180deg, transparent, var(--paper) 30%);
}

.steps-bar a,
.steps-bar span {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: #eef2f6;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
}
.steps-bar a.on,
.steps-bar span.on {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(11, 79, 140, 0.25);
}
.steps-bar a:hover {
  background: var(--blue-3);
  color: var(--blue);
}

.steps-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}
.steps-bar a,
.steps-bar span {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: #fff;
  color: #5b6b7c;
  border: 1px solid #e2e8f0;
  text-decoration: none;
}
.steps-bar a.on,
.steps-bar span.on {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

/* =========================================================
   LOGIN BGFI BANK — fidèle à la maquette
   ========================================================= */

.login-page {
  --login-navy: #06346c;
  --login-navy-dark: #04264f;
  --login-gold: #c9a45c;
  --login-ink: #0e2a55;
  --login-muted: #5a6b86;
  --login-line: #d5deea;

  position: relative;
  display: grid;
  place-items: stretch;
  padding: 0;
  grid-template-columns: 62% 38%;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  background: #fff;
  color: var(--login-ink);
  font-family: var(--font, "Segoe UI", Arial, sans-serif);
}

/* ---------- Partie gauche : bleu, diagonale, immeuble ---------- */

.login-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: 100%;
  padding: 0 clamp(32px, 5vw, 80px);
  color: #fff;
  background: linear-gradient(160deg, #04306a 0%, #06397a 55%, #0a4a8d 100%);
  clip-path: polygon(0 0, 100% 0, 81% 100%, 0 100%);
}

/* image de la banque (derrière le texte, en bas à gauche) */
.login-brand::before {
  content: "";
  position: absolute;
  inset: auto 12% 0 0; /* décale l'image vers la gauche : l'enseigne reste visible */
  height: 94%;
  background: url("../bank-bgfi.jpg") right bottom / cover no-repeat;
  mix-blend-mode: luminosity; /* la photo prend le bleu du fond */
  opacity: 0.85;
  -webkit-mask-image:
    linear-gradient(to top, #000 55%, transparent 100%),
    linear-gradient(to right, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to top, #000 55%, transparent 100%),
    linear-gradient(to right, #000 88%, transparent 100%);
  mask-composite: intersect;
  pointer-events: none;
}

/* liseré clair le long de la diagonale */
.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, #5b8fd0, #3a6eb3);
  clip-path: polygon(
    calc(100% - 14px) 0,
    100% 0,
    81% 100%,
    calc(81% - 10px) 100%
  );
  opacity: 0.85;
  pointer-events: none;
}

.login-brand-content {
  position: relative;
  z-index: 1;
  margin-top: -6vh;
}

.login-brand-photo {
  /* même image, en couleurs d'origine, uniquement autour de l'enseigne */
  position: absolute;
  inset: auto 12% 0 0;
  height: 94%;
  background: url("../bank-bgfi.jpg") right bottom / cover no-repeat;
  opacity: 0.95;
  -webkit-mask-image: radial-gradient(
    ellipse 22% 24% at 71% 44%,
    #000 35%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 22% 24% at 71% 44%,
    #000 35%,
    transparent 100%
  );
  pointer-events: none;
}

.login-brand-content::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -90px -140px -90px -120px;
  background: radial-gradient(
    ellipse at 40% 50%,
    rgba(3, 34, 78, 0.85) 0%,
    rgba(3, 34, 78, 0.6) 45%,
    transparent 75%
  );
  pointer-events: none;
}

.login-brand-title {
  margin: 0;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(56px, 6.2vw, 104px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.login-brand-title span {
  color: #a5b39a;
}

.login-brand-content h2 {
  margin: 18px 0 0;
  color: #fff;
  font-size: clamp(22px, 2.4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.login-brand-divider {
  width: min(280px, 60%);
  height: 4px;
  margin: 26px 0 38px;
  border-radius: 2px;
  background: linear-gradient(90deg, #a5b39a, rgba(201, 164, 92, 0));
}

.login-brand-tagline {
  margin: 0;
  color: #fff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(17px, 1.7vw, 28px);
  font-style: italic;
  font-weight: 300;
}

/* ---------- Partie droite : logo + carte ---------- */

.login-panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: clamp(96px, 17vh, 170px) clamp(24px, 4vw, 72px)
    clamp(20px, 4vh, 48px);
  margin-left: -14%; /* passe sous la diagonale */
  padding-left: calc(14% + 40px);
  background:
    radial-gradient(
      ellipse at 80% 100%,
      rgba(226, 236, 249, 0.55),
      transparent 50%
    ),
    #fff;
}

.login-logo {
  position: absolute;
  top: clamp(16px, 3.5vh, 40px);
  right: clamp(24px, 4vw, 70px);
  display: block;
  width: clamp(120px, 12vw, 210px);
  height: auto;
  max-height: 14vh;
  object-fit: contain;
}

.login-box {
  width: 100%;
  max-width: 620px;
  padding: clamp(20px, 4.5vh, 52px) clamp(24px, 3.4vw, 42px)
    clamp(18px, 3.6vh, 38px);
  border: 1px solid rgba(213, 222, 234, 0.7);
  border-radius: 24px;
  background: #fff;
  box-shadow:
    0 24px 60px rgba(14, 42, 85, 0.1),
    0 4px 14px rgba(14, 42, 85, 0.05);
}

.login-box h2 {
  margin: 0;
  color: #0a2a5c;
  font-size: clamp(32px, 3vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.login-box-sub {
  margin: clamp(6px, 1.2vh, 12px) 0 clamp(16px, 3.6vh, 34px);
  color: #34486a;
  font-size: clamp(14px, min(1.35vw, 2.4vh), 20px);
  text-align: center;
}

/* Messages d'erreur */

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
}

.login-error-icon {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

/* Champs */

.login-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.login-input-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 0 20px;
  border: 1px solid var(--login-line);
  border-radius: 14px;
  background: #fff;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.login-input-wrap:focus-within {
  border-color: #3b73b5;
  box-shadow: 0 0 0 4px rgba(20, 75, 133, 0.1);
}

.login-input-wrap > svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  fill: #0a2a5c;
  stroke: none;
}

.login-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 58px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
  color: #0e2a55;
  font: 400 17px var(--font, "Segoe UI", Arial, sans-serif);
}

.login-input-wrap input::placeholder {
  color: #6b7a92;
  opacity: 1;
}

/* Neutralise le fond bleu de l'autofill Chrome (visible sur ta capture) */
.login-input-wrap input:-webkit-autofill,
.login-input-wrap input:-webkit-autofill:hover,
.login-input-wrap input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0e2a55;
  caret-color: #0e2a55;
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 9999s ease-out 0s;
}

.login-password-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #34486a;
  cursor: pointer;
}

.login-password-toggle:hover {
  background: #edf2f8;
}

.login-password-toggle svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-password-toggle .icon-visible {
  display: none;
}
.login-password-toggle[aria-pressed="true"] .icon-visible {
  display: block;
}
.login-password-toggle[aria-pressed="true"] .icon-hidden {
  display: none;
}

/* Bouton */

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 62px;
  margin-top: 2px;
  padding: 14px 22px;
  border: 0;
  border-radius: 14px;
  background: #042a5c;
  box-shadow: 0 10px 22px rgba(4, 42, 92, 0.22);
  color: #fff;
  font: 600 18px var(--font, "Segoe UI", Arial, sans-serif);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  background: #06357a;
  box-shadow: 0 14px 28px rgba(4, 42, 92, 0.28);
}

.login-submit:active {
  transform: translateY(0);
}

.login-submit:focus-visible,
.login-password-toggle:focus-visible {
  outline: 3px solid rgba(39, 111, 180, 0.4);
  outline-offset: 3px;
}

.login-submit svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Mention de sécurité */

.login-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 0;
  color: #34486a;
  font-size: clamp(11px, 0.95vw, 14px);
  text-align: center;
}

.login-security svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: #34486a;
}

/* Le login n'affiche pas la note de bas de page globale */
main.login-main {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
}

main.login-main > .footer-note {
  display: none;
}

/* ==========================================================
   BGFI BANK - NOUVELLE INTERFACE
   Couleurs du thème : #3d789a, #d1deaf, #042A5C, blanc
   ========================================================== */

:root {
  --bgfi-blue: #3d789a;
  --bgfi-green: #d1deaf;
  --bgfi-navy: #042a5c;
  --bgfi-white: #ffffff;
  --bgfi-bg: #f3f7fb;
  --bgfi-border: #dce8f1;
  --bgfi-muted: #7186a2;
  --bgfi-shadow: 0 8px 28px rgba(4, 42, 92, 0.065);
}

body.page-app {
  color: var(--bgfi-navy);
  background:
    radial-gradient(ellipse at 10% 0%, #e9f2f9 0, transparent 36%),
    var(--bgfi-bg);
}

.page-app a {
  color: var(--bgfi-blue);
}

.page-app a:hover {
  color: var(--bgfi-navy);
}

/* --------------------------
   NAVBAR
   -------------------------- */

.app-header {
  position: relative;
  z-index: 20;
  padding: 0 30px;
  color: #fff;
  background: var(--bgfi-navy);
  box-shadow: 0 4px 18px rgba(4, 42, 92, 0.12);
}

.app-header .header-inner {
  width: 100%;
  max-width: 1600px;
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.app-header .brand {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  color: #fff;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.brand-copy .brand-subtitle {
  color: #d6e3f1;
  font-size: 11px;
  line-height: 1.4;
}

.header-account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.account-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--bgfi-green);
  box-shadow: 0 0 0 4px rgba(209, 222, 175, 0.12);
}

.account-role {
  padding: 5px 10px;
  color: var(--bgfi-green);
  border: 1px solid rgba(209, 222, 175, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.header-account form {
  margin: 0;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.btn-logout svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-logout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.5);
}

/* --------------------------
   BANNIÈRE PRINCIPALE
   -------------------------- */

.hero {
  --img-w: 64%; /* largeur de la zone image */
  --cut: 90px; /* pente de la diagonale */
  --stripe: 30px; /* épaisseur de la bande verte */

  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: var(--img-w) 1fr;
  align-items: center;
  width: 100%;
  min-height: 360px;
  padding: 0; /* important : plus de padding ici */
  overflow: hidden;
  background: linear-gradient(105deg, #edf5fb 0%, #fff 55%, #f6f9fc 100%);
  border-bottom: 1px solid #e4edf4;
}

.hero::after {
  display: none; /* supprime l'ancien carré décoratif */
}

.hero-building {
  position: relative;
  align-self: stretch;
  min-height: 100%;
  overflow: hidden;
  background: #e0edf7;
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--cut)) 100%, 0 100%);
}

.hero-building::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(0deg, rgba(4, 42, 92, 0.12), transparent 55%);
  pointer-events: none;
}

.hero-building img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
}

.hero-decoration {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  left: calc(var(--img-w) - var(--cut) - 1px); /* -1px : pas de fente */
  width: calc(var(--cut) + 120px);
  pointer-events: none;
}

.hero-slash {
  position: absolute;
  top: 0;
  bottom: 0;
  clip-path: polygon(
    var(--cut) 0,
    100% 0,
    calc(100% - var(--cut)) 100%,
    0 100%
  );
}

.hero-slash-green {
  left: 0;
  width: calc(var(--cut) + var(--stripe) + 1px);
  background: rgba(209, 222, 175, 0.8);
}

.hero-slash-blue {
  left: calc(var(--stripe) + 8px);
  width: calc(var(--cut) + 24px);
  background: rgba(61, 120, 154, 0.3);
}

.hero-notebook {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: calc(var(--img-w) - var(--cut) / 2 + 30px);
  width: clamp(150px, 15vw, 250px);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
}

.notebook-image {
  display: block;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 265px;
  max-height: 245px;
  object-fit: contain;
  filter: drop-shadow(0 12px 13px rgba(4, 42, 92, 0.12));
  animation: notebook-float 5s ease-in-out infinite;
}

.notebook-line {
  position: absolute;
  z-index: 0;
  left: 2%;
  right: 2%;
  height: 1px;
  background: var(--bgfi-green);
  transform-origin: center;
  pointer-events: none;
}

.notebook-line-one {
  bottom: 22%;
  transform: rotate(-9deg);
}

.notebook-line-two {
  bottom: 16%;
  left: 12%;
  right: 12%;
  transform: rotate(5deg);
}

@keyframes notebook-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.hero-content {
  grid-column: 2;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  justify-self: start;
  padding: 30px clamp(24px, 4vw, 68px) 30px clamp(130px, 10vw, 190px);
}

.hero-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--bgfi-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.hero-title {
  min-height: 2.65em;
  margin: 0 0 12px;
  color: var(--bgfi-navy);
  font-size: clamp(23px, 2.2vw, 34px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.035em;
}

#typing-text {
  background: linear-gradient(90deg, var(--bgfi-navy), var(--bgfi-blue));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  margin-left: 4px;
  vertical-align: -0.08em;
  background: var(--bgfi-blue);
  animation: cursor-blink 0.85s steps(2, start) infinite;
}

@keyframes cursor-blink {
  to {
    visibility: hidden;
  }
}

.hero-description {
  max-width: 450px;
  margin: 0 0 20px;
  color: var(--bgfi-muted);
  font-size: 14px;
  line-height: 1.8;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 12px 22px;
  color: #fff !important;
  border: 1px solid var(--bgfi-navy);
  border-radius: 999px;
  background: var(--bgfi-navy);
  box-shadow: 0 7px 17px rgba(4, 42, 92, 0.15);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

.hero-cta svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.hero-cta:hover {
  color: #fff;
  background: var(--bgfi-blue);
  border-color: var(--bgfi-blue);
  box-shadow: 0 10px 22px rgba(4, 42, 92, 0.2);
  transform: translateY(-2px);
  text-decoration: none;
}

/* --------------------------
   NAVIGATION EN CARTES KPI
   -------------------------- */

.kpi-navigation {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 22px clamp(20px, 2.6vw, 42px) 8px;
}

.kpi-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 94px;
  padding: 15px 13px;
  color: var(--bgfi-navy) !important;
  border: 1px solid var(--bgfi-border);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(4, 42, 92, 0.035);
  text-decoration: none !important;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    border-color 0.2s;
}

.kpi-card:hover {
  color: var(--bgfi-navy);
  border-color: #a7c8dc;
  box-shadow: var(--bgfi-shadow);
  transform: translateY(-3px);
}

.kpi-card.is-active {
  color: #fff !important;
  border-color: var(--bgfi-navy);
  background: var(--bgfi-navy);
  box-shadow: 0 8px 20px rgba(4, 42, 92, 0.16);
}

.kpi-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  color: var(--bgfi-blue);
  border-radius: 50%;
  background: #e8f2f8;
}

.kpi-icon svg {
  display: block;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-card.is-active .kpi-icon {
  color: var(--bgfi-navy);
  background: var(--bgfi-green);
}

.kpi-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.kpi-copy strong {
  overflow-wrap: anywhere;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.kpi-copy small {
  color: var(--bgfi-muted);
  font-size: 10px;
  line-height: 1.4;
}

.kpi-card.is-active .kpi-copy small {
  color: #d5e3f0;
}

.kpi-arrow {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--bgfi-blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-card.is-active .kpi-arrow {
  stroke: var(--bgfi-green);
}

/* --------------------------
   CONTENU PRINCIPAL
   -------------------------- */

.page-app .wrap {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 18px clamp(20px, 2.6vw, 42px) 34px;
}

.page-app .panel {
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--bgfi-border);
  border-radius: 17px;
  background: #fff;
  box-shadow: var(--bgfi-shadow);
}

.page-app .panel h2 {
  color: var(--bgfi-navy);
}

.page-app .lead {
  color: var(--bgfi-muted);
}

/* --------------------------
   EN-TÊTE DU TABLEAU
   -------------------------- */

.dossier-panel {
  min-width: 0;
}

.dossier-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.dossier-heading-icon {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--bgfi-navy);
  border: 1px solid #d7e6f0;
  border-radius: 50%;
  background: #eaf3f9;
}

.dossier-heading-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dossier-heading > div:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.dossier-heading h2 {
  margin: 0 0 4px;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.dossier-heading .lead {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.page-app .dossier-create-btn {
  flex-shrink: 0;
  color: #fff;
  border-color: var(--bgfi-navy);
  border-radius: 10px;
  background: var(--bgfi-navy);
}

.page-app .dossier-create-btn:hover {
  color: #fff;
  border-color: var(--bgfi-blue);
  background: var(--bgfi-blue);
}

.dossier-create-btn > span {
  font-size: 19px;
  line-height: 1;
}

/* --------------------------
   FILTRES ET RECHERCHE
   -------------------------- */

.dossier-filters {
  margin: 0 0 17px;
  padding: 13px;
  border: 1px solid #d9e9e6;
  border-radius: 12px;
  background: linear-gradient(110deg, #f0f8f4, #eff6fa);
}

.filter-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px 3px;
  color: #167553;
  font-size: 12px;
  font-weight: 800;
}

.filter-heading svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.filter-controls {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.filter-controls .f {
  min-width: 0;
  margin: 0;
}

.filter-status {
  flex: 0 0 190px;
}

.filter-search {
  flex: 1 1 auto;
}

.page-app .filter-controls select,
.page-app .filter-controls input {
  width: 100%;
  min-height: 43px;
  padding: 10px 13px;
  color: var(--bgfi-navy);
  border: 1px solid #d8e5ee;
  border-radius: 9px;
  background-color: #fff;
  font: 400 13px var(--font);
}

.page-app .filter-controls select:focus,
.page-app .filter-controls input:focus {
  outline: none;
  border-color: var(--bgfi-blue);
  box-shadow: 0 0 0 3px rgba(61, 120, 154, 0.12);
}

.search-input-wrap {
  position: relative;
  display: block;
}

.search-input-wrap > svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--bgfi-blue);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
  transform: translateY(-50%);
}

.page-app .search-input-wrap input {
  padding-left: 41px;
}

.page-app .filter-submit {
  align-self: stretch;
  justify-content: center;
  min-width: 105px;
  color: var(--bgfi-navy);
  border: 1px solid #d5e4ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(4, 42, 92, 0.04);
}

.filter-submit svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.page-app .filter-submit:hover {
  color: #fff;
  border-color: var(--bgfi-navy);
  background: var(--bgfi-navy);
}

/* --------------------------
   TABLEAU
   -------------------------- */

.dossier-table-wrap {
  overflow-x: auto;
  border: 1px solid #e3ecf3;
  border-radius: 12px;
  background: #fff;
}

.page-app table.data.dossier-table {
  width: 100%;
  min-width: 1020px;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.page-app .dossier-table th,
.page-app .dossier-table td {
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid #e9eff5;
  text-align: left;
  vertical-align: middle;
}

.page-app .dossier-table th {
  color: #647e9e;
  background: #f2f6fa;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.045em;
  white-space: nowrap;
}

.page-app .dossier-table tbody tr {
  transition: background 0.15s;
}

.page-app .dossier-table tbody tr:hover td {
  background: #f8fbfe;
}

.page-app .dossier-table tbody tr:last-child td {
  border-bottom: 0;
}

.reference-cell a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--bgfi-blue);
  text-decoration: none;
  white-space: nowrap;
}

.reference-cell a:hover {
  color: var(--bgfi-navy);
  text-decoration: underline;
}

.reference-cell svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reference-cell strong {
  font-size: 12px;
  font-weight: 800;
}

.page-app .dossier-table .amount-cell {
  color: var(--bgfi-navy);
  font-weight: 700;
  white-space: nowrap;
}

.page-app .dossier-table .date-cell {
  color: #607894;
  font-size: 11px;
  white-space: nowrap;
}

.page-app .dossier-table .badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.status-bullet {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
}

.page-app .dossier-table .badge.draft {
  color: #5c728b;
  background: #edf2f7;
}

.page-app .dossier-table .badge.submitted {
  color: #175c9d;
  background: #e3f1fb;
}

.page-app .dossier-table .badge.in_review,
.page-app .dossier-table .badge.docs_incomplete {
  color: #936100;
  background: #fff3d5;
}

.page-app .dossier-table .badge.approved,
.page-app .dossier-table .badge.signed,
.page-app .dossier-table .badge.active {
  color: #167344;
  background: #e8f6e8;
}

.page-app .dossier-table .badge.rejected,
.page-app .dossier-table .badge.locked {
  color: #b42318;
  background: #feeeee;
}

.page-app .dossier-table .badge.cancelled,
.page-app .dossier-table .badge.archived,
.page-app .dossier-table .badge.inactive {
  color: #68788b;
  background: #edf0f4;
}

.actions-column,
.actions-cell {
  text-align: right !important;
}

.page-app .table-open-btn {
  justify-content: center;
  min-width: 92px;
  padding: 8px 12px;
  color: #fff;
  border: 1px solid var(--bgfi-navy);
  border-radius: 9px;
  background: var(--bgfi-navy);
  font-size: 11px;
  white-space: nowrap;
}

.page-app .table-open-btn:hover {
  color: #fff;
  border-color: var(--bgfi-blue);
  background: var(--bgfi-blue);
  text-decoration: none;
}

.table-open-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state {
  height: 145px;
  color: var(--bgfi-muted);
  text-align: center !important;
}

.empty-state > * {
  display: block;
  margin: 5px auto;
}

.empty-state strong {
  color: var(--bgfi-navy);
}

.empty-state-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #86a7bf;
  stroke-width: 1.5;
}

.table-footnote {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 13px;
  color: var(--bgfi-muted);
  font-size: 10px;
}

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

/* --------------------------
   PIED DE PAGE
   -------------------------- */

.page-app .footer-note {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0 12px;
  color: #7188a5;
  font-size: 10px;
}

.footer-separator {
  color: #a3b6c9;
}

/* --------------------------
   RESPONSIVE
   -------------------------- */
/* Tablette */
@media (max-width: 900px) {
  .hero {
    --img-w: 48%;
    --cut: 60px;
  }
  .hero-notebook {
    display: none;
  }
  .hero-content {
    padding: 24px 24px 24px 28px;
  }
}

@media (max-width: 600px) {
  .hero {
    grid-template-columns: 1fr;
    padding-bottom: 24px;
  }
  .hero-building {
    min-height: 190px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 40px));
  }
  .hero-decoration {
    display: none;
  }
  .hero-content {
    grid-column: 1;
    padding: 8px 16px 0;
  }
}

@media (max-width: 1250px) {
  .kpi-navigation {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero {
    grid-template-columns: minmax(180px, 0.9fr) minmax(130px, 0.55fr) minmax(
        270px,
        1fr
      );
  }

  .hero-decoration {
    left: 40%;
  }

  .kpi-card {
    min-height: 84px;
  }
}

@media (max-width: 900px) {
  .app-header {
    padding: 0 20px;
  }

  .app-header .header-inner {
    min-height: 68px;
  }

  .account-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
    padding: 24px;
  }

  .hero-building {
    min-height: 230px;
  }

  .hero-notebook {
    display: none;
  }

  .hero-content {
    justify-self: stretch;
    max-width: none;
  }

  .hero-decoration {
    left: 42%;
  }

  .kpi-navigation {
    padding: 18px 20px 6px;
    gap: 10px;
  }

  .kpi-card {
    padding: 12px;
    gap: 9px;
  }

  .kpi-icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .kpi-icon svg {
    width: 20px;
    height: 20px;
  }

  .page-app .wrap {
    padding: 16px 20px 30px;
  }
}

@media (max-width: 600px) {
  .app-header {
    padding: 0 14px;
  }

  .app-header .header-inner {
    min-height: auto;
    padding: 12px 0;
    align-items: flex-start;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .brand-copy .brand-subtitle {
    max-width: 165px;
    font-size: 10px;
  }

  .header-account {
    gap: 7px;
  }

  .account-status {
    display: none;
  }

  .account-role {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 9px;
    white-space: nowrap;
  }

  .btn-logout {
    min-height: 36px;
    padding: 8px;
  }

  .btn-logout span {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px 16px 24px;
  }

  .hero-building {
    min-height: 170px;
    max-height: 210px;
  }

  .hero-building img {
    min-height: 170px;
  }

  .hero-decoration {
    left: 65%;
    opacity: 0.5;
  }

  .hero-content {
    padding: 0 3px;
  }

  .hero-eyebrow {
    margin-bottom: 6px;
  }

  .hero-title {
    min-height: 2.6em;
    font-size: 25px;
  }

  .hero-description {
    font-size: 13px;
  }

  .hero-cta {
    min-height: 43px;
  }

  .kpi-navigation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px 12px 5px;
    gap: 9px;
  }

  .kpi-card {
    min-height: 83px;
    padding: 10px;
    gap: 8px;
    border-radius: 12px;
  }

  .kpi-icon {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .kpi-icon svg {
    width: 18px;
    height: 18px;
  }

  .kpi-copy strong {
    font-size: 11px;
  }

  .kpi-copy small {
    font-size: 9px;
  }

  .kpi-arrow {
    display: none;
  }

  .page-app .wrap {
    padding: 13px 12px 24px;
  }

  .page-app .panel {
    padding: 16px 12px;
    border-radius: 13px;
  }

  .dossier-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }

  .dossier-heading-icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .dossier-heading h2 {
    font-size: 18px;
  }

  .dossier-heading .lead {
    font-size: 11px;
  }

  .page-app .dossier-create-btn {
    width: 100%;
    justify-content: center;
  }

  .filter-controls {
    flex-direction: column;
    gap: 9px;
  }

  .filter-status {
    flex-basis: auto;
  }

  .page-app .filter-submit {
    width: 100%;
    min-height: 42px;
  }

  .table-footnote {
    flex-direction: column;
  }

  .page-app .footer-note {
    gap: 5px;
    line-height: 1.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notebook-image,
  .typing-cursor {
    animation: none !important;
  }

  .kpi-card,
  .hero-cta,
  .btn-logout {
    transition: none !important;
  }
}

/* Tablette */

@media (max-width: 1000px) {
  .login-page {
    grid-template-columns: 46% 54%;
  }
  .login-brand {
    padding: 0 28px;
  }
  .login-panel {
    padding-right: 24px;
  }
}

/* Mobile : bandeau bleu en haut, carte dessous */

@media (max-width: 720px) {
  .login-page {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .login-brand {
    min-height: 260px;
    padding: 36px 24px 56px;
    clip-path: polygon(0 0, 100% 0, 100% 86%, 0 100%);
  }

  .login-brand::before {
    height: 100%;
    opacity: 0.3;
  }
  .login-brand::after {
    display: none;
  }
  .login-brand-content {
    margin-top: 0;
  }
  .login-brand-title {
    font-size: 48px;
  }
  .login-brand-content h2 {
    font-size: 22px;
  }
  .login-brand-divider {
    margin: 16px 0 18px;
  }
  .login-brand-tagline {
    font-size: 16px;
  }

  .login-panel {
    flex-wrap: wrap;
    margin: -30px 0 0;
    padding: 24px 16px 32px;
    align-items: flex-start;
  }

  .login-logo {
    position: static;
    align-self: flex-end;
    width: 120px;
    margin: 0 0 14px auto;
  }

  .login-box {
    max-width: 520px;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-input-wrap,
  .login-submit {
    transition: none;
  }
}

/* =========================================================
   DASHBOARD - SLIDER HORIZONTAL 3D
   4 boutons visibles / glissement 280ms / aucun hover
   ========================================================= */
.kpi-slider {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px clamp(14px, 2.6vw, 42px) 10px;
}

.kpi-slider .kpi-slider-viewport {
  min-width: 0;
  width: 100%;
  overflow: hidden;
  padding: 18px 4px 20px;
  perspective: 1000px;
}

.kpi-slider .kpi-slider-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  transform: translate3d(0, 0, 0);
  transition: transform 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}

.kpi-slider .kpi-card {
  box-sizing: border-box;
  flex: 0 0 calc((100% - 48px) / 4);
  width: calc((100% - 48px) / 4);
  min-width: 0;
  min-height: 112px;
  height: auto;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  transition: none !important;
}

/* Courbure 3D permanente, sans agrandissement au survol. */
.kpi-slider .kpi-card:nth-child(4n + 1),
.kpi-slider .kpi-card:nth-child(4n + 1):hover {
  transform: rotateY(-13deg) translateZ(-12px) scale(0.97);
}
.kpi-slider .kpi-card:nth-child(4n + 2),
.kpi-slider .kpi-card:nth-child(4n + 2):hover {
  transform: rotateY(-4deg) translateZ(10px);
}
.kpi-slider .kpi-card:nth-child(4n + 3),
.kpi-slider .kpi-card:nth-child(4n + 3):hover {
  transform: rotateY(4deg) translateZ(10px);
}
.kpi-slider .kpi-card:nth-child(4n + 4),
.kpi-slider .kpi-card:nth-child(4n + 4):hover {
  transform: rotateY(13deg) translateZ(-12px) scale(0.97);
}

/* Annule l'ancien hover global des .kpi-card. */
.kpi-slider .kpi-card:hover {
  color: var(--bgfi-navy) !important;
  border-color: var(--bgfi-border);
  box-shadow: 0 5px 18px rgba(4, 42, 92, 0.035);
  text-decoration: none;
}
.kpi-slider .kpi-card.is-active:hover {
  color: #fff !important;
  border-color: var(--bgfi-navy);
  box-shadow: 0 8px 20px rgba(4, 42, 92, 0.16);
}
.kpi-slider .kpi-card:focus-visible {
  outline: 2px solid var(--bgfi-blue);
  outline-offset: 2px;
}

.kpi-slider .kpi-slider-control {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #d5e4ed;
  border-radius: 50%;
  background: #fff;
  color: var(--bgfi-navy);
  box-shadow: 0 5px 16px rgba(4, 42, 92, 0.09);
  cursor: pointer;
  transition: none !important;
}
.kpi-slider .kpi-slider-control svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kpi-slider .kpi-slider-control:hover:not(:disabled) {
  transform: none;
  background: #fff;
  box-shadow: 0 5px 16px rgba(4, 42, 92, 0.09);
}
.kpi-slider .kpi-slider-control:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.kpi-slider .kpi-slider-control[hidden] {
  visibility: hidden;
}
.kpi-slider .kpi-slider-status {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--bgfi-muted);
  font-size: 12px;
  min-height: 17px;
}

@media (max-width: 850px) {
  .kpi-slider {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 5px;
    padding-inline: 8px;
  }
  .kpi-slider .kpi-slider-track {
    gap: 7px;
  }
  .kpi-slider .kpi-card {
    flex-basis: calc((100% - 21px) / 4);
    width: calc((100% - 21px) / 4);
    flex-direction: column;
    text-align: center;
    justify-content: center;
    padding: 10px 5px;
    gap: 7px;
  }
  .kpi-slider .kpi-icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
  }
  .kpi-slider .kpi-copy {
    flex: 0 0 auto;
  }
  .kpi-slider .kpi-copy small,
  .kpi-slider .kpi-arrow {
    display: none;
  }
  .kpi-slider .kpi-slider-control {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .kpi-slider .kpi-slider-track {
    gap: 4px;
  }
  .kpi-slider .kpi-card {
    flex-basis: calc((100% - 12px) / 4);
    width: calc((100% - 12px) / 4);
    min-height: 86px;
    border-radius: 10px;
  }
  .kpi-slider .kpi-copy strong {
    font-size: 9px;
    overflow-wrap: anywhere;
  }
  .kpi-slider .kpi-icon {
    flex-basis: 29px;
    width: 29px;
    height: 29px;
  }
  .kpi-slider .kpi-icon svg {
    width: 17px;
    height: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kpi-slider .kpi-slider-track {
    transition: none !important;
  }
}

/* ==========================================
   HEADER BGFI : profil et déconnexion Power
   ========================================== */
.app-header .brand-copy strong {
  color: #fff;
  font-size: clamp(16px, 1.5vw, 21px);
  font-weight: 700;
}
.app-header .header-account {
  display: flex;
  align-items: center;
  gap: 24px;
}
.app-header .account-status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.app-header .account-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}
.app-header .account-profile-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-header .btn-logout-power {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.app-header .btn-logout-power svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.app-header .btn-logout-power:hover {
  color: var(--bgfi-green);
}
.app-header .btn-logout-power:focus-visible {
  outline: 2px solid var(--bgfi-green);
  outline-offset: 3px;
}
@media (max-width: 600px) {
  .app-header .header-account {
    gap: 10px;
  }
  .app-header .account-name {
    font-size: 12px;
  }
  .app-header .account-profile-icon {
    width: 20px;
    height: 20px;
  }
}

/* HEADER - Logo et titre proportionnés */

.app-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.app-header .brand-logo {
  width: 10vw;
  height: 10vh;
  object-fit: contain;
  flex-shrink: 0;
}

.app-header .brand-copy strong {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: #fff;
}


/* =========================================================
   LISTES DE CONTRATS — filtres et recherche harmonisés
   ========================================================= */
.contracts-filter,
.page-app .dossier-filters {
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid #e1eaf1;
  border-radius: 13px;
  background: linear-gradient(115deg, #f7f9fc 0%, #f1f6fa 100%);
  box-shadow: 0 4px 14px rgba(4, 42, 92, .035);
}

.contracts-filter-grid {
  display: grid;
  grid-template-columns: minmax(155px, .85fr) minmax(170px, .95fr) minmax(260px, 1.7fr) auto;
  align-items: end;
  gap: 14px;
}

.contracts-filter-field,
.contracts-filter-field .f,
.page-app .filter-controls .f {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  gap: 7px;
  margin: 0;
}

.contracts-filter-field > span,
.filter-field-label {
  display: block;
  color: #526b87;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .025em;
}

.page-app .contracts-filter select,
.page-app .contracts-filter input,
.page-app .filter-controls select,
.page-app .filter-controls input {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 13px;
  color: #173b63;
  border: 1px solid #d7e2ec;
  border-radius: 9px;
  background: #fff;
  font: 400 13px var(--font);
  box-shadow: 0 1px 2px rgba(4, 42, 92, .025);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.page-app .contracts-filter select:focus,
.page-app .contracts-filter input:focus,
.page-app .filter-controls select:focus,
.page-app .filter-controls input:focus {
  outline: none;
  border-color: #6d9bb8;
  box-shadow: 0 0 0 3px rgba(61, 120, 154, .11);
}

.contracts-filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
  min-height: 44px;
}

.page-app .contracts-filter-btn,
.page-app .filter-controls .filter-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 44px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #d4e0ea;
  border-radius: 9px;
  color: #244b70;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: none;
}

.page-app .contracts-filter-btn:hover,
.page-app .filter-controls .filter-submit:hover {
  color: #fff;
  border-color: #3d789a;
  background: #3d789a;
}

.page-app .dossier-filters .filter-heading {
  margin: 0 0 13px 1px;
  color: #315c7e;
  font-size: 12px;
  font-weight: 750;
}

.page-app .filter-controls {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(280px, 2fr) auto;
  align-items: end;
  gap: 14px;
}

.page-app .filter-controls .search-input-wrap {
  width: 100%;
}

.page-app .filter-controls .search-input-wrap input {
  padding-left: 41px;
}

.page-app .filter-controls .filter-submit {
  min-width: 112px;
}

@media (max-width: 900px) {
  .contracts-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .contracts-filter-field-search {
    grid-column: 1 / -1;
  }
  .contracts-filter-actions {
    grid-column: 1 / -1;
  }
  .page-app .filter-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
  .page-app .filter-controls .filter-submit {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 560px) {
  .contracts-filter,
  .page-app .dossier-filters {
    padding: 13px;
  }
  .contracts-filter-grid,
  .page-app .filter-controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
  }
  .contracts-filter-field-search,
  .contracts-filter-actions,
  .page-app .filter-controls .filter-submit {
    grid-column: auto;
  }
  .contracts-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .page-app .filter-controls .filter-submit {
    justify-self: stretch;
    width: 100%;
  }
}

/* Boutons verts : texte toujours blanc (liens, boutons, états hover/focus/visited) */
.btn:not(.ghost):not(.warn),
a.btn:not(.ghost):not(.warn),
button.btn:not(.ghost):not(.warn),
.btn.ok,
a.btn.ok,
button.btn.ok,
.btn:not(.ghost):not(.warn):hover,
.btn:not(.ghost):not(.warn):focus,
.btn:not(.ghost):not(.warn):active,
a.btn:not(.ghost):not(.warn):visited,
.btn.ok:hover,
.btn.ok:focus,
.btn.ok:active {
  color: #fff !important;
}
