/**
 * Tailmates Admin — reusable UI component layer.
 * Tokens live in tailmates-admin-theme.css (:root).
 */

/* ?? Card ?? */
.tm-card {
    background: #fff;
    border: 1px solid var(--tm-border, #e2e8f0);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.tm-card--padding {
    padding: 1.25rem 1.5rem;
}

.tm-card--padding-sm {
    padding: 1rem 1.25rem;
}

.tm-card--padding-lg {
    padding: 1.5rem 1.75rem;
}

.tm-card--accent {
    border-left-width: 3px;
    border-left-style: solid;
}

.tm-card--accent-primary { border-left-color: var(--tm-primary, #b5122b); }
.tm-card--accent-success { border-left-color: #22c55e; }
.tm-card--accent-warning { border-left-color: #f59e0b; }
.tm-card--accent-info { border-left-color: #3b82f6; }
.tm-card--accent-neutral { border-left-color: #94a3b8; }

/* ?? Typography ?? */
.tm-eyebrow {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
}

.tm-eyebrow--brand {
    color: var(--tm-primary, #b5122b);
}

.tm-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--tm-ink, #0f172a);
}

.tm-title--lg {
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}

.tm-text-muted {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #64748b;
}

/* ?? Action link ?? */
.tm-action-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.tm-action-link:hover {
    color: var(--tm-primary, #b5122b);
    background: #fff;
    border-color: rgb(181 18 43 / 0.25);
}

.tm-action-link:focus-visible {
    outline: 2px solid var(--tm-primary, #b5122b);
    outline-offset: 2px;
}

.tm-action-link__icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: var(--tm-primary, #b5122b);
}

/* ?? Stack / cluster layout ?? */
.tm-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tm-stack--sm { gap: 0.5rem; }
.tm-stack--lg { gap: 1.25rem; }

.tm-cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tm-split {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* ?? Empty state (custom views) ?? */
.tm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.tm-empty__icon {
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.75rem;
    color: #94a3b8;
}

.tm-empty__title {
    margin: 0 0 0.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--tm-ink, #0f172a);
}

.tm-empty__desc {
    margin: 0;
    max-width: 20rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #64748b;
}

/* ?? Skeleton loading ?? */
.tm-skeleton {
    border-radius: 0.375rem;
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 200% 100%;
    animation: tm-skeleton-pulse 1.4s ease-in-out infinite;
}

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

.tm-skeleton--line-sm {
    height: 0.625rem;
    width: 60%;
}

.tm-skeleton--block {
    height: 4rem;
    width: 100%;
}

@keyframes tm-skeleton-pulse {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .tm-skeleton {
        animation: none;
        background: #f1f5f9;
    }
}
