:root {
    --ink: #17212b;
    --muted: #687381;
    --line: #d9e0e7;
    --surface: #ffffff;
    --page: #eef3f6;
    --primary: #0f5f70;
    --primary-dark: #0a4652;
    --accent: #d99a2b;
    --danger: #a83c35;
    --success: #1f7a55;
}

* {
    box-sizing: border-box;
}

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

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

.login-page {
    min-height: 100vh;
    background: linear-gradient(120deg, rgba(15, 95, 112, .88), rgba(23, 33, 43, .90)), url("https://images.unsplash.com/photo-1494412651409-8963ce7935a7?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(430px, 100%);
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .18);
}

.brand-mark {
    display: inline-grid;
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    place-items: center;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: inset 0 -4px 0 var(--accent);
}

.brand-mark.small {
    width: 36px;
    height: 36px;
    margin: 0;
    font-size: 14px;
}

.login-panel {
    text-align: center;
}

.login-panel .brand-mark {
    margin-left: auto;
    margin-right: auto;
}

.login-panel form {
    text-align: left;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 6px;
    font-size: clamp(28px, 4vw, 42px);
}

h2 {
    margin-bottom: 18px;
    font-size: 21px;
}

.login-panel p,
.muted {
    color: var(--muted);
}

.form-stack,
.ride-form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: #31404d;
    font-size: 14px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid #c9d3dc;
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
}

input[type="file"] {
    padding: 10px;
    background: #fff;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 95, 112, .16);
    outline: none;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 800;
    cursor: pointer;
}

.button.primary {
    background: var(--primary);
    color: #fff;
}

.button.primary:hover {
    background: var(--primary-dark);
}

.button.secondary {
    background: #fff;
    border-color: var(--line);
    color: var(--primary-dark);
}

.topbar {
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 34px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.brand,
.topbar nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    font-weight: 800;
}

.topbar nav a {
    padding: 8px 10px;
    color: #344554;
    font-weight: 700;
}

.topbar nav a:hover {
    color: var(--primary);
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 48px;
}

.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.eyebrow {
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.panel {
    margin-bottom: 24px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.ride-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.ride-form label:first-child {
    grid-column: span 2;
}

.file-field {
    grid-column: span 2;
}

.file-field span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

.ride-form .button {
    align-self: end;
}

.alert,
.notice,
.empty-state {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 6px;
}

.alert {
    background: #fff0ee;
    color: var(--danger);
    border: 1px solid #efc9c4;
}

.notice {
    background: #edf8f2;
    color: var(--success);
    border: 1px solid #bfe4cf;
}

.empty-state {
    margin: 0;
    background: #f5f8fa;
    color: var(--muted);
    border: 1px dashed #c7d1da;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-title h2 {
    margin: 0;
}

.section-title span {
    color: var(--muted);
    font-weight: 700;
}

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

table,
thead,
tbody,
tr,
th,
td {
    display: block;
}

table {
    width: 100%;
    min-width: 0;
    border-collapse: separate;
    background: transparent;
}

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

tbody {
    display: grid;
    gap: 14px;
}

tr {
    display: grid;
    grid-template-columns: 1.45fr 1fr 1fr 1fr;
    gap: 14px 22px;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(23, 33, 43, .06);
}

td {
    display: grid;
    gap: 6px;
    align-content: start;
    padding: 0;
    border-bottom: 0;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

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

td:first-child {
    font-size: 16px;
    font-weight: 800;
    grid-column: 1 / -1;
}

td:nth-child(2),
td:nth-child(3),
td:nth-child(5),
td:nth-child(6),
td:nth-child(7),
td:nth-child(8) {
    grid-column: span 1;
}

td:nth-child(4) {
    grid-column: span 2;
}

td:nth-child(9) {
    grid-column: 1 / span 3;
    grid-row: 5;
}

td:nth-child(8) {
    grid-column: 1;
    grid-row: 4;
}

td:nth-child(10) {
    grid-column: 4;
    grid-row: 6;
    align-self: end;
}

td:nth-child(11) {
    grid-column: 1 / span 3;
    grid-row: 6;
}

.distance {
    color: var(--primary-dark);
    font-weight: 800;
    white-space: nowrap;
}

.status {
    display: inline-flex;
    min-width: 86px;
    width: 100%;
    justify-content: center;
    padding: 5px 9px;
    background: #e8f2f5;
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

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

.file-actions a {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 800;
}

.file-actions a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.row-actions a,
.row-actions button {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--primary-dark);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.row-actions button {
    color: var(--danger);
}

.row-actions button.success-action {
    color: var(--success);
}

.row-actions a:hover,
.row-actions button:hover {
    border-color: currentColor;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

.pagination a {
    display: inline-flex;
    min-width: 38px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--primary-dark);
    font-weight: 800;
}

.pagination a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

@media (max-width: 760px) {
    .topbar,
    .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar {
        padding: 18px;
    }

    .topbar nav {
        flex-wrap: wrap;
    }

    .ride-form {
        grid-template-columns: 1fr;
    }

    .ride-form label:first-child {
        grid-column: auto;
    }

    .file-field {
        grid-column: auto;
    }

    .panel,
    .login-panel {
        padding: 20px;
    }

    .container {
        width: min(100% - 20px, 1180px);
        padding-top: 22px;
    }

    tr {
        display: block;
        padding: 14px;
    }

    td {
        display: grid;
        grid-template-columns: minmax(112px, 42%) 1fr;
        gap: 10px;
        align-items: start;
        padding: 9px 0;
        border-bottom: 1px solid #edf1f4;
        overflow-wrap: anywhere;
    }

    td:first-child,
    td:nth-child(10),
    td:nth-child(9),
    td:nth-child(11) {
        grid-column: auto;
        grid-row: auto;
    }

    td:first-child {
        padding-top: 0;
        font-size: 16px;
        font-weight: 800;
    }

    td:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    td:first-child::before {
        padding-top: 2px;
    }

    .file-actions,
    .row-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .file-actions a,
    .row-actions a,
    .row-actions button {
        width: 100%;
        justify-content: center;
    }

    .pagination {
        justify-content: center;
    }
}
