/* Mobile Card View Styles - Hidden on Desktop (≥992px) */
.mobile-card-view {
    display: none;
}

/* Compact Stats Card for Mobile */
.mobile-stats-compact {
    display: none;
}

@media (max-width: 991px) {
    /* Hide desktop table only when a mobile card view sibling is present */
    .mobile-card-view ~ .table-responsive,
    .table-responsive:has(~ .mobile-card-view) {
        display: none !important;
    }

    /* Show mobile card view */
    .mobile-card-view {
        display: block;
        padding: 1rem;
    }
}

@media (max-width: 767px) {
    /* Hide large stats cards on mobile */
    .stats-cards-desktop {
        display: none !important;
    }

    /* Show compact stats card on mobile */
    .mobile-stats-compact {
        display: block;
        margin-bottom: 1rem;
    }

    .mobile-stats-compact .card {
        border: 1px solid var(--bs-border-color);
        border-radius: 0.5rem;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .mobile-stats-compact .stats-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .mobile-stats-compact .stat-item {
        text-align: center;
    }

    .mobile-stats-compact .stat-value {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--bs-emphasis-color);
        line-height: 1;
        margin-bottom: 0.25rem;
    }

    .mobile-stats-compact .stat-label {
        font-size: 0.75rem;
        color: var(--bs-secondary-color);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-weight: 500;
    }

    .mobile-stats-compact .stat-icon {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
        opacity: 0.6;
    }
}

/* Mobile Card List */
.mobile-card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Individual Mobile Card */
.mobile-data-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-data-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Mobile Card Header */
.mobile-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

.mobile-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.mobile-card-title {
    flex: 1;
    min-width: 0;
}

.mobile-card-title h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-emphasis-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-card-title small {
    display: block;
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Card Body */
.mobile-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.mobile-card-row:last-child {
    border-bottom: none;
}

.mobile-card-label {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    font-weight: 500;
    flex-shrink: 0;
}

.mobile-card-value {
    font-size: 0.9375rem;
    color: var(--bs-body-color);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile Card Footer */
.mobile-card-footer {
    padding: 1rem;
    background: var(--bs-tertiary-bg);
    border-top: 1px solid var(--bs-border-color);
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.mobile-card-footer .btn {
    min-height: 44px;
    min-width: 44px;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
}

.mobile-card-footer .btn-sm {
    min-height: 44px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

/* Badge overrides in mobile cards */
.mobile-card-value .badge {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Icon spacing in mobile cards */
.mobile-card-value i {
    margin-right: 0.25rem;
}

/* Empty state in mobile */
.mobile-card-view .text-center {
    padding: 3rem 1rem;
}

.mobile-card-view .text-center i {
    font-size: 3rem;
    color: var(--bs-secondary-color);
    opacity: 0.5;
}
