/* Skeleton loaders: replace spinners / "Processing..." with page-shaped placeholders */

:root {
    --sk-base: #e9ecf2;
    --sk-shine: #f6f7fa;
}

@keyframes sk-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.sk,
.sk-line,
.sk-pill,
.sk-circle {
    display: block;
    background: linear-gradient(90deg, var(--sk-base) 25%, var(--sk-shine) 37%, var(--sk-base) 63%);
    background-size: 400% 100%;
    animation: sk-shimmer 1.4s ease infinite;
    border-radius: 4px;
}
.sk-line   { height: 12px; }
.sk-pill   { height: 26px; border-radius: 13px; }
.sk-circle { border-radius: 50%; flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
    .sk, .sk-line, .sk-pill, .sk-circle { animation: none; }
}

/* ---------- DataTables ---------- */

/* the built-in "Processing..." box is replaced by skeleton rows */
.dataTables_processing,
div.dataTables_processing { display: none !important; }

table.dataTable tbody tr.sk-row td { vertical-align: middle; }
table.dataTable tbody tr.sk-row:hover { background: transparent; }
tr.sk-row td .sk-line { height: 14px; }
tr.sk-row td .sk-actions { display: flex; gap: 6px; }
tr.sk-row td .sk-actions .sk-pill { width: 32px; height: 24px; }

/* ---------- Content-area skeleton (replaces the spinner) ---------- */

/*
 * Reuses .loader-wrapper from app.css for the fixed overlay + fade-out once body.loaded,
 * but only covers the content area: it starts right of the sidebar and below the top bar,
 * so those two are never hidden behind a skeleton.
 */
.loader-wrapper.page-skeleton {
    display: block;
    overflow: hidden;
    background: #f9fafb;
    align-items: initial;
    justify-content: initial;
    top: 60px;          /* top bar height */
    left: 240px;        /* sidebar width */
    width: auto;
    height: auto;
    right: 0;
    bottom: 0;
}
.page-skeleton .psk-body { padding: 24px; overflow: hidden; }
.page-skeleton .psk-card { background: #fff; border-radius: 4px; padding: 20px; box-shadow: 0 0 10px rgba(183, 192, 206, .2); }
.page-skeleton .psk-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.page-skeleton .psk-trow { display: flex; gap: 18px; padding: 14px 0; border-bottom: 1px solid #f0f2f6; }
.page-skeleton .psk-trow .sk-line { flex: 1; }
.page-skeleton .psk-trow .sk-line:first-child { flex: 0 0 40px; }

/* sidebar is an overlay below 992px, so the content area starts at the left edge */
@media (max-width: 991px) {
    .loader-wrapper.page-skeleton { left: 0; }
    .page-skeleton .psk-body { padding: 14px; }
}
