/* Regles migrees hors de styles.css, lot par lot.
   Cette feuille prend la place de l'ancienne dans l'ordre de chargement :
   deplacer une regle ne doit pas changer qui l'emporte.
   Voir docs/CHANTIER_CSS_ET_NAVIGATION.md. */

/* ---- Regles migrees ---- */

/* Regles migrees hors de styles.css, lot par lot.
   Cette feuille prend la place de l'ancienne dans l'ordre de chargement :
   deplacer une regle ne doit pas changer qui l'emporte.
   Voir docs/CHANTIER_CSS_ET_NAVIGATION.md. */

/* ---- Lot : connexion ---- */

/* Regles migrees hors de styles.css, lot par lot.
   Cette feuille prend la place de l'ancienne dans l'ordre de chargement :
   deplacer une regle ne doit pas changer qui l'emporte.
   Voir docs/CHANTIER_CSS_ET_NAVIGATION.md. */

/* ---- Lot : connexion ---- */

.auth-shell {
min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

body.is-authenticated .auth-shell,
.auth-shell.is-hidden,
.app-shell.is-hidden {
display: none;
}

.auth-card {
width: min(520px, 100%);
  padding: 36px;
  border-radius: 32px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, rgba(189, 149, 91, 0.18), transparent 28%),
    radial-gradient(circle at bottom left, rgba(38, 93, 73, 0.14), transparent 24%),
    rgba(255, 250, 242, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-title {
max-width: none;
  margin-bottom: 10px;
  font-size: clamp(2.4rem, 5vw, 4rem);
}

.auth-text {
margin-bottom: 24px;
}

.auth-form {
display: grid;
  gap: 14px;
}

.auth-submit {
margin-top: 10px;
}

.auth-status {
margin-top: 18px;
  min-height: 24px;
}

.auth-status.is-error {
color: var(--danger);
}

.auth-loader-view {
min-height: 360px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.auth-loader-title {
margin-bottom: 0;
}

.auth-loader-text {
max-width: 28ch;
  margin-bottom: 0;
}

.auth-loader-ring {
width: 92px;
  height: 92px;
  border-radius: 999px;
  border: 6px solid rgba(189, 149, 91, 0.16);
  border-top-color: var(--accent);
  border-right-color: rgba(38, 93, 73, 0.75);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    0 16px 34px rgba(38, 93, 73, 0.16);
  animation: authSpin 1.05s linear infinite;
}

/* Wow login refresh 2026-07-01 */
.auth-shell {
position: relative;
  min-height: 100vh;
  overflow: hidden;
  place-items: stretch;
  padding: clamp(18px, 3vw, 42px);
  background:
    radial-gradient(circle at 18% 18%, rgba(189, 149, 91, 0.22), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(41, 79, 63, 0.2), transparent 28%),
    linear-gradient(135deg, #fbf6ee 0%, #efe1cf 52%, #f7efe4 100%);
}

.auth-shell::before,
.auth-shell::after {
content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(6px);
}

.auth-shell::before {
width: 44vw;
  height: 44vw;
  left: -15vw;
  bottom: -22vw;
  background: radial-gradient(circle, rgba(189, 149, 91, 0.18), transparent 68%);
}

.auth-shell::after {
width: 38vw;
  height: 38vw;
  right: -12vw;
  top: -18vw;
  background: radial-gradient(circle, rgba(41, 79, 63, 0.18), transparent 70%);
}

.auth-stage,
.auth-card {
position: relative;
  overflow: hidden;
  border: 1px solid rgba(55, 43, 29, 0.1);
  box-shadow:
    0 38px 90px rgba(57, 43, 27, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(22px);
}

.auth-stage > .eyebrow,
.auth-stage h1,
.auth-stage-text,
.auth-visual-grid {
position: relative;
  z-index: 2;
}

.auth-card {
width: 100%;
  min-height: min(760px, calc(100vh - 84px));
  display: grid;
  align-content: center;
  padding: clamp(28px, 4vw, 52px);
  border-radius: 38px;
  background:
    radial-gradient(circle at top right, rgba(41, 79, 63, 0.12), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(255, 250, 242, 0.92));
}

.auth-card::before {
content: "Accès privé";
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 8px 12px;
  border: 1px solid rgba(41, 79, 63, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-title {
margin: 0 0 10px;
  font-size: clamp(3rem, 5.8vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: -0.065em;
}

.auth-text {
max-width: 32ch;
  margin-bottom: 30px;
}

.auth-form {
gap: 16px;
}

.auth-form label {
display: grid;
}

.auth-form label span {
color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-form input {
min-height: 58px;
  border-radius: 20px;
  border-color: rgba(55, 43, 29, 0.12);
  background: rgba(255, 255, 255, 0.74);
  font-size: 1rem;
}

.auth-form input:focus {
border-color: rgba(41, 79, 63, 0.52);
  box-shadow:
    0 0 0 4px rgba(41, 79, 63, 0.1),
    0 14px 30px rgba(41, 79, 63, 0.08);
}

.auth-submit {
min-height: 58px;
  margin-top: 6px;
  justify-content: center;
  border-radius: 20px;
  font-weight: 900;
}

.auth-status {
margin-top: 18px;
  padding: 0 2px;
}

.auth-loader-view {
min-height: 420px;
}

@media (max-width: 980px) {

  .auth-shell {
padding: 14px;
  }

  .auth-card {
min-height: auto;
    border-radius: 30px;
  }

}

@media (max-width: 640px) {

  .auth-shell {
padding: 10px;
  }

  .auth-card {
padding: 24px;
  }

  .auth-card::before {
position: static;
    width: fit-content;
    margin-bottom: 18px;
  }

  .auth-title {
font-size: clamp(2.7rem, 16vw, 4.4rem);
  }

  .auth-form input,
  .auth-submit {
min-height: 56px;
  }

}

/* Privacy-safe login correction: no business figures on the public login screen */
.auth-shell {
background:
    radial-gradient(circle at 18% 22%, rgba(189, 149, 91, 0.16), transparent 26%),
    radial-gradient(circle at 84% 18%, rgba(41, 79, 63, 0.15), transparent 24%),
    linear-gradient(145deg, #fbf7ef 0%, #f4eadc 48%, #efe2d2 100%);
}

.auth-card {
min-height: min(680px, calc(100vh - 84px));
  border-radius: 36px;
  box-shadow:
    0 30px 74px rgba(57, 43, 27, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.auth-title {
font-size: clamp(3rem, 4.6vw, 4.7rem);
}

.auth-submit {
background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent),
    #203a31;
}

@media (max-width: 980px) {

  .auth-card {
min-height: auto;
    border-radius: 30px;
  }

}

@media (max-width: 640px) {

  .auth-shell {
padding: 10px;
  }

  .auth-card {
padding: 22px;
  }

}

/* Final login direction: desktop = mockup 1, mobile = mockup 3 */
body:not(.is-authenticated) {
overflow-x: hidden;
}

.auth-shell {
min-height: 100vh;
  padding: clamp(20px, 3vw, 40px);
  background:
    radial-gradient(circle at 12% 14%, rgba(189, 149, 91, 0.14), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(41, 79, 63, 0.13), transparent 26%),
    linear-gradient(145deg, #fbf7ef 0%, #f1e7d8 52%, #f8f0e7 100%);
}

.auth-stage,
.auth-card {
min-height: 0;
  border-radius: 34px;
}

.auth-stage > .eyebrow {
align-self: start;
  margin: 8px 78px 26px 0;
}

.auth-card {
display: grid;
  align-content: center;
  padding: clamp(28px, 4vw, 46px);
  background:
    radial-gradient(circle at top right, rgba(41, 79, 63, 0.1), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 250, 242, 0.94));
}

.auth-card::before {
position: static;
  width: fit-content;
  margin-bottom: 22px;
}

.auth-title {
font-size: clamp(3rem, 4.4vw, 4.4rem);
}

@media (max-width: 860px) {

  .auth-shell {
display: grid;
    place-items: stretch;
    padding: 12px;
  }

  .auth-stage > .eyebrow {
margin: 4px 68px 18px 0;
  }

  .auth-card {
flex: 1;
    min-height: auto;
    padding: 24px;
    border-radius: 28px;
  }

  .auth-title {
font-size: clamp(2.8rem, 14vw, 4.2rem);
  }

  .auth-text {
max-width: 28ch;
  }

  .auth-form input,
  .auth-submit {
min-height: 56px;
  }

}

/* Login exact direction 2026-07-01: desktop mockup 1, mobile mockup 3. */
body:not(.is-authenticated) {
min-height: 100vh;
  overflow-x: hidden;
}

body:not(.is-authenticated)::before {
opacity: 0;
}

body:not(.is-authenticated) .auth-shell {
position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(16px, 2.7vw, 34px);
  background:
    radial-gradient(circle at 8% 85%, rgba(187, 96, 67, 0.2), transparent 30%),
    radial-gradient(circle at 42% 24%, rgba(38, 93, 73, 0.12), transparent 28%),
    radial-gradient(circle at 89% 13%, rgba(200, 160, 100, 0.12), transparent 30%),
    linear-gradient(135deg, #fbf7ef 0%, #f3eadf 50%, #fffaf4 100%);
}

body:not(.is-authenticated) .auth-frame {
position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  min-height: min(760px, calc(100vh - 44px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 0.94fr);
  overflow: hidden;
  border: 1px solid rgba(66, 49, 31, 0.16);
  border-radius: 32px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow:
    0 26px 70px rgba(68, 47, 27, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(22px);
}

body:not(.is-authenticated) .auth-frame::before,
body:not(.is-authenticated) .auth-frame::after {
content: "";
  position: absolute;
  pointer-events: none;
}

body:not(.is-authenticated) .auth-frame::before {
inset: 20px;
  border: 1px solid rgba(92, 73, 50, 0.12);
  border-radius: 26px;
}

body:not(.is-authenticated) .auth-frame::after {
inset: 0;
  background-image:
    linear-gradient(rgba(110, 90, 62, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 90, 62, 0.06) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.48), transparent 60%);
}

body:not(.is-authenticated) .auth-brand-panel,
body:not(.is-authenticated) .auth-login-panel {
position: relative;
  z-index: 1;
}

body:not(.is-authenticated) .auth-brand-panel {
min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(48px, 5.4vw, 72px);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 86% 23%, rgba(38, 93, 73, 0.12), transparent 44%),
    radial-gradient(ellipse at 3% 92%, rgba(189, 149, 91, 0.18), transparent 44%),
    linear-gradient(145deg, rgba(255, 253, 248, 0.94), rgba(250, 241, 230, 0.82));
}

body:not(.is-authenticated) .auth-brand-panel::before {
content: "";
  position: absolute;
  top: -4%;
  right: -22%;
  width: 56%;
  height: 66%;
  border: 1px solid rgba(38, 93, 73, 0.1);
  border-radius: 999px 0 0 999px;
  background: linear-gradient(135deg, rgba(38, 93, 73, 0.1), rgba(255, 255, 255, 0));
  pointer-events: none;
}

body:not(.is-authenticated) .auth-brand-panel::after {
content: "";
  position: absolute;
  left: -16%;
  bottom: -22%;
  width: 82%;
  height: 48%;
  border: 1px solid rgba(190, 102, 71, 0.16);
  border-radius: 999px 999px 0 0;
  transform: rotate(-11deg);
  pointer-events: none;
}

body:not(.is-authenticated) .auth-brand-copy {
position: relative;
  z-index: 1;
}

body:not(.is-authenticated) .auth-brand-copy h1 {
margin: 0;
  color: #143f34;
  font-family: "Didot", "Bodoni 72", "Georgia", serif;
  font-size: clamp(4.6rem, 7.1vw, 6.8rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.065em;
  text-shadow: 0 14px 34px rgba(20, 63, 52, 0.08);
}

body:not(.is-authenticated) .auth-gold-line {
display: block;
  width: 72px;
  height: 3px;
  margin: 30px 0 26px;
  border-radius: 999px;
  background: linear-gradient(90deg, #bf9555, #dfc08a);
}

body:not(.is-authenticated) .auth-brand-copy p {
margin: 0;
  color: #756c62;
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 500;
  line-height: 1.34;
}

body:not(.is-authenticated) .auth-feature-stack {
position: relative;
  z-index: 1;
  align-self: end;
  display: grid;
  gap: 14px;
  width: min(430px, 88%);
  margin-top: 44px;
  padding-bottom: 20px;
}

body:not(.is-authenticated) .auth-feature-card {
width: 78%;
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(69, 50, 30, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 18px 42px rgba(62, 45, 26, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
}

body:not(.is-authenticated) .auth-feature-card:nth-child(2) {
margin-left: 48px;
}

body:not(.is-authenticated) .auth-feature-card:nth-child(3) {
margin-left: 18px;
}

body:not(.is-authenticated) .auth-feature-card:nth-child(4) {
margin-left: 86px;
}

body:not(.is-authenticated) .auth-feature-icon,
body:not(.is-authenticated) .auth-hosting-note span,
body:not(.is-authenticated) .auth-mobile-lock,
body:not(.is-authenticated) .auth-input-icon,
body:not(.is-authenticated) .auth-mobile-hosting span {
display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

body:not(.is-authenticated) .auth-feature-icon {
width: 56px;
  height: 56px;
  border-radius: 16px;
  color: #265d49;
  background: rgba(38, 93, 73, 0.08);
}

body:not(.is-authenticated) .auth-feature-icon.accent {
color: #9b7040;
  background: rgba(189, 149, 91, 0.1);
}

body:not(.is-authenticated) .auth-feature-icon.gold {
color: #9b7040;
  background: rgba(191, 149, 85, 0.12);
}

body:not(.is-authenticated) .auth-feature-card svg,
body:not(.is-authenticated) .auth-hosting-note svg,
body:not(.is-authenticated) .auth-mobile-lock svg,
body:not(.is-authenticated) .auth-input-icon svg,
body:not(.is-authenticated) .auth-password-toggle svg,
body:not(.is-authenticated) .auth-mobile-hosting svg {
width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body:not(.is-authenticated) .auth-feature-card strong,
body:not(.is-authenticated) .auth-feature-card small {
display: block;
}

body:not(.is-authenticated) .auth-feature-card strong {
color: #25211d;
  font-size: 1.05rem;
  font-weight: 800;
}

body:not(.is-authenticated) .auth-feature-card small {
margin-top: 4px;
  color: #7d7369;
  font-size: 0.88rem;
  font-weight: 600;
}

body:not(.is-authenticated) .auth-hosting-note,
body:not(.is-authenticated) .auth-mobile-hosting {
margin: 0;
  color: #7b746b;
  font-weight: 700;
}

body:not(.is-authenticated) .auth-hosting-note {
position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.98rem;
}

body:not(.is-authenticated) .auth-hosting-note span {
width: 46px;
  height: 46px;
  border: 1px solid rgba(38, 93, 73, 0.18);
  border-radius: 999px;
  color: #265d49;
  background: rgba(255, 255, 255, 0.62);
}

body:not(.is-authenticated) .auth-login-panel {
min-width: 0;
  display: grid;
  place-items: center;
  padding: clamp(34px, 5vw, 58px);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 1px 0 0 rgba(72, 50, 31, 0.08);
}

body:not(.is-authenticated) .auth-frame .auth-card {
width: min(470px, 100%);
  max-width: calc(100vw - 44px);
  min-height: 0;
  display: block;
  padding: clamp(28px, 4.2vw, 44px);
  border: 1px solid rgba(61, 44, 27, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 22px 56px rgba(42, 32, 21, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

body:not(.is-authenticated) .auth-frame .auth-card::before {
content: none;
  display: none;
}

body:not(.is-authenticated) .auth-card-header {
display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 30px;
  text-align: center;
}

body:not(.is-authenticated) .auth-shield {
display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  color: #8d7d62;
  border-radius: 20px;
  border: 1px solid rgba(143, 124, 88, 0.44);
  background: rgba(255, 252, 245, 0.62);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
}

body:not(.is-authenticated) .auth-shield svg {
width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body:not(.is-authenticated) .auth-title {
max-width: none;
  margin: 0;
  color: #1f2c27;
  font-family: "Didot", "Bodoni 72", "Georgia", serif;
  font-size: clamp(1.9rem, 3vw, 2.3rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

body:not(.is-authenticated) .auth-title-mobile,
body:not(.is-authenticated) .auth-mobile-lock,
body:not(.is-authenticated) .auth-mobile-hosting {
display: none;
}

body:not(.is-authenticated) .auth-gold-line-small {
width: 42px;
  height: 3px;
  margin: 8px 0 0;
}

body:not(.is-authenticated) .auth-form {
display: grid;
  gap: 18px;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body:not(.is-authenticated) .auth-field {
display: grid;
  gap: 9px;
  margin: 0;
}

body:not(.is-authenticated) .auth-field > span:first-child {
color: #24201c;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

body:not(.is-authenticated) .auth-input-wrap {
position: relative;
  display: flex;
  align-items: center;
}

body:not(.is-authenticated) .auth-input-icon {
position: absolute;
  left: 18px;
  width: 24px;
  height: 24px;
  color: #9a958d;
  pointer-events: none;
}

body:not(.is-authenticated) .auth-form input[type="text"],
body:not(.is-authenticated) .auth-form input[type="password"] {
width: 100%;
  min-height: 58px;
  padding: 0 52px 0 56px;
  border: 1px solid rgba(42, 32, 21, 0.1);
  border-radius: 12px;
  color: #26221d;
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 2px rgba(45, 34, 22, 0.06),
    0 0 0 4px rgba(38, 93, 73, 0);
  font-size: 1rem;
  font-weight: 700;
}

body:not(.is-authenticated) .auth-form input::placeholder {
color: #a9a39a;
  font-weight: 700;
}

body:not(.is-authenticated) .auth-form input:focus {
border-color: rgba(38, 93, 73, 0.34);
  box-shadow:
    inset 0 1px 2px rgba(45, 34, 22, 0.04),
    0 0 0 4px rgba(38, 93, 73, 0.1);
  outline: none;
}

body:not(.is-authenticated) .auth-password-toggle {
position: absolute;
  right: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #928c82;
  background: transparent;
  cursor: pointer;
}

body:not(.is-authenticated) .auth-password-toggle:hover {
color: #265d49;
  background: rgba(38, 93, 73, 0.08);
}

body:not(.is-authenticated) .auth-options-row {
display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 2px 0 8px;
  color: #7a7167;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

body:not(.is-authenticated) .auth-checkbox {
display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  white-space: nowrap;
  letter-spacing: 0;
  text-transform: none;
}

body:not(.is-authenticated) .auth-checkbox span {
letter-spacing: 0;
  text-transform: none;
}

body:not(.is-authenticated) .auth-checkbox input {
width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  accent-color: #265d49;
}

body:not(.is-authenticated) .auth-link-button {
border: 0;
  padding: 0;
  color: #bd6951;
  background: transparent;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: 0;
  text-transform: none;
}

body:not(.is-authenticated) .auth-submit {
width: 100%;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  border: 0;
  border-radius: 12px;
  color: #fffaf2;
  background: linear-gradient(180deg, #2d7551, #1f5d42);
  box-shadow:
    0 14px 30px rgba(31, 93, 66, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-size: 1rem;
  font-weight: 900;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

body:not(.is-authenticated) .auth-submit:hover {
transform: translateY(-1px);
  background: linear-gradient(180deg, #31825a, #1d563d);
}

body:not(.is-authenticated) .auth-submit-arrow {
font-size: 1.45rem;
  line-height: 1;
}

body:not(.is-authenticated) .auth-status {
min-height: 22px;
  margin: 14px 0 0;
  color: #265d49;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

body:not(.is-authenticated) .auth-status.is-error {
color: var(--danger);
}

body:not(.is-authenticated) .auth-help-text {
margin: 26px 0 0;
  color: #7c746a;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

body:not(.is-authenticated) .auth-loader-view {
min-height: 360px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

@media (max-width: 920px) {

  body:not(.is-authenticated) {
background:
      radial-gradient(circle at 18% 18%, rgba(38, 93, 73, 0.12), transparent 32%),
      radial-gradient(circle at 92% 64%, rgba(189, 149, 91, 0.18), transparent 34%),
      linear-gradient(160deg, #fffaf4 0%, #f4eadf 58%, #fbf5ed 100%);
  }

  body:not(.is-authenticated) .auth-shell {
min-height: 100svh;
    display: block;
    padding: 0;
    background:
      radial-gradient(circle at 12% 8%, rgba(38, 93, 73, 0.12), transparent 28%),
      radial-gradient(circle at 100% 58%, rgba(189, 149, 91, 0.19), transparent 36%),
      linear-gradient(160deg, #fffaf4 0%, #f4eadf 58%, #fbf5ed 100%);
  }

  body:not(.is-authenticated) .auth-frame {
width: 100%;
    min-height: 100svh;
    display: block;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  body:not(.is-authenticated) .auth-frame::before,
  body:not(.is-authenticated) .auth-frame::after,
  body:not(.is-authenticated) .auth-brand-panel::before,
  body:not(.is-authenticated) .auth-brand-panel::after {
content: none;
  }

  body:not(.is-authenticated) .auth-brand-panel {
min-height: 42svh;
    display: grid;
    place-items: end center;
    padding: calc(42px + env(safe-area-inset-top)) 28px 34px;
    text-align: center;
    background:
      radial-gradient(ellipse at 24% 8%, rgba(38, 93, 73, 0.1), transparent 38%),
      radial-gradient(ellipse at 100% 100%, rgba(189, 149, 91, 0.16), transparent 46%);
  }

  body:not(.is-authenticated) .auth-brand-copy h1 {
font-size: clamp(3.65rem, 17vw, 5rem);
    line-height: 0.92;
    letter-spacing: -0.06em;
  }

  body:not(.is-authenticated) .auth-gold-line {
width: 48px;
    height: 3px;
    margin: 22px auto 18px;
  }

  body:not(.is-authenticated) .auth-brand-copy p {
font-size: 1.18rem;
    line-height: 1.32;
  }

  body:not(.is-authenticated) .desktop-only,
  body:not(.is-authenticated) .auth-feature-stack,
  body:not(.is-authenticated) .auth-hosting-note,
  body:not(.is-authenticated) .auth-title-desktop,
  body:not(.is-authenticated) .auth-gold-line-small {
display: none;
  }

  body:not(.is-authenticated) .auth-login-panel {
display: block;
    padding: 0 22px calc(28px + env(safe-area-inset-bottom));
    background: transparent;
    box-shadow: none;
  }

  body:not(.is-authenticated) .auth-frame .auth-card {
width: min(540px, 100%);
    margin: 0 auto;
    padding: 24px 20px 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow:
      0 22px 54px rgba(55, 42, 26, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }

  body:not(.is-authenticated) .auth-card-header {
display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 22px;
    text-align: left;
  }

  body:not(.is-authenticated) .auth-mobile-lock {
display: inline-grid;
    width: 24px;
    height: 24px;
    color: #718076;
  }

  body:not(.is-authenticated) .auth-title-mobile {
display: block;
    color: #746c63;
    font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.01em;
  }

  body:not(.is-authenticated) .auth-form {
gap: 16px;
  }

  body:not(.is-authenticated) .auth-field {
gap: 8px;
  }

  body:not(.is-authenticated) .auth-form input[type="text"],
  body:not(.is-authenticated) .auth-form input[type="password"] {
min-height: 56px;
    padding-left: 54px;
    /* 16 px exactement : en dessous, iOS grossit la page a la prise de focus
       et la connexion demarre de travers. Regle R7 du cahier de recette. */
    font-size: 16px;
  }

  body:not(.is-authenticated) .auth-options-row {
justify-content: center;
    margin: -2px 0 8px;
    order: 4;
  }

  body:not(.is-authenticated) .auth-submit {
order: 3;
  }

  body:not(.is-authenticated) .auth-checkbox {
display: none;
  }

  body:not(.is-authenticated) .auth-link-button {
font-size: 0.95rem;
  }

  body:not(.is-authenticated) .auth-submit {
min-height: 58px;
    justify-content: center;
    position: relative;
  }

  body:not(.is-authenticated) .auth-submit-arrow {
position: absolute;
    right: 22px;
  }

  body:not(.is-authenticated) .auth-mobile-hosting {
display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 22px 0 0;
    color: #8a8177;
    font-size: 0.9rem;
  }

  body:not(.is-authenticated) .auth-mobile-hosting span {
width: 20px;
    height: 20px;
    color: #718076;
  }

}

@media (min-width: 921px) and (max-width: 1100px) {

  body:not(.is-authenticated) .auth-frame {
grid-template-columns: minmax(0, 0.92fr) minmax(390px, 1fr);
  }

  body:not(.is-authenticated) .auth-feature-card {
width: 92%;
    margin-left: 0;
  }

}

/* ---- Lot : pilotage ---- */

.hero,
.dashboard-grid,
.deals-dashboard-grid,
.contracts-dashboard-grid,
.content-grid,
.insights-grid,
.duplicates-layout,
.deals-grid {
display: grid;
  gap: 20px;
}

.hero-copy,
.panel,
.metric-card {
position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-copy,
.panel,
.metric-card {
padding: 24px;
}

.hero-copy::after,
.panel::after,
.metric-card::after {
content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent 34%);
}

h1,
h2,
.metric-value {
font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.hero-text,
.status-message,
.empty-state,
.detail-summary,
.meta-text,
.contract-snippet,
.metric-foot,
.detail-text {
color: var(--muted);
  line-height: 1.65;
}

.dashboard-grid {
grid-template-columns: repeat(6, minmax(0, 1fr));
}

.metric-card {
border-radius: 24px;
}

.metric-card.is-clickable-kpi {
cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.metric-card.is-clickable-kpi:hover,
.metric-card.is-clickable-kpi:focus-visible {
transform: translateY(-2px);
  border-color: rgba(189, 149, 91, 0.28);
  box-shadow:
    0 18px 36px rgba(58, 43, 26, 0.14),
    0 0 0 3px rgba(189, 149, 91, 0.08);
}

.metric-card.accent {
background:
    radial-gradient(circle at top right, rgba(189, 149, 91, 0.22), transparent 34%),
    var(--card);
}

.metric-card.success-card {
background:
    radial-gradient(circle at top right, rgba(38, 93, 73, 0.2), transparent 34%),
    var(--card);
}

.metric-card.warning-card {
background:
    radial-gradient(circle at top right, rgba(189, 149, 91, 0.16), transparent 34%),
    var(--card);
}

.metric-card.danger-card {
background:
    radial-gradient(circle at top right, rgba(157, 53, 36, 0.18), transparent 34%),
    var(--card);
}

.metric-label {
margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.metric-value {
display: block;
  font-size: clamp(1.5rem, 2.4vw, 2.35rem);
}

.metric-foot {
display: inline-block;
  margin-top: 10px;
  font-size: 0.9rem;
}

.yearly-kpis,
.yearly-analysis,
.brands-ranking,
.monthly-overview,
.portfolio-health,
.duplicates-summary,
.duplicates-list,
.deals-table,
.invoice-workspace,
.import-review-panel {
display: grid;
  gap: 14px;
}

.deals-dashboard-grid {
grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.contracts-dashboard-grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-kpi-detail-panel {
display: grid;
  gap: 18px;
}

@media (max-width: 1240px) {

  .dashboard-grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .deals-dashboard-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contracts-dashboard-grid {
grid-template-columns: 1fr;
  }

}

@media (max-width: 920px) {

  .dashboard-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deals-dashboard-grid,
  .contracts-dashboard-grid,
  .invoice-kpis,
  .kpi-detail-meta,
  .admin-user-form-grid,
  .invoice-editor-grid,
  .deal-editor-grid,
  .analysis-grid,
  .invoice-template-grid,
  .invoice-preview-header,
  .invoice-preview-footer-grid,
  .invoice-hero {
grid-template-columns: 1fr;
  }

}

@media (max-width: 640px) {

  .hero-copy,
  .panel,
  .metric-card,
  .detail-card {
padding: 18px;
    border-radius: 20px;
  }

  .dashboard-grid,
  .contracts-dashboard-grid,
  .invoice-kpis {
grid-template-columns: 1fr;
  }

}

.hero-copy,
.panel,
.metric-card {
border-color: rgba(55, 43, 29, 0.1);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 250, 242, 0.86)),
    var(--card);
  box-shadow: var(--shadow-soft);
}

#dashboard-overview {
display: grid;
  gap: 22px;
}

.deals-dashboard-panel,
.contracts-dashboard-panel,
.insight-panel,
.deals-main-panel,
.accounting-main-panel,
.invoices-main-panel,
.library-panel,
.details-panel,
.duplicates-list-panel,
.duplicates-summary-panel {
border-radius: 30px;
}

.deals-dashboard-grid {
grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.contracts-dashboard-grid {
grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.metric-card {
min-height: 150px;
  padding: 22px;
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 250, 243, 0.9)),
    var(--card);
}

.metric-label {
margin-bottom: 12px;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric-value {
letter-spacing: -0.035em;
}

.metric-foot {
margin-top: 14px;
}

.metric-card.accent,
.metric-card.warning-card,
.metric-card.success-card,
.metric-card.danger-card {
background:
    radial-gradient(circle at top right, rgba(189, 149, 91, 0.13), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 250, 243, 0.9));
}

.metric-card.success-card {
background:
    radial-gradient(circle at top right, rgba(41, 79, 63, 0.14), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(249, 252, 247, 0.9));
}

.metric-card.danger-card {
background:
    radial-gradient(circle at top right, rgba(159, 61, 46, 0.13), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 247, 244, 0.9));
}

@media (max-width: 920px) {

  .panel,
  .hero-copy,
  .metric-card,
  .detail-card {
border-radius: 24px;
  }

  .deals-dashboard-grid,
  .contracts-dashboard-grid,
  .invoice-kpis,
  .invoice-summary-grid,
  .import-summary-grid {
display: flex;
    grid-template-columns: none;
    gap: 12px;
    overflow-x: auto;
    margin-inline: -18px;
    padding: 0 18px 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .deals-dashboard-grid::-webkit-scrollbar,
  .contracts-dashboard-grid::-webkit-scrollbar,
  .invoice-kpis::-webkit-scrollbar,
  .invoice-summary-grid::-webkit-scrollbar,
  .import-summary-grid::-webkit-scrollbar {
display: none;
  }

  .deals-dashboard-grid .metric-card,
  .contracts-dashboard-grid .metric-card,
  .invoice-kpis .metric-card,
  .invoice-summary-grid > *,
  .import-summary-grid > * {
min-width: min(78vw, 290px);
    scroll-snap-align: start;
  }

  .metric-card {
min-height: 142px;
  }

}

@media (max-width: 640px) {

  .hero-copy,
  .hero-side,
  .assistant-home-panel,
  .workspace > .tab-view.is-active,
  .panel,
  .metric-card,
  .detail-card {
padding: 16px;
    border-radius: 22px;
  }

  .metric-value {
font-size: 2rem;
  }

}

body.is-authenticated .hero-copy,
body.is-authenticated .panel,
body.is-authenticated .metric-card {
border-color: var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 252, 247, 0.88)),
    var(--card);
  box-shadow:
    0 22px 60px rgba(48, 38, 25, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px);
}

body.is-authenticated .metric-card {
border-radius: 24px;
}

body.is-authenticated .hero-copy::after,
body.is-authenticated .panel::after,
body.is-authenticated .metric-card::after {
background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 32%),
    radial-gradient(circle at top right, rgba(38, 93, 73, 0.055), transparent 36%);
}

body.is-authenticated h1,
body.is-authenticated h2,
body.is-authenticated .metric-value {
color: var(--ink);
  font-family: "Didot", "Bodoni 72", "Iowan Old Style", Georgia, serif;
  letter-spacing: -0.035em;
}

body.is-authenticated .hero-text,
body.is-authenticated .status-message,
body.is-authenticated .empty-state,
body.is-authenticated .detail-summary,
body.is-authenticated .meta-text,
body.is-authenticated .contract-snippet,
body.is-authenticated .metric-foot,
body.is-authenticated .detail-text,
body.is-authenticated .upload-caption {
color: var(--muted);
}

body.is-authenticated .metric-card.accent,
body.is-authenticated .metric-card.success-card {
background:
    radial-gradient(circle at top right, rgba(38, 93, 73, 0.18), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 252, 247, 0.9));
}

body.is-authenticated .metric-card.warning-card {
background:
    radial-gradient(circle at top right, rgba(189, 149, 91, 0.2), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 252, 247, 0.9));
}

body.is-authenticated .metric-card.danger-card {
background:
    radial-gradient(circle at top right, rgba(157, 63, 48, 0.15), transparent 38%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 252, 247, 0.9));
}

body.is-authenticated .metric-card.is-clickable-kpi:hover,
body.is-authenticated .metric-card.is-clickable-kpi:focus-visible {
border-color: rgba(38, 93, 73, 0.24);
  box-shadow:
    0 18px 44px rgba(48, 38, 25, 0.13),
    0 0 0 3px rgba(38, 93, 73, 0.08);
}

body.is-authenticated .metric-label {
color: #6f685f;
  letter-spacing: 0.02em;
}

@media (max-width: 920px) {

  body.is-authenticated .hero-copy,
  body.is-authenticated .panel,
  body.is-authenticated .metric-card {
padding: 18px;
  }

}

body.is-authenticated .hero-copy,
body.is-authenticated .panel,
body.is-authenticated .metric-card,
body.is-authenticated .detail-card {
border-color: rgba(34, 32, 28, 0.1) !important;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 253, 249, 0.94)),
    #fffdf9;
  box-shadow: var(--shadow) !important;
  backdrop-filter: blur(14px);
}

body.is-authenticated .metric-card {
border-radius: 20px;
}

body.is-authenticated .hero-copy::after,
body.is-authenticated .panel::after,
body.is-authenticated .metric-card::after {
background: linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 36%);
}

body.is-authenticated h1,
body.is-authenticated h2,
body.is-authenticated .metric-value {
color: #24211d !important;
  letter-spacing: -0.025em !important;
}

body.is-authenticated .hero-text,
body.is-authenticated .status-message,
body.is-authenticated .empty-state,
body.is-authenticated .detail-summary,
body.is-authenticated .meta-text,
body.is-authenticated .contract-snippet,
body.is-authenticated .metric-foot,
body.is-authenticated .detail-text,
body.is-authenticated .upload-caption {
color: var(--muted) !important;
}

body.is-authenticated .metric-card.accent,
body.is-authenticated .metric-card.success-card,
body.is-authenticated .metric-card.warning-card,
body.is-authenticated .metric-card.danger-card {
background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 253, 249, 0.94)),
    #fffdf9;
}

body.is-authenticated .metric-card.accent {
border-color: rgba(33, 79, 63, 0.16) !important;
}

body.is-authenticated .metric-card.success-card {
box-shadow:
    0 18px 42px rgba(42, 35, 26, 0.08),
    inset 4px 0 0 rgba(33, 79, 63, 0.42) !important;
}

body.is-authenticated .metric-card.warning-card {
box-shadow:
    0 18px 42px rgba(42, 35, 26, 0.08),
    inset 4px 0 0 rgba(164, 126, 67, 0.42) !important;
}

body.is-authenticated .metric-card.danger-card {
box-shadow:
    0 18px 42px rgba(42, 35, 26, 0.08),
    inset 4px 0 0 rgba(157, 63, 48, 0.38) !important;
}

@media (max-width: 920px) {

  body.is-authenticated .hero-copy,
  body.is-authenticated .panel,
  body.is-authenticated .metric-card,
  body.is-authenticated .detail-card {
border-radius: 18px;
    padding: 16px !important;
  }

  /* Un panneau ne doit pas rogner son contenu sur petit ecran. La fiche
     ouverte en surimpression est l'exception : elle est de hauteur bornee et
     doit defiler, sinon on ne voit que son premier ecran. */
  body.is-authenticated .hero-copy,
  body.is-authenticated .panel:not(.is-floating-open),
  body.is-authenticated .metric-card,
  body.is-authenticated .detail-card {
max-width: 100% !important;
    overflow: visible !important;
    border-radius: 18px;
    padding: 14px !important;
  }

  body.is-authenticated .deals-dashboard-panel,
  body.is-authenticated .contracts-dashboard-panel,
  body.is-authenticated .insight-panel,
  body.is-authenticated .library-panel,
  body.is-authenticated .details-panel,
  body.is-authenticated .invoices-main-panel,
  body.is-authenticated .invoice-preview-panel,
  body.is-authenticated .accounting-main-panel,
  body.is-authenticated .duplicates-summary-panel,
  body.is-authenticated .duplicates-list-panel {
height: auto;
    min-height: 0;
  }

  body.is-authenticated .dashboard-grid,
  body.is-authenticated .deals-dashboard-grid,
  body.is-authenticated .contracts-dashboard-grid,
  body.is-authenticated .invoice-kpis,
  body.is-authenticated .duplicates-summary,
  body.is-authenticated .import-summary-grid,
  body.is-authenticated .analysis-grid,
  body.is-authenticated .invoice-template-grid,
  body.is-authenticated .kpi-detail-grid,
  body.is-authenticated .kpi-detail-meta,
  body.is-authenticated .admin-diagnostics-grid {
display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  body.is-authenticated .deals-dashboard-grid .metric-card,
  body.is-authenticated .contracts-dashboard-grid .metric-card,
  body.is-authenticated .invoice-kpis .metric-card,
  body.is-authenticated .metric-card {
width: 100%;
    min-width: 0 !important;
    min-height: 0 !important;
    scroll-snap-align: unset;
  }

  body.is-authenticated .metric-card {
display: grid !important;
    gap: 6px !important;
  }

  body.is-authenticated .metric-label {
font-size: 0.72rem !important;
    line-height: 1.2;
  }

  body.is-authenticated .metric-value {
max-width: 100% !important;
    font-size: clamp(1.65rem, 8.8vw, 2.4rem) !important;
    line-height: 1.05 !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body.is-authenticated .metric-foot {
font-size: 0.88rem !important;
    line-height: 1.3 !important;
  }

}

@media (max-width: 520px) {

  body.is-authenticated .hero-copy,
  body.is-authenticated .panel,
  body.is-authenticated .metric-card,
  body.is-authenticated .detail-card {
padding: 12px !important;
    border-radius: 16px;
  }

  body.is-authenticated .metric-value {
font-size: clamp(1.55rem, 8vw, 2.1rem) !important;
  }

}

/* Mobile UX polish 2026-07-05: replace raw controls with product-grade hierarchy. */
body.is-authenticated .metric-card {
align-content: start;
}

body.is-authenticated .metric-label {
color: #857c70 !important;
  font-weight: 720 !important;
  letter-spacing: 0.08em !important;
}

body.is-authenticated .metric-value {
font-weight: 620 !important;
}

body.is-authenticated .metric-foot {
font-weight: 440 !important;
}

@media (max-width: 920px) {

  body.is-authenticated .metric-card {
gap: 8px !important;
  }

}

/* ---- Lot : navigation ---- */

.tabs-bar {
display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tab-button,
button {
font: inherit;
}

.tab-button,
button {
border: none;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.tab-button {
background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  border: 1px solid rgba(58, 43, 26, 0.12);
}

.tab-button.is-active {
background: linear-gradient(135deg, rgba(189, 149, 91, 0.14), rgba(255, 255, 255, 0.9));
  color: var(--accent-deep);
  box-shadow: 0 12px 28px rgba(58, 43, 26, 0.08);
}

button:hover,
.tab-button:hover {
transform: translateY(-1px);
}

.tab-view {
display: none;
  gap: 20px;
}

.tab-view.is-active {
display: grid;
}

@media (max-width: 640px) {

  .tabs-bar {
flex-direction: column;
  }

}

.tabs-bar {
position: sticky;
  top: 18px;
  z-index: 30;
  grid-column: 1;
  grid-row: 1 / span 20;
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 0%, rgba(189, 149, 91, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.94), rgba(248, 239, 228, 0.9));
}

.tabs-bar::before {
content: none;
  display: none;
}

.tabs-bar::after {
content: none;
  display: none;
}

.tab-view {
grid-column: 2;
  min-width: 0;
}

.tab-button {
width: 100%;
  display: flex;
  justify-content: flex-start;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  text-align: left;
  font-weight: 760;
}

.tab-button:hover {
background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
}

.tab-button.is-active {
background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent),
    var(--nav);
  color: #fffaf2;
  box-shadow: 0 12px 28px rgba(32, 58, 49, 0.18);
}

@media (max-width: 1180px) {

  .tabs-bar {
position: sticky;
    top: 0;
    grid-column: 1;
    grid-row: auto;
    display: flex;
    flex-wrap: nowrap;
    max-height: none;
    overflow-x: auto;
    padding: 12px;
    border-radius: 24px;
    scrollbar-width: none;
  }

  .tabs-bar::-webkit-scrollbar {
display: none;
  }

  .tabs-bar::before,
  .tabs-bar::after {
display: none;
  }

  .tab-view {
grid-column: 1;
  }

  .tab-button {
width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

}

@media (max-width: 920px) {

  .hero-copy,
  .hero-side,
  .assistant-home-panel,
  .workspace > .tab-view.is-active,
  .tabs-bar {
border-radius: 24px;
  }

  .tabs-bar {
top: 0;
    z-index: 80;
    margin: 0 -12px;
    padding: 10px 12px;
    border-radius: 0 0 24px 24px;
    border-left: 0;
    border-right: 0;
    background: rgba(255, 253, 248, 0.94);
    box-shadow: 0 14px 34px rgba(70, 50, 28, 0.1);
  }

  .tab-button {
min-height: 44px;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    background: rgba(255, 255, 255, 0.74);
  }

  .tab-button.is-active {
background: var(--nav);
  }

}

body.is-authenticated .tabs-bar {
gap: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 252, 247, 0.9)),
    rgba(255, 252, 247, 0.88);
}

body.is-authenticated .tab-button,
body.is-authenticated .secondary-button,
body.is-authenticated .ghost-button,
body.is-authenticated button {
font-weight: 800;
}

body.is-authenticated .tab-button {
border-color: rgba(31, 63, 52, 0.12);
  color: #34443e;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body.is-authenticated .tab-button.is-active {
border-color: rgba(38, 93, 73, 0.22);
  color: #fffaf2;
  background: linear-gradient(180deg, #2f7454, #235b43);
  box-shadow:
    0 14px 32px rgba(38, 93, 73, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

body.is-authenticated .secondary-button:hover,
body.is-authenticated .tab-button.is-active:hover {
background: linear-gradient(180deg, #347f5d, #1f523d);
}

@media (max-width: 920px) {

  body.is-authenticated .tabs-bar {
padding: 14px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  body.is-authenticated .tab-button {
flex: 0 0 auto;
    padding: 11px 15px;
  }

}

body.is-authenticated .tabs-bar {
position: sticky !important;
  top: 12px !important;
  z-index: 90 !important;
  grid-column: 1;
  grid-row: auto;
  display: flex !important;
  flex-wrap: wrap;
  align-items: center !important;
  max-height: none !important;
  overflow: visible !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 14px !important;
  border: 1px solid rgba(31, 63, 52, 0.14) !important;
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 252, 247, 0.93)),
    rgba(255, 252, 247, 0.9);
  box-shadow:
    0 18px 46px rgba(48, 38, 25, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

body.is-authenticated .tabs-bar::before,
body.is-authenticated .tabs-bar::after {
content: none;
  display: none !important;
}

body.is-authenticated .tab-view {
grid-column: 1;
  min-width: 0 !important;
}

body.is-authenticated .tab-button {
width: auto;
  min-height: 42px !important;
  flex: 0 0 auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center !important;
  padding: 11px 16px !important;
  border-radius: 999px;
  white-space: nowrap;
  text-align: center;
  color: #34443e !important;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
}

body.is-authenticated .tab-button.is-active {
color: #fffaf2 !important;
  background: linear-gradient(180deg, #2f7454, #235b43);
  box-shadow:
    0 14px 32px rgba(38, 93, 73, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}

@media (max-width: 920px) {

  body.is-authenticated .tabs-bar {
top: 0 !important;
    flex-wrap: nowrap;
    overflow-x: auto !important;
    margin: 0 -12px !important;
    padding: 10px 12px !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 0 24px 24px;
    scrollbar-width: none;
  }

  body.is-authenticated .tabs-bar::-webkit-scrollbar {
display: none !important;
  }

  body.is-authenticated .tab-button {
min-height: 44px !important;
    padding: 10px 14px !important;
    font-size: 0.88rem !important;
  }

}

body.is-authenticated button,
body.is-authenticated .tab-button,
body.is-authenticated .secondary-button,
body.is-authenticated .ghost-button {
font-weight: 680 !important;
  letter-spacing: -0.01em;
}

body.is-authenticated .secondary-button,
body.is-authenticated .tab-button.is-active {
border-color: rgba(33, 79, 63, 0.18) !important;
  color: #fffaf2 !important;
  background: linear-gradient(180deg, #2a6a50, #214f3f);
  box-shadow:
    0 10px 24px rgba(33, 79, 63, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}

body.is-authenticated .ghost-button,
body.is-authenticated .tab-button {
border-color: rgba(34, 32, 28, 0.1) !important;
  color: #35443d !important;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

body.is-authenticated .tabs-bar {
position: relative !important;
  top: auto !important;
  z-index: 1 !important;
  display: flex !important;
  flex-wrap: wrap;
  align-items: center !important;
  gap: 8px !important;
  max-height: none !important;
  overflow: visible !important;
  margin: 0 !important;
  padding: 12px !important;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 253, 249, 0.94)),
    #fffdf9;
}

body.is-authenticated .tabs-bar::before,
body.is-authenticated .tabs-bar::after {
content: none;
  display: none !important;
}

body.is-authenticated .tab-button {
min-height: 38px !important;
  padding: 9px 13px !important;
  border-radius: 999px;
  font-size: 0.88rem !important;
  line-height: 1.05;
  white-space: nowrap;
}

body.is-authenticated .tab-view {
grid-column: 1;
}

@media (max-width: 920px) {

  body.is-authenticated .tabs-bar {
position: relative !important;
    top: auto !important;
    z-index: 1 !important;
    flex-wrap: nowrap;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-height: 56px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 7px !important;
    border-radius: 18px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.is-authenticated .tabs-bar::-webkit-scrollbar {
display: none !important;
  }

  body.is-authenticated .tab-button {
flex: 0 0 auto !important;
    min-height: 38px !important;
    padding: 8px 12px !important;
    font-size: 0.8rem !important;
  }

}

/* Mobile repair 2026-07-05: one predictable responsive layer for the authenticated app. */
.mobile-tab-nav {
display: none;
}

@media (max-width: 920px) {

  body.is-authenticated .mobile-tab-nav {
position: sticky !important;
    top: 0 !important;
    z-index: 80 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 7px !important;
    padding: 12px !important;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 253, 249, 0.97)),
      #fffdf9;
    box-shadow: 0 12px 28px rgba(42, 35, 26, 0.08) !important;
  }

  body.is-authenticated .mobile-tab-trigger {
width: 100% !important;
    min-height: 58px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center !important;
    gap: 4px 10px !important;
    padding: 10px 12px !important;
    border: 1px solid rgba(33, 79, 63, 0.16) !important;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink) !important;
    text-align: left;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
  }

  body.is-authenticated .mobile-tab-kicker {
grid-column: 1 / -1;
    color: var(--muted) !important;
    font-size: 0.66rem !important;
    font-weight: 760 !important;
    letter-spacing: 0.14em !important;
    line-height: 1 !important;
    text-transform: uppercase;
  }

  body.is-authenticated .mobile-tab-trigger strong {
min-width: 0;
    font-size: 1.06rem;
    font-weight: 760;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.is-authenticated .mobile-tab-chevron {
width: 34px !important;
    height: 34px !important;
    display: inline-grid !important;
    place-items: center;
    border-radius: 999px;
    color: var(--accent) !important;
    background: rgba(33, 79, 63, 0.08);
    font-size: 1.15rem !important;
    transition: transform 160ms ease;
  }

  body.is-authenticated .mobile-tab-trigger[aria-expanded="true"] .mobile-tab-chevron {
transform: rotate(180deg);
  }

  body.is-authenticated .mobile-tab-menu {
display: grid !important;
    gap: 6px !important;
    max-height: min(68vh, 420px) !important;
    overflow-y: auto !important;
    padding: 8px !important;
    border: 1px solid rgba(34, 32, 28, 0.1);
    border-radius: 16px;
    background: rgba(255, 253, 249, 0.98);
    box-shadow: 0 18px 42px rgba(42, 35, 26, 0.12) !important;
  }

  body.is-authenticated .mobile-tab-menu[hidden] {
display: none !important;
  }

  body.is-authenticated .mobile-tab-option {
width: 100%;
    min-height: 44px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px !important;
    border: 0;
    border-radius: 12px;
    color: #35443d !important;
    background: transparent;
    box-shadow: none;
    font-size: 0.98rem !important;
    font-weight: 650 !important;
    text-align: left;
  }

  body.is-authenticated .mobile-tab-option.is-active {
color: #fffaf2 !important;
    background: linear-gradient(180deg, #2a6a50, #214f3f);
  }

  body.is-authenticated .tabs-bar {
display: none !important;
  }

  body.is-authenticated .tab-view {
min-width: 0 !important;
  }

  body.is-authenticated .tab-view.is-active {
display: block;
  }

}

@media (max-width: 520px) {

  body.is-authenticated .mobile-tab-nav {
padding: 10px !important;
  }

}

@media (max-width: 920px) {

  body.is-authenticated .mobile-tab-nav {
border: 1px solid rgba(34, 32, 28, 0.08) !important;
  }

  body.is-authenticated .mobile-tab-trigger {
position: relative !important;
    min-height: 62px !important;
    border-color: rgba(33, 79, 63, 0.18) !important;
    background:
      radial-gradient(circle at top right, rgba(214, 169, 104, 0.16), transparent 42%),
      rgba(255, 255, 255, 0.88);
  }

  body.is-authenticated .mobile-tab-menu {
position: absolute !important;
    right: 12px !important;
    left: 12px !important;
    top: calc(100% - 8px) !important;
    z-index: 100 !important;
    gap: 4px !important;
  }

  body.is-authenticated .mobile-tab-option::after {
content: "";
    width: 8px !important;
    height: 8px !important;
    border-radius: 999px;
    background: rgba(33, 79, 63, 0.12);
  }

  body.is-authenticated .mobile-tab-option.is-active::after {
background: #fffaf2;
  }

}

body.is-authenticated .app-shell,
  body.is-authenticated .workspace,
  body.is-authenticated .tab-view,
  body.is-authenticated .content-grid,
  body.is-authenticated #contracts-view,
  body.is-authenticated #contracts-view .filters-panel,
  body.is-authenticated #contracts-view .library-panel,
  body.is-authenticated #contracts-view .details-panel,
  body.is-authenticated #contracts-view .contracts-toolbar,
  body.is-authenticated #contracts-view .contracts-list,
  body.is-authenticated #contracts-view .month-group,
  body.is-authenticated #contracts-view .contract-card {
width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

/* ---- Lot : assistant ---- */

.assistant-panel {
display: grid;
  gap: 18px;
  margin-top: 18px;
}

.assistant-home-panel {
margin-bottom: 20px;
}

.assistant-chat-list {
display: grid;
  gap: 14px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.assistant-chat-form {
display: grid;
  gap: 14px;
}

.assistant-message {
display: grid;
  gap: 10px;
  max-width: min(860px, 100%);
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(58, 43, 26, 0.12);
}

.assistant-message-assistant {
background: rgba(255, 253, 249, 0.92);
}

.assistant-message-user {
justify-self: end;
  background:
    linear-gradient(135deg, rgba(189, 149, 91, 0.14), rgba(189, 149, 91, 0.04)),
    rgba(255, 248, 240, 0.96);
}

.assistant-message-empty {
max-width: 100%;
}

.assistant-message.is-loading {
border-style: dashed;
}

.assistant-loading-indicator {
display: inline-flex;
  align-items: center;
  gap: 6px;
}

.assistant-loading-indicator span {
width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(189, 149, 91, 0.72);
  animation: assistant-dot 1.1s ease-in-out infinite;
}

.assistant-loading-indicator span:nth-child(2) {
animation-delay: 0.16s;
}

.assistant-loading-indicator span:nth-child(3) {
animation-delay: 0.32s;
}

.assistant-message-label,
.assistant-message-text,
.assistant-message-title {
margin: 0;
}

.assistant-message-label {
color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assistant-message-title {
font-size: 1rem;
}

.assistant-message-text {
line-height: 1.6;
}

.assistant-message-list {
margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.assistant-message-block {
display: grid;
  gap: 8px;
}

/* Raccourcis, sources et suites : spec 11, section 7. Les raccourcis repondent
   sans modele, les sources s'ouvrent d'un geste, les suites reposent la
   question. */

.assistant-freshness {
margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.assistant-shortcuts {
display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-shortcut {
appearance: none;
  border: 1px solid rgba(58, 43, 26, 0.16);
  background: rgba(255, 253, 249, 0.92);
  color: inherit;
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.assistant-shortcut:hover:not(:disabled),
.assistant-suite:hover:not(:disabled),
.assistant-source:hover {
border-color: rgba(189, 149, 91, 0.62);
  background: rgba(189, 149, 91, 0.1);
}

.assistant-shortcut:disabled,
.assistant-suite:disabled {
opacity: 0.55;
  cursor: default;
}

.assistant-sources {
display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-source {
appearance: none;
  border: 1px solid rgba(58, 43, 26, 0.16);
  background: transparent;
  color: inherit;
  border-radius: 10px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}

.assistant-suites {
display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-suite {
appearance: none;
  border: 1px dashed rgba(58, 43, 26, 0.28);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 6px 13px;
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.assistant-message-scope {
margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.assistant-reserves .assistant-message-list {
color: var(--muted);
  font-size: 0.86rem;
}

.assistant-message-error {
border-style: dashed;
  border-color: rgba(168, 74, 52, 0.42);
}

@media (max-width: 640px) {

  .assistant-shortcuts {
flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .assistant-shortcuts::-webkit-scrollbar {
display: none;
  }

  .assistant-shortcut {
flex: 0 0 auto;
  }

}

.assistant-home-panel {
margin: 0;
  border-radius: 26px;
}

.assistant-home-panel .assistant-chat-list:empty {
display: none;
}

.assistant-home-panel .assistant-chat-list {
max-height: 280px;
}

@media (max-width: 920px) {

  .assistant-home-panel {
margin: 12px;
  }

  .assistant-home-panel .assistant-chat-form {
gap: 10px;
  }

}

@media (max-width: 640px) {

  .assistant-home-panel {
margin-inline: 10px;
  }

}

@media (max-width: 920px) {

  body.is-authenticated .assistant-home-panel {
display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 0 10px !important;
  }

  body.is-authenticated .assistant-home-panel .section-heading {
margin: 0;
  }

  body.is-authenticated .assistant-home-panel h2 {
font-size: 1.18rem !important;
    line-height: 1.2 !important;
  }

  body.is-authenticated .assistant-home-panel .assistant-chat-list:empty {
display: none !important;
  }

  body.is-authenticated .assistant-home-panel .assistant-chat-list {
max-height: 180px;
    overflow-y: auto;
  }

  body.is-authenticated .assistant-home-panel .assistant-chat-form {
display: grid;
    gap: 10px;
  }

  body.is-authenticated .assistant-home-panel textarea {
min-height: 86px;
    font-size: 0.95rem;
    line-height: 1.35;
  }

  body.is-authenticated .assistant-home-panel .secondary-button {
width: 100% !important;
    min-height: 46px;
  }

}

/* ---- tranche de 150 regles ---- */

:root {
--bg: #f8f3ea;
  --bg-deep: #ede3d4;
  --ink: #1e2d28;
  --muted: #766f65;
  --line: rgba(31, 63, 52, 0.14);
  --card: rgba(255, 252, 247, 0.9);
  --card-strong: rgba(255, 253, 249, 0.97);
  --accent: #bd955b;
  --accent-deep: #265d49;
  --accent-soft: #ead9bd;
  --success: #265d49;
  --danger: #9d3f30;
  --shadow: 0 24px 68px rgba(48, 38, 25, 0.11);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
box-sizing: border-box;
}

[hidden] {
display: none !important;
}

html {
scroll-behavior: smooth;
}

body {
margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(189, 149, 91, 0.18), transparent 24%),
    radial-gradient(circle at bottom right, rgba(38, 93, 73, 0.16), transparent 18%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
}

#app-shell {
display: none;
}

body.is-authenticated #app-shell {
display: block;
}

body::before {
content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.38)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='rgba(140,90,40,0.08)' stroke-width='1'%3E%3Cpath d='M0 40h160M0 80h160M0 120h160'/%3E%3Cpath d='M40 0v160M80 0v160M120 0v160'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.55;
  mix-blend-mode: soft-light;
}

.app-shell {
width: min(1660px, calc(100% - 24px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

@keyframes authSpin {

  from {
transform: rotate(0deg);
  }

  to {
transform: rotate(360deg);
  }

}

.hero {
grid-template-columns: 1.45fr 0.95fr;
  margin-bottom: 20px;
}

.hero-copy,
.panel {
border-radius: var(--radius-xl);
}

.hero-copy {
padding: 36px;
}

.logout-button {
white-space: nowrap;
}

.eyebrow,
.section-kicker,
.month-chip {
margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-deep);
}

h1 {
margin: 0;
  max-width: 12ch;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.98;
}

h2 {
margin: 0;
  font-size: 1.65rem;
}

.section-heading {
margin-bottom: 18px;
}

.section-heading.row {
display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

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

.sort-pill-group {
display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sort-pill-button {
padding: 10px 14px;
  font-size: 0.82rem;
}

.sort-pill-button.is-active {
border-color: rgba(189, 149, 91, 0.3);
  background: rgba(189, 149, 91, 0.12);
  color: var(--accent-deep);
}

.section-heading.compact {
margin-bottom: 14px;
}

.upload-zone {
display: grid;
  gap: 10px;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(189, 149, 91, 0.35);
  background:
    linear-gradient(135deg, rgba(189, 149, 91, 0.08), transparent 55%),
    var(--card-strong);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.upload-zone:hover {
transform: translateY(-2px);
  border-color: rgba(189, 149, 91, 0.6);
  box-shadow: 0 16px 40px rgba(189, 149, 91, 0.12);
}

.upload-zone input {
display: none;
}

.upload-title {
font-size: 1rem;
  font-weight: 800;
}

.upload-caption {
font-size: 0.92rem;
  color: var(--muted);
}

.mini-card,
.health-card,
.ranking-card,
.month-stat {
border: 1px solid rgba(58, 43, 26, 0.12);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.88);
}

.status-message {
min-height: 28px;
  margin: 14px 2px 0;
  font-size: 0.94rem;
}

.status-message:empty {
display: none;
}

.workspace {
display: grid;
  gap: 20px;
}

.secondary-button,
.ghost-button {
background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  border: 1px solid rgba(58, 43, 26, 0.12);
}

.secondary-button {
box-shadow: 0 12px 28px rgba(58, 43, 26, 0.08);
}

.ghost-button {
background: transparent;
}

.danger-button {
color: var(--danger);
  border-color: rgba(157, 53, 36, 0.2);
}

.full-width {
width: 100%;
  margin-top: 8px;
}

.insights-grid {
grid-template-columns: 1.35fr 0.95fr;
}

.insights-grid.bottom {
grid-template-columns: 1fr;
}

.insight-panel {
min-height: 100%;
}

.deals-grid {
grid-template-columns: 270px minmax(0, 1fr);
  align-items: start;
}

.accounting-grid {
grid-template-columns: 290px minmax(0, 1fr);
  align-items: start;
}

.invoices-grid {
grid-template-columns: 290px 360px minmax(0, 1fr);
  align-items: start;
}

.upload-actions-grid {
display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.invoice-toolbar {
display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(58, 43, 26, 0.1);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.9);
}

.contracts-toolbar {
display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.contracts-toolbar-shell {
flex-wrap: wrap;
}

.contracts-toolbar-copy {
display: grid;
  gap: 4px;
}

.contracts-toolbar-copy span {
color: var(--muted);
  font-size: 0.88rem;
}

.import-review-shell {
display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(58, 43, 26, 0.12);
  background: rgba(255, 252, 247, 0.92);
}

.import-loader-shell {
grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
}

.import-loader {
width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 4px solid rgba(189, 149, 91, 0.18);
  border-top-color: var(--accent);
  animation: import-spin 0.9s linear infinite;
}

.import-summary-grid,
.invoice-summary-grid {
grid-template-columns: repeat(4, minmax(0, 1fr));
}

.invoice-kpis {
display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-detail-hero {
display: grid;
  gap: 16px;
}

.kpi-detail-header {
display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.kpi-detail-copy {
display: grid;
  gap: 8px;
}

.kpi-detail-copy p {
margin: 0;
}

.kpi-detail-grid {
display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 18px;
}

.kpi-detail-card {
padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(58, 43, 26, 0.1);
  background: rgba(255, 252, 247, 0.92);
}

.kpi-detail-meta {
display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.kpi-detail-meta-card {
padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(58, 43, 26, 0.1);
  background: rgba(255, 253, 249, 0.92);
  display: grid;
  gap: 6px;
}

.kpi-detail-meta-card strong {
font-size: 1.2rem;
}

.kpi-detail-chart {
display: grid;
  gap: 14px;
}

.kpi-detail-chart .sort-pill-group {
margin-bottom: 4px;
}

.kpi-chart-legend {
display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.kpi-chart-bars {
display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 250px;
}

.kpi-chart-bar {
display: grid;
  gap: 8px;
  justify-items: center;
}

.kpi-chart-bar-fill {
width: 100%;
  min-height: 8px;
  border-radius: 999px 999px 16px 16px;
  background: linear-gradient(180deg, rgba(189, 149, 91, 0.95), rgba(38, 93, 73, 0.8));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.kpi-chart-bar.is-positive .kpi-chart-bar-fill {
background: linear-gradient(180deg, rgba(38, 93, 73, 0.95), rgba(27, 71, 55, 0.84));
}

.kpi-chart-bar.is-negative .kpi-chart-bar-fill {
background: linear-gradient(180deg, rgba(157, 53, 36, 0.96), rgba(117, 36, 23, 0.84));
}

.kpi-chart-bar-label,
.kpi-chart-bar-value {
font-size: 0.82rem;
  text-align: center;
}

.kpi-chart-bar-value {
font-weight: 700;
}

.kpi-detail-list {
margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.kpi-detail-list li {
color: var(--text);
}

.action-loader {
position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  background: rgba(31, 27, 22, 0.32);
  backdrop-filter: blur(8px);
}

.action-loader-card {
width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background:
    radial-gradient(circle at top right, rgba(189, 149, 91, 0.18), transparent 28%),
    rgba(255, 250, 242, 0.96);
  box-shadow: 0 28px 70px rgba(31, 27, 22, 0.24);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 12px;
}

.action-loader-ring {
width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 5px solid rgba(189, 149, 91, 0.16);
  border-top-color: var(--accent);
  border-right-color: rgba(38, 93, 73, 0.75);
  animation: authSpin 1s linear infinite;
}

.action-loader-title,
.action-loader-text {
margin: 0;
}

.action-loader-text {
max-width: 28ch;
  color: var(--muted);
}

.action-loader-progress {
width: min(280px, 100%);
}

.action-loader-progress-track {
display: block;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(58, 43, 26, 0.1);
  overflow: hidden;
}

.action-loader-progress-bar {
display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), rgba(38, 93, 73, 0.92));
  transition: width 180ms ease;
}

.table-shell {
overflow-x: visible;
}

.deals-main-panel,
.accounting-main-panel,
.library-panel,
.duplicates-list-panel,
.invoices-main-panel,
.invoice-preview-panel {
min-width: 0;
}

.accounting-status-pill {
display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(58, 43, 26, 0.08);
  color: var(--text);
}

.accounting-status-pill.is-review {
background: rgba(189, 149, 91, 0.14);
  color: #8e3d14;
}

.accounting-status-pill.is-processing {
background: rgba(179, 120, 33, 0.14);
  color: #8a5a12;
}

.accounting-status-pill.is-complete {
background: rgba(40, 111, 83, 0.14);
  color: #1f6546;
}

.accounting-inline-actions {
display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.accounting-owner {
display: grid;
  gap: 4px;
}

.accounting-owner strong {
font-size: 0.92rem;
}

.accounting-primary-actions {
display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 6px 0 18px;
}

.accounting-quick-actions-panel {
display: grid;
  gap: 14px;
}

.accounting-quick-actions-panel .section-heading {
margin-bottom: 0;
}

.accounting-quick-actions-panel .accounting-primary-actions {
margin: 0;
}

.accounting-primary-action {
grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 104px;
  border-style: solid;
}

.accounting-primary-action .upload-title,
.accounting-primary-action .upload-caption {
display: block;
}

.accounting-primary-action .upload-title {
margin-bottom: 4px;
  font-size: 1.08rem;
}

.accounting-primary-icon {
width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 18px;
  color: var(--accent-deep);
  background: rgba(40, 111, 83, 0.12);
}

.accounting-primary-icon svg {
width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.accounting-primary-action.is-camera .accounting-primary-icon {
color: #8a5a12;
  background: rgba(189, 149, 91, 0.16);
}

.accounting-mobile-card {
cursor: default;
}

.accounting-mobile-card-edit {
gap: 18px;
}

.accounting-mobile-meta {
display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.accounting-mobile-edit-grid {
display: grid;
  gap: 12px;
}

.accounting-mobile-edit-grid label,
.accounting-mobile-owner {
display: grid;
  gap: 6px;
}

.accounting-mobile-edit-grid label span,
.accounting-mobile-owner span {
font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.accounting-mobile-owner small {
color: var(--muted);
}

.accounting-mobile-edit-grid input,
.accounting-mobile-edit-grid select,
.accounting-mobile-edit-grid textarea {
width: 100%;
}

.accounting-mobile-comment {
grid-column: 1 / -1;
}

.backup-card {
grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.checkbox-field {
display: inline-flex;
  align-items: center;
  gap: 10px;
}

.accounting-stats-table input,
.accounting-stats-table select,
.accounting-stats-table textarea {
width: 100%;
  border: 1px solid rgba(58, 43, 26, 0.16);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 253, 249, 0.96);
  color: var(--text);
  font: inherit;
}

.accounting-stats-table textarea {
min-height: 72px;
  resize: vertical;
}

.invoice-preview-panel.is-floating-open {
position: fixed;
  inset: 92px 28px 26px 340px;
  z-index: 60;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 28px;
  background: rgba(247, 242, 234, 0.98);
  box-shadow:
    0 28px 70px rgba(31, 27, 22, 0.24),
    0 0 0 100vmax rgba(31, 27, 22, 0.24);
}

/* Le blocage du defilement de fond est pose par app.js (classe « est-fige »),
   qui retient la position de lecture et la rend a la fermeture. Un simple
   overflow: hidden sur la racine ramenait la page en haut et ne la
   redescendait jamais. Regle R3 du cahier de recette UX. */

.contract-preview-close {
display: none;
}

.invoice-preview-panel.is-floating-open .invoice-workspace {
min-height: 100%;
}

.stats-table {
width: 100%;
  border-collapse: collapse;
}

.deals-stats-table {
table-layout: fixed;
}

.stats-table th,
.stats-table td {
padding: 12px 10px;
  border-top: 1px solid rgba(58, 43, 26, 0.08);
  text-align: left;
  font-size: 0.94rem;
  vertical-align: top;
}

.stats-table thead th {
border-top: 0;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.deals-stats-table th,
.deals-stats-table td {
padding: 8px 6px;
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.deals-stats-table td:first-child,
.deals-stats-table th:first-child {
text-align: center;
}

.deals-stats-table input[type="checkbox"] {
width: 16px;
  height: 16px;
  margin: 2px auto 0;
  accent-color: var(--accent);
}

.deals-stats-table th:nth-child(1),
.deals-stats-table td:nth-child(1) {
width: 3%;
}

.deals-stats-table th:nth-child(2),
.deals-stats-table td:nth-child(2) {
width: 7%;
}

.deals-stats-table th:nth-child(3),
.deals-stats-table td:nth-child(3) {
width: 6%;
}

.deals-stats-table th:nth-child(4),
.deals-stats-table td:nth-child(4) {
width: 14%;
}

.deals-stats-table th:nth-child(5),
.deals-stats-table td:nth-child(5),
.deals-stats-table th:nth-child(6),
.deals-stats-table td:nth-child(6),
.deals-stats-table th:nth-child(7),
.deals-stats-table td:nth-child(7) {
width: 7%;
}

.deals-stats-table th:nth-child(8),
.deals-stats-table td:nth-child(8),
.deals-stats-table th:nth-child(9),
.deals-stats-table td:nth-child(9),
.deals-stats-table th:nth-child(10),
.deals-stats-table td:nth-child(10) {
width: 6%;
}

.deals-stats-table th:nth-child(11),
.deals-stats-table td:nth-child(11),
.deals-stats-table th:nth-child(12),
.deals-stats-table td:nth-child(12) {
width: 5%;
}

.deals-stats-table th:nth-child(13),
.deals-stats-table td:nth-child(13) {
width: 6%;
}

.deals-stats-table th:nth-child(14),
.deals-stats-table td:nth-child(14) {
width: 8%;
}

.deals-stats-table th:nth-child(15),
.deals-stats-table td:nth-child(15) {
width: 7%;
}

.link-button {
padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-deep);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible {
color: var(--accent);
  text-decoration: underline;
}

.deals-mobile-list {
display: grid;
  gap: 14px;
}

.deal-mobile-card {
display: grid;
  gap: 14px;
  padding: 18px;
}

/* ---- tranche de 200 regles ---- */

.deal-mobile-card-alert {
border-color: rgba(189, 149, 91, 0.28);
  background:
    radial-gradient(circle at top right, rgba(189, 149, 91, 0.12), transparent 34%),
    rgba(255, 250, 244, 0.96);
}

.deal-mobile-card-header {
display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.deal-mobile-card-header h3 {
margin: 4px 0 0;
  font-size: 1.08rem;
}

.deal-mobile-select {
display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.deal-mobile-select input[type="checkbox"] {
width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.deal-mobile-grid {
display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.deal-mobile-grid > div,
.deal-mobile-contract,
.deal-mobile-comments,
.deal-mobile-editor {
padding: 12px 14px;
  border: 1px solid rgba(58, 43, 26, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.deal-mobile-grid > div {
display: grid;
  gap: 4px;
}

.deal-mobile-grid strong,
.deal-mobile-contract strong {
font-size: 0.98rem;
  line-height: 1.45;
}

.deal-mobile-contract,
.deal-mobile-comments,
.deal-mobile-editor {
display: grid;
  gap: 8px;
}

.deal-linked-contract-button {
width: fit-content;
}

.linked-contract-stack {
display: grid;
  gap: 8px;
}

.linked-contract-actions {
justify-content: flex-start;
  flex-wrap: wrap;
}

.linked-contract-actions .ghost-button {
padding: 6px 10px;
  font-size: 0.8rem;
}

.deal-editor-form-mobile .editor-grid {
grid-template-columns: 1fr;
}

.deal-editor-form-mobile .detail-actions {
justify-content: flex-start;
}

.review-table input,
.review-table select {
padding: 10px 11px;
  min-width: 0;
  font-size: 0.82rem;
}

.review-table th,
.review-table td {
padding: 8px 6px;
  font-size: 0.82rem;
}

.review-comment-alert {
border-color: rgba(157, 53, 36, 0.38);
  color: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(157, 53, 36, 0.14);
}

.sort-button {
display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: 700;
}

.sort-button.is-active {
color: var(--accent-deep);
}

.select-all-button {
color: var(--accent-deep);
}

.invoice-preview {
display: grid;
  gap: 16px;
}

.invoice-preview-visual {
overflow: hidden;
}

.invoice-preview-visual svg {
display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
}

.invoice-sheet {
display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid rgba(58, 43, 26, 0.12);
  background:
    radial-gradient(circle at top right, rgba(189, 149, 91, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(255, 255, 255, 0.92));
}

.invoice-sheet-editor {
padding: 0;
  border: 0;
  background: transparent;
}

.year-cards,
.analysis-grid,
.invoice-template-grid {
display: grid;
  gap: 14px;
}

.year-cards {
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.year-card {
display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid rgba(58, 43, 26, 0.12);
  border-radius: 20px;
  background: rgba(255, 253, 249, 0.88);
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.year-card:hover,
.year-card.is-active {
transform: translateY(-2px);
  border-color: rgba(189, 149, 91, 0.38);
  box-shadow: 0 16px 32px rgba(92, 56, 24, 0.08);
}

.year-card.is-active {
background:
    linear-gradient(135deg, rgba(189, 149, 91, 0.12), transparent 70%),
    rgba(255, 248, 236, 0.96);
}

.year-analysis-shell {
display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(58, 43, 26, 0.12);
  background: rgba(255, 252, 247, 0.9);
}

.year-analysis-shell.is-loading {
grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
}

.analysis-grid,
.invoice-template-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analysis-mode {
align-self: start;
}

.invoice-fixed-card {
gap: 8px;
}

.invoice-template-grid-premium {
align-items: stretch;
}

.invoice-hero {
display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(58, 43, 26, 0.1);
  background:
    linear-gradient(135deg, rgba(189, 149, 91, 0.12), transparent 55%),
    rgba(255, 255, 255, 0.86);
}

.invoice-hero-copy {
display: grid;
  gap: 8px;
}

.invoice-kicker {
margin: 0;
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.invoice-hero-title {
margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  letter-spacing: 0.08em;
}

.invoice-hero-subtitle {
margin: 0;
  max-width: 46ch;
  color: var(--muted);
  line-height: 1.55;
}

.invoice-hero-meta {
display: grid;
  gap: 12px;
}

.invoice-hero-item {
display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(58, 43, 26, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.invoice-hero-item span {
color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invoice-hero-item strong {
font-size: 1rem;
}

.invoice-form-block,
.invoice-issued-card,
.invoice-recipient-shell,
.invoice-recipient-card,
.invoice-bank-card,
.invoice-notes-card {
background: rgba(255, 255, 255, 0.82);
}

.invoice-lines-shell {
padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(58, 43, 26, 0.1);
  background: rgba(255, 255, 255, 0.84);
}

.invoice-summary-grid-premium {
grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invoice-summary-card {
border-radius: 20px;
  border: 1px solid rgba(58, 43, 26, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.invoice-summary-card-accent {
background:
    linear-gradient(135deg, rgba(38, 93, 73, 0.16), rgba(38, 93, 73, 0.06)),
    rgba(255, 255, 255, 0.9);
  border-color: rgba(38, 93, 73, 0.22);
}

.table-subline {
margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.table-subline.subtle {
opacity: 0.8;
}

.table-cell-alert {
color: var(--danger);
  font-weight: 800;
}

.delta-positive {
color: var(--success);
  font-weight: 800;
}

.delta-negative {
color: var(--danger);
  font-weight: 800;
}

.delta-pill.delta-positive {
background: rgba(38, 93, 73, 0.12);
  border-color: rgba(38, 93, 73, 0.18);
}

.delta-pill.delta-negative {
background: rgba(157, 53, 36, 0.12);
  border-color: rgba(157, 53, 36, 0.18);
}

@keyframes import-spin {

  to {
transform: rotate(360deg);
  }

}

.ranking-card,
.month-stat,
.health-card {
display: grid;
  gap: 6px;
  padding: 16px;
}

.content-grid {
grid-template-columns: 320px 1.15fr 1fr;
  align-items: start;
}

.filters-stack,
.detail-grid,
.detail-list,
.editor-grid {
display: grid;
  gap: 14px;
}

label span {
display: inline-block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
width: 100%;
  border: 1px solid rgba(58, 43, 26, 0.14);
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  outline: none;
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

input:focus,
select:focus,
textarea:focus {
border-color: rgba(189, 149, 91, 0.65);
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(189, 149, 91, 0.1);
}

textarea {
resize: vertical;
  min-height: 120px;
}

.results-count {
display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(189, 149, 91, 0.1);
  color: var(--accent-deep);
}

.contracts-list {
display: grid;
  gap: 14px;
}

.contract-card,
.detail-card,
.detail-block,
.duplicate-card {
border: 1px solid rgba(58, 43, 26, 0.12);
  background: rgba(255, 253, 249, 0.88);
}

.contract-card {
position: relative;
  border-radius: 20px;
  padding: 18px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.contract-card:hover,
.contract-card.is-active {
transform: translateY(-2px);
  border-color: rgba(189, 149, 91, 0.44);
  box-shadow: 0 18px 36px rgba(92, 56, 24, 0.1);
}

.contract-card.is-selected {
border-color: rgba(38, 93, 73, 0.32);
  background:
    linear-gradient(135deg, rgba(38, 93, 73, 0.08), transparent 55%),
    rgba(255, 253, 249, 0.94);
  box-shadow: 0 18px 36px rgba(38, 93, 73, 0.09);
}

.contract-topline,
.contract-meta,
.detail-pills,
.detail-actions,
.duplicate-header {
display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.contract-topline,
.duplicate-header {
justify-content: space-between;
}

.contract-card-heading {
display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.contract-card-heading .contract-title {
flex: 1;
}

.contract-select-toggle {
display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(58, 43, 26, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent-deep);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.contract-select-toggle:hover {
transform: translateY(-1px);
  border-color: rgba(189, 149, 91, 0.36);
}

.contract-select-toggle.is-selected {
border-color: rgba(38, 93, 73, 0.3);
  background: rgba(38, 93, 73, 0.14);
  color: var(--success);
}

.contract-title,
.duplicate-side h4 {
margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.amount-pill,
.meta-pill,
.tag,
.status-pill {
display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 800;
}

.amount-pill {
background: rgba(38, 93, 73, 0.12);
  color: var(--success);
}

.meta-pill {
background: rgba(189, 149, 91, 0.1);
  color: var(--accent-deep);
}

.tag {
background: rgba(29, 26, 23, 0.06);
}

.status-pill {
padding: 4px 10px;
  min-height: auto;
  border: 1px solid rgba(58, 43, 26, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.status-recu,
.status-paye {
color: var(--success);
  background: rgba(38, 93, 73, 0.1);
}

.status-non_recu,
.status-non_paye,
.status-facture,
.status-a_facturer {
color: var(--accent-deep);
  background: rgba(189, 149, 91, 0.12);
}

.status-perdu,
.status-non_remunere {
color: var(--danger);
  background: rgba(157, 53, 36, 0.1);
}

.row-actions {
display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-actions button {
width: 100%;
  padding: 8px 10px;
  font-size: 0.76rem;
}

.compact-actions {
flex-direction: column;
  align-items: stretch;
}

.inline-file-button {
position: relative;
  overflow: hidden;
  cursor: pointer;
}

.cards-stack {
display: grid;
  gap: 18px;
}

.admin-diagnostics-grid {
display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.admin-user-form {
display: grid;
  gap: 14px;
}

.admin-users-list {
display: grid;
  gap: 12px;
}

.list-pagination {
display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(58, 43, 26, 0.08);
}

.list-pagination-copy {
display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.pagination-button {
min-width: 42px;
}

.pagination-button.is-active {
border-color: rgba(189, 149, 91, 0.34);
  background: rgba(189, 149, 91, 0.12);
  color: var(--accent-deep);
}

.invoice-list-item.is-active {
border-color: rgba(189, 149, 91, 0.4);
  box-shadow: 0 14px 26px rgba(58, 43, 26, 0.08);
}

.invoice-editor-grid {
grid-template-columns: repeat(4, minmax(0, 1fr));
}

.invoice-list-card,
.invoice-editor-card,
.import-review-block {
display: grid;
  gap: 14px;
}

.deal-row-alert td {
background: rgba(189, 149, 91, 0.05);
}

.deal-editor-row td {
padding: 0;
  background: rgba(255, 249, 241, 0.92);
}

.deal-editor-form {
display: grid;
  gap: 16px;
  padding: 16px;
}

.deal-editor-grid {
grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.contract-snippet {
margin: 12px 0 0;
  font-size: 0.92rem;
}

.detail-card {
border-radius: 24px;
  padding: 22px;
  min-height: 580px;
}

.empty-state {
display: grid;
  place-items: center;
  text-align: center;
}

.detail-header {
display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.detail-title {
margin: 0;
  font-size: 1.55rem;
}

.detail-summary {
margin: 0;
}

.detail-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.delta-grid {
margin-top: 14px;
}

.detail-editor {
display: grid;
  gap: 16px;
}

.editor-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-block {
border-radius: 18px;
  padding: 16px;
}

.detail-block h3 {
margin: 0 0 10px;
  font-size: 1rem;
}

.detail-list {
margin: 0;
  padding: 0;
  list-style: none;
}

.detail-list li {
padding: 10px 0;
  border-top: 1px solid rgba(58, 43, 26, 0.08);
}

.detail-list li:first-child {
border-top: 0;
  padding-top: 0;
}

.meta-label {
display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.month-group {
display: grid;
  gap: 12px;
}

.month-chip {
display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(189, 149, 91, 0.08);
}

.duplicates-layout {
grid-template-columns: 340px 1fr;
  align-items: start;
}

.duplicate-card {
border-radius: 24px;
  padding: 18px;
}

.reconciliation-card {
background:
    linear-gradient(135deg, rgba(189, 149, 91, 0.04), transparent 48%),
    rgba(255, 253, 249, 0.9);
}

.reconciliation-card .detail-grid {
align-items: start;
}

.reconciliation-form select:disabled,
.reconciliation-form button:disabled {
opacity: 0.65;
  cursor: not-allowed;
}

.workspace-highlights {
display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.notifications-list,
.review-queue-list {
display: grid;
  gap: 14px;
}

.notification-card,
.review-queue-card,
.backup-card {
display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(58, 43, 26, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.notification-card-topline {
display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.review-pill {
display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  border: 1px solid rgba(58, 43, 26, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.review-pill.is-complete,
.accounting-status-pill.is-complete {
color: var(--success);
  background: rgba(38, 93, 73, 0.1);
}

.review-pill.is-review,
.accounting-status-pill.is-review {
color: var(--accent-deep);
  background: rgba(189, 149, 91, 0.12);
}

.review-pill.is-processing,
.accounting-status-pill.is-processing {
color: #8a5a12;
  background: rgba(179, 120, 33, 0.14);
}

.review-pill.is-missing {
color: var(--danger);
  background: rgba(157, 53, 36, 0.1);
}

.review-pill.is-blocked,
.review-pill.is-danger {
color: var(--danger);
  background: rgba(157, 53, 36, 0.14);
}

.review-pill.is-warning {
color: var(--accent-deep);
  background: rgba(189, 149, 91, 0.12);
}

.review-pill.is-info {
color: var(--accent-deep);
  background: rgba(189, 149, 91, 0.08);
}

.upload-zone.is-disabled {
opacity: 0.48;
  filter: grayscale(0.2);
  cursor: not-allowed;
}

.upload-zone.is-disabled .upload-title,
.upload-zone.is-disabled .upload-caption {
color: var(--muted);
}

.read-only-toolbar {
border: 1px dashed rgba(58, 43, 26, 0.16);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.72);
}

@keyframes assistant-dot {

  0%,
  80%,
  100% {
transform: translateY(0);
    opacity: 0.35;
  }

  40% {
transform: translateY(-4px);
    opacity: 1;
  }

}

.duplicate-grid {
display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.duplicate-side {
border: 1px solid rgba(58, 43, 26, 0.12);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 12px;
}

.duplicate-side.is-preferred {
border-color: rgba(38, 93, 73, 0.28);
  box-shadow: inset 0 0 0 1px rgba(38, 93, 73, 0.18);
}

.empty-list {
padding: 20px;
  border-radius: 18px;
  border: 1px dashed rgba(58, 43, 26, 0.16);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1240px) {

  .content-grid,
  .duplicates-layout,
  .deals-grid,
  .accounting-grid,
  .invoices-grid,
  .invoice-layout,
  .insights-grid,
  .insights-grid.bottom {
grid-template-columns: 1fr;
  }

  .invoice-kpis {
grid-template-columns: 1fr;
  }

  .kpi-detail-grid,
  .kpi-detail-meta,
  .admin-user-form-grid {
grid-template-columns: 1fr;
  }

  .invoice-preview-panel.is-floating-open {
inset: 88px 18px 18px 18px;
  }

}

@media (max-width: 920px) {

  .details-panel.is-floating-open {
position: fixed;
    inset: 88px 18px 18px 18px;
    z-index: 70;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 28px;
    background: rgba(247, 242, 234, 0.98);
    box-shadow:
      0 28px 70px rgba(31, 27, 22, 0.24),
      0 0 0 100vmax rgba(31, 27, 22, 0.24);
  }

  .details-panel.is-floating-open .section-heading {
position: sticky;
    top: 0;
    z-index: 2;
    padding-bottom: 10px;
    background: linear-gradient(180deg, rgba(247, 242, 234, 0.98), rgba(247, 242, 234, 0.88));
  }

  .details-panel.is-floating-open .contract-preview-close {
display: inline-flex;
  }

  .hero,
  .detail-grid,
  .editor-grid,
  .duplicate-grid,
  .kpi-detail-header {
grid-template-columns: 1fr;
  }

  .table-shell {
overflow-x: auto;
  }

  .deals-stats-table {
min-width: 1080px;
  }

  .notification-card-topline,
  .backup-card {
grid-template-columns: 1fr;
  }

  .deal-mobile-grid {
grid-template-columns: 1fr;
  }

}

@media (max-width: 640px) {

  .app-shell {
width: min(100% - 18px, 1660px);
    padding-top: 18px;
  }

  h1 {
font-size: 2.35rem;
  }

}

/* UX refresh 2026-07-01: premium desktop shell + mobile-first operational views */
:root {
--bg: #f7f1e7;
  --bg-deep: #eadfce;
  --ink: #191715;
  --muted: #786f63;
  --line: rgba(55, 43, 29, 0.11);
  --card: rgba(255, 252, 246, 0.9);
  --card-strong: rgba(255, 254, 250, 0.96);
  --accent: #b86944;
  --accent-deep: #7c3c23;
  --accent-soft: #f2d8c8;
  --success: #294f3f;
  --danger: #9f3d2e;
  --nav: #203a31;
  --info: #315d72;
  --shadow: 0 24px 64px rgba(70, 50, 28, 0.12);
  --shadow-soft: 0 12px 34px rgba(70, 50, 28, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
}

body {
background:
    radial-gradient(circle at 12% 0%, rgba(189, 149, 91, 0.18), transparent 26%),
    radial-gradient(circle at 88% 12%, rgba(41, 79, 63, 0.14), transparent 24%),
    linear-gradient(145deg, #f9f4eb 0%, #f0e4d4 52%, #efe5d6 100%);
}

body::before {
opacity: 0.38;
}

body.is-authenticated #app-shell {
display: grid;
}

.app-shell {
width: min(1780px, calc(100% - 36px));
  gap: 22px;
  padding: 24px 0 54px;
}

.hero {
grid-template-columns: minmax(0, 1.25fr) 390px;
  gap: 22px;
  margin-bottom: 0;
  align-items: stretch;
}

.hero-copy {
min-height: 244px;
  display: grid;
  align-content: end;
  padding: clamp(28px, 4vw, 54px);
  background:
    radial-gradient(circle at 84% 18%, rgba(189, 149, 91, 0.18), transparent 25%),
    linear-gradient(135deg, rgba(255, 254, 250, 0.96), rgba(246, 237, 224, 0.92));
}

.hero-copy h1 {
max-width: 14ch;
  letter-spacing: -0.045em;
}

.hero-text {
max-width: 56ch;
  margin-bottom: 0;
  font-size: 1.02rem;
}

.upload-zone {
min-height: 154px;
  align-content: center;
  border-color: rgba(189, 149, 91, 0.24);
  background:
    radial-gradient(circle at top right, rgba(41, 79, 63, 0.09), transparent 36%),
    rgba(255, 254, 250, 0.9);
}

.workspace {
display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.insights-grid {
grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr);
}

.deals-grid,
.accounting-grid {
grid-template-columns: 310px minmax(0, 1fr);
}

.content-grid {
grid-template-columns: 300px minmax(420px, 0.9fr) minmax(0, 1fr);
}

.invoices-grid {
grid-template-columns: 300px minmax(360px, 0.85fr) minmax(0, 1fr);
}

.deals-side-panel,
.accounting-side-panel,
.invoices-side-panel,
.filters-panel {
position: sticky;
  top: 18px;
}

.section-heading.row {
align-items: center;
}

.section-kicker,
.eyebrow,
.month-chip {
letter-spacing: 0.16em;
}

input,
select,
textarea {
min-height: 46px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.secondary-button {
background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
    var(--nav);
  color: #fffaf2;
  border-color: rgba(32, 58, 49, 0.18);
  box-shadow: 0 14px 28px rgba(32, 58, 49, 0.14);
}

.ghost-button,
.secondary-button {
min-height: 42px;
}

.ghost-button {
background: rgba(255, 255, 255, 0.58);
}

.danger-button {
color: var(--danger);
}

.status-pill,
.review-pill,
.meta-pill,
.amount-pill,
.tag {
min-height: 30px;
  border-radius: 999px;
}

.table-shell {
overflow-x: auto;
  border: 1px solid rgba(55, 43, 29, 0.1);
  border-radius: 24px;
  background: rgba(255, 254, 250, 0.74);
}

.stats-table thead th {
position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(247, 241, 232, 0.96);
  backdrop-filter: blur(12px);
}

/* ---- tranche de 173 regles ---- */

.stats-table tbody tr {
transition: background 160ms ease;
}

.stats-table tbody tr:hover {
background: rgba(189, 149, 91, 0.045);
}

.deals-stats-table {
min-width: 1280px;
}

.contracts-list,
.cards-stack,
.deals-mobile-list,
.duplicates-list,
.review-queue-list {
gap: 16px;
}

.contract-card,
.detail-card,
.detail-block,
.duplicate-card,
.notification-card,
.review-queue-card,
.backup-card {
background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 250, 243, 0.88)),
    rgba(255, 253, 249, 0.88);
}

.contract-card {
border-radius: 24px;
}

.deal-mobile-card {
border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(41, 79, 63, 0.08), transparent 34%),
    rgba(255, 253, 249, 0.94);
}

.deal-mobile-card-header h3 {
font-size: 1.28rem;
  letter-spacing: -0.02em;
}

.deal-mobile-grid > div,
.deal-mobile-contract,
.deal-mobile-comments,
.deal-mobile-editor {
border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

@media (max-width: 1180px) {

  .app-shell {
width: min(100% - 24px, 1780px);
  }

  .workspace {
grid-template-columns: 1fr;
  }

  .deals-side-panel,
  .accounting-side-panel,
  .invoices-side-panel,
  .filters-panel {
position: static;
  }

}

@media (max-width: 920px) {

  body.is-authenticated #app-shell {
display: block;
  }

  .app-shell {
width: 100%;
    padding: 0 0 max(28px, env(safe-area-inset-bottom));
  }

  .hero {
grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 12px 0;
  }

  .hero-copy {
min-height: auto;
    padding: 24px;
  }

  .hero-copy h1 {
max-width: 9ch;
    font-size: clamp(2.55rem, 12vw, 4rem);
  }

  .upload-zone {
min-height: auto;
    padding: 18px;
  }

  .workspace {
display: grid;
    gap: 12px;
    padding: 0 12px 18px;
  }

  .section-heading.row {
display: grid;
    align-items: start;
  }

  .deals-grid,
  .accounting-grid,
  .invoices-grid,
  .content-grid,
  .duplicates-layout,
  .insights-grid,
  .invoice-layout {
grid-template-columns: 1fr;
  }

  .filters-stack.compact-stack,
  .filters-stack {
grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deals-side-panel,
  .accounting-side-panel,
  .invoices-side-panel,
  .filters-panel {
order: -1;
  }

  .invoice-toolbar {
display: grid;
    align-items: start;
  }

  .detail-actions,
  .row-actions,
  .section-actions {
width: 100%;
    justify-content: flex-start;
  }

  .detail-actions > button,
  .row-actions > button,
  .section-actions > button,
  .detail-actions > label,
  .row-actions > label,
  .section-actions > label {
min-height: 44px;
  }

  .deals-mobile-list {
gap: 14px;
  }

  .deal-mobile-card {
padding: 18px;
    box-shadow: var(--shadow-soft);
  }

  .deal-mobile-card-header {
display: grid;
  }

  .deal-mobile-select {
width: fit-content;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
  }

  .deal-mobile-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deal-mobile-grid > div,
  .deal-mobile-contract,
  .deal-mobile-comments,
  .deal-mobile-editor {
padding: 13px;
  }

  .linked-contract-actions {
display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .linked-contract-actions .ghost-button {
width: 100%;
    min-height: 40px;
  }

  .review-table,
  .review-table thead,
  .review-table tbody,
  .review-table tr,
  .review-table td {
display: block;
    width: 100%;
  }

  .review-table thead {
display: none;
  }

  .review-table tr {
margin-bottom: 14px;
    padding: 14px;
    border: 1px solid rgba(55, 43, 29, 0.1);
    border-radius: 20px;
    background: rgba(255, 253, 249, 0.92);
  }

  .review-table td {
padding: 8px 0;
    border-top: 0;
  }

  .review-table td::before {
display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .review-table td:nth-child(1)::before {
content: "Action";
  }

  .review-table td:nth-child(2)::before {
content: "Date";
  }

  .review-table td:nth-child(3)::before {
content: "Client";
  }

  .review-table td:nth-child(4)::before {
content: "Code";
  }

  .review-table td:nth-child(5)::before {
content: "Contrat";
  }

  .review-table td:nth-child(6)::before {
content: "Paiement";
  }

  .review-table td:nth-child(7)::before {
content: "Montant contrat";
  }

  .review-table td:nth-child(8)::before {
content: "Apres commission";
  }

  .review-table td:nth-child(9)::before {
content: "Annonce";
  }

  .review-table td:nth-child(10)::before {
content: "Delta";
  }

  .review-table td:nth-child(11)::before {
content: "Numero";
  }

  .review-table td:nth-child(12)::before {
content: "Date facture";
  }

  .review-table td:nth-child(13)::before {
content: "Commentaire";
  }

  .review-table input,
  .review-table select,
  .review-table button {
width: 100%;
  }

}

@media (max-width: 640px) {

  .hero,
  .workspace {
padding-inline: 10px;
  }

  .filters-stack.compact-stack,
  .filters-stack,
  .deal-mobile-grid,
  .linked-contract-actions {
grid-template-columns: 1fr;
  }

  .results-count {
width: fit-content;
  }

  .detail-actions > button,
  .row-actions > button,
  .section-actions > button,
  .detail-actions > label,
  .row-actions > label,
  .section-actions > label {
width: 100%;
  }

  .deal-mobile-card-header h3 {
font-size: 1.18rem;
  }

}

@keyframes authFloat {

  0%,
  100% {
transform: translateY(0);
  }

  50% {
transform: translateY(-8px);
  }

}

@keyframes authFloatSoft {

  0%,
  100% {
transform: translateY(0);
  }

  50% {
transform: translateY(-4px);
  }

}

/* Global DA refresh 2026-07-02: align the whole app with the new private-access visual language. */
:root {
--bg: #f8f3ea;
  --bg-deep: #ede3d4;
  --ink: #1e2d28;
  --muted: #766f65;
  --line: rgba(31, 63, 52, 0.14);
  --card: rgba(255, 252, 247, 0.9);
  --card-strong: rgba(255, 253, 249, 0.97);
  --accent: #bd955b;
  --accent-deep: #265d49;
  --accent-soft: #ead9bd;
  --success: #265d49;
  --danger: #9d3f30;
  --shadow: 0 24px 68px rgba(48, 38, 25, 0.11);
}

body {
color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(38, 93, 73, 0.1), transparent 28%),
    radial-gradient(circle at 92% 8%, rgba(189, 149, 91, 0.16), transparent 30%),
    radial-gradient(circle at 88% 82%, rgba(157, 63, 48, 0.08), transparent 30%),
    linear-gradient(145deg, var(--bg) 0%, var(--bg-deep) 100%);
}

body::before {
background:
    linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.42)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='176' height='176' viewBox='0 0 176 176'%3E%3Cg fill='none' stroke='rgba(38,93,73,0.075)' stroke-width='1'%3E%3Cpath d='M0 44h176M0 88h176M0 132h176'/%3E%3Cpath d='M44 0v176M88 0v176M132 0v176'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.46;
  mix-blend-mode: multiply;
}

body.is-authenticated .app-shell {
width: min(1680px, calc(100% - 28px));
}

body.is-authenticated .hero-copy,
body.is-authenticated .panel {
border-radius: 30px;
}

body.is-authenticated .hero h1 {
color: #173f34;
  font-size: clamp(3.2rem, 6.2vw, 5.8rem);
}

body.is-authenticated .eyebrow,
body.is-authenticated .section-kicker,
body.is-authenticated .month-chip,
body.is-authenticated .mini-label {
color: #8f734d;
  letter-spacing: 0.14em;
}

body.is-authenticated .secondary-button {
border-color: rgba(38, 93, 73, 0.22);
  color: #fffaf2;
  background: linear-gradient(180deg, #2f7454, #235b43);
  box-shadow:
    0 14px 30px rgba(38, 93, 73, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

body.is-authenticated .ghost-button {
border-color: rgba(31, 63, 52, 0.16);
  color: #315447;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

body.is-authenticated .danger-button {
color: var(--danger);
  border-color: rgba(157, 63, 48, 0.22);
  background: rgba(157, 63, 48, 0.06);
}

body.is-authenticated .upload-zone {
border-color: rgba(38, 93, 73, 0.24);
  background:
    radial-gradient(circle at top left, rgba(38, 93, 73, 0.08), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(255, 252, 247, 0.9));
}

body.is-authenticated .upload-zone:hover {
border-color: rgba(38, 93, 73, 0.46);
  box-shadow: 0 16px 42px rgba(38, 93, 73, 0.13);
}

body.is-authenticated input,
body.is-authenticated textarea,
body.is-authenticated select {
border-color: rgba(31, 63, 52, 0.13);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 2px rgba(48, 38, 25, 0.05);
}

body.is-authenticated input:focus,
body.is-authenticated textarea:focus,
body.is-authenticated select:focus {
border-color: rgba(38, 93, 73, 0.34);
  box-shadow:
    inset 0 1px 2px rgba(48, 38, 25, 0.04),
    0 0 0 4px rgba(38, 93, 73, 0.1);
  outline: none;
}

body.is-authenticated table,
body.is-authenticated .table-like,
body.is-authenticated .deals-table,
body.is-authenticated .invoice-workspace,
body.is-authenticated .import-review-panel {
color: var(--ink);
}

body.is-authenticated th,
body.is-authenticated .table-header,
body.is-authenticated .import-review-table th {
color: #827766;
  letter-spacing: 0.08em;
}

body.is-authenticated tr,
body.is-authenticated .table-row,
body.is-authenticated .deal-card,
body.is-authenticated .contract-card,
body.is-authenticated .invoice-card,
body.is-authenticated .accounting-card,
body.is-authenticated .review-item,
body.is-authenticated .duplicate-card,
body.is-authenticated .admin-user-card,
body.is-authenticated .mini-card,
body.is-authenticated .health-card,
body.is-authenticated .ranking-card,
body.is-authenticated .month-stat {
border-color: rgba(31, 63, 52, 0.12);
  background: rgba(255, 253, 249, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

body.is-authenticated .status-pill,
body.is-authenticated .tag,
body.is-authenticated .badge {
border-color: rgba(38, 93, 73, 0.16);
  color: #315447;
  background: rgba(38, 93, 73, 0.08);
}

body.is-authenticated .status-pill.warning,
body.is-authenticated .tag.warning,
body.is-authenticated .badge.warning {
border-color: rgba(189, 149, 91, 0.24);
  color: #8f734d;
  background: rgba(189, 149, 91, 0.1);
}

body.is-authenticated .status-pill.danger,
body.is-authenticated .tag.danger,
body.is-authenticated .badge.danger {
border-color: rgba(157, 63, 48, 0.24);
  color: var(--danger);
  background: rgba(157, 63, 48, 0.08);
}

@media (max-width: 920px) {

  body.is-authenticated .app-shell {
width: min(100% - 16px, 760px);
    padding-top: 12px;
  }

  body.is-authenticated .hero-copy,
  body.is-authenticated .panel {
border-radius: 24px;
  }

  body.is-authenticated .hero h1 {
font-size: clamp(2.7rem, 13vw, 4.4rem);
  }

}

/* Layout repair 2026-07-02: remove the old experimental sidebar nav everywhere. */
body.is-authenticated .workspace {
display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: stretch !important;
  gap: 20px !important;
}

@media (max-width: 920px) {

  body.is-authenticated .workspace {
gap: 12px !important;
    padding: 0 12px 18px !important;
  }

}

/* Sober fix 2026-07-05: neutral palette + mobile nav that never covers content. */
:root {
--bg: #f6f2ea;
  --bg-deep: #ebe3d6;
  --ink: #22201c;
  --muted: #6f685f;
  --line: rgba(34, 32, 28, 0.11);
  --card: rgba(255, 253, 249, 0.92);
  --card-strong: rgba(255, 255, 255, 0.97);
  --accent: #214f3f;
  --accent-deep: #183b30;
  --accent-soft: #e4ddd2;
  --success: #214f3f;
  --danger: #9d3f30;
  --shadow: 0 18px 46px rgba(42, 35, 26, 0.09);
}

body {
color: var(--ink) !important;
  background:
    radial-gradient(circle at 10% 0%, rgba(33, 79, 63, 0.055), transparent 26%),
    radial-gradient(circle at 94% 8%, rgba(156, 123, 76, 0.075), transparent 30%),
    linear-gradient(180deg, #f8f5ef 0%, #efe7da 100%);
}

body::before {
opacity: 0.26;
  mix-blend-mode: multiply;
}

body.is-authenticated .app-shell {
width: min(1660px, calc(100% - 28px)) !important;
  padding-top: 22px !important;
}

body.is-authenticated .hero-copy,
body.is-authenticated .panel {
border-radius: 24px;
}

body.is-authenticated .hero h1 {
color: #244238 !important;
  font-size: clamp(2.8rem, 5.4vw, 5rem) !important;
}

body.is-authenticated .eyebrow,
body.is-authenticated .section-kicker,
body.is-authenticated .month-chip,
body.is-authenticated .mini-label {
color: #8a765c !important;
  letter-spacing: 0.12em !important;
}

body.is-authenticated .danger-button {
color: var(--danger) !important;
  border-color: rgba(157, 63, 48, 0.18) !important;
  background: rgba(157, 63, 48, 0.055);
}

body.is-authenticated input,
body.is-authenticated textarea,
body.is-authenticated select {
border-color: rgba(34, 32, 28, 0.12) !important;
  background: rgba(255, 255, 255, 0.82);
}

body.is-authenticated input:focus,
body.is-authenticated textarea:focus,
body.is-authenticated select:focus {
border-color: rgba(33, 79, 63, 0.34) !important;
  box-shadow: 0 0 0 4px rgba(33, 79, 63, 0.09) !important;
}

body.is-authenticated .workspace {
display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 18px !important;
}

@media (max-width: 920px) {

  body.is-authenticated .app-shell {
width: min(100% - 14px, 760px) !important;
    padding-top: 8px !important;
  }

  body.is-authenticated .workspace {
gap: 10px !important;
    padding: 0 0 18px !important;
  }

  /* `clip`, pas `hidden`. Pose sur html ET sur body a la fois, `hidden` ne se
     propage plus de body a la fenetre : body devient un conteneur de
     defilement qui ne defile jamais, et plus aucun `position: sticky` ne colle
     sur telephone (mesure le 21 septembre 2026 : le pied du plan de
     l'Organisation restait a 2 002 px dans une fenetre de 844 px). `clip` coupe
     le debordement sans creer ce conteneur. La premiere declaration sert de
     repli aux navigateurs qui ne connaissent pas `clip` (Safari avant 16). */
  html,
  body {
max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
  }

  body.is-authenticated .app-shell {
width: 100% !important;
    max-width: 100% !important;
    padding: 8px 10px 28px !important;
  }

  body.is-authenticated .hero {
display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
  }

  body.is-authenticated .hero-side {
display: none !important;
  }

  body.is-authenticated .hero-copy-top,
  body.is-authenticated .section-heading.row {
display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body.is-authenticated .hero h1 {
max-width: 100% !important;
    font-size: clamp(2rem, 11vw, 3.2rem) !important;
    line-height: 0.95 !important;
  }

  body.is-authenticated .hero-text {
font-size: 1rem;
    line-height: 1.45;
  }

  body.is-authenticated .hero-actions,
  body.is-authenticated .hero-actions > * {
width: 100% !important;
  }

  body.is-authenticated .workspace {
display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 0 !important;
  }

  body.is-authenticated .content-grid,
  body.is-authenticated .deals-grid,
  body.is-authenticated .invoices-grid,
  body.is-authenticated .accounting-grid,
  body.is-authenticated .duplicates-layout,
  body.is-authenticated .invoice-layout,
  body.is-authenticated .insights-grid,
  body.is-authenticated .insights-grid.bottom {
display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  body.is-authenticated .filters-stack,
  body.is-authenticated .filters-stack.compact-stack,
  body.is-authenticated .upload-actions-grid,
  body.is-authenticated .accounting-primary-actions,
  body.is-authenticated .editor-grid,
  body.is-authenticated .deal-editor-grid,
  body.is-authenticated .invoice-editor-grid {
grid-template-columns: 1fr;
    gap: 10px;
  }

  body.is-authenticated .deals-side-panel,
  body.is-authenticated .filters-panel,
  body.is-authenticated .invoices-side-panel,
  body.is-authenticated .accounting-side-panel {
max-height: 72vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.is-authenticated .mobile-collapsible-panel {
display: grid;
    gap: 10px;
    max-height: none !important;
    overflow: visible !important;
  }

  body.is-authenticated .mobile-panel-toggle {
width: 100%;
    min-height: 46px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(33, 79, 63, 0.14);
    border-radius: 14px;
    color: var(--ink) !important;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
    font-size: 0.95rem;
    font-weight: 720 !important;
    text-align: left;
  }

  body.is-authenticated .mobile-panel-toggle strong {
color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
  }

  body.is-authenticated .mobile-collapsible-panel:not(.is-mobile-open) > :not(.section-heading):not(.mobile-panel-toggle) {
display: none !important;
  }

  body.is-authenticated .mobile-collapsible-panel.is-mobile-open {
max-height: 72vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body.is-authenticated .invoice-toolbar,
  body.is-authenticated .contracts-toolbar-shell {
display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  body.is-authenticated .detail-actions,
  body.is-authenticated .row-actions,
  body.is-authenticated .section-actions,
  body.is-authenticated .compact-actions {
display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    justify-content: stretch;
  }

  body.is-authenticated .detail-actions > *,
  body.is-authenticated .row-actions > *,
  body.is-authenticated .section-actions > *,
  body.is-authenticated .compact-actions > * {
width: 100% !important;
    min-width: 0 !important;
  }

  body.is-authenticated .table-shell {
max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }

  body.is-authenticated .stats-table {
min-width: 760px;
  }

  body.is-authenticated .deals-mobile-list,
  body.is-authenticated .cards-stack,
  body.is-authenticated .contracts-list,
  body.is-authenticated .duplicates-list,
  body.is-authenticated .review-queue-list {
display: grid;
    grid-template-columns: 1fr;
    gap: 12px !important;
    width: 100% !important;
  }

  body.is-authenticated .deal-mobile-card {
width: 100%;
    min-height: 0;
    gap: 12px;
  }

  body.is-authenticated .deal-mobile-card-header {
display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
  }

  body.is-authenticated .deal-mobile-card-header h3,
  body.is-authenticated .contract-title {
max-width: 100% !important;
    font-size: 1.04rem !important;
    overflow-wrap: anywhere;
  }

  body.is-authenticated .deal-mobile-select {
align-self: start;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
  }

  body.is-authenticated .deal-mobile-grid {
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  body.is-authenticated .deal-mobile-grid > div,
  body.is-authenticated .deal-mobile-contract,
  body.is-authenticated .deal-mobile-comments,
  body.is-authenticated .deal-mobile-editor,
  body.is-authenticated .deal-mobile-more {
min-width: 0;
    padding: 10px;
    border-radius: 14px;
  }

  body.is-authenticated .deal-mobile-grid strong,
  body.is-authenticated .deal-mobile-contract strong {
font-size: 0.92rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  body.is-authenticated .deal-mobile-more {
display: grid;
    gap: 10px;
    border: 1px solid rgba(34, 32, 28, 0.1);
    background: rgba(255, 255, 255, 0.68);
  }

  body.is-authenticated .deal-mobile-more summary {
cursor: pointer;
    color: var(--accent);
    font-weight: 820;
  }

  body.is-authenticated .deal-mobile-more .deal-mobile-grid {
margin-top: 10px;
  }

  body.is-authenticated .linked-contract-actions {
display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

}

@media (max-width: 520px) {

  body.is-authenticated .app-shell {
padding-inline: 8px;
  }

  body.is-authenticated .deal-mobile-grid,
  body.is-authenticated .linked-contract-actions {
grid-template-columns: 1fr !important;
  }

  body.is-authenticated .deal-mobile-primary-grid {
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.is-authenticated .deal-mobile-more .deal-mobile-grid {
grid-template-columns: 1fr !important;
  }

  body.is-authenticated .row-actions:empty {
display: none !important;
  }

}

body.is-authenticated .mobile-panel-toggle {
display: none !important;
}

body.is-authenticated .year-card {
gap: 8px;
  font-weight: 500 !important;
}

body.is-authenticated .year-card .meta-label {
color: #968a7a !important;
  font-size: 0.72rem !important;
  font-weight: 760 !important;
  letter-spacing: 0.13em !important;
}

body.is-authenticated .year-card-year {
color: #24211d;
  font-size: clamp(1.45rem, 3.2vw, 1.95rem);
  font-weight: 740;
  letter-spacing: -0.03em;
  line-height: 1;
}

body.is-authenticated .year-card-count {
color: #34453d;
  font-size: 0.98rem;
  font-weight: 660;
  line-height: 1.25;
}

body.is-authenticated .year-card-amount {
width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #214f3f;
  background: rgba(33, 79, 63, 0.08);
  font-size: 1.02rem;
  font-weight: 760;
  line-height: 1.15;
}

body.is-authenticated .year-card-meta {
color: #746b60;
  font-size: 0.9rem;
  font-weight: 470;
  line-height: 1.3;
}

@media (max-width: 920px) {

  body.is-authenticated .mobile-panel-toggle {
display: flex !important;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 250, 242, 0.86)),
      #fffdf9;
  }

  body.is-authenticated .accounting-primary-actions {
margin: 2px 0 14px !important;
  }

  body.is-authenticated .accounting-quick-actions-panel .accounting-primary-actions {
margin: 0 !important;
  }

  body.is-authenticated .accounting-primary-action {
min-height: 86px !important;
    padding: 14px !important;
    border-radius: 18px;
  }

  body.is-authenticated .year-cards {
grid-template-columns: 1fr;
  }

  body.is-authenticated .year-card {
display: grid;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: start;
    padding: 16px;
  }

  body.is-authenticated .year-card .meta-label,
  body.is-authenticated .year-card-count,
  body.is-authenticated .year-card-meta {
grid-column: 1 / -1;
  }

  body.is-authenticated .year-card-amount {
justify-self: end;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: right;
  }

}

@media (max-width: 520px) {

  body.is-authenticated .year-card {
grid-template-columns: 1fr !important;
  }

  body.is-authenticated .year-card-amount {
justify-self: start;
    text-align: left;
  }

}

/* Mobile contract library repair 2026-07-05: prevent horizontal clipping.
   Le 21 septembre 2026, `hidden` devient `clip` : voir plus haut, la regle
   sur html et body de la meme largeur. `hidden` reste en repli. */
@media (max-width: 920px) {
html,
  body,
  body.is-authenticated {
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-x: clip !important;
}

body.is-authenticated #contracts-view .section-heading.row {
display: grid !important;
    grid-template-columns: 1fr !important;
    align-items: start !important;
    gap: 12px !important;
}

body.is-authenticated #contracts-view .results-count {
width: fit-content !important;
    max-width: 100%;
}

body.is-authenticated #contracts-view .contracts-toolbar-shell,
  body.is-authenticated #contracts-view .contracts-toolbar-shell .detail-actions {
width: 100% !important;
    max-width: 100%;
    min-width: 0;
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-items: stretch;
}

body.is-authenticated #contracts-view .contracts-toolbar-copy {
min-width: 0;
}

body.is-authenticated #contracts-view .contracts-toolbar-copy strong,
  body.is-authenticated #contracts-view .contracts-toolbar-copy span,
  body.is-authenticated #contracts-view .contract-title,
  body.is-authenticated #contracts-view .contract-snippet {
max-width: 100% !important;
    overflow-wrap: anywhere;
    word-break: normal;
}

body.is-authenticated #contracts-view .contracts-toolbar .ghost-button,
  body.is-authenticated #contracts-view .contracts-toolbar .secondary-button {
width: 100% !important;
    max-width: 100%;
    min-width: 0 !important;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.2;
}

body.is-authenticated #contracts-view .contract-card {
overflow: hidden;
    padding: 16px !important;
}

body.is-authenticated #contracts-view .contract-topline {
display: grid;
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 12px;
}

body.is-authenticated #contracts-view .contract-card-heading {
width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
}

body.is-authenticated #contracts-view .contract-select-toggle {
width: 44px;
    min-width: 44px;
    height: 44px;
}

body.is-authenticated #contracts-view .contract-meta {
width: 100%;
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

body.is-authenticated #contracts-view .amount-pill,
  body.is-authenticated #contracts-view .meta-pill,
  body.is-authenticated #contracts-view .review-pill,
  body.is-authenticated #contracts-view .tag,
  body.is-authenticated #contracts-view .status-pill {
max-width: 100%;
    min-width: 0;
    min-height: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.2;
    padding: 8px 10px;
}

@media (max-width: 520px) {

  body.is-authenticated .app-shell {
width: 100% !important;
    padding-inline: 6px;
  }

  body.is-authenticated .workspace {
padding-inline: 6px;
  }

}

/* Fermeture de « Mobile contract library repair 2026-07-05 » : cette
   requete media etait restee ouverte, et tout ce qui suivait dans la
   feuille s'y retrouvait enferme, donc sans effet au-dessus de 920 px. */
}

/* ---- Lot : carnet des marques ----
   Specification : docs/specs/08-carnet-des-marques.md
   Toutes les regles sont portees par #brands-view ou une classe .brand-* :
   elles n'entrent en concurrence avec aucune autre feuille, et se passent donc
   des declarations prioritaires que le chantier CSS s'emploie a retirer. */

#brands-view {
  gap: 16px;
}

#brands-view .field > span {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--pg-muted);
  font-size: 12px;
  font-weight: 500;
}

#brands-view input[type="text"],
#brands-view input[type="email"],
#brands-view input[type="tel"],
#brands-view input[type="date"],
#brands-view input[type="search"],
#brands-view select,
#brands-view textarea {
  border-radius: 10px;
  border-color: var(--pg-control-border);
  background: var(--pg-surface);
  padding: 9px 12px;
}

#brands-view textarea {
  min-height: 78px;
}

/* Bande de synthese */

.brand-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px 30px;
}

.brand-band-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
}

.brand-band-count strong {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 58px;
  font-weight: 400;
  line-height: 0.9;
  color: var(--pg-accent);
}

.brand-band-count span {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 24px;
  color: var(--pg-muted);
}

.brand-band-label {
  display: block;
  margin-top: 6px;
  color: var(--pg-muted);
  font-size: 12px;
}

.brand-band-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.brand-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--pg-soft);
  overflow: hidden;
}

.brand-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
}

.brand-bar-partial {
  background: #d9b16b;
  z-index: 1;
}

.brand-bar-done {
  background: var(--pg-good);
  z-index: 2;
}

.brand-coverage {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--pg-line);
  color: var(--pg-muted);
  font-size: 12.5px;
}

.brand-coverage strong {
  color: var(--pg-accent);
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.brand-dot-todo {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--pg-muted);
}

.brand-dot-partial {
  background: #d9b16b;
}

.brand-dot-complete {
  background: var(--pg-good);
}

/* Barre d'outils et liste */

.brand-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
}

.brand-search {
  flex: 1 1 220px;
  min-width: 0;
}

.brand-search > span,
.brand-sort > span {
  margin-bottom: 0;
}

.brand-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-toolbar .results-count {
  margin-left: auto;
}

.brand-actions-row {
  justify-content: flex-end;
}

.brand-list-panel {
  container: brandlist / inline-size;
}

/* La fiche est posee sur le bord droit de la fenetre : les panneaux lui
   reservent sa largeur pendant qu'elle est ouverte, sinon la liste passe
   dessous. La marge porte sur les panneaux et non sur la vue, dont la mise en
   page impose deja padding: 0 partout. */
@media (min-width: 1000px) {
  #brands-view.has-open-sheet > .panel {
    margin-right: 476px;
  }
}

.brand-list {
  display: grid;
  border: 1px solid var(--pg-line);
  border-radius: 16px;
  overflow: hidden;
}

.brand-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.8fr) 150px;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--pg-line);
  background: var(--pg-surface);
  text-align: left;
  cursor: pointer;
  transition: background 140ms ease;
}

.brand-row:last-child {
  border-bottom: 0;
}

.brand-row:hover,
.brand-row:focus-visible {
  background: var(--pg-accent-soft);
}

.brand-row.is-open {
  background: var(--pg-accent-soft);
}

.brand-state {
  justify-self: center;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.brand-identity {
  min-width: 0;
}

.brand-name {
  display: block;
  color: var(--pg-ink);
  font-size: 15px;
  font-weight: 600;
}

.brand-meta {
  display: block;
  margin-top: 2px;
  color: var(--pg-muted);
  font-size: 12px;
}

.brand-meta b {
  color: var(--pg-ink);
  font-weight: 600;
}

.brand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.brand-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--pg-soft);
  color: var(--pg-muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.brand-chip-good,
.brand-chip-complete {
  background: var(--pg-good-bg);
  color: var(--pg-good);
}

.brand-chip-warn,
.brand-chip-partial {
  background: var(--pg-warning-bg);
  color: var(--pg-warning);
}

.brand-chip-empty,
.brand-chip-todo {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--pg-line);
  color: var(--pg-muted);
  font-weight: 500;
}

.brand-amount {
  color: var(--pg-ink);
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 20px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.brand-amount small {
  display: block;
  margin-top: 4px;
  color: var(--pg-muted);
  font-family: inherit;
  font-size: 11px;
}

/* La liste se replie selon la largeur disponible, fiche ouverte ou non. */
@container brandlist (max-width: 860px) {
  .brand-row {
    grid-template-columns: 20px minmax(0, 1.4fr) minmax(0, 1fr) 130px;
  }

  .brand-pieces {
    display: none;
  }
}

@container brandlist (max-width: 600px) {
  .brand-row {
    grid-template-columns: 14px minmax(0, 1fr) auto;
    grid-template-areas: "state identity amount" "state people amount" "state pieces amount";
    gap: 6px 12px;
    padding: 12px 14px;
  }

  .brand-state {
    grid-area: state;
    align-self: start;
    margin-top: 6px;
  }

  .brand-identity {
    grid-area: identity;
  }

  .brand-people {
    grid-area: people;
  }

  .brand-pieces {
    display: flex;
    grid-area: pieces;
  }

  .brand-amount {
    grid-area: amount;
    align-self: start;
    font-size: 17px;
  }
}

/* Fiche de marque */

.brand-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 114;
  display: none;
  background: var(--pg-overlay);
}

.brand-sheet {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 115;
  width: min(460px, 100vw);
  height: 100vh;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 22px;
  padding: 24px 26px 60px;
  border-left: 1px solid var(--pg-line);
  background: var(--pg-surface);
  box-shadow: -18px 0 50px rgba(41, 36, 44, 0.12);
}

.brand-sheet[hidden],
.brand-sheet-backdrop[hidden] {
  display: none;
}

.brand-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.brand-sheet-head h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.05;
}

.brand-sheet-state {
  margin: 6px 0 0;
}

.brand-block h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.brand-block h3 small {
  color: var(--pg-muted);
  font-size: 11px;
  font-weight: 500;
}

.brand-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--pg-line);
}

.brand-facts > div {
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--pg-line);
}

.brand-facts > div:nth-child(odd) {
  padding-right: 14px;
}

.brand-facts > div:nth-child(even) {
  padding-left: 14px;
  border-left: 1px solid var(--pg-line);
}

.brand-facts dt {
  color: var(--pg-muted);
  font-size: 11px;
}

.brand-facts dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.brand-unknown {
  color: var(--pg-muted);
  font-weight: 500;
}

.brand-note {
  margin: 8px 0 0;
  color: var(--pg-muted);
  font-size: 11px;
}

.brand-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--pg-accent);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.brand-link-danger:hover {
  color: var(--pg-danger);
}

.brand-contacts {
  display: grid;
  gap: 8px;
}

.brand-contact {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
  background: var(--pg-chrome);
}

.brand-contact.is-pending {
  border-style: dashed;
}

.brand-contact-name {
  font-weight: 700;
}

.brand-source {
  margin-left: 7px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--pg-soft);
  color: var(--pg-muted);
  font-size: 10.5px;
  font-weight: 600;
  vertical-align: 1px;
}

.brand-source.is-direct {
  background: var(--pg-good-bg);
  color: var(--pg-good);
}

.brand-source.is-pending {
  background: var(--pg-warning-bg);
  color: var(--pg-warning);
}

.brand-contact-line {
  color: var(--pg-muted);
  font-size: 12px;
}

.brand-contact-line b {
  color: var(--pg-ink);
  font-weight: 600;
}

.brand-missing {
  color: var(--pg-warning);
  font-style: normal;
}

.brand-contact-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.brand-none {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border: 1px dashed var(--pg-control-border);
  border-radius: 12px;
  color: var(--pg-muted);
  font-size: 12px;
}

.brand-form {
  display: grid;
  gap: 12px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--pg-accent);
  border-radius: 12px;
  background: var(--pg-accent-soft);
}

.brand-form-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.brand-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.brand-option {
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--pg-control-border);
  border-radius: 999px;
  background: var(--pg-surface);
  color: var(--pg-ink);
  font-size: 12px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.brand-option:hover {
  background: var(--pg-chrome);
}

.brand-option[aria-pressed="true"] {
  border-color: var(--pg-accent);
  background: var(--pg-accent);
  color: var(--pg-on-accent);
  font-weight: 600;
}

/* Passage rapide */

.brand-quick {
  position: fixed;
  inset: 0;
  /* Au-dessus de la barre de navigation du telephone : le passage rapide est
     un mode plein ecran, il ne laisse pas d'onglet cliquable dessous. */
  z-index: 120;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--pg-canvas);
}

.brand-quick[hidden] {
  display: none;
}

.brand-quick-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--pg-line);
  background: var(--pg-surface);
}

.brand-quick-progress {
  color: var(--pg-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.brand-quick-body {
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
}

.brand-quick-card {
  display: grid;
  gap: 18px;
  width: min(560px, 100%);
}

.brand-quick-name {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1;
}

.brand-quick-facts {
  margin: 0;
  color: var(--pg-muted);
  font-size: 13px;
}

.brand-quick-facts b {
  color: var(--pg-ink);
}

.brand-quick-ask {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}

.brand-quick-answers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.brand-quick-answers button {
  min-height: 52px;
  justify-content: center;
}

.brand-quick-done {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.brand-quick-figure {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 58px;
  line-height: 0.9;
  color: var(--pg-accent);
}

/* Regroupements dans l'administration */

.brand-admin-list {
  display: grid;
  gap: 8px;
}

.brand-admin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
  background: var(--pg-chrome);
  font-size: 13px;
}

.brand-admin-row .detail-actions {
  margin: 0;
}

.brand-admin-reason {
  color: var(--pg-muted);
  font-size: 11px;
}

/* Telephone */

@media (max-width: 999px) {
  .brand-band {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand-band-count strong {
    font-size: 44px;
  }

  .brand-sheet-backdrop:not([hidden]) {
    display: block;
  }

  .brand-sheet {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    height: auto;
    max-height: 92vh;
    padding: 18px 18px 48px;
    border-left: 0;
    border-top: 1px solid var(--pg-line);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -18px 50px rgba(41, 36, 44, 0.18);
  }

  .brand-sheet-head h2 {
    font-size: 28px;
  }

  .brand-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand-facts > div:nth-child(odd) {
    padding-right: 0;
  }

  .brand-facts > div:nth-child(even) {
    padding-left: 0;
    border-left: 0;
  }

  .brand-form-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand-quick-name {
    font-size: 34px;
  }

  .brand-quick-answers {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand-toolbar .results-count {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-row,
  .brand-option {
    transition: none;
  }
}

.brand-error {
  margin: 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--pg-danger-bg);
  color: var(--pg-danger);
  font-size: 12px;
  font-weight: 600;
}

/* ---- Lot : rapprochement des contrats sur preuve ----
   Specification : docs/specs/09-extraction-rapprochement-contrats.md
   Toutes les regles sont portees par une classe .review-* : elles n'entrent en
   concurrence avec aucune autre feuille. */

.review-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px 28px;
}

.review-band-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
}

.review-band-count strong {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 52px;
  font-weight: 400;
  line-height: 0.9;
  color: var(--pg-accent);
}

.review-band-count span {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 22px;
  color: var(--pg-muted);
}

.review-band-label {
  display: block;
  margin-top: 6px;
  color: var(--pg-muted);
  font-size: 12px;
}

.review-band-body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.review-card {
  display: grid;
  gap: 20px;
  padding: 22px 24px;
  border: 1px solid var(--pg-line);
  border-radius: 18px;
  background: var(--pg-surface);
}

.review-card:focus-visible {
  outline: 2px solid var(--pg-accent);
  outline-offset: 3px;
}

.review-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.review-card-head h3 {
  margin: 4px 0 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.1;
}

.review-block h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.review-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.review-value {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
  background: var(--pg-chrome);
}

.review-value dt {
  color: var(--pg-muted);
  font-size: 11px;
}

.review-value dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* La citation est le coeur de l'ecran : c'est elle qui permet de confirmer en
   quelques secondes sans rouvrir le contrat. */
.review-evidence {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-left: 3px solid var(--pg-accent);
  background: var(--pg-accent-soft);
  color: var(--pg-ink);
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.45;
}

.review-no-evidence {
  margin: 8px 0 0;
  color: var(--pg-warning);
  font-size: 12px;
}

.review-deal {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--pg-line);
  border-radius: 12px;
  background: var(--pg-surface);
}

.review-deal.is-primary {
  border-color: var(--pg-accent);
  background: var(--pg-accent-soft);
}

.review-deal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 13px;
}

.review-deal-head strong {
  font-size: 15px;
}

.review-others {
  margin-top: 10px;
}

.review-others summary {
  color: var(--pg-accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.review-others[open] summary {
  margin-bottom: 10px;
}

.review-other-deals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.review-changes {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.review-changes th,
.review-changes td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--pg-line);
  text-align: left;
}

.review-changes th {
  color: var(--pg-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-actions button {
  min-height: 44px;
}

.review-actions kbd {
  margin-left: 8px;
  padding: 1px 6px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-family: inherit;
  font-size: 10px;
  opacity: 0.7;
}

@media (max-width: 999px) {
  .review-band {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-values {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-card {
    padding: 16px 14px;
  }

  .review-actions button {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* --- Confirmation assistée (spec 09, section 6.5) ------------------------
   Le plan vit au-dessus de la carte : des groupes repliés, un bouton par
   groupe, une table qui dit ce que le serveur a vérifié. */

.review-plan {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.review-plan-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
}

.review-plan-head h3 {
  margin: 0;
  font-size: 17px;
  text-wrap: balance;
}

.review-plan-head .brand-note {
  flex: 1 1 320px;
  max-width: 60ch;
}

.review-plan-group {
  border: 1px solid var(--pg-line);
  border-radius: 14px;
  background: var(--pg-surface);
}

.review-plan-group > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 16px;
  list-style: none;
  cursor: pointer;
}

.review-plan-group > summary::-webkit-details-marker {
  display: none;
}

.review-plan-group > summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--pg-muted);
  border-bottom: 2px solid var(--pg-muted);
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}

.review-plan-group[open] > summary::before {
  transform: rotate(45deg);
}

.review-plan-title {
  font-weight: 600;
}

.review-plan-count {
  color: var(--pg-muted);
  font-variant-numeric: tabular-nums;
}

.review-plan-group > summary button {
  margin-left: auto;
  min-height: 40px;
}

.review-plan-group > .brand-note {
  margin: 0;
  padding: 0 16px 10px;
  max-width: 80ch;
}

.review-plan-scroll {
  overflow-x: auto;
  padding: 0 16px 14px;
}

.review-plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.review-plan-table th,
.review-plan-table td {
  padding: 8px 12px 8px 0;
  border-top: 1px solid var(--pg-line);
  text-align: left;
  vertical-align: top;
}

.review-plan-table th {
  border-top: 0;
  color: var(--pg-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.review-plan-table .is-numeric {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.review-plan-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.review-plan-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}

.review-plan-link:focus-visible {
  outline: 2px solid var(--pg-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.review-plan-evidence {
  display: block;
  margin-top: 2px;
  color: var(--pg-muted);
  font-size: 12px;
}

.review-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -8px 0 0;
}

.review-signal {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--pg-accent-soft);
  color: inherit;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}

.review-signal.is-ok {
  background: #e3f1e6;
  color: #1f5a2d;
}

.review-signal.is-warn {
  background: #f8e6d8;
  color: #8e3919;
}

.review-plan-pair {
  display: grid;
  gap: 6px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--pg-line);
}

.review-plan-pair-deal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
}

.review-plan-pair-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.review-plan-pair-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.review-plan-pair-actions button {
  min-height: 36px;
}

@media (max-width: 720px) {
  .review-plan-group > summary button,
  .review-plan-pair-actions {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .review-plan-pair-actions button {
    flex: 1 1 auto;
  }
}

/* --- La fiche d'un contrat : trois états, et la preuve sous la valeur ------
   Spec 09, section 4.3 : une valeur confirmée, une valeur héritée à vérifier
   et une proposition citée ne se ressemblent pas. */

.detail-list-states li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.detail-list-states .meta-label {
  flex: 1 1 100%;
}

.detail-list-states .review-signal {
  font-size: 11px;
}

.detail-block .review-values {
  margin: 0;
}

.detail-block .review-value {
  border-top: 1px solid var(--pg-line);
  padding-top: 10px;
}

.detail-block .review-value:first-child {
  border-top: 0;
  padding-top: 0;
}

.detail-block .review-evidence {
  margin-top: 6px;
}

/* ---- Lot : organigramme ----
   Specification : docs/specs/12-organigramme.md
   Toutes les regles sont portees par #organigramme-view ou une classe .org-* ;
   les reglages d'un poste reprennent les classes .brand-sheet du carnet des
   marques sans les modifier. Aucune declaration prioritaire ici : les champs
   poses sur les cartes perdent leur cadre dans paola-studio.css, la ou les
   champs recoivent le leur. :not([hidden]) sur tout ce qui se masque. */

#organigramme-view {
  gap: 16px;
}

/* Couleurs des postes, celles des schemas montres a Paola. */
.org-tone-violet {
  --org-tone: #7f77dd;
  --org-tone-soft: #eeedfe;
  --org-tone-ink: #3c3489;
}

.org-tone-turquoise {
  --org-tone: #1d9e75;
  --org-tone-soft: #e1f5ee;
  --org-tone-ink: #085041;
}

.org-tone-gris {
  --org-tone: #888780;
  --org-tone-soft: #f1efe8;
  --org-tone-ink: #444441;
}

.org-tone-corail {
  --org-tone: #d85a30;
  --org-tone-soft: #faece7;
  --org-tone-ink: #712b13;
}

/* Formulaires : versions, reglages d'un poste, acces */

#organigramme-view .field {
  display: grid;
}

#organigramme-view .field > span {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--pg-muted);
  font-size: 12px;
  font-weight: 500;
}

:is(.org-version-form, .org-settings) :is(input[type="text"], select, textarea) {
  width: 100%;
  padding: 9px 12px;
}

#organigramme-view select {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 1000px) {
  #organigramme-view.has-open-sheet > .panel {
    margin-right: 476px;
  }

  /* Reglages ouverts : le plan garde toute la largeur restante, « À
     attribuer » passe dessous. */
  #organigramme-view.has-open-sheet .org-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #organigramme-view.has-open-sheet .org-backlog {
    position: static;
    max-height: none;
  }
}

/* Versions */

.org-versions:not([hidden]) {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.org-version-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 14px;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: var(--pg-surface);
  color: var(--pg-ink);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.org-version-tab:hover {
  background: var(--pg-chrome);
}

.org-version-tab.is-active {
  border-color: var(--pg-ink);
  box-shadow: inset 0 0 0 1px var(--pg-ink);
  font-weight: 600;
}

.org-version-new {
  border-style: dashed;
  color: var(--pg-muted);
}

.org-version-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
}

.org-version-copy {
  flex: 1 1 320px;
  min-width: 0;
}

.org-version-copy h2,
.org-version-form h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.08;
}

.org-version-description {
  max-width: 76ch;
  margin: 6px 0 0;
  color: var(--pg-muted);
  font-size: 13px;
  white-space: pre-line;
}

.org-version-actions {
  margin: 0;
}

.org-version-form {
  display: grid;
  flex: 1 1 100%;
  gap: 12px;
  max-width: 640px;
}

.org-status {
  margin: 12px 0 0;
}

.org-status:empty {
  display: none;
}

.org-status.is-error {
  color: var(--pg-danger);
  font-weight: 600;
}

/* Rangees de commandes du module. Elles n'utilisent pas .detail-actions, que
   le telephone force en une colonne de boutons pleine largeur. */
.org-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Legende */

.org-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin-bottom: 14px;
  color: var(--pg-muted);
  font-size: 12px;
}

.org-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.org-legend-line {
  flex: 0 0 auto;
  overflow: visible;
}

.org-legend-hint {
  flex: 1 1 260px;
  text-align: right;
}

/* Plan de travail : la grille des postes, et « À attribuer » a droite */

.org-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  align-items: start;
  gap: 20px;
}

/* La grille garde la largeur de ses colonnes et defile dans son panneau quand
   elle depasse, plutot que d'ecraser les cartes. */
.org-board-scroll {
  min-width: 0;
  padding: 4px 0 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.org-board-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Le cadre ne sert qu'en dessous de 100 % : il rend la place que la mise a
   l'echelle graphique ne prend pas. Il ne rogne rien, pour ne jamais couper
   une carte qui vient de grandir. */
.org-board-sizer {
  position: relative;
  margin: 0 auto;
}

.org-board {
  --org-col: minmax(212px, 268px);
  position: relative;
  display: grid;
  column-gap: 40px;
  row-gap: 36px;
  width: max-content;
  margin: 0 auto;
  padding: 0 36px;
  transform-origin: 0 0;
}

/* Pied du plan : l'etat de l'enregistrement et le zoom. Pose sous le plan,
   il reste au bas de l'ecran tant que le plan defile. */
.org-board-footer {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 10px;
  margin-top: 8px;
  pointer-events: none;
}

.org-board-footer > * {
  pointer-events: auto;
}

.org-save-state:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: var(--pg-surface);
  box-shadow: 0 6px 18px rgba(41, 36, 44, 0.12);
  color: var(--pg-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.org-save-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.org-save-state.is-saved {
  color: var(--pg-good);
}

.org-save-state.is-error {
  border-color: var(--pg-danger);
  background: var(--pg-danger-bg);
  color: var(--pg-danger);
}

.org-zoom {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: var(--pg-surface);
  box-shadow: 0 6px 18px rgba(41, 36, 44, 0.12);
}

.org-zoom button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--pg-ink);
  font-size: 13px;
  line-height: 1;
}

.org-zoom button:hover:not(:disabled) {
  transform: none;
  background: var(--pg-chrome);
}

.org-zoom button:disabled {
  opacity: 0.35;
  cursor: default;
}

.org-zoom .org-zoom-button {
  width: 32px;
  padding: 0;
  font-size: 18px;
}

.org-zoom .org-zoom-level {
  min-width: 58px;
  font-variant-numeric: tabular-nums;
}

.org-zoom .org-zoom-fit {
  border-left: 1px solid var(--pg-line);
  border-radius: 0 999px 999px 0;
  font-weight: 600;
}

.org-slot {
  min-width: 0;
}

.org-slot:not(.org-cell) {
  align-self: start;
}

.org-links {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

.org-link {
  fill: none;
  stroke: #888780;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.org-link-tone-violet {
  stroke: #7f77dd;
}

.org-link-tone-turquoise {
  stroke: #1d9e75;
}

.org-link-tone-gris {
  stroke: #888780;
}

.org-link-tone-corail {
  stroke: #d85a30;
}

.org-link-echange {
  stroke-dasharray: 5 4;
}

/* Case vide : on y pose un poste, ou on y glisse une carte. */
.org-cell {
  display: grid;
  place-items: center;
  min-height: 64px;
  border: 1px dashed transparent;
  border-radius: 12px;
}

.org-cell-add {
  padding: 6px 12px;
  border: 1px dashed var(--pg-control-border);
  border-radius: 999px;
  background: var(--pg-surface);
  color: var(--pg-muted);
  font-size: 12px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.org-cell:hover .org-cell-add,
.org-cell-add:focus-visible {
  opacity: 1;
}

.org-cell-add:hover {
  transform: none;
  color: var(--pg-ink);
}

@media (hover: none) {
  .org-cell-add {
    opacity: 0.7;
  }
}

.org-workspace.is-dragging-position .org-cell {
  border-color: var(--pg-control-border);
}

.org-workspace.is-dragging-position .org-cell-add {
  opacity: 0;
}

.org-cell.is-drop-target {
  border-color: var(--pg-accent);
  background: var(--pg-accent-soft);
}

/* Carte de poste */

.org-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--pg-line);
  border-top: 4px solid var(--org-tone);
  border-radius: 12px;
  background: var(--pg-surface);
  box-shadow: 0 1px 2px rgba(41, 36, 44, 0.05);
}

.org-card.is-open {
  box-shadow: 0 0 0 2px var(--org-tone);
}

.org-card.is-dragging {
  opacity: 0.45;
}

.org-card.is-drop-target {
  background: var(--org-tone-soft);
  box-shadow: 0 0 0 2px var(--org-tone);
}

.org-workspace.is-dragging-mission .org-card:not(.is-drop-target) {
  box-shadow: 0 0 0 1px var(--org-tone-soft);
}

.org-card-head {
  display: flex;
  align-items: flex-start;
  gap: 2px;
}

.org-card-grip {
  flex: 0 0 auto;
  padding: 6px 2px;
  color: var(--pg-muted);
  font-size: 13px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.org-card-names {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
}

#organigramme-view .org-card-holder {
  width: 100%;
  min-height: 0;
  padding: 2px 6px;
  color: var(--pg-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

#organigramme-view .org-card-holder::placeholder {
  color: var(--pg-muted);
  font-style: italic;
  font-weight: 500;
}

#organigramme-view .org-card-title {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 1px 6px 2px;
  overflow: hidden;
  color: var(--org-tone-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  resize: none;
}

.org-card-settings {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pg-muted);
  font-size: 18px;
  line-height: 1;
}

.org-card-settings:hover {
  transform: none;
  background: var(--pg-chrome);
  color: var(--pg-ink);
}

.org-card-summary {
  margin: -2px 0 0;
  padding: 0 6px 0 20px;
  color: var(--pg-muted);
  font-size: 12px;
  font-style: italic;
  line-height: 1.35;
}

.org-card-relations {
  margin: 0;
  padding: 0 6px;
  color: var(--pg-muted);
  font-size: 12px;
  line-height: 1.4;
}

/* Le lien du poste avec la structure, en pastille sous l'intitule. */
.org-card-contract {
  align-self: flex-start;
  margin: 3px 6px 0;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--pg-chrome);
  color: var(--pg-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Le lien avec la structure et le montant, sur la carte meme. */
.org-card {
  cursor: pointer;
}

.org-card :is(input:not([readonly]), textarea:not([readonly])) {
  cursor: text;
}

.org-card-money {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  margin: 3px 6px 0;
}

/* Le montant s'aligne sur le texte de la pastille du lien, juste au-dessus. */
.org-card-money .org-card-pay {
  padding-left: 4px;
}

.org-card-money .org-card-contract {
  margin: 0;
}

.org-card-status {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  cursor: pointer;
}

.org-card-pay {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--pg-muted);
  font-size: 12px;
  white-space: nowrap;
}

.org-card-pay input {
  width: 74px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.org-card-pay input.is-illisible {
  color: var(--pg-danger);
}

.org-card-pay-text {
  color: var(--pg-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Les reglages ouverts en lecture : on regarde, rien ne s'ecrit. */
.org-sheet-lecture {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--pg-info-bg);
  color: var(--pg-info);
  font-size: 13px;
}

.org-sheet-lecture p {
  margin: 0;
}

.org-settings[inert] {
  opacity: 0.72;
}

.org-card-contract.is-cdi {
  background: var(--pg-good-bg);
  color: var(--pg-good);
}

.org-card-contract.is-cdd,
.org-card-contract.is-alternance {
  background: var(--pg-warning-bg);
  color: var(--pg-warning);
}

.org-card-contract.is-mandat {
  background: var(--pg-accent-soft);
  color: var(--pg-accent);
}

/* Plein ecran : le plan seul, et une croix pour en sortir. */
.org-workspace.is-plein-ecran {
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 20px 24px 0;
  overflow: auto;
  background: var(--pg-surface);
}

body.est-en-plein-ecran {
  overflow: hidden;
}

#org-workspace:fullscreen {
  background: var(--pg-surface);
}

/* La croix occupe le coin : la legende s'arrete avant. */
.org-workspace.is-plein-ecran .org-legend {
  padding-right: 64px;
}

.org-workspace.is-plein-ecran .org-backlog {
  top: 16px;
  max-height: calc(100vh - 32px);
}

.org-fullscreen-toggle {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: var(--pg-surface);
  box-shadow: 0 6px 18px rgba(41, 36, 44, 0.12);
  color: var(--pg-ink);
  font-size: 13px;
  font-weight: 600;
}

.org-fullscreen-toggle:hover {
  transform: none;
  background: var(--pg-chrome);
}

.org-fullscreen-close {
  display: none;
}

.org-workspace.is-plein-ecran .org-fullscreen-toggle {
  display: none;
}

.org-workspace.is-plein-ecran .org-fullscreen-close {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 101;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: var(--pg-surface);
  box-shadow: 0 6px 18px rgba(41, 36, 44, 0.16);
  color: var(--pg-ink);
  font-size: 22px;
  line-height: 1;
}

/* Vue d'ensemble : les fonctions se taisent, la carte dit combien il y en a.
   Un clic sur ce compte deplie la carte, sans deplier les autres. */
.org-card-count {
  display: none;
  justify-self: start;
  min-height: 0;
  margin: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--pg-chrome);
  color: var(--pg-muted);
  font-size: 12px;
  font-weight: 600;
}

.org-card-count:hover {
  transform: none;
  background: var(--pg-soft);
  color: var(--pg-ink);
}

.org-card-count::after {
  content: " ▾";
}

.org-card.is-deplie .org-card-count::after {
  content: " ▴";
}

.org-workspace.is-overview .org-card-count {
  display: block;
}

/* Seules les cartes se replient : « À attribuer » garde ses fonctions et son
   champ d'ajout, sinon la colonne ne sert plus a rien dans cette vue. */
.org-workspace.is-overview .org-card .org-missions,
.org-workspace.is-overview .org-card .org-add-mission {
  display: none;
}

.org-workspace.is-overview .org-card.is-deplie .org-missions {
  display: grid;
}

/* Mode lecture : le plan se lit, rien ne s'attrape. */
.org-workspace.is-lecture .org-workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

.org-workspace.is-lecture .org-cell-add,
.org-workspace.is-lecture .org-legend-hint {
  display: none;
}

.org-workspace.is-lecture .org-mission {
  padding-left: 6px;
}

.org-workspace.is-lecture :is(.org-card-holder, .org-card-title, .org-mission-text) {
  cursor: default;
}

.org-reading-toggle[aria-pressed="true"] {
  border-color: var(--pg-ink);
  box-shadow: inset 0 0 0 1px var(--pg-ink), 0 6px 18px rgba(41, 36, 44, 0.12);
}

.org-reading-toggle,
.org-overview-toggle {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: var(--pg-surface);
  box-shadow: 0 6px 18px rgba(41, 36, 44, 0.12);
  color: var(--pg-ink);
  font-size: 13px;
  font-weight: 600;
}

.org-reading-toggle:hover,
.org-overview-toggle:hover {
  transform: none;
  background: var(--pg-chrome);
}

.org-overview-toggle[aria-pressed="true"] {
  border-color: var(--pg-ink);
  box-shadow: inset 0 0 0 1px var(--pg-ink), 0 6px 18px rgba(41, 36, 44, 0.12);
}

/* Fonctions */

.org-missions {
  display: grid;
  gap: 1px;
  min-height: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.org-mission {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 3px 2px 3px 4px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.32;
}

.org-mission:hover {
  background: var(--pg-chrome);
}

.org-mission.is-dragging {
  opacity: 0.4;
}

/* Safari ne fait glisser un element que s'il le declare aussi en CSS. */
.org-mission[draggable="true"],
.org-card-grip {
  -webkit-user-drag: element;
}

.org-mission-grip {
  flex: 0 0 auto;
  width: 12px;
  color: var(--org-tone, var(--pg-muted));
  font-size: 11px;
  line-height: 17px;
  cursor: grab;
  user-select: none;
}

.org-mission-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  border-radius: 4px;
  cursor: text;
}

@media (hover: hover) {
  .org-mission-text:hover {
    text-decoration: underline;
    text-decoration-color: var(--pg-line);
    text-underline-offset: 3px;
  }
}

#organigramme-view .org-mission-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 3px 6px;
  font-size: 12.5px;
  line-height: 1.35;
  resize: none;
}

.org-mission-action {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--pg-muted);
  font-size: 15px;
  line-height: 1;
  opacity: 0;
}

.org-mission:hover .org-mission-action,
.org-mission-action:focus-visible {
  opacity: 1;
}

.org-mission-action:hover {
  transform: none;
  background: var(--pg-danger-bg);
  color: var(--pg-danger);
}

@media (hover: none) {
  .org-mission-action,
  .org-mission-menu {
    opacity: 0.8;
  }
}

/* Un « ⋯ » visible, et par-dessus la liste native, transparente, qui s'ouvre
   au clic ou au toucher. Sur ordinateur il n'apparait qu'au survol ou au
   focus, comme la croix. */
.org-mission-menu {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--pg-muted);
  font-size: 14px;
  line-height: 1;
  opacity: 0;
}

.org-mission:hover .org-mission-menu,
.org-mission-menu:focus-within {
  opacity: 1;
}

.org-mission-menu:hover {
  background: var(--pg-surface);
  color: var(--pg-ink);
}

#organigramme-view .org-mission-menu select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  opacity: 0;
  cursor: pointer;
}

.org-mission-menu:focus-within {
  outline: 2px solid #a62954;
  outline-offset: 2px;
}

.org-add-mission {
  margin: 0;
}

#organigramme-view .org-add-mission input {
  width: 100%;
  min-height: 0;
  padding: 5px 6px;
  color: var(--pg-ink);
  font-size: 12.5px;
}

/* À attribuer */

/* Collee sous la barre du haut (54 px), et jamais plus haute que l'ecran. */
.org-backlog {
  position: sticky;
  top: 70px;
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 86px);
  padding: 14px 12px;
  overflow-y: auto;
  border: 1px dashed var(--pg-control-border);
  border-radius: 14px;
  background: var(--pg-chrome);
}

.org-backlog.is-drop-target {
  border-color: var(--pg-accent);
  background: var(--pg-accent-soft);
}

.org-workspace.is-dragging-mission .org-backlog:not(.is-drop-target) {
  border-color: var(--pg-ink);
}

.org-backlog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.org-backlog-head h3 {
  margin: 0;
  font-size: 15px;
}

.org-backlog-count {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--pg-surface);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.org-backlog-hint {
  margin: 0;
  color: var(--pg-muted);
  font-size: 12px;
  line-height: 1.4;
}

.org-backlog-list {
  gap: 6px;
}

.org-backlog .org-mission {
  border: 1px solid var(--pg-line);
  background: var(--pg-surface);
  padding: 6px 4px 6px 6px;
}

.org-backlog-empty {
  padding: 6px 2px;
  color: var(--pg-muted);
  font-size: 12.5px;
}

/* Liste, sur telephone : les cartes dans l'ordre de lecture de la grille. */

.org-list {
  display: grid;
  gap: 12px;
}

.org-workspace.is-mobile .org-workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

.org-workspace.is-mobile .org-backlog {
  position: static;
  max-height: none;
}

/* Etat vide */

.org-empty {
  display: grid;
  justify-items: start;
  gap: 6px;
  padding: 22px;
  border: 1px dashed var(--pg-control-border);
  border-radius: 12px;
}

.org-empty p {
  margin: 0;
  color: var(--pg-muted);
}

.org-empty .org-empty-title {
  color: var(--pg-ink);
  font-weight: 600;
}

.org-empty .org-actions {
  margin-top: 8px;
}

/* En tres simple */

.org-simple-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.org-simple-depth-1 {
  padding-left: 16px;
}

.org-simple-depth-2 {
  padding-left: 32px;
}

.org-simple-depth-3 {
  padding-left: 48px;
}

/* Ce que coute l'organisation */

/* Le verdict en une pastille, dans le pied flottant du plan, poussee a gauche :
   il reste sous les yeux pendant qu'on change un montant sur une carte, et un
   clic remonte au panneau, qui est au-dessus du plan. */
.org-cost-teaser {
  min-height: 34px;
  margin-right: auto;
  padding: 0 14px;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  background: var(--pg-surface);
  box-shadow: 0 6px 18px rgba(41, 36, 44, 0.12);
  color: var(--pg-ink);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
}

.org-cost-teaser::after {
  content: " \2191";
  color: var(--pg-muted);
}

.org-cost-teaser:hover {
  transform: none;
  background: var(--pg-chrome);
}

.org-cost-teaser.is-gain {
  border-color: transparent;
  background: var(--pg-good-bg);
  color: var(--pg-good);
}

.org-cost-teaser.is-perte {
  border-color: transparent;
  background: var(--pg-danger-bg);
  color: var(--pg-danger);
}

.org-cost-panel {
  scroll-margin-top: 72px;
  padding-bottom: 12px;
}

.org-cost-panel h2:focus {
  outline: none;
}

.org-cost-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.org-cost-base {
  display: inline-flex;
  border: 1px solid var(--pg-line);
  border-radius: 999px;
  overflow: hidden;
}

.org-cost-base button {
  padding: 6px 14px;
  border: 0;
  background: transparent;
  color: var(--pg-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.org-cost-base button[aria-pressed="true"] {
  background: var(--pg-ink);
  color: #fff;
}

/* Au-dessus du plan, le panneau doit rester court : verdict et barres cote a
   cote des que SA largeur le permet — la sienne, pas celle de la fenetre : les
   reglages d'un poste ouverts a cote lui en prennent la moitie, et le chiffre
   du verdict se cassait alors sur trois lignes (test au clic du 21 septembre
   2026). Un navigateur sans requetes de conteneur garde une seule colonne. */
.org-cost {
  container-type: inline-size;
}

.org-cost-summary {
  display: grid;
  gap: 0 28px;
}

@container (min-width: 820px) {
  .org-cost-summary {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
  }

  .org-cost-summary .org-cost-hero,
  .org-cost-summary .org-cost-bars {
    margin-bottom: 16px;
  }
}

/* Le verdict : une phrase, un chiffre. */
.org-cost-hero {
  margin: 0 0 20px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--pg-line);
  background: var(--pg-chrome);
}

.org-cost-hero.is-gain {
  border-color: transparent;
  background: var(--pg-good-bg);
}

.org-cost-hero.is-perte {
  border-color: transparent;
  background: var(--pg-danger-bg);
}

.org-cost-hero p {
  margin: 0;
}

.org-cost-hero-label {
  color: var(--pg-muted);
  font-size: 14px;
  line-height: 1.5;
}

.org-cost-hero-figure {
  margin-top: 2px !important;
  font-size: clamp(24px, 4.2vw, 34px);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--pg-ink);
}

.org-cost-hero.is-gain .org-cost-hero-figure {
  color: var(--pg-good);
}

.org-cost-hero.is-perte .org-cost-hero-figure {
  color: var(--pg-danger);
}

.org-cost-hero-figure span {
  display: inline-block;
  font-size: 0.6em;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}

.org-cost-hero-note {
  margin-top: 8px !important;
  color: var(--pg-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Deux barres a la meme echelle. */
.org-cost-bars {
  display: grid;
  gap: 16px;
  margin: 0 0 18px;
}

.org-cost-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 14px;
}

.org-cost-bar-head span {
  color: var(--pg-muted);
}

.org-cost-bar-head strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.org-cost-track {
  display: flex;
  height: 18px;
  border-radius: 999px;
  background: var(--pg-soft);
  overflow: hidden;
}

.org-cost-fill {
  display: block;
  height: 100%;
}

.org-cost-fill.is-follow {
  background: var(--pg-ink);
}

.org-cost-fill.is-team {
  background: var(--pg-accent);
}

.org-cost-fill.is-kept {
  background: repeating-linear-gradient(135deg, #b9dcc6 0 6px, #d6ebdd 6px 12px);
}

.org-cost-fill.is-over {
  background: repeating-linear-gradient(135deg, #f0b9b2 0 6px, #f8d9d5 6px 12px);
}

.org-cost-bar-foot {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.org-cost-bar-foot.is-gain {
  color: var(--pg-good);
}

.org-cost-bar-foot.is-perte {
  color: var(--pg-danger);
}

.org-cost-kept {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--pg-muted);
}

.org-cost-kept strong {
  color: var(--pg-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Le detail, poste par poste : une liste, lisible a toutes les largeurs. */
.org-cost-detail {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--pg-line);
}

.org-cost-list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  color: var(--pg-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.org-cost-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.org-cost-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--pg-line);
}

.org-cost-who {
  min-width: 0;
}

.org-cost-name {
  display: inline;
  font-weight: 600;
  font-size: 15px;
}

.org-cost-role {
  display: block;
  margin-top: 1px;
  color: var(--pg-muted);
  font-size: 13px;
  line-height: 1.4;
}

.org-cost-figures {
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.org-cost-figures strong {
  display: block;
  font-size: 15px;
}

.org-cost-sub {
  display: block;
  margin-top: 1px;
  color: var(--pg-muted);
  font-size: 12px;
  white-space: nowrap;
}

.org-cost-item.is-existant .org-cost-figures strong,
.org-cost-item.is-existant .org-cost-name {
  color: var(--pg-muted);
  font-weight: 500;
}

.org-cost-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--pg-soft);
  color: var(--pg-muted);
  font-size: 11px;
  white-space: nowrap;
}

.org-cost-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0 0;
  border-top: 2px solid var(--pg-ink);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.org-cost-total.is-existant {
  padding-top: 6px;
  border-top: 0;
  color: var(--pg-muted);
  font-size: 13px;
  font-weight: 400;
}

.org-cost-missing .org-cost-name {
  font-size: inherit;
}

.org-cost-source,
.org-cost-missing {
  margin: 14px 0 0;
  color: var(--pg-muted);
  font-size: 13px;
  line-height: 1.6;
}

.org-cost-economics {
  margin-top: 16px;
}

.org-economics-grid {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.org-charge-scroll {
  overflow-x: auto;
}

.org-charge-table {
  width: 100%;
  max-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
}

.org-charge-table th,
.org-charge-table td {
  padding: 5px 6px 5px 0;
  border: 0;
  background: transparent;
  color: var(--pg-ink);
  font-weight: 400;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
}

.org-charge-table thead th {
  color: var(--pg-muted);
  font-size: 12px;
}

.org-charge-table tbody th {
  white-space: nowrap;
}

.org-charge-table input {
  width: 68px;
  padding: 5px 8px;
  border: 1px solid var(--pg-control-border);
  border-radius: 8px;
  background: var(--pg-surface);
  font: inherit;
  text-align: right;
}

/* Remuneration, dans les reglages d'un poste */

.org-pay-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 120px;
}

.org-pay-existing {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--pg-muted);
}

.org-pay-preview {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--pg-muted);
}

/* Acces */

.org-access-intro {
  margin: 0 0 10px;
  color: var(--pg-muted);
  font-size: 13px;
}

.org-access-list {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.org-access-list small {
  color: var(--pg-muted);
}

/* Reglages d'un poste */

/* La fiche defile dans sa marge interieure : un en-tete collant s'arrete a
   cette marge et laissait voir le contenu dessous. Il s'etend donc jusqu'au
   bord de la fiche. */
#org-sheet .brand-sheet-head {
  top: -24px;
  margin-top: -24px;
  padding-top: 24px;
}

#org-sheet > *,
.org-settings,
.org-block {
  min-width: 0;
}

.org-settings {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.org-block {
  display: grid;
  gap: 10px;
}

.org-block h3 {
  margin: 0;
  font-size: 14px;
}

.org-block-danger {
  justify-items: start;
  padding-top: 16px;
  border-top: 1px solid var(--pg-line);
}

.org-tone-option::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--org-tone);
  vertical-align: -1px;
}

.org-tone-option[aria-pressed="true"] {
  border-color: var(--org-tone);
  background: var(--org-tone-soft);
  color: var(--org-tone-ink);
}

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

.org-link-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.org-link-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.org-link-add select {
  flex: 1 1 140px;
  width: auto;
}

.org-nudge {
  display: flex;
  gap: 6px;
}

.org-mini {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--pg-line);
  border-radius: 10px;
  background: var(--pg-surface);
  color: var(--pg-ink);
  font-size: 16px;
}

.org-mini:hover:not(:disabled) {
  transform: none;
  background: var(--pg-chrome);
}

.org-mini:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 999px) {
  .org-version-copy h2,
  .org-version-form h2 {
    font-size: 26px;
  }

  #org-sheet .brand-sheet-head {
    top: -18px;
    margin-top: -18px;
    padding-top: 18px;
  }

  .org-workspace-grid {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

  .org-legend-hint {
    text-align: left;
  }
}

@media (max-width: 767px) {
  /* Au-dessus de la barre d'onglets fixee au bas de l'ecran. */
  .org-workspace.is-mobile .org-board-footer {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    justify-content: center;
  }

  .org-actions > button {
    flex: 1 1 calc(50% - 8px);
    min-height: 44px;
  }

  .org-card {
    padding: 10px 10px 10px 12px;
  }

  .org-mission {
    align-items: center;
    padding: 4px 2px 4px 4px;
    font-size: 14px;
  }

  .org-card-summary {
    padding-left: 6px;
  }

  .org-mission-menu {
    width: 40px;
    height: 36px;
    border-radius: 8px;
    background: var(--pg-chrome);
    font-size: 18px;
    opacity: 1;
  }

  .org-mission-action {
    width: 32px;
    height: 32px;
  }
}
