:root {
    --skeleton-base: #e4eaf4;
    --skeleton-highlight: #f4f8ff;
    --skeleton-surface: #f1f5fc;
    --skeleton-border: #d7e1f4;
}

body.theme-dark {
    --skeleton-base: #1a253a;
    --skeleton-highlight: #25344f;
    --skeleton-surface: #121c2f;
    --skeleton-border: #25344f;
}

.skeleton-overlay {
    position: fixed;
    inset: 0;
    z-index: 2400;
    background: linear-gradient(180deg, #f2f6ff 0%, #edf3ff 60%, #f4f8ff 100%);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    overflow-y: auto;
    transition: opacity 0.34s ease, visibility 0.34s ease;
}

body.theme-dark .skeleton-overlay {
    background: linear-gradient(180deg, #0b1324 0%, #101b2f 60%, #0b1426 100%);
}

body.skeleton-loaded .skeleton-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.skeleton-shell {
    width: min(1200px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1rem 0 1.5rem;
}

.skeleton-shimmer {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: var(--skeleton-base);
}

.skeleton-shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.78) 50%, transparent 100%);
    animation: skeletonShimmer 1.8s ease-in-out infinite;
}

body.theme-dark .skeleton-shimmer::after {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.12) 50%, transparent 100%);
}

@keyframes skeletonShimmer {
    100% {
        transform: translateX(100%);
    }
}

.landing-skeleton .skeleton-shell {
    padding-top: 0.8rem;
}

.sk-navbar {
    height: 74px;
    border: 1px solid var(--skeleton-border);
    border-radius: 18px;
    background: #f8fbff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.15rem;
    margin-bottom: 1.4rem;
}

.sk-logo {
    width: 140px;
    height: 24px;
    border-radius: 8px;
}

.sk-nav {
    display: flex;
    align-items: center;
    gap: 0.72rem;
}

.sk-nav-item {
    width: 74px;
    height: 14px;
    border-radius: 999px;
}

.sk-nav-btn {
    width: 96px;
    height: 40px;
    border-radius: 999px;
}

.sk-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.25rem;
    align-items: center;
    margin-bottom: 1.6rem;
}

.sk-hero-left {
    padding: 0.5rem 0;
}

.sk-eyebrow {
    width: 230px;
    height: 14px;
    border-radius: 999px;
    margin-bottom: 0.95rem;
}

.sk-title-line {
    height: 54px;
    border-radius: 14px;
    margin-bottom: 0.6rem;
}

.sk-title-line.one {
    width: 86%;
}

.sk-title-line.two {
    width: 82%;
}

.sk-title-line.three {
    width: 74%;
}

.sk-subtitle-line {
    height: 17px;
    border-radius: 10px;
    margin-top: 0.72rem;
}

.sk-subtitle-line.one {
    width: 92%;
}

.sk-subtitle-line.two {
    width: 80%;
}

.sk-btn-row {
    margin-top: 1.2rem;
    display: flex;
    gap: 0.78rem;
}

.sk-btn {
    height: 46px;
    border-radius: 999px;
}

.sk-btn.primary {
    width: 156px;
}

.sk-btn.secondary {
    width: 126px;
}

.sk-table-card {
    background: #f8fbff;
    border: 1px solid var(--skeleton-border);
    border-radius: 22px;
    padding: 1rem;
}

.sk-table-title {
    width: 170px;
    height: 24px;
    border-radius: 9px;
    margin-bottom: 0.55rem;
}

.sk-table-subtitle {
    width: 78%;
    height: 14px;
    border-radius: 9px;
    margin-bottom: 0.92rem;
}

.sk-table {
    border: 1px solid #dde7fb;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
}

.sk-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 0.9fr 0.8fr;
    gap: 0.55rem;
    align-items: center;
    padding: 0.7rem 0.72rem;
    border-top: 1px solid #e8effc;
}

.sk-row:first-child {
    border-top: none;
}

.sk-cell {
    height: 12px;
    border-radius: 7px;
}

.sk-head .sk-cell {
    height: 11px;
}

.sk-badge {
    height: 18px;
    border-radius: 999px;
}

.sk-features {
    margin-top: 0.85rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.95rem;
}

.sk-feature-card {
    border: 1px solid var(--skeleton-border);
    border-radius: 16px;
    background: #f8fbff;
    padding: 1rem;
}

.sk-feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    margin-bottom: 0.8rem;
}

.sk-feature-title {
    width: 72%;
    height: 15px;
    border-radius: 8px;
    margin-bottom: 0.55rem;
}

.sk-feature-text {
    width: 92%;
    height: 12px;
    border-radius: 8px;
    margin-bottom: 0.35rem;
}

.sk-feature-text.short {
    width: 70%;
    margin-bottom: 0;
}

.auth-skeleton .skeleton-shell {
    padding-top: 0.9rem;
}

.auth-sk-grid {
    min-height: calc(100vh - 2.2rem);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.95rem;
}

.auth-sk-side,
.auth-sk-form {
    border: 1px solid var(--skeleton-border);
    border-radius: 24px;
    background: #f8fbff;
}

.auth-sk-side {
    padding: clamp(1.1rem, 2.2vw, 2rem);
}

.auth-sk-logo {
    width: 150px;
    height: 24px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.auth-sk-eyebrow {
    width: 150px;
    height: 13px;
    border-radius: 999px;
    margin-bottom: 0.8rem;
}

.auth-sk-title {
    height: 44px;
    border-radius: 12px;
    margin-bottom: 0.55rem;
}

.auth-sk-title.one {
    width: 82%;
}

.auth-sk-title.two {
    width: 72%;
}

.auth-sk-sub {
    height: 15px;
    border-radius: 9px;
    margin-top: 0.62rem;
}

.auth-sk-sub.one {
    width: 94%;
}

.auth-sk-sub.two {
    width: 74%;
}

.auth-sk-pill {
    height: 52px;
    border-radius: 14px;
    margin-top: 0.85rem;
}

.auth-sk-pill.first {
    margin-top: 1.25rem;
}

.auth-sk-form {
    padding: clamp(1.1rem, 2.2vw, 2rem);
}

.auth-sk-back {
    width: 140px;
    height: 14px;
    border-radius: 8px;
    margin-bottom: 0.95rem;
}

.auth-sk-card-title {
    width: 220px;
    height: 38px;
    border-radius: 11px;
    margin-bottom: 0.65rem;
}

.auth-sk-card-sub {
    width: 66%;
    height: 14px;
    border-radius: 8px;
    margin-bottom: 1.15rem;
}

.auth-sk-google {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    margin-bottom: 0.85rem;
}

.auth-sk-divider {
    width: 100%;
    height: 16px;
    border-radius: 8px;
    margin-bottom: 0.95rem;
}

.auth-sk-label {
    width: 35%;
    height: 13px;
    border-radius: 7px;
    margin-bottom: 0.5rem;
}

.auth-sk-input {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    margin-bottom: 0.9rem;
}

.auth-sk-forgot {
    width: 28%;
    height: 13px;
    margin-left: auto;
    border-radius: 7px;
    margin-bottom: 1rem;
}

.auth-sk-submit {
    width: 100%;
    height: 48px;
    border-radius: 999px;
    margin-bottom: 0.9rem;
}

.auth-sk-switch {
    width: 68%;
    height: 14px;
    margin: 0 auto;
    border-radius: 8px;
}

.dashboard-skeleton .skeleton-shell {
    width: min(1320px, calc(100% - 1.6rem));
    padding-top: 0.75rem;
    padding-bottom: 0.95rem;
}

.dash-sk-layout {
    min-height: calc(100vh - 1.7rem);
    display: grid;
    grid-template-columns: 264px 1fr;
    gap: 1rem;
}

.dash-sk-sidebar,
.dash-sk-main,
.dash-sk-card {
    border: 1px solid var(--skeleton-border);
    border-radius: 18px;
    background: #f8fbff;
}

body.theme-dark .sk-navbar,
body.theme-dark .sk-table-card,
body.theme-dark .sk-table,
body.theme-dark .sk-feature-card,
body.theme-dark .auth-sk-side,
body.theme-dark .auth-sk-form,
body.theme-dark .dash-sk-sidebar,
body.theme-dark .dash-sk-main,
body.theme-dark .dash-sk-card {
    background: var(--skeleton-surface);
    border-color: var(--skeleton-border);
}

body.theme-dark .sk-row {
    border-top-color: #25344f;
}

.dash-sk-sidebar {
    padding: 1rem 0.85rem;
}

.dash-sk-logo {
    width: 145px;
    height: 24px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.dash-sk-nav {
    display: grid;
    gap: 0.52rem;
}

.dash-sk-nav-item {
    width: 100%;
    height: 40px;
    border-radius: 10px;
}

.dash-sk-main {
    padding: 0.95rem;
}

.dash-sk-topbar {
    display: grid;
    grid-template-columns: 1fr 1.2fr 0.85fr;
    gap: 0.72rem;
    margin-bottom: 0.82rem;
}

.dash-sk-title,
.dash-sk-search,
.dash-sk-profile {
    height: 48px;
    border-radius: 12px;
}

.dash-sk-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.72rem;
    margin-bottom: 0.82rem;
}

.dash-sk-metric {
    height: 96px;
    border-radius: 14px;
}

.dash-sk-content {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 0.72rem;
    margin-bottom: 0.72rem;
}

.dash-sk-left,
.dash-sk-right {
    display: grid;
    gap: 0.72rem;
}

.dash-sk-card {
    padding: 0.78rem;
}

.dash-sk-card-head {
    width: 38%;
    height: 15px;
    border-radius: 8px;
    margin-bottom: 0.64rem;
}

.dash-sk-table-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 0.9fr 0.8fr;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.dash-sk-table-row:last-child {
    margin-bottom: 0;
}

.dash-sk-table-row span {
    height: 11px;
    border-radius: 7px;
}

.dash-sk-chart-card {
    min-height: 150px;
}

.dash-sk-bars {
    height: 102px;
    display: flex;
    align-items: end;
    gap: 0.45rem;
}

.dash-sk-bars span {
    flex: 1;
    border-radius: 7px;
}

.dash-sk-bars span:nth-child(1) {
    height: 46%;
}

.dash-sk-bars span:nth-child(2) {
    height: 62%;
}

.dash-sk-bars span:nth-child(3) {
    height: 55%;
}

.dash-sk-bars span:nth-child(4) {
    height: 71%;
}

.dash-sk-bars span:nth-child(5) {
    height: 58%;
}

.dash-sk-bars span:nth-child(6) {
    height: 79%;
}

.dash-sk-bars span:nth-child(7) {
    height: 67%;
}

.dash-sk-line {
    height: 12px;
    border-radius: 7px;
    margin-bottom: 0.5rem;
}

.dash-sk-line:last-child {
    margin-bottom: 0;
}

.dash-sk-recent .dash-sk-line {
    width: 78%;
}

@media (max-width: 991.98px) {
    .skeleton-shell {
        width: min(900px, calc(100% - 1.4rem));
    }

    .dashboard-skeleton .skeleton-shell {
        width: min(980px, calc(100% - 1.4rem));
    }

    .dash-sk-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .dash-sk-sidebar {
        display: none;
    }

    .dash-sk-topbar {
        grid-template-columns: 1fr;
    }

    .dash-sk-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .dash-sk-content {
        grid-template-columns: 1fr;
    }

    .sk-hero {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .sk-features {
        grid-template-columns: 1fr 1fr;
    }

    .auth-sk-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }
}

@media (max-width: 767.98px) {
    .skeleton-shell {
        width: calc(100% - 1rem);
    }

    .dashboard-skeleton .skeleton-shell {
        width: calc(100% - 1rem);
    }

    .dash-sk-main,
    .dash-sk-card {
        border-radius: 14px;
    }

    .dash-sk-metrics {
        grid-template-columns: 1fr;
    }

    .dash-sk-table-row {
        grid-template-columns: 1.15fr 0.92fr 0.92fr 0.8fr 0.8fr;
    }

    .sk-navbar {
        height: 66px;
        padding: 0 0.85rem;
    }

    .sk-nav-item {
        width: 60px;
    }

    .sk-nav .sk-nav-item:nth-child(2),
    .sk-nav .sk-nav-item:nth-child(3) {
        display: none;
    }

    .sk-title-line {
        height: 42px;
    }

    .sk-btn {
        height: 42px;
    }

    .sk-features {
        grid-template-columns: 1fr;
    }

    .sk-row {
        grid-template-columns: 1.2fr 0.9fr 0.9fr 0.8fr 0.8fr;
        padding: 0.62rem 0.56rem;
    }

    .auth-sk-form,
    .auth-sk-side {
        border-radius: 18px;
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-shimmer::after {
        animation: none;
    }

    .skeleton-overlay {
        transition: none;
    }
}
