.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    .nedspice-badge {
        width: 1rem;
        height: 1rem;
        padding: 0.5rem;
        margin-left: 0.25rem;
        margin-top: -0.15rem;
        font-size: 0.65rem;
        background-color: var(--bs-primary) !important;
    }
    .contract-actions {
        .card-body {
            padding-top: 0.7rem;
        }
        .container {
            font-size: 0.9rem;
            .list-group {
                list-style-type: none;
            }
            .card-title {
                i {
                    font-size: 1.15rem;
                    color: #aaa;
                }
            }
        }
        .contract {
            font-size: 0.85rem;
            line-height: 1.2;
            margin-bottom: 0.3rem;
            p {
                color: #a8a8a8;
                font-size: 0.8rem;
            }
            a {
                white-space: nowrap;
                text-overflow: ellipsis;
                overflow: hidden;
            }
        }
    }
    .order-tracker {
        .card-body {
            padding-top: 0.7rem;
        }
        .container {
            font-size: 0.9rem;
            .list-group {
                list-style-type: none;
            }
            .card-title {
                i {
                    font-size: 1.15rem;
                    color: #aaa;
                }
            }
        }
        .contract {
            font-size: 0.8rem;
            line-height: 1.2;
            margin-bottom: 0.3rem;
            p {
                color: #a8a8a8;
                font-size: 0.75rem;
            }
            a {
                white-space: nowrap;
                text-overflow: ellipsis;
                overflow: hidden;
            }
        }
    }
}

.order-tracker-icon {
    width: 5rem;
    height: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden; /* clip square SVGs into a circle */
    object-fit: cover; /* ensure coverage if non-square sources ever appear */
}

/* Badge overlay on top-right of the circular icon */
.order-tracker-icon-wrap {
    position: relative;
    display: inline-block;
}

.order-tracker-badge {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    margin: 0 !important; /* override list/header spacing rules */
    border-radius: 999px; /* ensure pill is fully rounded */
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Contract Actions: only scroll when content would exceed the viewport */
:root {
    /* Default offset to account for dashboard header, paddings, and spacing.
       Adjust in layout if needed by overriding --contract-actions-offset. */
    --contract-actions-offset: 260px;
    --order-tracker-offset: 260px;
}

.contract-actions-scroll {
    /* Allow vertical scroll only when needed */
    overflow-y: auto;
    /* Cap height to available viewport area so it doesn't push beyond screen */
    max-height: calc(100vh - var(--contract-actions-offset));
}

.order-tracker-scroll {
    /* Allow vertical scroll only when needed */
    overflow-y: auto;
    /* Cap height to available viewport area so it doesn't push beyond screen */
    max-height: calc(100vh - var(--order-tracker-offset));
}

/* Ensure text truncation works next to fixed-size icons inside flex rows */
.order-tracker .text-col { min-width: 0; }

/* Slightly different offsets by breakpoint if needed */
@media (max-width: 991.98px) {
    :root { --contract-actions-offset: 220px; }
    :root { --order-tracker-offset: 220px; }
}
@media (max-width: 575.98px) {
    :root { --contract-actions-offset: 200px; }
    :root { --order-tracker-offset: 200px; }
}
