/* Module Trésorerie — aligné sur #module-content (fond blanc) */

.tresorerie-module {
  max-width: 1200px;
  position: relative;
  padding: 0.15rem 0.25rem 1rem;
  color: var(--carbone);
}

/* ── Popup authentification (fond sombre) ─────────────────────────────── */
.tres-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.tres-auth-modal[hidden] {
  display: none !important;
}

.tres-auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 16, 0.72);
  backdrop-filter: blur(4px);
}

.tres-auth-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(92vh, 640px);
  overflow-y: auto;
}

.tres-auth-dialog-inner {
  background: var(--carbone);
  border: 1px solid var(--carbone-70);
  border-radius: 14px;
  padding: 1.5rem 1.35rem 1.25rem;
  box-shadow: var(--shadow-lg);
  color: var(--color-text-inverse, #fff);
}

.tres-gate-header {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
  align-items: flex-start;
}

.tres-gate-icon { font-size: 1.85rem; line-height: 1; flex-shrink: 0; }

.tres-gate-title {
  margin: 0 0 0.3rem;
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
}

.tres-gate-subtitle,
.tres-gate-hint,
.tres-otp-hint {
  margin: 0;
  font-size: 0.86rem;
  color: var(--carbone-30);
  line-height: 1.45;
}

.tres-gate-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tres-gate-tab {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--carbone-70);
  background: transparent;
  color: inherit;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.tres-gate-tab.is-active {
  background: var(--cgt-red);
  border-color: var(--cgt-red);
  color: #fff;
}

.tres-gate-panel label {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.3rem;
  color: var(--carbone-30);
}

.tres-gate-panel input[type="password"],
.tres-gate-panel input[type="text"]:not(.tres-otp-cell) {
  width: 100%;
  margin-bottom: 0.75rem;
}

.tres-gate-panel .admin-submit { width: 100%; }

/* ── Cases OTP 6 chiffres ─────────────────────────────────────────────── */
.tres-otp-label {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  color: #fff;
}

.tres-otp-hint {
  text-align: center;
  margin-bottom: 1rem;
}

.tres-otp-boxes {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin: 0 auto 0.5rem;
  max-width: 320px;
}

.tres-otp-cell {
  width: 2.65rem;
  height: 3rem;
  padding: 0;
  border: 2px solid var(--carbone-70);
  border-radius: 10px;
  background: #fff;
  color: var(--carbone);
  font-size: 1.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1;
  caret-color: var(--cgt-red);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tres-otp-cell:focus {
  outline: none;
  border-color: var(--cgt-red);
  box-shadow: 0 0 0 3px rgba(226, 7, 20, 0.25);
}

.tres-otp-boxes.is-verifying .tres-otp-cell {
  opacity: 0.65;
  pointer-events: none;
}

.tres-otp-boxes.is-error .tres-otp-cell {
  border-color: var(--cgt-red);
  animation: tres-otp-shake 0.35s ease;
}

@keyframes tres-otp-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.tres-gate--setup .tres-auth-dialog-inner { text-align: center; }
.tres-gate--setup .tres-gate-header { justify-content: center; }
.tres-gate--setup .tres-gate-header > div { text-align: center; }

.tres-gate-alt-link {
  display: block;
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.35rem 0;
  border: none;
  background: none;
  color: var(--carbone-30);
  font-size: 0.84rem;
  text-decoration: underline;
  cursor: pointer;
  text-align: center;
}

.tres-gate-alt-link:hover,
.tres-gate-alt-link:focus-visible {
  color: #fff;
  outline: none;
}

.tres-passkey-setup input[type="text"] {
  width: 100%;
  margin-bottom: 0.75rem;
}

.tres-gate-panel.is-hidden { display: none; }

.tres-totp-qr { text-align: center; margin-top: 0.75rem; }
.tres-totp-qr img { border-radius: 8px; background: #fff; padding: 4px; margin-bottom: 0.5rem; }

.tres-gate-feedback {
  margin-top: 0.85rem;
  min-height: 1.2em;
  text-align: center;
  font-size: 0.88rem;
}

.tres-main[hidden] { display: none !important; }

/* ── Contenu principal (fond blanc) ───────────────────────────────────── */
.tres-header-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.tres-page-title {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--carbone);
}

.tres-session-info {
  margin: 0;
  font-size: 0.84rem;
  color: var(--carbone-70);
}

.tres-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.tres-header-actions .admin-submit {
  width: auto;
  padding: 0.45rem 1rem;
  font-size: 0.88rem;
}

/* Boutons secondaires sur fond blanc */
.tresorerie-module .admin-submit.secondary {
  background: #fff;
  color: var(--carbone);
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: none;
}

.tresorerie-module .admin-submit.secondary:hover {
  background: rgba(0, 0, 0, 0.04);
  filter: none;
}

/* ── Filtres ──────────────────────────────────────────────────────────── */
.tres-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: flex-end;
  margin-bottom: 1.15rem;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}

.tres-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1 1 120px;
  min-width: 100px;
}

.tres-filter-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--carbone);
}

.tres-filter-field select,
.tres-filter-field input[type="search"],
.tres-filter-field input[type="text"] {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  color: var(--carbone);
  font-size: 0.88rem;
}

.tres-filter-field select:focus,
.tres-filter-field input:focus {
  outline: none;
  border-color: var(--cgt-red);
  box-shadow: 0 0 0 2px rgba(226, 7, 20, 0.12);
}

.tres-filter-search { flex: 2 1 180px; }

.tres-filter-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tres-filter-actions .admin-submit {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
}

/* ── Bandeau totaux ───────────────────────────────────────────────────── */
.tres-totaux {
  background: var(--carbone-10);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--carbone);
}

.tres-status {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  color: var(--carbone-70);
}

/* ── Liste / tableau notes de frais ─────────────────────────────────────── */
.tres-list {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.tres-notes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  table-layout: fixed;
}

.tres-notes-table .tres-col-date { width: 6.75rem; }
.tres-notes-table .tres-col-elu { width: 11.5rem; }
.tres-notes-table .tres-col-categorie { width: 8.5rem; }
.tres-notes-table .tres-col-montant { width: 8.5rem; }
.tres-notes-table .tres-col-statut { width: 7.5rem; }

.tres-notes-table th,
.tres-notes-table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.tres-notes-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--carbone-70);
  background: #f6f7f8;
  white-space: nowrap;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.tres-notes-table td {
  color: var(--carbone);
  line-height: 1.35;
}

.tres-notes-table .tres-col-num,
.tres-notes-table td.tres-amount {
  text-align: right;
}

.tres-notes-table .tres-col-center {
  text-align: center;
}

.tres-notes-table--with-elu td:nth-child(2) {
  font-weight: 600;
  color: var(--carbone);
}

.tres-notes-table--with-elu td:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tres-notes-table:not(.tres-notes-table--with-elu) td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tres-notes-table tbody tr:last-child td {
  border-bottom: none;
}

.tres-notes-table tbody tr[data-id] {
  cursor: pointer;
  transition: background 0.12s ease;
}

.tres-notes-table tbody tr[data-id]:hover td {
  background: rgba(0, 140, 230, 0.05);
}

.tres-notes-table tbody tr[data-id]:active td {
  background: rgba(0, 140, 230, 0.09);
}

/* Rétrocompat : .tres-list sans classe explicite sur table */
.tres-list table:not(.tres-notes-table) {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.tres-list table:not(.tres-notes-table) th,
.tres-list table:not(.tres-notes-table) td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.tres-list table:not(.tres-notes-table) th {
  font-size: 0.78rem;
  color: var(--carbone-70);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(0, 0, 0, 0.03);
}

.tres-list table:not(.tres-notes-table) tr[data-id] {
  cursor: pointer;
  transition: background 0.12s ease;
}

.tres-list table:not(.tres-notes-table) tr[data-id]:hover td {
  background: rgba(0, 0, 0, 0.03);
}

.tres-empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--carbone-70);
  font-size: 0.92rem;
}

/* ── Badges statut ──────────────────────────────────────────────────────── */
.tres-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.tres-badge--brouillon { background: var(--carbone-30); color: var(--carbone); }
.tres-badge--soumise   { background: rgba(37, 99, 235, 0.14); color: #1d4ed8; }
.tres-badge--validee   { background: rgba(22, 163, 74, 0.14); color: #15803d; }
.tres-badge--rejetee   { background: rgba(226, 7, 20, 0.12); color: var(--cgt-red); }
.tres-badge--payee     { background: rgba(13, 148, 136, 0.14); color: #0f766e; }
.tres-badge--paye      { background: rgba(13, 148, 136, 0.14); color: #0f766e; }
.tres-badge--en_attente_virement { background: rgba(234, 179, 8, 0.16); color: #a16207; }

.tres-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tres-amount-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  line-height: 1.25;
}

.tres-amount-main {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--carbone);
}

.tres-amount-note {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--carbone-70);
  font-variant-numeric: tabular-nums;
}

/* ── Modales trésorerie / factures (fond blanc, comme Q-CSE) ─────────── */
#tres-modal .doc-modal-content,
#fact-modal .doc-modal-content {
  width: min(94vw, 640px);
  height: auto;
  max-height: 92vh;
  background: #fff;
  color: var(--carbone);
  overflow: auto;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

#tres-modal .doc-modal-body,
#fact-modal .doc-modal-body {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  width: auto;
  height: auto;
  max-height: none;
  overflow: visible;
  box-sizing: border-box;
  padding: 1.35rem 2.75rem 1.35rem 1.35rem;
}

#tres-modal .doc-modal-close,
#fact-modal .doc-modal-close {
  color: var(--carbone);
  background: rgba(0, 0, 0, 0.06);
}

#tres-modal .doc-modal-close:hover,
#fact-modal .doc-modal-close:hover {
  background: rgba(0, 0, 0, 0.12);
}

#tres-modal h3,
#fact-modal h3 {
  margin: 0 0 1.1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--carbone);
  padding-right: 1.5rem;
}

#tres-modal h4,
#fact-modal h4 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--carbone);
}

#tres-modal hr,
#fact-modal hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  margin: 1.15rem 0;
}

#tres-modal .tres-form,
#fact-modal .tres-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Grille formulaire note de frais */
.tres-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}

.tres-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.tres-form-field--full {
  grid-column: 1 / -1;
}

.tres-form-field--libelle {
  grid-column: 1 / -1;
}

.tres-form--gestion .tres-form-field--libelle {
  grid-column: auto;
}

.tres-form:not(.tres-form--gestion) .tres-form-field--date {
  grid-column: 1;
}

.tres-form:not(.tres-form--gestion) .tres-form-field--date {
  grid-column: 1;
}

.tres-form:not(.tres-form--has-quantite) .tres-form-field--montant {
  grid-column: 1 / -1;
}

.tres-form--has-quantite .tres-form-field--quantite {
  grid-column: 1;
}

.tres-form--has-quantite .tres-form-field--montant {
  grid-column: 2;
}

/* Grille formulaire facture */
.tres-form--facture .tres-form-field--date {
  grid-column: 1;
}

.tres-form--facture .tres-form-field--fournisseur {
  grid-column: 2;
}

.tres-form--facture .tres-form-field--numero {
  grid-column: 1;
}

.tres-form--facture .tres-form-field--montant {
  grid-column: 2;
}

.tres-form--facture .tres-form-field--libelle {
  grid-column: 1 / -1;
}

.tres-fact-file-zone {
  padding: 0.7rem 0.85rem;
  border: 1px dashed rgba(0, 0, 0, 0.16);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tres-fact-file-zone:focus-within {
  border-color: var(--bleu-rle, #008ce6);
  background: rgba(0, 140, 230, 0.05);
}

.tres-fact-file-zone input[type="file"] {
  width: 100%;
  font-size: 0.84rem;
  color: var(--carbone);
}

.tres-fact-file-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--carbone-70);
  line-height: 1.35;
}

.tres-fact-file-current {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--carbone-70);
  line-height: 1.4;
}

.tres-fact-file-current a {
  color: var(--bleu-rle, #008ce6);
  font-weight: 600;
  text-decoration: none;
}

.tres-fact-file-current a:hover {
  text-decoration: underline;
}

#fact-modal.fact-modal--consult .doc-modal-content {
  width: min(96vw, 920px);
  max-height: min(96vh, 820px);
  overflow: hidden;
}

#fact-modal.fact-modal--consult .doc-modal-body {
  padding: 0.75rem 2.35rem 0.75rem 0.85rem;
  max-height: min(96vh, 820px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#fact-modal.fact-modal--consult h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  line-height: 1.3;
}

#fact-modal .tres-form--consult {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#fact-modal .tres-form--consult .tres-form-actions {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

#fact-modal .tres-form--consult #fact-form-feedback {
  margin: 0;
  min-height: 0;
}

.fact-detail-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow: hidden;
}

.fact-detail-docs-top {
  margin: 0;
  flex-shrink: 0;
}

.fact-detail-docs-top .admin-submit {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.fact-detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.65rem 1rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.fact-detail-col {
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.07);
  overflow: auto;
}

.fact-detail-col-title {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--carbone);
}

.fact-detail-subtitle {
  margin: 0.55rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--carbone-70);
}

.fact-detail-grid {
  display: grid;
  grid-template-columns: minmax(4.8rem, 38%) 1fr;
  gap: 0.28rem 0.55rem;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.fact-detail-grid dt {
  font-weight: 600;
  color: var(--carbone-70);
}

.fact-detail-grid dd {
  margin: 0;
  word-break: break-word;
}

.fact-detail-preuve-wrap {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.fact-detail-preuve-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.55rem;
}

.fact-detail-preuve-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.fact-detail-preuve-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--carbone-70);
  line-height: 1.25;
}

.fact-detail-preuve-value {
  font-size: 0.78rem;
  color: var(--carbone);
  word-break: break-word;
  line-height: 1.3;
}

#tres-gest-modal.fact-modal--consult .doc-modal-content {
  width: min(96vw, 920px);
  max-height: min(96vh, 820px);
}

#tres-gest-modal.fact-modal--consult .doc-modal-body {
  padding: 0.75rem 2.35rem 0.75rem 0.85rem;
}

#tres-gest-modal.fact-modal--consult h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.fact-detail-view--modal {
  overflow: visible;
}

@media (max-width: 720px) {
  #fact-modal.fact-modal--consult .doc-modal-content {
    width: min(96vw, 520px);
    max-height: 96vh;
  }

  .fact-detail-columns {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .fact-detail-col {
    max-height: none;
  }

  .fact-detail-preuve-grid {
    grid-template-columns: 1fr;
  }
}

.tres-fact-form-statut {
  margin: 0 0 0.85rem;
}

.tres-form--readonly .tres-form-grid--locked {
  pointer-events: none;
  user-select: none;
}

.tres-form--readonly .tres-form-grid--locked input,
.tres-form--readonly .tres-form-grid--locked textarea,
.tres-form--readonly .tres-form-grid--locked select {
  background: var(--carbone-05, #f4f5f6);
  color: var(--carbone-70, #4b5563);
  cursor: default;
}

.tres-fact-detail-paiement hr {
  margin: 1rem 0;
  border: none;
  border-top: 1px solid var(--carbone-15, #e5e7eb);
}

.tres-notes-table tbody tr[data-fact-id] {
  cursor: pointer;
}

.tres-notes-table tbody tr[data-fact-id]:hover td,
.tres-notes-table tbody tr[data-fact-id]:focus td {
  background: rgba(0, 140, 230, 0.06);
}

.tres-notes-table tbody tr[data-fact-id]:focus-visible {
  outline: 2px solid var(--bleu-rle, #008ce6);
  outline-offset: -2px;
}

.tres-plafond-preview {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(0, 140, 230, 0.08);
  border: 1px solid rgba(0, 140, 230, 0.2);
  font-size: 0.88rem;
  color: var(--carbone);
  line-height: 1.45;
}

.tres-plafond-preview--warn {
  background: rgba(226, 7, 20, 0.06);
  border-color: rgba(226, 7, 20, 0.22);
}

.tres-plafonds-panel {
  margin-bottom: 1.15rem;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
}

.tres-plafonds-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.tres-plafonds-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--carbone);
}

.tres-plafonds-body {
  margin-top: 0.85rem;
}

.tres-plafonds-body.is-hidden {
  display: none;
}

.tres-plafonds-intro {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  color: var(--carbone-70);
  line-height: 1.45;
}

.tres-plafonds-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.tres-plafonds-card {
  flex: 1 1 180px;
  padding: 0.75rem 0.85rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

.tres-plafonds-card-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--carbone-70);
  margin-bottom: 0.25rem;
}

.tres-plafonds-card-value {
  font-size: 1.15rem;
  color: var(--carbone);
}

.tres-plafonds-card-unit,
.tres-plafonds-card-since {
  display: block;
  font-size: 0.78rem;
  color: var(--carbone-70);
  margin-top: 0.15rem;
}

.tres-plafonds-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem 0.85rem;
  align-items: end;
  margin-bottom: 0.5rem;
}

.tres-plafonds-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tres-plafonds-form-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--carbone);
}

.tres-plafonds-form-row input,
.tres-plafonds-form-row select {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  color: var(--carbone);
}

.tres-plafonds-form .admin-submit {
  width: auto;
  justify-self: start;
}

.tres-plafonds-history-title {
  margin: 1rem 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--carbone);
}

.tres-plafonds-history table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.tres-plafonds-history th,
.tres-plafonds-history td {
  padding: 0.45rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.tres-plafonds-history th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--carbone-70);
}

.tres-form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--carbone);
}

.tres-form-field input,
.tres-form-field select,
.tres-form-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  color: var(--carbone);
  font-size: 0.9rem;
}

.tres-form-field input::placeholder,
.tres-form-field textarea::placeholder {
  color: var(--carbone-70);
  opacity: 1;
}

.tres-form-field input:focus,
.tres-form-field select:focus,
.tres-form-field textarea:focus {
  outline: none;
  border-color: var(--cgt-red);
  box-shadow: 0 0 0 2px rgba(226, 7, 20, 0.12);
}

.tres-form-field textarea {
  min-height: 72px;
  resize: vertical;
  font-family: inherit;
}

#tres-modal .admin-form,
#fact-modal .admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#tres-modal .admin-form-row,
#fact-modal .admin-form-row {
  gap: 0.35rem;
}

#tres-modal .admin-form-row label,
#fact-modal .admin-form-row label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--carbone);
}

#tres-modal .admin-form-row input,
#tres-modal .admin-form-row select,
#tres-modal .admin-form-row textarea,
#fact-modal .admin-form-row input,
#fact-modal .admin-form-row select,
#fact-modal .admin-form-row textarea {
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  color: var(--carbone);
  font-size: 0.9rem;
}

#tres-modal .admin-form-row input::placeholder,
#tres-modal .admin-form-row textarea::placeholder,
#fact-modal .admin-form-row input::placeholder,
#fact-modal .admin-form-row textarea::placeholder {
  color: var(--carbone-70);
  opacity: 1;
}

#tres-modal .admin-form-row input:focus,
#tres-modal .admin-form-row select:focus,
#tres-modal .admin-form-row textarea:focus,
#fact-modal .admin-form-row input:focus,
#fact-modal .admin-form-row select:focus,
#fact-modal .admin-form-row textarea:focus {
  outline: none;
  border-color: var(--cgt-red);
  box-shadow: 0 0 0 2px rgba(226, 7, 20, 0.12);
}

#tres-modal .admin-form-row textarea,
#fact-modal .admin-form-row textarea {
  min-height: 72px;
  resize: vertical;
}

#tres-modal .admin-submit.secondary,
#fact-modal .admin-submit.secondary {
  background: #fff;
  color: var(--carbone);
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: none;
}

#tres-modal .admin-submit.secondary:hover,
#fact-modal .admin-submit.secondary:hover {
  background: rgba(0, 0, 0, 0.04);
  filter: none;
}

.tres-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.tres-form-actions .admin-submit {
  width: auto;
  flex: 0 1 auto;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
}

#tres-modal #tres-form-feedback,
#fact-modal #fact-form-feedback {
  color: var(--carbone-70);
  min-height: 1.2rem;
}

/* ── Zone glisser-déposer justificatifs ─────────────────────────────────── */
.tres-pieces-dropzone {
  border: 2px dashed rgba(0, 0, 0, 0.18);
  border-radius: 12px;
  padding: 1.1rem 1rem;
  text-align: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.02);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.tres-pieces-dropzone:hover,
.tres-pieces-dropzone:focus-visible {
  border-color: var(--bleu-rle);
  background: rgba(0, 140, 230, 0.06);
  outline: none;
}

.tres-pieces-dropzone.is-dragover {
  border-color: var(--cgt-red);
  background: rgba(226, 7, 20, 0.05);
  box-shadow: 0 0 0 3px rgba(226, 7, 20, 0.1);
}

.tres-pieces-dropzone.is-disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: not-allowed;
}

.tres-pieces-dropzone-icon {
  display: block;
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
}

.tres-pieces-dropzone-title {
  margin: 0 0 0.25rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--carbone);
}

.tres-pieces-dropzone-hint {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--carbone-70);
}

.tres-pieces-dropzone-action {
  margin: 0;
  font-size: 0.82rem;
  color: var(--carbone-70);
}

.tres-pieces-dropzone-action span {
  color: var(--bleu-rle);
  font-weight: 600;
  text-decoration: underline;
}

.tres-pieces-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.tres-pieces-camera-btn {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
}

.tres-pieces-camera-btn.is-disabled,
.tres-pieces-camera-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.tres-pieces-list {
  margin-top: 0.65rem;
  padding: 0;
  background: transparent;
  border: none;
  min-height: 0;
}

.tres-pieces-list:not(:empty) {
  padding: 0.5rem 0.65rem;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
}

.tres-pieces-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--carbone-70);
  font-style: italic;
}

.tres-piece-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--carbone);
}

.tres-piece-item a {
  color: var(--bleu-rle);
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tres-piece-item--pending .tres-piece-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.tres-piece-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(0, 140, 230, 0.12);
  color: var(--bleu-rle);
  white-space: nowrap;
}

.tres-piece-remove {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--carbone-70);
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1;
}

.tres-piece-remove:hover {
  color: var(--cgt-red);
  background: rgba(226, 7, 20, 0.08);
}

.tres-piece-item + .tres-piece-item {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

#tres-pieces-add {
  margin-top: 0.35rem;
}

/* ── Actions trésorier ─────────────────────────────────────────────────── */
.tres-gestion-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tres-gestion-actions .admin-submit {
  width: auto;
  padding: 0.5rem 0.9rem;
  font-size: 0.88rem;
}

.tres-reject-wrap {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tres-reject-wrap label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--carbone);
}

.tres-reject-wrap textarea {
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  color: var(--carbone);
  font-family: inherit;
  resize: vertical;
  min-height: 64px;
}

.tres-historique ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
}

.tres-historique li {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--carbone);
}

.tres-historique li:last-child {
  border-bottom: none;
}

@media (max-width: 720px) {
  .tres-filters {
    padding: 0.75rem;
  }

  .tres-filter-actions {
    width: 100%;
  }

  .tres-filter-actions .admin-submit {
    flex: 1 1 auto;
  }

  .tres-form-grid {
    grid-template-columns: 1fr;
  }

  .tres-form-field--full,
  .tres-form-field--libelle,
  .tres-form-field--montant,
  .tres-form-field--quantite,
  .tres-form:not(.tres-form--gestion) .tres-form-field--date,
  .tres-form--facture .tres-form-field--fournisseur,
  .tres-form--facture .tres-form-field--numero {
    grid-column: 1;
  }

  .tres-form-actions {
    justify-content: stretch;
  }

  .tres-form-actions .admin-submit {
    flex: 1 1 calc(50% - 0.25rem);
  }

  #tres-modal .doc-modal-body,
  #fact-modal .doc-modal-body {
    padding: 1.15rem 2.25rem 1.15rem 1.15rem;
  }

  .tres-remb-detail-grid {
    grid-template-columns: 1fr;
  }

  #tres-remb-modal .doc-modal-body,
  #tres-gest-modal .doc-modal-body {
    padding: 1.15rem 2.25rem 1.15rem 1.15rem;
  }
}

@media (max-width: 600px) {
  .tres-otp-cell {
    width: 2.35rem;
    height: 2.75rem;
    font-size: 1.25rem;
  }

  .tres-otp-boxes { gap: 0.3rem; }

  .tres-header-actions {
    width: 100%;
  }

  .tres-header-actions .admin-submit {
    flex: 1 1 auto;
  }

  .tres-list {
    overflow-x: auto;
  }

  .tres-notes-table {
    min-width: 640px;
  }
}

/* Hub Note de frais — onglets saisie */
.tres-saisie-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1rem;
  border-bottom: 1px solid var(--gris-clair, #ddd);
}
.tres-saisie-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  color: var(--gris-fonce, #555);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.tres-saisie-tab.is-active {
  color: var(--cgt-red, #c00);
  border-bottom-color: var(--cgt-red, #c00);
}

/* Dossiers remboursements & notes par mois */
.tres-remb-dossiers {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tres-remb-dossier {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tres-remb-dossier summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--carbone);
  padding: 0.75rem 1rem;
  background: #f6f7f8;
  border-bottom: 1px solid transparent;
  list-style: none;
  user-select: none;
  transition: background 0.12s ease;
}

.tres-remb-dossier summary::-webkit-details-marker {
  display: none;
}

.tres-remb-dossier summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.8rem;
  color: var(--carbone-70);
  transition: transform 0.15s ease;
}

.tres-remb-dossier[open] > summary::before {
  transform: rotate(90deg);
}

.tres-remb-dossier[open] > summary {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.tres-remb-dossier summary:hover {
  background: #eef0f2;
}

.tres-remb-dossier-items {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tres-remb-dossier-items .tres-notes-table thead th {
  position: static;
}

.tres-remb-dossier .tres-remb-dossier-items table tbody tr[data-id] {
  cursor: pointer;
}

.tres-remb-dossier .tres-remb-dossier-items table tbody tr[data-id]:hover td {
  background: rgba(0, 140, 230, 0.05);
}

/* Tableau remboursements — compact, responsive */
.tres-remb-table .tres-col-statut { width: 30%; }
.tres-remb-table .tres-col-montant { width: 28%; }
.tres-remb-table .tres-col-date { width: 22%; }
.tres-remb-table--with-elu .tres-col-elu { width: 20%; }
.tres-remb-table--with-elu .tres-col-statut { width: 22%; }
.tres-remb-table--with-elu .tres-col-montant { width: 18%; }
.tres-remb-table--with-elu .tres-col-date { width: 18%; }

.tres-remb-table .tres-badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.tres-remb-elu {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.tres-remb-table tbody tr[data-remb-id] {
  cursor: pointer;
  transition: background 0.12s ease;
}

.tres-remb-table tbody tr[data-remb-id]:hover td,
.tres-remb-table tbody tr[data-remb-id]:focus td {
  background: rgba(0, 140, 230, 0.05);
  outline: none;
}

.tres-remb-table tbody tr[data-remb-id]:focus-visible {
  outline: 2px solid rgba(0, 140, 230, 0.35);
  outline-offset: -2px;
}

/* Modale détail remboursement */
#tres-remb-modal .doc-modal-content,
#tres-gest-modal .doc-modal-content {
  width: min(94vw, 680px);
  height: auto;
  max-height: 92vh;
  background: #fff;
  color: var(--carbone);
  overflow: auto;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

#tres-remb-modal .doc-modal-body,
#tres-gest-modal .doc-modal-body {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  width: auto;
  height: auto;
  max-height: none;
  overflow: visible;
  box-sizing: border-box;
  padding: 1.35rem 2.75rem 1.35rem 1.35rem;
}

#tres-remb-modal .doc-modal-close:hover,
#tres-gest-modal .doc-modal-close:hover {
  background: rgba(0, 0, 0, 0.12);
}

#tres-remb-modal .doc-modal-close,
#tres-gest-modal .doc-modal-close {
  color: var(--carbone);
  background: rgba(0, 0, 0, 0.06);
}

#tres-remb-modal h3,
#tres-gest-modal-body h3 {
  margin: 0 0 1.1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--carbone);
  padding-right: 1.5rem;
}

.tres-remb-detail-grid {
  display: grid;
  grid-template-columns: minmax(7.5rem, 36%) 1fr;
  gap: 0.45rem 1rem;
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}

.tres-remb-detail-grid dt {
  font-weight: 600;
  color: var(--carbone-70);
}

.tres-remb-detail-grid dd {
  margin: 0;
  word-break: break-word;
}

.tres-remb-detail-section-title {
  margin: 1.15rem 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--carbone);
}

.tres-remb-detail-notes {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.tres-remb-detail-notes th,
.tres-remb-detail-notes td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.tres-remb-detail-notes th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--carbone-70);
  background: #f6f7f8;
}

.tres-remb-detail-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tres-remb-detail-docs .admin-submit {
  width: auto;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  text-decoration: none;
}

.tres-remb-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.tres-remb-modal-actions .admin-submit {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
}
.tres-remb-item,
.tres-gest-remb-card-inner {
  padding: 0.85rem 1rem;
  margin: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
}
.tres-gest-remb-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.tres-gest-remb-card-ids {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.tres-gest-remb-ref {
  font-weight: 700;
  font-size: 0.92rem;
  color: #1a2a3a;
}
.tres-gest-remb-total {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cgt-red, #c00);
  white-space: nowrap;
}
.tres-gest-remb-notes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.tres-gest-remb-notes-table td {
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  vertical-align: top;
}
.tres-gest-remb-notes-table tr:last-child td {
  border-bottom: none;
}
.tres-gest-remb-note-date {
  width: 5.5rem;
  color: var(--carbone-70, #666);
  white-space: nowrap;
}
.tres-gest-remb-note-lib {
  padding-right: 0.5rem;
}
.tres-gest-remb-note-amt {
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
}
.tres-gest-remb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.tres-gest-remb-actions .admin-submit {
  width: auto;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}
.tres-empty { color: var(--gris-fonce, #666); font-style: italic; }

/* Gestion trésorier — cartes élus */
.tres-gest-elus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
.tres-gest-elu-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  text-align: left;
  width: 100%;
  padding: 1rem 1.1rem;
  border: 2px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.tres-gest-elu-card:hover {
  transform: translateY(-3px);
  border-color: var(--cgt-red, #c00);
  box-shadow: 0 10px 24px rgba(204, 0, 0, 0.12);
}
.tres-gest-elu-card:focus-visible {
  outline: 2px solid var(--cgt-red, #c00);
  outline-offset: 3px;
}
.tres-gest-elu-card--pending {
  border-left: 4px solid var(--cgt-red, #c00);
  padding-left: calc(1.1rem - 2px);
}
.tres-gest-elu-avatar {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(145deg, #1a3a5c 0%, #2d5a87 100%);
  box-shadow: 0 2px 6px rgba(26, 58, 92, 0.25);
}
.tres-gest-elu-card--pending .tres-gest-elu-avatar {
  background: linear-gradient(145deg, #a80000 0%, #cc0000 100%);
  box-shadow: 0 2px 8px rgba(204, 0, 0, 0.3);
}
.tres-gest-elu-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.tres-gest-elu-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #1a2a3a;
  line-height: 1.25;
}
.tres-gest-elu-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tres-gest-elu-badge {
  display: inline-block;
  position: relative;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  line-height: 1.3;
  cursor: help;
}
.tres-gest-elu-badge[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%);
  min-width: 11rem;
  max-width: 16rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: #1a2a3a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 20;
}
.tres-gest-elu-badge[data-tip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 1px);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a2a3a;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 20;
}
.tres-gest-elu-badge[data-tip]:hover::after,
.tres-gest-elu-badge[data-tip]:hover::before {
  opacity: 1;
  visibility: visible;
}
.tres-gest-elu-badge--soumise {
  background: #e3f2fd;
  color: #1565c0;
}
.tres-gest-elu-badge--remb {
  background: #fff3e0;
  color: #e65100;
}
.tres-gest-elu-badge--virement {
  background: rgba(234, 179, 8, 0.16);
  color: #a16207;
}
.tres-gest-elu-chevron {
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: #bbb;
  transition: color 0.15s, transform 0.15s;
}
.tres-gest-elu-card:hover .tres-gest-elu-chevron {
  color: var(--cgt-red, #c00);
  transform: translateX(3px);
}
.tres-gest-elu-meta { font-size: 0.9rem; color: var(--gris-fonce, #555); }

/* Panneau virement en attente */
.tres-gest-pending-panel {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(204, 0, 0, 0.15);
  border-radius: 12px;
  background: linear-gradient(135deg, #fffbfb 0%, #fff9f5 100%);
  box-shadow: 0 2px 12px rgba(204, 0, 0, 0.06);
}
.tres-gest-pending-panel-head {
  margin-bottom: 0.85rem;
}
.tres-gest-pending-panel-head h4 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a2a3a;
}
.tres-gest-pending-panel-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--carbone-70, #666);
  line-height: 1.35;
}
.tres-gest-pending-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  align-items: start;
}
@media (min-width: 860px) {
  .tres-gest-pending-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 1rem;
  }
}
.tres-gest-pending-recap .tres-gest-remb-card-inner {
  height: 100%;
}
.tres-gest-validate-form {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: #fff;
}
.tres-gest-validate-form-title {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a2a3a;
}
.tres-gest-validate-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 480px) {
  .tres-gest-validate-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }
}
.tres-gest-validate-row {
  margin-bottom: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.tres-gest-validate-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--carbone-70, #555);
}
.tres-gest-validate-row input[type="text"],
.tres-gest-validate-row input[type="date"] {
  max-width: 100%;
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
}
.tres-gest-validate-row input[type="file"] {
  font-size: 0.82rem;
}
.tres-gest-validate-submit {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 1rem !important;
  font-size: 0.88rem !important;
}
.tres-gest-preuve-parse {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #555;
}
.tres-gest-preuve-details {
  margin-top: 0.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: #fafbfc;
  font-size: 0.82rem;
}
.tres-preuve-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.tres-preuve-details-table th {
  text-align: left;
  font-weight: 600;
  color: #555;
  padding: 0.35rem 0.75rem 0.35rem 0;
  vertical-align: top;
  white-space: nowrap;
  width: 38%;
}
.tres-preuve-details-table td {
  padding: 0.35rem 0;
  word-break: break-word;
}

/* En-tête détail élu */
.tres-gest-elu-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
}
.tres-gest-elu-header-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}
.tres-gest-elu-avatar--lg {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 0.88rem;
}
.tres-gest-elu-avatar--lg.tres-gest-elu-avatar--pending,
.tres-gest-elu-avatar--pending {
  background: linear-gradient(145deg, #a80000 0%, #cc0000 100%);
  box-shadow: 0 2px 8px rgba(204, 0, 0, 0.3);
}
.tres-gest-elu-header-text {
  min-width: 0;
}
.tres-gest-elu-header-text h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.25;
  color: #1a2a3a;
}
.tres-gest-elu-summary {
  margin: 0.35rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tres-gest-elu-chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e8f0f8;
  color: #1a4a7a;
  line-height: 1.3;
}
.tres-gest-elu-chip--muted {
  background: #f0f2f4;
  color: #6a7280;
  font-weight: 500;
}
.tres-gest-elu-actions .admin-submit {
  width: auto;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  white-space: nowrap;
}
.tres-gest-section {
  margin: 1.25rem 0 0;
  padding-top: 0;
}
.tres-gest-section h4 {
  margin: 0 0 0.65rem;
  padding-bottom: 0.4rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  color: #1a2a3a;
}
.tres-gest-remb-hint {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.04);
  color: var(--carbone, #222);
}
.tres-gest-remb-hint[hidden] {
  display: none !important;
}

/* Module gestion trésorerie — espacements */
.tresorerie-gestion-module .tres-main {
  padding: 0.25rem 0 1.5rem;
}

.tresorerie-gestion-module .tres-header-bar {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
}

.tres-gest-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tres-gest-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.tres-gest-nav-tab {
  padding: 0.55rem 1.1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--carbone-70, #555);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  border-radius: 6px 6px 0 0;
}

.tres-gest-nav-tab:hover {
  color: var(--carbone, #222);
  background: rgba(0, 0, 0, 0.03);
}

.tres-gest-nav-tab.is-active {
  color: var(--cgt-red, #c00);
  border-bottom-color: var(--cgt-red, #c00);
}

.tres-gest-view {
  padding-top: 0.25rem;
}

.tres-gest-elus-view {
  padding-top: 0.5rem;
}

.tres-gest-elu-view {
  padding-top: 0.25rem;
}

.tres-plafonds-panel--standalone {
  margin: 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.02);
}

.tres-plafonds-panel--standalone .tres-plafonds-title {
  margin: 0 0 1rem;
}

.tres-plafonds-panel--standalone .tres-plafonds-intro {
  margin-bottom: 1.25rem;
}

.tresorerie-gestion-module .tres-status {
  margin: 0.5rem 0 1rem;
}

.tresorerie-gestion-module .admin-submit.secondary {
  background: #fff;
  color: var(--carbone);
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: none;
}

.tres-gest-intro {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--carbone-70, #555);
}

.tres-gest-remb-hint--warn {
  background: #fff8e6;
  border: 1px solid #f0d78c;
  color: #7a5c00;
}

.tres-gest-remb-hint--ok {
  background: #ecfdf3;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.tres-gest-remb-hint--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.tres-gest-note-actions {
  white-space: nowrap;
}

.tres-gest-note-btn {
  width: auto !important;
  padding: 0.3rem 0.65rem !important;
  font-size: 0.8rem !important;
  margin: 0.15rem 0.2rem 0.15rem 0;
}

.admin-submit.is-disabled,
.admin-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.2);
}
