:root {
    color-scheme: light;
    --ink: #18202a;
    --muted: #5d6978;
    --line: #d8dee8;
    --panel: #ffffff;
    --paper: #f4f6f9;
    --brand: #f4c430;
    --brand-ink: #1d1b12;
    --green: #137a4b;
    --red: #a12c2f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--paper);
}

a {
    color: inherit;
}

.topbar {
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr auto 1fr;
    min-height: 72px;
    padding: 12px clamp(16px, 4vw, 40px);
}

.brand {
    align-items: center;
    grid-column: 2;
    display: flex;
    gap: 14px;
    justify-self: center;
    min-width: 0;
    text-decoration: none;
}

.brand img {
    background: #fff;
    border-radius: 6px;
    height: 44px;
    object-fit: contain;
    padding: 3px 8px;
    width: 126px;
}

.brand strong {
    display: block;
    font-size: 18px;
}

.brand span {
    color: #cbd3de;
    display: block;
    font-size: 13px;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    grid-column: 3;
    justify-self: end;
}

@media (max-width: 760px) {
    .topbar {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .brand,
    .nav {
        grid-column: 1;
        justify-self: center;
    }

    .nav {
        justify-content: center;
    }
}

.nav a,
.button,
button {
    align-items: center;
    background: var(--brand);
    border: 1px solid #d2a812;
    border-radius: 6px;
    color: var(--brand-ink);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 42px;
    padding: 9px 13px;
    text-decoration: none;
}

.nav a.secondary,
.button.secondary,
button.secondary {
    background: transparent;
    border-color: #526071;
    color: #fff;
}

.panel button.secondary,
.card button.secondary,
.table-wrap button.secondary {
    border-color: #8d98a7;
    color: var(--ink);
}

button:disabled,
select:disabled,
input:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

button:disabled {
    background: #e4e8ee;
    border-color: #c5ccd6;
    color: #6c7684;
}

.wrap {
    margin: 0 auto;
    max-width: 1120px;
    padding: 28px clamp(14px, 4vw, 40px) 56px;
}

.hero {
    background: #fff;
    border-bottom: 4px solid var(--brand);
    padding: clamp(22px, 4vw, 44px);
}

.hero h1,
.panel h1 {
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
    margin: 0 0 12px;
}

.hero p,
.panel p {
    color: var(--muted);
    line-height: 1.5;
    margin: 0 0 16px;
}

.grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.compact-field {
    max-width: 260px;
    width: min(100%, 260px);
}

.hidden-field[hidden] {
    display: none;
}

.route-estimate {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: inline-grid;
    gap: 4px;
    max-width: 260px;
    padding: 12px 14px;
}

.route-estimate strong {
    font-size: 18px;
}

.panel,
.card,
.table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

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

label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

input,
select,
textarea {
    border: 1px solid #bac4d1;
    border-radius: 6px;
    font: inherit;
    min-height: 42px;
    padding: 9px 10px;
    width: 100%;
}

textarea {
    min-height: 92px;
    resize: vertical;
}

.hint,
.meta {
    color: var(--muted);
    font-size: 14px;
}

.status {
    background: #e9edf3;
    border-radius: 999px;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 9px;
    text-transform: capitalize;
}

.status.paid {
    background: #dff3e8;
    color: var(--green);
}

.status.assigned,
.status.accepted {
    background: #fff3cd;
    color: #7a5a00;
}

.status.driver_en_route,
.status.arrived,
.status.in_progress {
    background: #dbeafe;
    color: #1d4f91;
}

.status.completed,
.status.payment_pending,
.status.pending,
.status.unpaid {
    background: #eef0f4;
    color: #465365;
}

.status.disputed,
.status.cancelled {
    background: #f8e2e3;
    color: var(--red);
}

table {
    border-collapse: collapse;
    min-width: 820px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    font-size: 13px;
}

.table-wrap {
    overflow-x: auto;
    padding: 0;
}

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

.event {
    border-left: 4px solid var(--brand);
    padding: 8px 0 8px 12px;
}

.money {
    font-size: 26px;
    font-weight: 800;
}

.map-surface {
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 360px;
    width: 100%;
}

@media (max-width: 720px) {
    .nav {
        width: 100%;
    }

    .nav a {
        flex: 1;
    }

    .table-wrap {
        background: transparent;
        border: 0;
        overflow: visible;
    }

    table,
    thead,
    tbody,
    tfoot,
    tr,
    th,
    td {
        display: block;
        min-width: 0;
        width: 100%;
    }

    thead {
        clip: rect(0 0 0 0);
        height: 1px;
        overflow: hidden;
        position: absolute;
        white-space: nowrap;
        width: 1px;
    }

    tbody tr,
    tfoot tr {
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 8px;
        margin-bottom: 12px;
        overflow: hidden;
    }

    td,
    tfoot th {
        align-items: start;
        border-bottom: 1px solid var(--line);
        display: grid;
        gap: 10px;
        grid-template-columns: minmax(96px, 38%) 1fr;
        min-height: 44px;
        overflow-wrap: anywhere;
    }

    td::before,
    tfoot th::before {
        color: var(--muted);
        content: attr(data-label);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
    }

    td:last-child,
    tfoot th:last-child {
        border-bottom: 0;
    }

    td form,
    td .stack {
        min-width: 0;
    }

    .booking-row {
        display: grid;
        gap: 0;
        padding: 12px;
    }

    .booking-row td {
        border-bottom: 0;
        display: block;
        min-height: 0;
        padding: 4px 0;
    }

    .booking-row td::before {
        content: none;
    }

    .booking-row td[data-label="ID"] {
        font-size: 18px;
        font-weight: 800;
        padding-bottom: 6px;
    }

    .booking-row td[data-label="Status"],
    .booking-row td[data-label="Quote"],
    .booking-row td[data-label="Payment"],
    .booking-row td[data-label="Dispute"] {
        align-items: center;
        display: flex;
        gap: 8px;
        justify-content: space-between;
    }

    .booking-row td[data-label="Status"]::before,
    .booking-row td[data-label="Quote"]::before,
    .booking-row td[data-label="Payment"]::before,
    .booking-row td[data-label="Dispute"]::before {
        color: var(--muted);
        content: attr(data-label);
        display: block;
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .booking-row td[data-label="Passenger"],
    .booking-row td[data-label="Route"],
    .booking-row td[data-label="Driver"],
    .booking-row td[data-label="Split"] {
        color: var(--muted);
        font-size: 14px;
    }

    .booking-row td[data-label="Passenger"] {
        color: var(--ink);
        font-size: 16px;
        font-weight: 700;
    }

    .booking-row td[data-label="Payment"] {
        border-top: 1px solid var(--line);
        margin-top: 8px;
        padding-top: 10px;
    }
}
