/* Mes finances — fond vectoriel intégré, sans image externe ni requête supplémentaire. */
html { min-height: 100%; background: #07152b; }
body {
  min-height: 100vh;
  background-color: #07152b;
  background-image:
    radial-gradient(ellipse 65% 70% at 86% 92%, rgba(8, 59, 74, .16), transparent 75%),
    radial-gradient(ellipse 65% 60% at 5% 3%, rgba(12, 56, 81, .13), transparent 78%),
    linear-gradient(115deg, #07152b 0%, #0a1b34 56%, #091a2f 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}
/* Les éléments .wave existent déjà dans login.php et common.php.
   Leurs courbes sont des SVG embarqués directement dans ce CSS : aucun PNG,
   aucune ressource distante, aucune apparition tardive du décor. */
.wave {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  display: block;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}
.wave-top {
  left: 0;
  top: 0;
  width: min(57vw, 950px);
  height: min(47vh, 480px);
  min-width: 320px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 950 480' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='.9' y2='1'%3E%3Cstop stop-color='%230a5267'/%3E%3Cstop offset='.53' stop-color='%230b3e5c'/%3E%3Cstop offset='1' stop-color='%230a2745'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M0 0H950C835 17 720 48 610 99 479 160 383 252 275 321 182 382 88 413 0 422Z'/%3E%3C/svg%3E");
}
.wave-bottom {
  right: 0;
  bottom: 0;
  width: min(100vw, 1700px);
  height: min(45vh, 480px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1700 480' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='.7'%3E%3Cstop stop-color='%230a2946'/%3E%3Cstop offset='.55' stop-color='%2309475e'/%3E%3Cstop offset='1' stop-color='%230b666c'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M0 480C240 442 387 348 566 258 740 169 885 146 1022 165 1204 191 1350 285 1700 222V480Z'/%3E%3C/svg%3E");
}
body > header, body > nav, body > main { position: relative; z-index: 1; }
@media (max-width: 650px) {
  .wave-top { width: 88vw; min-width: 0; height: 27vh; }
  .wave-bottom { width: 120vw; height: 28vh; right: -8vw; }
}

/* Barre de navigation unifiée — sans image externe */
body > .app-header {
  display: block; /* Annule le display:flex global de header, sur PC et mobile. */
  position: relative;
  z-index: 2;
  width: min(1240px, calc(100% - 36px));
  margin: 16px auto 0;
  padding: 0;
  border: 1px solid rgba(139, 187, 211, .16);
  border-radius: 17px;
  background: rgba(21, 37, 59, .89);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .14);
}
.app-header-inner {
  width: 100%; /* La grille occupe toute la barre, sans décaler la déconnexion. */
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 66px;
  padding: 7px 16px;
}
.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: #f5f9fc;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
.app-brand .brand-logo { width: 49px; height: 45px; display: block; flex: none; }
.app-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  flex-wrap: nowrap;
}
.app-nav a {
  padding: 11px 13px;
  border-radius: 9px;
  color: #b8c8d8;
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.app-nav a:hover, .app-nav a:focus-visible { background: rgba(35, 115, 139, .24); color: #fff; }
.app-nav a[aria-current="page"] { color: #78e1df; background: rgba(10, 118, 134, .28); }
.app-logout { justify-self: end; margin: 0; }
.app-logout button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(145, 180, 205, .15);
  border-radius: 10px;
  background: rgba(255, 255, 255, .055);
  color: #d5e3ee;
  font-size: 13px;
}
.app-logout button:hover { background: rgba(255,255,255,.11); }
.app-logout button svg { display: block; }
/* Desktop : déconnexion à l'extrémité droite */
@media (min-width: 761px) {
  .app-header-inner { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .app-logout { justify-self: end; margin-left: auto; }
}

/* Mobile : logo centré, déconnexion en haut à droite, navigation sur la 2e ligne */
@media (max-width: 760px) {
  body > header.app-header {
    width: calc(100% - 24px);
    max-width: 100%;
    margin: 12px auto 0;
  }
  body > header.app-header > .app-header-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    justify-items: center;
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding: 10px 8px 9px;
  }
  body > header.app-header .app-brand {
    grid-column: 1;
    grid-row: 1;
    justify-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin: 0;
    font-size: 13px;
    text-align: center;
  }
  body > header.app-header .app-brand .brand-logo { width: 52px; height: 43px; }
  body > header.app-header nav.app-nav {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 2px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
  }
  body > header.app-header nav.app-nav a {
    flex: 0 1 auto;
    white-space: nowrap;
    text-align: center;
    padding: 9px 8px;
    font-size: 13px;
  }
  body > header.app-header form.app-logout {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    margin: 0;
  }
  body > header.app-header form.app-logout button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 8px;
  }
  body > header.app-header form.app-logout .logout-text { display: none; }
}
@media (max-width: 355px) {
  body > header.app-header nav.app-nav a { font-size: 12px; padding: 8px 5px; }
}

/* Connexion : centrage stable, sans repositionnement ni animation. */
body:has(> .login-card) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
}
body > .login-card {
  flex: 0 0 auto;
  margin: auto;
  animation: none !important;
  transition: none !important;
}
