:root {
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: #172033;
    background: #f6f8fb;
    --blue: #258cfb;
    --blue-dark: #1769aa;
    --navy: #1e3c72;
    --line: #dbe4ef;
    --muted: #64748b;
}

.selected-report-badge {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: .35rem .7rem;
    border: 1px solid var(--line);
    border-radius: .45rem;
    color: var(--navy);
    background: #f7fbff;
    white-space: nowrap;
}

.employee-form-panel {
    max-width: 820px;
    padding: 1.25rem 1.35rem 1.35rem;
}

.employee-form-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.employee-form-heading h1,
.employee-form-heading p {
    margin-top: 0;
}

.employee-form-heading p {
    margin-bottom: 0;
}

.employee-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.form-field {
    display: grid;
    gap: .35rem;
}

.form-field input,
.form-field select {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.5rem;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: .4rem;
    background: #fff;
    color: var(--navy);
    font: inherit;
}

.recon-defaults-form {
    padding: 0 0 14px;
}

.recon-defaults-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    padding: 0 0 14px;
}

.recon-defaults-grid label {
    display: grid;
    gap: 5px;
}

.recon-defaults-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 0 0 4px;
}

.form-field small {
    font-size: .82rem;
}

.password-field {
    grid-column: 1 / -1;
    padding: .85rem;
    border: 1px solid #cfe0f2;
    border-radius: .5rem;
    background: #f7fbff;
}

.optional-label {
    margin-left: .35rem;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 400;
}

.user-edit-form {
    display: grid;
    gap: 1rem;
}

.employee-store-fieldset {
    margin: 0;
    padding: .85rem 1rem 1rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
}

.employee-store-fieldset legend {
    padding: 0 .4rem;
    color: var(--navy);
    font-weight: 700;
}

.employee-store-fieldset .user-store-list label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .55rem;
    border-radius: .35rem;
    background: var(--surface-muted, #f4f7fb);
}

.employee-form-actions {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

.employee-identity {
    display: grid;
    gap: .2rem;
    margin-bottom: 1.25rem;
    padding: .85rem 1rem;
    border-left: 4px solid var(--blue, #1677ff);
    background: var(--surface-muted, #f4f7fb);
}

.employee-account-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem;
    align-items: start;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.employee-account-card {
    display: grid;
    align-content: start;
    gap: .55rem;
    min-height: 0;
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: #fbfcfe;
}

.employee-account-card h2,
.employee-account-card p,
.employee-account-actions h2,
.employee-account-actions p {
    margin: 0;
    min-height: 0;
}

.employee-account-actions h2 {
    font-size: 1rem;
}

.employee-account-card form,
.employee-delete-action form {
    display: grid;
    justify-items: start;
    gap: .65rem;
    margin: 0;
}

.button-secondary {
    background: #fff;
    color: var(--navy);
    border: 1px solid var(--line);
}

.button-danger {
    background: #b42318;
}

.validation-message {
    margin-bottom: 1rem;
    color: #b42318;
}

.field-validation-message {
    color: #b42318;
    font-size: .82rem;
}

.success-message {
    padding: .7rem .85rem;
    border: 1px solid #a7dfbd;
    border-radius: .4rem;
    background: #effbf3;
    color: #146c36;
}

@media (max-width: 700px) {
    .employee-form-heading {
        display: block;
    }

    .employee-form-heading .button {
        display: inline-block;
        margin-top: 1rem;
    }

    .employee-form-grid {
        grid-template-columns: 1fr;
    }

    .employee-account-actions {
        grid-template-columns: 1fr;
    }
}

.user-menu {
    position: relative;
}

.settings-menu {
    position: relative;
}

.report-selector {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    margin-left: .75rem;
    color: var(--navy);
    font-size: .85rem;
    white-space: nowrap;
}

.report-selector select {
    min-width: 13rem;
    padding: .45rem 2rem .45rem .65rem;
    border: 1px solid var(--line);
    border-radius: .55rem;
    color: #475569;
    background: #fff;
    font: inherit;
}

.settings-menu-button {
    display: inline-block;
    padding: .55rem .8rem;
    color: var(--navy);
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.settings-menu-button::-webkit-details-marker {
    display: none;
}

.settings-menu[open] .settings-menu-button,
.settings-menu-button:hover,
.settings-menu-button:focus-visible {
    color: #fff;
    background: var(--blue);
    border-radius: .55rem;
    outline: none;
}

.settings-menu-items {
    right: 0;
}

.user-menu-button {
    display: inline-block;
    padding: .55rem .8rem;
    color: var(--navy);
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.user-menu-button::-webkit-details-marker {
    display: none;
}

.user-menu[open] .user-menu-button,
.user-menu-button:hover,
.user-menu-button:focus-visible {
    color: #fff;
    background: var(--blue);
    border-radius: .55rem;
    outline: none;
}

.user-menu-items {
    position: absolute;
    right: 0;
    z-index: 10;
    display: none;
    min-width: 170px;
    padding: .35rem 0;
    border: 1px solid var(--line);
    border-radius: .45rem;
    background: #fff;
    box-shadow: 0 8px 20px rgb(15 23 42 / 16%);
}

.user-menu[open] .user-menu-items,
.settings-menu[open] .user-menu-items {
    display: grid;
}

.app-account-area {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-left: auto;
}

.app-account-area > a {
    padding: .55rem .8rem;
    border-radius: .55rem;
    color: var(--navy);
    font-size: .92rem;
    font-weight: 550;
    text-decoration: none;
}

.app-account-area > a:hover,
.app-account-area > a:focus {
    color: var(--blue-dark);
    background: #eff6ff;
}

.settings-menu-items a {
    padding: .5rem .75rem;
    color: var(--navy);
    text-decoration: none;
}

.user-menu-items a:hover,
.user-menu-items button:hover {
    background: #eef5fc;
}

.user-menu-items a,
.user-menu-items button {
    display: block;
    width: 100%;
    padding: .65rem .8rem;
    border: 0;
    color: var(--navy);
    background: #fff;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.user-menu-items form {
    border-top: 1px solid var(--line);
}

.settings-panel,
.user-management-panel,
.messages-panel,
.message-compose-panel,
.message-thread-panel {
    max-width: 1000px;
    margin: 0 auto;
}

.user-management-panel.employee-form-panel {
    max-width: 820px;
}

.settings-panel form,
.message-compose-panel form,
.message-thread-panel form {
    display: grid;
    gap: .7rem;
    max-width: 620px;
}

.settings-form {
    align-items: start;
}

.settings-field {
    display: grid;
    gap: .35rem;
}

.settings-check {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: fit-content;
}

.settings-check input {
    width: 1.05rem;
    height: 1.05rem;
    padding: 0;
}

.settings-panel input,
.settings-panel select,
.message-compose-panel input,
.message-compose-panel textarea,
.message-thread-panel textarea {
    box-sizing: border-box;
    width: 100%;
    padding: .55rem .65rem;
    border: 1px solid var(--line);
    border-radius: .35rem;
    font: inherit;
}

.users-page {
    display: grid;
    gap: 1rem;
    max-width: 1180px;
    margin: 0 auto;
}

.users-page-header,
.users-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.users-kicker {
    color: #2563eb;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.users-page h1 {
    margin: .15rem 0;
}

.users-page-header p,
.users-card-header span {
    margin: 0;
    color: var(--muted);
}

.users-info {
    padding: .85rem 1rem;
    border-radius: .7rem;
    background: #e8f3ff;
    color: #24527a;
}

.users-card {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: .9rem;
    background: #fff;
}

.users-card-header {
    padding: 1rem 1.1rem .4rem;
}

.users-table-wrap {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    padding: .75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #64748b;
    font-size: .75rem;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
}

.users-table td {
    padding: .9rem 1rem;
    border-top: 1px solid #eef2f7;
    vertical-align: middle;
}

.users-name {
    font-weight: 700;
}

.users-email {
    color: #64748b;
}

.users-access {
    display: inline-flex;
    padding: .15rem .55rem;
    border-radius: 999px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: .82rem;
    font-weight: 700;
}

.users-access-readonly {
    background: #e2e8f0;
    color: #334155;
}

.users-access-edit {
    background: #dbeafe;
    color: #1d4ed8;
}

.employee-delete-action form {
    display: grid;
    justify-items: start;
    gap: .7rem;
}

.user-access-row,
.message-row {
    display: grid;
    grid-template-columns: 1.2fr 130px 2fr auto;
    gap: .75rem;
    align-items: center;
    padding: .8rem 0;
    border-bottom: 1px solid var(--line);
}

.user-store-list,
.message-recipient-list {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .8rem;
}

.message-row {
    grid-template-columns: 1fr 1fr 2fr auto;
    color: inherit;
    text-decoration: none;
}

.message-unread {
    font-weight: 700;
    background: #eef5fc;
}

.message-thread {
    display: grid;
    gap: .75rem;
    margin: 1rem 0;
}

.message-item {
    max-width: 75%;
    padding: .75rem 1rem;
    border-radius: .6rem;
    background: #eef2f7;
}

.message-current {
    justify-self: end;
    background: #dceeff;
}

.message-item time {
    float: right;
    margin-left: 1rem;
    color: var(--muted);
    font-size: .72rem;
}

@media (max-width: 700px) {
    .user-access-row,
    .message-row {
        grid-template-columns: 1fr;
    }
}

.inventory-search select,
.export-button {
    padding: .5rem .65rem;
    border: 1px solid var(--line);
    border-radius: .45rem;
    font-size: .78rem;
}

.export-button {
    color: #fff;
    background: #198754;
    text-decoration: none;
}

.recon-status-dashboard {
    margin-bottom: 1rem;
}

.recon-status-dashboard h2 {
    margin: 0 0 .55rem;
    font-size: 1rem;
}

.recon-status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: .85rem;
}

.recon-status-card {
    display: grid;
    gap: .2rem;
    min-height: 7rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: .45rem;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 1px 2px rgb(15 23 42 / 8%);
}

.recon-status-card-empty {
    cursor: default;
    filter: grayscale(1);
    opacity: .45;
}

.recon-status-card-empty:hover {
    filter: grayscale(1);
    text-decoration: none;
}

.recon-status-card:hover {
    filter: brightness(.95);
    text-decoration: underline;
}

.recon-status-card span {
    font-size: .78rem;
}

.return-dashboard-badge,
.selected-store-badge {
    display: inline-block;
    margin-top: .45rem;
    padding: .35rem .65rem;
    border-radius: 999px;
    color: #fff;
    background: var(--blue-dark);
    font-size: .75rem;
    font-weight: 700;
    text-decoration: none;
}

.return-dashboard-badge:hover {
    background: var(--navy);
    text-decoration: none;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 18px 45px rgb(15 23 42 / 14%);
}

.login-brand-panel {
    padding: 3.5rem;
    color: #fff;
    background: linear-gradient(135deg, #123b68, #1769aa);
}

.login-brand-panel h1 {
    margin: .7rem 0;
    color: #fff;
}

.login-brand-icon,
.app-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: .6rem;
    color: #fff;
    background: #f36f21;
    font-size: 1.5rem;
}

.auth-card {
    padding: 3.5rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.login-page {
    min-height: 100vh;
    background: #f6f8fb;
}

.login-page-main {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 2rem;
    box-sizing: border-box;
}

.auth-card .eyebrow {
    margin-bottom: .8rem;
}

.auth-card h2 {
    margin-bottom: .4rem;
    color: var(--navy);
    font-size: 1.65rem;
}

.auth-card > .muted {
    margin-bottom: 1.5rem;
}

.auth-card form {
    display: grid;
    gap: .85rem;
}

.login-field {
    display: grid;
    gap: .35rem;
}

.login-field input {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.7rem;
    padding: .6rem .7rem;
    border: 1px solid var(--line);
    border-radius: .45rem;
    background: #fff;
    color: var(--navy);
    font: inherit;
}

.login-field input:focus {
    border-color: var(--blue);
    outline: 3px solid rgb(37 140 251 / 18%);
}

.login-submit {
    width: 100%;
    margin-top: .35rem;
}

.auth-error {
    margin-bottom: 1rem;
    padding: .7rem .8rem;
    border: 1px solid #f1b8b5;
    border-radius: .4rem;
    color: #9f1d18;
    background: #fff2f1;
}

@media (max-width: 700px) {
    .login-shell {
        grid-template-columns: 1fr;
        width: min(100%, 32rem);
    }

    .login-brand-panel {
        padding: 2rem;
    }

    .auth-card {
        padding: 2rem;
    }

    .login-page-main {
        padding: 1rem;
    }
}

body {
    font-size: .9rem;
}

.panel:has(.vehicle-grid) {
    overflow-x: auto;
}

.vehicle-grid {
    width: 100%;
    min-width: 0;
}

.vehicle-grid .k-hierarchy-cell,
.vehicle-grid .k-hierarchy-col {
    display: none !important;
}

.vehicle-details-link {
    font-weight: 700;
}

.inventory-flag {
    display: inline-block;
    min-width: 100%;
    padding: .45rem .25rem;
    text-align: center;
    font-weight: 800;
}

.vehicle-secondary-row {
    display: flex;
    gap: .55rem;
    align-items: baseline;
    min-height: 1.25rem;
    padding: .1rem .65rem;
    color: #475569;
    background: inherit;
    font-size: .72rem;
}

.vehicle-details {
    color: #333;
    font-size: .86rem;
}

.vehicle-details-header {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.vehicle-stock {
    font-size: 1.25rem;
}

.vehicle-description,
.vehicle-vin {
    font-size: .9rem;
}

.vehicle-legacy-form {
    display: grid;
    gap: 13px;
}

.vehicle-memo-grid {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr) 105px minmax(0, 1fr);
    align-items: center;
    gap: 7px 10px;
}

.vehicle-memo-grid label,
.vehicle-check-grid label,
.vehicle-recon-row label,
.vehicle-note-grid label {
    font-weight: 700;
}

.vehicle-memo-grid input,
.vehicle-recon-row select,
.vehicle-note-grid textarea {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid #bfc4c8;
    border-radius: 4px;
    background: #fff;
    font: inherit;
}

.vehicle-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.vehicle-check-grid input {
    margin-right: 8px;
    vertical-align: middle;
}

.vehicle-recon-row {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.vehicle-note-grid {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr) 105px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}

.vehicle-note-grid textarea {
    resize: vertical;
}

.vehicle-note-grid textarea[readonly] {
    background: #f5f5f5;
}

.vehicle-save-button {
    margin-top: 14px;
    background: #f36f21;
}

.vehicle-save-button:hover {
    background: #d95b14;
}

@media (max-width: 620px) {
    .vehicle-memo-grid,
    .vehicle-note-grid {
        grid-template-columns: 95px minmax(0, 1fr);
    }

    .vehicle-check-grid {
        grid-template-columns: 1fr;
    }
}

.vehicle-note-label {
    color: #64748b;
    font-weight: 700;
}

.vehicle-note-value {
    flex: 3 1 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.vehicle-memo2-label {
    margin-left: auto;
}

.vehicle-memo2-value {
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.inventory-flag-wsl {
    color: #a40000;
    background: #fff200;
}

.inventory-flag-title-hold {
    color: #fff;
    background: #2563eb;
}

.vehicle-grid .k-detail-row > td {
    padding: 0;
    border-bottom: 1px solid #cbd5e1;
}

.vehicle-grid .k-master-row > td {
    padding-top: 1px;
    padding-bottom: 1px;
    line-height: 1.2;
}

.vehicle-grid .vehicle-record-even > td,
.vehicle-grid .vehicle-record-even > td.k-detail-cell {
    background: #fff;
}

.vehicle-grid .vehicle-record-odd > td,
.vehicle-grid .vehicle-record-odd > td.k-detail-cell {
    background: #f5f5f5;
}

.vehicle-grid .vehicle-record-even:hover > td,
.vehicle-grid .vehicle-record-odd:hover > td,
.vehicle-grid .vehicle-record-even:hover + .k-detail-row > td,
.vehicle-grid .vehicle-record-odd:hover + .k-detail-row > td {
    background: #dceeff;
}

.inventory-flag-not-clear {
    color: #fff;
    background: #ef1111;
}

.recon-step-cell {
    width: 100%;
    min-height: 1.55rem !important;
    margin: -.2rem -.4rem;
    padding: .2rem .4rem !important;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.recon-step-cell:hover {
    filter: brightness(.95);
    text-decoration: underline;
}

.recon-history {
    min-width: min(700px, 80vw);
}

.recon-history h2 {
    margin: 0 0 1rem;
}

.recon-history-table th,
.recon-history-table td {
    white-space: nowrap;
}

.account-details {
    min-width: min(700px, 80vw);
}

.account-details h2 {
    margin: 0 0 1rem;
}

.account-details-table th,
.account-details-table td {
    white-space: nowrap;
}

.account-details-table tfoot th,
.account-details-table tfoot td {
    border-top: 2px solid var(--line);
    font-weight: 800;
}

.account-status {
    display: inline-block;
    padding: .2rem .45rem;
    border-radius: .35rem;
    font-size: .72rem;
    font-weight: 800;
}

.account-status-posted {
    color: #166534;
    background: #dcfce7;
}

.account-status-pending {
    color: #92400e;
    background: #fef3c7;
}

.account-details-link {
    color: var(--blue-dark);
    font-weight: 700;
    text-decoration: underline;
}

.account-cost-with-open-ro {
    margin-top: .15rem;
    color: var(--blue);
    font-weight: 700;
}

.ro-link {
    color: var(--blue-dark);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.ro-dialog {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 4vh 5vw;
    background: rgba(15, 23, 42, .55);
}

.ro-dialog-content {
    max-height: 92vh;
    overflow: auto;
    padding: 1.25rem;
    border-radius: .65rem;
    background: #fff;
}

#roDialog .ro-dialog-content {
    width: min(1100px, 100%);
    margin: 0 auto;
    box-sizing: border-box;
}

#vehicleDetailsDialog .ro-dialog-content {
    width: min(820px, 100%);
    margin: 0 auto;
    box-sizing: border-box;
}

#roDialog .ro-details-table {
    width: 100%;
    table-layout: auto;
    font-size: .82rem;
}

#roDialog .ro-details-table th,
#roDialog .ro-details-table td {
    padding: .45rem .55rem;
}

#roDialog .ro-details-table th:nth-child(5),
#roDialog .ro-details-table td:nth-child(5) {
    min-width: 15rem;
}

#roDialog .ro-details-table th:nth-child(6),
#roDialog .ro-details-table td:nth-child(6) {
    min-width: 5rem;
}

.vehicle-recon-info-grid,
.vehicle-recon-edit-grid {
    display: grid;
    gap: .75rem 1rem;
}

.vehicle-recon-info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 1rem 0;
}

.vehicle-recon-memo-grid {
    margin: 1rem 0;
}

.vehicle-trade-deal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem 1rem;
    margin: 0 0 1rem;
}

.vehicle-trade-deal-grid div {
    display: grid;
    gap: .15rem;
}

.vehicle-trade-deal-grid span {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
}

.vehicle-trade-deal-note {
    grid-column: 1 / -1;
}

.vehicle-recon-info-grid div {
    display: grid;
    gap: .15rem;
}

.vehicle-recon-info-grid span,
.vehicle-recon-edit-field > span,
.vehicle-recon-step-field > label {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
}

.vehicle-recon-edit-grid {
    grid-template-columns: auto minmax(0, 1fr);
}

.vehicle-clear-field {
    grid-column: 1;
}

.vehicle-recon-step-top {
    grid-column: 2;
    justify-self: start;
}

.vehicle-recon-edit-field,
.vehicle-recon-step-field {
    display: grid;
    align-content: start;
    gap: .35rem;
}

.vehicle-clear-field,
.vehicle-received-title-field {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-height: 2.25rem;
}

.vehicle-recon-edit-field input:not([type="checkbox"]),
.vehicle-recon-edit-field textarea,
.vehicle-recon-step-field select {
    box-sizing: border-box;
    width: 100%;
    padding: .5rem .6rem;
    border: 1px solid var(--line);
    border-radius: .4rem;
    font: inherit;
}

.vehicle-recon-edit-field input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
}

.vehicle-recon-edit-wide {
    grid-column: span 2;
}

.vehicle-received-title-field {
    grid-column: 1;
    align-self: center;
}

.vehicle-title-note-field {
    grid-column: 2;
    justify-self: start;
    width: min(100%, 32rem);
}

.vehicle-note-memo2-row {
    display: grid;
    grid-column: span 2;
    grid-template-columns: 3fr 1fr;
    gap: 1rem;
    align-items: end;
}

.vehicle-recon-memo2-value {
    display: grid;
    gap: .35rem;
    padding-bottom: .55rem;
}

.vehicle-recon-memo2-value span {
    color: var(--muted);
    font-size: .8rem;
}

.vehicle-note-field,
.vehicle-title-note-field {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    width: 100%;
}

.vehicle-title-note-field textarea[rows="6"] {
    min-height: 9rem;
}

.vehicle-recon-step-field {
    grid-template-columns: auto minmax(12rem, 22rem) auto;
    align-items: center;
    gap: .5rem;
}

.inventory-search {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.inventory-search input {
    width: min(28rem, 42vw);
    padding: .5rem .65rem;
    border: 1px solid var(--line);
    border-radius: .45rem;
}

.inventory-search button {
    padding: .5rem .8rem;
    border: 0;
    border-radius: .45rem;
    color: #fff;
    background: var(--blue);
}

.inventory-search a {
    color: var(--blue-dark);
    font-size: .85rem;
}

.store-selector-form {
    margin-left: auto;
}

.store-selector {
    min-width: 10rem;
    padding: .45rem .65rem;
    border: 1px solid var(--line);
    border-radius: .55rem;
    color: #475569;
    background: #fff;
    font-size: .85rem;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: #f6f8fb;
    display: flex;
    flex-direction: column;
}

.app-navbar {
    min-height: 4.25rem;
    padding: .7rem 5vw;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 .25rem 1rem rgba(15, 36, 71, .06);
}

.app-nav-shell {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1500px;
    margin: 0 auto;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-right: 1rem;
    color: #172033;
    font-size: 1.3rem;
    font-weight: 750;
    letter-spacing: -.04em;
    text-decoration: none;
}

.app-brand:hover {
    color: var(--blue-dark);
}

.app-brand-mark {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: .6rem;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--navy));
    box-shadow: 0 .35rem .75rem rgba(37, 140, 251, .25);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
}

.app-nav-links {
    display: flex;
    gap: .2rem;
}

.app-nav-links a {
    padding: .55rem .8rem;
    border-radius: .55rem;
    color: #475569;
    font-size: .92rem;
    font-weight: 550;
    text-decoration: none;
    transition: color .15s ease, background-color .15s ease;
}

.app-nav-links a:hover,
.app-nav-links a:focus {
    color: var(--blue-dark);
    background: #eff6ff;
}

.shell {
    flex: 1;
    width: 95%;
    max-width: none;
    margin: 0 auto;
    padding: 12px 0;
    min-height: 0;
}

.shell:has(.vehicle-grid) {
    display: flex;
    flex-direction: column;
}

.shell:has(.vehicle-grid) > .panel {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 8px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--blue-dark);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .15em;
}

h1 {
    margin: 0;
    color: #172033;
    font-size: 1.35rem;
}

h2 {
    margin: 0;
    font-size: 1.15rem;
}

.muted {
    margin: 0;
    color: var(--muted);
}

.hero-stat {
    padding: 0;
    border-left: 0;
}

.hero-stat strong {
    display: block;
    color: var(--navy);
    font-size: .85rem;
    font-weight: 600;
}

.hero-stat span {
    display: none;
}

.toolbar,
.panel {
    border: 1px solid var(--line);
    border-radius: .6rem;
    background: #fff;
    box-shadow: 0 .2rem .8rem rgba(15, 36, 71, .03);
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 18px;
    padding: 10px;
}

.filter {
    padding: 10px 14px;
    border-radius: .55rem;
    color: #566873;
    font-size: .88rem;
    text-decoration: none;
}

.filter:hover,
.filter.active {
    color: var(--blue-dark);
    background: #eff6ff;
    font-weight: 700;
}

.store-filter {
    margin-left: auto;
    color: var(--muted);
    font-size: .8rem;
}

.store-filter input {
    margin-left: 8px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: .55rem;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-bottom: 1px solid var(--line);
}

.button {
    padding: 9px 16px;
    border: 0;
    border-radius: .55rem;
    color: #fff;
    background: var(--blue);
    font-weight: 600;
}

.button:hover {
    background: var(--blue-dark);
}

a.button {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.button.button-secondary {
    color: var(--navy);
    background: #fff;
    border: 1px solid #c5d0de;
}

.button.button-secondary:hover {
    color: var(--navy);
    background: #f8fafc;
}

.button.button-danger {
    color: #fff;
    background: #b42318;
    border: 0;
}

.button.button-danger:hover {
    background: #912018;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .86rem;
}

th {
    color: #64748b;
    background: #f8fafc;
    text-align: left;
    font-size: .72rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}

th,
td {
    padding: 7px 9px;
    border-bottom: 1px solid #edf1f3;
    white-space: nowrap;
}

.k-grid,
.k-grid .k-table,
.k-grid .k-grid-header,
.k-grid .k-grid-content {
    font-size: .78rem;
}

.k-grid .k-table th,
.k-grid .k-table td {
    padding: 2px 5px;
}

tr:hover {
    background: #eff6ff;
}

.strong {
    color: var(--navy);
    font-weight: 700;
}

.status {
    padding: 4px 9px;
    border-radius: 12px;
    color: #24744c;
    background: #e8f3ed;
    font-size: .74rem;
}

.footer {
    padding: 25px;
    color: #8a989f;
    font-size: .75rem;
    text-align: center;
}

.recon-steps-panel,
.recon-defaults-panel {
    margin-bottom: 18px;
}

.recon-step-editor {
    max-width: 880px;
    padding: 16px 14px 14px;
    border-bottom: 1px solid var(--line);
}

.recon-step-editor h3 {
    margin: 0 0 12px;
    color: var(--navy);
    font-size: .95rem;
}

.recon-status-form {
    display: grid;
    grid-template-columns: 250px 82px 82px 250px auto;
    align-items: end;
    gap: 12px;
}

.recon-status-field {
    display: grid;
    gap: 5px;
}

.recon-status-field label,
.recon-field-label,
.recon-defaults-form label {
    color: #475569;
    font-size: .76rem;
    font-weight: 700;
}

.recon-status-field input:not([type="color"]),
.recon-defaults-form select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid var(--line);
    border-radius: .4rem;
    font: inherit;
}

.recon-color-field input[type="color"],
.recon-inline-form input[type="color"] {
    display: block;
    width: 48px;
    height: 34px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: .4rem;
    background: #fff;
}

.recon-preview-field {
    display: grid;
    gap: 5px;
}

.recon-color-preview {
    display: inline-flex;
    min-width: 112px;
    height: 34px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    overflow: hidden;
    border-radius: .4rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recon-status-action {
    display: flex;
    align-items: end;
    height: 100%;
}

.recon-status-help {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    font-size: .76rem;
}

.recon-status-table {
    width: 100%;
    max-width: 880px;
    table-layout: fixed;
}

.recon-steps-panel > .table-wrap {
    max-width: 880px;
}

.recon-status-table th,
.recon-status-table td {
    height: 52px;
    box-sizing: border-box;
    padding: 7px 8px;
    vertical-align: middle;
}

.recon-status-table-wrap {
    max-width: 880px;
}

.recon-column-handle { width: 34px; }
.recon-column-status { width: 250px; }
.recon-column-color { width: 82px; }
.recon-column-preview { width: 250px; }
.recon-column-actions { width: 150px; }

.recon-status-table thead th:nth-child(3),
.recon-status-table thead th:nth-child(4) {
    white-space: nowrap;
}

.recon-status-table thead th:nth-child(3) {
    padding-right: 2px;
}

.recon-status-table thead th:nth-child(4) {
    padding-left: 2px;
}

.recon-status-table thead th {
    padding-top: 8px;
    padding-bottom: 8px;
}

.recon-status-table tbody tr {
    border-bottom: 1px solid #edf1f3;
}

.recon-status-table tbody tr:hover {
    background: #f8fbff;
}

.recon-drag-handle {
    width: 34px;
    color: #64748b;
    cursor: grab;
    font-size: 1.1rem;
    text-align: center;
    user-select: none;
}

.recon-step-number {
    color: var(--muted);
    font-weight: 700;
}

.recon-inline-form {
    display: contents;
}

.recon-description-input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid var(--line);
    border-radius: .4rem;
    font: inherit;
}

.recon-color-cell {
    text-align: center;
}

.recon-color-cell input[type="color"] {
    display: inline-block;
    width: 48px;
    height: 34px;
    margin: 0 auto;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: .4rem;
    background: #fff;
}

.recon-preview-cell {
    padding-right: 14px;
    text-align: left;
}

.recon-preview-cell .recon-color-preview {
    width: 100%;
    min-width: 0;
}

.recon-actions-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.recon-actions-cell form {
    margin: 0;
}

.button-small {
    padding: 7px 11px;
    font-size: .76rem;
    white-space: nowrap;
}

.recon-dragging {
    opacity: .45;
}

@media (max-width: 800px) {
    .recon-status-form {
        grid-template-columns: minmax(0, 1fr) 1fr;
    }

    .recon-status-name-field,
    .recon-preview-field,
    .recon-status-action {
        grid-column: 1 / -1;
    }

    .recon-status-table {
        min-width: 760px;
    }

    .recon-status-table-wrap {
        overflow-x: auto;
    }
}

.message-unread-badge {
    display: inline-flex;
    min-width: 1.3rem;
    justify-content: center;
    margin-left: .35rem;
    padding: .05rem .4rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
}

.message-alert {
    color: #b91c1c;
    font-weight: 700;
}

.message-dialog {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .45);
}

.message-dialog[hidden] {
    display: none;
}

.message-dialog-content {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(1100px, calc(100vw - 2rem));
    height: min(760px, calc(100vh - 2rem));
    overflow: hidden;
    border-radius: .7rem;
    background: #fff;
}

.message-dialog-header,
.message-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .8rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.message-dialog-footer {
    border-top: 1px solid #e5e7eb;
    border-bottom: 0;
}

.message-chat-layout {
    display: grid;
    grid-template-columns: minmax(240px, 32%) 1fr;
    min-height: 0;
}

.message-inbox-pane {
    overflow-y: auto;
    border-right: 1px solid #e5e7eb;
    background: #f8fafc;
}

.message-inbox-heading,
.message-recent-only,
.message-chat-header {
    padding: .75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.message-conversation-pane {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
}

.message-thread {
    display: flex;
    min-height: 0;
    max-height: 460px;
    flex: 1 1 auto;
    flex-direction: column;
    gap: .65rem;
    overflow-y: auto;
    padding: .75rem;
}

.message-line {
    display: flex;
    width: 75%;
    max-width: 75%;
    flex-direction: column;
}

.message-line-sent {
    align-self: flex-end;
    align-items: flex-end;
}

.message-line-received {
    align-self: flex-start;
}

.message-bubble {
    width: 100%;
    padding: .35rem .7rem;
    border-radius: 1rem;
    background: #f1f5f9;
    overflow-wrap: anywhere;
}

.message-line-sent .message-bubble {
    background: #e8e9ff;
}

.message-body {
    white-space: pre-wrap;
}

.message-time,
.message-preview {
    color: #64748b;
    font-size: .78rem;
}

.message-thread-link {
    display: block;
    padding: .75rem 1rem;
    border-left: 3px solid transparent;
    color: inherit;
    text-decoration: none;
}

.message-thread-link.active,
.message-thread-link:hover {
    border-left-color: #2563eb;
    background: #eff6ff;
}

.message-thread-row {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
}

.message-unread .message-conversation-name,
.message-unread .message-preview {
    font-weight: 700;
}

.message-empty-state {
    padding: 2rem;
    color: #64748b;
    text-align: center;
}

#messageComposeForm,
#messageReplyForm {
    display: grid;
    gap: .55rem;
    padding: .75rem 1rem;
}

#messageComposeForm textarea,
#messageReplyForm textarea,
#messageComposeForm select {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid #cbd5e1;
    border-radius: .6rem;
    font: inherit;
}

@media (max-width: 800px) {
    .message-chat-layout {
        grid-template-columns: 1fr;
    }

    .message-inbox-pane {
        max-height: 220px;
        border-right: 0;
    }
}