.test-vehicle-internal-grid {
    display: grid;
    gap: 1rem;
}

.test-vehicle-internal-info .test-vehicle-kv dd {
    white-space: normal;
}

.test-vehicle-cost-card > .test-vehicle-card-header p {
    margin: 0.2rem 0 0;
    color: var(--text-secondary);
    font-size: 0.76rem;
}

.test-vehicle-cost-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 0.65rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.test-vehicle-cost-summary > div {
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    background: #f8fafc;
}

.test-vehicle-cost-summary span,
.test-vehicle-cost-summary strong,
.test-vehicle-cost-summary small {
    display: block;
}

.test-vehicle-cost-summary span,
.test-vehicle-cost-summary small {
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.test-vehicle-cost-summary strong {
    margin-top: 0.3rem;
    overflow-wrap: anywhere;
    font-size: 1.08rem;
}

.test-vehicle-cost-summary small {
    margin-top: 0.25rem;
}

.test-vehicle-cost-summary .is-total {
    border-color: #93c5fd;
    background: #eff6ff;
}

.test-vehicle-cost-summary .is-total strong {
    color: var(--primary);
}

.test-vehicle-cost-summary .is-positive {
    border-color: #86efac;
    background: #f0fdf4;
}

.test-vehicle-cost-summary .is-positive strong {
    color: #15803d;
}

.test-vehicle-cost-summary .is-negative {
    border-color: #fca5a5;
    background: #fef2f2;
}

.test-vehicle-cost-summary .is-negative strong {
    color: #b91c1c;
}

.test-vehicle-cost-summary .is-rental-income {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.test-vehicle-cost-summary .is-rental-income strong {
    color: #0f766e;
}

.test-vehicle-cost-form {
    display: grid;
    grid-template-columns: minmax(150px, 0.7fr) minmax(180px, 1.2fr) minmax(145px, 0.7fr) minmax(145px, 0.7fr) minmax(190px, 1fr);
    gap: 0.7rem;
    align-items: end;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.test-vehicle-cost-form .form-group {
    margin: 0;
}

.test-vehicle-cost-form small {
    display: block;
    margin-top: 0.2rem;
    color: var(--text-secondary);
    font-size: 0.68rem;
}

.test-vehicle-cost-form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.test-vehicle-cost-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.test-vehicle-cost-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.test-vehicle-cost-table th,
.test-vehicle-cost-table td {
    padding: 0.72rem 0.8rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.test-vehicle-cost-table th {
    color: var(--text-secondary);
    background: #f8fafc;
    font-size: 0.7rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.test-vehicle-cost-table tbody tr:last-child td {
    border-bottom: 0;
}

.test-vehicle-cost-amount {
    font-weight: 750;
    white-space: nowrap;
}

.test-vehicle-cost-actions {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
}

.test-vehicle-cost-actions .btn {
    min-height: 34px;
}

.test-vehicle-cost-muted {
    color: var(--text-secondary);
}

@media (max-width: 1180px) {
    .test-vehicle-cost-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .test-vehicle-cost-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .test-vehicle-cost-card > .test-vehicle-card-header {
        align-items: flex-start;
    }

    .test-vehicle-cost-form {
        grid-template-columns: 1fr;
    }

    .test-vehicle-cost-form-actions {
        grid-column: 1;
    }

    .test-vehicle-cost-table,
    .test-vehicle-cost-table tbody,
    .test-vehicle-cost-table tr,
    .test-vehicle-cost-table td {
        display: block;
        width: 100%;
    }

    .test-vehicle-cost-table thead {
        display: none;
    }

    .test-vehicle-cost-table tr {
        padding: 0.55rem 0.8rem;
        border-bottom: 1px solid var(--border);
    }

    .test-vehicle-cost-table td {
        display: grid;
        grid-template-columns: minmax(90px, 34%) minmax(0, 1fr);
        gap: 0.6rem;
        padding: 0.4rem 0;
        border: 0;
    }

    .test-vehicle-cost-table td::before {
        content: attr(data-label);
        color: var(--text-secondary);
        font-size: 0.72rem;
    }
}

@media (max-width: 430px) {
    .test-vehicle-cost-summary {
        grid-template-columns: 1fr;
    }
}

.test-vehicle-income-proposals {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: #fffbeb;
}
.test-vehicle-income-proposals h3 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.test-vehicle-income-proposals p,
.test-vehicle-income-proposal small { color: var(--text-secondary); font-size: 0.8rem; }
.test-vehicle-income-proposal {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
}
.test-vehicle-income-proposal > div:first-child { flex: 1 1 220px; min-width: 0; }
.test-vehicle-income-proposal small { display: block; margin-top: 0.25rem; }
.test-vehicle-income-calculator {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    min-width: 0;
}
.test-vehicle-income-calculator[hidden] { display: none; }
.test-vehicle-income-calculator small { grid-column: 1 / -1; }
.test-vehicle-income-calculator legend { font-size: 0.8rem; }
@media (max-width: 720px) {
    .test-vehicle-income-calculator { grid-template-columns: 1fr; }
    .test-vehicle-cost-card > .test-vehicle-card-header { flex-wrap: wrap; }
}

.rental-income-popup { width: min(500px, calc(100vw - 2rem)); }
.rental-income-calculation { padding: 0.8rem; background: #eff6ff; border-radius: 0.7rem; overflow-wrap: anywhere; }
.rental-income-popup .test-vehicle-income-calculator { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0.8rem; }
.rental-income-popup [data-income-error] { color: var(--danger, #b91c1c); }
@media (max-width: 480px) {
    .rental-income-popup .test-vehicle-income-calculator { grid-template-columns: 1fr; }
}
