/* ==========================================================================
   Skeleton loading — modern shimmer placeholders that replace spinners.
   Auto-included on every dashboard page via dashboard_base.html and driven by
   static/js/skeleton.js (window.Skeleton).
   ========================================================================== */

:root {
    --sk-base:  #e2e8f0;
    --sk-shine: #f1f5f9;
    --sk-radius: 8px;
    --sk-card-border: #edf0f5;
    --sk-card-bg: #ffffff;
}

.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--sk-base);
    border-radius: var(--sk-radius);
    display: block;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, var(--sk-shine), transparent);
    animation: sk-shimmer 1.25s infinite;
}

@keyframes sk-shimmer { 100% { transform: translateX(100%); } }

/* Respect reduced-motion: swap the sweeping shine for a gentle pulse. */
@media (prefers-reduced-motion: reduce) {
    .skeleton::after { animation: none; }
    .skeleton { animation: sk-pulse 1.4s ease-in-out infinite; }
    @keyframes sk-pulse { 50% { opacity: .55; } }
}

/* Primitives ------------------------------------------------------------- */
.sk-line   { height: 12px; margin: 8px 0; border-radius: 6px; }
.sk-line.sk-sm { height: 9px; }
.sk-line.sk-lg { height: 18px; }
.sk-title  { height: 20px; width: 45%; margin-bottom: 14px; border-radius: 6px; }
.sk-avatar { width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto; }
.sk-btn    { height: 34px; width: 110px; border-radius: 8px; }
.sk-thumb  { width: 100%; padding-top: 56.25%; border-radius: 10px; } /* 16:9 */

/* Layout helpers --------------------------------------------------------- */
.sk-flex  { display: flex; align-items: center; gap: 12px; }
.sk-grow  { flex: 1 1 auto; min-width: 0; }

.sk-card {
    border: 1px solid var(--sk-card-border);
    border-radius: 12px;
    padding: 16px;
    background: var(--sk-card-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sk-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.sk-table { width: 100%; border-collapse: collapse; }
.sk-table td { padding: 13px 10px; border-bottom: 1px solid #eef0f3; }

/* Dark-mode friendliness where the app opts in. */
@media (prefers-color-scheme: dark) {
    :root {
        --sk-base:  #2a2f3a;
        --sk-shine: #363c49;
        --sk-card-border: #2b3140;
        --sk-card-bg: #1f2430;
    }
}
