:root {
    --ink: #101827;
    --muted: #64748b;
    --line: #dbe4ef;
    --panel: rgba(255, 255, 255, 0.92);
    --accent: #fb6b21;
    --accent-2: #08a6a6;
    --deep: #0d1726;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #eff4f8;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(115deg, rgba(8, 20, 35, .78), rgba(8, 20, 35, .34)),
        url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.login-shell {
    width: min(1100px, 100%);
    min-height: 650px;
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 28px;
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
    backdrop-filter: blur(16px);
}

.login-visual {
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #fff;
}

.brand-pill,
.eyebrow {
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .22);
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 12px;
}

.login-visual h1 {
    max-width: 660px;
    margin: 24px 0 14px;
    font-size: clamp(36px, 5vw, 70px);
    line-height: .95;
    letter-spacing: 0;
}

.login-visual p {
    max-width: 580px;
    margin: 0;
    color: rgba(255, 255, 255, .82);
    font-size: 18px;
    line-height: 1.55;
}

.signal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 34px;
}

.signal-grid div {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .18);
}

.signal-grid strong,
.signal-grid span {
    display: block;
}

.signal-grid span {
    margin-top: 5px;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
}

.login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 42px;
    background: rgba(255, 255, 255, .94);
}

.mark,
.logo {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), #ff9d3f);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 16px 34px rgba(251, 107, 33, .28);
}

.login-card h2 {
    margin: 26px 0 6px;
    font-size: 30px;
}

.login-card p {
    margin: 0 0 26px;
    color: var(--muted);
}

.login-card form {
    display: grid;
    gap: 16px;
}

label span {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 750;
}

input {
    width: 100%;
    height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 0 15px;
    font: inherit;
    outline: none;
    background: #fff;
}

select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0 12px;
    color: var(--ink);
    background: #fff;
    font: inherit;
    outline: none;
}

input:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 4px rgba(8, 166, 166, .12);
}

button {
    border: 0;
    border-radius: 14px;
    padding: 13px 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #ff8d2c);
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(251, 107, 33, .22);
}

button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #fecaca;
    border-radius: 14px;
    color: #991b1b;
    background: #fff1f2;
    font-weight: 700;
}

.driver-link {
    margin-top: 18px;
    color: var(--accent-2);
    font-weight: 800;
    text-decoration: none;
}

.panel-page {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px;
    background: var(--deep);
    color: #fff;
}

.sidebar nav {
    display: grid;
    gap: 8px;
    margin-top: 32px;
}

.sidebar a {
    padding: 12px 14px;
    border-radius: 12px;
    color: rgba(255, 255, 255, .72);
    text-decoration: none;
    font-weight: 750;
}

.sidebar a.active,
.sidebar a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .11);
}

.panel-main {
    padding: 28px;
}

.flash {
    margin: 20px 0 0;
    padding: 13px 15px;
    border-radius: 14px;
    font-weight: 800;
}

.flash-success {
    color: #047857;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
}

.flash-error {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fecaca;
}

.topbar,
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.topbar h1,
.section-head h2 {
    margin: 6px 0 0;
}

.topbar .eyebrow {
    color: var(--accent);
    background: #fff7ed;
    border-color: #fed7aa;
}

.logout {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
    text-decoration: none;
    font-weight: 800;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 26px 0;
}

.stats article,
.work-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

.stats article {
    padding: 20px;
}

.stats span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.stats strong {
    display: block;
    margin-top: 10px;
    font-size: clamp(20px, 2vw, 34px);
}

.work-card {
    margin-top: 18px;
    padding: 22px;
}

.paste-workspace {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 18px;
    margin-top: 18px;
}

.paste-card,
.preview-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    overflow: hidden;
}

.paste-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.paste-head h2 {
    margin: 0;
    font-size: 20px;
}

.paste-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.ghost-button {
    border: 1px solid var(--line);
    color: var(--ink);
    background: #fff;
    box-shadow: none;
    white-space: nowrap;
}

.paste-card form {
    padding: 16px;
}

.paste-area {
    width: 100%;
    min-height: 310px;
    resize: vertical;
    border: 1px solid #fed7aa;
    border-radius: 18px;
    padding: 16px;
    background: #fff;
    color: var(--ink);
    font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    outline: none;
    box-shadow: inset 0 0 0 2px rgba(251, 107, 33, .08);
}

.paste-area:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(251, 107, 33, .12);
}

.paste-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.file-pill {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 13px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    color: #64748b;
    background: #f8fafc;
    font-weight: 800;
    font-size: 12px;
}

.file-pill input {
    display: none;
}

.empty-preview {
    display: grid;
    place-items: center;
    min-height: 420px;
    padding: 26px;
    text-align: center;
    color: var(--muted);
}

.empty-preview strong,
.empty-preview span {
    display: block;
}

.empty-preview strong {
    color: var(--ink);
    font-size: 22px;
}

.parsed-list {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.parsed-transfer {
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background: #f8fbff;
    overflow: hidden;
}

.select-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #dbeafe;
}

.select-row input {
    width: 18px;
    height: 18px;
}

.parsed-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}

.parsed-grid .wide {
    grid-column: span 2;
}

.parsed-transfer details {
    padding: 0 16px 16px;
    color: #475569;
    font-size: 13px;
}

.parsed-transfer summary {
    cursor: pointer;
    font-weight: 800;
}

.parsed-transfer pre {
    white-space: pre-wrap;
    margin: 10px 0 0;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    color: #334155;
}

.sticky-save {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
}

.section-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.grid-form .wide {
    grid-column: span 2;
}

.form-actions {
    display: flex;
    align-items: end;
}

.form-actions button {
    width: 100%;
}

.table-wrap {
    margin-top: 18px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

td small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

th {
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    color: #0f766e;
    background: #ccfbf1;
    font-size: 12px;
    font-weight: 850;
}

.badge-soft {
    color: #334155;
    background: #e2e8f0;
}

.arrow {
    color: var(--accent);
    font-weight: 900;
}

.empty {
    padding: 24px;
    color: var(--muted);
    text-align: center;
}

.actions {
    white-space: nowrap;
}

.actions form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin: 0 5px 5px 0;
}

.actions select {
    width: 150px;
    min-height: 34px;
    font-size: 12px;
}

.actions button {
    margin-right: 6px;
    padding: 9px 11px;
    border-radius: 10px;
    background: #0f172a;
    box-shadow: none;
    font-size: 12px;
}

.action-stack {
    white-space: normal;
    min-width: 310px;
}

.mini-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
    text-decoration: none;
    font-weight: 850;
}

.payload {
    max-width: 420px;
    max-height: 180px;
    overflow: auto;
    padding: 12px;
    border-radius: 12px;
    color: #dbeafe;
    background: #0f172a;
    font-size: 12px;
    white-space: pre-wrap;
}

.driver-page {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(255,255,255,.9), rgba(239,244,248,.96)),
        url("https://images.unsplash.com/photo-1549924231-f129b911e442?auto=format&fit=crop&w=1800&q=80") center/cover fixed;
}

.driver-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 28px;
    color: #fff;
    background: rgba(13, 23, 38, .88);
}

.driver-top h1 {
    margin: 8px 0 4px;
}

.driver-top p {
    margin: 0;
    color: rgba(255,255,255,.72);
}

.driver-main {
    padding: 22px;
}

.driver-jobs {
    display: grid;
    gap: 14px;
}

.job-card {
    display: grid;
    grid-template-columns: 86px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

.job-time {
    display: grid;
    place-items: center;
    min-height: 72px;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-2), #14b8a6);
}

.job-time strong,
.job-time span {
    display: block;
}

.job-body h2 {
    margin: 0 0 8px;
}

.job-body p {
    margin: 0;
    color: #334155;
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.job-meta span {
    padding: 6px 9px;
    border-radius: 999px;
    color: #475569;
    background: #f1f5f9;
    font-size: 12px;
    font-weight: 800;
}

.job-actions {
    display: grid;
    gap: 10px;
    justify-items: end;
}

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

.job-actions select {
    width: 150px;
}

.empty-state {
    text-align: center;
}

@media (max-width: 900px) {
    .login-shell,
    .panel-page {
        grid-template-columns: 1fr;
    }

    .login-shell {
        min-height: auto;
    }

    .login-visual {
        padding: 34px;
    }

    .login-card {
        padding: 30px;
    }

    .signal-grid,
    .stats,
    .grid-form,
    .paste-workspace,
    .parsed-grid {
        grid-template-columns: 1fr;
    }

    .grid-form .wide,
    .parsed-grid .wide {
        grid-column: span 1;
    }

    .paste-actions,
    .paste-head {
        flex-direction: column;
        align-items: stretch;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .panel-main {
        padding: 18px;
    }

    .topbar,
    .section-head,
    .driver-top,
    .job-card {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .job-card {
        display: grid;
    }

    .job-actions {
        justify-items: stretch;
    }

    .job-actions form {
        flex-direction: column;
    }
}
