.s1-dashboard {
    container: s1-dashboard / inline-size;
}

.s1-dashboard .s1-welcome {
    min-height: 15rem;
    background-color: #091426;
}

.s1-dashboard .s1-welcome::before {
    inset: 0;
    width: 100%;
    mask-image: none;
    background: linear-gradient(90deg, rgba(6, 16, 33, .93), rgba(6, 16, 33, .76) 35%, rgba(6, 16, 33, .12) 68%),
                url("../img/server-room.webp") right center / cover no-repeat;
}

.s1-dashboard .s1-welcome-copy {
    position: relative;
    max-width: 60%;
}

.s1-dashboard .s1-welcome-label {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.s1-dashboard .s1-welcome-label::before {
    content: "";
    flex: none;
    width: 1.25rem;
    height: .19rem;
    background: #ef3341;
}

.s1-dashboard .s1-order-link {
    margin-top: 1rem;
    padding: .55rem .9rem;
    border-radius: .45rem;
    white-space: normal;
    font-size: .9rem;
}

.s1-dashboard .s1-order-link i {
    margin-inline-end: .35rem;
}

.s1-dashboard .tiles .row > div {
    --tile-color: #a61e2b;
    --tile-tint: #fbe9eb;
    min-width: 0;
}

.s1-dashboard .tiles .row > div:nth-child(2) {
    --tile-color: #305f93;
    --tile-tint: #e9f0f9;
}

/* Twenty-One's last pair is tickets, then invoices. */
.s1-dashboard .tiles .row > div:nth-child(3) {
    --tile-color: #705092;
    --tile-tint: #f0eaf7;
    order: 2;
}

.s1-dashboard .tiles .row > div:nth-child(4) {
    --tile-color: #85530a;
    --tile-tint: #fff2da;
    order: 1;
}

.primary-content .s1-dashboard .tiles .row > div > .tile {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-content: center;
    column-gap: .75rem;
    min-height: 5.5rem;
    padding: .85rem;
}

.s1-dashboard .tiles .row .tile > i,
.s1-dashboard .tiles .row .tile:hover > i {
    position: static;
    grid-row: span 2;
    align-self: center;
    display: grid;
    place-items: center;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: .65rem;
    color: var(--tile-color);
    background: var(--tile-tint);
    font-size: 1rem;
}

.s1-dashboard .tiles .tile .stat {
    font-size: 1.8rem;
    line-height: 1.1;
}

.s1-dashboard .tiles .tile .title {
    margin-top: .15rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.s1-dashboard .client-home-cards .card-title {
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.s1-dashboard .client-home-cards .card .card-header {
    padding: 1rem 1.15rem;
}

.s1-dashboard .client-home-cards .card .card-footer:empty {
    display: none;
}

.s1-dashboard .client-home-cards .card .card-header .btn-default {
    border: 0;
    background: #f9ebec;
    color: #a21725;
}

.s1-dashboard .client-home-cards .card .card-header .btn-default:hover {
    background: var(--s1-red-dark);
    color: white;
}

.s1-dashboard .client-home-cards :is([menuItemName="Unpaid Invoices"], [menuItemName="Overdue Invoices"]).card {
    color: #fff;
    border-color: #192641;
    background: repeating-radial-gradient(ellipse at 105% -25%, transparent 0 29px, #c0d3ff16 30px, transparent 31px 47px),
                linear-gradient(110deg, #1a2844, #101a31);
}

.s1-dashboard .client-home-cards :is([menuItemName="Unpaid Invoices"], [menuItemName="Overdue Invoices"]) .card-header {
    border-color: #ffffff28;
}

.s1-dashboard .client-home-cards :is([menuItemName="Unpaid Invoices"], [menuItemName="Overdue Invoices"]) .card-title {
    color: white;
}

.s1-dashboard .client-home-cards [menuItemName="Active Products/Services"] .div-service-name {
    font-weight: 650;
}

/* Retain the parent panel markup, including full-width panels added by modules. */
@container s1-dashboard (min-width: 48rem) {
    .s1-dashboard .client-home-cards > .row {
        display: grid;
        grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
        gap: 1rem;
        margin: 0;
    }

    .s1-dashboard .client-home-cards > .row > div {
        display: contents;
    }

    .s1-dashboard .client-home-cards > .row > div > .card {
        min-width: 0;
        margin: 0;
    }

    .s1-dashboard .client-home-cards > .row > div > [menuItemName="Active Products/Services"] {
        order: -2;
    }

    .s1-dashboard .client-home-cards > .row > div > :is([menuItemName="Unpaid Invoices"], [menuItemName="Overdue Invoices"]) {
        order: -1;
    }

    .s1-dashboard .client-home-cards > .row > div > [menuItemName="Recent Support Tickets"] {
        grid-column: 1 / -1;
    }

    .s1-dashboard .client-home-cards > .row > .col-12 > .card {
        order: -3;
        grid-column: 1 / -1;
    }
}

@container s1-dashboard (max-width: 46rem) {
    .primary-content .s1-dashboard .tiles .row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container s1-dashboard (max-width: 31rem) {
    .s1-dashboard .s1-welcome {
        min-height: 14rem;
        padding: 1.25rem;
        align-items: center;
    }

    .s1-dashboard .s1-welcome::before {
        background-position: center, 69% center;
        background-image: linear-gradient(90deg, rgba(6, 16, 33, .94), rgba(6, 16, 33, .68) 52%, rgba(6, 16, 33, .18)),
                          url("../img/server-room.webp");
    }

    .s1-dashboard .s1-welcome-copy {
        max-width: 64%;
    }

    .s1-dashboard .s1-welcome h1 {
        font-size: 1.85rem;
    }
}
