* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f7f1e7;
    color: #111827;
}

.delivery-header {
    background: #111827;
    color: white;
    padding: 26px 7%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.eyebrow {
    color: #d19035;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.delivery-header h1 {
    margin: 0;
    font-size: 34px;
}

.delivery-header p {
    margin: 8px 0 0;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

button {
    border: none;
    border-radius: 999px;
    padding: 13px 20px;
    font-weight: 900;
    cursor: pointer;
    transition: .25s;
}

button:hover {
    transform: translateY(-2px);
}

button:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
}

#backOrdersBtn {
    background: white;
    color: #111827;
}

#refreshDeliveryBtn {
    background: #d19035;
    color: white;
}

.delivery-page {
    width: 94%;
    max-width: 1700px;
    margin: 32px auto;
}

.delivery-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 26px;
}

.summary-card {
    background: white;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, .08);
}

.summary-card span {
    display: block;
    color: #a55f00;
    font-weight: 900;
    margin-bottom: 8px;
}

.summary-card strong {
    font-size: 32px;
}

.loading-box,
.error-box {
    background: white;
    padding: 26px;
    border-radius: 22px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, .08);
    text-align: center;
    font-weight: 900;
}

.error-box {
    color: #991b1b;
    background: #fef2f2;
}

.hidden {
    display: none !important;
}

.delivery-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    align-items: flex-start;
}

.delivery-column {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, .08);
    overflow: hidden;
    min-height: 400px;
}

.column-header {
    padding: 18px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-header h2 {
    margin: 0;
    font-size: 20px;
}

.column-header span {
    background: rgba(255, 255, 255, .22);
    border-radius: 999px;
    padding: 8px 13px;
    font-weight: 900;
}

.column-header.pending {
    background: #d19035;
}

.column-header.assigned {
    background: #2563eb;
}

.column-header.out {
    background: #7c3aed;
}

.column-header.delivered {
    background: #16a34a;
}

.column-body {
    padding: 16px;
}

.delivery-ticket {
    background: #fffdf8;
    border: 1px solid #eadcc9;
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 14px;
}

.ticket-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px dashed #d6c8b8;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.ticket-top h3 {
    margin: 0;
    font-size: 18px;
}

.ticket-time {
    color: #92400e;
    font-weight: 900;
    white-space: nowrap;
}

.ticket-info {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.ticket-info div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.ticket-info span {
    color: #6b7280;
    font-weight: 800;
}

.ticket-info strong {
    text-align: right;
}

.delivery-address {
    background: #eef2ff;
    border-radius: 12px;
    padding: 12px;
    margin: 12px 0;
    color: #1e3a8a;
    font-size: 14px;
    line-height: 1.5;
}

.ticket-items {
    border-top: 1px dashed #d6c8b8;
    border-bottom: 1px dashed #d6c8b8;
    padding: 12px 0;
    margin: 12px 0;
}

.ticket-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 15px;
}

.ticket-item:last-child {
    margin-bottom: 0;
}

.ticket-item strong {
    font-size: 18px;
}

.ticket-notes {
    background: #fff7ed;
    color: #9a3412;
    border-radius: 12px;
    padding: 10px;
    margin: 12px 0;
    font-size: 14px;
    line-height: 1.4;
}

.ticket-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.ticket-actions button,
.ticket-actions a {
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    font-weight: 900;
    font-size: 14px;
}

.assign-btn {
    background: #2563eb;
    color: white;
}

.out-btn {
    background: #7c3aed;
    color: white;
}

.delivered-btn {
    background: #16a34a;
    color: white;
}

.complete-btn {
    background: #111827;
    color: white;
}

.details-btn {
    background: #e5e7eb;
    color: #111827;
}

.call-btn {
    background: #dcfce7;
    color: #166534;
}

.map-btn {
    background: #dbeafe;
    color: #1d4ed8;
}

.empty-column {
    padding: 28px 10px;
    text-align: center;
    color: #6b7280;
    border: 1px dashed #d1d5db;
    border-radius: 16px;
    background: #fafafa;
}

.buildframe-footer {
    background: #111827;
    color: white;
    text-align: center;
    padding: 22px;
    margin-top: 50px;
}

.buildframe-footer a {
    color: #22d3ee;
    text-decoration: none;
}

@media (max-width: 1300px) {
    .delivery-board {
        grid-template-columns: repeat(2, 1fr);
    }

    .delivery-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {
    .delivery-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .delivery-header h1 {
        font-size: 32px;
    }

    .header-actions,
    .header-actions button {
        width: 100%;
    }

    .delivery-summary,
    .delivery-board {
        grid-template-columns: 1fr;
    }

    .delivery-page {
        width: 92%;
        margin: 22px auto;
    }

    .summary-card,
    .delivery-column {
        border-radius: 18px;
    }
}

.no-phone-btn {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}