:root {
    color-scheme: light;
    --ink: #242824;
    --muted: #6d746b;
    --panel: #ffffff;
    --line: #ddd8ce;
    --field: #f8f7f4;
    --bg: #f3f0e9;
    --green: #23362f;
    --green-2: #3f6655;
    --blue: #385d74;
    --rust: #b95f34;
    --amber: #dba744;
    --ok: #2f7a58;
    --danger: #aa3d36;
    --soft-green: #eef4ef;
    --soft-blue: #eef5f7;
    --soft-rust: #f7ede8;
    --shadow: 0 16px 44px rgba(31, 42, 34, .11);
    --shadow-soft: 0 8px 26px rgba(31, 42, 34, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(255,255,255,.36), rgba(255,255,255,0) 260px),
        var(--bg);
    color: var(--ink);
    font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

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

.app-shell {
    min-height: 100vh;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(280px, 440px) 1fr;
    min-height: 100vh;
}

.auth-panel {
    background: var(--panel);
    border-right: 1px solid var(--line);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
}

.auth-visual {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(120deg, rgba(35, 54, 47, .9), rgba(56, 93, 116, .72)),
        url("data:image/svg+xml,%3Csvg width='1200' height='900' viewBox='0 0 1200 900' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1200' height='900' fill='%23e9e3d8'/%3E%3Cg fill='none' stroke='%2323362f' stroke-width='20' stroke-linecap='round' stroke-linejoin='round' opacity='.23'%3E%3Cpath d='M198 574h792l-76-184c-21-49-57-72-111-72H400c-51 0-87 22-111 67l-91 189z'/%3E%3Ccircle cx='350' cy='609' r='78'/%3E%3Ccircle cx='850' cy='609' r='78'/%3E%3Cpath d='M377 414h441M488 319l-71 96M704 318l67 97'/%3E%3C/g%3E%3C/svg%3E") center/cover;
}

.auth-copy {
    position: absolute;
    left: clamp(32px, 8vw, 110px);
    right: clamp(32px, 8vw, 110px);
    bottom: clamp(36px, 8vw, 96px);
    color: #fff;
}

.auth-copy h1 {
    margin: 0;
    font-size: clamp(42px, 8vw, 88px);
    line-height: .95;
}

.auth-copy p {
    max-width: 640px;
    margin: 22px 0 0;
    font-size: 20px;
    color: rgba(255, 255, 255, .82);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    color: var(--green);
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--green);
    color: white;
    display: grid;
    place-items: center;
}

.topbar,
.sidebar,
.workspace,
.panel {
    background: var(--panel);
}

.dashboard {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 326px 1fr;
}

.sidebar {
    border-right: 1px solid rgba(221, 216, 206, .8);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(18px);
}

.workspace {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
}

.topbar {
    min-height: 74px;
    border-bottom: 1px solid rgba(221, 216, 206, .85);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.content {
    padding: 26px;
    display: grid;
    gap: 18px;
    align-content: start;
}

.split {
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
    gap: 18px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.panel-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-header h2,
.panel-header h3 {
    margin: 0;
    font-size: 17px;
}

.panel-body {
    padding: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field {
    display: grid;
    gap: 6px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--field);
    color: var(--ink);
    padding: 10px 12px;
    outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green-2);
    box-shadow: 0 0 0 3px rgba(63, 102, 85, .14);
}

.button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    background: #ebe7df;
    border-radius: 8px;
}

.segmented button {
    min-height: 36px;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
}

.segmented button.active {
    background: #fff;
    color: var(--green);
    box-shadow: 0 4px 12px rgba(32, 38, 31, .08);
}

.btn {
    min-height: 40px;
    border-radius: 6px;
    padding: 0 14px;
    background: var(--green);
    color: #fff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
}

.btn.secondary {
    background: #e7e3d9;
    color: var(--ink);
}

.btn.blue {
    background: var(--blue);
}

.btn.rust {
    background: var(--rust);
}

.btn.danger {
    background: var(--danger);
}

.btn.ghost {
    background: transparent;
    color: var(--green);
    border: 1px solid var(--line);
}

.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #ece7dc;
    border-radius: 8px;
    padding: 4px;
}

.tab {
    min-height: 38px;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
}

.tab.active {
    background: white;
    color: var(--green);
    box-shadow: 0 4px 14px rgba(34, 40, 32, .08);
}

.vehicle-list {
    display: grid;
    gap: 10px;
    overflow: auto;
}

.vehicle-item {
    text-align: left;
    border-radius: 8px;
    padding: 14px;
    background: rgba(249, 247, 242, .86);
    color: var(--ink);
    border: 1px solid transparent;
    box-shadow: 0 1px 0 rgba(34, 40, 32, .04);
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.vehicle-item.active {
    border-color: var(--green-2);
    background: #eef3ee;
}

.vehicle-item:hover {
    transform: translateY(-1px);
    border-color: #cfc8ba;
}

.vehicle-item strong {
    display: block;
}

.vehicle-item span,
.meta {
    color: var(--muted);
    font-size: 13px;
}

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

.detail-header {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.detail-header h1 {
    margin: 2px 0 4px;
    font-size: 30px;
    line-height: 1.1;
}

.eyebrow {
    color: var(--green-2);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

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

.subnav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-bottom: 1px solid rgba(221, 216, 206, .85);
    padding: 0 2px 0;
}

.subnav button {
    min-height: 42px;
    padding: 0 12px;
    background: transparent;
    color: var(--muted);
    font-weight: 900;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.subnav button.active {
    color: var(--green);
    border-bottom-color: var(--green-2);
}

.single-column {
    max-width: 860px;
    display: grid;
    gap: 18px;
}

.welcome-panel {
    min-height: 360px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(238, 244, 239, .96), rgba(255, 255, 255, .92)),
        radial-gradient(circle at right top, rgba(56, 93, 116, .16), transparent 36%);
    box-shadow: var(--shadow-soft);
    padding: 48px;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 18px;
}

.welcome-panel h1 {
    max-width: 760px;
    margin: 6px 0 10px;
    font-size: 48px;
    line-height: 1;
}

.welcome-panel p {
    max-width: 640px;
    margin: 0;
    color: var(--muted);
    font-size: 18px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.info-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fbfaf7;
}

.info-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.info-item strong {
    display: block;
    margin-top: 3px;
}

.notes-block {
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.notes-block p {
    margin: 4px 0 0;
}

.toolbar-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #fbfaf7;
}

.danger-zone {
    border-color: #e1c3bd;
}

.card-list {
    display: grid;
    gap: 10px;
}

.list-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fbfaf7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.list-card strong {
    display: block;
}

.chip-row {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--soft-blue);
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.chip.strong {
    background: var(--soft-green);
    color: var(--green);
}

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    justify-content: flex-end;
    background: rgba(27, 32, 28, .28);
    backdrop-filter: blur(4px);
}

.drawer {
    width: min(560px, 100vw);
    height: 100%;
    background: var(--panel);
    box-shadow: -24px 0 54px rgba(31, 42, 34, .2);
    display: grid;
    grid-template-rows: auto 1fr;
}

.drawer-header {
    min-height: 82px;
    border-bottom: 1px solid var(--line);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.drawer-header h2 {
    margin: 2px 0 0;
    font-size: 22px;
}

.drawer-body {
    padding: 20px;
    overflow: auto;
}

.drawer .panel {
    border: 0;
    box-shadow: none;
}

.drawer .panel-header {
    display: none;
}

.drawer .panel-body {
    padding: 0;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #eee9df;
    color: var(--ink);
    font-size: 22px;
    line-height: 1;
    display: grid;
    place-items: center;
}

.metric {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fbfaf7;
}

.metric b {
    display: block;
    font-size: 19px;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-size: 12px;
}

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

.status {
    min-height: 0;
    color: var(--green);
    font-weight: 800;
    padding: 0 2px;
}

.empty {
    color: var(--muted);
    padding: 20px;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
}

.checkbox-line input {
    width: 18px;
    min-height: 18px;
}

.hidden {
    display: none !important;
}

@media (max-width: 980px) {
    .auth-layout,
    .dashboard,
    .split {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: 42vh;
        order: -1;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .drawer {
        width: 100vw;
    }

    .metric-row,
    .info-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .detail-header,
    .toolbar-card,
    .list-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .chip-row {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .auth-panel,
    .content,
    .topbar,
    .sidebar {
        padding: 16px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel-body,
    .panel-header {
        padding: 14px;
    }

    .welcome-panel {
        min-height: 300px;
        padding: 28px;
    }

    .welcome-panel h1 {
        font-size: 34px;
    }
}
