/* ERP animation kit: stage, camera, cursor. The ERP look itself comes ONLY from erp.css. */

/* Ancestor shells around each part: they only exist so the ERP selectors still match. */
.kit-anc { display: block !important; position: static !important; margin: 0 !important; padding: 0 !important; width: auto !important; height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important; border: 0 !important; box-shadow: none !important; background: transparent !important; transform: none !important; inset: auto !important; grid-template-columns: none !important; max-width: none !important; animation: none !important; }
/* The tickets card is sized to the window in the ERP; inside a card it takes its content height. */
.kit-card .tkd-card { height: auto !important; max-height: none !important; }
.kit-card .tkd-card .table-wrap { height: auto !important; max-height: none !important; overflow: visible !important; }

/* Card (the visible box). Size it with width; height follows --kit-ratio. */
.kit-card { position: relative; width: 100%; aspect-ratio: var(--kit-ratio, 16 / 10); overflow: hidden; border-radius: 16px; background: var(--bg, #f6f7f9); border: 1px solid var(--border, #e8ebf0); box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .06); isolation: isolate; contain: paint; user-select: text; }
.kit-stage { position: absolute; inset: 0; transition: opacity .3s ease; }
.kit-card.kit-fade .kit-stage { opacity: 0; }

/* Camera: the part keeps its real ERP width and is scaled down; pan/zoom moves it. */
.kit-cam { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; transition: transform var(--kit-pan, .8s) cubic-bezier(.65, 0, .35, 1); }
.kit-cam > .kit-frame { background: var(--bg, #f6f7f9); padding: var(--kit-pad, 20px); }
.kit-cam > .kit-frame + .kit-frame { position: absolute; left: 0; top: 0; width: 100%; }
.kit-frame.kit-in { animation: kit-frame-in .35s ease both; }
.kit-frame.kit-out { animation: kit-frame-out .35s ease both; }
@keyframes kit-frame-in { from { opacity: 0; } }
@keyframes kit-frame-out { to { opacity: 0; } }

/* Overlay layer (dialogs, toasts): same scale as the camera, covers the card. */
.kit-ov { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.kit-ov .modal-bg, .kit-ov .toasts { position: absolute !important; }
.kit-ov.kit-out { animation: kit-frame-out .22s ease both; }

/* Things that appear */
.kit-enter { animation: kit-enter .5s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes kit-enter { from { opacity: 0; transform: translateY(-10px); } }
tr.kit-enter > td { animation: kit-row-flash 1.6s ease both; }
@keyframes kit-row-flash { 0%, 35% { background-color: color-mix(in srgb, var(--blue) 10%, transparent); } }
.kit-flash { animation: kit-flash 1.2s ease both; }
@keyframes kit-flash { 0%, 30% { background-color: color-mix(in srgb, var(--green) 12%, transparent); } }
.kit-gone { display: none !important; }

/* Fake cursor */
.kit-cursor { position: absolute; left: 0; top: 0; width: 22px; height: 22px; z-index: 50; pointer-events: none; opacity: 0; transform: translate(var(--x, 60%), var(--y, 110%)); transition: transform var(--kit-move, .6s) cubic-bezier(.65, 0, .35, 1), opacity .25s ease; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.kit-cursor.on { opacity: 1; }
.kit-cursor svg { display: block; width: 22px; height: 22px; transition: transform .12s ease; transform-origin: 4px 3px; }
.kit-cursor.press svg { transform: scale(.82); }
.kit-cursor::after { content: ''; position: absolute; left: -10px; top: -11px; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--blue) 35%, transparent); opacity: 0; transform: scale(.3); }
.kit-cursor.press::after { animation: kit-ripple .5s ease-out; }
@keyframes kit-ripple { 0% { opacity: .9; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.4); } }
.kit-press { filter: brightness(.94); transform: scale(.97); transition: transform .12s ease, filter .12s ease; }

/* No fake focus rings left on cloned inputs */
.kit-card input, .kit-card textarea, .kit-card select { caret-color: transparent; }

@media (prefers-reduced-motion: reduce) {
  .kit-cam, .kit-cursor, .kit-stage { transition: none !important; }
  .kit-enter, .kit-flash, .kit-frame.kit-in, tr.kit-enter > td { animation: none !important; }
}
.kit-now .kit-cam, .kit-now .kit-cursor, .kit-now .kit-stage { transition: none !important; }
/* Sticky headers/footers stick to the page scroll in the ERP; inside a card they stay in place. */
.kit-card .t th, .kit-card .t thead, .kit-card .t.tkd tfoot td, .kit-card .tk-side { position: static !important; }
