.overview-vehicle-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) 280px;
    gap: 18px;
    align-items: stretch;
}

.overview-vehicle-info {
    min-width: 0;
}

.overview-photo-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overview-photo-panel {
    min-height: 180px;
    overflow: hidden;
    border-radius: 9px;
    background: #f3f4f6;
}

.overview-vehicle-photo {
    width: 100%;
    height: 100%;
    min-height: 180px;
    max-height: 220px;
    object-fit: cover;
    display: block;
}

.overview-photo-placeholder {
    display: flex;
    min-height: 180px;
    height: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px;
    text-align: center;
    color: #6b7280;
}

.overview-photo-placeholder span {
    font-size: 0.8rem;
}

.overview-photo-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.overview-events-card {
    margin-top: 16px;
}

.overview-events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.overview-events-header h3 {
    margin: 0;
}

.overview-events-header span {
    color: #6b7280;
    font-size: 0.8rem;
}

#overview-events-list {
    display: grid;
    gap: 7px;
}

.overview-event {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 10px 12px;
    border-left: 5px solid transparent;
    border-radius: 8px;
}

.overview-event-trip {
    border-left-color: #22c55e;
    background: #ecfdf5;
}

.overview-event-fuel {
    border-left-color: #3b82f6;
    background: #eff6ff;
}

.overview-event-service {
    border-left-color: #8b5e3c;
    background: #f5eee8;
}

.overview-event-main {
    display: grid;
    grid-template-columns:
        82px minmax(0, 1fr);
    gap: 2px 10px;
    align-items: center;
    min-width: 0;
}

.overview-event-type {
    grid-row: 1 / 3;
    font-size: 0.8rem;
    font-weight: 700;
}

.overview-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-event-detail {
    color: #6b7280;
    font-size: 0.82rem;
}

.overview-event-meta {
    display: flex;
    min-width: 110px;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.overview-event-meta span {
    color: #6b7280;
    font-size: 0.78rem;
}

@media (max-width: 700px) {
    .overview-vehicle-layout {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .overview-photo-panel,
    .overview-vehicle-photo,
    .overview-photo-placeholder {
        min-height: 140px;
        max-height: 180px;
    }

    .overview-photo-actions {
        justify-content: stretch;
    }

    .overview-photo-actions .small-button {
        flex: 1;
    }

    .overview-events-card {
        margin-top: 10px;
    }

    .overview-events-header {
        margin-bottom: 8px;
    }

    .overview-events-header span {
        display: none;
    }

    .overview-event {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 8px 9px;
    }

    .overview-event-main {
        grid-template-columns:
            68px minmax(0, 1fr);
    }

    .overview-event-meta {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* Oprava rozměru hlavní fotografie vozidla */
.overview-photo-column {
    align-self: start;
}

.overview-photo-panel {
    width: 100%;
    min-height: 0;
    aspect-ratio: 4 / 3;
}

.overview-vehicle-photo {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    object-fit: cover;
}

.overview-photo-placeholder {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: 4 / 3;
}

@media (max-width: 700px) {
    .overview-photo-panel,
    .overview-vehicle-photo,
    .overview-photo-placeholder {
        min-height: 0;
        max-height: none;
    }
}

/* Fotografie zachovává svůj skutečný poměr stran */
.overview-photo-panel {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
    overflow: hidden;
    background: transparent;
}

.overview-vehicle-photo {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    object-fit: initial;
}

.overview-photo-placeholder {
    width: 100%;
    height: auto;
    min-height: 180px;
    aspect-ratio: auto;
}

@media (max-width: 700px) {
    .overview-photo-panel,
    .overview-vehicle-photo {
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        aspect-ratio: auto;
    }
}

/* Skryté prvky fotografie opravdu nezobrazovat */
.overview-photo-placeholder[hidden],
.overview-vehicle-photo[hidden] {
    display: none !important;
}

/* Kompaktní ovládání fotografie */
.overview-photo-actions {
    gap: 5px;
}

.overview-photo-icon-button {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    background: white;
    color: #374151;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}

.overview-photo-icon-button:hover {
    background: #f3f4f6;
}

.overview-photo-icon-button.danger {
    border-color: #fecaca;
    color: #dc2626;
}

.overview-photo-icon-button.danger:hover {
    background: #fef2f2;
}


/* Fotka zachová skutečný poměr, ale nebude příliš vysoká */
.overview-photo-panel {
    display: flex;
    width: 100%;
    height: auto;
    align-items: flex-start;
    justify-content: flex-end;
    overflow: visible;
}

.overview-vehicle-photo {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 9px;
}

@media (max-width: 700px) {
    .overview-vehicle-photo {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 160px;
    }

    .overview-photo-actions {
        justify-content: flex-end;
    }

    .overview-photo-actions .overview-photo-icon-button {
        flex: 0 0 34px;
    }
}

/* Ovládání fotografie přímo přes obrázek */
.overview-photo-column {
    position: relative;
}

.overview-photo-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    display: flex;
    gap: 3px;
}

.overview-photo-icon-button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 70%);
    border-radius: 6px;
    background: rgb(255 255 255 / 72%);
    color: #374151;
    box-shadow: 0 1px 3px rgb(0 0 0 / 18%);
    font-size: 1rem;
    line-height: 1;
    backdrop-filter: blur(3px);
}

.overview-photo-icon-button:hover {
    background: rgb(255 255 255 / 95%);
}

.overview-photo-icon-button.danger {
    border-color: rgb(254 202 202 / 80%);
    background: rgb(255 255 255 / 72%);
    color: #dc2626;
}

.overview-photo-icon-button.danger:hover {
    background: rgb(254 242 242 / 95%);
}

@media (max-width: 700px) {
    .overview-photo-actions {
        top: 5px;
        right: 5px;
        gap: 3px;
    }

    .overview-photo-actions .overview-photo-icon-button {
        flex: 0 0 24px;
        width: 24px;
        height: 24px;
    }
}

/* =========================================================
   FINÁLNÍ ROZLOŽENÍ FOTOGRAFIE
   - celý pravý sloupec
   - bez ořezu
   - zachovaný poměr stran
   - centrování
   - bílé pozadí
   ========================================================= */

.overview-vehicle-layout {
    align-items: stretch;
}

.overview-photo-column {
    position: relative;
    align-self: stretch;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0;
}

.overview-photo-panel {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 9px;
    background: white;
    aspect-ratio: auto;
}

.overview-vehicle-photo {
    display: block;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 9px;
}

/* žádné šedé pozadí placeholderu */
.overview-photo-placeholder {
    width: 100%;
    height: 100%;
    min-height: 0;
    align-items: center;
    justify-content: center;
    background: white;
}

/* ovládání zůstává přes fotografii */
.overview-photo-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
}


/* Na mobilu nepoužívat výšku celé informační karty */
@media (max-width: 700px) {
    .overview-photo-column {
        align-self: auto;
        height: auto;
    }

    .overview-photo-panel {
        height: auto;
        min-height: 140px;
        max-height: 180px;
    }

    .overview-vehicle-photo {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 180px;
    }

    .overview-photo-placeholder {
        min-height: 140px;
        max-height: 180px;
    }
}

/* =========================================================
   FOTO NESMÍ MĚNIT VÝŠKU KARTY
   Výšku desktopové karty určuje pouze levá část.
   Fotografie se do pravé části pouze vejde.
   ========================================================= */

@media (min-width: 701px) {
    .overview-photo-column {
        position: relative;
        align-self: stretch;
        min-height: 0;
        height: auto;
        overflow: hidden;
        border-radius: 9px;
    }

    .overview-photo-panel {
        position: absolute;
        inset: 0;

        display: flex;
        width: auto;
        height: auto;
        min-height: 0;

        align-items: center;
        justify-content: center;

        overflow: hidden;
        background: white;
        border-radius: 9px;
    }

    .overview-vehicle-photo {
        display: block;

        width: auto;
        height: auto;

        max-width: 100%;
        max-height: 100%;

        object-fit: contain;
        object-position: center;

        border-radius: 9px;
    }

    .overview-photo-actions {
        position: absolute;
        top: 6px;
        right: 6px;
        z-index: 3;
    }
}

/* === OVERVIEW COLOR SYSTEM START === */
.overview-event {
    border-left-width: 5px;
    border-left-style: solid;
}

.overview-event-trip {
    border-left-color:
        var(--color-trip);

    background:
        var(--color-trip-soft);
}

.overview-event-fuel {
    border-left-color:
        var(--color-fuel);

    background:
        var(--color-fuel-soft);
}

.overview-event-service {
    border-left-color:
        var(--color-service);

    background:
        var(--color-service-soft);
}


.overview-event-type {
    display: inline-block;

    width: fit-content;

    padding: 2px 7px;

    border-radius: 999px;

    font-weight: 600;
}

.overview-event-trip
.overview-event-type {
    color:
        var(--color-trip-dark);

    background:
        var(--color-trip-border);
}

.overview-event-fuel
.overview-event-type {
    color:
        var(--color-fuel-dark);

    background:
        var(--color-fuel-border);
}

.overview-event-service
.overview-event-type {
    color:
        var(--color-service-dark);

    background:
        var(--color-service-border);
}
/* === OVERVIEW COLOR SYSTEM END === */


/* === OVERVIEW EXPENSE EVENTS START === */

.overview-event-expense {
    border-left-color: #0f766e;
    background: #f0fdfa;
}

.overview-event-expense
.overview-event-type {
    color: #115e59;
    background: #99f6e4;
}

/* === OVERVIEW EXPENSE EVENTS END === */


/* === NAV ACTIVE STRIP CONSISTENCY START === */

/* Přehled – stejný styl aktivní záložky jako Tankování */
.navigation .nav-button[data-section="overview"].active {
    background: #f3f4f6 !important;
    color: #111827 !important;
    border-radius: 10px !important;
    box-shadow: inset 0 -3px 0 #9ca3af !important;
}

/* Náklady */
.navigation .nav-button[data-section="expenses"].active {
    background: #f0fdfa !important;
    color: #115e59 !important;
    border-radius: 10px !important;
    box-shadow: inset 0 -3px 0 #0f766e !important;
}

/* Dokumenty */
.navigation .nav-button[data-section="documents"].active {
    background: #f8fafc !important;
    color: #475569 !important;
    border-radius: 10px !important;
    box-shadow: inset 0 -3px 0 #64748b !important;
}

/* === NAV ACTIVE STRIP CONSISTENCY END === */


