/* Shared busy/spinner — Android-native, Sahla orange accent */
.sahla-busy-spinner,
.btn-primary__spinner {
    display: none;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sahla-busy-spin 0.7s linear infinite;
    vertical-align: middle;
}

.shop-btn .sahla-busy-spinner,
.orders-card__btn .sahla-busy-spinner,
.users-sheet__view-btn .sahla-busy-spinner,
.user-card__action .sahla-busy-spinner,
.admin-table__btn .sahla-busy-spinner {
    border-color: rgba(245, 130, 32, 0.25);
    border-top-color: var(--sahla-orange, #f58220);
}

.shop-btn--primary .sahla-busy-spinner,
.users-fab.is-loading .sahla-busy-spinner,
.btn-primary.is-loading .sahla-busy-spinner,
.btn-primary.is-loading .btn-primary__spinner,
.users-fab.is-loading .btn-primary__spinner {
    border-color: rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
}

.is-loading .sahla-busy-spinner,
.is-loading .btn-primary__spinner,
.btn-primary.is-loading .btn-primary__spinner,
.users-fab.is-loading .btn-primary__spinner {
    display: inline-block;
}

button.is-loading,
.btn-primary.is-loading,
.shop-btn.is-loading,
.users-fab.is-loading {
    cursor: progress;
    opacity: 0.85;
    pointer-events: none;
}

@keyframes sahla-busy-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sahla-busy-spinner,
    .btn-primary__spinner {
        animation: none;
        border-top-color: transparent;
        opacity: 0.7;
    }
}

/* Loading skeletons (markup from Sahla.skeleton in common.js). Tinted from currentColor so they suit any theme. */
.sk-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid color-mix(in srgb, currentColor 8%, transparent);
    border-radius: 14px;
    pointer-events: none;
}

.sk {
    display: block;
    flex-shrink: 0;
    border-radius: 8px;
    background: linear-gradient(90deg,
        color-mix(in srgb, currentColor 7%, transparent) 25%,
        color-mix(in srgb, currentColor 14%, transparent) 37%,
        color-mix(in srgb, currentColor 7%, transparent) 63%);
    background-size: 400% 100%;
    animation: sahla-sk-shimmer 1.3s ease-in-out infinite;
}

.sk-line {
    width: 100%;
    height: 0.75rem;
}

.sk-lg { height: 1.05rem; }
.sk-w30 { width: 30%; }
.sk-w40 { width: 40%; }
.sk-w50 { width: 50%; }
.sk-w60 { width: 60%; }
.sk-w70 { width: 70%; }

.sk-media {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
}

.sk-row {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.sk-thumb {
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
}

.sk-col {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.sk-pill {
    width: 4.5rem;
    height: 1.5rem;
    border-radius: 999px;
}

.sk-hero {
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 22rem;
    border-radius: 12px;
}

.sk-btn {
    width: 100%;
    height: 2.75rem;
    margin-top: 0.25rem;
    border-radius: 12px;
}

.sk-detail,
.sk-profile {
    border: 0;
    padding: 0;
}

.sk-banner {
    width: 100%;
    height: 8rem;
    border-radius: 14px;
}

.sk-avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
}

.sk-chips {
    display: flex;
    gap: 0.5rem;
}

/* Table rows: the row itself stays a table row, only the cells get bars. */
tr.sk-tr {
    display: table-row;
    padding: 0;
    border: 0;
}

tr.sk-tr td .sk-line {
    width: 80%;
    min-width: 2.5rem;
}

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

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

.sk-page {
    display: grid;
    gap: 0.75rem;
}
