/* ==========================================================================
   Demo viva "finance-report" (hero de /reportes): Finanzas → Resumen con las
   4 tarjetas que cuentan hacia arriba y saldos bancarios; luego Proyección con
   la gráfica de saldo que se dibuja.
   Markup: resources/views/web/partials/anim/finance-report.blade.php
   Estados en la raíz:
     data-tab     summary | proj     data-bal   saldos visibles
     data-draw    gráfica dibujada    data-cursor puntero visible
   El panel no tiene modo oscuro: solo halo y sombra.
   ========================================================================== */

/* ---------- Paleta ---------- */
.lla-fr {
  --lla-surface: #f8f9fa;
  --lla-text: #1e2022;
  --lla-muted: #677788;
  --lla-border: #e7eaf3;
  --lla-primary: #377dff;
  --lla-shadow: 0 32px 64px -24px rgba(22, 34, 58, .38), 0 10px 24px -10px rgba(22, 34, 58, .18);
  --lla-glow-a: rgba(0, 123, 255, .16);
  --lla-glow-b: rgba(56, 239, 125, .12);
  --lla-cursor-fill: #1e2022;
  --lla-cursor-edge: #ffffff;
  --lla-cursor-ring: rgba(55, 125, 255, .55);
}
html[data-theme="dark"] .lla-fr {
  --lla-glow-a: rgba(77, 159, 255, .14);
  --lla-glow-b: rgba(56, 239, 125, .1);
  --lla-shadow: 0 32px 64px -24px rgba(0, 0, 0, .8), 0 10px 24px -10px rgba(0, 0, 0, .55);
}

/* ---------- Escena ---------- */
.lla-fr { max-width: 700px; margin-inline: auto; color: var(--lla-text); line-height: 1.3; text-align: left; }
.lla .lla-fr__stage { --lla-w: 700; --lla-h: 470; }
.lla-fr :where(b, small, strong, em, i, p) { margin: 0; font-size: inherit; font-style: normal; font-weight: inherit; color: inherit; }
.lla-fr .bi::before { vertical-align: 0; }
.lla-fr__glow { position: absolute; border-radius: 50%; pointer-events: none; }
.lla-fr__glow--a { left: -30px; top: 20px; width: 460px; height: 460px; background: radial-gradient(closest-side, var(--lla-glow-a), transparent); }
.lla-fr__glow--b { left: 340px; top: 40px; width: 380px; height: 420px; background: radial-gradient(closest-side, var(--lla-glow-b), transparent); }

/* ---------- Ventana ---------- */
.lla-fr__win { position: absolute; left: 0; top: 10px; width: 700px; height: 450px; overflow: hidden; border: 1px solid var(--lla-border); border-radius: 14px; background: #f5f7fb; box-shadow: var(--lla-shadow); }
.lla-fr__chrome { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 12px; border-bottom: 1px solid var(--lla-border); background: var(--lla-surface); }
.lla-fr__dots { display: flex; gap: 5px; }
.lla-fr__dots i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.lla-fr__dots i:nth-child(2) { background: #febc2e; }
.lla-fr__dots i:nth-child(3) { background: #28c840; }
.lla-fr__url { display: flex; align-items: center; gap: 6px; flex: 1; max-width: 340px; height: 20px; margin-inline: auto; padding: 0 10px; border-radius: 6px; background: #fff; color: var(--lla-muted); font-size: 11px; }
.lla-fr__url .bi { color: #198754; font-size: 9px; }
.lla-fr__panel { height: calc(100% - 32px); padding: 12px; }
.lla-fr__card { position: relative; height: 100%; overflow: hidden; border: 1px solid var(--lla-border); border-radius: 12px; background: #fff; }

.lla-fr__pills { display: flex; gap: 4px; padding: 7px; }
.lla-fr__pills span { display: flex; flex: 1; align-items: center; justify-content: center; gap: 4px; padding: 6px 2px; border-radius: 7px; color: var(--lla-muted); font-size: 10.5px; font-weight: 600; white-space: nowrap; transition: background-color .25s, color .25s; }
.lla-fr__pills .bi { font-size: 10px; }
.lla-fr[data-tab="summary"] .lla-fr__p-sum, .lla-fr[data-tab="proj"] .lla-fr__p-proj { background: var(--lla-primary); color: #fff; }
.lla-fr__pills .is-pressed { transform: scale(.95); }

.lla-fr__view { position: absolute; left: 0; right: 0; top: 44px; bottom: 0; padding: 4px 14px 12px; opacity: 0; transition: opacity .35s var(--lla-ease); }
.lla-fr[data-tab="summary"] .lla-fr__view--summary, .lla-fr[data-tab="proj"] .lla-fr__view--proj { opacity: 1; }

.lla-fr__period { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 10px; padding: 8px 10px; border: 1px solid var(--lla-border); border-radius: 8px; background: var(--lla-surface); }
.lla-fr__period > span { display: flex; flex-direction: column; gap: 3px; }
.lla-fr__period small { color: var(--lla-muted); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.lla-fr__period em { width: 170px; padding: 5px 9px; border: 1px solid #e7eaf3; border-radius: 6px; background: #fff; font-size: 11.5px; }
.lla-fr__period > .bi { padding: 5px 9px; border: 1px solid #e7eaf3; border-radius: 6px; background: #fff; color: var(--lla-primary); font-size: 12px; }

.lla-fr__kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.lla-fr__kpis--3 { grid-template-columns: repeat(3, 1fr); }
.lla-fr__k { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 11px; border-radius: 13px; color: #fff; box-shadow: 0 4px 10px -4px rgba(22, 34, 58, .25); }
.lla-fr__k--sales { background: linear-gradient(135deg, #007bff 0%, #00d2ff 100%); }
.lla-fr__k--exp { background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%); }
.lla-fr__k--net { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.lla-fr__k--profit { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }
.lla-fr__k small { color: rgba(255, 255, 255, .7); font-size: 8.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.lla-fr__k b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lla-fr__k > .bi { position: absolute; right: 9px; top: 9px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #007bff; font-size: 11px; }
.lla-fr__k--exp > .bi { color: #ff416c; }
.lla-fr__k--net > .bi { color: #11998e; }
.lla-fr__k--profit > .bi { color: #a18cd1; }
.lla-fr__k > span { display: flex; justify-content: space-between; font-size: 9.5px; }
.lla-fr__k > span:nth-of-type(1) { margin-top: 5px; padding-top: 5px; border-top: 1px solid rgba(255, 255, 255, .25); }

.lla-fr__h { margin: 12px 0 6px !important; font-size: 12.5px !important; font-weight: 600; }
.lla-fr__table { width: 100%; border-collapse: collapse; font-size: 11.5px; opacity: 0; transform: translateY(6px); transition: opacity .4s var(--lla-ease), transform .4s var(--lla-ease); }
.lla-fr[data-bal] .lla-fr__table { opacity: 1; transform: none; }
.lla-fr__table th { padding: 6px 8px; border-bottom: 2px solid var(--lla-border); color: var(--lla-muted); font-size: 10px; font-weight: 600; text-align: left; }
.lla-fr__table td { padding: 6px 8px; border-bottom: 1px solid #f1f3f7; }
.lla-fr__table :is(th, td):last-child { text-align: right; }
.lla-fr__total td { border-bottom: 0; font-weight: 700; }
.lla-fr__total td:first-child { text-align: right; }

.lla-fr__chart { margin-top: 4px; }
.lla-fr__chart svg { display: block; width: 100%; height: 190px; }
.lla-fr__grid line { stroke: #eef0f4; stroke-width: 1; }
.lla-fr__line { fill: none; stroke: #377dff; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; vector-effect: non-scaling-stroke; }
.lla-fr__area { fill: rgba(55, 125, 255, .1); opacity: 0; transition: opacity .6s .9s; }
.lla-fr[data-draw] .lla-fr__line { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--lla-ease); }
.lla-fr[data-draw] .lla-fr__area { opacity: 1; }
.lla-fr__legend { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 4px; color: var(--lla-muted); font-size: 10.5px; }
.lla-fr__legend i { width: 18px; height: 3px; border-radius: 2px; background: #377dff; }

/* ---------- Puntero ---------- */
.lla-fr__cursor { position: absolute; top: 0; left: 0; z-index: 10; width: 22px; height: 22px; pointer-events: none; opacity: 0; transform: translate(560px, 440px); transition: transform .6s var(--lla-ease), opacity .3s var(--lla-ease); }
.lla-fr[data-cursor] .lla-fr__cursor { opacity: 1; }
.lla-fr__cursor svg { position: relative; display: block; width: 22px; height: 22px; fill: var(--lla-cursor-fill); stroke: var(--lla-cursor-edge); stroke-width: 1.4; stroke-linejoin: round; }
.lla-fr__cursor-ring { position: absolute; left: -10px; top: -12px; width: 28px; height: 28px; border: 2px solid var(--lla-cursor-ring); border-radius: 50%; opacity: 0; }
.lla-fr__cursor.is-tap svg { animation: lla-fr-press .3s var(--lla-ease); }
.lla-fr__cursor.is-tap .lla-fr__cursor-ring { animation: lla-fr-ripple .5s var(--lla-ease); }

@keyframes lla-fr-press { 50% { transform: scale(.85); } }
@keyframes lla-fr-ripple {
  0% { opacity: .9; transform: scale(.4); }
  100% { opacity: 0; transform: scale(1.4); }
}
