/* ===========================================
   VEHÍCULOS — lista + almacenes (estilo ox_inventory)
   =========================================== */

#vehicles-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vehicle-row {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.vehicle-row-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 14px 16px;
}

.vehicle-row-info {
    flex: 1 1 220px;
    min-width: 0;
}

.vehicle-row-info h5 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vehicle-row-meta {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary, #666);
}

.vehicle-row-storage-btns {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.veh-storage-toggle {
    min-width: 96px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.veh-storage-toggle.active {
    box-shadow: inset 0 0 0 2px rgba(252, 163, 17, 0.45);
}

.vehicle-row-manage {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.vehicle-row.vehicle-row-highlight {
    animation: vehicleRowHighlight 4s ease-out forwards;
    position: relative;
    z-index: 2;
}

@keyframes vehicleRowHighlight {
    0% {
        border-color: #ff9800;
        box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.55), 0 6px 24px rgba(255, 152, 0, 0.35);
        background: rgba(255, 152, 0, 0.12);
    }
    35% {
        border-color: #ffb74d;
        box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.4), 0 4px 16px rgba(255, 152, 0, 0.2);
        background: rgba(255, 152, 0, 0.06);
    }
    100% {
        border-color: var(--border-color, rgba(0, 0, 0, 0.08));
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        background: var(--card-bg, #fff);
    }
}

.dark-theme .vehicle-row.vehicle-row-highlight,
[data-theme="dark"] .vehicle-row.vehicle-row-highlight {
    animation-name: vehicleRowHighlightDark;
}

@keyframes vehicleRowHighlightDark {
    0% {
        border-color: #ff9800;
        box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.5), 0 6px 24px rgba(255, 152, 0, 0.25);
        background: rgba(255, 152, 0, 0.18);
    }
    35% {
        border-color: #ffb74d;
        box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.35), 0 4px 16px rgba(255, 152, 0, 0.15);
        background: rgba(255, 152, 0, 0.1);
    }
    100% {
        border-color: var(--border-color, rgba(255, 255, 255, 0.1));
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        background: var(--card-bg, #1e1e2e);
    }
}

.vehicle-storage-panel {
    display: none;
    border-top: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    background: var(--section-bg, rgba(0, 0, 0, 0.03));
    padding: 12px 16px 16px;
}

.vehicle-storage-panel.open {
    display: block;
}

.vehicle-storage-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.vehicle-storage-panel-header h6 {
    margin: 0;
    font-weight: 600;
}

.vehicle-storage-loading,
.vehicle-storage-empty {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-secondary, #888);
}

.vehicle-storage-loading i {
    animation: vehSpin 1s linear infinite;
    display: inline-block;
}

@keyframes vehSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Grid tipo ox_inventory */
.ox-slot-grid-wrap {
    border-radius: 8px;
    background: rgba(12, 14, 18, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px;
}

.ox-slot-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(72px, 1fr));
    gap: 4px;
    max-height: 340px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px;
}

.ox-slot {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    min-height: 72px;
    max-height: 88px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-sizing: border-box;
    overflow: hidden;
}

.ox-slot-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ox-slot-icon img {
    max-width: 44px;
    max-height: 44px;
    object-fit: contain;
    display: block;
}

.ox-slot-label {
    font-size: 9px;
    line-height: 1.15;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 2px;
}

.ox-slot-count {
    position: absolute;
    bottom: 3px;
    right: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1;
}

.ox-slot-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: rgba(0, 0, 0, 0.72);
    opacity: 0;
    transition: opacity 0.15s ease;
    border-radius: 3px;
}

.ox-slot:hover .ox-slot-actions {
    opacity: 1;
}

.ox-slot-actions .btn {
    min-width: 24px;
    padding: 2px 5px;
}

.vehicle-storage-add {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.vehicle-storage-add .row-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.vehicle-storage-add .veh-item-select-wrap {
    flex: 1 1 220px;
    min-width: 180px;
}

.vehicle-storage-add .veh-add-qty {
    width: 72px;
    flex-shrink: 0;
}

@media (max-width: 992px) {
    .ox-slot-grid {
        grid-template-columns: repeat(6, minmax(64px, 1fr));
    }
}

@media (max-width: 768px) {
    .vehicle-row-main {
        flex-direction: column;
        align-items: stretch;
    }

    .vehicle-row-storage-btns,
    .vehicle-row-manage {
        width: 100%;
        justify-content: flex-start;
    }

    .ox-slot-grid {
        grid-template-columns: repeat(4, minmax(64px, 1fr));
        max-height: 280px;
    }
}

/* Tema claro */
.vehicle-row {
    background: #fff;
}

.ox-slot-grid-wrap {
    background: #eef1f5;
    border-color: #d8dee6;
}

.ox-slot {
    background: #f8f9fb;
    border-color: #cfd6df;
}

.ox-slot-label {
    color: #444;
}

.ox-slot-count {
    color: #222;
    text-shadow: none;
}

/* Dark theme */
.dark-theme .vehicle-row,
[data-theme="dark"] .vehicle-row {
    background: var(--dark-bg-secondary, #0a101c);
    border-color: var(--dark-border, #1c2f52);
}

.dark-theme .vehicle-storage-panel,
[data-theme="dark"] .vehicle-storage-panel {
    background: var(--dark-bg-tertiary, #14213d);
    border-color: var(--dark-border, #1c2f52);
}

.dark-theme .vehicle-row-meta,
[data-theme="dark"] .vehicle-row-meta {
    color: #aaa;
}

.dark-theme .ox-slot-grid-wrap,
[data-theme="dark"] .ox-slot-grid-wrap {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.08);
}

.dark-theme .ox-slot,
[data-theme="dark"] .ox-slot {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .ox-slot-label,
[data-theme="dark"] .ox-slot-label {
    color: rgba(255, 255, 255, 0.75);
}
