/* Reusable skeleton placeholders — light blocks + ~1.2s shimmer */

:root {
    --bm-skeleton-base: #dce3ec;
    --bm-skeleton-highlight: #f8fafc;
}

.bm-skeleton {
    display: block;
    background: var(--bm-skeleton-base);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.bm-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--bm-skeleton-highlight) 45%,
        transparent 90%
    );
    animation: bm-skeleton-shimmer 1.2s ease-in-out infinite;
}

@keyframes bm-skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bm-skeleton::after {
        animation: none;
        opacity: 0.35;
    }
}

.bm-skeleton--circle {
    border-radius: 50%;
    flex-shrink: 0;
}

.bm-skeleton--pill {
    border-radius: 999px;
}

.bm-skeleton-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.bm-skeleton-table--all col:nth-child(1) { width: 34%; }
.bm-skeleton-table--all col:nth-child(2) { width: 14%; }
.bm-skeleton-table--all col:nth-child(3) { width: 18%; }
.bm-skeleton-table--all col:nth-child(4) { width: 14%; }
.bm-skeleton-table--all col:nth-child(5) { width: 20%; }

.bm-skeleton-data-row td {
    box-shadow: 0 1px 0 rgba(226, 232, 240, 0.9);
}

.bm-skeleton-table thead th {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 0 16px 8px;
    text-align: left;
    border: none;
    background: transparent;
}

.bm-skeleton-table thead th.bm-skeleton-th-center {
    text-align: center;
}

.bm-skeleton-table tbody td {
    background: #fff;
    padding: 16px;
    vertical-align: middle;
    border: none;
}

.bm-skeleton-table tbody td:first-child {
    border-radius: 12px 0 0 12px;
    padding-left: 20px;
}

.bm-skeleton-table tbody td:last-child {
    border-radius: 0 12px 12px 0;
}

.bm-skeleton-client-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 220px;
}

.bm-skeleton-client-lines--stacked {
    padding-left: 4px;
}

.bm-skeleton-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.clients-grid-error {
    padding: 2rem 1.5rem;
    text-align: center;
    color: #64748b;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--bm-border, #e3ebf1);
    margin-bottom: 1rem;
}

.clients-grid-error-title {
    font-weight: 600;
    color: #262646;
    margin-bottom: 0.35rem;
}

.clients-grid-skeleton-pager {
    padding: 12px 4px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.bm-admin-skeleton-table tbody td {
    vertical-align: middle;
}

.bm-admin-skeleton-pager {
    padding: 0.75rem 1.25rem 1.25rem;
    justify-content: space-between;
}

.bm-skeleton--square-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    display: inline-block;
}

.bm-skeleton-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.al-table-wrap .clients-grid-error {
    margin: 1rem 1.25rem;
}

.bm-app-skel-scope-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.bm-app-skel-field-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 991px) {
    .bm-app-skel-scope-grid,
    .bm-app-skel-field-grid {
        grid-template-columns: 1fr;
    }
}

/* Applications list modal (adviser) */
.bm-apps-skeleton-table tbody td {
    padding: 14px 8px;
    vertical-align: middle;
}

.bm-apps-skeleton-row .bm-skeleton--square-avatar {
    border-radius: 8px;
    flex-shrink: 0;
}

.bm-apps-table-wrap .clients-grid-error {
    margin: 0.5rem 0 1rem;
}

/* Client dashboard tab skeletons */
.bm-dash-tab-skeleton {
    font-family: Inter, "DM Sans", system-ui, sans-serif;
}

.bm-dash-skel-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 0;
}

.bm-dash-skel-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bm-dash-skel-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.bm-dash-skel-section-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    min-height: 88px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
}

.bm-dash-skel-shell {
    border: 1px solid #e8e6e1;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.bm-dash-skel-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}

.bm-dash-skel-summary-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 1.25rem;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
}

.bm-dash-skel-facility {
    border: 1px solid #e8e6e1;
    border-radius: 12px;
    overflow: hidden;
}

.bm-dash-skel-facility-head {
    border-radius: 0 !important;
}

.bm-dash-skel-policy {
    border: 1px solid #e8e6e1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.bm-dash-skel-policy-head {
    border-radius: 0 !important;
}

.bm-dash-skel-policy-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #e8e6e1;
}

.bm-dash-skel-ks-wrap {
    background: #f5fbfb;
    border-radius: 8px;
}

.bm-dash-skel-ks-head {
    border-radius: 0 !important;
}

.bm-dash-skel-ks-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-bottom: 1px solid #e0e0e0;
}

.bm-dash-skel-ks-metrics .km {
    padding: 14px 16px;
    border-right: 1px solid #e0e0e0;
}

.bm-dash-skel-ks-metrics .km:last-child {
    border-right: none;
}

.bm-dash-skel-chart {
    height: 240px;
    padding: 16px 20px 20px;
}

.bm-dash-skel-doc-year {
    margin: 1rem 0 0.5rem;
}

.bm-dash-skel-doc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
