* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f6f8;
    color: #17202a;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #ffffff;
    border-bottom: 1px solid #d9e0e7;
}

.brand {
    font-weight: 800;
    font-size: 18px;
}

.userline {
    display: inline-block;
    margin-top: 3px;
    color: #667085;
    font-size: 13px;
}

.userline:hover {
    color: #175cd3;
}

.page {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 16px;
}

.login-panel,
.detail,
.empty {
    background: #ffffff;
    border: 1px solid #d9e0e7;
    border-radius: 8px;
    padding: 18px;
}

.login-panel {
    margin-top: 40px;
}

.login-panel h1,
.detail h1 {
    margin: 0 0 18px;
    font-size: 22px;
}

.form-stack {
    display: grid;
    gap: 14px;
}

label span {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 14px;
}

input {
    width: 100%;
    min-height: 44px;
    border: 1px solid #b9c3cf;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 16px;
}

select {
    min-height: 40px;
    border: 1px solid #b9c3cf;
    border-radius: 6px;
    padding: 8px 10px;
    background: #ffffff;
    font-size: 15px;
}

button,
.primary-btn,
.secondary-btn,
.ghost-btn {
    min-height: 40px;
    border-radius: 6px;
    border: 1px solid transparent;
    padding: 9px 13px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
}

.top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.primary-btn {
    background: #0b72e7;
    color: #ffffff;
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-color: #b9c3cf;
}

.ghost-btn {
    background: #eef2f6;
    color: #344054;
}

.ghost-btn.active {
    background: #17202a;
    color: #ffffff;
    border-color: #17202a;
}

.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.tabs a {
    padding: 11px;
    background: #ffffff;
    border: 1px solid #d9e0e7;
    border-radius: 6px;
    text-align: center;
    font-weight: 800;
}

.tabs a.active {
    background: #17202a;
    color: #ffffff;
}

.admin-filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 8px;
    margin-bottom: 12px;
}

.order-list {
    display: grid;
    gap: 12px;
}

.order-card {
    background: #ffffff;
    border: 1px solid #d9e0e7;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

.order-head,
.detail-head,
.actions,
.meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.status-wrap {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.order-head {
    padding: 12px 14px;
    background: #eaf2fb;
    border-bottom: 1px solid #c9d8e8;
}

.order-card:nth-child(even) .order-head {
    background: #eef8f1;
    border-bottom-color: #cfe4d5;
}

.order-head strong {
    display: block;
    margin-bottom: 3px;
    font-size: 18px;
}

.order-head span,
.meta {
    color: #667085;
    font-size: 13px;
}

.status {
    white-space: nowrap;
    border-radius: 999px;
    background: #edf7ed;
    color: #187a2f;
    padding: 5px 9px;
    font-weight: 800;
    font-size: 13px;
}

.order-card .route,
.order-card .meta,
.order-card .eta-form,
.order-card .actions {
    margin-left: 14px;
    margin-right: 14px;
}

.edit-flag {
    border-radius: 999px;
    padding: 4px 8px;
    font-weight: 800;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.edit-flag.can {
    background: #eaf8ee;
    color: #176b31;
}

.edit-flag.cannot {
    background: #fdecec;
    color: #b42318;
}

.status-wrap .customer-pay {
    border-radius: 999px;
    padding: 4px 8px;
    font-weight: 800;
    font-size: 12px;
    background: #ff00cc;
    color: #fff;
    line-height: 1;
}

.route {
    display: grid;
    gap: 8px;
    margin: 14px 0;
}

.route div,
.detail-grid dd {
    line-height: 1.45;
}

.route b {
    display: inline-block;
    min-width: 38px;
    margin-right: 6px;
}

.route div:first-child b,
.start {
    color: #d92d20;
}

.route div:last-child b,
.end {
    color: #175cd3;
}

.meta {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.danger {
    background: #d92d20;
    color: #ffffff;
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 800;
}

.notice {
    background: #eef4ff;
    color: #175cd3;
    border-radius: 4px;
    padding: 2px 6px;
    font-weight: 800;
}

.order-head .danger {
    color: #ffffff;
}

.actions {
    justify-content: flex-end;
    margin-bottom: 14px;
}

.actions form {
    margin: 0;
}

.assign-actions {
    align-items: stretch;
}

.assign-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 8px;
}

.eta-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin: 12px 0;
}

.eta-form button {
    background: #ffcc00;
    color: #111111;
}

.detail-grid {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 10px 12px;
}

.detail-grid dt {
    color: #667085;
    font-weight: 800;
}

.detail-grid dd {
    margin: 0;
}

.profile-summary {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #d9e0e7;
}

.profile-form {
    max-width: 420px;
}

.profile-actions {
    justify-content: flex-start;
    margin-bottom: 0;
}

.flash {
    margin-bottom: 12px;
    border-radius: 6px;
    padding: 11px 12px;
    font-weight: 700;
}

.flash.success {
    background: #eaf8ee;
    color: #176b31;
}

.flash.error {
    background: #fdecec;
    color: #b42318;
}

.flash.info {
    background: #eef4ff;
    color: #175cd3;
}

@media (max-width: 520px) {
    .page {
        padding: 12px;
    }

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

    .assign-actions,
    .assign-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-filters {
        grid-template-columns: 1fr;
    }

    .detail-grid dt {
        margin-top: 6px;
    }
}
