/* Order-focused home dashboard */
.home-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.home-order-stats {
    margin-bottom: 1.25rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.home-order-stat {
    position: relative;
    min-width: 0;
    overflow: hidden;
    padding: 1.15rem 1.2rem;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    text-decoration: none;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.home-order-stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.3rem;
}

.home-order-stat.pending::before { background: var(--gold); }
.home-order-stat.moving::before { background: #3c7697; }
.home-order-stat.delivered::before { background: var(--leaf); }
.home-order-stat.attention::before { background: var(--wine); }

.home-order-stat:hover {
    color: var(--ink);
    transform: translateY(-2px);
    box-shadow: 0 21px 60px rgba(50, 39, 31, 0.14);
}

.home-order-stat > span {
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 850;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.home-order-stat strong {
    margin: 0.25rem 0 0.1rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
    font-weight: 400;
}

.home-order-stat small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.64rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-status-strip {
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem 1.4rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(117, 104, 91, 0.14);
    border-radius: 0.65rem;
    font-size: 0.68rem;
}

.home-status-strip > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #45652d;
    font-weight: 800;
}

.home-status-strip a {
    margin-left: auto;
    font-weight: 850;
    text-decoration: none;
}

.home-orders-card {
    padding: 1.35rem;
}

.home-orders-card .card-header-row > a {
    font-size: 0.7rem;
    font-weight: 850;
    text-decoration: none;
}

.home-order-list {
    display: grid;
}

.home-order-row {
    min-width: 0;
    padding: 0.9rem 0.15rem;
    display: grid;
    grid-template-columns: 6rem minmax(12rem, 1fr) auto auto 3.5rem;
    align-items: center;
    gap: 0.8rem;
    color: var(--ink);
    border-bottom: 1px solid #eee9e2;
    text-decoration: none;
}

.home-order-row:last-child {
    border-bottom: 0;
}

.home-order-row:hover {
    color: var(--ink);
    background: #fcfaf7;
}

.home-order-number {
    color: var(--wine);
    font-size: 0.78rem;
    font-weight: 900;
}

.home-order-customer {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.home-order-customer strong,
.home-order-customer small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-order-customer strong {
    font-size: 0.78rem;
}

.home-order-customer small {
    color: var(--muted);
    font-size: 0.63rem;
}

.home-order-open {
    color: var(--wine);
    font-size: 0.68rem;
    font-weight: 850;
    text-align: right;
}

.compose-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.send-blocked-message.held {
    color: #806127;
    background: var(--gold-soft);
    border: 1px solid #e9d8b5;
}

.shipment-live-summary,
.shipment-draft-message {
    margin: 0.85rem 0 0;
    padding: 0.65rem 0.75rem;
    color: #514a44;
    background: #f7f4ef;
    border-radius: 0.45rem;
    font-size: 0.67rem;
}

.automatic-jobs-card {
    margin-bottom: 1.25rem;
    padding: 1.35rem;
}

.automatic-job-grid {
    padding-top: 1.1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.automatic-job-card {
    min-width: 0;
    padding: 0.95rem;
    background: #faf8f5;
    border: 1px solid #e8e2da;
    border-top: 3px solid #9b948d;
    border-radius: 0.55rem;
}

.automatic-job-card.status-succeeded { border-top-color: var(--leaf); }
.automatic-job-card.status-running { border-top-color: #3c7697; }
.automatic-job-card.status-waiting { border-top-color: var(--gold); }
.automatic-job-card.status-failed { border-top-color: var(--wine); background: #fff8fa; }

.automatic-job-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
}

.automatic-job-heading strong {
    overflow: hidden;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.automatic-job-card > p {
    min-height: 2.3rem;
    margin: 0.65rem 0;
    color: var(--muted);
    font-size: 0.65rem;
}

.automatic-job-card > small {
    margin-bottom: 0.6rem;
    display: block;
    font-size: 0.62rem;
}

.automatic-job-card dl {
    margin: 0;
    display: grid;
    gap: 0.35rem;
}

.automatic-job-card dl div {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.58rem;
}

.automatic-job-card dt { color: var(--muted); font-weight: 650; }
.automatic-job-card dd { margin: 0; font-weight: 800; text-align: right; }

.shipment-draft-message {
    color: #806127;
    background: var(--gold-soft);
}

@media (max-width: 1050px) {
    .home-order-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-order-row {
        grid-template-columns: 5.5rem minmax(10rem, 1fr) auto auto;
    }

    .automatic-job-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-order-open {
        display: none;
    }
}

@media (max-width: 700px) {
    .home-heading-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .home-order-stats {
        grid-template-columns: 1fr;
    }

    .automatic-job-grid {
        grid-template-columns: 1fr;
    }

    .home-status-strip a {
        width: 100%;
        margin-left: 0;
    }

    .home-order-row {
        grid-template-columns: 5rem minmax(0, 1fr);
        align-items: start;
    }

    .home-order-row > .handling-status,
    .home-order-row > .shipment-status-badge {
        grid-column: 2;
        width: fit-content;
    }
}
