/* Dashboard summary stat cards (.stat-card / .stat-icon / .stat-number ...).
   Globally loaded — stat cards appear on the dashboard and the list pages, so
   this can't live in a page-scoped sheet. The <=576px block hides the boxed
   cards on mobile (the lists carry the counts) and restyles the compact form. */

/* Mobile dashboard stats */
.dashboard-stats {
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-base);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card-primary .stat-icon {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--entity-color-clients);
}

.stat-card-warning .stat-icon {
    background: rgba(255, 193, 7, 0.1);
    color: var(--entity-color-quotes);
}

.stat-card-success .stat-icon {
    background: rgba(25, 135, 84, 0.1);
    color: var(--entity-color-jobs);
}

.stat-card-info .stat-icon {
    background: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
}

.stat-card-orange .stat-icon {
    background: rgba(253, 126, 20, 0.1);
    color: var(--entity-color-invoices);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Hide inline icons on desktop - shown on mobile only */
.stat-icon-inline {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 576px) {
    /* Summary stat cards are hidden on mobile across dashboard,
       quotes, jobs, invoices and clients — the lists themselves
       carry the relevant counts. The .stat-* rules below remain
       for any non-mobile-hidden usage. */
    .dashboard-stats {
        display: none;
    }

    .dashboard-stats .row.g-3 {
        --bs-gutter-y: 0.5rem;
        --bs-gutter-x: 0.5rem;
    }

    .stat-card {
        padding: 8px 6px;
        border-radius: 10px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2px;
    }

    /* Hide boxed icon on mobile */
    .stat-card > .stat-icon {
        display: none;
    }

    .stat-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .stat-number {
        font-size: 1.15rem;
        margin-bottom: 0;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    /* Show inline icon on mobile */
    .stat-icon-inline {
        display: inline !important;
        font-size: 1rem;
    }

    .stat-card-warning .stat-icon-inline { color: var(--entity-color-quotes); }
    .stat-card-success .stat-icon-inline { color: var(--entity-color-jobs); }
    .stat-card-info .stat-icon-inline { color: #0dcaf0; }
    .stat-card-orange .stat-icon-inline { color: var(--entity-color-invoices); }

    .stat-label {
        font-size: 0.65rem;
        letter-spacing: 0.2px;
        margin-top: 2px;
    }
}
