/* ==========================================================================
   rz-loading — transfer progress panel + skeleton placeholders
   Loaded globally from layouts/partials/head.blade.php. Classes are rz-tf-* /
   rz-skel-* only so nothing here restyles existing components.
   ========================================================================== */

:root {
    --rz-top-bar-height: 105px;
    --rz-skel-base: #E9EEF5;
    --rz-skel-shine: rgba(255, 255, 255, .45);
    --rz-skel-radius: 6px;
    --rz-skel-duration: 1.8s;
    --rz-skel-delay: .2s;
    --rz-tf-accent: #2563EB;
    /* Skeleton layout tiles (rounded shapes; % widths scale with the container) */
    --rz-skel-svg-row: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='56'%3E%3Crect x='2%' y='22' width='24%' height='12' rx='6' fill='%23E9EEF5'/%3E%3Crect x='32%' y='22' width='16%' height='12' rx='6' fill='%23E9EEF5'/%3E%3Crect x='54%' y='22' width='12%' height='12' rx='6' fill='%23E9EEF5'/%3E%3Crect x='72%' y='22' width='14%' height='12' rx='6' fill='%23E9EEF5'/%3E%3Crect x='90%' y='22' width='7%' height='12' rx='6' fill='%23E9EEF5'/%3E%3Crect x='0' y='55' width='100%' height='1' fill='%23F1F5F9'/%3E%3C/svg%3E");
    --rz-skel-svg-lines: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='72'%3E%3Crect x='14' y='12' width='58%' height='11' rx='6' fill='%23E9EEF5'/%3E%3Crect x='14' y='32' width='86%' height='11' rx='6' fill='%23E9EEF5'/%3E%3Crect x='14' y='52' width='42%' height='11' rx='6' fill='%23E9EEF5'/%3E%3C/svg%3E");
    --rz-skel-svg-cell: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='72'%3E%3Crect x='14' y='16' width='38%' height='10' rx='6' fill='%23E9EEF5'/%3E%3Crect x='14' y='36' width='68%' height='10' rx='6' fill='%23E9EEF5'/%3E%3Crect x='14' y='56' width='28%' height='10' rx='6' fill='%23E9EEF5'/%3E%3C/svg%3E");
    --rz-skel-svg-list: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='64'%3E%3Ccircle cx='30' cy='32' r='14' fill='%23E9EEF5'/%3E%3Crect x='56' y='20' width='46%' height='10' rx='6' fill='%23E9EEF5'/%3E%3Crect x='56' y='36' width='28%' height='9' rx='6' fill='%23E9EEF5'/%3E%3Crect x='0' y='63' width='100%' height='1' fill='%23F1F5F9'/%3E%3C/svg%3E");
    --rz-skel-svg-form: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='74'%3E%3Crect x='14' y='10' width='24%' height='10' rx='5' fill='%23E9EEF5'/%3E%3Crect x='14' y='28' width='94%' height='36' rx='8' fill='%23F8FAFC' stroke='%23E9EEF5'/%3E%3C/svg%3E");
    --rz-skel-svg-cards: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='172'%3E%3Crect x='0%' y='8' width='31.3%' height='148' rx='12' fill='%23FFFFFF' stroke='%23E5E7EB'/%3E%3Crect x='2%' y='28' width='36' height='36' rx='8' fill='%23E9EEF5'/%3E%3Crect x='2%' y='82' width='20%' height='12' rx='6' fill='%23E9EEF5'/%3E%3Crect x='2%' y='104' width='14%' height='10' rx='5' fill='%23E9EEF5'/%3E%3Crect x='2%' y='128' width='9%' height='10' rx='5' fill='%23E9EEF5'/%3E%3Crect x='34.35%' y='8' width='31.3%' height='148' rx='12' fill='%23FFFFFF' stroke='%23E5E7EB'/%3E%3Crect x='36.35%' y='28' width='36' height='36' rx='8' fill='%23E9EEF5'/%3E%3Crect x='36.35%' y='82' width='20%' height='12' rx='6' fill='%23E9EEF5'/%3E%3Crect x='36.35%' y='104' width='14%' height='10' rx='5' fill='%23E9EEF5'/%3E%3Crect x='36.35%' y='128' width='9%' height='10' rx='5' fill='%23E9EEF5'/%3E%3Crect x='68.7%' y='8' width='31.3%' height='148' rx='12' fill='%23FFFFFF' stroke='%23E5E7EB'/%3E%3Crect x='70.7%' y='28' width='36' height='36' rx='8' fill='%23E9EEF5'/%3E%3Crect x='70.7%' y='82' width='20%' height='12' rx='6' fill='%23E9EEF5'/%3E%3Crect x='70.7%' y='104' width='14%' height='10' rx='5' fill='%23E9EEF5'/%3E%3Crect x='70.7%' y='128' width='9%' height='10' rx='5' fill='%23E9EEF5'/%3E%3C/svg%3E");
    --rz-skel-svg-doc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%' height='440'%3E%3Crect x='10%' y='16' width='80%' height='408' rx='8' fill='%23FFFFFF' stroke='%23E5E7EB'/%3E%3Crect x='16%' y='48' width='40%' height='16' rx='6' fill='%23E9EEF5'/%3E%3Crect x='16%' y='84' width='66%' height='10' rx='6' fill='%23E9EEF5'/%3E%3Crect x='16%' y='104' width='62%' height='10' rx='6' fill='%23E9EEF5'/%3E%3Crect x='16%' y='124' width='68%' height='10' rx='6' fill='%23E9EEF5'/%3E%3Crect x='16%' y='144' width='44%' height='10' rx='6' fill='%23E9EEF5'/%3E%3Crect x='16%' y='184' width='66%' height='10' rx='6' fill='%23E9EEF5'/%3E%3Crect x='16%' y='204' width='60%' height='10' rx='6' fill='%23E9EEF5'/%3E%3Crect x='16%' y='224' width='64%' height='10' rx='6' fill='%23E9EEF5'/%3E%3Crect x='16%' y='244' width='36%' height='10' rx='6' fill='%23E9EEF5'/%3E%3Crect x='16%' y='284' width='66%' height='10' rx='6' fill='%23E9EEF5'/%3E%3Crect x='16%' y='304' width='58%' height='10' rx='6' fill='%23E9EEF5'/%3E%3Crect x='16%' y='324' width='30%' height='10' rx='6' fill='%23E9EEF5'/%3E%3C/svg%3E");
}

@media (max-width: 1023px) {
    :root {
        --rz-top-bar-height: 57px;
    }
}

/* ── Skeleton primitives ─────────────────────────────────────────────── */
.rz-skel,
.skeleton,
.sk-line {
    position: relative;
    overflow: hidden;
    background: var(--rz-skel-base);
    border-radius: var(--rz-skel-radius);
}
.rz-skel::after,
.skeleton::after,
.sk-line::after,
.rz-skeleton-wrapper::after,
.case-files-skeleton-list::after,
.rz-skel-page::after,
.rz-skel-host::after,
.rz-skel-page .rz-skel-shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent 0, var(--rz-skel-shine) 50%, transparent 100%);
    animation: rz-skel-shimmer var(--rz-skel-duration) ease-in-out infinite;
    pointer-events: none;
}
@keyframes rz-skel-shimmer {
    100% { transform: translateX(100%); }
}
.rz-skel-line   { height: 12px; margin: 0 0 10px; }
.rz-skel-line.sm { height: 9px; }
.rz-skel-line.lg { height: 18px; }
.rz-skel-circle { border-radius: 50%; }
.rz-skel-pill   { border-radius: 999px; }
.rz-skel-w-25 { width: 25%; } .rz-skel-w-40 { width: 40%; } .rz-skel-w-60 { width: 60%; }
.rz-skel-w-75 { width: 75%; } .rz-skel-w-90 { width: 90%; } .rz-skel-w-100 { width: 100%; }

.rz-skel-title { border-radius: 6px; }
.rz-skel-subtitle { border-radius: 4px; }
.rz-skel-label { border-radius: 4px; }
.rz-skel-input { border-radius: 6px; }
.rz-skel-btn { border-radius: 6px; }
.rz-skel-badge { border-radius: 999px; }

/* Large skeleton layouts use one shimmer layer instead of animating every cell. */
.rz-skeleton-wrapper, .case-files-skeleton-list { position: relative; overflow: hidden; }
.rz-skel-page { overflow: hidden; }
.rz-skeleton-wrapper .rz-skel::after,
.case-files-skeleton-list .rz-skel::after,
.rz-skel-page .rz-skel::after,
.rz-skel-page .rz-skel-shimmer::after,
.rz-skel-page .rz-skeleton-wrapper::after,
.rz-skel-page[role="status"]::after { display: none; }

/* Page skeleton containers and transitions */
.rz-skeleton-wrapper {
    width: 100%;
    animation: rz-fade-in .15s ease both;
}
.rz-page-skeleton-container {
    position: relative;
    z-index: 2;
    width: 100%;
    pointer-events: none;
    animation: rz-fade-in .18s ease var(--rz-skel-delay) both;
    transition: opacity .18s ease-out;
}
.rz-page-skeleton-container.rz-skel-fade {
    animation: none;
    opacity: 0;
    pointer-events: none;
}
.rz-page-skeleton-container.rz-skel-hidden {
    display: none !important;
}
.rz-page-content-wrapper {
    transition: opacity .2s ease-in;
}
.rz-page-content-wrapper.rz-content-loading {
    display: none !important;
    pointer-events: none;
    opacity: 0;
}
.rz-page-content-wrapper.rz-content-ready {
    display: block !important;
    opacity: 1;
}

/* Modal skeleton */
.rz-modal-skeleton-body {
    position: relative;
    overflow: hidden;
    padding: 4px 0;
}
.modal.rz-modal-loading .modal-footer .btn:not(.btn-close),
.modal.rz-modal-loading .modal-body > :not(.rz-modal-skeleton-body) {
    visibility: hidden;
}

.rz-skel-stack { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.rz-skel-stack .rz-skel-line { margin: 0; }

/* Table skeleton rows (RzSkeleton.tableRows / busy tables) */
tr.rz-skel-row > td { padding-top: 12px !important; padding-bottom: 12px !important; }
tr.rz-skel-row .rz-skel-line { margin: 0; }

/* Document & Case Files skeleton rows */
.case-files-skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
.doc-file-row.case-file-skeleton-row {
    pointer-events: none;
    user-select: none;
    border-color: var(--rz-line, #E2E8F0);
    background: #FFFFFF;
    cursor: default;
}
.case-file-skeleton-row .doc-file-row-icon.rz-skel {
    border: none;
}
.case-files-empty-state,
.case-files-error-state {
    padding: 1.5rem 1rem;
    text-align: center;
    background: #FAFBFC;
    border: 1px dashed #CBD5E1;
    border-radius: 10px;
    margin: 4px 0;
}

/* Cards / form skeleton */
.rz-skel-card {
    background: #fff;
    border: 1px solid #EEF2F7;
    border-radius: 12px;
    padding: 18px;
}
.rz-skel-form-row { margin-bottom: 16px; }
.rz-skel-form-row .rz-skel-label { height: 10px; width: 30%; margin-bottom: 8px; }
.rz-skel-form-row .rz-skel-input { height: 38px; width: 100%; border-radius: 8px; }

/* ── Auto placeholder host: spinner + "Loading…" blocks ────────────────
   Children stay in the DOM (pages may toggle them by id); they are only
   hidden visually while a layout-shaped skeleton is painted in their place.
   Variant comes from data-rz-skeleton="lines|list|form|document" or is
   inferred by rz-loading.js from the placeholder text. */
.rz-skel-host {
    position: relative !important;
    overflow: hidden;
    min-height: 72px;
    color: transparent !important;
    border-radius: var(--rz-radius-md, 8px);
}
/* Shapes live on ::before so page/table skins that force `background` can't erase them */
.rz-skel-host::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: var(--rz-skel-svg-lines) 0 0 / 100% 72px no-repeat;
    animation: rz-fade-in .2s ease both;
}
.rz-skel-host > * { visibility: hidden !important; }
td.rz-skel-host, li.rz-skel-host { min-height: 0; height: 76px; }
td.rz-skel-host::before { background-image: var(--rz-skel-svg-cell); background-position: 0 2px; }

.rz-skel-host[data-rz-skel-variant="list"] { min-height: 192px; }
.rz-skel-host[data-rz-skel-variant="list"]::before { background: var(--rz-skel-svg-list) 0 0 / 100% 64px repeat-y; }
.rz-skel-host[data-rz-skel-variant="form"] { min-height: 222px; }
.rz-skel-host[data-rz-skel-variant="form"]::before { background: var(--rz-skel-svg-form) 0 0 / 100% 74px repeat-y; }
.rz-skel-host[data-rz-skel-variant="document"] { min-height: 440px; background-color: #F3F4F6; }
.rz-skel-host[data-rz-skel-variant="document"]::before { background: var(--rz-skel-svg-doc) 50% 0 / 100% 440px no-repeat; }
.rz-skel-host[data-rz-skel-variant="compact"] { min-height: 0; height: 132px; }
.rz-skel-host[data-rz-skel-variant="compact"]::before { background: var(--rz-skel-svg-list) 0 2px / 100% 64px repeat-y; }

.rz-skel-host::before, .rz-skel-host::after {
    animation-delay: var(--rz-skel-delay);
}
.rz-skel-busy[data-rz-skel-measured="true"]::before,
[data-rz-sort-table][data-rz-skel-measured="true"][aria-busy="true"]::before,
body .cm-matters-table-card.is-sorting[data-rz-skel-measured="true"]::before {
    background-image: var(--rz-skel-layout) !important;
    background-size: 100% 100% !important;
    background-repeat: no-repeat !important;
}

/* ── Busy AJAX containers (filter / search / sort / page swaps) ───────
   The skeleton fades in after a short delay so fast responses never flash. */
.rz-skel-busy,
[data-rz-sort-table][aria-busy="true"],
.cm-matters-table-card.is-sorting {
    position: relative !important;
    overflow: hidden;
    opacity: 1 !important;
    min-height: max(var(--rz-skel-min-height, 120px), 120px) !important;
}
.rz-skel-busy::before,
[data-rz-sort-table][aria-busy="true"]::before,
body .cm-matters-table-card.is-sorting::before {
    content: '';
    position: absolute;
    inset: var(--rz-skel-top, 0px) 0 0 0;
    z-index: 4;
    background: #fff var(--rz-skel-svg-row) 0 0 / 100% 56px repeat-y;
    pointer-events: none;
    animation: rz-fade-in .18s ease var(--rz-skel-delay) both;
}
.rz-skel-busy::after,
[data-rz-sort-table][aria-busy="true"]::after,
body .cm-matters-table-card.is-sorting::after {
    content: '';
    position: absolute;
    inset: var(--rz-skel-top, 0px) 0 0 0;
    z-index: 5;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent 0, var(--rz-skel-shine) 50%, transparent 100%);
    animation: rz-skel-shimmer var(--rz-skel-duration) ease-in-out var(--rz-skel-delay) infinite;
    pointer-events: none;
}
tbody.rz-skel-busy::before,
tbody.rz-skel-busy::after,
.rz-skel-busy[data-rz-skel-busy]::before,
.rz-skel-busy[data-rz-skel-busy]::after { inset: 0 !important; }
.row.rz-skel-busy::before,
.row.rz-skel-busy::after {
    left: calc(var(--bs-gutter-x, 1.5rem) * .5);
    right: calc(var(--bs-gutter-x, 1.5rem) * .5);
}
.rz-skel-busy[data-rz-skel-busy="list"]::before { background: #fff var(--rz-skel-svg-list) 0 0 / 100% 64px repeat-y; }
.rz-skel-busy[data-rz-skel-busy="cards"]::before { background: var(--rz-canvas, #f3f4f6) var(--rz-skel-svg-cards) 0 0 / 100% 172px repeat-y; }
@media (max-width: 767.98px) {
    .rz-skel-busy[data-rz-skel-busy="cards"]::before { background-image: var(--rz-skel-svg-list); background-size: 100% 64px; background-color: #fff; }
}

.rz-skel-calendar { display: grid; grid-template-columns: repeat(var(--rz-skel-days, 7), minmax(0, 1fr)); border: 1px solid var(--bs-border-color, #e5e7eb); background: var(--bs-body-bg, #fff); }
.rz-skel-calendar-day { min-height: var(--rz-skel-day-height, 110px); padding: 12px; border: 1px solid var(--bs-border-color, #e5e7eb); overflow: hidden; }
@media (max-width: 767.98px) {
    .rz-skel-calendar-day { min-height: 76px; padding: 6px; }
}

@keyframes rz-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Page-level navigation skeleton ─────────────────────────────────── */
#page-content { position: relative; }
#page-content.rz-nav-loading > :not(.rz-skel-page):not(script):not(style) {
    opacity: 0;
    transition: opacity .15s ease;
}
.rz-skel-page {
    display: none;
    position: fixed;
    top: var(--rz-top-bar-height, 105px);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: calc(100vh - var(--rz-top-bar-height, 105px));
    z-index: 1050;
    background: var(--rz-canvas, #f3f4f6);
    contain: layout;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 20px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.rz-skel-page > * {
    margin-left: auto;
    margin-right: auto;
    max-width: 1400px;
    width: 100%;
}
.rz-skel-page.rz-skel-clean {
    padding: 0 !important;
    background: var(--rz-canvas, #f3f4f6) !important;
    min-height: auto !important;
}
body.rz-page-loading {
    overflow: hidden !important;
}
.rz-page-error-state {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    box-sizing: border-box;
    text-align: center;
}
.rz-page-error-state .card {
    max-width: 540px;
    width: 100%;
    margin: 0 auto;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
}
#page-content.rz-nav-loading > .rz-skel-page {
    display: block;
    animation: rz-fade-in .2s ease both;
}
.rz-skel-page .rz-skel-shimmer { position: relative; overflow: hidden; }
.rz-skel-page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.rz-skel-page-head .rz-skel-actions { display: flex; gap: 10px; }
.rz-skel-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.rz-skel-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    gap: 20px;
}
.rz-skel-table-card { padding: 0; overflow: hidden; }
.rz-skel-table-card .rz-skel-thead { height: 42px; background: #F8FAFC; border-bottom: 1px solid #EEF2F7; }
.rz-skel-table-card .rz-skel-tr {
    display: grid;
    grid-template-columns: 2fr 1.4fr 1fr 1fr .6fr;
    gap: 18px;
    padding: 15px 18px;
    border-top: 1px solid #F1F5F9;
}
.rz-skel-table-card .rz-skel-tr .rz-skel-line { margin: 0; }
@media (max-width: 991.98px) {
    .rz-skel-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rz-skel-grid { grid-template-columns: minmax(0, 1fr); }
    .rz-skel-grid > .rz-skel-side { display: none; }
}
@media (max-width: 575.98px) {
    .rz-skel-page { padding: 14px; }
    .rz-skel-stats { gap: 10px; }
    .rz-skel-page-head .rz-skel-actions { display: none; }
    .rz-skel-table-card .rz-skel-tr { grid-template-columns: 2fr 1fr; }
    .rz-skel-table-card .rz-skel-tr > :nth-child(n+3) { display: none; }
}

/* ── Transfer panel (uploads + downloads) ────────────────────────────── */
#rz-tf-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99998;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    width: 340px;
    max-width: calc(100vw - 24px);
    pointer-events: none;
}
#rz-tf-panel.rz-tf-panel-processing {
    inset: 0;
    width: auto;
    max-width: none;
    padding: 24px;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(3px);
    pointer-events: auto;
}
#rz-tf-panel.rz-tf-panel-processing .rz-tf-card {
    width: 340px;
    max-width: 100%;
}
.rz-tf-card {
    pointer-events: auto;
    position: relative;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 14px 12px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .06);
    font-family: 'Inter', system-ui, sans-serif;
    animation: rz-tf-in .28s cubic-bezier(.2, .8, .2, 1) both;
    overflow: hidden;
}
.rz-tf-card.rz-tf-leaving { animation: rz-tf-out .22s ease forwards; }
@keyframes rz-tf-in  { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rz-tf-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }

.rz-tf-icon {
    flex: 0 0 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #EFF6FF;
    color: var(--rz-tf-accent);
    font-size: 15px;
    transition: background .25s ease, color .25s ease;
}
.rz-tf-body { flex: 1; min-width: 0; }
.rz-tf-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rz-tf-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rz-tf-pct {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--rz-tf-accent);
    font-variant-numeric: tabular-nums;
}
.rz-tf-meta {
    margin-top: 2px;
    font-size: 11.5px;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rz-tf-bar {
    position: relative;
    height: 6px;
    margin-top: 9px;
    border-radius: 999px;
    background: #EEF2F7;
    overflow: hidden;
}
.rz-tf-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #3B82F6, #2563EB);
    transition: width .3s ease, background .25s ease;
}
.rz-tf-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
    transform: translateX(-100%);
    animation: rz-skel-shimmer 1.2s ease-in-out infinite;
}
.rz-tf-card.is-indeterminate .rz-tf-fill {
    width: 38% !important;
    animation: rz-tf-indeterminate 1.25s ease-in-out infinite;
}
@keyframes rz-tf-indeterminate {
    0%   { left: -38%; }
    100% { left: 100%; }
}
.rz-tf-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #9CA3AF;
    font-size: 12px;
    line-height: 1;
    display: none;
    cursor: pointer;
}
.rz-tf-close:hover { background: #F3F4F6; color: #374151; }
.rz-tf-card.is-success .rz-tf-close,
.rz-tf-card.is-error .rz-tf-close { display: block; }

.rz-tf-card.is-success .rz-tf-icon { background: #F0FDF4; color: #16A34A; }
.rz-tf-card.is-success .rz-tf-pct { color: #16A34A; }
.rz-tf-card.is-success .rz-tf-fill { width: 100% !important; background: #16A34A; }
.rz-tf-card.is-success .rz-tf-fill::after,
.rz-tf-card.is-error .rz-tf-fill::after { display: none; }
.rz-tf-card.is-error .rz-tf-icon { background: #FEF2F2; color: #DC2626; }
.rz-tf-card.is-error .rz-tf-pct { color: #DC2626; }
.rz-tf-card.is-error .rz-tf-fill { width: 100% !important; background: #DC2626; }
.rz-tf-card.is-error .rz-tf-meta { color: #B91C1C; white-space: normal; }
.rz-tf-card.is-success .rz-tf-top,
.rz-tf-card.is-error .rz-tf-top { padding-right: 18px; }

.rz-tf-check { animation: rz-tf-pop .35s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes rz-tf-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* Busy trigger (button / link) while its transfer is running */
[data-rz-busy="1"]:not(.rz-btn-loading) {
    pointer-events: none !important;
    opacity: .65;
    cursor: progress !important;
}

/* ── Action Button Loading System (rz-btn-loading) ──────────────────── */
.rz-btn-loading,
[data-rz-loading="1"] {
    position: relative !important;
    pointer-events: none !important;
    cursor: wait !important;
    user-select: none !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color .15s ease, border-color .15s ease, opacity .15s ease;
}

.btn.rz-btn-loading:disabled,
.btn.rz-btn-loading[disabled],
button.rz-btn-loading:disabled,
button.rz-btn-loading[disabled],
input[type="submit"].rz-btn-loading:disabled,
input[type="button"].rz-btn-loading:disabled {
    opacity: 0.84 !important;
    cursor: wait !important;
    pointer-events: none !important;
}

.rz-btn-spinner {
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    vertical-align: -0.1em;
    border: 2px solid currentColor;
    border-right-color: transparent !important;
    border-radius: 50%;
    box-sizing: border-box;
    animation: rz-btn-spin 0.65s linear infinite;
    flex-shrink: 0;
    margin-right: 0.5em;
    pointer-events: none;
}

.btn-sm.rz-btn-loading .rz-btn-spinner {
    width: 0.82em;
    height: 0.82em;
    border-width: 1.75px;
    margin-right: 0.4em;
}

.btn-lg.rz-btn-loading .rz-btn-spinner {
    width: 1em;
    height: 1em;
    border-width: 2.5px;
    margin-right: 0.6em;
}

.rz-btn-loading.rz-btn-icon-only {
    min-width: 0 !important;
    justify-content: center !important;
}
.rz-btn-loading.rz-btn-icon-only .rz-btn-spinner {
    margin: 0 !important;
}

@keyframes rz-btn-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 575.98px) {
    #rz-tf-panel { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .rz-skeleton-wrapper::after, .case-files-skeleton-list::after, .rz-skel-page::after,
    .rz-skel::after, .skeleton::after, .sk-line::after, .rz-skel-host::after, .rz-skel-busy::after,
    [data-rz-sort-table][aria-busy="true"]::after, body .cm-matters-table-card.is-sorting::after,
    .rz-skel-page .rz-skel-shimmer::after, .rz-tf-fill::after { animation: none; }
    .rz-btn-spinner { animation-duration: 1.6s; }
    .rz-tf-card, .rz-tf-card.rz-tf-leaving { animation-duration: .01s; }
    .rz-tf-card.is-indeterminate .rz-tf-fill { animation: none; width: 45%; }
    .rz-skeleton-wrapper, .rz-skel-page, .rz-page-content-wrapper,
    .rz-page-skeleton-container, .rz-skel-host::before, .rz-skel-busy::before,
    [data-rz-sort-table][aria-busy="true"]::before,
    body .cm-matters-table-card.is-sorting::before { animation: none; transition: none; }
}
