/* axeane-bilan.css
	Page-scoped helpers extracted from bilanComptable inline styles.
	Keep these small and opt-in; they allow removing the <style> block
	from `bilanComptable.html` without touching global shared classes.
*/

/* required field asterisk (replaces inline <span style="color:red">) */
.ax-required {
  color: #e53935;
  font-weight: 600;
}

/* PDF iframe helpers (matching inline padding used in template) */
.ax-p-16-5pct {
  padding: 16px 5% 20px 5% !important;
}
.ax-iframe-full {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

/* Note detail modal helpers (small variant) */
.ax-note-detail-modal {
  background: #fff;
  border-radius: 14px;
  width: 1000px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.ax-modal-backdrop-10000 {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ax-note-detail-header {
  background: #fff;
  padding: 20px 24px;
  border-bottom: 2px solid #e8eaf6;
}
.ax-note-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 28px 18px 28px;
}
.ax-note-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eef0f6;
}
.ax-note-footer {
  padding: 14px 24px;
  border-top: 1px solid #eef0f6;
  display: flex;
  justify-content: flex-end;
  background: #fafbfe;
}
.ax-no-margin {
  margin: 0 !important;
}

/* Modal used for the 'all notes' overview (standard size) */
.ax-bilan-notes-modal {
  background: #fff;
  border-radius: 14px;
  width: 1100px;
  max-width: 92vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.ax-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Small, page-scoped layout/utilities used by the template's inline styles */
.ax-ml-15 {
  margin-left: 15px !important;
}
.ax-mr-15 {
  margin-right: 15px !important;
}
.ax-gap-10 {
  gap: 10px !important;
}
/* smaller gap helpers */
.ax-gap-4 {
  gap: 4px !important;
}
.ax-gap-3 {
  gap: 3px !important;
}
.ax-gap-12 {
  gap: 12px !important;
}
.ax-flex-shrink-0 {
  flex-shrink: 0 !important;
}
.ax-flex-1 {
  flex: 1 1 auto !important;
}
.ax-min-h-0 {
  min-height: 0 !important;
}
.ax-overflow-hidden {
  overflow: hidden !important;
}
.ax-overflow-x-auto {
  overflow-x: auto !important;
}
.ax-justify-center {
  justify-content: center !important;
}
.ax-align-center {
  align-items: center !important;
}
.ax-justify-space-between {
  justify-content: space-between !important;
}
.ax-mx-5pct {
  margin-left: 5% !important;
  margin-right: 5% !important;
}
.ax-align-flex-end {
  align-items: flex-end !important;
}
.ax-flex-row {
  display: flex;
  flex-direction: row !important;
}
.ax-flex-column {
  display: flex;
  flex-direction: column !important;
}
.ax-flex-wrap {
  flex-wrap: wrap !important;
}
.ax-no-wrap {
  white-space: nowrap !important;
}
.ax-full-flex {
  display: flex;
  flex: 1 1 auto;
}

/* Narrow helpers for table widths used commonly in the page (table-layout: fixed) */
.ax-col-35 {
  width: 35% !important;
}
.ax-col-18 {
  width: 18% !important;
}
.ax-col-11 {
  width: 11% !important;
}

/* Utility for small icon spacing consistently used in template */
.ax-mr-8 {
  margin-right: 8px !important;
}
.ax-mr-4 {
  margin-right: 4px !important;
}

/* End of bilan helpers */

/* --------------------------------------------------------------------------
   Full Bilan styles copied from bilanComptable.html <style> block.
   These are page-scoped and reproduced here so the template can remove
   its inline <style> without losing presentation.
   -------------------------------------------------------------------------- */

.bilan-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: "Montserrat-Regular", Roboto, sans-serif;
  background: #f5f6fb;
  color: #2b2f38;
  padding: 0;
}

/* --------------------------------------------------------------------------
   ETAT RESULTAT styles moved from etatResultat.html <style> block.
   These replicate the previous inline rules so the template can remove its
   <style> block without losing presentation. Kept with `er-` prefixes.
   -------------------------------------------------------------------------- */
.er-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family: "Montserrat-Regular", Roboto, sans-serif;
  background: #f5f6fb;
  color: #2b2f38;
  padding: 0;
}

/* ================= KPI ================= */
.er-kpi-container {
  display: flex;
  gap: 10px;
  padding: 8px 5% 0 5%;
  margin: 0;
}
.er-kpi-card {
  flex: 1;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #eef0f6;
  position: relative;
  overflow: hidden;
}
.er-kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.er-kpi-card.ekpi-produits::before {
  background: #2ecc71;
}
.er-kpi-card.ekpi-charges::before {
  background: #e74c3c;
}
.er-kpi-card.ekpi-resultat-exploit::before {
  background: #3f51b5;
}
.er-kpi-card.ekpi-resultat-net::before {
  background: #8e24aa;
}
.er-kpi-card.ekpi-resultat-net.negative::before {
  background: #e74c3c;
}
.er-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.er-kpi-title {
  font-size: 12px;
  color: #6c7483;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.er-kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.er-kpi-icon.eicon-produits {
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
}
.er-kpi-icon.eicon-charges {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
}
.er-kpi-icon.eicon-exploit {
  background: rgba(63, 81, 181, 0.1);
  color: #3f51b5;
}
.er-kpi-icon.eicon-net {
  background: rgba(142, 36, 170, 0.1);
  color: #8e24aa;
}
.er-kpi-value {
  font-size: 17px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 2px;
  line-height: 1.2;
}
.er-kpi-value.positive {
  color: #2ecc71;
}
.er-kpi-value.negative {
  color: #e74c3c;
}

/* ================= TABLE ================= */
.er-table-wrapper {
  flex: 1;
  overflow: auto;
  margin: 10px 0 16px 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid #eef0f6;
}
.er-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}
.er-table thead th {
  background: #f8fafc;
  color: #475569;
  padding: 8px 12px;
  text-align: center;
  position: sticky;
  top: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 2;
  border-bottom: 2px solid var(--ax-border, #e5e7eb);
}
.er-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f6;
  font-size: 14px;
  white-space: normal;
  word-break: break-word;
}
.er-table td.montant {
  text-align: center;
}

.er-variation-cell {
  text-align: center;
  font-weight: 600;
}
.er-variation-cell .fa-arrow-up {
  color: #27ae60;
  margin-right: 4px;
}
.er-variation-cell .fa-arrow-down {
  color: #e74c3c;
  margin-right: 4px;
}
.er-variation-cell .fa-minus {
  color: #95a5a6;
  margin-right: 4px;
}
.er-variation-cell.positive {
  color: #27ae60;
}
.er-variation-cell.negative {
  color: #e74c3c;
}
.er-variation-cell.neutral {
  color: #95a5a6;
}

/* Sections PRODUITS (vert) */
.er-section-produits {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  font-weight: 700;
  font-size: 15px;
  color: #1b5e20;
  border-left: 5px solid #2e7d32;
}
.er-sub-section-produits {
  background: #e8f5e9;
  font-weight: 600;
  font-size: 14px;
  color: #2e7d32;
  border-left: 3px solid #66bb6a;
}

/* Sections CHARGES (rouge) */
.er-section-charges {
  background: linear-gradient(135deg, #fbe9e7 0%, #ffccbc 100%);
  font-weight: 700;
  font-size: 15px;
  color: #bf360c;
  border-left: 5px solid #d32f2f;
}
.er-sub-section-charges {
  background: #fbe9e7;
  font-weight: 600;
  font-size: 14px;
  color: #c62828;
  border-left: 3px solid #ef5350;
}

/* Résultats intermédiaires */
.er-resultat-intermediaire {
  background: #e8eaf6;
  font-weight: 700;
  font-size: 15px;
  color: #283593;
  border-left: 5px solid #3f51b5;
}
.er-total-row {
  background: #eef1fb;
  font-weight: 600;
}
.er-total-section {
  background: #dfe5f7;
  font-weight: 700;
  color: #2a2f3a;
}

/* Résultat net final */
.er-resultat-net-positif {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border-left: 5px solid #00e676;
}
.er-resultat-net-positif td {
  border-bottom: none;
  letter-spacing: 0.3px;
  color: #fff !important;
}
.er-resultat-net-positif .er-variation-cell {
  color: #fff !important;
}
.er-resultat-net-positif .er-variation-cell .fa {
  color: #fff !important;
}

.er-resultat-net-negatif {
  background: linear-gradient(135deg, #b71c1c 0%, #c62828 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border-left: 5px solid #ff5252;
}
.er-resultat-net-negatif td {
  border-bottom: none;
  letter-spacing: 0.3px;
  color: #fff !important;
}
.er-resultat-net-negatif .er-variation-cell {
  color: #fff !important;
}
.er-resultat-net-negatif .er-variation-cell .fa {
  color: #fff !important;
}

/* Séparateur */
.er-separator td {
  height: 6px;
  background: transparent;
  border: none;
}
.er-separator-block td {
  height: 0;
  padding: 0;
  border: none;
  position: relative;
}
.er-separator-block td::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(
    90deg,
    #2e7d32 0%,
    #66bb6a 30%,
    transparent 50%,
    #ef5350 70%,
    #c62828 100%
  );
  border-radius: 2px;
  margin: 12px 0;
}

/* Chip résultat barre */
.er-resultat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  transition: all 0.2s;
}
.er-resultat-chip.chip-benefice {
  background: #e8f5e9;
  border: 1.5px solid #66bb6a;
  color: #2e7d32;
}
.er-resultat-chip.chip-perte {
  background: #fbe9e7;
  border: 1.5px solid #ef5350;
  color: #c62828;
}
.er-resultat-chip .chip-icon {
  font-size: 14px;
}

/* Note badge */
.er-note-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ff6d00;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  cursor: pointer;
  margin-left: 8px;
  vertical-align: middle;
  transition:
    background 0.2s,
    transform 0.15s;
  box-shadow: 0 2px 6px rgba(255, 109, 0, 0.35);
  line-height: 1.4;
}
.er-note-badge:hover {
  background: #e65100;
  transform: scale(1.08);
}
.er-note-badge i {
  font-size: 13px;
}

/* ================= KPI TOGGLE ================= */
.er-kpi-toggle-bar {
  display: flex;
  align-items: center;
  padding: 6px 5%;
  margin: 0;
}

.er-kpi-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e0e4f0;
  border-radius: 8px;
  padding: 5px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #3f51b5;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  outline: none;
}

.er-kpi-toggle-btn:hover {
  background: #e8eaf6;
  border-color: #3f51b5;
  box-shadow: 0 2px 8px rgba(63, 81, 181, 0.12);
}

.er-kpi-toggle-btn .toggle-chevron {
  font-size: 12px;
  transition: transform 0.25s ease;
}
.er-kpi-toggle-btn .toggle-chevron.open {
  transform: rotate(180deg);
}

.er-kpi-collapse {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.25s ease;
  opacity: 0;
}
.er-kpi-collapse.open {
  max-height: 200px;
  opacity: 1;
}

.bilan-kpi-container {
  display: flex;
  gap: 10px;
  padding: 8px 5% 0 5%;
  margin: 0;
}

.bilan-kpi-card {
  flex: 1;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #eef0f6;
  position: relative;
  overflow: hidden;
}

.bilan-kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.bilan-kpi-card.bkpi-actifs::before {
  background: #3f51b5;
}
.bilan-kpi-card.bkpi-actifs-n1::before {
  background: #7986cb;
}
.bilan-kpi-card.bkpi-variation::before {
  background: #2ecc71;
}
.bilan-kpi-card.bkpi-variation.negative::before {
  background: #e74c3c;
}
.bilan-kpi-card.bkpi-passifs::before {
  background: #e67e22;
}
.bilan-kpi-card.bkpi-passifs-n1::before {
  background: #f39c12;
}
.bilan-kpi-card.bkpi-variation-passifs::before {
  background: #2ecc71;
}
.bilan-kpi-card.bkpi-variation-passifs.negative::before {
  background: #e74c3c;
}

.bilan-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.bilan-kpi-title {
  font-size: 11px;
  color: #6c7483;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bilan-kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.bilan-kpi-icon.bicon-actifs {
  background: rgba(63, 81, 181, 0.1);
  color: #3f51b5;
}
.bilan-kpi-icon.bicon-actifs-n1 {
  background: rgba(121, 134, 203, 0.1);
  color: #7986cb;
}
.bilan-kpi-icon.bicon-variation {
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
}
.bilan-kpi-icon.bicon-variation.negative {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
}
.bilan-kpi-icon.bicon-passifs {
  background: rgba(230, 126, 34, 0.1);
  color: #e67e22;
}
.bilan-kpi-icon.bicon-passifs-n1 {
  background: rgba(243, 156, 18, 0.1);
  color: #f39c12;
}
.bilan-kpi-icon.bicon-variation-passifs {
  background: rgba(46, 204, 113, 0.1);
  color: #2ecc71;
}
.bilan-kpi-icon.bicon-variation-passifs.negative {
  background: rgba(231, 76, 60, 0.1);
  color: #e74c3c;
}

.bilan-kpi-value {
  font-size: 17px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 2px;
  line-height: 1.2;
}

.bilan-kpi-value.positive {
  color: #2ecc71;
}
.bilan-kpi-value.negative {
  color: #e74c3c;
}

.bilan-kpi-subtitle {
  font-size: 11px;
  color: #95a5a6;
}

.bilan-kpi-toggle-bar {
  display: flex;
  align-items: center;
  padding: 6px 5%;
  margin: 0;
}

.bilan-kpi-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e0e4f0;
  border-radius: 8px;
  padding: 5px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #3f51b5;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  outline: none;
}

.bilan-kpi-toggle-btn:hover {
  background: #e8eaf6;
  border-color: #3f51b5;
  box-shadow: 0 2px 8px rgba(63, 81, 181, 0.12);
}

.bilan-kpi-toggle-btn .toggle-chevron {
  font-size: 11px;
  transition: transform 0.25s ease;
}

.bilan-kpi-toggle-btn .toggle-chevron.open {
  transform: rotate(180deg);
}

.bilan-kpi-collapse {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.25s ease;
  opacity: 0;
}

.bilan-kpi-collapse.open {
  max-height: 200px;
  opacity: 1;
}

.bilan-kpi-collapse.open {
  margin-bottom: 12px;
}

.bilan-table-wrapper {
  flex: 1;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  border: 1px solid #eef1f6;
}

.bilan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.bilan-table thead th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f3f9 100%);
  color: #475569;
  padding: 10px 16px;
  text-align: center;
  position: sticky;
  top: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 3;
  border-bottom: 2px solid var(--ax-primary, #3f51b5);
}

.bilan-table thead th:first-child {
  text-align: left;
  padding-left: 20px;
}

.bilan-table td {
  padding: 9px 16px;
  border-bottom: 1px solid #f1f3f9;
  font-size: 14px;
  white-space: normal;
  word-break: break-word;
  transition: background 0.12s ease;
}

.bilan-table tbody tr:not([class]):nth-child(even),
.bilan-table tbody tr.bilan-sous-detail:nth-child(even) {
  background: #fafbfe;
}

.bilan-table tbody tr:not([class]):hover {
  background: #f0f2fb;
}

.bilan-table td.montant {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.2px;
  padding-right: 20px;
}

.bilan-variation-cell {
  text-align: center;
  font-weight: 600;
  font-size: 13px;
}

.bilan-variation-cell .fa-arrow-up {
  color: #059669;
  margin-right: 4px;
}
.bilan-variation-cell .fa-arrow-down {
  color: #dc2626;
  margin-right: 4px;
}
.bilan-variation-cell .fa-minus {
  color: #94a3b8;
  margin-right: 4px;
}
.bilan-variation-cell.positive {
  color: #059669;
}
.bilan-variation-cell.negative {
  color: #dc2626;
}
.bilan-variation-cell.neutral {
  color: #94a3b8;
}

.bilan-section-title-actifs {
  background: linear-gradient(135deg, #e8eaf6 0%, #dde1f7 100%);
  font-weight: 700;
  font-size: 14px;
  color: #283593;
  border-left: 4px solid #3f51b5;
}
.bilan-section-title-actifs td {
  padding: 12px 20px !important;
  letter-spacing: 0.3px;
}
.bilan-sub-section-actifs {
  background: #eef1fb;
  font-weight: 600;
  font-size: 13px;
  color: #3949ab;
  border-left: 3px solid #7986cb;
}
.bilan-sub-section-actifs td {
  padding: 10px 20px !important;
}

.bilan-section-title-passifs {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe8cc 100%);
  font-weight: 700;
  font-size: 14px;
  color: #bf360c;
  border-left: 4px solid #e65100;
}
.bilan-section-title-passifs td {
  padding: 12px 20px !important;
  letter-spacing: 0.3px;
}
.bilan-sub-section-passifs {
  background: #fff8f0;
  font-weight: 600;
  font-size: 13px;
  color: #d84315;
  border-left: 3px solid #ffab40;
}
.bilan-sub-section-passifs td {
  padding: 10px 20px !important;
}

.bilan-section-title {
  background: #e5e9fb;
  font-weight: 600;
  font-size: 14px;
  color: #2f3550;
}
.bilan-sub-section {
  background: #f2f4fb;
  font-weight: 600;
  font-size: 13px;
  color: #3a4160;
}
.bilan-total-row {
  background: #eef1fb;
  font-weight: 600;
  font-size: 14px;
}
.bilan-total-row td {
  border-bottom: 1px solid #dce0f5;
}
.bilan-categorie {
  background: #fafbfe;
  font-weight: 600;
  color: #424a60;
  font-size: 13px;
  border-left: 3px solid #7986cb;
}
.bilan-sous-detail td:first-child {
  padding-left: 36px;
  font-style: italic;
  color: #64748b;
  background: #f8f9fd;
}
.bilan-total-intermediaire {
  background: #e9edf9;
  font-weight: 600;
  color: #2f3550;
  font-size: 14px;
}
.bilan-total-intermediaire td {
  border-bottom: 1px solid #c5cae9;
}
.bilan-total-section {
  background: #dfe5f7;
  font-weight: 700;
  color: #1a237e;
  font-size: 14px;
}
.bilan-total-section td {
  border-bottom: 2px solid #c5cae9;
  padding: 10px 16px;
}

.bilan-total-final-actifs {
  background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-left: 4px solid #00bcd4;
}
.bilan-total-final-actifs td {
  border-bottom: none;
  letter-spacing: 0.3px;
  color: #fff !important;
  padding: 12px 16px;
}
.bilan-total-final-actifs .bilan-variation-cell {
  color: #fff !important;
}
.bilan-total-final-actifs .bilan-variation-cell .fa {
  color: #fff !important;
}

.bilan-total-final-passifs {
  background: linear-gradient(135deg, #bf360c 0%, #8d2608 100%);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-left: 4px solid #ffab40;
}
.bilan-total-final-passifs td {
  border-bottom: none;
  letter-spacing: 0.3px;
  color: #fff !important;
  padding: 12px 16px;
}
.bilan-total-final-passifs .bilan-variation-cell {
  color: #fff !important;
}
.bilan-total-final-passifs .bilan-variation-cell .fa {
  color: #fff !important;
}

.bilan-total-final {
  background: #3f51b5;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.bilan-total-final td {
  border-bottom: none;
  color: #fff !important;
}
.bilan-total-final .bilan-variation-cell {
  color: #fff !important;
}
.bilan-total-final .bilan-variation-cell .fa {
  color: #fff !important;
}

.bilan-separator td {
  height: 6px;
  background: transparent;
  border: none;
}
.bilan-separator-block td {
  height: 0;
  padding: 0;
  border: none;
  position: relative;
}

/* --------------------------------------------------------------------------
   FLUX TRÉSORERIE AUTORISÉ styles moved from
   app/views/comptageneral/etatFinancier/etatFluxTresoAutoriseTable.html
   -------------------------------------------------------------------------- */
.ftreso-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background: #f7f8fc;
  color: #1e293b;
  padding: 0;
}

/* KPI CARDS */
.ftreso-kpi-strip {
  display: flex;
  gap: 10px;
  padding: 8px 4% 0 4%;
}
.ftreso-kpi {
  flex: 1;
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #eef1f6;
  position: relative;
  overflow: hidden;
  transition:
    box-shadow 0.25s ease,
    transform 0.18s ease;
}
.ftreso-kpi:hover {
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}
.ftreso-kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.ftreso-kpi.kpi-exploit::before {
  background: #3f51b5;
}
.ftreso-kpi.kpi-invest::before {
  background: #0891b2;
}
.ftreso-kpi.kpi-finan::before {
  background: #7c3aed;
}
.ftreso-kpi.kpi-variation::before {
  background: #059669;
}
.ftreso-kpi.kpi-variation.kpi-neg::before {
  background: #dc2626;
}
.ftreso-kpi.kpi-solde::before {
  background: #334155;
}

.ftreso-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.ftreso-kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: #6c7483;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
}
.ftreso-kpi-badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.ftreso-kpi-badge.badge-exploit {
  background: #eef0fb;
  color: #3f51b5;
}
.ftreso-kpi-badge.badge-invest {
  background: #ecfeff;
  color: #0891b2;
}
.ftreso-kpi-badge.badge-finan {
  background: #f3f0ff;
  color: #7c3aed;
}
.ftreso-kpi-badge.badge-variation {
  background: #ecfdf5;
  color: #059669;
}
.ftreso-kpi-badge.badge-variation.kpi-neg {
  background: #fef2f2;
  color: #dc2626;
}
.ftreso-kpi-badge.badge-solde {
  background: #f1f5f9;
  color: #334155;
}

.ftreso-kpi-amount {
  font-size: 17px;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1.2;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}
.ftreso-kpi-amount.val-pos {
  color: #059669;
}
.ftreso-kpi-amount.val-neg {
  color: #dc2626;
}

.ftreso-kpi-sub {
  font-size: 12px;
  color: #95a5a6;
  margin-top: 0;
}

/* TABLE WRAPPER */
.ftreso-table-area {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 8px 0 10px 0;
}
.ftreso-table-card {
  flex: 1;
  background: #ffffff;
  border-radius: 12px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.03);
  border: 1px solid #eef1f6;
  overflow: auto;
}

/* TABLE */
.ftreso-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}
.ftreso-tbl thead th {
  background: #f8fafc;
  color: #475569;
  padding: 8px 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 3;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--ax-border, #e5e7eb);
}
.ftreso-tbl thead th:first-child {
  text-align: left;
  padding-left: 24px;
}
.ftreso-tbl td {
  padding: 11px 20px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  vertical-align: middle;
}
.ftreso-tbl td.amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.2px;
}

/* SECTION HEADERS */
.ftreso-section-exploit {
  background: #f8faff;
  border-left: 4px solid #3f51b5;
}
.ftreso-section-exploit td {
  font-weight: 700;
  font-size: 15px;
  color: #3f51b5;
  padding: 14px 20px !important;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #dce0f5;
}

.ftreso-section-invest {
  background: #f0fdfa;
  border-left: 4px solid #0891b2;
}
.ftreso-section-invest td {
  font-weight: 700;
  font-size: 15px;
  color: #0e7490;
  padding: 14px 20px !important;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #ccfbf1;
}

.ftreso-section-finan {
  background: #faf5ff;
  border-left: 4px solid #7c3aed;
}
.ftreso-section-finan td {
  font-weight: 700;
  font-size: 15px;
  color: #6d28d9;
  padding: 14px 20px !important;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #e9d5ff;
}

.ftreso-section-synth {
  background: #f0fdf4;
  border-left: 4px solid #16a34a;
}
.ftreso-section-synth td {
  font-weight: 700;
  font-size: 15px;
  color: #15803d;
  padding: 14px 20px !important;
  letter-spacing: 0.3px;
  border-bottom: 1px solid #bbf7d0;
}

/* SOUS-TITRES */
.ftreso-sub-row {
  background: #fafbfe;
}
.ftreso-sub-row td {
  font-weight: 600;
  font-size: 14px;
  color: #64748b;
  font-style: italic;
  padding: 8px 20px 8px 40px !important;
  border-bottom: 1px solid #f1f5f9;
}

/* DETAIL ROWS */
.ftreso-detail-row td:first-child {
  padding-left: 48px !important;
  color: #475569;
}
.ftreso-detail-row:nth-child(even) {
  background: #fafbfe;
}
.ftreso-detail-row:nth-child(odd) {
  background: #ffffff;
}
.ftreso-detail-row:hover {
  background: #f1f5f9;
}

/* TOTALS */
.ftreso-total-exploit {
  background: linear-gradient(135deg, #eef0fb 0%, #e8eaf6 100%);
  border-left: 4px solid #3f51b5;
}
.ftreso-total-exploit td {
  font-weight: 700;
  color: #283593;
  padding: 12px 20px !important;
  border-bottom: 2px solid #c5cae9;
  font-size: 16px;
}

.ftreso-total-invest {
  background: linear-gradient(135deg, #e0f7fa 0%, #ccfbf1 100%);
  border-left: 4px solid #0891b2;
}
.ftreso-total-invest td {
  font-weight: 700;
  color: #155e75;
  padding: 12px 20px !important;
  border-bottom: 2px solid #a5f3fc;
  font-size: 16px;
}

.ftreso-total-finan {
  background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
  border-left: 4px solid #7c3aed;
}
.ftreso-total-finan td {
  font-weight: 700;
  color: #5b21b6;
  padding: 12px 20px !important;
  border-bottom: 2px solid #c4b5fd;
  font-size: 16px;
}

/* SYNTHESE */
.ftreso-row-variation {
  background: #f0fdf4;
}
.ftreso-row-variation td {
  font-weight: 700;
  color: #166534;
  padding: 12px 20px 12px 40px !important;
  font-size: 16px;
}

.ftreso-row-treso-detail {
  background: #f8fafc;
}
.ftreso-row-treso-detail td:first-child {
  padding-left: 40px !important;
  font-weight: 600;
  color: #64748b;
}

.ftreso-row-grand-total {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}
.ftreso-row-grand-total td {
  color: #ffffff !important;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 20px !important;
  border-bottom: none;
  letter-spacing: 0.2px;
}

/* VARIATION BADGE */
.ftreso-var-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.ftreso-var-badge.var-up {
  background: #ecfdf5;
  color: #059669;
}
.ftreso-var-badge.var-down {
  background: #fef2f2;
  color: #dc2626;
}
.ftreso-var-badge.var-flat {
  background: #f1f5f9;
  color: #94a3b8;
}

@keyframes nxSpinRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* KPI TOGGLE */
.ftreso-kpi-toggle-bar {
  display: flex;
  align-items: center;
  padding: 6px 4%;
  margin: 0;
}

.ftreso-kpi-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e0e4f0;
  border-radius: 8px;
  padding: 5px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #3f51b5;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  outline: none;
}

.ftreso-kpi-toggle-btn:hover {
  background: #e8eaf6;
  border-color: #3f51b5;
  box-shadow: 0 2px 8px rgba(63, 81, 181, 0.12);
}

.ftreso-kpi-toggle-btn .toggle-chevron {
  font-size: 12px;
  transition: transform 0.25s ease;
}

.ftreso-kpi-toggle-btn .toggle-chevron.open {
  transform: rotate(180deg);
}

.ftreso-kpi-collapse {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    opacity 0.25s ease;
  opacity: 0;
}

.ftreso-kpi-collapse.open {
  max-height: 200px;
  opacity: 1;
}

.bilan-separator-block td::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(
    90deg,
    #3f51b5 0%,
    #7986cb 30%,
    transparent 50%,
    #ffab40 70%,
    #e65100 100%
  );
  border-radius: 2px;
  margin: 12px 0;
}

.bilan-messages {
  padding: 0 5%;
  margin-top: 8px;
}
.bilan-messages label {
  display: block;
  color: red;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}

.bilan-equilibre-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  transition: all 0.2s;
}
.bilan-equilibre-chip.chip-ok {
  background: #e8f5e9;
  border: 1.5px solid #66bb6a;
  color: #2e7d32;
}
.bilan-equilibre-chip.chip-ko {
  background: #fbe9e7;
  border: 1.5px solid #ef5350;
  color: #c62828;
}
.bilan-equilibre-chip .chip-icon {
  font-size: 14px;
}
.bilan-equilibre-chip .chip-ecart {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
  margin-left: 4px;
}

.bilan-note-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ff6d00;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  cursor: pointer;
  margin-left: 8px;
  vertical-align: middle;
  transition:
    background 0.2s,
    transform 0.15s;
  box-shadow: 0 2px 6px rgba(255, 109, 0, 0.35);
  line-height: 1.4;
}
.bilan-note-badge:hover {
  background: #e65100;
  transform: scale(1.08);
}
.bilan-note-badge i {
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   High-specificity, page-scoped overrides for Bilan (narrow scope)
   - Uses attribute selector [ng-controller="BilanComptableController"] to
     limit impact to the Bilan page and increase specificity.
   - Kept minimal and targeted to iframe + table/layout rules.
   -------------------------------------------------------------------------- */

/* ── Years bar context (exercice courant quand pas sélectionné) ── */
.bilan-container .ax-years-inline button.yr-context {
  background: var(--ax-primary-light, #C5CAE9);
  color: var(--ax-primary, rgb(63, 81, 181));
  border: 2px solid var(--ax-primary, rgb(63, 81, 181));
}

/* ── md-switch label text — force primary color ── */
.bilan-container .ax-toolbar md-switch .md-label {
  color: var(--ax-primary, rgb(63, 81, 181)) !important;
  font-weight: 600 !important;
}

/* ── Filter section overflow for dropdowns ── */
.bilan-container .ax-filter-section.open {
  overflow: visible !important;
}
.bilan-container .ax-filter-section .form-group,
.bilan-container .ax-filter-section .row {
  overflow: visible !important;
}

.bilan-container[ng-controller="BilanComptableController"] {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

.bilan-container[ng-controller="BilanComptableController"] > .ax-table-wrapper,
.bilan-container[ng-controller="BilanComptableController"] .ax-table-wrapper {
  flex: 1 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.bilan-container[ng-controller="BilanComptableController"]
  .bilan-table-wrapper {
  flex: 1 !important;
  overflow: auto !important;
  background: #fff !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03) !important;
  border: 1px solid #eef1f6 !important;
  min-height: 0 !important;
}

.bilan-container[ng-controller="BilanComptableController"] .bilan-table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 14px !important;
  table-layout: fixed !important;
}

.bilan-container[ng-controller="BilanComptableController"]
  .bilan-table
  thead
  th {
  position: sticky !important;
  top: 0 !important;
  z-index: 3 !important;
  text-align: center !important;
}

.bilan-container[ng-controller="BilanComptableController"] .bilan-table td,
.bilan-container[ng-controller="BilanComptableController"] .bilan-table th {
  padding: 9px 16px !important;
  font-size: 14px !important;
  white-space: normal !important;
  word-break: break-word !important;
}

.bilan-container[ng-controller="BilanComptableController"]
  .bilan-variation-cell {
  text-align: center !important;
  font-weight: 600 !important;
  font-size: 13px !important;
}

/* PDF iframe sizing: target only iframes inside the Bilan PDF panel */
.bilan-container[ng-controller="BilanComptableController"]
  [ng-show="modeBilan === 'PDF'"]
  iframe,
.bilan-container[ng-controller="BilanComptableController"] iframe[ng-src] {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06) !important;
}

.bilan-container[ng-controller="BilanComptableController"] .ax-filter-section,
.bilan-container[ng-controller="BilanComptableController"] .ax-table-zone,
.bilan-container[ng-controller="BilanComptableController"]
  .ax-table-body-scroll {
  min-height: 0 !important;
}

.bilan-container[ng-controller="BilanComptableController"]
  .bilan-table
  td.montant,
.bilan-container[ng-controller="BilanComptableController"]
  .bilan-table
  td.bilan-variation-cell {
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
}
