/* Vehicle directory cards: focused visual hierarchy for the Cards view. */
.vehicle-directory-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 18px;
}

.vehicle-directory-grid.directory-grid-single {
    grid-template-columns: minmax(0, 360px);
    justify-content: start;
}

.vehicle-directory-card {
    min-width: 0;
    width: 100%;
    max-width: 360px;
    justify-self: start;
    min-height: 304px;
    padding: 16px;
    gap: 16px;
    border: 1px solid #d9e4ee;
    border-top: 3px solid #2f80c9;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(30, 63, 94, 0.07);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.vehicle-directory-card:hover {
    transform: translateY(-2px);
    border-color: #b9cfe2;
    border-top-color: #1769aa;
    box-shadow: 0 18px 32px rgba(30, 63, 94, 0.12);
}

.vehicle-directory-card:focus-visible {
    outline: 3px solid rgba(47, 128, 201, 0.26);
    outline-offset: 3px;
}

.vehicle-directory-card-topline {
    align-items: center;
    gap: 10px;
}

.vehicle-directory-card-topline-main {
    gap: 0;
}

.vehicle-directory-card-topline-actions {
    gap: 6px;
}

.vehicle-directory-card-badge {
    min-height: 24px;
    padding: 0 9px;
    border: 0;
    border-radius: 6px;
    background: #edf4fa;
    color: #41627c;
    font-size: 0.64rem;
    letter-spacing: 0.08em;
}

.vehicle-directory-card-identity {
    min-width: 0;
}

.vehicle-directory-card-plate-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.vehicle-directory-card-plate {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 132px;
    max-width: calc(100% - 70px);
    padding: 9px 14px 8px;
    border: 1px solid #b8c9d8;
    border-left: 4px solid #173b59;
    border-radius: 10px;
    background: #f8fbfd;
    box-shadow: inset 0 -2px 0 rgba(23, 59, 89, 0.07);
}

.vehicle-directory-card-plate span {
    overflow: hidden;
    max-width: 100%;
    color: #17324d;
    font-family: "Courier New", monospace;
    font-size: 1.48rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vehicle-directory-card-plate small {
    margin-top: 5px;
    color: #7890a5;
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.vehicle-directory-card-photo {
    display: grid;
    flex: 0 0 58px;
    place-items: center;
    width: 58px;
    height: 52px;
    overflow: hidden;
    border: 1px solid #dce7ef;
    border-radius: 12px;
    background: #eef4f8;
    color: #6d879b;
    font-size: 1.25rem;
}

.vehicle-directory-card-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vehicle-directory-card-copy {
    margin-top: 13px;
}

.vehicle-directory-card-copy strong {
    color: #102d47;
    font-size: 0.91rem;
    font-weight: 750;
    line-height: 1.25;
}

.vehicle-directory-card-copy p {
    margin: 4px 0 0;
    color: #637b91;
    font-size: 0.77rem;
    line-height: 1.25;
}

.vehicle-directory-card-meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
}

.vehicle-directory-card-meta span {
    display: block;
    min-width: 0;
    overflow: hidden;
    padding: 7px 10px;
    border: 1px solid #dce7ef;
    border-radius: 8px;
    background: #f8fbfd;
    color: #5f768b;
    font-size: 0.69rem;
    font-weight: 700;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vehicle-directory-card-meta span:first-child {
    flex: 0 0 auto;
}

.vehicle-directory-card-meta span:last-child {
    flex: 1 1 auto;
}

.vehicle-directory-card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #e4ebf1;
}

.vehicle-directory-card-stat {
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid #e0e9f0;
    border-radius: 11px;
    background: #f8fbfd;
}

.vehicle-directory-card-stat span {
    display: block;
    margin-bottom: 5px;
    overflow: hidden;
    color: #7890a5;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.vehicle-directory-card-stat strong {
    display: block;
    overflow: hidden;
    color: #17324d;
    font-size: 0.96rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vehicle-directory-card .vehicle-directory-card-case-button,
.vehicle-directory-card .vehicle-directory-card-delete {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #d6e1ea;
    border-radius: 10px;
    background: #f8fbfd;
    color: #627b90;
    box-shadow: none;
}

.vehicle-directory-card .vehicle-directory-card-delete {
    border-color: #e1c3bd;
    color: #b33a2e;
}

.vehicle-directory-card .vehicle-directory-card-case-button:hover,
.vehicle-directory-card .vehicle-directory-card-delete:hover {
    border-color: #afc4d4;
    background: #eef4f8;
    color: #173b59;
    transform: none;
}

.vehicle-directory-card .vehicle-directory-card-delete:hover {
    border-color: #b91c1c;
    background: #fff;
    color: #b91c1c;
}

body[data-theme="dark"] .vehicle-directory-card {
    border-color: rgba(148, 163, 184, 0.2);
    border-top-color: #4b9bd1;
    background: #0d1b2a;
    box-shadow: 0 14px 28px rgba(2, 8, 20, 0.2);
}

body[data-theme="dark"] .vehicle-directory-card:hover {
    border-color: rgba(148, 163, 184, 0.32);
    border-top-color: #69b4e5;
    box-shadow: 0 18px 32px rgba(2, 8, 20, 0.28);
}

body[data-theme="dark"] .vehicle-directory-card-badge {
    background: rgba(60, 112, 153, 0.28);
    color: #c8e5f7;
}

body[data-theme="dark"] .vehicle-directory-card-plate {
    border-color: #47657b;
    border-left-color: #76b6d9;
    background: #13283b;
    box-shadow: inset 0 -2px 0 rgba(118, 182, 217, 0.1);
}

body[data-theme="dark"] .vehicle-directory-card-plate span,
body[data-theme="dark"] .vehicle-directory-card-copy strong,
body[data-theme="dark"] .vehicle-directory-card-stat strong {
    color: #edf6fc;
}

body[data-theme="dark"] .vehicle-directory-card-plate small,
body[data-theme="dark"] .vehicle-directory-card-copy p,
body[data-theme="dark"] .vehicle-directory-card-stat span {
    color: #93aec2;
}

body[data-theme="dark"] .vehicle-directory-card-photo,
body[data-theme="dark"] .vehicle-directory-card-meta span,
body[data-theme="dark"] .vehicle-directory-card-stat,
body[data-theme="dark"] .vehicle-directory-card .vehicle-directory-card-case-button,
body[data-theme="dark"] .vehicle-directory-card .vehicle-directory-card-delete {
    border-color: rgba(148, 163, 184, 0.2);
    background: #122438;
    color: #a9c0d2;
}

body[data-theme="dark"] .vehicle-directory-card .btn.icon-only.vehicle-directory-card-delete {
    border-color: rgba(216, 178, 170, 0.42);
    color: #f08b7e;
}

body[data-theme="dark"] .vehicle-directory-card-stats {
    border-top-color: rgba(148, 163, 184, 0.17);
}

body[data-theme="dark"] .vehicle-directory-card .vehicle-directory-card-case-button:hover,
body[data-theme="dark"] .vehicle-directory-card .vehicle-directory-card-delete:hover {
    border-color: rgba(148, 163, 184, 0.34);
    background: #1a334b;
    color: #eff8ff;
}

body[data-theme="dark"] .vehicle-directory-card .btn.icon-only.vehicle-directory-card-delete:hover {
    border-color: rgba(216, 178, 170, 0.58);
    background: #3b2525;
    color: #ffc6bc;
}

@media (max-width: 640px) {
    .vehicle-directory-card {
        min-height: 0;
    }

    .vehicle-directory-card-plate {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
    }

    .vehicle-directory-card-plate span {
        font-size: 1.2rem;
        letter-spacing: 0.08em;
    }

    .vehicle-directory-card-photo {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }

    .vehicle-directory-card .vehicle-directory-card-case-button,
    .vehicle-directory-card .vehicle-directory-card-delete {
        width: 44px;
        min-width: 44px;
        height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vehicle-directory-card {
        transition: none;
    }
}
