/* ==========================================================================
   Demo viva "prospects-board" (hero de /crm): tablero de Prospectos por etapas.
   Markup: resources/views/web/partials/anim/prospects-board.blade.php
   Estados en la raíz:
     data-new    entra un prospecto en «Nuevo» · data-drag  tarjeta levantada en «Propuesta»
     data-drop   tarjeta sobre «Ganado» · data-won  tarjeta soltada (conteos cambian)
     data-toast  aviso de seguimientos · data-cursor  puntero visible
   Columnas de 120 px + 8 de separación; tarjetas de 62 px + 6: la tarjeta que se arrastra
   va de (384, 34) a (512, 102) dentro del tablero. El panel no tiene modo oscuro: solo halo y sombra.
   ========================================================================== */

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

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

/* ---------- Ventana ---------- */
.lla-cr__win { position: absolute; left: 0; top: 10px; width: 680px; height: 460px; overflow: hidden; border: 1px solid var(--lla-border); border-radius: 14px; background: #f5f7fb; box-shadow: var(--lla-shadow); }
.lla-cr__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-cr__dots { display: flex; gap: 5px; }
.lla-cr__dots i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.lla-cr__dots i:nth-child(2) { background: #febc2e; }
.lla-cr__dots i:nth-child(3) { background: #28c840; }
.lla-cr__url { display: flex; align-items: center; gap: 6px; flex: 1; max-width: 360px; height: 20px; margin-inline: auto; padding: 0 10px; border-radius: 6px; background: #fff; color: var(--lla-muted); font-size: 11px; white-space: nowrap; overflow: hidden; }
.lla-cr__url .bi { color: #198754; font-size: 9px; }
.lla-cr__panel { position: relative; height: calc(100% - 32px); padding: 10px 12px; }

.lla-cr__head { display: flex; align-items: center; gap: 7px; height: 30px; margin-bottom: 10px; font-size: 10.5px; }
.lla-cr__head > b { margin-right: auto; font-size: 15px; font-weight: 700; }
.lla-cr__search { display: flex; align-items: center; gap: 6px; width: 140px; height: 26px; padding: 0 8px; border: 1px solid #dfe3ea; border-radius: 6px; background: #fff; color: #97a4af; }
.lla-cr__sel { position: relative; height: 26px; padding: 5px 20px 0 8px; border: 1px solid #dfe3ea; border-radius: 6px; background: #fff; white-space: nowrap; }
.lla-cr__sel::after { content: ""; position: absolute; right: 8px; top: 9px; width: 5px; height: 5px; border-right: 1.5px solid #677788; border-bottom: 1.5px solid #677788; transform: rotate(45deg); }
.lla-cr__add { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 6px; background: var(--lla-primary); color: #fff; font-weight: 600; white-space: nowrap; }

/* ---------- Tablero ---------- */
.lla-cr__board { position: relative; display: grid; grid-template-columns: repeat(5, 120px); gap: 8px; width: 632px; margin-inline: auto; }
.lla-cr__col { display: flex; flex-direction: column; gap: 6px; min-height: 360px; padding: 0; border-radius: 10px; }
.lla-cr__colhead { display: flex; align-items: center; justify-content: space-between; height: 28px; padding: 0 8px; border-radius: 7px; background: #e9edf5; font-size: 10.5px; }
.lla-cr__colhead b { font-weight: 700; }
.lla-cr__col--won .lla-cr__colhead { background: rgba(22, 163, 74, .14); color: #15803d; }
.lla-cr__n { display: inline-grid; min-width: 18px; padding: 1px 6px; border-radius: 999px; background: #fff; font-size: 9.5px; font-weight: 700; text-align: center; }
.lla-cr__n em { grid-area: 1 / 1; }
.lla-cr__n em + em { visibility: hidden; }
.lla-cr[data-new] .lla-cr__col--new .lla-cr__n em:first-child,
.lla-cr[data-won] .lla-cr__n--out em:first-child,
.lla-cr[data-won] .lla-cr__n--in em:first-child { visibility: hidden; }
.lla-cr[data-new] .lla-cr__col--new .lla-cr__n em + em,
.lla-cr[data-won] .lla-cr__n--out em + em,
.lla-cr[data-won] .lla-cr__n--in em + em { visibility: visible; }

.lla-cr__card { display: flex; flex-direction: column; gap: 2px; height: 62px; padding: 7px 8px; border: 1px solid var(--lla-border); border-radius: 8px; background: #fff; font-size: 9.5px; box-shadow: 0 1px 2px rgba(22, 34, 58, .05); }
.lla-cr__card > b { overflow: hidden; font-size: 10.5px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.lla-cr__card > small { overflow: hidden; color: var(--lla-muted); white-space: nowrap; text-overflow: ellipsis; }
.lla-cr__row { display: flex; align-items: center; gap: 4px; margin-top: auto; }
.lla-cr__row em { margin-right: auto; font-weight: 700; }
.lla-cr__fu { display: inline-flex; align-items: center; gap: 2px; padding: 1px 4px; border-radius: 4px; background: rgba(55, 125, 255, .1); color: var(--lla-primary); font-size: 8.5px; font-weight: 600; }
.lla-cr__fu--late { background: rgba(220, 53, 69, .1); color: #dc3545; }
.lla-cr__av { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #c7d7fe; color: #1e3a8a; font-size: 7.5px; font-weight: 700; }

/* Prospecto que entra desde un formulario */
.lla-cr__card--new { display: none; border-color: rgba(55, 125, 255, .45); }
.lla-cr[data-new] .lla-cr__card--new { display: flex; animation: lla-cr-in .55s var(--lla-ease) both; }

/* Arrastre de Propuesta a Ganado */
.lla-cr__card--src { transition: opacity .25s var(--lla-ease); }
.lla-cr[data-drag] .lla-cr__card--src { opacity: .35; border-style: dashed; box-shadow: none; }
.lla-cr[data-won] [data-ref="src"] { display: none; }
.lla-cr__card--dst { visibility: hidden; }
.lla-cr[data-won] .lla-cr__card--dst { visibility: visible; border-color: rgba(22, 163, 74, .55); animation: lla-cr-won 1.2s var(--lla-ease) both; }
.lla-cr__ghost { position: absolute; left: 0; top: 0; z-index: 3; width: 120px; opacity: 0; pointer-events: none; transform: translate(384px, 34px); transition: transform .6s var(--lla-ease), opacity .2s var(--lla-ease), box-shadow .2s; }
.lla-cr[data-drag] .lla-cr__ghost { opacity: 1; transform: translate(384px, 30px) rotate(-3deg) scale(1.04); box-shadow: 0 14px 28px -10px rgba(22, 34, 58, .45); }
.lla-cr[data-drag][data-drop] .lla-cr__ghost { transform: translate(512px, 98px) rotate(-2deg) scale(1.04); }
.lla-cr[data-won] .lla-cr__ghost { opacity: 0; transition: none; }

/* ---------- Aviso de seguimientos ---------- */
.lla-cr__toast { position: absolute; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 10px; width: 250px; padding: 10px 12px; border: 1px solid var(--lla-border); border-radius: 12px; background: #fff; box-shadow: 0 18px 36px -14px rgba(22, 34, 58, .4); font-size: 10px; opacity: 0; transform: translateY(12px); transition: opacity .4s var(--lla-ease), transform .45s var(--lla-ease); }
.lla-cr[data-toast] .lla-cr__toast { opacity: 1; transform: none; }
.lla-cr__toast > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.lla-cr__toast b { font-size: 11.5px; font-weight: 700; }
.lla-cr__toast small { color: var(--lla-muted); }
.lla-cr__toast-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #7aa7ff, #377dff); color: #fff; font-size: 14px; }

/* ---------- Puntero ---------- */
.lla-cr__cursor { position: absolute; top: 0; left: 0; z-index: 10; width: 22px; height: 22px; pointer-events: none; opacity: 0; transform: translate(520px, 450px); transition: transform .6s var(--lla-ease), opacity .3s var(--lla-ease); }
.lla-cr[data-cursor] .lla-cr__cursor { opacity: 1; }
.lla-cr__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-cr__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-cr__cursor.is-tap svg { animation: lla-cr-press .3s var(--lla-ease); }
.lla-cr__cursor.is-tap .lla-cr__cursor-ring { animation: lla-cr-ripple .5s var(--lla-ease); }

@keyframes lla-cr-in { from { opacity: 0; transform: translateY(-8px); background: rgba(55, 125, 255, .1); } to { opacity: 1; transform: none; background: #fff; } }
@keyframes lla-cr-won { 0% { background: rgba(22, 163, 74, .16); } 100% { background: #fff; } }
@keyframes lla-cr-press { 50% { transform: scale(.85); } }
@keyframes lla-cr-ripple {
  0% { opacity: .9; transform: scale(.4); }
  100% { opacity: 0; transform: scale(1.4); }
}
