/* ─────────────────────────────────────────────
   Dashboard widget grid
   ───────────────────────────────────────────── */

.widget-grid {
    display: grid;
    gap: 10px;

    /* Columns are added/removed automatically as space allows.
       - min 160px  → 2 cols fits from ~330px upward (mobile)
       - min 160px  → 4 cols fits from ~650px upward (tablet)
       - min 160px  → 6 cols fits from ~970px upward (desktop, sidebar closed)
       - sidebar open narrows the container, so column count drops gracefully
       Adjust the 160px value to taste — larger = fewer columns at any given width. */

}

.widget-grid {
    grid-template-columns: 1fr;
}

@media (min-width: 320px) {
    .widget-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 512px) {
    .widget-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Wide grid variant: smaller min allows up to 12 columns */
.widget-grid--wide {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}


/* ─────────────────────────────────────────────
   Stat widget
   ───────────────────────────────────────────── */

.stat-widget {
    /*background: rgb(249,250,251);*/
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    transition: border-color 0.15s ease;

    /* Mobile: 2 columns are narrow — use fixed height only, no aspect-ratio */
    flex-direction: column;
    height: 100%;
}


/* Top half – icon + title */

.stat-widget__top {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 12px 12px 6px;
}

.stat-widget__icon-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.stat-widget__icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    /*background: #f3f4f6;*/
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-widget__title {
    font-size: 15px;
    font-weight: 400;
    color: #616367;
    line-height: 1.35;
    margin: 0;
    padding-top: 3px;
}

/* Bottom half – value + trend */

.stat-widget__bottom {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 6px 12px 12px;
}

.stat-widget__value {
    font-size: 24px;
    font-weight: 500;
    color: #111827;
    line-height: 1;
    margin: 0;
}

@media (min-width: 1024px) {
    .stat-widget__value {
        font-size: 24px;
    }
}

.stat-widget__trend {
    font-size: 13px;
    font-weight: 400;
}

.stat-widget__trend--up {
    color: #1D9E75;
}

.stat-widget__trend--down {
    color: #D85A30;
}

.stat-widget__trend--neutral {
    color: #9ca3af;
}


