/* =============================================================================
   AURYVO Business — graphique des entrées et sorties d'argent (js/graphiques.js).
   Vert : l'argent qui entre. Rouge : l'argent qui sort (et un solde négatif). Échelle semaine, mois ou année ; plein écran.
   ============================================================================= */
.ga { --ga-e: var(--green); --ga-s: var(--danger); padding: 18px 18px 8px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--panel-line); box-shadow: var(--sh-card); }
.ga-tete { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.ga-totaux { display: flex; gap: 22px; flex-wrap: wrap; }
.ga-t { display: flex; flex-direction: column; gap: 2px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.ga-t i { display: none; }
.ga-t b { font: 500 22px/1.1 var(--display); letter-spacing: -.02em; color: var(--ink); }
.ga-t.e b { color: var(--ga-e); }
.ga-t.s b { color: var(--ga-s); }
.ga-t.n b.neg { color: var(--danger); }
.ga-erreur { font-size: 13px; color: var(--ink-3); }
.ga-outils { display: flex; align-items: center; gap: 8px; }
.ga-echelle { display: inline-flex; padding: 3px; border-radius: var(--pill); background: var(--card-3); }
.ga-echelle button { height: 32px; padding: 0 14px; border: 0; border-radius: var(--pill); background: none; color: var(--ink-2); font: 600 13px var(--text); cursor: pointer; transition: background .2s, color .2s; }
.ga-echelle button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 24, 40, .14), 0 0 0 .5px rgba(16, 24, 40, .05); }
:root:not([data-theme="light"]) .ga-echelle button.on { background: #3A3B42; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.ga-plein { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border: 0; border-radius: var(--pill); background: var(--card-2); color: var(--ink);
  font: 600 13px var(--text); cursor: pointer; transition: background .2s, transform .3s var(--spring); }
.ga-plein:hover { background: var(--card-3); }
.ga-plein:active { transform: scale(.95); }
.ga-plein svg { width: 17px; height: 17px; }
.ga-zone { position: relative; transition: opacity .2s; }
.ga-zone.charge { opacity: .45; }
.ga-svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; outline: none; -webkit-user-select: none; user-select: none; }
.ga-svg:focus-visible { box-shadow: 0 0 0 2px var(--ink); border-radius: 12px; }
.ga-grille line { stroke: var(--line); }
.ga-grille line.zero { stroke: var(--line-2); }
.ga-grille text, .ga-axe text { fill: var(--ink-3); font: 600 11.5px var(--text); font-variant-numeric: tabular-nums; }
.ga-colonne { fill: var(--card-2); pointer-events: none; transition: x .15s var(--ease-out), opacity .15s; }
.ga-barres rect.entrees { fill: var(--ga-e); }
.ga-barres rect.sorties { fill: var(--ga-s); }
.ga-barres.anime rect { transform-box: fill-box; transform-origin: bottom; animation: ga-monte .6s var(--ease-out) both; animation-delay: var(--d); }
@keyframes ga-monte { from { transform: scaleY(0); } }
.ga-bulle { position: absolute; top: 6px; z-index: 5; min-width: 210px; padding: 12px 14px; border-radius: 14px; pointer-events: none; font-size: 13px;
  background: var(--card); box-shadow: 0 0 0 1px var(--line-2), 0 18px 40px -18px rgba(0, 0, 0, .45); }
.ga-b-titre { font-weight: 700; margin-bottom: 8px; }
.ga-b-l { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; padding: 2px 0; color: var(--ink-2); }
.ga-b-l i { width: 10px; height: 10px; border-radius: 3px; }
.ga-b-l.e i { background: var(--ga-e); } .ga-b-l.s i { background: var(--ga-s); }
.ga-b-l b { color: var(--ink); font-weight: 700; }
.ga-b-l.e b { color: var(--ga-e); } .ga-b-l.s b { color: var(--ga-s); }
.ga-b-l.n { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line); grid-template-columns: 1fr auto; }
.ga-b-l.n b.neg { color: var(--danger); }

/* plein écran : le graphique prend tout l'écran, au-dessus de la navigation */
.ga.plein { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; margin: 0; border: 0; border-radius: 0; box-shadow: none;
  padding: calc(env(safe-area-inset-top) + 18px) calc(env(safe-area-inset-right) + 22px) calc(env(safe-area-inset-bottom) + 14px) calc(env(safe-area-inset-left) + 22px);
  background: var(--bg); animation: ga-ouvre .3s var(--ease-out) both; }
.ga.plein .ga-zone { flex: 1; min-height: 0; }
.ga.plein .ga-t b { font-size: 28px; }
html.ga-plein-ecran, html.ga-plein-ecran body { overflow: hidden; }
@keyframes ga-ouvre { from { opacity: 0; transform: scale(.98); } }

.bq-graphe { margin: -6px 0 14px; }

@media (max-width: 820px) {
  .ga { padding: 14px 12px 6px; }
  .ga-totaux { gap: 16px; width: 100%; justify-content: space-between; }
  .ga-t b { font-size: 17px; }
  .ga-outils { width: 100%; justify-content: space-between; }
  .ga-plein span { display: none; }
  .ga-plein { width: 38px; padding: 0; justify-content: center; }
  .ga-bulle { min-width: 180px; }
}
@media (prefers-reduced-motion: reduce) { .ga-barres.anime rect, .ga.plein { animation: none; } }
.cc-argent { margin: 4px 0 26px; }
.pv-courbe .ga:not(.plein) { padding: 0; border: 0; box-shadow: none; background: none; }
