:root {
  --blue: #1f4e78;
  --blue2: #d9eaf7;
  --green: #2e7d32;
  --red: #b00020;
  --gray: #f4f6f8;
  --border: #d0d7de;
  --text: #1f2933;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: var(--gray); color: var(--text); }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 28px; background: white; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { width: 64px; height: auto; }
.brand strong { display: block; color: var(--blue); font-size: 20px; }
.brand span { display: block; font-size: 13px; color: #555; }
nav a { margin-left: 18px; color: var(--blue); text-decoration: none; font-weight: 600; }
.container { max-width: 1240px; margin: 28px auto; padding: 0 18px; }
.card { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: 0 8px 28px rgba(31,78,120,0.08); }
.wide { max-width: none; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; }
h1 { color: var(--blue); margin-top: 0; }
dl { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; }
dt { font-weight: 700; color: #445; }
dd { margin: 0; }
.amount { font-size: 22px; color: var(--green); font-weight: 700; }
.button-grid { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 14px; }
.btn { display: inline-block; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); background: white; text-decoration: none; color: var(--blue); font-weight: 700; text-align: center; cursor: pointer; }
.btn.primary { background: var(--blue); color: white; border-color: var(--blue); }
.btn.danger { background: var(--red); color: white; border-color: var(--red); }
.btn.secondary { background: var(--blue2); }
.actions { margin-top: 20px; display: flex; gap: 12px; align-items: center; }
form p, .form-row { margin-bottom: 14px; }
label { font-weight: 700; display: block; margin-bottom: 6px; }
input, select, textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; }
.helptext { color: #667; font-size: 12px; display: block; margin-top: 4px; }
.errorlist { color: var(--red); }
.form-card { max-width: 760px; margin: 0 auto; }
.login-card { max-width: 430px; margin: 80px auto; }
.hint { background: #fff8e6; border-left: 4px solid #f0b429; padding: 12px; }
.messages { margin-bottom: 18px; }
.message { padding: 12px 14px; border-radius: 8px; margin-bottom: 8px; background: #e6f4ea; }
.message.error { background: #fde8e8; }
.message.warning { background: #fff8e6; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; }
th { background: var(--blue); color: white; text-align: left; padding: 9px; }
td { border-bottom: 1px solid var(--border); padding: 8px; vertical-align: top; }
td.num, th.num { text-align: right; white-space: nowrap; }
.title-row { display: flex; justify-content: space-between; align-items: center; }
.inventory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .button-grid { grid-template-columns: 1fr; }
  .inventory-grid { grid-template-columns: 1fr; }
}


.inventory-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0;
}
.inventory-summary div {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: #f8fafc;
}
.inventory-summary span {
  display: block;
  color: #556;
  font-size: 13px;
  margin-bottom: 8px;
}
.inventory-summary strong {
  color: var(--blue);
  font-size: 18px;
}
.inventory-summary strong.ok {
  color: var(--green);
}
.inventory-summary strong.bad {
  color: var(--red);
}
.denomination-row small.line-total {
  display: block;
  margin-top: 6px;
  color: #556;
  font-size: 12px;
  font-weight: 600;
}
@media (max-width: 900px) {
  .inventory-summary {
    grid-template-columns: 1fr;
  }
}


.last-operation-box {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.last-operation-box h2 {
  margin: 0 0 12px 0;
  color: var(--blue);
  font-size: 20px;
}
.last-operation-details {
  grid-template-columns: 110px 1fr;
  gap: 8px 12px;
  font-size: 14px;
}
.amount-positive {
  color: var(--green);
  font-weight: 700;
}
.amount-negative {
  color: var(--red);
  font-weight: 700;
}
.last-operation-details a {
  color: var(--blue);
  font-weight: 700;
}


.version-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f1fb;
  color: var(--blue);
  border: 1px solid #c7d9ef;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}
.dashboard-grid-v08 {
  grid-template-columns: 1fr 1.15fr 1.15fr;
  align-items: start;
}
.last-operation-card h1 {
  margin-bottom: 10px;
}
.operation-number {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 14px;
}
.operation-number a {
  color: var(--blue);
  text-decoration: none;
}
.last-operation-details {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px 12px;
  font-size: 14px;
}
.last-operation-details dt {
  color: #334155;
  font-weight: 800;
}
.last-operation-details dd {
  margin: 0;
}
.amount-positive {
  color: var(--green);
  font-weight: 800;
}
.amount-negative {
  color: var(--red);
  font-weight: 800;
}
.last-operation-details a {
  color: var(--blue);
  font-weight: 800;
}
@media (max-width: 1150px) {
  .dashboard-grid-v08 {
    grid-template-columns: 1fr;
  }
}


/* v09 — accueil moins compressé */
.dashboard-grid-v08 {
  width: min(1500px, calc(100vw - 56px));
  margin-left: auto;
  margin-right: auto;
  grid-template-columns: minmax(330px, 0.9fr) minmax(380px, 1.1fr) minmax(380px, 1.1fr);
  gap: 26px;
}

.card.state {
  min-width: 330px;
}

.card.state dl {
  grid-template-columns: 150px minmax(150px, 1fr);
  column-gap: 16px;
}

.card.state dd,
.card.state .amount {
  white-space: nowrap;
}

.card.state .amount {
  font-size: 26px;
  line-height: 1.1;
}

.last-operation-card,
.card.menu {
  min-width: 360px;
}

@media (max-width: 1250px) {
  .dashboard-grid-v08 {
    grid-template-columns: 1fr;
    width: min(920px, calc(100vw - 32px));
  }
}

/* v10 */
.dashboard-grid-v10 {
  width: min(1550px, calc(100vw - 56px));
  margin-left: auto;
  margin-right: auto;
  grid-template-columns: minmax(380px, 1fr) minmax(430px, 1.15fr) minmax(380px, 1fr);
  gap: 28px;
  align-items: start;
}
.amount-eur {
  color: #475569;
  font-weight: 800;
  font-size: 18px;
  white-space: nowrap;
}
.chart-card {
  width: min(1550px, calc(100vw - 56px));
  margin: 28px auto 0 auto;
}
.chart-subtitle { color: #64748b; font-weight: 700; }
.cash-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(70px, 1fr));
  gap: 12px;
  align-items: end;
  overflow-x: auto;
  padding-top: 12px;
}
.cash-chart-item { text-align: center; min-width: 70px; }
.bar-wrap {
  height: 150px;
  display: flex;
  align-items: end;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}
.cash-bar {
  width: 28px;
  border-radius: 9px 9px 0 0;
  background: linear-gradient(180deg, #4f8cc9, var(--blue));
  box-shadow: 0 5px 15px rgba(31,78,120,.18);
}
.cash-bar.negative { background: linear-gradient(180deg, #d96c6c, var(--red)); }
.cash-chart-label { margin-top: 8px; font-weight: 800; color: var(--blue); font-size: 12px; }
.cash-chart-value { font-size: 11px; color: #475569; white-space: nowrap; }
.admin-grid { grid-template-columns: minmax(430px, .9fr) minmax(360px, .7fr); }
@media (max-width: 1250px) {
  .dashboard-grid-v10, .admin-grid { grid-template-columns: 1fr; width: min(920px, calc(100vw - 32px)); }
  .chart-card { width: min(920px, calc(100vw - 32px)); }
}


/* v11 */
.chart-card-compact {
  width: min(860px, calc(100vw - 56px));
  margin: 22px auto 0 auto;
  padding: 18px 22px;
}

.chart-card-compact h1 {
  font-size: 22px;
  margin-bottom: 4px;
}

.line-chart-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 8px;
}

.line-chart {
  display: block;
  width: 100%;
  max-height: 180px;
}

.line-chart .axis {
  stroke: #cbd5e1;
  stroke-width: 1;
}

.cash-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cash-point {
  fill: white;
  stroke: var(--blue);
  stroke-width: 2;
}

.chart-month {
  font-size: 10px;
  fill: #475569;
}

.chart-values {
  display: grid;
  grid-template-columns: repeat(6, minmax(90px, 1fr));
  gap: 4px 12px;
  margin-top: 8px;
  color: #475569;
  font-size: 11px;
}

.admin-single {
  width: min(820px, calc(100vw - 56px));
  margin: 0 auto;
}

.admin-single .form-card {
  max-width: none;
}

@media (max-width: 900px) {
  .chart-values {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

/* Neutralise l’ancien graphique en barres si le CSS subsiste */
.cash-chart, .cash-chart-item, .bar-wrap, .cash-bar {
  all: unset;
}


/* v15 corrections */
.chart-values {
  display: none !important;
}
.chart-card-compact,
.chart-card {
  padding-bottom: 18px;
}
.line-chart {
  max-height: 155px;
}
.cash-point {
  cursor: help;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}
.table-scroll table {
  min-width: 1180px;
  table-layout: auto;
}
.table-wrap.table-scroll {
  overflow-x: auto;
}
.table-scroll th,
.table-scroll td {
  vertical-align: top;
}
.table-scroll td:nth-child(1),
.table-scroll th:nth-child(1),
.table-scroll td:nth-child(2),
.table-scroll th:nth-child(2) {
  white-space: nowrap;
}
.table-scroll td:nth-child(5),
.table-scroll th:nth-child(5) {
  min-width: 190px;
}
.table-scroll td:nth-child(6),
.table-scroll th:nth-child(6) {
  min-width: 115px;
}
.table-scroll td:nth-child(7),
.table-scroll td:nth-child(8),
.table-scroll td:nth-child(9),
.table-scroll th:nth-child(7),
.table-scroll th:nth-child(8),
.table-scroll th:nth-child(9) {
  min-width: 130px;
  text-align: right;
  white-space: nowrap;
}


/* v16 clean */
.chart-values {
  display: none !important;
}
.chart-card {
  position: relative;
}
.chart-tooltip {
  position: absolute;
  z-index: 20;
  background: #1f2933;
  color: white;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
  white-space: nowrap;
}
.cash-point {
  cursor: pointer;
  fill: white;
  stroke: var(--blue);
  stroke-width: 2.2;
}
.cash-point:hover {
  fill: var(--blue2);
}
.journal-card {
  width: min(98vw, 1540px);
  margin-left: 50%;
  transform: translateX(-50%);
}
.journal-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.journal-table {
  min-width: 1420px;
  font-size: 13px;
}
.journal-table th,
.journal-table td {
  padding: 7px 8px;
}
.journal-table th:nth-child(1),
.journal-table td:nth-child(1) { width: 95px; white-space: nowrap; }
.journal-table th:nth-child(2),
.journal-table td:nth-child(2) { width: 92px; white-space: nowrap; }
.journal-table th:nth-child(3),
.journal-table td:nth-child(3) { width: 110px; }
.journal-table th:nth-child(4),
.journal-table td:nth-child(4) { width: 160px; }
.journal-table th:nth-child(5),
.journal-table td:nth-child(5) { width: 240px; }
.journal-table th:nth-child(6),
.journal-table td:nth-child(6) { width: 150px; }
.journal-table th:nth-child(7),
.journal-table td:nth-child(7),
.journal-table th:nth-child(8),
.journal-table td:nth-child(8),
.journal-table th:nth-child(9),
.journal-table td:nth-child(9) {
  width: 135px;
  white-space: nowrap;
  text-align: right;
}
.journal-table th:nth-child(10),
.journal-table td:nth-child(10),
.journal-table th:nth-child(11),
.journal-table td:nth-child(11) {
  width: 70px;
  text-align: center;
  white-space: nowrap;
}


/* v17 — graphique propre, boutons PV, inventaires */
.chart-card-compact {
  width: min(980px, calc(100vw - 56px));
  padding: 18px 22px 16px 22px;
}
.chart-card-compact h1 {
  font-size: 22px;
  margin-bottom: 0;
}
.line-chart-wrap {
  margin-top: 6px;
}
.line-chart {
  display: block;
  width: 100%;
  height: 180px;
  max-height: 180px;
}
.line-chart .axis {
  stroke: #d5dde7;
  stroke-width: 1;
}
.cash-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cash-point {
  fill: white;
  stroke: var(--blue);
  stroke-width: 2.2;
}
.cash-hit {
  fill: transparent;
  stroke: transparent;
  cursor: pointer;
}
.cash-hover:hover .cash-point {
  fill: var(--blue2);
  stroke-width: 2.8;
}
.chart-month {
  font-size: 11px;
  fill: #475569;
  font-weight: 700;
}
.chart-tooltip {
  position: absolute;
  z-index: 100;
  background: #102a43;
  color: white;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(0,0,0,.20);
  white-space: nowrap;
}
.chart-tooltip[hidden] {
  display: none !important;
}
.recent-inventories {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.recent-inventories h2 {
  color: var(--blue);
  margin: 0 0 12px 0;
}


/* v18 — graphique réécrit proprement */
.chart-card.cash-chart-card {
  width: min(980px, calc(100vw - 56px));
  padding: 20px 24px 18px 24px;
  position: relative;
  overflow: visible;
}

.cash-chart-card .title-row {
  margin-bottom: 4px;
}

.cash-chart-card h1 {
  font-size: 22px;
  line-height: 1.15;
  margin: 0;
}

.cash-chart-card .chart-subtitle {
  font-size: 14px;
  font-weight: 700;
  color: #243b53;
}

.cash-chart {
  position: relative;
  height: 190px;
  margin-top: 8px;
  padding: 0 18px 34px 18px;
  overflow: visible;
}

.cash-chart-svg {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 8px;
  width: calc(100% - 36px);
  height: 128px;
  overflow: visible;
}

.cash-chart-axis {
  stroke: #d8e0ea;
  stroke-width: 0.55;
}

.cash-chart-line {
  fill: none;
  stroke: #123b5d;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.cash-chart-point {
  position: absolute;
  width: 18px;
  height: 18px;
  margin-left: 9px;
  margin-top: 8px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 5;
}

.cash-chart-point::after {
  content: "";
  display: block;
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #123b5d;
  opacity: 0;
  transition: opacity .12s ease;
}

.cash-chart-point:hover::after,
.cash-chart-point:focus::after {
  opacity: 1;
}

.cash-chart-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: #102a43;
  color: #fff;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
  z-index: 30;
}

.cash-chart-point:hover .cash-chart-tooltip,
.cash-chart-point:focus .cash-chart-tooltip {
  display: block;
}

.cash-chart-month {
  position: absolute;
  bottom: 5px;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  color: #52606d;
  z-index: 2;
}

/* neutralisation des anciens artefacts SVG */
.line-chart,
.line-chart-wrap,
.chart-values,
.cash-hit,
.cash-hover,
.chart-month,
.chart-tooltip:not(.cash-chart-tooltip) {
  display: none !important;
}


/* v19 — graphique définitif : un seul repère 0..100, tooltip CSS fiable */
.chart-values,
.line-chart,
.line-chart-wrap,
.cash-hit,
.cash-hover,
.chart-month,
.chart-tooltip:not(.cash-chart-tooltip) {
  display: none !important;
}

.chart-card.cash-chart-card {
  width: min(980px, calc(100vw - 56px));
  padding: 20px 24px 18px 24px;
  position: relative;
  overflow: visible;
}

.cash-chart-card .title-row {
  margin-bottom: 8px;
}

.cash-chart-card h1 {
  font-size: 22px;
  line-height: 1.15;
  margin: 0;
}

.cash-chart-card .chart-subtitle {
  font-size: 14px;
  font-weight: 700;
  color: #243b53;
}

.cash-chart {
  position: relative;
  height: 185px;
  margin-top: 4px;
  overflow: visible;
}

.cash-chart-svg {
  position: absolute;
  inset: 0 0 30px 0;
  width: 100%;
  height: 140px;
  overflow: visible;
}

.cash-chart-axis {
  stroke: #d8e0ea;
  stroke-width: 0.65;
}

.cash-chart-line {
  fill: none;
  stroke: #123b5d;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.cash-chart-point {
  position: absolute;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 8;
}

.cash-chart-point::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #123b5d;
  opacity: 0;
  transition: opacity .12s ease;
}

.cash-chart-point:hover::after,
.cash-chart-point:focus::after {
  opacity: 1;
}

.cash-chart-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #102a43;
  color: #fff;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
  z-index: 50;
  pointer-events: none;
}

.cash-chart-point:hover .cash-chart-tooltip,
.cash-chart-point:focus .cash-chart-tooltip {
  display: block;
}

.cash-chart-month {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 700;
  color: #52606d;
  z-index: 2;
}


/* v20 — graphique canvas propre : neutralise tous les anciens composants */
.chart-card,
.cash-chart-card,
.cash-chart,
.cash-chart-svg,
.cash-chart-point,
.cash-chart-month,
.cash-chart-tooltip,
.line-chart,
.line-chart-wrap,
.chart-values,
.cash-hit,
.cash-hover,
.chart-month,
.chart-tooltip {
  display: none !important;
}

.trend-card {
  width: min(760px, calc(100vw - 56px));
  margin-left: auto;
  margin-right: auto;
  padding: 18px 22px 16px 22px;
  position: relative;
  overflow: visible;
}

.trend-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 4px;
}

.trend-header h1 {
  font-size: 20px;
  line-height: 1.15;
  margin: 0;
}

.trend-header span {
  font-size: 13px;
  font-weight: 700;
  color: #243b53;
  white-space: nowrap;
}

.trend-chart {
  position: relative;
  width: 100%;
  height: 230px;
}

#cashTrendCanvas {
  display: block;
  width: 100%;
  height: 230px;
}

.trend-tooltip {
  position: absolute;
  z-index: 50;
  background: #102a43;
  color: #fff;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
  pointer-events: none;
}

.trend-tooltip[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .trend-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}


/* v21 */
.admin-single .card + .card { margin-top: 22px; }
.form-card h2 { color: var(--blue); margin-top: 18px; }

.read-only-box, .danger-zone {
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0 16px;
  background: #f8fafc;
}
.danger-zone {
  border-color: #e5b1b1;
  background: #fff5f5;
}
.btn.disabled, .btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}


/* v23 — menu principal regroupé par blocs fonctionnels */
.menu-v23 {
  padding: 22px;
}

.menu-v23 h1 {
  margin-bottom: 16px;
}

.menu-section {
  border: 1px solid #dde6ef;
  border-radius: 14px;
  padding: 13px 14px 14px 14px;
  margin-bottom: 13px;
  background: #fbfdff;
}

.menu-section:last-child {
  margin-bottom: 0;
}

.menu-section h2 {
  margin: 0 0 10px 0;
  font-size: 14px;
  letter-spacing: .01em;
  color: #284b6d;
}

.menu-section-primary {
  background: #f7fbff;
  border-color: #cbdff2;
}

.menu-section-critical {
  background: #fff8f8;
  border-color: #f1c7cf;
}

.menu-section-admin {
  background: #f8fafc;
}

.menu-actions {
  display: grid;
  gap: 10px;
}

.menu-actions.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.menu-v23 .btn {
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
}

.menu-link {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
  text-decoration: none;
}

.btn.disabled,
.btn[aria-disabled="true"] {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 520px) {
  .menu-actions.two-cols {
    grid-template-columns: 1fr;
  }
}

/* v24 — accueil recomposé, inspiration institutionnelle libre de droit */
:root {
  --if-blue: #123b5d;
  --if-blue-soft: #eaf2f8;
  --if-red: #b83b4a;
  --if-ink: #17212b;
  --if-muted: #64748b;
  --if-line: #dbe4ee;
  --if-surface: rgba(255,255,255,.92);
}
body {
  background:
    radial-gradient(circle at 8% 0%, rgba(18,59,93,.12), transparent 30%),
    linear-gradient(180deg, #f6f8fb 0%, #edf2f7 100%);
  color: var(--if-ink);
}
.topbar {
  border-bottom: 1px solid rgba(18,59,93,.16);
  box-shadow: 0 8px 24px rgba(18,59,93,.06);
}
.brand strong { color: var(--if-blue); letter-spacing: -.01em; }
nav a { color: var(--if-blue); }
.home-hero-v24,
.home-grid-v24,
.home-lower-v24,
.conversion-strip-v24 {
  width: min(1540px, calc(100vw - 56px));
  margin-left: auto;
  margin-right: auto;
}
.home-hero-v24 {
  margin-bottom: 24px;
  padding: 24px 28px;
  border: 1px solid rgba(18,59,93,.12);
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f4f8fb 62%, #e9f1f7 100%);
  box-shadow: 0 16px 46px rgba(18,59,93,.08);
  position: relative;
  overflow: hidden;
}
.home-hero-v24:before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: linear-gradient(180deg, var(--if-blue), var(--if-red));
}
.hero-kicker,
.card-label {
  color: var(--if-red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.hero-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.hero-main h1 {
  margin: 0;
  color: var(--if-blue);
  font-size: clamp(30px, 3vw, 44px);
  letter-spacing: -.035em;
}
.hero-main p {
  margin: 8px 0 0 0;
  color: var(--if-muted);
  font-weight: 650;
}
.hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.hero-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--if-line);
  color: var(--if-blue);
  font-weight: 800;
  white-space: nowrap;
}
.home-grid-v24 {
  display: grid;
  grid-template-columns: 1.18fr .82fr 1fr;
  gap: 22px;
  align-items: stretch;
}
.home-grid-v24 .card,
.home-lower-v24 .card,
.admin-v24 .card {
  background: var(--if-surface);
  border: 1px solid rgba(18,59,93,.12);
  border-radius: 22px;
  box-shadow: 0 16px 38px rgba(18,59,93,.075);
}
.state-card-v24,
.action-card-v24,
.last-card-v24 { min-height: 310px; }
.main-balance {
  font-size: clamp(34px, 3.6vw, 56px);
  line-height: 1;
  color: var(--if-blue);
  font-weight: 950;
  letter-spacing: -.05em;
  margin-top: 6px;
}
.eur-balance {
  margin-top: 10px;
  font-size: 20px;
  color: #2f5b7b;
  font-weight: 850;
}
.rate-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--if-blue-soft);
  color: #334155;
  font-size: 13px;
  line-height: 1.35;
  border: 1px solid #d4e4f0;
}
.state-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.state-mini-grid div {
  padding: 12px;
  border-radius: 14px;
  background: #fbfdff;
  border: 1px solid var(--if-line);
}
.state-mini-grid span,
.nav-blocks-v24 span,
.hero-meta span {
  font-size: 12px;
}
.state-mini-grid span,
.nav-blocks-v24 span {
  display: block;
  color: var(--if-muted);
  font-weight: 750;
  margin-bottom: 5px;
}
.state-mini-grid strong,
.nav-blocks-v24 strong {
  color: var(--if-blue);
  font-size: 15px;
}
.primary-actions-v24 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 10px 0 18px 0;
}
.action-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
  border-radius: 18px;
  padding: 18px 20px;
  color: white;
  text-decoration: none;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -.02em;
  box-shadow: 0 12px 26px rgba(18,59,93,.16);
}
.action-pill:after { content: "→"; font-size: 26px; }
.action-pill.encaisser { background: linear-gradient(135deg, var(--if-blue), #285f8c); }
.action-pill.payer { background: linear-gradient(135deg, var(--if-red), #8c2737); }
.secondary-actions-v24 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.secondary-actions-v24 a,
.inline-links-v24 a,
.nav-blocks-v24 a,
.nav-disabled {
  text-decoration: none;
  border: 1px solid var(--if-line);
  background: #fff;
  color: var(--if-blue);
  border-radius: 14px;
  padding: 12px;
  font-weight: 850;
}
.secondary-actions-v24 a:hover,
.nav-blocks-v24 a:hover { border-color: #a9c2d7; background: #f8fbfe; }
.operation-number a { color: var(--if-blue); }
.compact-dl {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px 12px;
  margin-top: 10px;
}
.compact-dl dt { color: var(--if-muted); }
.compact-dl dd { min-width: 0; }
.inline-links-v24 {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.home-lower-v24 {
  display: grid;
  grid-template-columns: minmax(420px, .72fr) minmax(620px, 1.28fr);
  gap: 22px;
  margin-top: 22px;
}
.nav-blocks-v24 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.nav-blocks-v24 a,
.nav-disabled {
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.nav-blocks-v24 a.critical {
  border-color: rgba(184,59,74,.28);
  background: #fff7f8;
}
.nav-disabled {
  background: #eef3f7;
  color: #748094;
}
.nav-disabled strong { color: #748094; }
.trend-card-v24 { position: relative; overflow: hidden; }
.trend-card-v24 h1 { margin: 2px 0 0 0; font-size: 28px; }
.trend-header { align-items: center; }
.trend-header > span {
  background: var(--if-blue-soft);
  color: var(--if-blue);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
}
.conversion-strip-v24 {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fff8e6;
  border: 1px solid #f2d289;
  color: #6b5208;
  font-weight: 750;
}
.rate-panel-v24 {
  margin: 18px 0 22px 0;
  padding: 16px;
  border: 1px solid #d4e4f0;
  border-radius: 16px;
  background: #f7fbff;
}
.rate-panel-v24 h2 { margin-top: 0; color: var(--if-blue); }
.inline-form-v24 { margin-top: 12px; }
.hint-inline { color: var(--if-muted); font-weight: 700; }
.warning-box-v24 {
  padding: 14px;
  border-radius: 14px;
  background: #fff7f8;
  border: 1px solid rgba(184,59,74,.28);
  color: #7a2431;
  margin-bottom: 16px;
}
@media (max-width: 1280px) {
  .home-grid-v24,
  .home-lower-v24 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .home-hero-v24,
  .home-grid-v24,
  .home-lower-v24,
  .conversion-strip-v24 { width: min(100% - 24px, 720px); }
  .hero-main { align-items: flex-start; flex-direction: column; }
  .hero-meta { justify-content: flex-start; }
  .state-mini-grid,
  .secondary-actions-v24,
  .nav-blocks-v24 { grid-template-columns: 1fr; }
  .main-balance { font-size: 36px; }
}


/* v26 — formulaires encaissement / décaissement et choix de natures */
.operation-card-v26 {
  max-width: 900px;
  padding: 30px 34px;
}
.operation-title-row-v26 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}
.form-kicker-v26 {
  margin: 0 0 4px 0;
  color: var(--if-red, #b83b4a);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.operation-card-v26 h1 {
  margin-bottom: 0;
  letter-spacing: -.02em;
}
.ghost-v26 {
  background: #f8fbfe;
}
.operation-hint-v26 {
  border-radius: 14px;
  border-left-width: 5px;
  margin: 16px 0 22px 0;
}
.operation-form-v26 {
  display: grid;
  gap: 18px;
}
.form-grid-v26.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-v26 label,
.nature-field-v26 > label {
  color: #243b53;
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 8px;
}
.field-v26 input,
.field-v26 textarea {
  border-radius: 12px;
  border: 1px solid #cfd9e5;
  background: #fff;
  min-height: 46px;
}
.field-v26 input:focus,
.field-v26 textarea:focus {
  outline: none;
  border-color: #7aa4c7;
  box-shadow: 0 0 0 4px rgba(18,59,93,.10);
}
.nature-cards-v26 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.nature-card-v26 {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid #d7e1ec;
  border-radius: 14px;
  background: #fbfdff;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease, transform .12s ease;
}
.nature-card-v26:hover {
  background: #f4f8fb;
  border-color: #a9c2d7;
}
.nature-card-v26 input {
  width: 18px;
  height: 18px;
  accent-color: var(--if-blue, #123b5d);
  flex: 0 0 auto;
}
.nature-card-v26:has(input:checked) {
  background: #eaf2f8;
  border-color: var(--if-blue, #123b5d);
  box-shadow: 0 8px 20px rgba(18,59,93,.10);
}
.nature-card-v26 span {
  font-weight: 850;
  color: #183b56;
  line-height: 1.2;
}
.operation-decaissement .nature-card-v26 input {
  accent-color: var(--if-red, #b83b4a);
}
.operation-decaissement .nature-card-v26:has(input:checked) {
  background: #fff7f8;
  border-color: var(--if-red, #b83b4a);
}
.file-field-v26 {
  padding: 14px;
  border: 1px dashed #cbd8e6;
  border-radius: 14px;
  background: #fbfdff;
}
.file-field-v26 input[type=file] {
  border: 0;
  padding: 0;
  min-height: 0;
  background: transparent;
}
.receipt-check-v26 {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid #d7e1ec;
  background: #fbfdff;
  cursor: pointer;
}
.receipt-check-v26 input {
  width: 18px;
  height: 18px;
  accent-color: var(--if-blue, #123b5d);
}
.receipt-check-v26 span {
  font-weight: 850;
  color: #243b53;
}
@media (max-width: 760px) {
  .operation-card-v26 {
    max-width: calc(100vw - 24px);
    padding: 22px;
  }
  .operation-title-row-v26,
  .form-grid-v26.two {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .nature-cards-v26 {
    grid-template-columns: 1fr;
  }
}


/* v27 — cockpit guidé et séparation Administration / Paramètres */
:root {
  --if-navy: #002654;
  --if-blue: #005fa0;
  --if-red: #a82040;
  --if-surface: #ffffff;
  --if-bg: #f4f6f8;
  --if-border: #dce3eb;
  --if-muted: #637381;
  --if-text: #142337;
}
body { font-family: Inter, "Source Sans 3", Arial, Helvetica, sans-serif; background: var(--if-bg); color: var(--if-text); }
.container { max-width: 1500px; }
.topbar-v27 { padding: 14px 34px; border-bottom: 1px solid #dbe4ee; box-shadow: 0 8px 28px rgba(0,38,84,.06); }
.brand-v27 img { width: 58px; }
.topbar-v27 nav a { color: var(--if-navy); opacity: .82; font-weight: 800; }
.topbar-v27 nav a:hover { opacity: 1; }
.cockpit-hero-v27 { background: #fff; border-radius: 28px; padding: 30px 36px; display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; border: 1px solid #e2e8f0; box-shadow: 0 18px 44px rgba(0,38,84,.08); position: relative; overflow: hidden; }
.cockpit-hero-v27:before { content: ""; position: absolute; inset: 0 auto 0 0; width: 14px; background: var(--if-red); }
.cockpit-hero-v27 h1 { font-size: 42px; line-height: 1.05; margin: 8px 0 8px; color: var(--if-navy); }
.cockpit-hero-v27 p { color: var(--if-muted); font-size: 18px; margin: 0; }
.hero-kicker-v27, .card-label-v27 { color: var(--if-red); text-transform: uppercase; letter-spacing: .08em; font-weight: 900; font-size: 13px; }
.hero-meta-v27 { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.hero-meta-v27 span { background: #eaf2f8; color: var(--if-navy); padding: 9px 14px; border-radius: 999px; font-weight: 800; }
.cockpit-grid-v27 { display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; margin-top: 24px; }
.cockpit-lower-v27 { display: grid; grid-template-columns: .9fr .85fr 1fr; gap: 24px; margin-top: 24px; align-items: stretch; }
.cockpit-state-v27, .cockpit-actions-v27, .checklist-card-v27, .last-op-card-v27, .controls-card-v27, .cockpit-trend-v27, .settings-card-v27, .about-card-v27 { border-radius: 28px; border: 1px solid #e2e8f0; box-shadow: 0 18px 44px rgba(0,38,84,.08); }
.state-balance-v27 { font-size: clamp(48px, 5vw, 72px); line-height: 1; margin-top: 18px; font-weight: 950; color: var(--if-navy); }
.state-eur-v27 { margin-top: 14px; font-size: 22px; font-weight: 900; color: #142337; }
.rate-note-v27 { margin-top: 20px; padding: 16px 18px; border-radius: 18px; background: #ecf4f8; border: 1px solid #d9e7f0; color: #243b53; }
.state-mini-grid-v27 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.state-mini-grid-v27 div { border: 1px solid #e1e8ef; border-radius: 16px; background: #fbfdff; padding: 12px 14px; }
.state-mini-grid-v27 span { display: block; color: var(--if-muted); font-size: 12px; font-weight: 800; }
.state-mini-grid-v27 strong { display: block; margin-top: 3px; color: var(--if-navy); font-size: 14px; }
.primary-action-grid-v27 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.action-button-v27 { min-height: 98px; border-radius: 20px; padding: 20px 22px; color: #fff; text-decoration: none; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 14px 28px rgba(0,38,84,.15); transition: transform .12s ease, box-shadow .12s ease; }
.action-button-v27:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(0,38,84,.20); }
.action-button-v27 strong { font-size: 24px; line-height: 1; }
.action-button-v27 span { margin-top: 9px; opacity: .88; font-weight: 650; }
.action-blue { background: var(--if-navy); }
.action-red { background: var(--if-red); }
.action-mid { background: var(--if-blue); }
.action-dark { background: #2d4054; }
.checklist-card-v27 h2 { margin: 10px 0 20px; color: var(--if-navy); }
.checklist-v27 { padding: 0; margin: 0; list-style: none; display: grid; gap: 15px; }
.checklist-v27 li { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.checklist-v27 li span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 900; }
.checklist-v27 li.ok span { background: #148752; }
.checklist-v27 li.warn span { background: #b77d00; }
.soft-callout-v27 { display: block; margin-top: 24px; padding: 13px 16px; border-radius: 16px; background: #fff5dc; border: 1px solid #ecd69f; color: #513b00; text-decoration: none; font-weight: 900; }
.last-op-type-v27 { font-size: 18px; font-weight: 850; margin-bottom: 8px; }
.last-op-amount-v27 { font-size: 27px; font-weight: 950; margin: 0 0 12px; }
.hintline-v27 { color: var(--if-muted); font-weight: 700; }
.last-op-label-v27 { border-top: 1px solid #e4eaf0; padding-top: 14px; color: #334e68; }
.inline-links-v27 { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.inline-links-v27 a { border-radius: 14px; padding: 11px 14px; background: #eef5fa; color: var(--if-navy); text-decoration: none; font-weight: 900; }
.control-grid-v27 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.control-grid-v27 a, .control-grid-v27 .nav-disabled { border: 1px solid #dfe7ef; border-radius: 16px; padding: 14px 16px; background: #fbfdff; text-decoration: none; color: var(--if-navy); }
.control-grid-v27 a.critical { color: var(--if-red); }
.control-grid-v27 a span, .control-grid-v27 .nav-disabled span { display: block; color: var(--if-muted); font-size: 12px; font-weight: 800; }
.control-grid-v27 a strong, .control-grid-v27 .nav-disabled strong { display: block; margin-top: 4px; font-size: 15px; }
.control-grid-v27 .nav-disabled { opacity: .62; background: #eef2f5; }
.cockpit-trend-v27 { margin-top: 24px; }
.settings-layout-v27 { display: grid; grid-template-columns: .85fr 1.15fr; gap: 24px; align-items: start; }
.change-list-v27 { margin: 16px 0 0; padding-left: 22px; }
.change-list-v27 li { margin-bottom: 10px; }
.autocomplete-box-v27 { border: 1px solid #cfd9e5; border-radius: 12px; background: #fff; margin-top: 6px; box-shadow: 0 12px 30px rgba(0,38,84,.15); overflow: hidden; position: relative; z-index: 20; }
.autocomplete-box-v27 button { display: block; width: 100%; background: #fff; border: 0; text-align: left; padding: 10px 12px; cursor: pointer; font-weight: 700; color: #243b53; }
.autocomplete-box-v27 button:hover { background: #eef5fa; }
@media (max-width: 1100px) { .cockpit-grid-v27, .cockpit-lower-v27, .settings-layout-v27 { grid-template-columns: 1fr; } .state-mini-grid-v27, .primary-action-grid-v27, .control-grid-v27 { grid-template-columns: 1fr; } .cockpit-hero-v27 { flex-direction: column; } }


/* v28 — correctifs cockpit, graphique et référentiels */
.cockpit-trend-v28 {
  width: auto;
  max-width: none;
  margin: 24px 0 0 0;
  padding: 22px 26px 18px;
}
.cockpit-trend-v28 .trend-header h1 {
  font-size: 26px;
}
.cockpit-trend-v28 .trend-chart,
.cockpit-trend-v28 #cashTrendCanvas {
  height: 250px;
}
.warning-box-v24 {
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff5dc;
  border: 1px solid #ecd69f;
  color: #513b00;
}
.rates-table-v28 {
  margin: 24px 0;
  padding: 18px;
  border-radius: 18px;
  background: #fbfdff;
  border: 1px solid #e1e8ef;
}
.rates-table-v28 h2 { margin-top: 0; }
.active-rate-row-v28 { background: #eef7f2; }
.badge-v28 {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #148752;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}
html[lang="ar"] body { direction: rtl; }
html[lang="ar"] .topbar-v27 nav,
html[lang="ar"] .hero-meta-v27,
html[lang="ar"] .trend-header { direction: rtl; }

/* v29 — retour des natures en menu déroulant et blocs repliables sur l'accueil */
.nature-select-block-v29 {
  max-width: 100%;
}
.nature-select-v29 {
  width: 100%;
  min-height: 52px;
  border-radius: 13px;
  border: 1px solid #cfd9e5;
  background: #fff;
  color: #183b56;
  font-weight: 750;
  padding: 12px 14px;
  appearance: auto;
}
.nature-select-v29:focus {
  outline: none;
  border-color: #7aa4c7;
  box-shadow: 0 0 0 4px rgba(18,59,93,.10);
}
.nature-help-v29 {
  margin-top: 7px;
}
.card-toolbar-v29 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.collapse-toggle-v29 {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border: 1px solid #dce3eb;
  border-radius: 10px;
  background: #f8fbfe;
  color: var(--if-navy, #002654);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.collapse-toggle-v29:hover {
  background: #eaf2f8;
  border-color: #b9cedf;
}
.collapsible-card-v29 {
  position: relative;
  transition: min-height .15s ease, padding .15s ease;
}
.collapsible-card-v29.is-collapsed-v29 {
  min-height: 0 !important;
  padding-bottom: 18px;
}
.collapsible-card-v29.is-collapsed-v29 > *:not(.card-toolbar-v29) {
  display: none !important;
}
.collapsible-card-v29.is-collapsed-v29 .card-toolbar-v29 {
  margin-bottom: 0;
}
.trend-header-v29 {
  margin-top: 6px;
}

/* v30 — accueil compact réel, select plus propre, courbe intra-mois */
.cockpit-grid-v27,
.cockpit-lower-v27 {
  align-items: start;
}
.compact-summary-v30 {
  display: none;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f4f8fb;
  border: 1px solid #dfe7ef;
  color: var(--if-navy, #002654);
}
.compact-summary-v30 strong {
  font-size: 16px;
  font-weight: 950;
}
.compact-summary-v30 span {
  font-size: 13px;
  color: var(--if-muted, #637381);
  font-weight: 800;
}
.actions-compact-v30 {
  flex-wrap: wrap;
  justify-content: flex-start;
}
.actions-compact-v30 a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d7e2ed;
  color: var(--if-navy, #002654);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}
.collapsible-card-v29 {
  align-self: start;
}
.collapsible-card-v29.is-collapsed-v29 {
  min-height: unset !important;
  padding: 18px 20px !important;
}
.collapsible-card-v29.is-collapsed-v29 > *:not(.card-toolbar-v29):not(.compact-summary-v30) {
  display: none !important;
}
.collapsible-card-v29.is-collapsed-v29 .compact-summary-v30 {
  display: flex;
  margin-top: 10px;
}
.collapsible-card-v29.is-collapsed-v29 .card-toolbar-v29 {
  margin-bottom: 0;
}
.nature-select-block-v29 {
  position: relative;
}
.nature-select-v30 {
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  border: 1px solid #c7d5e3;
  background-color: #fff;
  background-image: linear-gradient(45deg, transparent 50%, #002654 50%), linear-gradient(135deg, #002654 50%, transparent 50%);
  background-position: calc(100% - 22px) 24px, calc(100% - 15px) 24px;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
  color: #183b56;
  font-weight: 850;
  padding: 13px 46px 13px 16px;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 0 8px 20px rgba(0,38,84,.04);
}
.nature-select-v30:hover {
  border-color: #9db8cf;
  background-color: #fbfdff;
}
.nature-select-v30:focus {
  outline: none;
  border-color: #005fa0;
  box-shadow: 0 0 0 4px rgba(0,95,160,.12);
}
.operation-decaissement .nature-select-v30:focus {
  border-color: var(--if-red, #a82040);
  box-shadow: 0 0 0 4px rgba(168,32,64,.10);
}

/* v31 — finition UI, bandeau plus professionnel, dates comptables */
.topbar-v27 {
  min-height: 62px;
  padding: 8px 28px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
}
.brand-v27 {
  gap: 12px;
}
.brand-v27 img {
  width: 44px;
  max-height: 44px;
  object-fit: contain;
}
.brand-v27 strong {
  font-size: 18px;
  line-height: 1.05;
  letter-spacing: -.01em;
}
.brand-v27 span:not(.version-badge) {
  font-size: 12px;
  margin-top: 2px;
}
.version-badge {
  font-size: 10px;
  padding: 1px 7px;
  margin-left: 6px;
}
.topbar-v27 nav a {
  font-size: 13px;
  margin-left: 14px;
}
.container {
  max-width: 1320px;
}
.cockpit-hero-v27 {
  padding: 22px 30px;
  border-radius: 22px;
}
.cockpit-hero-v27:before {
  width: 10px;
}
.cockpit-hero-v27 h1 {
  font-size: clamp(28px, 3vw, 36px);
  margin: 6px 0 6px;
}
.cockpit-hero-v27 p {
  font-size: 15px;
}
.hero-kicker-v27, .card-label-v27 {
  font-size: 12px;
  letter-spacing: .075em;
}
.cockpit-state-v27, .cockpit-actions-v27, .checklist-card-v27, .last-op-card-v27, .controls-card-v27, .cockpit-trend-v27, .settings-card-v27, .about-card-v27 {
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(0,38,84,.07);
}
.state-balance-v27 {
  font-size: clamp(42px, 4vw, 58px);
}
.state-eur-v27 {
  font-size: 18px;
}
.rate-note-v27 {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
}
.primary-action-grid-v27 {
  gap: 12px;
  margin-top: 16px;
}
.action-button-v27 {
  min-height: 74px;
  border-radius: 16px;
  padding: 15px 18px;
  box-shadow: 0 10px 22px rgba(0,38,84,.13);
}
.action-button-v27 strong {
  font-size: 20px;
}
.action-button-v27 span {
  margin-top: 6px;
  font-size: 13px;
}
.cockpit-trend-v28 {
  width: min(980px, 100%);
  max-width: 980px;
  margin: 24px auto 0 auto;
  padding: 18px 22px 14px;
}
.cockpit-trend-v28 .trend-header h1 {
  font-size: 22px;
}
.cockpit-trend-v28 .trend-chart,
.cockpit-trend-v28 #cashTrendCanvas {
  height: 190px;
}
.nature-select-v30 {
  border-radius: 12px;
  min-height: 48px;
  font-size: 15px;
  background-color: #fbfdff;
}
.admin-details-v31, .version-history-v31 {
  border: 1px solid #dfe7ef;
  border-radius: 16px;
  background: #fbfdff;
  padding: 14px 16px;
  margin: 18px 0;
}
.admin-details-v31 > summary, .version-history-v31 > summary {
  cursor: pointer;
  color: var(--if-navy, #002654);
  font-weight: 900;
  list-style-position: outside;
}
.admin-details-v31[open] > summary, .version-history-v31[open] > summary {
  margin-bottom: 14px;
}
.rates-table-v28 {
  padding: 14px 16px;
}
.version-entry-v31 {
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  margin-top: 12px;
}
.version-entry-v31 h3 {
  margin: 0 0 8px;
  color: var(--if-navy, #002654);
  font-size: 17px;
}
.journal-table-v31 th, .journal-table-v31 td {
  font-size: 12px;
  white-space: nowrap;
}
.journal-table-v31 td:nth-child(6) {
  white-space: normal;
  min-width: 180px;
}

/* v32 — Paramètres enrichis, À propos repliable et historique honnête */
.settings-page-v32 {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  gap: 24px;
  align-items: start;
}
.settings-main-v32 h1,
.about-card-v32 h1 {
  font-size: clamp(30px, 3vw, 46px);
  margin: 8px 0 12px;
  color: var(--if-navy, #002654);
}
.settings-form-v32 {
  margin-top: 22px;
}
.settings-section-v32,
.about-card-v32,
.version-history-v32 {
  border: 1px solid #dfe7ef;
  border-radius: 18px;
  background: #fbfdff;
  margin: 14px 0;
  overflow: hidden;
}
.settings-section-v32 > summary,
.about-card-v32 > summary,
.version-history-v32 > summary {
  cursor: pointer;
  padding: 16px 18px;
  color: var(--if-navy, #002654);
  font-weight: 950;
  list-style-position: outside;
  display: block;
}
.settings-section-v32 > summary span,
.about-card-v32 > summary span {
  display: block;
  font-size: 18px;
}
.settings-section-v32 > summary small,
.about-card-v32 > summary small {
  display: block;
  margin-top: 5px;
  color: var(--if-muted, #637381);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 650;
}
.settings-section-v32[open] > summary,
.about-card-v32[open] > summary,
.version-history-v32[open] > summary {
  border-bottom: 1px solid #e4ebf2;
  background: #f8fbfd;
}
.settings-fields-v32 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  padding: 18px;
}
.setting-field-v32 {
  display: grid;
  gap: 7px;
}
.setting-field-v32 label {
  font-size: 14px;
  font-weight: 900;
  color: #243b53;
}
.setting-field-v32 input[type="text"],
.setting-field-v32 select {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid #cfd9e5;
  background: #fff;
  padding: 10px 12px;
  font-size: 15px;
}
.setting-field-v32.is-checkbox {
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 6px 10px;
}
.setting-field-v32.is-checkbox label {
  grid-column: 2;
  grid-row: 1;
}
.setting-field-v32.is-checkbox input[type="checkbox"] {
  grid-column: 1;
  grid-row: 1;
  width: 20px;
  height: 20px;
}
.setting-field-v32.is-checkbox .field-help-v32,
.setting-field-v32.is-checkbox .errorlist {
  grid-column: 2;
}
.field-help-v32 {
  margin: 0;
  color: var(--if-muted, #637381);
  font-size: 12px;
  line-height: 1.35;
}
.settings-actions-v32 {
  margin-top: 20px;
}
.about-card-v32 {
  padding: 0;
}
.about-content-v32 {
  padding: 18px 22px 22px;
}
.about-kv-v32 {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 10px 18px;
  align-items: baseline;
  margin: 18px 0 28px;
}
.about-kv-v32 dt {
  color: var(--if-muted, #637381);
  font-weight: 950;
  line-height: 1.2;
}
.about-kv-v32 dd {
  margin: 0;
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.history-note-v32 {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff5dc;
  border: 1px solid #ecd69f;
  color: #513b00;
  font-size: 13px;
  font-weight: 700;
}
.version-history-v32 {
  padding: 0;
}
.version-history-v32 > summary {
  padding: 14px 16px;
}
.version-history-v32 .version-entry-v31 {
  padding: 12px 0;
}
@media (max-width: 1100px) {
  .settings-page-v32 { grid-template-columns: 1fr; }
  .settings-fields-v32 { grid-template-columns: 1fr; }
  .about-kv-v32 { grid-template-columns: 1fr; gap: 4px 0; }
}
